Previous 15994 Revisions Next

r11241 Tuesday 19th April, 2011 at 07:33:40 UTC by Miodrag Milanović
Sync with MAME (r12190) (no whatsnew)
[src/emu]audit.c cheat.c devimage.c devintrf.c devintrf.h devlegcy.c drawgfx.c drawgfx.h emupal.c inptport.c inptport.h input.c input.h machine.c machine.h memory.c memory.h render.c rendlay.c schedule.c schedule.h screen.c screen.h sound.c sound.h speaker.c state.c state.h tilemap.c tilemap.h timer.c uimenu.c uimenu.h video.c video.h
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/cosmac]cosmac.c
[src/emu/cpu/dsp16]dsp16.c
[src/emu/cpu/m6502]m4510.c m6502.c
[src/emu/cpu/mips]psx.c
[src/emu/cpu/tms32031]32031ops.c tms32031.c
[src/emu/cpu/upd7725]upd7725.c
[src/emu/debug]debugvw.c debugvw.h dvdisasm.c dvmemory.c dvstate.c
[src/emu/debugint]debugint.c
[src/emu/layout]ho4f893d.lay pinball.lay
[src/emu/machine]6522via.c 6526cia.c 6532riot.c 6840ptm.c 6850acia.c 74123.c 8237dma.c at28c16.c ds1302.c ds2401.c ds2404.c eeprom.c f3853.c i2cmem.c ins8154.c k033906.c k056230.c mb3773.c mc146818.c nvram.c timekpr.c x76f041.c x76f100.c z80dart.c z80dma.c z80sio.c z80sti.c
[src/emu/sound]asc.c bsmt2000.c cdp1869.c discrete.c ics2115.c okim6295.c okim9810.c spu.c
[src/emu/video]cdp1861.c cdp1862.c crt9007.c crt9021.c hd44102.c hd61830.c msm6255.c upd3301.c
[src/ldplayer]ldpdriv.c ldplayer.c ldplayer.mak
[src/mame]mame.lst tiny.lst
[src/mame/drivers]beathead.c cidelsa.c igs017.c itech32.c liberatr.c limenko.c model2.c
[src/mame/includes]vertigo.h
[src/mame/layout]18w.lay 280zzzap.lay aristmk4.lay armora.lay buckrog.lay buggybjr.lay buggyboy.lay buggychl.lay cbombers.lay changela.lay chqflag.lay contcirc.lay crusnexo.lay dblaxle.lay dlair.lay elecyoyo.lay finallap.lay gamball.lay geebee.lay gorf.lay grchamp.lay gridiron.lay lagunar.lay luckyrlt.lay maxaflex.lay namcofl.lay outrun.lay overdriv.lay pdrift.lay pirpok2.lay polepos.lay radr.lay re800.lay re900.lay roul.lay roundup5.lay spacwalk.lay sspeedr.lay stactics.lay stocker.lay subroc3d.lay superchs.lay tenpindx.lay topracer.lay topspeed.lay turbo.lay turbotag.lay tx1.lay videodad.lay wecleman.lay
[src/mame/machine]cd32.c cdicdic.c cdislave.c nmk004.c snessdd1.c zs01.c
[src/mame/video]atarimo.c avgdvg.c beathead.c cidelsa.c gaelco3d.c gp9001.c hyprduel.c liberatr.c metro.c n64.c n64.h rdpblend.c rdpblend.h rdpspn16.c rdpspn16.h vertigo.c
[src/mess/devices]kermit.c
[src/mess/drivers]4004clk.c a5105.c abc1600.c abc80.c abc80x.c ace.c adam.c argo.c bcs3.c beehive.c beta.c bigbord2.c bullet.c bw12.c bw2.c c10.c c80.c ccs2422.c cd2650.c cgc7900.c coleco.c compis.c comx35.c cosmicos.c crvision.c czk80.c d6800.c dim68k.c dolphin.c e01.c eacc.c elf.c et3400.c eti660.c exp85.c fidelz80.c fmtowns.c gmaster.c h19.c homez80.c huebler.c jtc.c k8915.c kyocera.c lc80.c m5.c mc10.c mc1000.c mccpm.c mekd2.c mes.c mikrolab.c mikromik.c mirage.c mpf1.c msbc1.c mycom.c nanos.c newbrain.c ngp.c ob68k1a.c osi.c pb1000.c pc1500.c pc2000.c pc4.c pc8001.c pc8401a.c pc9801.c pcfx.c pegasus.c pes.c phc25.c phunsy.c plan80.c poly880.c portfoli.c prestige.c pro80.c prof180x.c prof80.c psion.c ptcsol.c px8.c ql.c qtsbc.c rex6000.c savia84.c sg1000.c studio2.c sun1.c tandy2k.c tec1.c tek405x.c ti89.c tiki100.c tmc1800.c tmc2000e.c tmc600.c trs80m2.c tsispch.c univac.c v1050.c vg5k.c vidbrain.c vip.c vixen.c x07.c xerox820.c xor100.c zrt80.c
[src/mess/includes]gmaster.h
[src/mess/machine]64h156.c abc77.c abcbus.c advision.c c1551.c c1581.c comx35.c comxpl80.c cs4031.c fm_scsi.c gamepock.c genpc.c isa.c isa_hdc.c lux10828.c lux21046.c mb89352.c mpc105.c ncr5380.c osborne1.c psxcd.c psxcddrv.h sorcerer.c super80.c vic1112.c x1.c
[src/mess/video]abc1600.c abc80.c abc800.c abc802.c abc806.c advision.c atarist.c cgc7900.c comx35.c ef9345.c fmtowns.c ibm_vga.c isa_mda.c newbrain.c osi.c pc4.c tmc600.c upd7220.c v1050.c vidbrain.c zx8301.c
[src/osd/windows]debugwin.c input.c window.c window.h
[src/tools]src2html.c

src/mame/mame.lst
r11240r11241
11/******************************************************************************
22
33    mame.lst
4   
4
55    List of all enabled drivers in the system. This file is parsed by
66    makelist.exe, sorted, and output as C code describing the drivers.
77
r11240r11241
8686piranhao      // GL
8787nmouse         // (c) 1981 Amenip (Palcom Queen River)
8888nmouseb         // (c) 1981 Amenip Nova Games Ltd.
89mspacman      // (c) 1981 Midway    // made by General Computer
89mspacman      // (c) 1981 Midway   // made by General Computer
9090mspacmnf      // hack
9191mspacmat      // hack
9292woodpeck      // (c) 1981 Amenip (Palcom Queen River)
r11240r11241
728728liblrabl      // (c) 1983
729729toypop         // (c) 1986
730730// Z8000 games
731polepos         // (c) 1982
731polepos         // (c) 1982
732732poleposa      // 136014   (c) 1982 + Atari license
733733polepos1      // 136014   (c) 1982 Atari
734734topracer      // bootleg
r11240r11241
15441544andromed      // (c) 1979
15451545ipminvad      // M10 no copyright notice (Arcade TV Game List - P.67, Left, 26 from top)
15461546ipminvad1      // M10 incomplete dump
1547ptrmj         // M14 (c) 1979
1547ptrmj         // M14 (c) 1979
15481548skychut         // Irem [1980]
15491549spacbeam      // M15 no copyright notice
15501550greenber      // Irem
r11240r11241
16121612rtypej         // (c) 1987 (Japan)
16131613rtypejp         // (c) 1987 (Japan)
16141614rtypeu         // (c) 1987 + Nintendo USA license (US)
1615rtypeb         // bootleg
1615rtypeb         // bootleg
16161616bchopper      // (c) 1987
16171617mrheli         // (c) 1987 (Japan)
16181618nspirit         // (c) 1988
r11240r11241
17281728qbertqub      // GV-119 (c) 1983 Mylstar
17291729screwloo      // GV-123 (c) 1983 Mylstar - never released
17301730curvebal      // GV-134 (c) 1984 Mylstar
1731vidvince      // GV-??? (c) 1984 Mylstar - never released
1731vidvince      // GV-??? (c) 1984 Mylstar - never released
17321732wizwarz         // GV-??? (c) 1984 Mylstar - never released
17331733
17341734// Taito "Qix hardware" games
r11240r11241
23582358outzonec      // TP-O18 (c) 1990 Toaplan
23592359outzoned      // TP-O18 (c) 1990 Toaplan
23602360vimana         // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)
2361vimana1         // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)
2361vimana1         // TP-O19 (c) 1991 Toaplan (+ Tecmo license when set to Japan)
23622362vimanan         // TP-O19 (c) 1991 Toaplan (+ Nova Apparate GMBH & Co license)
23632363snowbros      // MIN16-02 (c) 1990 Toaplan + Romstar license
23642364snowbrosa      // MIN16-02 (c) 1990 Toaplan + Romstar license
r11240r11241
26072607
26082608// Capcom games
26092609// The following is a COMPLETE list of the Capcom games up to 1997, as shown on
2610// their web site. The list is sorted by production date.                     
2611// A comprehensive list of Capcom games with board info can be found here:     
2612// http://www.arcadeflyers.com/strider/capcom_list.html                       
2610// their web site. The list is sorted by production date.
2611// A comprehensive list of Capcom games with board info can be found here:
2612// http://www.arcadeflyers.com/strider/capcom_list.html
26132613vulgus         //  5/1984 (c) 1984
26142614vulgus2         //  5/1984 (c) 1984
26152615vulgusj         //  5/1984 (c) 1984
r11240r11241
41164116eswatbl         // BOOTLEG
41174117fpointbl      // (c) 1989 (Datsu bootleg)
41184118fpointbj      // (c) 1989 (Datsu bootleg, Japan)
4119goldnaxeb1      // BOOTLEG
4120goldnaxeb2      // BOOTLEG
4119goldnaxeb1      // BOOTLEG
4120goldnaxeb2      // BOOTLEG
41214121passht4b      // bootleg
41224122passshtb      // bootleg
41234123shinoblb      // (c) 1987 (but bootleg)
r11240r11241
43114311sonic         // 1993.09 Sonic the Hedgehog (Japan)
43124312sonicp         // 1993.?? Sonic the Hedgehog (proto, Japan)
43134313kokoroj2      // 1993.12 Soreike! Kokoroji 2 (Japan)
4314jpark         // 1994.?? Jurassic Park (World)
4314jpark         // 1994.?? Jurassic Park (World)
43154315            // 1994.?? Jurassic Park (US)
43164316            // 1994.02 Jurassic Park (Japan)
43174317dbzvrvs         // 1994.03 Dragon Ball Z V.R.V.S. (Japan)
r11240r11241
59125912bm2ndmix      // GX853 (c) 1998 (Japan)
59135913bm2ndmxa      // GX853 (c) 1998 (Japan)
59145914bm3rdmix      // GX853 (c) 1998 (Japan)
5915//bm3rdmxb       // GX853 (c) 1998 (Japan)
5915//bm3rdmxb     // GX853 (c) 1998 (Japan)
59165916bmcompmx      // GX858 (c) 1999 (Japan)
59175917hmcompmx      // GX858 (c) 1999
59185918bm4thmix      // GX847 (c) 1999 (Japan)
r11240r11241
59265926bm7thmix      // GXB07 (c) 2001 (Japan)
59275927bmfinal         // GXC01 (c) 2002 (Japan)
59285928
5929//popn1          // GX803 (c) 1998 (Japan)
5929//popn1        // GX803 (c) 1998 (Japan)
59305930popn2         // GX831 (c) 1998 (Japan)
5931//popn3          // GX980 (c) 1999 (Japan)
5932//popnstex       // GX970 (c) 1999 (Japan)
5931//popn3        // GX980 (c) 1999 (Japan)
5932//popnstex     // GX970 (c) 1999 (Japan)
59335933
59345934// Firebeat games
59355935ppp            // GQ977 (c) 2000
r11240r11241
60746074tourtabl      // 030170           1978/03 [6507]
60756075tourtab2      // 030170           1978/03 [6507]
60766076avalnche      // 030574           1978/04 [6502]
6077cascade         // bootleg                       
6077cascade         // bootleg
60786078firetrk         // 030926           1978/06 [6808]
60796079skydiver      // 009787           1978/06 [6800]
60806080// Smokey Joe   // 030926           1978/07 [6502]
r11240r11241
70177017ddungeone      // East Coast Coin Company (Melbourne)
70187018darktowr      // Game Room
70197019tstrike         // East Coast Coin Company (Melbourne)
7020tstrikea      // Game Room
7020tstrikea      // Game Room
70217021ctribe         // TA-0028 (c) 1990 (US)
70227022ctribe1         // TA-0028 (c) 1990 (US) - Set 1?
70237023ctribej         // TA-0028 (c) 1990 (Japan)
r11240r11241
93849384tcl            // (c) 1995 Uniwang
93859385othello         // (c) 1984 Success
93869386sothello      // (c) 1986 Success / Fujiwara
9387quake         // (c) 19?? Lazer-Tron / iD Software
9387quake         // (c) 19?? Lazer-Tron / iD Software
93889388majorpkr      // (c) 1994 PAL System.
93899389
93909390// Multi Amenity Cassette System
r11240r11241
1039510395
1039610396// Igrosoft Original sets
1039710397// Multifish
10398//mfish         // (c) 2002
10399//mfish_2       // (c) 2002
10400//mfish_4       // (c) 2002
10401//mfish_5       // (c) 2002
10402//mfish_7       // (c) 2002
10403//mfish_8       // (c) 2002
10404//mfish_9       // (c) 2002
10405//mfish_10       // (c) 2002
10406//mfish_13       // (c) 2002
10398//mfish       // (c) 2002
10399//mfish_2      // (c) 2002
10400//mfish_4      // (c) 2002
10401//mfish_5      // (c) 2002
10402//mfish_7      // (c) 2002
10403//mfish_8      // (c) 2002
10404//mfish_9      // (c) 2002
10405//mfish_10     // (c) 2002
10406//mfish_13     // (c) 2002
1040710407mfish_3         // (c) 2002
1040810408mfish_6         // (c) 2002
1040910409mfish_11      // (c) 2002
r11240r11241
1041110411mfish_13      // (c) 2002
1041210412
1041310413// Crazy Monkey
10414//crzmon        // (c) 2003
10415//crzmon_2       // (c) 2003
10416//crzmon_3       // (c) 2003
10417//crzmon_4       // (c) 2003
10418//crzmon_5       // (c) 2003
10419//crzmon_6       // (c) 2003
10414//crzmon      // (c) 2003
10415//crzmon_2     // (c) 2003
10416//crzmon_3     // (c) 2003
10417//crzmon_4     // (c) 2003
10418//crzmon_5     // (c) 2003
10419//crzmon_6     // (c) 2003
1042010420crzmon_5      // (c) 2003
1042110421crzmon_7      // (c) 2003
1042210422crzmon_8      // (c) 2003
1042310423crzmon_9      // (c) 2003
1042410424
1042510425// Fruit Cocktail
10426//fcockt        // (c) 2003
10427//fcockt_2       // (c) 2003
10426//fcockt      // (c) 2003
10427//fcockt_2     // (c) 2003
1042810428fcockt_3      // (c) 2003
10429//fcockt_4     // (c) 2003
10429//fcockt_4     // (c) 2003
1043010430fcockt_5      // (c) 2003
1043110431fcockt_6      // (c) 2003
1043210432fcockt_7      // (c) 2003
r11240r11241
1043710437fcockt_12      // (c) 2003
1043810438
1043910439// Lucky Haunter
10440//lhaunt        // (c) 2003
10440//lhaunt      // (c) 2003
1044110441lhaunt_2      // (c) 2003
10442//lhaunt_3       // (c) 2003
10442//lhaunt_3     // (c) 2003
1044310443lhaunt_4      // (c) 2003
1044410444lhaunt_5      // (c) 2003
1044510445lhaunt_6      // (c) 2003
r11240r11241
1044710447lhaunt_8      // (c) 2003
1044810448
1044910449// Rollfruit
10450//rollfr        // (c) 2003
10450//rollfr      // (c) 2003
1045110451rollfr_2      // (c) 2003
1045210452
1045310453// Garage
10454//garage        // (c) 2004
10455//garage_2       // (c) 2004
10456//garage_3       // (c) 2004
10454//garage      // (c) 2004
10455//garage_2     // (c) 2004
10456//garage_3     // (c) 2004
1045710457garage_4      // (c) 2004
1045810458garage_5      // (c) 2004
1045910459garage_6      // (c) 2004
1046010460garage_7      // (c) 2004
1046110461
1046210462// Rock Climber
10463//rclimb_2       // (c) 2004
10463//rclimb_2     // (c) 2004
1046410464rclimb         // (c) 2004
1046510465rclimb_3      // (c) 2004
1046610466rclimb_4      // (c) 2004
r11240r11241
1048010480island_2      // (c) 2005
1048110481
1048210482// Pirate
10483//pirate        // (c) 2005
10483//pirate      // (c) 2005
1048410484pirate_2      // (c) 2005
1048510485pirate_3      // (c) 2005
1048610486pirate_4      // (c) 2005
r11240r11241
1081910819bowarrow
1082010820eightbll
1082110821evelknie
10822freedom
10822freedom
1082310823matahari
1082410824nightrdr
1082510825nightr20
r11240r11241
1083110831*/
1083210832bullseye
1083310833blakpyra
10834bmx     
10835centaur
10834bmx
10835centaur
1083610836cosflash
1083710837cybrnaut
1083810838dollyptn
1083910839eballdlx
1084010840eballd14
10841elektra
10842embryon
10843fathom 
10844fbclass
10841elektra
10842embryon
10843fathom
10844fbclass
1084510845fball_ii
1084610846flashgdn
1084710847flashgdnf
r11240r11241
1085410854granslam4
1085510855hglbtrtr
1085610856hotdoggn
10857kosteel
10858kiss   
10857kosteel
10858kiss
1085910859lostwrlp
10860medusa 
10861m_mpac 
10862mystic 
10860medusa
10861m_mpac
10862mystic
1086310863myststar
10864newwave
10864newwave
1086510865ngndshkr
10866paragon
10867playboy
10866paragon
10867playboy
1086810868rapidfip
1086910869rollston
10870saturn2
10870saturn2
1087110871slbmania
1087210872skatebll
1087310873spacehaw
1087410874spaceinv
1087510875speakesy
1087610876speakesy4p
10877spectrm
10877spectrm
1087810878spectrm4
1087910879spyhuntr
1088010880startrep
10881sst   
10882smman   
10881sst
10882smman
1088310883tigerrag
10884vector 
10885viking 
10886voltan 
10887xsandos
10888xenon   
10889xenonf 
10884vector
10885viking
10886voltan
10887xsandos
10888xenon
10889xenonf
1089010890worlddef
1089110891darkshad
1089210892skflight
10893cobrap   
10893cobrap
1089410894futrquen
10895f1gpp   
10896toppin 
10897uboat65
10895f1gpp
10896toppin
10897uboat65
1089810898bbbowlin
1089910899monrobwl
1090010900mdntmrdr
r11240r11241
1090410904/*
1090510905   Bally Kiss 8035 prototype
1090610906*/
10907kissp   
10907kissp
1090810908
1090910909/*
1091010910   Bally MPU A084-91786-AH06 (6803)
r11240r11241
1093310933/*
1093410934   Bally MPU AS-2518-133
1093510935*/
10936babypac
10937granny 
10936babypac
10937granny
1093810938
1093910939// by68701.c
1094010940flashgdnp1
src/mame/machine/nmk004.c
r11240r11241
8888/* C1CA-C1CB */   UINT16 timer_duration;
8989};
9090
91static struct
91struct nmk004_state
9292{
93public:
9394   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
95   void set_machine(running_machine &machine) { m_machine = &machine; }
9496
9597   const UINT8 *rom;   // NMK004 data ROM
9698   UINT8 from_main;   // command from main CPU
9799   UINT8 to_main;      // answer to main CPU
98100   int protection_check;
99101
100   running_machine *m_machine;
101102   device_t *ymdevice;
102103   okim6295_device *oki1device;
103104   okim6295_device *oki2device;
r11240r11241
107108   /* C020-C19F */   struct fm_control fm_control[FM_CHANNELS];
108109   /* C220-C2DF */   struct psg_control psg_control[PSG_CHANNELS];
109110   /* C1A0-C21F */   struct effects_control effects_control[EFFECTS_CHANNELS];
110} NMK004_state;
111111
112private:
113   running_machine *m_machine;
114};
112115
116static nmk004_state NMK004_state;
117
118
113119#define SAMPLE_TABLE_0      0xefe0
114120#define SAMPLE_TABLE_1      0xefe2
115121#define FM_MODULATION_TABLE   0xefe4
r11240r11241
10221028
10231029   memset(&NMK004_state, 0, sizeof(NMK004_state));
10241030
1025   NMK004_state.m_machine = &machine;
1031   NMK004_state.set_machine(machine);
10261032   NMK004_state.ymdevice = machine.device("ymsnd");
10271033   NMK004_state.oki1device = machine.device<okim6295_device>("oki1");
10281034   NMK004_state.oki2device = machine.device<okim6295_device>("oki2");
src/mame/machine/snessdd1.c
r11240r11241
1010
1111static UINT8 sdd1_read(running_machine& machine, UINT32 addr);
1212
13typedef struct //Input Manager
13class SDD1_IM //Input Manager
1414{
15   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
15public:
16   SDD1_IM(running_machine &machine)
17      : m_machine(machine) { }
1618
17   running_machine* m_machine;
19   running_machine &machine() const { return m_machine; }
20
1821   UINT32 byte_ptr;
1922   UINT8 bit_count;
20} SDD1_IM;
2123
22static SDD1_IM* SDD1_IM_ctor(running_machine& machine)
23{
24   SDD1_IM* newclass = (SDD1_IM*)auto_alloc_array(machine, UINT8, sizeof(SDD1_IM));
25   newclass->m_machine = &machine;
26   return newclass;
27}
24private:
25   running_machine& m_machine;
26};
2827
2928static void SDD1_IM_prepareDecomp(SDD1_IM* thisptr, UINT32 in_buf)
3029{
r11240r11241
5554   return codeword;
5655}
5756
58typedef struct //Golomb-Code Decoder
57class SDD1_GCD //Golomb-Code Decoder
5958{
60   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
59public:
60   SDD1_GCD(running_machine &machine, SDD1_IM* associatedIM)
61      : IM(associatedIM),
62         m_machine(machine) { }
63     
64   running_machine &machine() const { return m_machine; }
6165
62   running_machine* m_machine;
6366   SDD1_IM* IM;
64} SDD1_GCD;
6567
66static SDD1_GCD* SDD1_GCD_ctor(running_machine& machine, SDD1_IM* associatedIM)
67{
68   SDD1_GCD* newclass = (SDD1_GCD*)auto_alloc_array(machine, UINT8, sizeof(SDD1_GCD));
69   newclass->m_machine = &machine;
70   newclass->IM = associatedIM;
71   return newclass;
72}
68private:
69   running_machine& m_machine;
70};
7371
7472static void SDD1_GCD_getRunCount(SDD1_GCD* thisptr, UINT8 code_num, UINT8* MPScount, UINT8* LPSind)
7573{
r11240r11241
122120   }
123121}
124122
125typedef struct // Bits Generator
123class SDD1_BG // Bits Generator
126124{
127   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
125public:
126   SDD1_BG(running_machine &machine, SDD1_GCD* associatedGCD, UINT8 code)
127      : code_num(code),
128        GCD(associatedGCD),
129        m_machine(machine) { }
128130
129   running_machine* m_machine;
131   running_machine &machine() const { return m_machine; }
132
130133   UINT8 code_num;
131134   UINT8 MPScount;
132135   UINT8 LPSind;
133136   SDD1_GCD* GCD;
134} SDD1_BG;
135137
136static SDD1_BG* SDD1_BG_ctor(running_machine& machine, SDD1_GCD* associatedGCD, UINT8 code)
137{
138   SDD1_BG* newclass = (SDD1_BG*)auto_alloc_array(machine, UINT8, sizeof(SDD1_BG));
139   newclass->m_machine = &machine;
140   newclass->code_num = code;
141   newclass->GCD = associatedGCD;
142   return newclass;
143}
138public:
139   running_machine& m_machine;
140} ;
144141
145142static void SDD1_BG_prepareDecomp(SDD1_BG* thisptr)
146143{
r11240r11241
231228   UINT8 MPS;
232229} SDD1_PEM_ContextInfo;
233230
234typedef struct //Probability Estimation Module
231class SDD1_PEM //Probability Estimation Module
235232{
236   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
237
238   running_machine* m_machine;
239   SDD1_PEM_ContextInfo contextInfo[32];
240   SDD1_BG* BG[8];
241} SDD1_PEM;
242
243static SDD1_PEM* SDD1_PEM_ctor(running_machine& machine,
233public:
234   SDD1_PEM(running_machine& machine,
244235                        SDD1_BG* associatedBG0, SDD1_BG* associatedBG1,
245236                        SDD1_BG* associatedBG2, SDD1_BG* associatedBG3,
246237                        SDD1_BG* associatedBG4, SDD1_BG* associatedBG5,
247238                        SDD1_BG* associatedBG6, SDD1_BG* associatedBG7)
248{
249   SDD1_PEM* newclass = (SDD1_PEM*)auto_alloc_array(machine, UINT8, sizeof(SDD1_PEM));
250   newclass->m_machine = &machine;
251   newclass->BG[0] = associatedBG0;
252   newclass->BG[1] = associatedBG1;
253   newclass->BG[2] = associatedBG2;
254   newclass->BG[3] = associatedBG3;
255   newclass->BG[4] = associatedBG4;
256   newclass->BG[5] = associatedBG5;
257   newclass->BG[6] = associatedBG6;
258   newclass->BG[7] = associatedBG7;
259   return newclass;
260}
239      : m_machine(machine)
240   {
241      BG[0] = associatedBG0;
242      BG[1] = associatedBG1;
243      BG[2] = associatedBG2;
244      BG[3] = associatedBG3;
245      BG[4] = associatedBG4;
246      BG[5] = associatedBG5;
247      BG[6] = associatedBG6;
248      BG[7] = associatedBG7;
249   }
250   
251   running_machine &machine() const { return m_machine; }
261252
253   SDD1_PEM_ContextInfo contextInfo[32];
254   SDD1_BG* BG[8];
255
256private:
257   running_machine& m_machine;
258} ;
259
262260static void SDD1_PEM_prepareDecomp(SDD1_PEM* thisptr)
263261{
264262   UINT8 i;
r11240r11241
300298   return bit ^ currentMPS;
301299}
302300
303typedef struct
301class SDD1_CM
304302{
305   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
303public:
304   SDD1_CM(running_machine& machine, SDD1_PEM* associatedPEM)
305      : PEM(associatedPEM),
306        m_machine(machine) { }
307   
308   running_machine &machine() const { return m_machine; }
306309
307   running_machine* m_machine;
308310   UINT8 bitplanesInfo;
309311   UINT8 contextBitsInfo;
310312   UINT8 bit_number;
311313   UINT8 currBitplane;
312314   UINT16 prevBitplaneBits[8];
313315   SDD1_PEM* PEM;
314} SDD1_CM;
315316
316static SDD1_CM* SDD1_CM_ctor(running_machine& machine, SDD1_PEM* associatedPEM)
317{
318   SDD1_CM* newclass = (SDD1_CM*)auto_alloc_array(machine, UINT8, sizeof(SDD1_CM));
319   newclass->m_machine = &machine;
320   newclass->PEM = associatedPEM;
321   return newclass;
322}
317private:
318   running_machine& m_machine;
319} ;
323320
324321static void SDD1_CM_prepareDecomp(SDD1_CM* thisptr, UINT32 first_byte)
325322{
r11240r11241
404401   return bit;
405402}
406403
407typedef struct
404class SDD1_OL
408405{
409   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
406public:
407   SDD1_OL(running_machine& machine, SDD1_CM* associatedCM)
408      : CM(associatedCM),
409        m_machine(machine) { }
410410
411   running_machine* m_machine;
411   running_machine &machine() const { return m_machine; }
412
412413   UINT8 bitplanesInfo;
413414   UINT16 length;
414415   UINT8* buffer;
415416   SDD1_CM* CM;
416} SDD1_OL;
417417
418static SDD1_OL* SDD1_OL_ctor(running_machine& machine, SDD1_CM* associatedCM)
419{
420   SDD1_OL* newclass = (SDD1_OL*)auto_alloc_array(machine, UINT8, sizeof(SDD1_OL));
421   newclass->m_machine = &machine;
422   newclass->CM = associatedCM;
423   return newclass;
424}
418private:
419   running_machine& m_machine;
420} ;
425421
426422static void SDD1_OL_prepareDecomp(SDD1_OL* thisptr, UINT32 first_byte, UINT16 out_len, UINT8 *out_buf)
427423{
r11240r11241
481477   }
482478}
483479
484typedef struct
480class SDD1emu
485481{
486   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
482public:
483   SDD1emu(running_machine &machine);
484   
485   running_machine &machine() const { return m_machine; }
487486
488   running_machine* m_machine;
489487   SDD1_IM* IM;
490488   SDD1_GCD* GCD;
491489   SDD1_BG* BG0;   SDD1_BG* BG1;   SDD1_BG* BG2;   SDD1_BG* BG3;
r11240r11241
493491   SDD1_PEM* PEM;
494492   SDD1_CM* CM;
495493   SDD1_OL* OL;
496} SDD1emu;
497494
498static SDD1emu* SDD1emu_ctor(running_machine &machine)
499{
500   SDD1emu* newclass = (SDD1emu*)auto_alloc_array(machine, UINT8, sizeof(SDD1emu));
501   newclass->m_machine = &machine;
495private:
496   running_machine& m_machine;
497};
502498
503   newclass->IM = SDD1_IM_ctor(machine);
504   newclass->GCD = SDD1_GCD_ctor(machine, newclass->IM);
505   newclass->BG0 = SDD1_BG_ctor(machine, newclass->GCD, 0);
506   newclass->BG1 = SDD1_BG_ctor(machine, newclass->GCD, 1);
507   newclass->BG2 = SDD1_BG_ctor(machine, newclass->GCD, 2);
508   newclass->BG3 = SDD1_BG_ctor(machine, newclass->GCD, 3);
509   newclass->BG4 = SDD1_BG_ctor(machine, newclass->GCD, 4);
510   newclass->BG5 = SDD1_BG_ctor(machine, newclass->GCD, 5);
511   newclass->BG6 = SDD1_BG_ctor(machine, newclass->GCD, 6);
512   newclass->BG7 = SDD1_BG_ctor(machine, newclass->GCD, 7);
513   newclass->PEM = SDD1_PEM_ctor(machine, newclass->BG0, newclass->BG1, newclass->BG2, newclass->BG3,
514                                 newclass->BG4, newclass->BG5, newclass->BG6, newclass->BG7);
515   newclass->CM = SDD1_CM_ctor(machine, newclass->PEM);
516   newclass->OL = SDD1_OL_ctor(machine, newclass->CM);
517   return newclass;
499SDD1emu::SDD1emu(running_machine &machine)
500   : m_machine(machine)
501{
502   IM = auto_alloc(machine, SDD1_IM(machine));
503   GCD = auto_alloc(machine, SDD1_GCD(machine, IM));
504   BG0 = auto_alloc(machine, SDD1_BG(machine, GCD, 0));
505   BG1 = auto_alloc(machine, SDD1_BG(machine, GCD, 1));
506   BG2 = auto_alloc(machine, SDD1_BG(machine, GCD, 2));
507   BG3 = auto_alloc(machine, SDD1_BG(machine, GCD, 3));
508   BG4 = auto_alloc(machine, SDD1_BG(machine, GCD, 4));
509   BG5 = auto_alloc(machine, SDD1_BG(machine, GCD, 5));
510   BG6 = auto_alloc(machine, SDD1_BG(machine, GCD, 6));
511   BG7 = auto_alloc(machine, SDD1_BG(machine, GCD, 7));
512   PEM = auto_alloc(machine, SDD1_PEM(machine, BG0, BG1, BG2, BG3,
513                                 BG4, BG5, BG6, BG7));
514   CM = auto_alloc(machine, SDD1_CM(machine, PEM));
515   OL = auto_alloc(machine, SDD1_OL(machine, CM));
518516}
519517
520518static void SDD1emu_decompress(SDD1emu* thisptr, UINT32 in_buf, UINT16 out_len, UINT8 *out_buf)
r11240r11241
577575      snes_sdd1.dma[i].size = 0;
578576   }
579577
580   snes_sdd1.sdd1emu = SDD1emu_ctor(machine);
578   snes_sdd1.sdd1emu = auto_alloc(machine, SDD1emu(machine));
581579
582580   snes_sdd1.buffer.data = (UINT8*)auto_alloc_array(machine, UINT8, 0x10000);
583581   snes_sdd1.buffer.ready = 0;
src/mame/machine/cdicdic.c
r11240r11241
448448{
449449   // Get XA format from sector header
450450
451    cdi_state *state = m_machine.driver_data<cdi_state>();
451    cdi_state *state = machine().driver_data<cdi_state>();
452452   const UINT8 *hdr = xa + 4;
453453    INT32 channels;
454454    INT32 bits = 4;
r11240r11241
460460      return;
461461   }
462462
463    verboselog(m_machine, 0, "decode_audio_sector, got header type %02x\n", hdr[2] );
463    verboselog(machine(), 0, "decode_audio_sector, got header type %02x\n", hdr[2] );
464464
465465   switch(hdr[2] & 0x3f)   // ignore emphasis and reserved bits
466466   {
r11240r11241
573573{
574574    if(m_decode_addr == 0xffff)
575575    {
576        verboselog(m_machine, 0, "Decode stop requested, stopping playback\n" );
576        verboselog(machine(), 0, "Decode stop requested, stopping playback\n" );
577577        m_audio_sample_timer->adjust(attotime::never);
578578        return;
579579    }
r11240r11241
581581    if(!m_decode_delay)
582582    {
583583        // Indicate that data has been decoded
584        verboselog(m_machine, 0, "Flagging that audio data has been decoded\n" );
584        verboselog(machine(), 0, "Flagging that audio data has been decoded\n" );
585585        m_audio_buffer |= 0x8000;
586586
587587        // Set the CDIC interrupt line
588        verboselog(m_machine, 0, "Setting CDIC interrupt line for soundmap decode\n" );
589        device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
590        cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
588        verboselog(machine(), 0, "Setting CDIC interrupt line for soundmap decode\n" );
589        device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128);
590        cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, ASSERT_LINE);
591591    }
592592    else
593593    {
r11240r11241
596596
597597    if(CDIC_IS_VALID_SAMPLE_BUF(m_ram, m_decode_addr & 0x3ffe))
598598    {
599        verboselog(m_machine, 0, "Hit audio_sample_trigger, with m_decode_addr == %04x, calling decode_audio_sector\n", m_decode_addr );
599        verboselog(machine(), 0, "Hit audio_sample_trigger, with m_decode_addr == %04x, calling decode_audio_sector\n", m_decode_addr );
600600
601601        // Decode the data at Z+4, the same offset as a normal CD sector.
602602        decode_audio_sector(((UINT8*)m_ram) + (m_decode_addr & 0x3ffe) + 4, 1);
r11240r11241
604604        // Swap buffer positions to indicate our new buffer position at the next read
605605        m_decode_addr ^= 0x1a00;
606606
607        verboselog(m_machine, 0, "Updated m_decode_addr, new value is %04x\n", m_decode_addr );
607        verboselog(machine(), 0, "Updated m_decode_addr, new value is %04x\n", m_decode_addr );
608608
609609        //// Delay for Frequency * (18*28*2*size in bytes) before requesting more data
610        verboselog(m_machine, 0, "Data is valid, setting up a new callback\n" );
610        verboselog(machine(), 0, "Data is valid, setting up a new callback\n" );
611611        m_decode_period = attotime::from_hz(CDIC_SAMPLE_BUF_FREQ(m_ram, m_decode_addr & 0x3ffe)) * (18*28*2*CDIC_SAMPLE_BUF_SIZE(m_ram, m_decode_addr & 0x3ffe));
612612        m_audio_sample_timer->adjust(m_decode_period);
613613        //dmadac_enable(&dmadac[0], 2, 0);
r11240r11241
617617        // Swap buffer positions to indicate our new buffer position at the next read
618618        m_decode_addr ^= 0x1a00;
619619
620        verboselog(m_machine, 0, "Data is not valid, indicating to shut down on the next audio sample\n" );
620        verboselog(machine(), 0, "Data is not valid, indicating to shut down on the next audio sample\n" );
621621        m_decode_addr = 0xffff;
622622        m_audio_sample_timer->adjust(m_decode_period);
623623    }
r11240r11241
686686         lba = nybbles[0] + nybbles[1]*10 + ((nybbles[2] + nybbles[3]*10)*75) + ((nybbles[4] + nybbles[5]*10)*75*60);
687687
688688            //printf( "Reading Mode %d sector from MSF location %06x\n", m_command - 0x28, m_time | 2 );
689            verboselog(m_machine, 0, "Reading Mode %d sector from MSF location %06x\n", m_command - 0x28, m_time | 2 );
689            verboselog(machine(), 0, "Reading Mode %d sector from MSF location %06x\n", m_command - 0x28, m_time | 2 );
690690
691691            cdrom_read_data(m_cd, lba, buffer, CD_TRACK_RAW_DONTCARE);
692692
r11240r11241
725725                if(((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_FORM | CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == (CDIC_SUBMODE_FORM | CDIC_SUBMODE_AUDIO)) &&
726726                   (m_channel & m_audio_channel & (1 << buffer[CDIC_SECTOR_CHAN2])))
727727                {
728                    verboselog(m_machine, 0, "Audio sector\n" );
728                    verboselog(machine(), 0, "Audio sector\n" );
729729
730730                    m_x_buffer |= 0x8000;
731731                    //m_data_buffer |= 0x4000;
r11240r11241
739739                    decode_audio_sector(((UINT8*)m_ram) + ((m_data_buffer & 5) * 0xa00 + 4), 0);
740740
741741                    //printf( "Setting CDIC interrupt line\n" );
742                    verboselog(m_machine, 0, "Setting CDIC interrupt line for audio sector\n" );
743                    device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
744                    cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
742                    verboselog(machine(), 0, "Setting CDIC interrupt line for audio sector\n" );
743                    device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128);
744                    cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, ASSERT_LINE);
745745                }
746746                else if((buffer[CDIC_SECTOR_SUBMODE2] & (CDIC_SUBMODE_DATA | CDIC_SUBMODE_AUDIO | CDIC_SUBMODE_VIDEO)) == 0x00)
747747                {
r11240r11241
758758                       (buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == CDIC_SUBMODE_EOF)
759759                    {
760760                        //printf( "Setting CDIC interrupt line\n" );
761                        verboselog(m_machine, 0, "Setting CDIC interrupt line for message sector\n" );
762                        device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
763                        cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
761                        verboselog(machine(), 0, "Setting CDIC interrupt line for message sector\n" );
762                        device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128);
763                        cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, ASSERT_LINE);
764764                    }
765765                    else
766766                    {
767                        verboselog(m_machine, 0, "Message sector, ignored\n" );
767                        verboselog(machine(), 0, "Message sector, ignored\n" );
768768                    }
769769                }
770770                else
r11240r11241
778778                    }
779779
780780                    //printf( "Setting CDIC interrupt line\n" );
781                    verboselog(m_machine, 0, "Setting CDIC interrupt line for data sector\n" );
782                    device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
783                    cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
781                    verboselog(machine(), 0, "Setting CDIC interrupt line for data sector\n" );
782                    device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128);
783                    cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, ASSERT_LINE);
784784                }
785785
786786                if((buffer[CDIC_SECTOR_SUBMODE2] & CDIC_SUBMODE_EOF) == 0 && m_command != 0x23)
r11240r11241
842842         if(!(msf & 0x0000ff))
843843         {
844844            next_lba = next_nybbles[0] + next_nybbles[1]*10 + ((next_nybbles[2] + next_nybbles[3]*10)*75) + ((next_nybbles[4] + next_nybbles[5]*10)*75*60);
845                verboselog(m_machine, 0, "Playing CDDA sector from MSF location %06x\n", m_time | 2 );
845                verboselog(machine(), 0, "Playing CDDA sector from MSF location %06x\n", m_time | 2 );
846846
847                cdda_start_audio(m_machine.device("cdda"), lba, rounded_next_msf);
847                cdda_start_audio(machine().device("cdda"), lba, rounded_next_msf);
848848         }
849849
850850            m_ram[(m_data_buffer & 5) * (0xa00/2) + 0x924/2] = 0x0001;                      //  CTRL
r11240r11241
873873                m_ram[(m_data_buffer & 5) * (0xa00/2) + (index - 6)] = (buffer[index*2] << 8) | buffer[index*2 + 1];
874874         }
875875
876            verboselog(m_machine, 0, "Setting CDIC interrupt line for CDDA sector\n" );
877            device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
878            cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
876            verboselog(machine(), 0, "Setting CDIC interrupt line for CDDA sector\n" );
877            device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128);
878            cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, ASSERT_LINE);
879879         break;
880880      }
881881      case 0x2c: // Seek
r11240r11241
924924
925925            m_time = next_msf << 8;
926926
927            verboselog(m_machine, 0, "Setting CDIC interrupt line for Seek sector\n" );
928            device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_4, 128);
929            cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
927            verboselog(machine(), 0, "Setting CDIC interrupt line for Seek sector\n" );
928            device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_4, 128);
929            cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, ASSERT_LINE);
930930         break;
931931      }
932932   }
r11240r11241
944944    switch(addr)
945945    {
946946        case 0x3c00/2: // Command register
947            verboselog(m_machine, 0, "cdic_r: Command Register = %04x & %04x\n", m_command, mem_mask);
947            verboselog(machine(), 0, "cdic_r: Command Register = %04x & %04x\n", m_command, mem_mask);
948948            return m_command;
949949
950950        case 0x3c02/2: // Time register (MSW)
951            verboselog(m_machine, 0, "cdic_r: Time Register (MSW) = %04x & %04x\n", m_time >> 16, mem_mask);
951            verboselog(machine(), 0, "cdic_r: Time Register (MSW) = %04x & %04x\n", m_time >> 16, mem_mask);
952952            return m_time >> 16;
953953
954954        case 0x3c04/2: // Time register (LSW)
955            verboselog(m_machine, 0, "cdic_r: Time Register (LSW) = %04x & %04x\n", (UINT16)(m_time & 0x0000ffff), mem_mask);
955            verboselog(machine(), 0, "cdic_r: Time Register (LSW) = %04x & %04x\n", (UINT16)(m_time & 0x0000ffff), mem_mask);
956956            return m_time & 0x0000ffff;
957957
958958        case 0x3c06/2: // File register
959            verboselog(m_machine, 0, "cdic_r: File Register = %04x & %04x\n", m_file, mem_mask);
959            verboselog(machine(), 0, "cdic_r: File Register = %04x & %04x\n", m_file, mem_mask);
960960            return m_file;
961961
962962        case 0x3c08/2: // Channel register (MSW)
963            verboselog(m_machine, 0, "cdic_r: Channel Register (MSW) = %04x & %04x\n", m_channel >> 16, mem_mask);
963            verboselog(machine(), 0, "cdic_r: Channel Register (MSW) = %04x & %04x\n", m_channel >> 16, mem_mask);
964964            return m_channel >> 16;
965965
966966        case 0x3c0a/2: // Channel register (LSW)
967            verboselog(m_machine, 0, "cdic_r: Channel Register (LSW) = %04x & %04x\n", m_channel & 0x0000ffff, mem_mask);
967            verboselog(machine(), 0, "cdic_r: Channel Register (LSW) = %04x & %04x\n", m_channel & 0x0000ffff, mem_mask);
968968            return m_channel & 0x0000ffff;
969969
970970        case 0x3c0c/2: // Audio Channel register
971            verboselog(m_machine, 0, "cdic_r: Audio Channel Register = %04x & %04x\n", m_audio_channel, mem_mask);
971            verboselog(machine(), 0, "cdic_r: Audio Channel Register = %04x & %04x\n", m_audio_channel, mem_mask);
972972            return m_audio_channel;
973973
974974        case 0x3ff4/2: // ABUF
r11240r11241
977977            m_audio_buffer &= 0x7fff;
978978            if(!((m_audio_buffer | m_x_buffer) & 0x8000))
979979            {
980                cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, CLEAR_LINE);
981                verboselog(m_machine, 0, "Clearing CDIC interrupt line\n" );
980                cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, CLEAR_LINE);
981                verboselog(machine(), 0, "Clearing CDIC interrupt line\n" );
982982                ////printf("Clearing CDIC interrupt line\n" );
983983            }
984            verboselog(m_machine, 0, "cdic_r: Audio Buffer Register = %04x & %04x\n", temp, mem_mask);
984            verboselog(machine(), 0, "cdic_r: Audio Buffer Register = %04x & %04x\n", temp, mem_mask);
985985            return temp;
986986        }
987987
r11240r11241
991991            m_x_buffer &= 0x7fff;
992992            if(!((m_audio_buffer | m_x_buffer) & 0x8000))
993993            {
994                cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_4, CLEAR_LINE);
995                verboselog(m_machine, 0, "Clearing CDIC interrupt line\n" );
994                cputag_set_input_line(machine(), "maincpu", M68K_IRQ_4, CLEAR_LINE);
995                verboselog(machine(), 0, "Clearing CDIC interrupt line\n" );
996996                ////printf("Clearing CDIC interrupt line\n" );
997997            }
998            verboselog(m_machine, 0, "cdic_r: X-Buffer Register = %04x & %04x\n", temp, mem_mask);
998            verboselog(machine(), 0, "cdic_r: X-Buffer Register = %04x & %04x\n", temp, mem_mask);
999999            return temp;
10001000        }
10011001
r11240r11241
10051005            {
10061006                m_z_buffer ^= 0x0001;
10071007            }
1008            verboselog(m_machine, 0, "cdic_r: Z-Buffer Register = %04x & %04x\n", m_z_buffer, mem_mask);
1008            verboselog(machine(), 0, "cdic_r: Z-Buffer Register = %04x & %04x\n", m_z_buffer, mem_mask);
10091009            return m_z_buffer;
10101010        }
10111011
10121012        case 0x3ffe/2:
10131013        {
1014            verboselog(m_machine, 0, "cdic_r: Data buffer Register = %04x & %04x\n", m_data_buffer, mem_mask);
1014            verboselog(machine(), 0, "cdic_r: Data buffer Register = %04x & %04x\n", m_data_buffer, mem_mask);
10151015            return m_data_buffer;
10161016        }
10171017        default:
1018            verboselog(m_machine, 0, "cdic_r: UNIMPLEMENTED: Unknown address: %04x & %04x\n", addr*2, mem_mask);
1018            verboselog(machine(), 0, "cdic_r: UNIMPLEMENTED: Unknown address: %04x & %04x\n", addr*2, mem_mask);
10191019            return 0;
10201020    }
10211021}
r11240r11241
10271027
10281028void cdicdic_device::register_write(const UINT32 offset, const UINT16 data, const UINT16 mem_mask)
10291029{
1030    cdi_state *state = m_machine.driver_data<cdi_state>();
1030    cdi_state *state = machine().driver_data<cdi_state>();
10311031
10321032   UINT32 addr = offset + 0x3c00/2;
10331033
10341034   switch(addr)
10351035   {
10361036      case 0x3c00/2: // Command register
1037            verboselog(m_machine, 0, "cdic_w: Command Register = %04x & %04x\n", data, mem_mask);
1037            verboselog(machine(), 0, "cdic_w: Command Register = %04x & %04x\n", data, mem_mask);
10381038            COMBINE_DATA(&m_command);
10391039         break;
10401040
10411041      case 0x3c02/2: // Time register (MSW)
10421042            m_time &= ~(mem_mask << 16);
10431043            m_time |= (data & mem_mask) << 16;
1044            verboselog(m_machine, 0, "cdic_w: Time Register (MSW) = %04x & %04x\n", data, mem_mask);
1044            verboselog(machine(), 0, "cdic_w: Time Register (MSW) = %04x & %04x\n", data, mem_mask);
10451045         break;
10461046
10471047      case 0x3c04/2: // Time register (LSW)
10481048            m_time &= ~mem_mask;
10491049            m_time |= data & mem_mask;
1050            verboselog(m_machine, 0, "cdic_w: Time Register (LSW) = %04x & %04x\n", data, mem_mask);
1050            verboselog(machine(), 0, "cdic_w: Time Register (LSW) = %04x & %04x\n", data, mem_mask);
10511051         break;
10521052
10531053      case 0x3c06/2: // File register
1054            verboselog(m_machine, 0, "cdic_w: File Register = %04x & %04x\n", data, mem_mask);
1054            verboselog(machine(), 0, "cdic_w: File Register = %04x & %04x\n", data, mem_mask);
10551055            COMBINE_DATA(&m_file);
10561056         break;
10571057
10581058      case 0x3c08/2: // Channel register (MSW)
10591059            m_channel &= ~(mem_mask << 16);
10601060            m_channel |= (data & mem_mask) << 16;
1061            verboselog(m_machine, 0, "cdic_w: Channel Register (MSW) = %04x & %04x\n", data, mem_mask);
1061            verboselog(machine(), 0, "cdic_w: Channel Register (MSW) = %04x & %04x\n", data, mem_mask);
10621062         break;
10631063
10641064      case 0x3c0a/2: // Channel register (LSW)
10651065            m_channel &= ~mem_mask;
10661066            m_channel |= data & mem_mask;
1067            verboselog(m_machine, 0, "cdic_w: Channel Register (LSW) = %04x & %04x\n", data, mem_mask);
1067            verboselog(machine(), 0, "cdic_w: Channel Register (LSW) = %04x & %04x\n", data, mem_mask);
10681068         break;
10691069
10701070      case 0x3c0c/2: // Audio Channel register
1071            verboselog(m_machine, 0, "cdic_w: Audio Channel Register = %04x & %04x\n", data, mem_mask);
1071            verboselog(machine(), 0, "cdic_w: Audio Channel Register = %04x & %04x\n", data, mem_mask);
10721072            COMBINE_DATA(&m_audio_channel);
10731073         break;
10741074
10751075      case 0x3ff4/2:
1076            verboselog(m_machine, 0, "cdic_w: Audio Buffer Register = %04x & %04x\n", data, mem_mask);
1076            verboselog(machine(), 0, "cdic_w: Audio Buffer Register = %04x & %04x\n", data, mem_mask);
10771077            COMBINE_DATA(&m_audio_buffer);
10781078         break;
10791079
10801080      case 0x3ff6/2:
1081            verboselog(m_machine, 0, "cdic_w: X Buffer Register = %04x & %04x\n", data, mem_mask);
1081            verboselog(machine(), 0, "cdic_w: X Buffer Register = %04x & %04x\n", data, mem_mask);
10821082            COMBINE_DATA(&m_x_buffer);
10831083         break;
10841084
r11240r11241
10901090         UINT32 index = 0;
10911091         UINT32 device_index = (data & 0x3fff) >> 1;
10921092         UINT16 *memory = state->m_planea;
1093            verboselog(m_machine, 0, "memory address counter: %08x\n", scc68070->dma.channel[0].memory_address_counter);
1094            verboselog(m_machine, 0, "cdic_w: DMA Control Register = %04x & %04x\n", data, mem_mask);
1095            verboselog(m_machine, 0, "Doing copy, transferring %04x bytes\n", count * 2 );
1093            verboselog(machine(), 0, "memory address counter: %08x\n", scc68070->dma.channel[0].memory_address_counter);
1094            verboselog(machine(), 0, "cdic_w: DMA Control Register = %04x & %04x\n", data, mem_mask);
1095            verboselog(machine(), 0, "Doing copy, transferring %04x bytes\n", count * 2 );
10961096         ////printf("Doing copy, transferring %04x bytes\n", count * 2 );
10971097         if((start & 0x00f00000) == 0x00200000)
10981098         {
r11240r11241
11161116
11171117      case 0x3ffa/2:
11181118      {
1119            verboselog(m_machine, 0, "cdic_w: Z-Buffer Register = %04x & %04x\n", data, mem_mask);
1119            verboselog(machine(), 0, "cdic_w: Z-Buffer Register = %04x & %04x\n", data, mem_mask);
11201120            COMBINE_DATA(&m_z_buffer);
11211121            if(m_z_buffer & 0x2000)
11221122         {
r11240r11241
11361136         break;
11371137      }
11381138      case 0x3ffc/2:
1139            verboselog(m_machine, 0, "cdic_w: Interrupt Vector Register = %04x & %04x\n", data, mem_mask);
1139            verboselog(machine(), 0, "cdic_w: Interrupt Vector Register = %04x & %04x\n", data, mem_mask);
11401140            COMBINE_DATA(&m_interrupt_vector);
11411141         break;
11421142      case 0x3ffe/2:
11431143      {
1144            verboselog(m_machine, 0, "cdic_w: Data Buffer Register = %04x & %04x\n", data, mem_mask);
1144            verboselog(machine(), 0, "cdic_w: Data Buffer Register = %04x & %04x\n", data, mem_mask);
11451145            COMBINE_DATA(&m_data_buffer);
11461146            if(m_data_buffer & 0x8000)
11471147         {
r11240r11241
11561156                  break;
11571157               }
11581158               case 0x2b: // Stop CDDA
1159                  cdda_stop_audio(m_machine.device("cdda"));
1159                  cdda_stop_audio(machine().device("cdda"));
11601160                        m_interrupt_timer->adjust(attotime::never);
11611161                  break;
11621162               case 0x23: // Reset Mode 1
r11240r11241
11801180                  break;
11811181               }
11821182               default:
1183                        verboselog(m_machine, 0, "Unknown CDIC command: %02x\n", m_command );
1183                        verboselog(machine(), 0, "Unknown CDIC command: %02x\n", m_command );
11841184                  break;
11851185            }
11861186         }
r11240r11241
11881188         break;
11891189      }
11901190      default:
1191            verboselog(m_machine, 0, "cdic_w: UNIMPLEMENTED: Unknown address: %04x = %04x & %04x\n", addr*2, data, mem_mask);
1191            verboselog(machine(), 0, "cdic_w: UNIMPLEMENTED: Unknown address: %04x = %04x & %04x\n", addr*2, data, mem_mask);
11921192         break;
11931193   }
11941194}
r11240r11241
12161216{
12171217    register_globals();
12181218
1219    m_interrupt_timer = m_machine.scheduler().timer_alloc(FUNC(trigger_readback_int));
1219    m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(trigger_readback_int));
12201220    m_interrupt_timer->adjust(attotime::never);
12211221
1222    m_audio_sample_timer = m_machine.scheduler().timer_alloc(FUNC(audio_sample_trigger));
1222    m_audio_sample_timer = machine().scheduler().timer_alloc(FUNC(audio_sample_trigger));
12231223    m_audio_sample_timer->adjust(attotime::never);
12241224
1225    m_ram = auto_alloc_array(m_machine, UINT16, 0x3c00/2);
1225    m_ram = auto_alloc_array(machine(), UINT16, 0x3c00/2);
12261226}
12271227
12281228//-------------------------------------------------
r11240r11241
12331233{
12341234    init();
12351235
1236   device_t *cdrom_dev = m_machine.device("cdrom");
1236   device_t *cdrom_dev = machine().device("cdrom");
12371237   if( cdrom_dev )
12381238   {
12391239      // MESS case (has CDROM device)
12401240      m_cd = cd_get_cdrom_file(cdrom_dev);
1241      cdda_set_cdrom(m_machine.device("cdda"), m_cd);
1241      cdda_set_cdrom(machine().device("cdda"), m_cd);
12421242   }
12431243   else
12441244   {
12451245      // MAME case
1246      m_cd = cdrom_open(get_disk_handle(m_machine, "cdrom"));
1247      cdda_set_cdrom(m_machine.device("cdda"), m_cd);
1246      m_cd = cdrom_open(get_disk_handle(machine(), "cdrom"));
1247      cdda_set_cdrom(machine().device("cdda"), m_cd);
12481248   }
12491249}
12501250
r11240r11241
12941294
12951295void cdicdic_device::ram_write(const UINT32 offset, const UINT16 data, const UINT16 mem_mask)
12961296{
1297    verboselog(m_machine, 5, "cdic_ram_w: %08x = %04x & %04x\n", 0x00300000 + offset*2, data, mem_mask);
1297    verboselog(machine(), 5, "cdic_ram_w: %08x = %04x & %04x\n", 0x00300000 + offset*2, data, mem_mask);
12981298    COMBINE_DATA(&m_ram[offset]);
12991299}
13001300
r11240r11241
13051305
13061306UINT16 cdicdic_device::ram_read(const UINT32 offset, const UINT16 mem_mask)
13071307{
1308    verboselog(m_machine, 5, "cdic_ram_r: %08x = %04x & %04x\n", 0x00300000 + offset * 2, m_ram[offset], mem_mask);
1308    verboselog(machine(), 5, "cdic_ram_r: %08x = %04x & %04x\n", 0x00300000 + offset * 2, m_ram[offset], mem_mask);
13091309    return m_ram[offset];
13101310}
13111311
src/mame/machine/cdislave.c
r11240r11241
9090
9191void cdislave_device::readback_trigger()
9292{
93    verboselog(m_machine, 0, "Asserting IRQ2\n" );
94    device_set_input_line_vector(m_machine.device("maincpu"), M68K_IRQ_2, 26);
95    cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_2, ASSERT_LINE);
93    verboselog(machine(), 0, "Asserting IRQ2\n" );
94    device_set_input_line_vector(machine().device("maincpu"), M68K_IRQ_2, 26);
95    cputag_set_input_line(machine(), "maincpu", M68K_IRQ_2, ASSERT_LINE);
9696    m_interrupt_timer->adjust(attotime::never);
9797}
9898
r11240r11241
111111
112112void cdislave_device::perform_mouse_update()
113113{
114    UINT16 x = input_port_read(m_machine, "MOUSEX");
115    UINT16 y = input_port_read(m_machine, "MOUSEY");
116    UINT8 buttons = input_port_read(m_machine, "MOUSEBTN");
114    UINT16 x = input_port_read(machine(), "MOUSEX");
115    UINT16 y = input_port_read(machine(), "MOUSEY");
116    UINT8 buttons = input_port_read(machine(), "MOUSEBTN");
117117
118118    UINT16 old_mouse_x = m_real_mouse_x;
119119    UINT16 old_mouse_y = m_real_mouse_y;
r11240r11241
165165    if(m_channel[offset].m_out_count)
166166    {
167167        UINT8 ret = m_channel[offset].m_out_buf[m_channel[offset].m_out_index];
168        verboselog(m_machine, 0, "slave_r: Channel %d: %d, %02x\n", offset, m_channel[offset].m_out_index, ret );
168        verboselog(machine(), 0, "slave_r: Channel %d: %d, %02x\n", offset, m_channel[offset].m_out_index, ret );
169169        if(m_channel[offset].m_out_index == 0)
170170        {
171171            switch(m_channel[offset].m_out_cmd)
r11240r11241
176176                case 0xf3:
177177                case 0xf4:
178178                case 0xf7:
179                    verboselog(m_machine, 0, "slave_r: De-asserting IRQ2\n" );
180                    cputag_set_input_line(m_machine, "maincpu", M68K_IRQ_2, CLEAR_LINE);
179                    verboselog(machine(), 0, "slave_r: De-asserting IRQ2\n" );
180                    cputag_set_input_line(machine(), "maincpu", M68K_IRQ_2, CLEAR_LINE);
181181                    break;
182182            }
183183        }
r11240r11241
191191        }
192192        return ret;
193193    }
194    verboselog(m_machine, 0, "slave_r: Channel %d: %d\n", offset, m_channel[offset].m_out_index );
194    verboselog(machine(), 0, "slave_r: Channel %d: %d\n", offset, m_channel[offset].m_out_index );
195195    return 0xff;
196196}
197197
r11240r11241
220220
221221void cdislave_device::register_write(const UINT32 offset, const UINT16 data, const UINT16 mem_mask)
222222{
223    cdi_state *state = m_machine.driver_data<cdi_state>();
223    cdi_state *state = machine().driver_data<cdi_state>();
224224
225225    switch(offset)
226226    {
227227        case 0:
228228            if(m_in_index)
229229            {
230                verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
230                verboselog(machine(), 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
231231                m_in_buf[m_in_index] = data & 0x00ff;
232232                m_in_index++;
233233                if(m_in_index == m_in_count)
r11240r11241
264264                    case 0xe8: case 0xe9: case 0xea: case 0xeb: case 0xec: case 0xed: case 0xee: case 0xef:
265265                    case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7:
266266                    case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff:
267                        verboselog(m_machine, 0, "slave_w: Channel %d: Update Mouse Position (0x%02x)\n", offset, data & 0x00ff );
267                        verboselog(machine(), 0, "slave_w: Channel %d: Update Mouse Position (0x%02x)\n", offset, data & 0x00ff );
268268                        m_in_count = 3;
269269                        break;
270270                    default:
271                        verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
271                        verboselog(machine(), 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
272272                        m_in_index = 0;
273273                        break;
274274                }
r11240r11241
277277        case 1:
278278            if(m_in_index)
279279            {
280                verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
280                verboselog(machine(), 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
281281                m_in_buf[m_in_index] = data & 0x00ff;
282282                m_in_index++;
283283                if(m_in_index == m_in_count)
r11240r11241
303303                switch(data & 0x00ff)
304304                {
305305                    default:
306                        verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
306                        verboselog(machine(), 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
307307                        memset(m_in_buf, 0, 17);
308308                        m_in_index = 0;
309309                        m_in_count = 0;
r11240r11241
314314        case 2:
315315            if(m_in_index)
316316            {
317                verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
317                verboselog(machine(), 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
318318                m_in_buf[m_in_index] = data & 0x00ff;
319319                m_in_index++;
320320                if(m_in_index == m_in_count)
r11240r11241
340340                switch(data & 0x00ff)
341341                {
342342                    case 0x82: // Mute Audio
343                        verboselog(m_machine, 0, "slave_w: Channel %d: Mute Audio (0x82)\n", offset );
343                        verboselog(machine(), 0, "slave_w: Channel %d: Mute Audio (0x82)\n", offset );
344344                        dmadac_enable(&state->m_dmadac[0], 2, 0);
345345                        m_in_index = 0;
346346                        m_in_count = 0;
347347                        //cdic->audio_sample_timer->adjust(attotime::never);
348348                        break;
349349                    case 0x83: // Unmute Audio
350                        verboselog(m_machine, 0, "slave_w: Channel %d: Unmute Audio (0x83)\n", offset );
350                        verboselog(machine(), 0, "slave_w: Channel %d: Unmute Audio (0x83)\n", offset );
351351                        dmadac_enable(&state->m_dmadac[0], 2, 1);
352352                        m_in_index = 0;
353353                        m_in_count = 0;
354354                        break;
355355                    case 0xf0: // Set Front Panel LCD
356                        verboselog(m_machine, 0, "slave_w: Channel %d: Set Front Panel LCD (0xf0)\n", offset );
356                        verboselog(machine(), 0, "slave_w: Channel %d: Set Front Panel LCD (0xf0)\n", offset );
357357                        m_in_count = 17;
358358                        break;
359359                    default:
360                        verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
360                        verboselog(machine(), 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
361361                        memset(m_in_buf, 0, 17);
362362                        m_in_index = 0;
363363                        m_in_count = 0;
r11240r11241
368368        case 3:
369369            if(m_in_index)
370370            {
371                verboselog(m_machine, 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
371                verboselog(machine(), 0, "slave_w: Channel %d: %d = %02x\n", offset, m_in_index, data & 0x00ff );
372372                m_in_buf[m_in_index] = data & 0x00ff;
373373                m_in_index++;
374374                if(m_in_index == m_in_count)
r11240r11241
402402                switch(data & 0x00ff)
403403                {
404404                    case 0xb0: // Request Disc Status
405                        verboselog(m_machine, 0, "slave_w: Channel %d: Request Disc Status (0xb0)\n", offset );
405                        verboselog(machine(), 0, "slave_w: Channel %d: Request Disc Status (0xb0)\n", offset );
406406                        m_in_count = 4;
407407                        break;
408408                    case 0xb1: // Request Disc Base
409                        verboselog(m_machine, 0, "slave_w: Channel %d: Request Disc Base (0xb1)\n", offset );
409                        verboselog(machine(), 0, "slave_w: Channel %d: Request Disc Base (0xb1)\n", offset );
410410                        m_in_count = 4;
411411                        break;
412412                    case 0xf0: // Request SLAVE Revision
413                        verboselog(m_machine, 0, "slave_w: Channel %d: Request SLAVE Revision (0xf0)\n", offset );
413                        verboselog(machine(), 0, "slave_w: Channel %d: Request SLAVE Revision (0xf0)\n", offset );
414414                        prepare_readback(attotime::from_hz(10000), 2, 2, 0xf0, 0x32, 0x31, 0, 0xf0);
415415                        m_in_index = 0;
416416                        break;
417417                    case 0xf3: // Request Pointer Type
418                        verboselog(m_machine, 0, "slave_w: Channel %d: Request Pointer Type (0xf3)\n", offset );
418                        verboselog(machine(), 0, "slave_w: Channel %d: Request Pointer Type (0xf3)\n", offset );
419419                        m_in_index = 0;
420420                        prepare_readback(attotime::from_hz(10000), 2, 2, 0xf3, 1, 0, 0, 0xf3);
421421                        break;
422422                    case 0xf4: // Request Test Plug Status
423                        verboselog(m_machine, 0, "slave_w: Channel %d: Request Test Plug Status (0xf4)\n", offset );
423                        verboselog(machine(), 0, "slave_w: Channel %d: Request Test Plug Status (0xf4)\n", offset );
424424                        m_in_index = 0;
425425                        prepare_readback(attotime::from_hz(10000), 2, 2, 0xf4, 0, 0, 0, 0xf4);
426426                        break;
427427                    case 0xf6: // Request NTSC/PAL Status
428                        verboselog(m_machine, 0, "slave_w: Channel %d: Request NTSC/PAL Status (0xf6)\n", offset );
428                        verboselog(machine(), 0, "slave_w: Channel %d: Request NTSC/PAL Status (0xf6)\n", offset );
429429                        prepare_readback(attotime::never, 2, 2, 0xf6, 2, 0, 0, 0xf6);
430430                        m_in_index = 0;
431431                        break;
432432                    case 0xf7: // Enable Input Polling
433                        verboselog(m_machine, 0, "slave_w: Channel %d: Activate Input Polling (0xf7)\n", offset );
433                        verboselog(machine(), 0, "slave_w: Channel %d: Activate Input Polling (0xf7)\n", offset );
434434                        m_polling_active = 1;
435435                        m_in_index = 0;
436436                        break;
437437                    case 0xfa: // Enable X-Bus Interrupts
438                        verboselog(m_machine, 0, "slave_w: Channel %d: X-Bus Interrupt Enable (0xfa)\n", offset );
438                        verboselog(machine(), 0, "slave_w: Channel %d: X-Bus Interrupt Enable (0xfa)\n", offset );
439439                        m_xbus_interrupt_enable = 1;
440440                        m_in_index = 0;
441441                        break;
442442                    default:
443                        verboselog(m_machine, 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
443                        verboselog(machine(), 0, "slave_w: Channel %d: Unknown register: %02x\n", offset, data & 0x00ff );
444444                        memset(m_in_buf, 0, 17);
445445                        m_in_index = 0;
446446                        m_in_count = 0;
r11240r11241
474474{
475475    register_globals();
476476
477    m_interrupt_timer = m_machine.scheduler().timer_alloc(FUNC(trigger_readback_int));
477    m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(trigger_readback_int));
478478    m_interrupt_timer->adjust(attotime::never);
479479}
480480
src/mame/machine/zs01.c
r11240r11241
2222      va_start(v, s_fmt);
2323      vsprintf(buf, s_fmt, v);
2424      va_end(v);
25      logerror("zs01 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
25      logerror("zs01 %s %s: %s", config.tag(), machine().describe_context(), buf);
2626   }
2727}
2828
r11240r11241
427427                        switch(write_buffer[1]) {
428428                        case 0xfd: {
429429                           /* TODO: use read/write to talk to the ds2401, which will require a timer. */
430                           ds2401_device *ds2401 = m_machine.device<ds2401_device>(config.ds2401_tag);
430                           ds2401_device *ds2401 = machine().device<ds2401_device>(config.ds2401_tag);
431431                           for(int i = 0; i < SIZE_DATA_BUFFER; i++)
432432                              read_buffer[2+i] = ds2401->direct_read(SIZE_DATA_BUFFER-i-1);
433433                           break;
src/mame/machine/cd32.c
r11240r11241
2626#define CD_SECTOR_TIME      (1000/((150*1024)/2048))   /* 1X CDROM sector time in msec (300KBps) */
2727
2828
29typedef struct _akiko_state akiko_state;
30struct _akiko_state
29class akiko_state
3130{
31public:
3232   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
33   void set_machine(running_machine &machine) { m_machine = &machine; }
3334
34   running_machine *m_machine;
3535   address_space *m_space;
3636
3737   /* chunky to planar converter */
r11240r11241
6868   device_t *m_i2cmem;
6969
7070   int m_cdrom_is_device;
71
72private:
73   running_machine *m_machine;
7174};
7275
7376static TIMER_CALLBACK(akiko_dma_proc);
r11240r11241
172175   running_machine &machine = device->machine();
173176   akiko_state *state = get_safe_token(device);
174177
175   state->m_machine = &machine;
178   state->set_machine(machine);
176179   state->m_space = machine.device("maincpu")->memory().space(AS_PROGRAM);
177180   state->m_c2p_input_index = 0;
178181   state->m_c2p_output_index = 0;
src/mame/tiny.lst
r11240r11241
11/******************************************************************************
22
33    tiny.lst
4   
4
55    List of all enabled drivers in the system. This file is parsed by
66    makelist.exe, sorted, and output as C code describing the drivers.
77
src/mame/includes/vertigo.h
r11240r11241
2121   UINT32 y;        /* Y output */
2222} am2901;
2323
24typedef struct _vector_generator
24class vector_generator
2525{
26   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
26public:
27   vector_generator(running_machine &machine)
28      : m_machine(machine) { }
29     
30   running_machine &machine() const { return m_machine; }
2731
28   running_machine *m_machine;
2932   UINT32 sreg;     /* shift register */
3033   UINT32 l1;        /* latch 1 adder operand only */
3134   UINT32 l2;        /* latch 2 adder operand only */
r11240r11241
4447   UINT32 vud2;     /* v-counter up or down (stored in L2) */
4548   UINT32 hc1;        /* use h- or v-counter in L1 mode */
4649   UINT32 ven;       /* vector intensity enable */
47} vector_generator;
4850
51private:
52   running_machine &m_machine;
53};
54
4955typedef struct _microcode
5056{
5157   UINT32 x;
r11240r11241
8187{
8288public:
8389   vertigo_state(running_machine &machine, const driver_device_config_base &config)
84      : driver_device(machine, config) { }
90      : driver_device(machine, config),
91        m_vgen(machine) { }
8592
8693   UINT16 *m_vectorram;
8794   device_t *m_ttl74148;
src/mame/video/vertigo.c
r11240r11241
187187   memset(&state->m_vs, 0, sizeof(state->m_vs));
188188   memset(&state->m_bsp, 0, sizeof(state->m_bsp));
189189   memset(&state->m_vgen, 0, sizeof(state->m_vgen));
190   state->m_vgen.m_machine = &machine;
191190}
192191
193192
src/mame/video/atarimo.c
r11240r11241
1515***************************************************************************/
1616
1717/* internal structure containing a word index, shift and mask */
18typedef struct _atarimo_mask atarimo_mask;
19struct _atarimo_mask
18struct atarimo_mask
2019{
2120   int               word;            /* word index */
2221   int               shift;            /* shift amount */
r11240r11241
2423};
2524
2625/* internal structure containing the state of the motion objects */
27typedef struct _atarimo_data atarimo_data;
28struct _atarimo_data
26class atarimo_data
2927{
30   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
28public:
29   atarimo_data(running_machine &machine)
30      : m_machine(machine)
31   {
32   }
3133
32   running_machine *   m_machine;         /* pointer back to the machine */
34   running_machine &machine() const { return m_machine; }
3335
3436   UINT32            gfxchanged;         /* true if the gfx info has changed */
35   gfx_element         gfxelement[MAX_GFX_ELEMENTS]; /* local copy of graphics elements */
37   gfx_element *      gfxelement[MAX_GFX_ELEMENTS]; /* local copy of graphics elements */
3638   int               gfxgranularity[MAX_GFX_ELEMENTS];
3739
3840   bitmap_t         *bitmap;         /* temporary bitmap to render to */
r11240r11241
112114
113115   UINT32            last_xpos;         /* (during processing) the previous X position */
114116   UINT32            next_xpos;         /* (during processing) the next X position */
117
118private:
119   running_machine &   m_machine;         /* pointer back to the machine */
115120};
116121
117122
r11240r11241
129134    STATIC VARIABLES
130135***************************************************************************/
131136
132static atarimo_data atarimo[ATARIMO_MAX];
137static atarimo_data *atarimo[ATARIMO_MAX];
133138static emu_timer *force_update_timer;
134139
135140
r11240r11241
230235
231236INLINE void init_gfxelement(atarimo_data *mo, int idx)
232237{
233   mo->gfxelement[idx] = *mo->machine().gfx[idx];
234   mo->gfxgranularity[idx] = mo->gfxelement[idx].color_granularity;
235   mo->gfxelement[idx].color_granularity = 1;
236   mo->gfxelement[idx].color_base = 0;
237   mo->gfxelement[idx].total_colors = 65536;
238   mo->gfxelement[idx] = auto_alloc(mo->machine(), gfx_element(mo->machine()));
239   memcpy(mo->gfxelement[idx], mo->machine().gfx[idx], sizeof(*mo->gfxelement[idx]));
240   mo->gfxgranularity[idx] = mo->gfxelement[idx]->color_granularity;
241   mo->gfxelement[idx]->color_granularity = 1;
242   mo->gfxelement[idx]->color_base = 0;
243   mo->gfxelement[idx]->total_colors = 65536;
238244}
239245
240246
r11240r11241
326332void atarimo_init(running_machine &machine, int map, const atarimo_desc *desc)
327333{
328334   gfx_element *gfx = machine.gfx[desc->gfxindex];
329   atarimo_data *mo = &atarimo[map];
330335   int i;
331336
332337   assert_always(map >= 0 && map < ATARIMO_MAX, "atarimo_init: map out of range");
338   atarimo_data *mo = atarimo[map] = auto_alloc(machine, atarimo_data(machine));
333339
334340   /* determine the masks first */
335341   convert_mask(&desc->linkmask,      &mo->linkmask);
r11240r11241
348354   convert_mask(&desc->absolutemask,  &mo->absolutemask);
349355
350356   /* copy in the basic data */
351   mo->m_machine     = &machine;
352357   mo->gfxchanged    = FALSE;
353358
354359   mo->linked        = desc->linked;
r11240r11241
452457
453458UINT16 *atarimo_get_code_lookup(int map, int *size)
454459{
455   atarimo_data *mo = &atarimo[map];
460   atarimo_data *mo = atarimo[map];
456461
457462   if (size)
458463      *size = round_to_powerof2(mo->codemask.mask);
r11240r11241
467472
468473UINT8 *atarimo_get_color_lookup(int map, int *size)
469474{
470   atarimo_data *mo = &atarimo[map];
475   atarimo_data *mo = atarimo[map];
471476
472477   if (size)
473478      *size = round_to_powerof2(mo->colormask.mask);
r11240r11241
482487
483488UINT8 *atarimo_get_gfx_lookup(int map, int *size)
484489{
485   atarimo_data *mo = &atarimo[map];
490   atarimo_data *mo = atarimo[map];
486491
487492   mo->gfxchanged = TRUE;
488493   if (size)
r11240r11241
633638
634639bitmap_t *atarimo_render(int map, const rectangle *cliprect, atarimo_rect_list *rectlist)
635640{
636   atarimo_data *mo = &atarimo[map];
641   atarimo_data *mo = atarimo[map];
637642   int startband, stopband, band, i;
638643   rectangle *rect;
639644
r11240r11241
737742static int mo_render_object(atarimo_data *mo, const atarimo_entry *entry, const rectangle *cliprect)
738743{
739744   int gfxindex = mo->gfxlookup[EXTRACT_DATA(entry, mo->gfxmask)];
740   const gfx_element *gfx = &mo->gfxelement[gfxindex];
745   const gfx_element *gfx = mo->gfxelement[gfxindex];
741746   bitmap_t *bitmap = mo->bitmap;
742747   int x, y, sx, sy;
743748
r11240r11241
910915
911916void atarimo_set_bank(int map, int bank)
912917{
913   atarimo_data *mo = &atarimo[map];
918   atarimo_data *mo = atarimo[map];
914919   mo->bank = bank;
915920}
916921
r11240r11241
922927
923928void atarimo_set_xscroll(int map, int xscroll)
924929{
925   atarimo_data *mo = &atarimo[map];
930   atarimo_data *mo = atarimo[map];
926931   mo->xscroll = xscroll;
927932}
928933
r11240r11241
934939
935940void atarimo_set_yscroll(int map, int yscroll)
936941{
937   atarimo_data *mo = &atarimo[map];
942   atarimo_data *mo = atarimo[map];
938943   mo->yscroll = yscroll;
939944}
940945
r11240r11241
946951
947952int atarimo_get_bank(int map)
948953{
949   return atarimo[map].bank;
954   return atarimo[map]->bank;
950955}
951956
952957
r11240r11241
957962
958963int atarimo_get_xscroll(int map)
959964{
960   return atarimo[map].xscroll;
965   return atarimo[map]->xscroll;
961966}
962967
963968
r11240r11241
968973
969974int atarimo_get_yscroll(int map)
970975{
971   return atarimo[map].yscroll;
976   return atarimo[map]->yscroll;
972977}
973978
974979
r11240r11241
978983
979984READ16_HANDLER( atarimo_0_spriteram_r )
980985{
981   atarimo_data *mo = &atarimo[0];
986   atarimo_data *mo = atarimo[0];
982987   return mo->sprite_ram[offset] & mem_mask;
983988}
984989
r11240r11241
990995WRITE16_HANDLER( atarimo_0_spriteram_w )
991996{
992997   int entry, idx, bank;
993   atarimo_data *mo = &atarimo[0];
998   atarimo_data *mo = atarimo[0];
994999
9951000   COMBINE_DATA(&mo->sprite_ram[offset]);
9961001   if (mo->split)
r11240r11241
10141019
10151020READ16_HANDLER( atarimo_1_spriteram_r )
10161021{
1017   atarimo_data *mo = &atarimo[1];
1022   atarimo_data *mo = atarimo[1];
10181023   return mo->sprite_ram[offset] & mem_mask;
10191024}
10201025
r11240r11241
10261031WRITE16_HANDLER( atarimo_1_spriteram_w )
10271032{
10281033   int entry, idx, bank;
1029   atarimo_data *mo = &atarimo[1];
1034   atarimo_data *mo = atarimo[1];
10301035
10311036   COMBINE_DATA(&mo->sprite_ram[offset]);
10321037   if (mo->split)
r11240r11241
10521057WRITE16_HANDLER( atarimo_0_spriteram_expanded_w )
10531058{
10541059   int entry, idx, bank;
1055   atarimo_data *mo = &atarimo[0];
1060   atarimo_data *mo = atarimo[0];
10561061
10571062   COMBINE_DATA(&mo->sprite_ram[offset]);
10581063   if (!(offset & 1))
r11240r11241
10801085
10811086void atarimo_set_slipram(int map, UINT16 *ram)
10821087{
1083   atarimo_data *mo = &atarimo[map];
1088   atarimo_data *mo = atarimo[map];
10841089   mo->slip_ram = ram;
10851090}
10861091
r11240r11241
10911096
10921097READ16_HANDLER( atarimo_0_slipram_r )
10931098{
1094   atarimo_data *mo = &atarimo[0];
1099   atarimo_data *mo = atarimo[0];
10951100   logerror("READ: %04x:%04x\n", offset, mo->slip_ram[offset] & mem_mask);
10961101   return mo->slip_ram[offset] & mem_mask;
10971102}
r11240r11241
11031108
11041109WRITE16_HANDLER( atarimo_0_slipram_w )
11051110{
1106   atarimo_data *mo = &atarimo[0];
1111   atarimo_data *mo = atarimo[0];
11071112   logerror("WRITE: %04x:%04x:%04x:%04x\n", offset, mo->slip_ram[offset], data, mem_mask);
11081113   COMBINE_DATA(&mo->slip_ram[offset]);
11091114}
r11240r11241
11151120
11161121READ16_HANDLER( atarimo_1_slipram_r )
11171122{
1118   atarimo_data *mo = &atarimo[1];
1123   atarimo_data *mo = atarimo[1];
11191124   return mo->slip_ram[offset] & mem_mask;
11201125}
11211126
r11240r11241
11261131
11271132WRITE16_HANDLER( atarimo_1_slipram_w )
11281133{
1129   atarimo_data *mo = &atarimo[1];
1134   atarimo_data *mo = atarimo[1];
11301135   COMBINE_DATA(&mo->slip_ram[offset]);
11311136}
11321137
src/mame/video/gaelco3d.c
r11240r11241
2424#define IS_POLYEND(x)      (((x) ^ ((x) >> 1)) & 0x4000)
2525
2626
27typedef struct _poly_extra_data poly_extra_data;
28struct _poly_extra_data
27struct poly_extra_data
2928{
3029   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
3130
src/mame/video/hyprduel.c
r11240r11241
484484
485485   for (i = 0; i < 0x20; i++)
486486   {
487      gfx_element gfx;
487      gfx_element gfx(machine);
488488
489489      if (!(state->m_videoregs[0x02 / 2] & 0x8000))
490490      {
src/mame/video/liberatr.c
r11240r11241
6868{
6969   UINT16 longitude;
7070
71   const UINT8 *latitude_scale = m_machine.region("user1")->base();
72   const UINT8 *longitude_scale = m_machine.region("user2")->base();
71   const UINT8 *latitude_scale = machine().region("user1")->base();
72   const UINT8 *longitude_scale = machine().region("user2")->base();
7373
7474   /* for each starting longitude */
7575   for (longitude = 0; longitude < 0x100; longitude++)
r11240r11241
171171           many segments it will take to store the description, allocate the
172172           space for it and copy the data to it.
173173        */
174      buffer = auto_alloc_array(m_machine, UINT8, 2*(128 + total_segment_count));
174      buffer = auto_alloc_array(machine(), UINT8, 2*(128 + total_segment_count));
175175
176176      liberatr_planet.frames[longitude] = buffer;
177177
r11240r11241
187187
188188         /* calculate the bitmap's x coordinate for the western horizon
189189               center of bitmap - (the number of planet pixels) / 4 */
190         *buffer++ = (m_machine.primary_screen->width() / 2) - ((line->max_x + 2) / 4);
190         *buffer++ = (machine().primary_screen->width() / 2) - ((line->max_x + 2) / 4);
191191
192192         for (i = 0; i < segment_count; i++)
193193         {
r11240r11241
212212void liberatr_state::video_start()
213213{
214214   // for each planet in the planet ROMs
215   init_planet(m_planets[0], &m_machine.region("gfx1")->base()[0x2000]);
216   init_planet(m_planets[1], &m_machine.region("gfx1")->base()[0x0000]);
215   init_planet(m_planets[0], &machine().region("gfx1")->base()[0x2000]);
216   init_planet(m_planets[1], &machine().region("gfx1")->base()[0x0000]);
217217}
218218
219219
src/mame/video/beathead.c
r11240r11241
1717
1818void beathead_state::video_start()
1919{
20   state_save_register_global(m_machine, m_finescroll);
21   state_save_register_global(m_machine, m_vram_latch_offset);
22   state_save_register_global(m_machine, m_hsyncram_offset);
23   state_save_register_global(m_machine, m_hsyncram_start);
24   state_save_register_global_array(m_machine, m_hsyncram);
20   state_save_register_global(machine(), m_finescroll);
21   state_save_register_global(machine(), m_vram_latch_offset);
22   state_save_register_global(machine(), m_hsyncram_offset);
23   state_save_register_global(machine(), m_hsyncram_start);
24   state_save_register_global_array(machine(), m_hsyncram);
2525}
2626
2727
src/mame/video/rdpblend.c
r11240r11241
243243   INT32 threshold;
244244   if (m_other_modes->alpha_compare_en)
245245   {
246      threshold = (m_other_modes->dither_alpha_en) ? (m_machine->rand() & 0xff) : m_rdp->GetBlendColor()->i.a;
246      threshold = (m_other_modes->dither_alpha_en) ? (machine().rand() & 0xff) : m_rdp->GetBlendColor()->i.a;
247247      if (alpha < threshold)
248248      {
249249         return false;
src/mame/video/rdpblend.h
r11240r11241
3636      void            SetShiftA(INT32 shift) { m_shift_a = shift; }
3737      void            SetShiftB(INT32 shift) { m_shift_b = shift; }
3838
39      running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
40
3941   private:
4042      running_machine*   m_machine;
4143      OtherModes*         m_other_modes;
src/mame/video/metro.c
r11240r11241
464464
465465   for (i = 0; i < 0x20; i++)
466466   {
467      gfx_element gfx;
467      gfx_element gfx(machine);
468468
469469      if (!(state->m_videoregs[0x02/2] & 0x8000))
470470      {
src/mame/video/avgdvg.c
r11240r11241
5656 *
5757 *************************************/
5858
59typedef struct _vgvector vgvector;
60struct _vgvector
59struct vgvector
6160{
6261   int x; int y;
6362   rgb_t color;
r11240r11241
6665   int status;
6766};
6867
69typedef struct _vgdata vgdata;
70struct _vgdata
68struct vgdata
7169{
7270   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
71   void set_machine(running_machine &machine) { m_machine = &machine; }
7372
74   running_machine *m_machine;
75
7673   UINT16 pc;
7774   UINT8 sp;
7875   UINT16 dvx;
r11240r11241
110107   INT32 clipy_min;
111108   INT32 clipx_max;
112109   INT32 clipy_max;
110
111private:
112   running_machine *m_machine;
113113};
114114
115115typedef struct _vgconf vgconf;
r11240r11241
14941494   const rectangle &visarea = machine.primary_screen->visible_area();
14951495
14961496   vg = &vgd;
1497   vg->m_machine = &machine;
1497   vg->set_machine(machine);
14981498
14991499   xmin = visarea.min_x;
15001500   ymin = visarea.min_y;
r11240r11241
15271527
15281528   vgc = &dvg_default;
15291529   vg = &vgd;
1530   vg->m_machine = &machine;
1530   vg->set_machine(machine);
15311531
15321532   xmin = visarea.min_x;
15331533   ymin = visarea.min_y;
src/mame/video/rdpspn16.c
r11240r11241
3434
3535   for(int i = start; i <= end; i++)
3636   {
37      m_span[i].SetMachine(*m_machine);
37      m_span[i].SetMachine(machine());
3838      switch(m_other_modes.cycle_type)
3939      {
4040         case CYCLE_TYPE_1: m_span[i].Draw1Cycle(i, tilenum, flip); break;
src/mame/video/rdpspn16.h
r11240r11241
4242      void   DrawCopy(int index, int tilenum, bool flip);
4343      void   DrawFill(int index, int tilenum, bool flip);
4444
45      running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
46
4547   public:
4648      int m_lx;
4749      int m_rx;
src/mame/video/n64.c
r11240r11241
412412{
413413   if (noisecompute)
414414   {
415      m_noise_color.i.r = m_noise_color.i.g = m_noise_color.i.b = m_machine->rand() & 0xff; // Not accurate...
415      m_noise_color.i.r = m_noise_color.i.g = m_noise_color.i.b = machine().rand() & 0xff; // Not accurate...
416416   }
417417
418418   m_pixel_color.i.r = ColorCombinerEquation(*m_color_inputs.combiner_rgbsub_a_r[1],*m_color_inputs.combiner_rgbsub_b_r[1],*m_color_inputs.combiner_rgbmul_r[1],*m_color_inputs.combiner_rgbadd_r[1]);
r11240r11241
428428{
429429   if (noisecompute)
430430   {
431      m_noise_color.i.r = m_noise_color.i.g = m_noise_color.i.b = m_machine->rand() & 0xff; // HACK
431      m_noise_color.i.r = m_noise_color.i.g = m_noise_color.i.b = machine().rand() & 0xff; // HACK
432432   }
433433
434434   m_combined_color.i.r = ColorCombinerEquation(*m_color_inputs.combiner_rgbsub_a_r[0],*m_color_inputs.combiner_rgbsub_b_r[0],*m_color_inputs.combiner_rgbmul_r[0],*m_color_inputs.combiner_rgbadd_r[0]);
r11240r11241
939939      break;
940940   case 2:
941941      *cdith = s_magic_matrix[dithindex];
942      *adith = m_machine->rand() & 7;
942      *adith = machine().rand() & 7;
943943      break;
944944   case 3:
945945      *cdith = s_magic_matrix[dithindex];
r11240r11241
954954      break;
955955   case 6:
956956      *cdith = s_bayer_matrix[dithindex];
957      *adith = m_machine->rand() & 7;
957      *adith = machine().rand() & 7;
958958      break;
959959   case 7:
960960      *cdith = s_bayer_matrix[dithindex];
961961      *adith = 0;
962962      break;
963963   case 8:
964      *cdith = m_machine->rand() & 7;
964      *cdith = machine().rand() & 7;
965965      *adith = s_magic_matrix[dithindex];
966966      break;
967967   case 9:
968      *cdith = m_machine->rand() & 7;
968      *cdith = machine().rand() & 7;
969969      *adith = (~s_magic_matrix[dithindex]) & 7;
970970      break;
971971   case 10:
972      *cdith = m_machine->rand() & 7;
972      *cdith = machine().rand() & 7;
973973      *adith = (*cdith + 17) & 7;
974974      break;
975975   case 11:
976      *cdith = m_machine->rand() & 7;
976      *cdith = machine().rand() & 7;
977977      *adith = 0;
978978      break;
979979   case 12:
src/mame/video/n64.h
r11240r11241
419419         m_span_dady = da;
420420         m_span_dzdy = dz;
421421      }
422     
423      running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
422424
423425      void   InitInternalState()
424426      {
425         if(m_machine)
426         {
427            m_tmem = auto_alloc_array(*m_machine, UINT8, 0x1000);
428            memset(m_tmem, 0, 0x1000);
427         m_tmem = auto_alloc_array(machine(), UINT8, 0x1000);
428         memset(m_tmem, 0, 0x1000);
429429
430            UINT8 *normpoint = m_machine->region("normpoint")->base();
431            UINT8 *normslope = m_machine->region("normslope")->base();
430         UINT8 *normpoint = machine().region("normpoint")->base();
431         UINT8 *normslope = machine().region("normslope")->base();
432432
433            for(INT32 i = 0; i < 64; i++)
434            {
435               m_norm_point_rom[i] = (normpoint[(i << 1) + 1] << 8) | normpoint[i << 1];
436               m_norm_slope_rom[i] = (normslope[(i << 1) + 1] << 8) | normslope[i << 1];
437            }
433         for(INT32 i = 0; i < 64; i++)
434         {
435            m_norm_point_rom[i] = (normpoint[(i << 1) + 1] << 8) | normpoint[i << 1];
436            m_norm_slope_rom[i] = (normslope[(i << 1) + 1] << 8) | normslope[i << 1];
438437         }
439438      }
440439
src/mame/video/cidelsa.c
r11240r11241
163163void cidelsa_state::video_start()
164164{
165165   // allocate memory
166   m_pcbram = auto_alloc_array(m_machine, UINT8, CIDELSA_CHARRAM_SIZE);
167   m_charram = auto_alloc_array(m_machine, UINT8, CIDELSA_CHARRAM_SIZE);
166   m_pcbram = auto_alloc_array(machine(), UINT8, CIDELSA_CHARRAM_SIZE);
167   m_charram = auto_alloc_array(machine(), UINT8, CIDELSA_CHARRAM_SIZE);
168168
169169   // register for state saving
170170   save_item(NAME(m_cdp1869_pcb));
src/mame/video/gp9001.c
r11240r11241
343343
344344void gp9001vdp_device::device_start()
345345{
346   top.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_TOP_VRAM_SIZE/2);
347   fg.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_FG_VRAM_SIZE/2);
348   bg.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_BG_VRAM_SIZE/2);
346   top.vram16 = auto_alloc_array_clear(machine(), UINT16, GP9001_TOP_VRAM_SIZE/2);
347   fg.vram16 = auto_alloc_array_clear(machine(), UINT16, GP9001_FG_VRAM_SIZE/2);
348   bg.vram16 = auto_alloc_array_clear(machine(), UINT16, GP9001_BG_VRAM_SIZE/2);
349349
350   sp.vram16 = auto_alloc_array_clear(m_machine, UINT16, GP9001_SPRITERAM_SIZE/2);
351   sp.vram16_buffer = auto_alloc_array_clear(m_machine, UINT16, GP9001_SPRITERAM_SIZE/2);
350   sp.vram16 = auto_alloc_array_clear(machine(), UINT16, GP9001_SPRITERAM_SIZE/2);
351   sp.vram16_buffer = auto_alloc_array_clear(machine(), UINT16, GP9001_SPRITERAM_SIZE/2);
352352
353353   create_tilemaps(m_gfxregion);
354354
src/mame/layout/crusnexo.lay
r11240r11241
8787      </text>
8888   </element>
8989
90   
90
9191   <view name="Simple LEDs">
9292      <bounds left="0" top="0" right="4" bottom="3.472" />
9393
r11240r11241
179179      <bezel name="lamp3" element="view3">
180180         <bounds x="0.1" y="3.3" width="0.4" height="0.1" />
181181      </bezel>
182   </view>   
182   </view>
183183</mamelayout>
src/mame/layout/stocker.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN1" inputmask="0x02">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN1" inputmask="0x02">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/stactics.lay
r11240r11241
1717   <element name="basetext">
1818      <text string="BASE MISSILE BUTTON">
1919         <color red="1.0" green="1.0" blue="1.0" />
20      </text>   
20      </text>
2121   </element>
2222   <element name="scoretext">
2323      <text string="SCORE">
2424         <color red="1.0" green="1.0" blue="1.0" />
25      </text>   
25      </text>
2626   </element>
2727   <element name="digit" defstate="10">
2828      <led7seg>
r11240r11241
3232   <element name="c_text">
3333      <text string="C">
3434         <color red="1.0" green="1.0" blue="1.0" />
35      </text>   
35      </text>
3636   </element>
3737   <element name="r_text">
3838      <text string="R">
3939         <color red="1.0" green="1.0" blue="1.0" />
40      </text>   
40      </text>
4141   </element>
4242   <element name="e_text">
4343      <text string="E">
4444         <color red="1.0" green="1.0" blue="1.0" />
45      </text>   
45      </text>
4646   </element>
4747   <element name="d_text">
4848      <text string="D">
4949         <color red="1.0" green="1.0" blue="1.0" />
50      </text>   
50      </text>
5151   </element>
5252   <element name="i_text">
5353      <text string="I">
5454         <color red="1.0" green="1.0" blue="1.0" />
55      </text>   
55      </text>
5656   </element>
5757   <element name="t_text">
5858      <text string="T">
5959         <color red="1.0" green="1.0" blue="1.0" />
60      </text>   
60      </text>
6161   </element>
6262   <element name="yellow_disc" defstate="0">
6363      <disk state="1">
r11240r11241
8282   <element name="energy_text">
8383      <text string="ENERGY BARRIER">
8484         <color red="1.0" green="1.0" blue="1.0" />
85      </text>   
85      </text>
8686   </element>
8787   <element name="energy_b_text">
8888      <text string="ENERGY BARRIER BUTTON">
8989         <color red="0" green="0" blue="0" />
90      </text>   
90      </text>
9191   </element>
9292   <element name="round_text">
9393      <text string="ROUND">
9494         <color red="1.0" green="1.0" blue="1.0" />
95      </text>   
95      </text>
9696   </element>
9797   <element name="1_text">
9898      <text string="1">
9999         <color red="1.0" green="1.0" blue="1.0" />
100      </text>   
100      </text>
101101   </element>
102102   <element name="2_text">
103103      <text string="2">
104104         <color red="1.0" green="1.0" blue="1.0" />
105      </text>   
105      </text>
106106   </element>
107107   <element name="3_text">
108108      <text string="3">
109109         <color red="1.0" green="1.0" blue="1.0" />
110      </text>   
110      </text>
111111   </element>
112112   <element name="4_text">
113113      <text string="4">
114114         <color red="1.0" green="1.0" blue="1.0" />
115      </text>   
115      </text>
116116   </element>
117117   <element name="5_text">
118118      <text string="5">
119119         <color red="1.0" green="1.0" blue="1.0" />
120      </text>   
120      </text>
121121   </element>
122122   <element name="6_text">
123123      <text string="6">
124124         <color red="1.0" green="1.0" blue="1.0" />
125      </text>   
125      </text>
126126   </element>
127127   <element name="7_text">
128128      <text string="7">
129129         <color red="1.0" green="1.0" blue="1.0" />
130      </text>   
130      </text>
131131   </element>
132132   <element name="8_text">
133133      <text string="8">
134134         <color red="1.0" green="1.0" blue="1.0" />
135      </text>   
135      </text>
136136   </element>
137137   <element name="9_text">
138138      <text string="9">
139139         <color red="1.0" green="1.0" blue="1.0" />
140      </text>   
140      </text>
141141   </element>
142142   <element name="0_text">
143143      <text string="0">
144144         <color red="1.0" green="1.0" blue="1.0" />
145      </text>   
145      </text>
146146   </element>
147147   <element name="green_disc" defstate="0">
148148      <disk state="1">
r11240r11241
448448                  <bounds x="59" y="573" width="7" height="7" />
449449      </bezel>
450450      <bezel element="0_text">
451                 <bounds x="63" y="573" width="7" height="7" />
451              <bounds x="63" y="573" width="7" height="7" />
452452      </bezel>
453453      <bezel element="1_text">
454454                  <bounds x="71" y="573" width="7" height="7" />
455455      </bezel>
456456      <bezel element="1_text">
457                 <bounds x="75" y="573" width="7" height="7" />
457              <bounds x="75" y="573" width="7" height="7" />
458458      </bezel>
459459      <bezel element="1_text">
460460                  <bounds x="83" y="573" width="7" height="7" />
461461      </bezel>
462462      <bezel element="2_text">
463                 <bounds x="87" y="573" width="7" height="7" />
463              <bounds x="87" y="573" width="7" height="7" />
464464      </bezel>
465465
466466<!--Energy Barrier Lamp-->
r11240r11241
636636                  <bounds x="59" y="673" width="7" height="7" />
637637      </bezel>
638638      <bezel element="0_text">
639                 <bounds x="63" y="673" width="7" height="7" />
639              <bounds x="63" y="673" width="7" height="7" />
640640      </bezel>
641641      <bezel element="1_text">
642642                  <bounds x="71" y="673" width="7" height="7" />
643643      </bezel>
644644      <bezel element="1_text">
645                 <bounds x="75" y="673" width="7" height="7" />
645              <bounds x="75" y="673" width="7" height="7" />
646646      </bezel>
647647      <bezel element="1_text">
648648                  <bounds x="83" y="673" width="7" height="7" />
649649      </bezel>
650650      <bezel element="2_text">
651                 <bounds x="87" y="673" width="7" height="7" />
651              <bounds x="87" y="673" width="7" height="7" />
652652      </bezel>
653653      <bezel element="1_text">
654654                  <bounds x="95" y="673" width="7" height="7" />
655655      </bezel>
656656      <bezel element="3_text">
657                 <bounds x="99" y="673" width="7" height="7" />
657              <bounds x="99" y="673" width="7" height="7" />
658658      </bezel>
659659      <bezel element="1_text">
660660                  <bounds x="107" y="673" width="7" height="7" />
661661      </bezel>
662662      <bezel element="4_text">
663                 <bounds x="111" y="673" width="7" height="7" />
663              <bounds x="111" y="673" width="7" height="7" />
664664      </bezel>
665665      <bezel element="1_text">
666666                  <bounds x="119" y="673" width="7" height="7" />
667667      </bezel>
668668      <bezel element="5_text">
669                 <bounds x="123" y="673" width="7" height="7" />
669              <bounds x="123" y="673" width="7" height="7" />
670670      </bezel>
671671
672672<!--Laser Beam Left-->
src/mame/layout/wecleman.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x20">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x20">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/superchs.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="INPUTS" inputmask="0x00002000">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="INPUTS" inputmask="0x00002000">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/gorf.lay
r11240r11241
2222   <element name="spacetext">
2323      <text string="SPACE">
2424         <color red="0" green="0" blue="0" />
25      </text>
25      </text>
2626   </element>
2727   <element name="rank">
2828      <text string="SPACE RANK">
2929         <color red="0" green="0" blue="0" />
30      </text>
30      </text>
3131   </element>
3232   <element name="cadet">
3333      <text string="CADET">
3434         <color red="0" green="0" blue="0" />
35      </text>
35      </text>
3636   </element>
3737   <element name="captain">
3838      <text string="CAPTAIN">
3939         <color red="0" green="0" blue="0" />
40      </text>
40      </text>
4141   </element>
4242   <element name="colonel">
4343      <text string="COLONEL">
4444         <color red="0" green="0" blue="0" />
45      </text>
45      </text>
4646   </element>
4747   <element name="general">
4848      <text string="GENERAL">
4949         <color red="0" green="0" blue="0" />
50      </text>
50      </text>
5151   </element>
5252   <element name="warrior">
5353      <text string="WARRIOR">
5454         <color red="0" green="0" blue="0" />
55      </text>
55      </text>
5656   </element>
5757   <element name="avenger">
5858      <text string="AVENGER">
5959         <color red="0" green="0" blue="0" />
60      </text>
60      </text>
6161   </element>
6262   <view name="Lamps">
6363      <bounds x="-112" y="0" width="524" height="400" />
src/mame/layout/aristmk4.lay
r11240r11241
8484      </rect>
8585      <rect state="0">
8686      <color red="0.25" green="0.0" blue="0.35" />
87         
87
8888      </rect>
8989      <text string="DOUBLE UP">
9090         <color red="0.0" green="0.0" blue="0.0" />
r11240r11241
117117         <bounds x="0" y="0.1" width="1" height="0.8" />
118118      </text>
119119   </element>
120   
120
121121   <element name="3 lines">
122122      <rect state="1">
123123         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
130130         <bounds x="0" y="0.1" width="1" height="0.8" />
131131      </text>
132132   </element>
133   
133
134134   <element name="5 lines">
135135      <rect state="1">
136136         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
143143         <bounds x="0" y="0.1" width="1" height="0.8" />
144144      </text>
145145   </element>
146   
146
147147   <element name="7 lines">
148148      <rect state="1">
149149         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
156156         <bounds x="0" y="0.1" width="1" height="0.8" />
157157      </text>
158158   </element>
159   
159
160160   <element name="9 lines">
161161      <rect state="1">
162162         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
169169         <bounds x="0" y="0.1" width="1" height="0.8" />
170170      </text>
171171   </element>
172   
172
173173   <element name="take win">
174174      <rect state="1">
175175         <color red="1.0" green="0.7" blue="0.0" />
r11240r11241
182182         <bounds x="0" y="0.1" width="1" height="0.8" />
183183      </text>
184184   </element>
185   
185
186186   <element name="light tower1">
187187      <disk state="1">
188188         <color red="1.0" green="0.0" blue="0.0" />
r11240r11241
195195         <bounds x="0" y="0.1" width="1" height="0.8" />
196196      </text>
197197   </element>
198   
198
199199   <element name="light tower2">
200200      <disk state="1">
201201         <color red="1.0" green="0.0" blue="0.0" />
r11240r11241
208208         <bounds x="0" y="0.1" width="1" height="0.8" />
209209      </text>
210210   </element>
211   
211
212212   <element name="light tower3">
213213      <disk state="1">
214214         <color red="1.0" green="0.0" blue="0.0" />
r11240r11241
221221         <bounds x="0" y="0.1" width="1" height="0.8" />
222222      </text>
223223   </element>
224   
224
225225   <element name="light tower4">
226226      <disk state="1">
227227         <color red="1.0" green="0.0" blue="0.0" />
r11240r11241
235235      </text>
236236   </element>
237237
238   
238
239239   <element name="auditkey">
240240      <rect state="1">
241241         <color red="0.5" green="0.35" blue="0.0" />
r11240r11241
283283         <bounds x="1.91" y="3.02" width="0.31" height="0.24" />
284284      </bezel>
285285
286       <bezel name="lamp12" element="bet5">
286      <bezel name="lamp12" element="bet5">
287287         <bounds x="2.31" y="3.02" width="0.31" height="0.24" />
288288      </bezel>
289289
290290      <bezel name="lamp7" element="bet10">
291291         <bounds x="2.72" y="3.02" width="0.31" height="0.24" />
292292      </bezel>
293   
293
294294      <bezel name="lamp18" element="double up">
295295         <bounds x="3.13" y="3.02" width="0.31" height="0.24" />
296296      </bezel>
r11240r11241
302302      <bezel name="lamp1" element="1 line">
303303         <bounds x="1.08" y="3.28" width="0.31" height="0.24" />
304304      </bezel>
305     
305
306306      <bezel name="lamp2" element="3 lines">
307307         <bounds x="1.49" y="3.28" width="0.31" height="0.24" />
308308      </bezel>
309     
309
310310      <bezel name="lamp3" element="5 lines">
311311         <bounds x="1.91" y="3.28" width="0.31" height="0.24" />
312      </bezel>   
312      </bezel>
313313      <bezel name="lamp9" element="7 lines">
314314         <bounds x="2.31" y="3.28" width="0.31" height="0.24" />
315315      </bezel>
316           
316
317317      <bezel name="lamp4" element="9 lines">
318318         <bounds x="2.72" y="3.28" width="0.31" height="0.24" />
319319      </bezel>
320     
320
321321      <bezel name="lamp13" element="take win">
322322         <bounds x="3.13" y="3.28" width="0.31" height="0.24" />
323323      </bezel>
324     
324
325325      <bezel name="lamp14" element="light tower1">
326326         <bounds x="3.70" y="3.28" width="0.10" height="0.10" />
327327      </bezel>
328     
328
329329      <bezel name="lamp15" element="light tower2">
330330         <bounds x="3.80" y="3.28" width="0.10" height="0.10" />
331331      </bezel>
332     
332
333333      <bezel name="lamp16" element="light tower3">
334334         <bounds x="3.70" y="3.38" width="0.10" height="0.10" />
335335      </bezel>
336     
336
337337      <bezel name="lamp17" element="light tower4">
338338         <bounds x="3.80" y="3.38" width="0.10" height="0.10" />
339339      </bezel>
340     
340
341341      <bezel name="lamp19" element="auditkey">
342342         <bounds x="0.26" y="3.09" width="0.31" height="0.12" />
343343      </bezel>
344     
344
345345      <bezel name="lamp20" element="jackpotkey">
346346         <bounds x="0.26" y="3.34" width="0.31" height="0.12" />
347347      </bezel>
348     
348
349349   </view>
350350</mamelayout>
src/mame/layout/changela.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x01">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x01">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/buggychl.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="480" height="640" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x08">
5656         <bounds x="446" y="574" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="480" height="640" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x08">
6565         <bounds x="2" y="574" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/gridiron.lay
r11240r11241
1717      <bezel name="digit0" element="digit">
1818         <bounds left="-15" top="18" right="-8" bottom="31" />
1919      </bezel>
20     
20
2121      <bezel name="digit1" element="digit">
2222         <bounds left="-15" top="50" right="-8" bottom="63" />
23      </bezel>     
24   </view>   
23      </bezel>
24   </view>
2525</mamelayout>
No newline at end of file
src/mame/layout/spacwalk.lay
r11240r11241
55         <bounds left="0" top="0" right="260" bottom="224" />
66         <color red="1" green="1" blue="1" />
77      </rect>
8     
8
99      <rect>
1010         <bounds left="0" top="158" right="131" bottom="181" />
1111         <color red="0.2" green="0.5" blue="1" />
r11240r11241
1414         <bounds left="131" top="158" right="260" bottom="181" />
1515         <color red="0" green="0.9" blue="0.5" />
1616      </rect>
17     
17
1818      <rect>
1919         <bounds left="0" top="181" right="131" bottom="207" />
2020         <color red="0" green="0.9" blue="0.5" />
r11240r11241
2323         <bounds left="131" top="181" right="260" bottom="207" />
2424         <color red="0.2" green="0.5" blue="1" />
2525      </rect>
26     
26
2727      <rect>
2828         <bounds left="0" top="207" right="47" bottom="224" />
2929         <color red="0.2" green="0.5" blue="1" />
src/mame/layout/280zzzap.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x10">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x10">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/luckyrlt.lay
r11240r11241
2525         <bounds left="100" top="96" right="832" bottom="1072" />
2626      </screen>
2727
28      <bezel name="lamp134" element="BALL0">   
28      <bezel name="lamp134" element="BALL0">
2929         <bounds x="1321.5755279531" y="319.178830824334" width="16" height="16" />
30      </bezel>   
31      <bezel name="lamp135" element="BALL">   
30      </bezel>
31      <bezel name="lamp135" element="BALL">
3232         <bounds x="1332.56513467655" y="335.702636395822" width="16" height="16" />
33      </bezel>   
34      <bezel name="lamp8" element="BALL">   
33      </bezel>
34      <bezel name="lamp8" element="BALL">
3535         <bounds x="1340.60412921523" y="353.84601461785" width="16" height="16" />
36      </bezel>   
37      <bezel name="lamp9" element="BALL">   
36      </bezel>
37      <bezel name="lamp9" element="BALL">
3838         <bounds x="1345.46124433281" y="373.087013532536" width="16" height="16" />
39      </bezel>   
40      <bezel name="lamp10" element="BALL">   
39      </bezel>
40      <bezel name="lamp10" element="BALL">
4141         <bounds x="1346.9967496707" y="392.872104633103" width="16" height="16" />
42      </bezel>   
43      <bezel name="lamp11" element="BALL">   
42      </bezel>
43      <bezel name="lamp11" element="BALL">
4444         <bounds x="1345.16647153601" y="412.632106871213" width="16" height="16" />
45      </bezel>   
46      <bezel name="lamp12" element="BALL">   
45      </bezel>
46      <bezel name="lamp12" element="BALL">
4747         <bounds x="1340.0230636983" y="431.798560959421" width="16" height="16" />
48      </bezel>   
49      <bezel name="lamp13" element="BALL">   
48      </bezel>
49      <bezel name="lamp13" element="BALL">
5050         <bounds x="1331.71449263647" y="449.820082909883" width="16" height="16" />
51      </bezel>   
52      <bezel name="lamp14" element="BALL">   
51      </bezel>
52      <bezel name="lamp14" element="BALL">
5353         <bounds x="1320.4797808126" y="466.178226347788" width="16" height="16" />
54      </bezel>   
55      <bezel name="lamp16" element="BALL">   
54      </bezel>
55      <bezel name="lamp16" element="BALL">
5656         <bounds x="1306.64213043088" y="480.402397269624" width="16" height="16" />
57      </bezel>   
58      <bezel name="lamp17" element="BALL">   
57      </bezel>
58      <bezel name="lamp17" element="BALL">
5959         <bounds x="1290.59962549863" y="492.083392175853" width="16" height="16" />
60      </bezel>   
61      <bezel name="lamp18" element="BALL">   
60      </bezel>
61      <bezel name="lamp18" element="BALL">
6262         <bounds x="1272.81377967425" y="500.885170110556" width="16" height="16" />
63      </bezel>   
64      <bezel name="lamp19" element="BALL">   
63      </bezel>
64      <bezel name="lamp19" element="BALL">
6565         <bounds x="1253.7962593595" y="506.554519947908" width="16" height="16" />
66      </bezel>   
67      <bezel name="lamp20" element="BALL">   
66      </bezel>
67      <bezel name="lamp20" element="BALL">
6868         <bounds x="1234.09416398871" y="508.928344815248" width="16" height="16" />
69      </bezel>   
70      <bezel name="lamp21" element="BALL">   
69      </bezel>
70      <bezel name="lamp21" element="BALL">
7171         <bounds x="1214.27428697419" y="507.938354093155" width="16" height="16" />
72      </bezel>   
73      <bezel name="lamp22" element="BALL">   
72      </bezel>
73      <bezel name="lamp22" element="BALL">
7474         <bounds x="1194.90681009169" y="503.613028012232" width="16" height="16" />
75      </bezel>   
76      <bezel name="lamp32" element="BALL">   
75      </bezel>
76      <bezel name="lamp32" element="BALL">
7777         <bounds x="1176.54890038884" y="496.076798328726" width="16" height="16" />
78      </bezel>   
79      <bezel name="lamp33" element="BALL">   
78      </bezel>
79      <bezel name="lamp33" element="BALL">
8080         <bounds x="1159.72868150364" y="485.546468649452" width="16" height="16" />
81      </bezel>   
82      <bezel name="lamp34" element="BALL">   
81      </bezel>
82      <bezel name="lamp34" element="BALL">
8383         <bounds x="1144.93004050891" y="472.32497738676" width="16" height="16" />
84      </bezel>   
85      <bezel name="lamp35" element="BALL">   
84      </bezel>
85      <bezel name="lamp35" element="BALL">
8686         <bounds x="1132.57870736225" y="456.792682771969" width="16" height="16" />
87      </bezel>   
88      <bezel name="lamp36" element="BALL">   
87      </bezel>
88      <bezel name="lamp36" element="BALL">
8989         <bounds x="1123.03000743027" y="439.396420641569" width="16" height="16" />
90      </bezel>   
91      <bezel name="lamp37" element="BALL">   
90      </bezel>
91      <bezel name="lamp37" element="BALL">
9292         <bounds x="1116.55863942476" y="420.636649783757" width="16" height="16" />
93      </bezel>   
94      <bezel name="lamp38" element="BALL">   
93      </bezel>
94      <bezel name="lamp38" element="BALL">
9595         <bounds x="1113.35077282082" y="401.053054650283" width="16" height="16" />
96      </bezel>   
97      <bezel name="lamp64" element="BALL">   
96      </bezel>
97      <bezel name="lamp64" element="BALL">
9898         <bounds x="1113.49869210012" y="381.209019617376" width="16" height="16" />
99      </bezel>   
100      <bezel name="lamp65" element="BALL">   
99      </bezel>
100      <bezel name="lamp65" element="BALL">
101101         <bounds x="1116.99814189431" y="361.675421442988" width="16" height="16" />
102      </bezel>   
103      <bezel name="lamp66" element="BALL">   
102      </bezel>
103      <bezel name="lamp66" element="BALL">
104104         <bounds x="1123.74844940422" y="343.014206181865" width="16" height="16" />
105      </bezel>   
106      <bezel name="lamp67" element="BALL">   
105      </bezel>
106      <bezel name="lamp67" element="BALL">
107107         <bounds x="1133.55542057307" y="325.762223020679" width="16" height="16" />
108      </bezel>   
109      <bezel name="lamp68" element="BALL">   
108      </bezel>
109      <bezel name="lamp68" element="BALL">
110110         <bounds x="1146.13692669582" y="310.415780104371" width="16" height="16" />
111      </bezel>   
112      <bezel name="lamp69" element="BALL">   
111      </bezel>
112      <bezel name="lamp69" element="BALL">
113113         <bounds x="1161.13102074843" y="297.416366654444" width="16" height="16" />
114      </bezel>   
115      <bezel name="lamp70" element="BALL">   
114      </bezel>
115      <bezel name="lamp70" element="BALL">
116116         <bounds x="1178.10634994466" y="287.137952127882" width="16" height="16" />
117      </bezel>   
118      <bezel name="lamp71" element="BALL">   
117      </bezel>
118      <bezel name="lamp71" element="BALL">
119119         <bounds x="1196.57456497046" y="279.876227796751" width="16" height="16" />
120      </bezel>   
121      <bezel name="lamp128" element="BALL">   
120      </bezel>
121      <bezel name="lamp128" element="BALL">
122122         <bounds x="1216.00436890452" y="275.840100248669" width="16" height="16" />
123      </bezel>   
124      <bezel name="lamp129" element="BALL">   
123      </bezel>
124      <bezel name="lamp129" element="BALL">
125125         <bounds x="1235.83680166342" y="275.145681524636" width="16" height="16" />
126      </bezel>   
127      <bezel name="lamp130" element="BALL">   
126      </bezel>
127      <bezel name="lamp130" element="BALL">
128128         <bounds x="1255.5013202655" y="277.812948787016" width="16" height="16" />
129      </bezel>   
130      <bezel name="lamp131" element="BALL">   
129      </bezel>
130      <bezel name="lamp131" element="BALL">
131131         <bounds x="1274.43221231367" y="283.765169612954" width="16" height="16" />
132      </bezel>   
133      <bezel name="lamp132" element="BALL">   
132      </bezel>
133      <bezel name="lamp132" element="BALL">
134134         <bounds x="1292.08487051111" y="292.831109446467" width="16" height="16" />
135      </bezel>   
136      <bezel name="lamp133" element="BALL">   
135      </bezel>
136      <bezel name="lamp133" element="BALL">
137137         <bounds x="1307.95146002158" y="304.749957704861" width="16" height="16" />
138      </bezel>   
138      </bezel>
139139
140140   </view>
141141</mamelayout>
src/mame/layout/topspeed.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN1" inputmask="0x10">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN1" inputmask="0x10">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/buggyboy.lay
r11240r11241
5757      </screen>
5858      <screen index="2">
5959         <bounds x="1280" y="0" width="640" height="480" />
60      </screen>     
61     
60      </screen>
61
6262<bezel element="shifter" inputtag="PPI_PORTA" inputmask="0x40">
6363
6464         <bounds x="1886" y="414" width="32" height="64" />
r11240r11241
7474      </screen>
7575      <screen index="2">
7676         <bounds x="1280" y="0" width="640" height="480" />
77      </screen>     
78     
77      </screen>
78
7979<bezel element="shifter" inputtag="PPI_PORTA" inputmask="0x40">
8080
8181         <bounds x="2" y="414" width="32" height="64" />
r11240r11241
8585   <view name="Shifter-1R">
8686      <screen index="1">
8787         <bounds x="0" y="0" width="640" height="480" />
88      </screen>     
89     
88      </screen>
89
9090<bezel element="shifter" inputtag="PPI_PORTA" inputmask="0x40">
9191
9292         <bounds x="606" y="414" width="32" height="64" />
r11240r11241
9696   <view name="Shifter-1L">
9797      <screen index="1">
9898         <bounds x="0" y="0" width="640" height="480" />
99      </screen>     
100     
99      </screen>
100
101101<bezel element="shifter" inputtag="PPI_PORTA" inputmask="0x40">
102102
103103         <bounds x="2" y="414" width="32" height="64" />
src/mame/layout/lagunar.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="480" height="640" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x10">
5656         <bounds x="446" y="574" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="480" height="640" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x10">
6565         <bounds x="2" y="574" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/re900.lay
r11240r11241
140140      <bezel name="lamp6" element="L6">
141141         <bounds x="1400" y="950" width="70" height="45" />
142142      </bezel>
143      <bezel name="lamp20" element="BALL0">   
143      <bezel name="lamp20" element="BALL0">
144144         <bounds x="1321.5755279531" y="319.178830824334" width="16" height="16" />
145      </bezel>   
146      <bezel name="lamp21" element="BALL">   
145      </bezel>
146      <bezel name="lamp21" element="BALL">
147147         <bounds x="1332.56513467655" y="335.702636395822" width="16" height="16" />
148      </bezel>   
149      <bezel name="lamp22" element="BALL">   
148      </bezel>
149      <bezel name="lamp22" element="BALL">
150150         <bounds x="1340.60412921523" y="353.84601461785" width="16" height="16" />
151      </bezel>   
152      <bezel name="lamp23" element="BALL">   
151      </bezel>
152      <bezel name="lamp23" element="BALL">
153153         <bounds x="1345.46124433281" y="373.087013532536" width="16" height="16" />
154      </bezel>   
155      <bezel name="lamp24" element="BALL">   
154      </bezel>
155      <bezel name="lamp24" element="BALL">
156156         <bounds x="1346.9967496707" y="392.872104633103" width="16" height="16" />
157      </bezel>   
158      <bezel name="lamp25" element="BALL">   
157      </bezel>
158      <bezel name="lamp25" element="BALL">
159159         <bounds x="1345.16647153601" y="412.632106871213" width="16" height="16" />
160      </bezel>   
161      <bezel name="lamp26" element="BALL">   
160      </bezel>
161      <bezel name="lamp26" element="BALL">
162162         <bounds x="1340.0230636983" y="431.798560959421" width="16" height="16" />
163      </bezel>   
164      <bezel name="lamp27" element="BALL">   
163      </bezel>
164      <bezel name="lamp27" element="BALL">
165165         <bounds x="1331.71449263647" y="449.820082909883" width="16" height="16" />
166      </bezel>   
167      <bezel name="lamp28" element="BALL">   
166      </bezel>
167      <bezel name="lamp28" element="BALL">
168168         <bounds x="1320.4797808126" y="466.178226347788" width="16" height="16" />
169      </bezel>   
170      <bezel name="lamp29" element="BALL">   
169      </bezel>
170      <bezel name="lamp29" element="BALL">
171171         <bounds x="1306.64213043088" y="480.402397269624" width="16" height="16" />
172      </bezel>   
173      <bezel name="lamp30" element="BALL">   
172      </bezel>
173      <bezel name="lamp30" element="BALL">
174174         <bounds x="1290.59962549863" y="492.083392175853" width="16" height="16" />
175      </bezel>   
176      <bezel name="lamp31" element="BALL">   
175      </bezel>
176      <bezel name="lamp31" element="BALL">
177177         <bounds x="1272.81377967425" y="500.885170110556" width="16" height="16" />
178      </bezel>   
179      <bezel name="lamp32" element="BALL">   
178      </bezel>
179      <bezel name="lamp32" element="BALL">
180180         <bounds x="1253.7962593595" y="506.554519947908" width="16" height="16" />
181      </bezel>   
182      <bezel name="lamp33" element="BALL">   
181      </bezel>
182      <bezel name="lamp33" element="BALL">
183183         <bounds x="1234.09416398871" y="508.928344815248" width="16" height="16" />
184      </bezel>   
185      <bezel name="lamp34" element="BALL">   
184      </bezel>
185      <bezel name="lamp34" element="BALL">
186186         <bounds x="1214.27428697419" y="507.938354093155" width="16" height="16" />
187      </bezel>   
188      <bezel name="lamp35" element="BALL">   
187      </bezel>
188      <bezel name="lamp35" element="BALL">
189189         <bounds x="1194.90681009169" y="503.613028012232" width="16" height="16" />
190      </bezel>   
191      <bezel name="lamp36" element="BALL">   
190      </bezel>
191      <bezel name="lamp36" element="BALL">
192192         <bounds x="1176.54890038884" y="496.076798328726" width="16" height="16" />
193      </bezel>   
194      <bezel name="lamp37" element="BALL">   
193      </bezel>
194      <bezel name="lamp37" element="BALL">
195195         <bounds x="1159.72868150364" y="485.546468649452" width="16" height="16" />
196      </bezel>   
197      <bezel name="lamp38" element="BALL">   
196      </bezel>
197      <bezel name="lamp38" element="BALL">
198198         <bounds x="1144.93004050891" y="472.32497738676" width="16" height="16" />
199      </bezel>   
200      <bezel name="lamp39" element="BALL">   
199      </bezel>
200      <bezel name="lamp39" element="BALL">
201201         <bounds x="1132.57870736225" y="456.792682771969" width="16" height="16" />
202      </bezel>   
203      <bezel name="lamp40" element="BALL">   
202      </bezel>
203      <bezel name="lamp40" element="BALL">
204204         <bounds x="1123.03000743027" y="439.396420641569" width="16" height="16" />
205      </bezel>   
206      <bezel name="lamp41" element="BALL">   
205      </bezel>
206      <bezel name="lamp41" element="BALL">
207207         <bounds x="1116.55863942476" y="420.636649783757" width="16" height="16" />
208      </bezel>   
209      <bezel name="lamp42" element="BALL">   
208      </bezel>
209      <bezel name="lamp42" element="BALL">
210210         <bounds x="1113.35077282082" y="401.053054650283" width="16" height="16" />
211      </bezel>   
212      <bezel name="lamp43" element="BALL">   
211      </bezel>
212      <bezel name="lamp43" element="BALL">
213213         <bounds x="1113.49869210012" y="381.209019617376" width="16" height="16" />
214      </bezel>   
215      <bezel name="lamp44" element="BALL">   
214      </bezel>
215      <bezel name="lamp44" element="BALL">
216216         <bounds x="1116.99814189431" y="361.675421442988" width="16" height="16" />
217      </bezel>   
218      <bezel name="lamp45" element="BALL">   
217      </bezel>
218      <bezel name="lamp45" element="BALL">
219219         <bounds x="1123.74844940422" y="343.014206181865" width="16" height="16" />
220      </bezel>   
221      <bezel name="lamp46" element="BALL">   
220      </bezel>
221      <bezel name="lamp46" element="BALL">
222222         <bounds x="1133.55542057307" y="325.762223020679" width="16" height="16" />
223      </bezel>   
224      <bezel name="lamp47" element="BALL">   
223      </bezel>
224      <bezel name="lamp47" element="BALL">
225225         <bounds x="1146.13692669582" y="310.415780104371" width="16" height="16" />
226      </bezel>   
227      <bezel name="lamp48" element="BALL">   
226      </bezel>
227      <bezel name="lamp48" element="BALL">
228228         <bounds x="1161.13102074843" y="297.416366654444" width="16" height="16" />
229      </bezel>   
230      <bezel name="lamp49" element="BALL">   
229      </bezel>
230      <bezel name="lamp49" element="BALL">
231231         <bounds x="1178.10634994466" y="287.137952127882" width="16" height="16" />
232      </bezel>   
233      <bezel name="lamp50" element="BALL">   
232      </bezel>
233      <bezel name="lamp50" element="BALL">
234234         <bounds x="1196.57456497046" y="279.876227796751" width="16" height="16" />
235      </bezel>   
236      <bezel name="lamp51" element="BALL">   
235      </bezel>
236      <bezel name="lamp51" element="BALL">
237237         <bounds x="1216.00436890452" y="275.840100248669" width="16" height="16" />
238      </bezel>   
239      <bezel name="lamp52" element="BALL">   
238      </bezel>
239      <bezel name="lamp52" element="BALL">
240240         <bounds x="1235.83680166342" y="275.145681524636" width="16" height="16" />
241      </bezel>   
242      <bezel name="lamp53" element="BALL">   
241      </bezel>
242      <bezel name="lamp53" element="BALL">
243243         <bounds x="1255.5013202655" y="277.812948787016" width="16" height="16" />
244      </bezel>   
245      <bezel name="lamp54" element="BALL">   
244      </bezel>
245      <bezel name="lamp54" element="BALL">
246246         <bounds x="1274.43221231367" y="283.765169612954" width="16" height="16" />
247      </bezel>   
248      <bezel name="lamp55" element="BALL">   
247      </bezel>
248      <bezel name="lamp55" element="BALL">
249249         <bounds x="1292.08487051111" y="292.831109446467" width="16" height="16" />
250      </bezel>   
251      <bezel name="lamp56" element="BALL">   
250      </bezel>
251      <bezel name="lamp56" element="BALL">
252252         <bounds x="1307.95146002158" y="304.749957704861" width="16" height="16" />
253      </bezel>   
253      </bezel>
254254
255255   </view>
256256</mamelayout>
src/mame/layout/tx1.lay
r11240r11241
5757      </screen>
5858      <screen index="2">
5959         <bounds x="1280" y="0" width="640" height="480" />
60      </screen>     
61     
60      </screen>
61
6262<bezel element="shifter" inputtag="PPI_PORTC" inputmask="0x08">
6363
6464         <bounds x="1886" y="414" width="32" height="64" />
r11240r11241
7474      </screen>
7575      <screen index="2">
7676         <bounds x="1280" y="0" width="640" height="480" />
77      </screen>     
78     
77      </screen>
78
7979<bezel element="shifter" inputtag="PPI_PORTC" inputmask="0x08">
8080
8181         <bounds x="2" y="414" width="32" height="64" />
r11240r11241
8585   <view name="Shifter-1R">
8686      <screen index="1">
8787         <bounds x="0" y="0" width="640" height="480" />
88      </screen>     
89     
88      </screen>
89
9090<bezel element="shifter" inputtag="PPI_PORTC" inputmask="0x08">
9191
9292         <bounds x="606" y="414" width="32" height="64" />
r11240r11241
9696   <view name="Shifter-1L">
9797      <screen index="1">
9898         <bounds x="0" y="0" width="640" height="480" />
99      </screen>     
100     
99      </screen>
100
101101<bezel element="shifter" inputtag="PPI_PORTC" inputmask="0x08">
102102
103103         <bounds x="2" y="414" width="32" height="64" />
src/mame/layout/finallap.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="MCUH" inputmask="0x20">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="MCUH" inputmask="0x20">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/turbotag.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="480" height="640" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="SSIO.IP0" inputmask="0x10">
5656         <bounds x="446" y="574" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="480" height="640" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="SSIO.IP0" inputmask="0x10">
6565         <bounds x="2" y="574" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/radr.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="P1_A" inputmask="0x01">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="P1_A" inputmask="0x01">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/outrun.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="SERVICE" inputmask="0x10">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="SERVICE" inputmask="0x10">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/gamball.lay
r11240r11241
6868         <color red="1.0" green="1.0" blue="0.0" />
6969         <bounds x="0" y="0.1" width="1" height="1" />
7070      </text>
71   </element>   
71   </element>
7272   <element name="6" defstate="0">
7373      <text string="6" state="0">
7474         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
201201      <text string="HI">
202202         <color red="0.0" green="0.0" blue="0.0" />
203203         <bounds x="0" y="0.1" width="1" height="0.8" />
204      </text>   
204      </text>
205205   </element>
206206   <element name="lo" defstate="0">
207207      <rect state="1">
r11240r11241
213213      <text string="LO">
214214         <color red="0.0" green="0.0" blue="0.0" />
215215         <bounds x="0" y="0.1" width="1" height="0.8" />
216      </text>   
216      </text>
217217   </element>
218218   <element name="cancol" defstate="0">
219219      <rect state="1">
r11240r11241
225225      <text string="CANCEL / COLLECT">
226226         <color red="0.0" green="0.0" blue="0.0" />
227227         <bounds x="0" y="0" width="1" height=".6" />
228      </text>   
228      </text>
229229   </element>
230230   <element name="hold" defstate="0">
231231      <rect state="1">
r11240r11241
237237      <text string="HOLD / NUDGE">
238238         <color red="0.0" green="0.0" blue="0.0" />
239239         <bounds x="0" y="0" width="1" height=".6" />
240      </text>   
240      </text>
241241   </element>
242242   <element name="start" defstate="0">
243243      <rect state="1">
r11240r11241
249249      <text string="START">
250250         <color red="0.0" green="0.0" blue="0.0" />
251251         <bounds x="0" y="0" width="1" height=".6" />
252      </text>   
252      </text>
253253   </element>
254254   <element name="credit" defstate="0">
255255      <text string="CREDIT" state="0">
r11240r11241
643643         <bounds x="0" y="0.1" width="1" height="1" />
644644      </text>
645645   </element>
646   
646
647647   <element name="Reel2" defstate="96">
648648      <text string="7" state="0">
649649         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
788788      <text string="Bar" state="35">
789789         <color red="1.0" green="1.0" blue="1.0" />
790790         <bounds x="0" y="0.1" width="1" height="1" />
791      </text>   
791      </text>
792792      <text string="7" state="36">
793793         <color red="1.0" green="1.0" blue="1.0" />
794794         <bounds x="0" y="0.1" width="1" height="1" />
r11240r11241
10301030         <bounds x="0" y="0.1" width="1" height="1" />
10311031      </text>
10321032   </element>
1033   
1033
10341034   <element name="Reel3" defstate="96">
10351035      <text string="7" state="0">
10361036         <color red="1.0" green="1.0" blue="1.0" />
src/mame/layout/sspeedr.lay
r11240r11241
55         <color red="1.0" green="0.3" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <element name="panel">
1010      <rect>
1111         <bounds left="-168.29" top="0" right="0" bottom="376" />
1212         <color red="0.0" green="0.0" blue="0.0" />
1313      </rect>
14     
14
1515      <text string="1ST">
1616         <bounds left="-88" top="33" right="0" bottom="52" />
1717      </text>
18     
18
1919      <text string="2ND">
2020         <bounds left="-88" top="60" right="0" bottom="79" />
2121      </text>
22     
22
2323      <text string="3RD">
2424         <bounds left="-88" top="87" right="0" bottom="106" />
2525      </text>
26     
26
2727      <text string="4TH">
2828         <bounds left="-88" top="114" right="0" bottom="133" />
2929      </text>
30     
30
3131      <text string="5TH">
3232         <bounds left="-88" top="141" right="0" bottom="160" />
3333      </text>
34     
34
3535      <text string="SCORE">
3636         <bounds left="-88" top="175" right="0" bottom="194" />
3737      </text>
38     
38
3939      <text string="TIME">
4040         <bounds left="-88" top="264" right="0" bottom="283" />
4141      </text>
src/mame/layout/geebee.lay
r11240r11241
2424         <bounds left="32.5" top="32.5" right="191.5" bottom="40.5" />
2525         <color red="1" green="0.816" blue="0" />
2626      </rect>
27     
27
2828      <rect>
2929         <bounds left="215.5" top="40.5" right="224" bottom="223.5" />
3030         <color red="0.627" green="0" blue="0.878" />
src/mame/layout/grchamp.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="480" height="640" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="TILT" inputmask="0x04">
5656         <bounds x="446" y="574" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="480" height="640" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="TILT" inputmask="0x04">
6565         <bounds x="2" y="574" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/pdrift.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="GENERAL" inputmask="0x20">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="GENERAL" inputmask="0x20">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/tenpindx.lay
r11240r11241
99         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
1010      </text>
1111   </element>
12   
12
1313   <element name="pin2" defstate="0">
1414      <disk state="1">
1515         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
1919         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
2020      </text>
2121   </element>
22   
22
2323   <element name="pin3" defstate="0">
2424      <disk state="1">
2525         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
2929         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
3030      </text>
3131   </element>
32   
32
3333   <element name="pin4" defstate="0">
3434      <disk state="1">
3535         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
3939         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
4040      </text>
4141   </element>
42   
42
4343   <element name="pin5" defstate="0">
4444      <disk state="1">
4545         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
4949         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
5050      </text>
5151   </element>
52   
52
5353   <element name="pin6" defstate="0">
5454      <disk state="1">
5555         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
5959         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
6060      </text>
6161   </element>
62   
62
6363   <element name="pin7" defstate="0">
6464      <disk state="1">
6565         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
6969         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
7070      </text>
7171   </element>
72   
72
7373   <element name="pin8" defstate="0">
7474      <disk state="1">
7575         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
7979         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
8080      </text>
8181   </element>
82   
82
8383   <element name="pin9" defstate="0">
8484      <disk state="1">
8585         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
8989         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
9090      </text>
9191   </element>
92   
92
9393   <element name="pin10" defstate="0">
9494      <disk state="1">
9595         <color red="1.0" green="1.0" blue="1.0" />
r11240r11241
9999         <bounds x="0.2" y="0.2" width="0.6" height="0.6" />
100100      </text>
101101   </element>
102   
102
103103   <element name="flash" defstate="0">
104104      <disk state="1">
105105         <color red="1.0" green="0.4" blue="0.4" />
106106      </disk>
107107   </element>
108   
108
109109   <view name="Lamps">
110110      <bounds left="-2" top="0" right="2" bottom="3.4" />
111   
111
112112      <screen index="0">
113113         <bounds left="-2" top="0" right="2" bottom="3" />
114114      </screen>
115     
115
116116      <bezel name="lamp0" element="pin1">
117117         <bounds x="-0.15" y="2.25" width="0.3" height="0.3" />
118118         <color alpha="0.7" />
r11240r11241
153153         <bounds x="0.90" y="0.75" width="0.3" height="0.3" />
154154         <color alpha="0.7" />
155155      </bezel>
156     
156
157157      <bezel name="lamp10" element="flash">
158158         <bounds x="-1.72" y="3.25" width="0.1" height="0.1" />
159159      </bezel>
src/mame/layout/turbo.lay
r11240r11241
55         <color red="1.0" green="0.3" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <element name="speed" defstate="0">
1010      <rect>
1111         <bounds x="0" y="0" width="86" height="26" />
r11240r11241
198198       <bezel name="digit26" element="digit">
199199           <bounds left="-44" top="50" right="-39" bottom="60" />
200200       </bezel>
201   </view>   
201   </view>
202202</mamelayout>
src/mame/layout/re800.lay
r11240r11241
2525         <bounds left="100" top="96" right="832" bottom="1072" />
2626      </screen>
2727
28      <bezel name="lamp0" element="BALL0">   
28      <bezel name="lamp0" element="BALL0">
2929         <bounds x="1321.5755279531" y="319.178830824334" width="16" height="16" />
30      </bezel>   
31      <bezel name="lamp1" element="BALL">   
30      </bezel>
31      <bezel name="lamp1" element="BALL">
3232         <bounds x="1332.56513467655" y="335.702636395822" width="16" height="16" />
33      </bezel>   
34      <bezel name="lamp2" element="BALL">   
33      </bezel>
34      <bezel name="lamp2" element="BALL">
3535         <bounds x="1340.60412921523" y="353.84601461785" width="16" height="16" />
36      </bezel>   
37      <bezel name="lamp3" element="BALL">   
36      </bezel>
37      <bezel name="lamp3" element="BALL">
3838         <bounds x="1345.46124433281" y="373.087013532536" width="16" height="16" />
39      </bezel>   
40      <bezel name="lamp4" element="BALL">   
39      </bezel>
40      <bezel name="lamp4" element="BALL">
4141         <bounds x="1346.9967496707" y="392.872104633103" width="16" height="16" />
42      </bezel>   
43      <bezel name="lamp5" element="BALL">   
42      </bezel>
43      <bezel name="lamp5" element="BALL">
4444         <bounds x="1345.16647153601" y="412.632106871213" width="16" height="16" />
45      </bezel>   
46      <bezel name="lamp6" element="BALL">   
45      </bezel>
46      <bezel name="lamp6" element="BALL">
4747         <bounds x="1340.0230636983" y="431.798560959421" width="16" height="16" />
48      </bezel>   
49      <bezel name="lamp7" element="BALL">   
48      </bezel>
49      <bezel name="lamp7" element="BALL">
5050         <bounds x="1331.71449263647" y="449.820082909883" width="16" height="16" />
51      </bezel>   
52      <bezel name="lamp8" element="BALL">   
51      </bezel>
52      <bezel name="lamp8" element="BALL">
5353         <bounds x="1320.4797808126" y="466.178226347788" width="16" height="16" />
54      </bezel>   
55      <bezel name="lamp9" element="BALL">   
54      </bezel>
55      <bezel name="lamp9" element="BALL">
5656         <bounds x="1306.64213043088" y="480.402397269624" width="16" height="16" />
57      </bezel>   
58      <bezel name="lamp10" element="BALL">   
57      </bezel>
58      <bezel name="lamp10" element="BALL">
5959         <bounds x="1290.59962549863" y="492.083392175853" width="16" height="16" />
60      </bezel>   
61      <bezel name="lamp11" element="BALL">   
60      </bezel>
61      <bezel name="lamp11" element="BALL">
6262         <bounds x="1272.81377967425" y="500.885170110556" width="16" height="16" />
63      </bezel>   
64      <bezel name="lamp12" element="BALL">   
63      </bezel>
64      <bezel name="lamp12" element="BALL">
6565         <bounds x="1253.7962593595" y="506.554519947908" width="16" height="16" />
66      </bezel>   
67      <bezel name="lamp13" element="BALL">   
66      </bezel>
67      <bezel name="lamp13" element="BALL">
6868         <bounds x="1234.09416398871" y="508.928344815248" width="16" height="16" />
69      </bezel>   
70      <bezel name="lamp14" element="BALL">   
69      </bezel>
70      <bezel name="lamp14" element="BALL">
7171         <bounds x="1214.27428697419" y="507.938354093155" width="16" height="16" />
72      </bezel>   
73      <bezel name="lamp15" element="BALL">   
72      </bezel>
73      <bezel name="lamp15" element="BALL">
7474         <bounds x="1194.90681009169" y="503.613028012232" width="16" height="16" />
75      </bezel>   
76      <bezel name="lamp16" element="BALL">   
75      </bezel>
76      <bezel name="lamp16" element="BALL">
7777         <bounds x="1176.54890038884" y="496.076798328726" width="16" height="16" />
78      </bezel>   
79      <bezel name="lamp17" element="BALL">   
78      </bezel>
79      <bezel name="lamp17" element="BALL">
8080         <bounds x="1159.72868150364" y="485.546468649452" width="16" height="16" />
81      </bezel>   
82      <bezel name="lamp18" element="BALL">   
81      </bezel>
82      <bezel name="lamp18" element="BALL">
8383         <bounds x="1144.93004050891" y="472.32497738676" width="16" height="16" />
84      </bezel>   
85      <bezel name="lamp19" element="BALL">   
84      </bezel>
85      <bezel name="lamp19" element="BALL">
8686         <bounds x="1132.57870736225" y="456.792682771969" width="16" height="16" />
87      </bezel>   
88      <bezel name="lamp20" element="BALL">   
87      </bezel>
88      <bezel name="lamp20" element="BALL">
8989         <bounds x="1123.03000743027" y="439.396420641569" width="16" height="16" />
90      </bezel>   
91      <bezel name="lamp21" element="BALL">   
90      </bezel>
91      <bezel name="lamp21" element="BALL">
9292         <bounds x="1116.55863942476" y="420.636649783757" width="16" height="16" />
93      </bezel>   
94      <bezel name="lamp22" element="BALL">   
93      </bezel>
94      <bezel name="lamp22" element="BALL">
9595         <bounds x="1113.35077282082" y="401.053054650283" width="16" height="16" />
96      </bezel>   
97      <bezel name="lamp23" element="BALL">   
96      </bezel>
97      <bezel name="lamp23" element="BALL">
9898         <bounds x="1113.49869210012" y="381.209019617376" width="16" height="16" />
99      </bezel>   
100      <bezel name="lamp24" element="BALL">   
99      </bezel>
100      <bezel name="lamp24" element="BALL">
101101         <bounds x="1116.99814189431" y="361.675421442988" width="16" height="16" />
102      </bezel>   
103      <bezel name="lamp25" element="BALL">   
102      </bezel>
103      <bezel name="lamp25" element="BALL">
104104         <bounds x="1123.74844940422" y="343.014206181865" width="16" height="16" />
105      </bezel>   
106      <bezel name="lamp26" element="BALL">   
105      </bezel>
106      <bezel name="lamp26" element="BALL">
107107         <bounds x="1133.55542057307" y="325.762223020679" width="16" height="16" />
108      </bezel>   
109      <bezel name="lamp27" element="BALL">   
108      </bezel>
109      <bezel name="lamp27" element="BALL">
110110         <bounds x="1146.13692669582" y="310.415780104371" width="16" height="16" />
111      </bezel>   
112      <bezel name="lamp28" element="BALL">   
111      </bezel>
112      <bezel name="lamp28" element="BALL">
113113         <bounds x="1161.13102074843" y="297.416366654444" width="16" height="16" />
114      </bezel>   
115      <bezel name="lamp29" element="BALL">   
114      </bezel>
115      <bezel name="lamp29" element="BALL">
116116         <bounds x="1178.10634994466" y="287.137952127882" width="16" height="16" />
117      </bezel>   
118      <bezel name="lamp30" element="BALL">   
117      </bezel>
118      <bezel name="lamp30" element="BALL">
119119         <bounds x="1196.57456497046" y="279.876227796751" width="16" height="16" />
120      </bezel>   
121      <bezel name="lamp31" element="BALL">   
120      </bezel>
121      <bezel name="lamp31" element="BALL">
122122         <bounds x="1216.00436890452" y="275.840100248669" width="16" height="16" />
123      </bezel>   
124      <bezel name="lamp32" element="BALL">   
123      </bezel>
124      <bezel name="lamp32" element="BALL">
125125         <bounds x="1235.83680166342" y="275.145681524636" width="16" height="16" />
126      </bezel>   
127      <bezel name="lamp33" element="BALL">   
126      </bezel>
127      <bezel name="lamp33" element="BALL">
128128         <bounds x="1255.5013202655" y="277.812948787016" width="16" height="16" />
129      </bezel>   
130      <bezel name="lamp34" element="BALL">   
129      </bezel>
130      <bezel name="lamp34" element="BALL">
131131         <bounds x="1274.43221231367" y="283.765169612954" width="16" height="16" />
132      </bezel>   
133      <bezel name="lamp35" element="BALL">   
132      </bezel>
133      <bezel name="lamp35" element="BALL">
134134         <bounds x="1292.08487051111" y="292.831109446467" width="16" height="16" />
135      </bezel>   
136      <bezel name="lamp36" element="BALL">   
135      </bezel>
136      <bezel name="lamp36" element="BALL">
137137         <bounds x="1307.95146002158" y="304.749957704861" width="16" height="16" />
138      </bezel>   
138      </bezel>
139139
140140   </view>
141141</mamelayout>
src/mame/layout/overdriv.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="480" height="640" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="INPUTS" inputmask="0x01">
5656         <bounds x="446" y="574" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="480" height="640" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="INPUTS" inputmask="0x01">
6565         <bounds x="2" y="574" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/maxaflex.lay
r11240r11241
3939         <bounds x="0" y="0.1" width="1" height="0.8" />
4040      </text>
4141   </element>
42   
42
4343   <element name="digit" defstate="10">
4444      <led7seg>
4545         <color red="1.0" green="0.3" blue="0.0" />
src/mame/layout/buggybjr.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="YM2149_IC19_A" inputmask="0x40">
5656
5757         <bounds x="606" y="414" width="32" height="64" />
r11240r11241
6262   <view name="Shifter-L">
6363      <screen index="0">
6464         <bounds x="0" y="0" width="640" height="480" />
65      </screen>     
65      </screen>
6666      <bezel element="shifter" inputtag="YM2149_IC19_A" inputmask="0x40">
6767
6868         <bounds x="2" y="414" width="32" height="64" />
src/mame/layout/topracer.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x20">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x20">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/roul.lay
r11240r11241
2525         <bounds left="100" top="96" right="832" bottom="1072" />
2626      </screen>
2727
28      <bezel name="lamp134" element="BALL0">   
28      <bezel name="lamp134" element="BALL0">
2929         <bounds x="1321.5755279531" y="319.178830824334" width="16" height="16" />
30      </bezel>   
31      <bezel name="lamp135" element="BALL">   
30      </bezel>
31      <bezel name="lamp135" element="BALL">
3232         <bounds x="1332.56513467655" y="335.702636395822" width="16" height="16" />
33      </bezel>   
34      <bezel name="lamp8" element="BALL">   
33      </bezel>
34      <bezel name="lamp8" element="BALL">
3535         <bounds x="1340.60412921523" y="353.84601461785" width="16" height="16" />
36      </bezel>   
37      <bezel name="lamp9" element="BALL">   
36      </bezel>
37      <bezel name="lamp9" element="BALL">
3838         <bounds x="1345.46124433281" y="373.087013532536" width="16" height="16" />
39      </bezel>   
40      <bezel name="lamp10" element="BALL">   
39      </bezel>
40      <bezel name="lamp10" element="BALL">
4141         <bounds x="1346.9967496707" y="392.872104633103" width="16" height="16" />
42      </bezel>   
43      <bezel name="lamp11" element="BALL">   
42      </bezel>
43      <bezel name="lamp11" element="BALL">
4444         <bounds x="1345.16647153601" y="412.632106871213" width="16" height="16" />
45      </bezel>   
46      <bezel name="lamp12" element="BALL">   
45      </bezel>
46      <bezel name="lamp12" element="BALL">
4747         <bounds x="1340.0230636983" y="431.798560959421" width="16" height="16" />
48      </bezel>   
49      <bezel name="lamp13" element="BALL">   
48      </bezel>
49      <bezel name="lamp13" element="BALL">
5050         <bounds x="1331.71449263647" y="449.820082909883" width="16" height="16" />
51      </bezel>   
52      <bezel name="lamp14" element="BALL">   
51      </bezel>
52      <bezel name="lamp14" element="BALL">
5353         <bounds x="1320.4797808126" y="466.178226347788" width="16" height="16" />
54      </bezel>   
55      <bezel name="lamp16" element="BALL">   
54      </bezel>
55      <bezel name="lamp16" element="BALL">
5656         <bounds x="1306.64213043088" y="480.402397269624" width="16" height="16" />
57      </bezel>   
58      <bezel name="lamp17" element="BALL">   
57      </bezel>
58      <bezel name="lamp17" element="BALL">
5959         <bounds x="1290.59962549863" y="492.083392175853" width="16" height="16" />
60      </bezel>   
61      <bezel name="lamp18" element="BALL">   
60      </bezel>
61      <bezel name="lamp18" element="BALL">
6262         <bounds x="1272.81377967425" y="500.885170110556" width="16" height="16" />
63      </bezel>   
64      <bezel name="lamp19" element="BALL">   
63      </bezel>
64      <bezel name="lamp19" element="BALL">
6565         <bounds x="1253.7962593595" y="506.554519947908" width="16" height="16" />
66      </bezel>   
67      <bezel name="lamp20" element="BALL">   
66      </bezel>
67      <bezel name="lamp20" element="BALL">
6868         <bounds x="1234.09416398871" y="508.928344815248" width="16" height="16" />
69      </bezel>   
70      <bezel name="lamp21" element="BALL">   
69      </bezel>
70      <bezel name="lamp21" element="BALL">
7171         <bounds x="1214.27428697419" y="507.938354093155" width="16" height="16" />
72      </bezel>   
73      <bezel name="lamp22" element="BALL">   
72      </bezel>
73      <bezel name="lamp22" element="BALL">
7474         <bounds x="1194.90681009169" y="503.613028012232" width="16" height="16" />
75      </bezel>   
76      <bezel name="lamp32" element="BALL">   
75      </bezel>
76      <bezel name="lamp32" element="BALL">
7777         <bounds x="1176.54890038884" y="496.076798328726" width="16" height="16" />
78      </bezel>   
79      <bezel name="lamp33" element="BALL">   
78      </bezel>
79      <bezel name="lamp33" element="BALL">
8080         <bounds x="1159.72868150364" y="485.546468649452" width="16" height="16" />
81      </bezel>   
82      <bezel name="lamp34" element="BALL">   
81      </bezel>
82      <bezel name="lamp34" element="BALL">
8383         <bounds x="1144.93004050891" y="472.32497738676" width="16" height="16" />
84      </bezel>   
85      <bezel name="lamp35" element="BALL">   
84      </bezel>
85      <bezel name="lamp35" element="BALL">
8686         <bounds x="1132.57870736225" y="456.792682771969" width="16" height="16" />
87      </bezel>   
88      <bezel name="lamp36" element="BALL">   
87      </bezel>
88      <bezel name="lamp36" element="BALL">
8989         <bounds x="1123.03000743027" y="439.396420641569" width="16" height="16" />
90      </bezel>   
91      <bezel name="lamp37" element="BALL">   
90      </bezel>
91      <bezel name="lamp37" element="BALL">
9292         <bounds x="1116.55863942476" y="420.636649783757" width="16" height="16" />
93      </bezel>   
94      <bezel name="lamp38" element="BALL">   
93      </bezel>
94      <bezel name="lamp38" element="BALL">
9595         <bounds x="1113.35077282082" y="401.053054650283" width="16" height="16" />
96      </bezel>   
97      <bezel name="lamp64" element="BALL">   
96      </bezel>
97      <bezel name="lamp64" element="BALL">
9898         <bounds x="1113.49869210012" y="381.209019617376" width="16" height="16" />
99      </bezel>   
100      <bezel name="lamp65" element="BALL">   
99      </bezel>
100      <bezel name="lamp65" element="BALL">
101101         <bounds x="1116.99814189431" y="361.675421442988" width="16" height="16" />
102      </bezel>   
103      <bezel name="lamp66" element="BALL">   
102      </bezel>
103      <bezel name="lamp66" element="BALL">
104104         <bounds x="1123.74844940422" y="343.014206181865" width="16" height="16" />
105      </bezel>   
106      <bezel name="lamp67" element="BALL">   
105      </bezel>
106      <bezel name="lamp67" element="BALL">
107107         <bounds x="1133.55542057307" y="325.762223020679" width="16" height="16" />
108      </bezel>   
109      <bezel name="lamp68" element="BALL">   
108      </bezel>
109      <bezel name="lamp68" element="BALL">
110110         <bounds x="1146.13692669582" y="310.415780104371" width="16" height="16" />
111      </bezel>   
112      <bezel name="lamp69" element="BALL">   
111      </bezel>
112      <bezel name="lamp69" element="BALL">
113113         <bounds x="1161.13102074843" y="297.416366654444" width="16" height="16" />
114      </bezel>   
115      <bezel name="lamp70" element="BALL">   
114      </bezel>
115      <bezel name="lamp70" element="BALL">
116116         <bounds x="1178.10634994466" y="287.137952127882" width="16" height="16" />
117      </bezel>   
118      <bezel name="lamp71" element="BALL">   
117      </bezel>
118      <bezel name="lamp71" element="BALL">
119119         <bounds x="1196.57456497046" y="279.876227796751" width="16" height="16" />
120      </bezel>   
121      <bezel name="lamp128" element="BALL">   
120      </bezel>
121      <bezel name="lamp128" element="BALL">
122122         <bounds x="1216.00436890452" y="275.840100248669" width="16" height="16" />
123      </bezel>   
124      <bezel name="lamp129" element="BALL">   
123      </bezel>
124      <bezel name="lamp129" element="BALL">
125125         <bounds x="1235.83680166342" y="275.145681524636" width="16" height="16" />
126      </bezel>   
127      <bezel name="lamp130" element="BALL">   
126      </bezel>
127      <bezel name="lamp130" element="BALL">
128128         <bounds x="1255.5013202655" y="277.812948787016" width="16" height="16" />
129      </bezel>   
130      <bezel name="lamp131" element="BALL">   
129      </bezel>
130      <bezel name="lamp131" element="BALL">
131131         <bounds x="1274.43221231367" y="283.765169612954" width="16" height="16" />
132      </bezel>   
133      <bezel name="lamp132" element="BALL">   
132      </bezel>
133      <bezel name="lamp132" element="BALL">
134134         <bounds x="1292.08487051111" y="292.831109446467" width="16" height="16" />
135      </bezel>   
136      <bezel name="lamp133" element="BALL">   
135      </bezel>
136      <bezel name="lamp133" element="BALL">
137137         <bounds x="1307.95146002158" y="304.749957704861" width="16" height="16" />
138      </bezel>   
138      </bezel>
139139
140140   </view>
141141</mamelayout>
src/mame/layout/dlair.lay
r11240r11241
55         <color red="1.0" green="0.3" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <view name="Simple LEDs">
1010      <screen index="0">
1111         <bounds left="0" top="0" right="4" bottom="3" />
r11240r11241
7979      <bezel name="digit15" element="digit">
8080         <bounds x="1.9" y="-0.3" width="0.2" height="0.3" />
8181      </bezel>
82   </view>   
82   </view>
8383</mamelayout>
src/mame/layout/chqflag.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="480" height="640" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN2" inputmask="0x01">
5656         <bounds x="446" y="574" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="480" height="640" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN2" inputmask="0x01">
6565         <bounds x="2" y="574" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/dblaxle.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0" inputmask="0x02">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0" inputmask="0x02">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/videodad.lay
r11240r11241
139139         <bounds x="3.92" y="3.2" width="0.05" height="0.06" />
140140      </bezel>
141141      <bezel name="digit8" element="Dig1">
142          <bounds x="3.87" y="3.2" width="0.05" height="0.06" />
142         <bounds x="3.87" y="3.2" width="0.05" height="0.06" />
143143      </bezel>
144144      <bezel name="digit9" element="Dig1">
145145         <bounds x="3.82" y="3.2" width="0.05" height="0.06" />
src/mame/layout/armora.lay
r11240r11241
180180         <orientation flipy="yes" />
181181      </backdrop>
182182      <screen index="0">
183                 <bounds x="0" y="0" width="1024" height="768" />
183              <bounds x="0" y="0" width="1024" height="768" />
184184      </screen>
185185   </view>
186186</mamelayout>
No newline at end of file
src/mame/layout/subroc3d.lay
r11240r11241
55         <color red="1.0" green="0.3" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <view name="Simple LEDs">
1010      <bounds left="0" top="-0.472" right="4" bottom="3" />
1111
r11240r11241
8989         <bounds left="3.770" top="-0.306" right="3.870" bottom="-0.136" />
9090      </bezel>
9191
92   </view>   
92   </view>
9393</mamelayout>
src/mame/layout/pirpok2.lay
r11240r11241
1414      <text string="BET">
1515         <color red="0.0" green="0.0" blue="0.0" />
1616         <bounds x="0" y="0.6" width="1" height="0.4" />
17      </text>   
17      </text>
1818   </element>
1919
2020   <element name="CARD2" defstate="1">
r11240r11241
3131      <text string="BIG">
3232         <color red="0.0" green="0.0" blue="0.0" />
3333         <bounds x="0" y="0.6" width="1" height="0.4" />
34      </text>   
35   </element>   
36   
34      </text>
35   </element>
36
3737   <element name="CARD3" defstate="1">
3838      <rect state="1">
3939         <color red="1.0" green="0.0" blue="0.0" />
r11240r11241
4848      <text string="DOUBLE">
4949         <color red="0.0" green="0.0" blue="0.0" />
5050         <bounds x="0" y="0.6" width="1" height="0.4" />
51      </text>   
52   </element>     
53   
51      </text>
52   </element>
53
5454   <element name="CARD4" defstate="1">
5555      <rect state="1">
5656         <color red="1.0" green="0.0" blue="0.0" />
r11240r11241
6565      <text string="SMALL">
6666         <color red="0.0" green="0.0" blue="0.0" />
6767         <bounds x="0" y="0.6" width="1" height="0.4" />
68      </text>   
68      </text>
6969   </element>
7070
7171   <element name="CARD5" defstate="1">
r11240r11241
8282      <text string="     ">
8383         <color red="0.0" green="0.0" blue="0.0" />
8484         <bounds x="0" y="0.6" width="1" height="0.4" />
85      </text>   
86   </element>     
85      </text>
86   </element>
8787
8888   <element name="START" defstate="1">
8989      <rect state="1">
r11240r11241
9999      <text string="TAKE">
100100         <color red="0.0" green="0.0" blue="0.0" />
101101         <bounds x="0" y="0.6" width="1" height="0.4" />
102      </text>   
103   </element>         
104   
102      </text>
103   </element>
104
105105   <view name="Button Lamps">
106106      <screen index="0">
107107         <bounds left="0" top="0" right="4" bottom="3" />
r11240r11241
114114      </bezel>
115115      <bezel name="lamp2" element="CARD3">
116116         <bounds x="1.0" y="3.15" width="0.40" height="0.24" />
117      </bezel>   
117      </bezel>
118118      <bezel name="lamp3" element="CARD4">
119119         <bounds x="1.5" y="3.15" width="0.40" height="0.24" />
120      </bezel>   
120      </bezel>
121121      <bezel name="lamp4" element="CARD5">
122122         <bounds x="2.0" y="3.15" width="0.40" height="0.24" />
123      </bezel>     
123      </bezel>
124124      <bezel name="lamp5" element="START">
125125         <bounds x="2.5" y="3.15" width="0.40" height="0.24" />
126      </bezel>     
126      </bezel>
127127   </view>
128128</mamelayout>
src/mame/layout/cbombers.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="INPUTS" inputmask="0x01000000">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="INPUTS" inputmask="0x01000000">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/buckrog.lay
r11240r11241
55         <color red="1.0" green="0.3" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <view name="Simple LEDs">
1010       <bounds left="-59" top="0" right="330" bottom="248" />
1111
r11240r11241
138138       <bezel name="digit9" element="digit">
139139           <bounds left="-44" top="50" right="-39" bottom="60" />
140140       </bezel>
141   </view>   
141   </view>
142142</mamelayout>
src/mame/layout/contcirc.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN1" inputmask="0x10">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN1" inputmask="0x10">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/namcofl.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN1" inputmask="0x10">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN1" inputmask="0x10">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/18w.lay
r11240r11241
55         <color red="1.0" green="0.3" blue="0.0" />
66      </led7seg>
77   </element>
8   
8
99   <view name="Simple LEDs">
1010      <bounds left="0" right="256" top="0" bottom="256" />
11     
11
1212      <!-- left panel -->
1313      <!-- TIME -->
1414      <bezel name="digit3" element="digit">
r11240r11241
1717      <bezel name="digit2" element="digit">
1818         <bounds left="10" top="0" right="19" bottom="15" />
1919      </bezel>
20     
20
2121      <!-- not connected -->
2222      <bezel name="dummy_digita" element="digit">
2323         <bounds left="20" top="0" right="29" bottom="15" />
r11240r11241
2525      <bezel name="dummy_digitb" element="digit">
2626         <bounds left="30" top="0" right="39" bottom="15" />
2727      </bezel>
28     
28
2929      <!-- M.P.H. -->
3030      <bezel name="digit1" element="digit">
3131         <bounds left="40" top="0" right="49" bottom="15" />
r11240r11241
3333      <bezel name="digit0" element="digit">
3434         <bounds left="50" top="0" right="59" bottom="15" />
3535      </bezel>
36     
36
3737      <!-- right panel -->
3838      <!-- SCORE -->
3939      <bezel name="digit9" element="digit">
src/mame/layout/roundup5.lay
r11240r11241
5151   <view name="Shifter-L">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
55     
54      </screen>
55
5656<bezel element="shifter" inputtag="IN0" inputmask="0x0008">
5757
5858         <bounds x="606" y="414" width="32" height="64" />
r11240r11241
6262   <view name="Shifter-R">
6363      <screen index="0">
6464         <bounds x="0" y="0" width="640" height="480" />
65      </screen>     
66     
65      </screen>
66
6767<bezel element="shifter" inputtag="IN0" inputmask="0x0008">
6868
6969         <bounds x="2" y="414" width="32" height="64" />
src/mame/layout/polepos.lay
r11240r11241
5151   <view name="Shifter-R">
5252      <screen index="0">
5353         <bounds x="0" y="0" width="640" height="480" />
54      </screen>     
54      </screen>
5555      <bezel element="shifter" inputtag="IN0L" inputmask="0x02">
5656         <bounds x="606" y="414" width="32" height="64" />
5757         <color alpha="0.6" />
r11240r11241
6060   <view name="Shifter-L">
6161      <screen index="0">
6262         <bounds x="0" y="0" width="640" height="480" />
63      </screen>     
63      </screen>
6464      <bezel element="shifter" inputtag="IN0L" inputmask="0x02">
6565         <bounds x="2" y="414" width="32" height="64" />
6666         <color alpha="0.6" />
src/mame/layout/elecyoyo.lay
r11240r11241
1616      </bezel>
1717      <bezel element="crop">
1818         <bounds x="288" y="385" width="12" height="15" />
19      </bezel>     
19      </bezel>
2020      <screen index="0">
21                 <bounds x="0" y="0" width="300" height="400" />
21              <bounds x="0" y="0" width="300" height="400" />
2222      </screen>
2323   </view>
2424</mamelayout>
src/mame/drivers/model2.c
r11240r11241
21902190   MCFG_TIMER_ADD("timer3", model2_timer_cb)
21912191   MCFG_TIMER_PTR((FPTR)3)
21922192
2193   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
2194
21932195   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK )
21942196
21952197   MCFG_SCREEN_ADD("screen", RASTER)
r11240r11241
22362238   MCFG_TIMER_ADD("timer3", model2_timer_cb)
22372239   MCFG_TIMER_PTR((FPTR)3)
22382240
2241   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
2242
22392243   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK )
22402244
22412245   MCFG_SCREEN_ADD("screen", RASTER)
src/mame/drivers/igs017.c
r11240r11241
249249{
250250   igs017_state *state = machine.driver_data<igs017_state>();
251251   // prepare GfxElement on the fly
252   gfx_element gfx;
252   gfx_element gfx(machine);
253253
254254   // Bounds checking
255255   if ( addr + dimx * dimy >= state->m_sprites_gfx_size )
src/mame/drivers/liberatr.c
r11240r11241
161161
162162WRITE8_MEMBER( liberatr_state::led_w )
163163{
164   set_led_status(m_machine, offset, ~data & 0x10);
164   set_led_status(machine(), offset, ~data & 0x10);
165165}
166166
167167
168168WRITE8_MEMBER( liberatr_state::coin_counter_w )
169169{
170   ::coin_counter_w(m_machine, offset ^ 0x01, data & 0x10);
170   ::coin_counter_w(machine(), offset ^ 0x01, data & 0x10);
171171}
172172
173173
r11240r11241
184184   /* input becomes the starting point for the trackball counters */
185185   if (((data ^ m_ctrld) & 0x10) && (data & 0x10))
186186   {
187      UINT8 trackball = input_port_read(m_machine, "FAKE");
188      UINT8 switches = input_port_read(m_machine, "IN0");
187      UINT8 trackball = input_port_read(machine(), "FAKE");
188      UINT8 switches = input_port_read(machine(), "IN0");
189189      m_trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f);
190190   }
191191   m_ctrld = data & 0x10;
r11240r11241
197197   /* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */
198198   if (m_ctrld)
199199   {
200      UINT8 trackball = input_port_read(m_machine, "FAKE");
200      UINT8 trackball = input_port_read(machine(), "FAKE");
201201      return ((trackball & 0xf0) - (m_trackball_offset & 0xf0)) | ((trackball - m_trackball_offset) & 0x0f);
202202   }
203203
204204   /* otherwise, the LS191 is simply passing through the raw switch inputs */
205205   else
206      return input_port_read(m_machine, "IN0");
206      return input_port_read(machine(), "IN0");
207207}
208208
209209
src/mame/drivers/beathead.c
r11240r11241
142142
143143void beathead_state::machine_start()
144144{
145   atarigen_init(m_machine);
145   atarigen_init(machine());
146146}
147147
148148
r11240r11241
159159   memcpy(m_ram_base, m_rom_base, 0x40);
160160
161161   /* compute the timing of the HBLANK interrupt and set the first timer */
162   m_hblank_offset = m_machine.primary_screen->scan_period() * (455 - 336 - 25) / 455;
163   timer_device *scanline_timer = m_machine.device<timer_device>("scan_timer");
164   scanline_timer->adjust(m_machine.primary_screen->time_until_pos(0) - m_hblank_offset);
162   m_hblank_offset = machine().primary_screen->scan_period() * (455 - 336 - 25) / 455;
163   timer_device *scanline_timer = machine().device<timer_device>("scan_timer");
164   scanline_timer->adjust(machine().primary_screen->time_until_pos(0) - m_hblank_offset);
165165
166166   /* reset IRQs */
167167   m_irq_line_state = CLEAR_LINE;
r11240r11241
192192   {
193193      m_irq_line_state = gen_int;
194194      //if (m_irq_line_state != CLEAR_LINE)
195         cputag_set_input_line(m_machine, "maincpu", ASAP_IRQ0, m_irq_line_state);
195         cputag_set_input_line(machine(), "maincpu", ASAP_IRQ0, m_irq_line_state);
196196      //else
197197         //asap_set_irq_line(ASAP_IRQ0, m_irq_line_state);
198198   }
r11240r11241
257257
258258READ32_MEMBER( beathead_state::input_2_r )
259259{
260   int result = input_port_read(m_machine, "IN2");
260   int result = input_port_read(machine(), "IN2");
261261   if (m_sound_to_cpu_ready) result ^= 0x10;
262262   if (m_cpu_to_sound_ready) result ^= 0x20;
263263   return result;
r11240r11241
287287WRITE32_MEMBER( beathead_state::sound_reset_w )
288288{
289289   logerror("Sound reset = %d\n", !offset);
290   cputag_set_input_line(m_machine, "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
290   cputag_set_input_line(machine(), "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
291291}
292292
293293
r11240r11241
300300
301301WRITE32_MEMBER( beathead_state::coin_count_w )
302302{
303   coin_counter_w(m_machine, 0, !offset);
303   coin_counter_w(machine(), 0, !offset);
304304}
305305
306306
src/mame/drivers/itech32.c
r11240r11241
895895
896896void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length)
897897{
898   itech32_state *state = m_machine.driver_data<itech32_state>();
898   itech32_state *state = machine().driver_data<itech32_state>();
899899   // if nvram is the main RAM, don't overwrite exception vectors
900900   int start = (base == state->m_main_ram) ? 0x80 : 0x00;
901901   for (int i = start; i < length; i++)
902      ((UINT8 *)base)[i] = m_machine.rand();
902      ((UINT8 *)base)[i] = machine().rand();
903903
904904   // due to accessing uninitialized RAM, we need this hack
905905   if (state->m_is_drivedge)
src/mame/drivers/limenko.c
r11240r11241
368368   UINT8 *gfx_max   = base_gfx + machine.region("gfx1")->bytes();
369369
370370   UINT8 *gfxdata;
371   gfx_element gfx;
371   gfx_element gfx(machine);
372372
373373   for(i = 0; i <= count*2; i += 2)
374374   {
src/mame/drivers/cidelsa.c
r11240r11241
4545
4646   int bank = BIT(data, 3);
4747
48   memory_set_bank(m_machine, "bank1", bank);
48   memory_set_bank(machine(), "bank1", bank);
4949}
5050
5151WRITE8_MEMBER( draco_state::sound_g_w )
r11240r11241
127127        7   CONT. M1
128128    */
129129
130   set_led_status(m_machine, 0, data & 0x08); // 1P
131   set_led_status(m_machine, 1, data & 0x10); // 2P
132   set_led_status(m_machine, 2, data & 0x20); // FIRE
130   set_led_status(machine(), 0, data & 0x08); // 1P
131   set_led_status(machine(), 1, data & 0x10); // 2P
132   set_led_status(machine(), 2, data & 0x20); // FIRE
133133}
134134
135135WRITE8_MEMBER( draco_state::out1_w )
r11240r11241
442442void draco_state::machine_start()
443443{
444444   /* setup COP402 memory banking */
445   memory_configure_bank(m_machine, "bank1", 0, 2, m_machine.region(COP402N_TAG)->base(), 0x400);
446   memory_set_bank(m_machine, "bank1", 0);
445   memory_configure_bank(machine(), "bank1", 0, 2, machine().region(COP402N_TAG)->base(), 0x400);
446   memory_set_bank(machine(), "bank1", 0);
447447
448448   /* register for state saving */
449449   save_item(NAME(m_reset));
r11240r11241
457457{
458458   /* reset the CPU */
459459   m_reset = 0;
460   m_machine.scheduler().timer_set(attotime::from_msec(200), FUNC(set_cpu_mode));
460   machine().scheduler().timer_set(attotime::from_msec(200), FUNC(set_cpu_mode));
461461}
462462
463463/* Machine Drivers */
src/tools/src2html.c
r11240r11241
121121{
122122   { ".c", FILE_TYPE_C },
123123   { ".h", FILE_TYPE_C },
124   { ".lst", FILE_TYPE_C },
124125   { ".mak", FILE_TYPE_MAKE },
125126   { "makefile", FILE_TYPE_MAKE },
126127   { ".lay", FILE_TYPE_XML },
128   { ".xml", FILE_TYPE_XML },
127129   { ".txt", FILE_TYPE_TEXT },
128130};
129131
r11240r11241
150152   { "#undef", PREPROC_CLASS },
151153
152154   { "auto", KEYWORD_CLASS },
155   { "bool", KEYWORD_CLASS },
153156   { "break", KEYWORD_CLASS },
154157   { "case", KEYWORD_CLASS },
158   { "catch", KEYWORD_CLASS },
155159   { "char", KEYWORD_CLASS },
160   { "class", KEYWORD_CLASS },
156161   { "const", KEYWORD_CLASS },
162   { "const_cast", KEYWORD_CLASS },
157163   { "continue", KEYWORD_CLASS },
158164   { "default", KEYWORD_CLASS },
165   { "delete", KEYWORD_CLASS },
159166   { "do", KEYWORD_CLASS },
160167   { "double", KEYWORD_CLASS },
168   { "dynamic_cast", KEYWORD_CLASS },
161169   { "else", KEYWORD_CLASS },
162170   { "enum", KEYWORD_CLASS },
171   { "explicit", KEYWORD_CLASS },
172   { "export", KEYWORD_CLASS },
163173   { "extern", KEYWORD_CLASS },
174   { "false", KEYWORD_CLASS },
164175   { "float", KEYWORD_CLASS },
165176   { "for", KEYWORD_CLASS },
177   { "friend", KEYWORD_CLASS },
166178   { "goto", KEYWORD_CLASS },
167179   { "if", KEYWORD_CLASS },
180   { "inline", KEYWORD_CLASS },
168181   { "int", KEYWORD_CLASS },
169182   { "long", KEYWORD_CLASS },
183   { "mutable", KEYWORD_CLASS },
184   { "namespace", KEYWORD_CLASS },
185   { "new", KEYWORD_CLASS },
186   { "operator", KEYWORD_CLASS },
187   { "private", KEYWORD_CLASS },
188   { "protected", KEYWORD_CLASS },
189   { "public", KEYWORD_CLASS },
170190   { "register", KEYWORD_CLASS },
191   { "reinterpret_cast", KEYWORD_CLASS },
171192   { "return", KEYWORD_CLASS },
172193   { "short", KEYWORD_CLASS },
173194   { "signed", KEYWORD_CLASS },
174195   { "sizeof", KEYWORD_CLASS },
175196   { "static", KEYWORD_CLASS },
197   { "static_cast", KEYWORD_CLASS },
176198   { "struct", KEYWORD_CLASS },
177199   { "switch", KEYWORD_CLASS },
200   { "template", KEYWORD_CLASS },
201   { "this", KEYWORD_CLASS },
202   { "throw", KEYWORD_CLASS },
203   { "true", KEYWORD_CLASS },
204   { "try", KEYWORD_CLASS },
178205   { "typedef", KEYWORD_CLASS },
206   { "typeid", KEYWORD_CLASS },
207   { "typename", KEYWORD_CLASS },
179208   { "union", KEYWORD_CLASS },
180209   { "unsigned", KEYWORD_CLASS },
210   { "virtual", KEYWORD_CLASS },
181211   { "void", KEYWORD_CLASS },
182212   { "volatile", KEYWORD_CLASS },
213   { "wchar_t", KEYWORD_CLASS },
183214   { "while", KEYWORD_CLASS },
184215
185216/*
src/osd/windows/input.c
r11240r11241
160160
161161
162162// generic device information
163typedef struct _device_info device_info;
164struct _device_info
163class device_info
165164{
166   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
165public:
166   device_info(running_machine &machine)
167      : m_machine(machine) { }
167168
169   running_machine &machine() const { return m_machine; }
170
168171   // device information
169172   device_info **         head;
170173   device_info *         next;
r11240r11241
172175   void               (*poll)(device_info *info);
173176
174177   // MAME information
175   running_machine *      m_machine;
176178   input_device *         device;
177179
178180   // device state
r11240r11241
186188   // DirectInput/RawInput-specific state
187189   dinput_device_info      dinput;
188190   rawinput_device_info   rawinput;
191
192private:
193   running_machine &      m_machine;
189194};
190195
191196
r11240r11241
817822   device_info *devinfo;
818823
819824   // allocate memory for the device object
820   devinfo = global_alloc_clear(device_info);
825   devinfo = global_alloc_clear(device_info(machine));
821826   devinfo->head = devlist_head_ptr;
822   devinfo->m_machine = &machine;
823827
824828   // allocate a UTF8 copy of the name
825829   devinfo->name = utf8_from_tstring(name);
src/osd/windows/debugwin.c
r11240r11241
148148//============================================================
149149
150150typedef struct _debugview_info debugview_info;
151typedef struct _debugwin_info debugwin_info;
151class debugwin_info;
152152
153153
154154struct _debugview_info
r11240r11241
161161};
162162
163163
164struct _debugwin_info
164class debugwin_info
165165{
166   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
166public:
167   debugwin_info(running_machine &machine)
168      : m_machine(machine) { }
167169
170   running_machine &machine() const { return m_machine; }
171
168172   debugwin_info *         next;
169173   HWND               wnd;
170174   HWND               focuswnd;
r11240r11241
191195
192196   HWND               otherwnd[MAX_OTHER_WND];
193197
194   running_machine *      m_machine;
198private:
199   running_machine &      m_machine;
195200};
196201
197202
r11240r11241
542547   RECT work_bounds;
543548
544549   // allocate memory
545   info = global_alloc_clear(debugwin_info);
550   info = global_alloc_clear(debugwin_info(machine));
546551
547552   // create the window
548553   info->handler = handler;
r11240r11241
563568   info->handle_key = global_handle_key;
564569   strcpy(info->edit_defstr, "");
565570
566   info->m_machine = &machine;
567
568571   // hook us in
569572   info->next = window_list;
570573   window_list = info;
src/osd/windows/window.c
r11240r11241
609609   assert(GetCurrentThreadId() == main_threadid);
610610
611611   // allocate a new window object
612   window = global_alloc_clear(win_window_info);
612   window = global_alloc_clear(win_window_info(machine));
613613   window->maxwidth = config->width;
614614   window->maxheight = config->height;
615615   window->refresh = config->refresh;
616616   window->monitor = monitor;
617617   window->fullscreen = !video_config.windowed;
618   window->m_machine = &machine;
619618
620619   // see if we are safe for fullscreen
621620   window->fullscreen_safe = TRUE;
src/osd/windows/window.h
r11240r11241
6565//  TYPE DEFINITIONS
6666//============================================================
6767
68typedef struct _win_window_info win_window_info;
69struct _win_window_info
68struct win_window_info
7069{
71   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
70public:
71   win_window_info(running_machine &machine)
72      : m_machine(machine) { }
73     
74   running_machine &machine() const { return m_machine; }
7275
7376   win_window_info *   next;
7477   volatile int      init_state;
r11240r11241
106109   // drawing data
107110   void *            drawdata;
108111
109   running_machine *   m_machine;
112private:
113   running_machine &   m_machine;
110114};
111115
112116
src/emu/debug/dvmemory.c
r11240r11241
153153
154154   // first add all the devices' address spaces
155155   device_memory_interface *memintf = NULL;
156   for (bool gotone = m_machine.m_devicelist.first(memintf); gotone; gotone = memintf->next(memintf))
156   for (bool gotone = machine().m_devicelist.first(memintf); gotone; gotone = memintf->next(memintf))
157157      for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
158158      {
159159         address_space *space = memintf->space(spacenum);
160160         if (space != NULL)
161161         {
162162            name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name());
163            m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *space)));
163            m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *space)));
164164         }
165165      }
166166
167167   // then add all the memory regions
168   for (const memory_region *region = m_machine.first_region(); region != NULL; region = region->next())
168   for (const memory_region *region = machine().first_region(); region != NULL; region = region->next())
169169   {
170170      name.printf("Region '%s'", region->name());
171      m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *region)));
171      m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *region)));
172172   }
173173
174174   // finally add all global array symbols
r11240r11241
177177      // stop when we run out of items
178178      UINT32 valsize, valcount;
179179      void *base;
180      const char *itemname = m_machine.state().indexed_item(itemnum, base, valsize, valcount);
180      const char *itemname = machine().state().indexed_item(itemnum, base, valsize, valcount);
181181      if (itemname == NULL)
182182         break;
183183
r11240r11241
185185      if (valcount > 1 && strstr(itemname, "globals/"))
186186      {
187187         name.cpy(strrchr(itemname, '/') + 1);
188         m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, base, valsize, valcount)));
188         m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, base, valsize, valcount)));
189189      }
190190   }
191191
r11240r11241
707707
708708// hack for FD1094 editing
709709#ifdef FD1094_HACK
710   if (source.m_base == m_machine.region("user2"))
710   if (source.m_base == machine().region("user2"))
711711   {
712712      extern void fd1094_regenerate_key(running_machine &machine);
713      fd1094_regenerate_key(m_machine);
713      fd1094_regenerate_key(machine());
714714   }
715715#endif
716716}
src/emu/debug/debugvw.c
r11240r11241
147147   {
148148      debug_view_source *source = m_head;
149149      m_head = source->m_next;
150      auto_free(m_machine, source);
150      auto_free(machine(), source);
151151   }
152152
153153   // reset the tail pointer and index
r11240r11241
201201
202202debug_view::debug_view(running_machine &machine, debug_view_type type, debug_view_osd_update_func osdupdate, void *osdprivate)
203203   : m_next(NULL),
204     m_machine(machine),
205204     m_type(type),
206205     m_source(NULL),
207206     m_source_list(machine),
r11240r11241
218217     m_update_pending(true),
219218     m_osd_update_pending(true),
220219     m_viewdata(NULL),
221     m_viewdata_size(0)
220     m_viewdata_size(0),
221     m_machine(machine)
222222{
223223   // allocate memory for the buffer
224224   m_viewdata_size = m_visible.y * m_visible.x;
r11240r11241
256256         if (size > m_viewdata_size)
257257         {
258258            m_viewdata_size = size;
259            auto_free(m_machine, m_viewdata);
260            m_viewdata = auto_alloc_array(m_machine, debug_view_char, m_viewdata_size);
259            auto_free(machine(), m_viewdata);
260            m_viewdata = auto_alloc_array(machine(), debug_view_char, m_viewdata_size);
261261         }
262262
263263         // update the view
r11240r11241
450450   {
451451      debug_view *oldhead = m_viewlist;
452452      m_viewlist = oldhead->m_next;
453      auto_free(m_machine, oldhead);
453      auto_free(machine(), oldhead);
454454   }
455455}
456456
r11240r11241
464464   switch (type)
465465   {
466466      case DVT_CONSOLE:
467         return append(auto_alloc(m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
467         return append(auto_alloc(machine(), debug_view_console(machine(), osdupdate, osdprivate)));
468468
469469      case DVT_STATE:
470         return append(auto_alloc(m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
470         return append(auto_alloc(machine(), debug_view_state(machine(), osdupdate, osdprivate)));
471471
472472      case DVT_DISASSEMBLY:
473         return append(auto_alloc(m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
473         return append(auto_alloc(machine(), debug_view_disasm(machine(), osdupdate, osdprivate)));
474474
475475      case DVT_MEMORY:
476         return append(auto_alloc(m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
476         return append(auto_alloc(machine(), debug_view_memory(machine(), osdupdate, osdprivate)));
477477
478478      case DVT_LOG:
479         return append(auto_alloc(m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
479         return append(auto_alloc(machine(), debug_view_log(machine(), osdupdate, osdprivate)));
480480
481481      case DVT_TIMERS:
482//          return append(auto_alloc(m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
482//          return append(auto_alloc(machine(), debug_view_timers(machine(), osdupdate, osdprivate)));
483483
484484      case DVT_ALLOCS:
485//          return append(auto_alloc(m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
485//          return append(auto_alloc(machine(), debug_view_allocs(machine(), osdupdate, osdprivate)));
486486
487487      default:
488488         fatalerror("Attempt to create invalid debug view type %d\n", type);
r11240r11241
502502      if (*viewptr == &view)
503503      {
504504         *viewptr = view.m_next;
505         auto_free(m_machine, &view);
505         auto_free(machine(), &view);
506506         break;
507507      }
508508}
r11240r11241
581581
582582void debug_view_expression::set_context(symbol_table *context)
583583{
584   m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(m_machine));
584   m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(machine()));
585585   m_dirty = true;
586586}
587587
src/emu/debug/debugvw.h
r11240r11241
165165   ~debug_view_source_list();
166166
167167   // getters
168   running_machine &machine() const { return m_machine; }
168169   const debug_view_source *head() const { return m_head; }
169170   int count() const { return m_count; }
170171   int index(const debug_view_source &source) const;
r11240r11241
239240protected:
240241   // core view data
241242   debug_view *         m_next;            // link to the next view
242   running_machine &      m_machine;         // machine associated with this view
243243   debug_view_type         m_type;            // type of view
244244   const debug_view_source *m_source;         // currently selected data source
245245   debug_view_source_list   m_source_list;      // list of available data sources
r11240r11241
263263   bool               m_osd_update_pending; // true if there is a pending update
264264   debug_view_char *      m_viewdata;         // current array of view data
265265   int                  m_viewdata_size;   // number of elements of the viewdata array
266
267private:
268   running_machine &      m_machine;         // machine associated with this view
266269};
267270
268271
r11240r11241
273276   // construction/destruction
274277   debug_view_manager(running_machine &machine);
275278   ~debug_view_manager();
279   
280   // getters
281   running_machine &machine() const { return m_machine; }
276282
277283   // view allocation
278284   debug_view *alloc_view(debug_view_type type, debug_view_osd_update_func osdupdate, void *osdprivate);
r11240r11241
301307   ~debug_view_expression();
302308
303309   // getters
310   running_machine &machine() const { return m_machine; }
304311   bool dirty() const { return m_dirty; }
305312   UINT64 last_value() const { return m_result; }
306313   UINT64 value() { recompute(); return m_result; }
src/emu/debug/dvdisasm.c
r11240r11241
116116
117117debug_view_disasm::~debug_view_disasm()
118118{
119   auto_free(m_machine, m_byteaddress);
120   auto_free(m_machine, m_dasm);
119   auto_free(machine(), m_byteaddress);
120   auto_free(machine(), m_dasm);
121121}
122122
123123
r11240r11241
134134   // iterate over devices with disassembly interfaces
135135   device_disasm_interface *dasm = NULL;
136136   astring name;
137   for (bool gotone = m_machine.m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
137   for (bool gotone = machine().m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
138138   {
139139      name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
140      m_source_list.append(*auto_alloc(m_machine, debug_view_disasm_source(name, dasm->device())));
140      m_source_list.append(*auto_alloc(machine(), debug_view_disasm_source(name, dasm->device())));
141141   }
142142
143143   // reset the source to a known good entry
r11240r11241
377377      m_allocated = m_total;
378378
379379      // allocate address array
380      auto_free(m_machine, m_byteaddress);
381      m_byteaddress = auto_alloc_array(m_machine, offs_t, m_allocated.y);
380      auto_free(machine(), m_byteaddress);
381      m_byteaddress = auto_alloc_array(machine(), offs_t, m_allocated.y);
382382
383383      // allocate disassembly buffer
384      auto_free(m_machine, m_dasm);
385      m_dasm = auto_alloc_array(m_machine, char, m_allocated.x * m_allocated.y);
384      auto_free(machine(), m_dasm);
385      m_dasm = auto_alloc_array(machine(), char, m_allocated.x * m_allocated.y);
386386   }
387387
388388   // iterate over lines
src/emu/debug/dvstate.c
r11240r11241
105105   // iterate over devices that have state interfaces
106106   device_state_interface *state = NULL;
107107   astring name;
108   for (bool gotone = m_machine.m_devicelist.first(state); gotone; gotone = state->next(state))
108   for (bool gotone = machine().m_devicelist.first(state); gotone; gotone = state->next(state))
109109   {
110110      name.printf("%s '%s'", state->device().name(), state->device().tag());
111      m_source_list.append(*auto_alloc(m_machine, debug_view_state_source(name, state->device())));
111      m_source_list.append(*auto_alloc(machine(), debug_view_state_source(name, state->device())));
112112   }
113113
114114   // reset the source to a known good entry
r11240r11241
127127   {
128128      state_item *oldhead = m_state_list;
129129      m_state_list = oldhead->m_next;
130      auto_free(m_machine, oldhead);
130      auto_free(machine(), oldhead);
131131   }
132132}
133133
r11240r11241
146146
147147   // add a cycles entry: cycles:99999999
148148   state_item **tailptr = &m_state_list;
149   *tailptr = auto_alloc(m_machine, state_item(REG_CYCLES, "cycles", 8));
149   *tailptr = auto_alloc(machine(), state_item(REG_CYCLES, "cycles", 8));
150150   tailptr = &(*tailptr)->m_next;
151151
152152   // add a beam entry: beamx:1234
153   *tailptr = auto_alloc(m_machine, state_item(REG_BEAMX, "beamx", 4));
153   *tailptr = auto_alloc(machine(), state_item(REG_BEAMX, "beamx", 4));
154154   tailptr = &(*tailptr)->m_next;
155155
156156   // add a beam entry: beamy:5678
157   *tailptr = auto_alloc(m_machine, state_item(REG_BEAMY, "beamy", 4));
157   *tailptr = auto_alloc(machine(), state_item(REG_BEAMY, "beamy", 4));
158158   tailptr = &(*tailptr)->m_next;
159159
160160   // add a beam entry: frame:123456
161   *tailptr = auto_alloc(m_machine, state_item(REG_FRAME, "frame", 6));
161   *tailptr = auto_alloc(machine(), state_item(REG_FRAME, "frame", 6));
162162   tailptr = &(*tailptr)->m_next;
163163
164164   // add a flags entry: flags:xxxxxxxx
165   *tailptr = auto_alloc(m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
165   *tailptr = auto_alloc(machine(), state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
166166   tailptr = &(*tailptr)->m_next;
167167
168168   // add a divider entry
169   *tailptr = auto_alloc(m_machine, state_item(REG_DIVIDER, "", 0));
169   *tailptr = auto_alloc(machine(), state_item(REG_DIVIDER, "", 0));
170170   tailptr = &(*tailptr)->m_next;
171171
172172   // add all registers into it
173173   for (const device_state_entry *entry = source.m_stateintf->state_first(); entry != NULL; entry = entry->next())
174174      if (entry->visible())
175175      {
176         *tailptr = auto_alloc(m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
176         *tailptr = auto_alloc(machine(), state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
177177         tailptr = &(*tailptr)->m_next;
178178      }
179179
r11240r11241
235235      curitem = curitem->m_next;
236236
237237   // loop over visible rows
238   screen_device *screen = m_machine.primary_screen;
238   screen_device *screen = machine().primary_screen;
239239   debug_view_char *dest = m_viewdata;
240240   for (UINT32 row = 0; row < m_visible.y; row++)
241241   {
src/emu/cpu/tms32031/32031ops.c
r11240r11241
100100
101101void tms3203x_device::illegal(UINT32 op)
102102{
103   if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
103   if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
104104   {
105105      logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21);
106      debugger_break(m_machine);
106      debugger_break(machine());
107107   }
108108}
109109
r11240r11241
54965496{
54975497   m_delayed = true;
54985498
5499   if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
5499   if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
55005500   {
55015501      execute_one();
55025502      execute_one();
src/emu/cpu/tms32031/tms32031.c
r11240r11241
819819   }
820820
821821   // non-debug case
822   if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
822   if ((machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
823823   {
824824      while (m_icount > 0)
825825      {
r11240r11241
854854      {
855855         // watch for out-of-range stack pointers
856856         if (IREG(TMR_SP) & 0xff000000)
857            debugger_break(m_machine);
857            debugger_break(machine());
858858         if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
859859         {
860860            if ((INT32)--IREG(TMR_RC) >= 0)
src/emu/cpu/adsp2100/adsp2100.c
r11240r11241
12631263
12641264void adsp21xx_device::execute_run()
12651265{
1266   bool check_debugger = ((device_t::m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0);
1266   bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
12671267
12681268   check_irqs();
12691269
src/emu/cpu/m6502/m4510.c
r11240r11241
153153
154154   UINT8    ddr;
155155   UINT8    port;
156   
156
157157   devcb_resolved_read8   in_port_func;
158158   devcb_resolved_write8   out_port_func;
159159};
src/emu/cpu/m6502/m6502.c
r11240r11241
8181
8282   UINT8    ddr;
8383   UINT8    port;
84   
84
8585   devcb_resolved_read8   in_port_func;
8686   devcb_resolved_write8   out_port_func;
8787};
src/emu/cpu/cosmac/cosmac.c
r11240r11241
726726
727727inline void cosmac_device::debug()
728728{
729   if (device_t::m_machine.debug_flags & DEBUG_FLAG_ENABLED)
729   if (device_t::machine().debug_flags & DEBUG_FLAG_ENABLED)
730730   {
731731      debugger_instruction_hook(this, R[P]);
732732   }
src/emu/cpu/mips/psx.c
r11240r11241
232232
233233void psxcpu_device::stop()
234234{
235   debugger_break( m_machine );
235   debugger_break( machine() );
236236   debugger_instruction_hook( this,  m_pc );
237237}
238238
src/emu/cpu/asap/asap.c
r11240r11241
635635   check_irqs();
636636
637637   // core execution loop
638   if ((device_t::m_machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
638   if ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
639639   {
640640      do
641641      {
src/emu/cpu/dsp16/dsp16.c
r11240r11241
232232
233233void dsp16_device::execute_run()
234234{
235   bool check_debugger = ((device_t::m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0);
235   bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
236236
237237   do
238238   {
src/emu/cpu/upd7725/upd7725.c
r11240r11241
400400   do
401401   {
402402      // call debugger hook if necessary
403      if (device_t::m_machine.debug_flags & DEBUG_FLAG_ENABLED)
403      if (device_t::machine().debug_flags & DEBUG_FLAG_ENABLED)
404404      {
405405         debugger_instruction_hook(this, regs.pc);
406406      }
src/emu/video/upd3301.c
r11240r11241
269269   devcb_resolve_write_line(&m_out_vrtc_func, &m_config.m_out_vrtc_func, this);
270270
271271   // get the screen device
272   m_screen = m_machine.device<screen_device>(m_config.m_screen_tag);
272   m_screen = machine().device<screen_device>(m_config.m_screen_tag);
273273   assert(m_screen != NULL);
274274
275275   // state saving
r11240r11241
663663   }
664664   else
665665   {
666      bitmap_fill(bitmap, cliprect, get_black_pen(m_machine));
666      bitmap_fill(bitmap, cliprect, get_black_pen(machine()));
667667   }
668668}
src/emu/video/crt9021.c
r11240r11241
166166   devcb_resolve_read_line(&m_in_atten_func, &m_config.in_atten_func, this);
167167
168168   // get the screen device
169   m_screen = m_machine.device<screen_device>(m_config.screen_tag);
169   m_screen = machine().device<screen_device>(m_config.screen_tag);
170170   assert(m_screen != NULL);
171171
172172   // register for state saving
src/emu/video/crt9007.c
r11240r11241
566566   devcb_resolve_write_line(&m_out_sld_func, &m_config.out_sld_func, this);
567567
568568   // get the screen device
569   m_screen = m_machine.device<screen_device>(m_config.screen_tag);
569   m_screen = machine().device<screen_device>(m_config.screen_tag);
570570   assert(m_screen != NULL);
571571
572572   // set horizontal pixels per column
src/emu/video/hd44102.c
r11240r11241
117117void hd44102_device::device_start()
118118{
119119   // find screen
120   m_screen = m_machine.device<screen_device>(m_config.m_screen_tag);
120   m_screen = machine().device<screen_device>(m_config.m_screen_tag);
121121
122122   // register for state saving
123123   save_item(NAME(m_ram[0]));
src/emu/video/hd61830.c
r11240r11241
208208   // resolve callbacks
209209    devcb_resolve_read8(&m_in_rd_func, &m_config.m_in_rd_func, this);
210210
211   m_screen = m_machine.device<screen_device>(m_config.screen_tag);
211   m_screen = machine().device<screen_device>(m_config.screen_tag);
212212
213213   // register for state saving
214214   save_item(NAME(m_bf));
src/emu/video/msm6255.c
r11240r11241
143143void msm6255_device::device_start()
144144{
145145   // find screen
146   m_screen = m_machine.device<screen_device>(m_config.m_screen_tag);
146   m_screen = machine().device<screen_device>(m_config.m_screen_tag);
147147
148148   // register for state saving
149149   save_item(NAME(m_ir));
r11240r11241
447447   }
448448   else
449449   {
450      bitmap_fill(bitmap, cliprect, get_black_pen(m_machine));
450      bitmap_fill(bitmap, cliprect, get_black_pen(machine()));
451451   }
452452}
src/emu/video/cdp1861.c
r11240r11241
9595   m_dma_timer = timer_alloc(TIMER_DMA);
9696
9797   // find devices
98   m_cpu = m_machine.device<cpu_device>(m_config.m_cpu_tag);
99   m_screen =  m_machine.device<screen_device>(m_config.m_screen_tag);
100   m_bitmap = auto_bitmap_alloc(m_machine, m_screen->width(), m_screen->height(), m_screen->format());
98   m_cpu = machine().device<cpu_device>(m_config.m_cpu_tag);
99   m_screen =  machine().device<screen_device>(m_config.m_screen_tag);
100   m_bitmap = auto_bitmap_alloc(machine(), m_screen->width(), m_screen->height(), m_screen->format());
101101
102102   // register for state saving
103103   save_item(NAME(m_disp));
r11240r11241
274274   }
275275   else
276276   {
277      bitmap_fill(bitmap, cliprect, get_black_pen(m_machine));
277      bitmap_fill(bitmap, cliprect, get_black_pen(machine()));
278278   }
279279}
src/emu/video/cdp1862.c
r11240r11241
103103      g = (i & 1) ? luma : 0;
104104      b = (i & 2) ? luma : 0;
105105
106      palette_set_color_rgb(m_machine, i, r, g, b);
106      palette_set_color_rgb(machine(), i, r, g, b);
107107   }
108108}
109109
r11240r11241
136136   devcb_resolve_read_line(&m_in_gd_func, &m_config.m_in_gd_func, this);
137137
138138   // find devices
139   m_screen =  m_machine.device<screen_device>(m_config.m_screen_tag);
140   m_bitmap = auto_bitmap_alloc(m_machine, m_screen->width(), m_screen->height(), m_screen->format());
139   m_screen =  machine().device<screen_device>(m_config.m_screen_tag);
140   m_bitmap = auto_bitmap_alloc(machine(), m_screen->width(), m_screen->height(), m_screen->format());
141141
142142   // init palette
143143   initialize_palette();
src/emu/tilemap.c
r11240r11241
6565
6666
6767/* core tilemap structure */
68struct _tilemap_t
68class tilemap_t
6969{
70   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
70public:
71   tilemap_t(running_machine &machine)
72      : m_machine(machine) { }
7173
74   running_machine &machine() const { return m_machine; }
75
7276   tilemap_t *               next;            /* pointer to next tilemap */
73   running_machine *         m_machine;         /* pointer back to the owning machine */
7477
7578   /* basic tilemap metrics */
7679   UINT32                  rows;            /* number of tile rows */
r11240r11241
120123   bitmap_t *               flagsmap;         /* per-pixel flags */
121124   UINT8 *                  tileflags;         /* per-tile flags */
122125   UINT8 *                  pen_to_flags;      /* mapping of pens to flags */
126
127private:
128   running_machine &         m_machine;         /* pointer back to the owning machine */
123129};
124130
125131
r11240r11241
350356   tilemap_instance = machine.tilemap_data->instance;
351357
352358   /* allocate the tilemap itself */
353   tmap = auto_alloc_clear(machine, tilemap_t);
359   tmap = auto_alloc_clear(machine, tilemap_t(machine));
354360
355361   /* fill in the basic metrics */
356   tmap->m_machine = &machine;
357362   tmap->rows = rows;
358363   tmap->cols = cols;
359364   tmap->tilewidth = tilewidth;
src/emu/tilemap.h
r11240r11241
380380typedef UINT32 tilemap_memory_index;
381381
382382/* opaque tilemap definition */
383typedef struct _tilemap_t tilemap_t;
383class tilemap_t;
384384
385385
386386/* tile_data is filled in by the get_tile_info callback */
src/emu/uimenu.c
r11240r11241
116116};
117117
118118
119struct _ui_menu
119class ui_menu
120120{
121   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
121public:
122   ui_menu(running_machine &machine)
123      : m_machine(machine) { }
124     
125   running_machine &machine() const { return m_machine; }
122126
123   running_machine *   m_machine;         /* machine we are attached to */
124127   render_container *   container;         /* render_container we render to */
125128   ui_menu_handler_func handler;         /* handler callback */
126129   void *            parameter;         /* parameter */
r11240r11241
140143   float            customtop;         /* amount of extra height to add at the top */
141144   float            custombottom;      /* amount of extra height to add at the bottom */
142145   ui_menu_pool *      pool;            /* list of memory pools */
146
147private:
148   running_machine &   m_machine;         /* machine we are attached to */
143149};
144150
145151
r11240r11241
441447   ui_menu *menu;
442448
443449   /* allocate and clear memory for the menu and the state */
444   menu = auto_alloc_clear(machine, ui_menu);
450   menu = auto_alloc_clear(machine, ui_menu(machine));
445451
446452   /* initialize the state */
447   menu->m_machine = &machine;
448453   menu->container = container;
449454   menu->handler = handler;
450455   menu->parameter = parameter;
src/emu/video.c
r11240r11241
218218void video_manager::frame_update(bool debug)
219219{
220220   // only render sound and video if we're in the running phase
221   int phase = m_machine.phase();
221   int phase = machine().phase();
222222   bool skipped_it = m_skipping_this_frame;
223   if (phase == MACHINE_PHASE_RUNNING && (!m_machine.paused() || m_machine.options().update_in_pause()))
223   if (phase == MACHINE_PHASE_RUNNING && (!machine().paused() || machine().options().update_in_pause()))
224224   {
225225      bool anything_changed = finish_screen_updates();
226226
r11240r11241
234234   }
235235
236236   // draw the user interface
237   ui_update_and_render(m_machine, &m_machine.render().ui_container());
237   ui_update_and_render(machine(), &machine().render().ui_container());
238238
239239   // update the internal render debugger
240   debugint_update_during_game(m_machine);
240   debugint_update_during_game(machine());
241241
242242   // if we're throttling, synchronize before rendering
243   attotime current_time = m_machine.time();
243   attotime current_time = machine().time();
244244   if (!debug && !skipped_it && effective_throttle())
245245      update_throttle(current_time);
246246
247247   // ask the OSD to update
248248   g_profiler.start(PROFILER_BLIT);
249   m_machine.osd().update(!debug && skipped_it);
249   machine().osd().update(!debug && skipped_it);
250250   g_profiler.stop();
251251
252252   // perform tasks for this frame
253253   if (!debug)
254      m_machine.call_notifiers(MACHINE_NOTIFY_FRAME);
254      machine().call_notifiers(MACHINE_NOTIFY_FRAME);
255255
256256   // update frameskipping
257257   if (!debug)
r11240r11241
265265   if (phase == MACHINE_PHASE_RUNNING)
266266   {
267267      // reset partial updates if we're paused or if the debugger is active
268      if (m_machine.primary_screen != NULL && (m_machine.paused() || debug || debugger_within_instruction_hook(m_machine)))
269         m_machine.primary_screen->scanline0_callback();
268      if (machine().primary_screen != NULL && (machine().paused() || debug || debugger_within_instruction_hook(machine())))
269         machine().primary_screen->scanline0_callback();
270270
271271      // otherwise, call the video EOF callback
272272      else
273273      {
274274         g_profiler.start(PROFILER_VIDEO);
275         for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
275         for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
276276            screen->screen_eof();
277277         g_profiler.stop();
278278      }
r11240r11241
290290   string.reset();
291291
292292   // if we're paused, just display Paused
293   bool paused = m_machine.paused();
293   bool paused = machine().paused();
294294   if (paused)
295295      string.cat("paused");
296296
r11240r11241
312312
313313   // display the number of partial updates as well
314314   int partials = 0;
315   for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
315   for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
316316      partials += screen->partial_updates();
317317   if (partials > 1)
318318      string.catprintf("\n%d partial updates", partials);
r11240r11241
336336
337337   // add two text entries describing the image
338338   astring text1(APPNAME, " ", build_version);
339   astring text2(m_machine.system().manufacturer, " ", m_machine.system().description);
339   astring text2(machine().system().manufacturer, " ", machine().system().description);
340340   png_info pnginfo = { 0 };
341341   png_add_text(&pnginfo, "Software", text1);
342342   png_add_text(&pnginfo, "System", text2);
343343
344344   // now do the actual work
345   const rgb_t *palette = (m_machine.palette != NULL) ? palette_entry_list_adjusted(m_machine.palette) : NULL;
346   png_error error = png_write_bitmap(file, &pnginfo, m_snap_bitmap, m_machine.total_colors(), palette);
345   const rgb_t *palette = (machine().palette != NULL) ? palette_entry_list_adjusted(machine().palette) : NULL;
346   png_error error = png_write_bitmap(file, &pnginfo, m_snap_bitmap, machine().total_colors(), palette);
347347   if (error != PNGERR_NONE)
348348      mame_printf_error("Error generating PNG for snapshot: png_error = %d\n", error);
349349
r11240r11241
363363   if (m_snap_native)
364364   {
365365      // write one snapshot per visible screen
366      for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
367         if (m_machine.render().is_live(*screen))
366      for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
367         if (machine().render().is_live(*screen))
368368         {
369            emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
369            emu_file file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
370370            file_error filerr = open_next(file, "png");
371371            if (filerr == FILERR_NONE)
372372               save_snapshot(screen, file);
r11240r11241
376376   // otherwise, just write a single snapshot
377377   else
378378   {
379      emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
379      emu_file file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
380380      file_error filerr = open_next(file, "png");
381381      if (filerr == FILERR_NONE)
382382         save_snapshot(NULL, file);
r11240r11241
398398
399399   // reset the state
400400   m_movie_frame = 0;
401   m_movie_next_frame_time = m_machine.time();
401   m_movie_next_frame_time = machine().time();
402402
403403   // start up an AVI recording
404404   if (format == MF_AVI)
r11240r11241
406406      // build up information about this new movie
407407      avi_movie_info info;
408408      info.video_format = 0;
409      info.video_timescale = 1000 * ((m_machine.primary_screen != NULL) ? ATTOSECONDS_TO_HZ(m_machine.primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
409      info.video_timescale = 1000 * ((machine().primary_screen != NULL) ? ATTOSECONDS_TO_HZ(machine().primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
410410      info.video_sampletime = 1000;
411411      info.video_numsamples = 0;
412412      info.video_width = m_snap_bitmap->width;
r11240r11241
414414      info.video_depth = 24;
415415
416416      info.audio_format = 0;
417      info.audio_timescale = m_machine.sample_rate();
417      info.audio_timescale = machine().sample_rate();
418418      info.audio_sampletime = 1;
419419      info.audio_numsamples = 0;
420420      info.audio_channels = 2;
421421      info.audio_samplebits = 16;
422      info.audio_samplerate = m_machine.sample_rate();
422      info.audio_samplerate = machine().sample_rate();
423423
424424      // create a new temporary movie file
425425      file_error filerr;
426426      astring fullpath;
427427      {
428         emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
428         emu_file tempfile(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
429429         if (name != NULL)
430430            filerr = tempfile.open(name);
431431         else
r11240r11241
452452   else if (format == MF_MNG)
453453   {
454454      // create a new movie file and start recording
455      m_mngfile = auto_alloc(m_machine, emu_file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
455      m_mngfile = auto_alloc(machine(), emu_file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
456456      file_error filerr;
457457      if (name != NULL)
458458         filerr = m_mngfile->open(name);
r11240r11241
462462      if (filerr == FILERR_NONE)
463463      {
464464         // start the capture
465         int rate = (m_machine.primary_screen != NULL) ? ATTOSECONDS_TO_HZ(m_machine.primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE;
465         int rate = (machine().primary_screen != NULL) ? ATTOSECONDS_TO_HZ(machine().primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE;
466466         png_error pngerr = mng_capture_start(*m_mngfile, m_snap_bitmap, rate);
467467         if (pngerr != PNGERR_NONE)
468468            return end_recording();
r11240r11241
497497   if (m_mngfile != NULL)
498498   {
499499      mng_capture_stop(*m_mngfile);
500      auto_free(m_machine, m_mngfile);
500      auto_free(machine(), m_mngfile);
501501      m_mngfile = NULL;
502502   }
503503
r11240r11241
547547
548548   // free all the graphics elements
549549   for (int i = 0; i < MAX_GFX_ELEMENTS; i++)
550      gfx_element_free(m_machine.gfx[i]);
550      gfx_element_free(machine().gfx[i]);
551551
552552   // free the snapshot target
553   m_machine.render().target_free(m_snap_target);
553   machine().render().target_free(m_snap_target);
554554   if (m_snap_bitmap != NULL)
555555      global_free(m_snap_bitmap);
556556
r11240r11241
584584
585585void video_manager::postload()
586586{
587   m_movie_next_frame_time = m_machine.time();
587   m_movie_next_frame_time = machine().time();
588588}
589589
590590
r11240r11241
597597inline int video_manager::effective_autoframeskip() const
598598{
599599   // if we're fast forwarding or paused, autoframeskip is disabled
600   if (m_fastforward || m_machine.paused())
600   if (m_fastforward || machine().paused())
601601      return false;
602602
603603   // otherwise, it's up to the user
r11240r11241
631631inline bool video_manager::effective_throttle() const
632632{
633633   // if we're paused, or if the UI is active, we always throttle
634   if (m_machine.paused() || ui_is_menu_active())
634   if (machine().paused() || ui_is_menu_active())
635635      return true;
636636
637637   // if we're fast forwarding, we don't throttle
r11240r11241
650650
651651inline int video_manager::original_speed_setting() const
652652{
653   return m_machine.options().speed() * 100.0 + 0.5;
653   return machine().options().speed() * 100.0 + 0.5;
654654}
655655
656656
r11240r11241
662662bool video_manager::finish_screen_updates()
663663{
664664   // finish updating the screens
665   for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
665   for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
666666      screen->update_partial(screen->visible_area().max_y);
667667
668668   // now add the quads for all the screens
669669   bool anything_changed = false;
670   for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
670   for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
671671      if (screen->update_quads())
672672         anything_changed = true;
673673
674674   // update our movie recording and burn-in state
675   if (!m_machine.paused())
675   if (!machine().paused())
676676   {
677677      record_frame();
678678
679679      // iterate over screens and update the burnin for the ones that care
680      for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
680      for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
681681         screen->update_burnin();
682682   }
683683
684684   // draw any crosshairs
685   for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
685   for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
686686      crosshair_render(*screen);
687687
688688   return anything_changed;
r11240r11241
761761       // and explicitly reset our tracked real and emulated timers to that value ...
762762       // this means we pretend that the last update was exactly 1/60th of a second
763763       // ago, and was in sync in both real and emulated time
764      if (m_machine.paused())
764      if (machine().paused())
765765      {
766766         m_throttle_emutime = emutime - attotime(0, ATTOSECONDS_PER_SECOND / PAUSED_REFRESH_RATE);
767767         m_throttle_realtime = m_throttle_emutime;
r11240r11241
850850   // we're allowed to sleep via the OSD code only if we're configured to do so
851851    // and we're not frameskipping due to autoframeskip, or if we're paused
852852   bool allowed_to_sleep = false;
853    if (m_machine.options().sleep() && (!effective_autoframeskip() || effective_frameskip() == 0))
853    if (machine().options().sleep() && (!effective_autoframeskip() || effective_frameskip() == 0))
854854       allowed_to_sleep = true;
855    if (m_machine.paused())
855    if (machine().paused())
856856       allowed_to_sleep = true;
857857
858858   // loop until we reach our target
r11240r11241
956956void video_manager::update_refresh_speed()
957957{
958958   // only do this if the refreshspeed option is used
959   if (m_machine.options().refresh_speed())
959   if (machine().options().refresh_speed())
960960   {
961      float minrefresh = m_machine.render().max_update_rate();
961      float minrefresh = machine().render().max_update_rate();
962962      if (minrefresh != 0)
963963      {
964964         // find the screen with the shortest frame period (max refresh rate)
965965         // note that we first check the token since this can get called before all screens are created
966966         attoseconds_t min_frame_period = ATTOSECONDS_PER_SECOND;
967         for (screen_device *screen = m_machine.first_screen(); screen != NULL; screen = screen->next_screen())
967         for (screen_device *screen = machine().first_screen(); screen != NULL; screen = screen->next_screen())
968968         {
969969            attoseconds_t period = screen->frame_period().attoseconds;
970970            if (period != 0)
r11240r11241
998998void video_manager::recompute_speed(attotime emutime)
999999{
10001000   // if we don't have a starting time yet, or if we're paused, reset our starting point
1001   if (m_speed_last_realtime == 0 || m_machine.paused())
1001   if (m_speed_last_realtime == 0 || machine().paused())
10021002   {
10031003      m_speed_last_realtime = osd_ticks();
10041004      m_speed_last_emutime = emutime;
r11240r11241
10401040   // if we're past the "time-to-execute" requested, signal an exit
10411041   if (m_seconds_to_run != 0 && emutime.seconds >= m_seconds_to_run)
10421042   {
1043      if (m_machine.primary_screen != NULL)
1043      if (machine().primary_screen != NULL)
10441044      {
10451045         // create a final screenshot
1046         emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
1047         file_error filerr = file.open(m_machine.basename(), PATH_SEPARATOR "final.png");
1046         emu_file file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
1047         file_error filerr = file.open(machine().basename(), PATH_SEPARATOR "final.png");
10481048         if (filerr == FILERR_NONE)
1049            save_snapshot(m_machine.primary_screen, file);
1049            save_snapshot(machine().primary_screen, file);
10501050      }
10511051
10521052      // schedule our demise
1053      m_machine.schedule_exit();
1053      machine().schedule_exit();
10541054   }
10551055}
10561056
r11240r11241
10661066   // select the appropriate view in our dummy target
10671067   if (m_snap_native && screen != NULL)
10681068   {
1069      int view_index = m_machine.m_devicelist.indexof(SCREEN, screen->tag());
1069      int view_index = machine().m_devicelist.indexof(SCREEN, screen->tag());
10701070      assert(view_index != -1);
10711071      m_snap_target->set_view(view_index);
10721072   }
r11240r11241
10821082   if (m_snap_bitmap == NULL || width != m_snap_bitmap->width || height != m_snap_bitmap->height)
10831083   {
10841084      if (m_snap_bitmap != NULL)
1085         auto_free(m_machine, m_snap_bitmap);
1086      m_snap_bitmap = auto_alloc(m_machine, bitmap_t(width, height, BITMAP_FORMAT_RGB32));
1085         auto_free(machine(), m_snap_bitmap);
1086      m_snap_bitmap = auto_alloc(machine(), bitmap_t(width, height, BITMAP_FORMAT_RGB32));
10871087   }
10881088
10891089   // render the screen there
r11240r11241
11051105   UINT32 origflags = file.openflags();
11061106
11071107   // handle defaults
1108   const char *snapname = m_machine.options().snap_name();
1108   const char *snapname = machine().options().snap_name();
11091109
11101110   if (snapname == NULL || snapname[0] == 0)
11111111      snapname = "%g/%i";
r11240r11241
11541154
11551155         // verify that there is such a device for this system
11561156         device_image_interface *image = NULL;
1157         for (bool gotone = m_machine.m_devicelist.first(image); gotone; gotone = image->next(image))
1157         for (bool gotone = machine().m_devicelist.first(image); gotone; gotone = image->next(image))
11581158         {
11591159            // get the device name
11601160            astring tempdevname(image->image_config().brief_instance_name());
r11240r11241
11911191
11921192   // substitute path and gamename up front
11931193   snapstr.replace(0, "/", PATH_SEPARATOR);
1194   snapstr.replace(0, "%g", m_machine.basename());
1194   snapstr.replace(0, "%g", machine().basename());
11951195
11961196   // determine if the template has an index; if not, we always use the same name
11971197   astring fname;
r11240r11241
12351235
12361236   // start the profiler and get the current time
12371237   g_profiler.start(PROFILER_MOVIE_REC);
1238   attotime curtime = m_machine.time();
1238   attotime curtime = machine().time();
12391239
12401240   // create the bitmap
12411241   create_snapshot_bitmap(NULL);
r11240r11241
12631263         if (m_movie_frame == 0)
12641264         {
12651265            astring text1(APPNAME, " ", build_version);
1266            astring text2(m_machine.system().manufacturer, " ", m_machine.system().description);
1266            astring text2(machine().system().manufacturer, " ", machine().system().description);
12671267            png_add_text(&pnginfo, "Software", text1);
12681268            png_add_text(&pnginfo, "System", text2);
12691269         }
12701270
12711271         // write the next frame
1272         const rgb_t *palette = (m_machine.palette != NULL) ? palette_entry_list_adjusted(m_machine.palette) : NULL;
1273         png_error error = mng_capture_frame(*m_mngfile, &pnginfo, m_snap_bitmap, m_machine.total_colors(), palette);
1272         const rgb_t *palette = (machine().palette != NULL) ? palette_entry_list_adjusted(machine().palette) : NULL;
1273         png_error error = mng_capture_frame(*m_mngfile, &pnginfo, m_snap_bitmap, machine().total_colors(), palette);
12741274         png_free(&pnginfo);
12751275         if (error != PNGERR_NONE)
12761276         {
src/emu/uimenu.h
r11240r11241
5353***************************************************************************/
5454
5555/* forward declarations */
56typedef struct _ui_menu ui_menu;
56class ui_menu;
5757
5858
5959/* menu-related callback functions */
src/emu/video.h
r11240r11241
8686   video_manager(running_machine &machine);
8787
8888   // getters
89   running_machine &machine() const { return m_machine; }
8990   bool skip_this_frame() const { return m_skipping_this_frame; }
9091   int speed_factor() const { return m_speed; }
9192   int frameskip() const { return m_auto_frameskip ? -1 : m_frameskip_level; }
src/emu/inptport.c
r11240r11241
20992099      /* allocate a new input_port_info structure */
21002100      portstate = auto_alloc_clear(machine, input_port_state);
21012101      ((input_port_config *)port)->state = portstate;
2102      ((input_port_config *)port)->m_machine = &machine;
2102      ((input_port_config *)port)->set_machine(machine);
21032103
21042104      /* start with tail pointers to all the data */
21052105      analogstatetail = &portstate->analoglist;
r11240r11241
36463646     tag(_tag),
36473647     fieldlist(NULL),
36483648     state(NULL),
3649     m_machine(NULL),
36503649     owner(NULL),
3651     active(0)
3650     active(0),
3651     m_machine(NULL)
36523652{
36533653}
36543654
src/emu/devintrf.c
r11240r11241
114114   // append each device from the configuration list
115115   for (const device_config *devconfig = list.first(); devconfig != NULL; devconfig = devconfig->next())
116116   {
117      device_t *newdevice = devconfig->alloc_device(*m_machine);
117      device_t *newdevice = devconfig->alloc_device(machine);
118118      append(devconfig->tag(), *newdevice);
119119      newdevice->find_interfaces();
120120   }
r11240r11241
130130{
131131   // add exit and reset callbacks
132132   assert(m_machine != NULL);
133   m_machine->add_notifier(MACHINE_NOTIFY_RESET, static_reset);
134   m_machine->add_notifier(MACHINE_NOTIFY_EXIT, static_exit);
133   machine().add_notifier(MACHINE_NOTIFY_RESET, static_reset);
134   machine().add_notifier(MACHINE_NOTIFY_EXIT, static_exit);
135135
136136   // add pre-save and post-load callbacks
137   m_machine->state().register_presave(static_pre_save, this);
138   m_machine->state().register_postload(static_post_load, this);
137   machine().state().register_presave(static_pre_save, this);
138   machine().state().register_postload(static_post_load, this);
139139
140140   // iterate over devices to start them
141141   device_t *nextdevice;
r11240r11241
569569//-------------------------------------------------
570570
571571device_t::device_t(running_machine &_machine, const device_config &config)
572   : m_machine(_machine),
573     m_state_manager(_machine.state()),
572   : m_state_manager(_machine.state()),
574573     m_debug(NULL),
575574     m_execute(NULL),
576575     m_memory(NULL),
r11240r11241
585584     m_unscaled_clock(config.m_clock),
586585     m_clock_scale(1.0),
587586     m_attoseconds_per_clock((config.m_clock == 0) ? 0 : HZ_TO_ATTOSECONDS(config.m_clock)),
588     m_auto_finder_list(NULL)
587     m_auto_finder_list(NULL),
588     m_machine(_machine)
589589{
590590}
591591
r11240r11241
596596
597597device_t::~device_t()
598598{
599   auto_free(m_machine, m_debug);
599   auto_free(machine(), m_debug);
600600}
601601
602602
r11240r11241
613613
614614   // build a fully-qualified name
615615   astring tempstring;
616   return m_machine.region(subtag(tempstring, _tag));
616   return machine().region(subtag(tempstring, _tag));
617617}
618618
619619
r11240r11241
630630
631631   // build a fully-qualified name
632632   astring tempstring;
633   return m_machine.device(subtag(tempstring, _tag));
633   return machine().device(subtag(tempstring, _tag));
634634}
635635
636636
r11240r11241
647647
648648   // build a fully-qualified name
649649   astring tempstring;
650   return m_machine.device(siblingtag(tempstring, _tag));
650   return machine().device(siblingtag(tempstring, _tag));
651651}
652652
653653
r11240r11241
714714
715715emu_timer *device_t::timer_alloc(device_timer_id id, void *ptr)
716716{
717   return m_machine.scheduler().timer_alloc(*this, id, ptr);
717   return machine().scheduler().timer_alloc(*this, id, ptr);
718718}
719719
720720
r11240r11241
725725
726726void device_t::timer_set(attotime duration, device_timer_id id, int param, void *ptr)
727727{
728   m_machine.scheduler().timer_set(duration, *this, id, param, ptr);
728   machine().scheduler().timer_set(duration, *this, id, param, ptr);
729729}
730730
731731
r11240r11241
749749void device_t::start()
750750{
751751   // populate the region field
752   m_region = m_machine.region(tag());
752   m_region = machine().region(tag());
753753
754754   // find all the registered devices
755755   for (auto_finder_base *autodev = m_auto_finder_list; autodev != NULL; autodev = autodev->m_next)
r11240r11241
760760      intf->interface_pre_start();
761761
762762   // remember the number of state registrations
763   int state_registrations = m_machine.state().registration_count();
763   int state_registrations = machine().state().registration_count();
764764
765765   // start the device
766766   device_start();
767767
768768   // complain if nothing was registered by the device
769   state_registrations = m_machine.state().registration_count() - state_registrations;
769   state_registrations = machine().state().registration_count() - state_registrations;
770770   device_execute_interface *exec;
771771   device_sound_interface *sound;
772772   if (state_registrations == 0 && (interface(exec) || interface(sound)))
773773   {
774774      logerror("Device '%s' did not register any state to save!\n", tag());
775      if ((m_machine.system().flags & GAME_SUPPORTS_SAVE) != 0)
775      if ((machine().system().flags & GAME_SUPPORTS_SAVE) != 0)
776776         fatalerror("Device '%s' did not register any state to save!", tag());
777777   }
778778
r11240r11241
784784   notify_clock_changed();
785785
786786   // if we're debugging, create a device_debug object
787   if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
787   if ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
788788   {
789      m_debug = auto_alloc(m_machine, device_debug(*this));
789      m_debug = auto_alloc(machine(), device_debug(*this));
790790      debug_setup();
791791   }
792792
src/emu/inptport.h
r11240r11241
742742
743743   input_port_config *next() const { return m_next; }
744744   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
745   void set_machine(running_machine &machine) { m_machine = &machine; }
745746
746747   input_port_config *         m_next;         /* pointer to next port */
747748   const char *            tag;         /* pointer to this port's tag */
r11240r11241
749750
750751   /* these fields are only valid if the port is live */
751752   input_port_state *         state;         /* live state of port (NULL if not live) */
752   running_machine *         m_machine;      /* machine if port is live */
753753   device_config *            owner;         /* associated device, when appropriate */
754754   input_port_value         active;         /* mask of active bits in the port */
755
756private:
757   running_machine *         m_machine;      /* machine if port is live */
755758};
756759
757760
src/emu/devintrf.h
r11240r11241
241241   device_list(resource_pool &pool = global_resource_pool);
242242   void import_config_list(const device_config_list &list, running_machine &machine);
243243
244   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
245
244246   void start_all();
245247   void reset_all();
246248};
r11240r11241
500502
501503   //------------------- end derived class overrides
502504
503   running_machine &      m_machine;
504505   state_manager &         m_state_manager;
505506   device_debug *         m_debug;
506507
r11240r11241
627628   void register_auto_finder(auto_finder_base &autodev);
628629
629630   auto_finder_base *      m_auto_finder_list;
631
632private:
633   running_machine &      m_machine;
630634};
631635
632636
src/emu/rendlay.c
r11240r11241
509509layout_element::~layout_element()
510510{
511511   // loop over all states and free their textures
512   auto_free(m_machine, m_elemtex);
512   auto_free(machine(), m_elemtex);
513513}
514514
515515
r11240r11241
526526   {
527527      m_elemtex[state].m_element = this;
528528      m_elemtex[state].m_state = state;
529      m_elemtex[state].m_texture = m_machine.render().texture_alloc(element_scale, &m_elemtex[state]);
529      m_elemtex[state].m_texture = machine().render().texture_alloc(element_scale, &m_elemtex[state]);
530530   }
531531   return m_elemtex[state].m_texture;
532532}
r11240r11241
554554         bounds.max_y = render_round_nearest(curcomp->bounds().y1 * dest.height);
555555
556556         // based on the component type, add to the texture
557         curcomp->draw(elemtex->m_element->m_machine, dest, bounds, elemtex->m_state);
557         curcomp->draw(elemtex->m_element->machine(), dest, bounds, elemtex->m_state);
558558      }
559559}
560560
r11240r11241
582582layout_element::texture::~texture()
583583{
584584   if (m_element != NULL)
585      m_element->m_machine.render().texture_free(m_texture);
585      m_element->machine().render().texture_free(m_texture);
586586}
587587
588588
src/emu/machine.c
r11240r11241
887887
888888memory_region::~memory_region()
889889{
890   auto_free(m_machine, m_base.v);
890   auto_free(machine(), m_base.v);
891891}
892892
893893
r11240r11241
10351035void driver_device::machine_start()
10361036{
10371037   if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START] != NULL)
1038      (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(m_machine);
1038      (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(machine());
10391039}
10401040
10411041
r11240r11241
10471047void driver_device::sound_start()
10481048{
10491049   if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_START] != NULL)
1050      (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(m_machine);
1050      (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(machine());
10511051}
10521052
10531053
r11240r11241
10591059void driver_device::video_start()
10601060{
10611061   if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START] != NULL)
1062      (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(m_machine);
1062      (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(machine());
10631063}
10641064
10651065
r11240r11241
10811081void driver_device::machine_reset()
10821082{
10831083   if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET] != NULL)
1084      (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(m_machine);
1084      (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(machine());
10851085}
10861086
10871087
r11240r11241
10931093void driver_device::sound_reset()
10941094{
10951095   if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET] != NULL)
1096      (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(m_machine);
1096      (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(machine());
10971097}
10981098
10991099
r11240r11241
11051105void driver_device::video_reset()
11061106{
11071107   if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET] != NULL)
1108      (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(m_machine);
1108      (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(machine());
11091109}
11101110
11111111
r11240r11241
11431143
11441144   // call the game-specific init
11451145   if (m_config.m_system->driver_init != NULL)
1146      (*m_config.m_system->driver_init)(m_machine);
1146      (*m_config.m_system->driver_init)(machine());
11471147
11481148   // finish image devices init process
1149   image_postdevice_init(m_machine);
1149   image_postdevice_init(machine());
11501150
11511151   // call palette_init if present
11521152   if (m_config.m_palette_init != NULL)
1153      (*m_config.m_palette_init)(m_machine, m_machine.region("proms")->base());
1153      (*m_config.m_palette_init)(machine(), machine().region("proms")->base());
11541154
11551155   // start the various pieces
11561156   driver_start();
src/emu/sound/cdp1869.c
r11240r11241
416416void cdp1869_device::device_start()
417417{
418418   // get the screen device
419   m_screen = m_machine.device<screen_device>(m_config.screen_tag);
419   m_screen = machine().device<screen_device>(m_config.screen_tag);
420420   assert(m_screen != NULL);
421421
422422   // resolve callbacks
r11240r11241
434434   initialize_palette();
435435
436436   // create sound stream
437   m_stream = m_machine.sound().stream_alloc(*this, 0, 1, m_machine.sample_rate());
437   m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate());
438438
439439   // register for state saving
440440   save_item(NAME(m_prd));
r11240r11241
496496
497497   for (i = 0; i < 8; i++)
498498   {
499      palette_set_color(m_machine, i, get_rgb(i, i, 15));
499      palette_set_color(machine(), i, get_rgb(i, i, 15));
500500   }
501501
502502   // tone-on-tone display (CFC=1)
r11240r11241
504504   {
505505      for (int l = 0; l < 8; l++)
506506      {
507         palette_set_color(m_machine, i, get_rgb(i, c, l));
507         palette_set_color(machine(), i, get_rgb(i, c, l));
508508         i++;
509509      }
510510   }
r11240r11241
529529      double frequency = (clock() / 2) / (512 >> m_tonefreq) / (m_tonediv + 1);
530530//      double amplitude = m_toneamp * ((0.78*5) / 15);
531531
532      int rate = m_machine.sample_rate() / 2;
532      int rate = machine().sample_rate() / 2;
533533
534534      /* get progress through wave */
535535      int incr = m_incr;
src/emu/sound/okim9810.c
r11240r11241
150150
151151   // create the stream
152152   //int divisor = m_config.m_pin7 ? 132 : 165;
153   m_stream = m_machine.sound().stream_alloc(*this, 0, 2, clock());
153   m_stream = machine().sound().stream_alloc(*this, 0, 2, clock());
154154
155155    // save state stuff
156156    // m_TMP_register
src/emu/sound/spu.c
r11240r11241
11481148{
11491149   const unsigned int hz=44100;
11501150
1151   m_stream = m_machine.sound().stream_alloc(*this, 0, 2, hz);
1151   m_stream = machine().sound().stream_alloc(*this, 0, 2, hz);
11521152
11531153   rev=new reverb(hz);
11541154
src/emu/sound/discrete.c
r11240r11241
688688      /* make sure we have one simple task
689689         * No need to create a node since there are no dependencies.
690690         */
691      task = auto_alloc_clear(m_machine, discrete_task(*this));
691      task = auto_alloc_clear(machine(), discrete_task(*this));
692692      task_list.add(task);
693693   }
694694
r11240r11241
722722               {
723723                  if (task != NULL)
724724                     fatalerror("init_nodes() - Nested DISCRETE_START_TASK.");
725                  task = auto_alloc_clear(m_machine, discrete_task(*this));
725                  task = auto_alloc_clear(machine(), discrete_task(*this));
726726                  task->task_group = block->initial[0];
727727                  if (task->task_group < 0 || task->task_group >= DISCRETE_MAX_TASK_GROUPS)
728728                     fatalerror("discrete_dso_task: illegal task_group %d", task->task_group);
r11240r11241
921921void discrete_device::device_start()
922922{
923923   // create the stream
924   //m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 22257);
924   //m_stream = machine().sound().stream_alloc(*this, 0, 2, 22257);
925925
926926   const discrete_block *intf_start = (m_config.m_intf != NULL) ? m_config.m_intf : (discrete_block *) baseconfig().static_config();
927927   char name[32];
r11240r11241
10211021      fatalerror("init_nodes() - Couldn't find an output node");
10221022
10231023   /* initialize the stream(s) */
1024   m_stream = m_machine.sound().stream_alloc(*this,m_input_stream_list.count(), m_output_list.count(), m_sample_rate);
1024   m_stream = machine().sound().stream_alloc(*this,m_input_stream_list.count(), m_output_list.count(), m_sample_rate);
10251025
10261026   /* Finalize stream_input_nodes */
10271027   for_each(discrete_dss_input_stream_node **, node, &m_input_stream_list)
src/emu/sound/ics2115.c
r11240r11241
4747void ics2115_device::device_start()
4848{
4949    m_rom = *region();
50    m_timer[0].timer = m_machine.scheduler().timer_alloc(FUNC(timer_cb_0), this);
51    m_timer[1].timer = m_machine.scheduler().timer_alloc(FUNC(timer_cb_1), this);
52    m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 33075);
50    m_timer[0].timer = machine().scheduler().timer_alloc(FUNC(timer_cb_0), this);
51    m_timer[1].timer = machine().scheduler().timer_alloc(FUNC(timer_cb_1), this);
52    m_stream = machine().sound().stream_alloc(*this, 0, 2, 33075);
5353
5454    //Exact formula as per patent 5809466
5555    //This seems to give the ok fit but it is not good enough.
src/emu/sound/bsmt2000.c
r11240r11241
226226   // in theory we should generate a 24MHz stream, but that's certainly overkill
227227   // internally at 24MHz the max output sample rate is 32kHz
228228   // divided by 128 gives us 6x the max output rate which is plenty for oversampling
229   m_stream = m_machine.sound().stream_alloc(*this, 0, 2, clock() / 128);
229   m_stream = machine().sound().stream_alloc(*this, 0, 2, clock() / 128);
230230
231231   // register for save states
232232   save_item(NAME(m_register_select));
r11240r11241
326326   synchronize(TIMER_ID_DATA_WRITE, data);
327327
328328   // boost the interleave on a write so that the caller detects the status more accurately
329   m_machine.scheduler().boost_interleave(attotime::from_usec(1), attotime::from_usec(10));
329   machine().scheduler().boost_interleave(attotime::from_usec(1), attotime::from_usec(10));
330330}
331331
332332
src/emu/sound/okim6295.c
r11240r11241
177177
178178   // create the stream
179179   int divisor = m_config.m_pin7 ? 132 : 165;
180   m_stream = m_machine.sound().stream_alloc(*this, 0, 1, clock() / divisor);
180   m_stream = machine().sound().stream_alloc(*this, 0, 1, clock() / divisor);
181181
182182   save_item(NAME(m_command));
183183   save_item(NAME(m_bank_offs));
r11240r11241
266266   if (m_bank_installed)
267267   {
268268      m_bank_offs = base;
269      memory_set_bankptr(m_machine, tag(), m_region->base() + base);
269      memory_set_bankptr(machine(), tag(), m_region->base() + base);
270270   }
271271}
272272
src/emu/sound/asc.c
r11240r11241
129129void asc_device::device_start()
130130{
131131   // create the stream
132   m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 22257, this);
132   m_stream = machine().sound().stream_alloc(*this, 0, 2, 22257, this);
133133
134134   memset(m_regs, 0, sizeof(m_regs));
135135
src/emu/machine.h
r11240r11241
214214
215215public:
216216   // getters
217   running_machine &machine() const { return m_machine; }
217218   memory_region *next() const { return m_next; }
218219   UINT8 *base() const { return (this != NULL) ? m_base.u8 : NULL; }
219220   UINT8 *end() const { return (this != NULL) ? m_base.u8 + m_length : NULL; }
src/emu/layout/ho4f893d.lay
r11240r11241
77      </rect>
88   </element>
99
10   
10
1111   <view name="Color Overlay">
1212      <screen index="0">
1313         <bounds left="0" top="0" right="4" bottom="3" />
r11240r11241
1717      </overlay>
1818   </view>
1919
20   
20
2121</mamelayout>
src/emu/layout/pinball.lay
r11240r11241
55         <color red="0.75" green="0" blue="0.0" />
66      </led7seg>
77   </element>
8     <element name="dummy_str" defstate="0">
8   <element name="dummy_str" defstate="0">
99      <text string="Pinball">
1010         <color red="1.0" green="1.0" blue="1.0" />
1111         <bounds x="0" y="0" width="25" height="5" />
src/emu/devlegcy.c
r11240r11241
218218{
219219   int tokenbytes = m_config.get_legacy_config_int(DEVINFO_INT_TOKEN_BYTES);
220220   if (tokenbytes != 0)
221      m_token = auto_alloc_array_clear(m_machine, UINT8, tokenbytes);
221      m_token = auto_alloc_array_clear(machine(), UINT8, tokenbytes);
222222}
223223
224224
src/emu/render.c
r11240r11241
25302530
25312531render_target *render_manager::target_alloc(const char *layoutfile, UINT32 flags)
25322532{
2533   return &m_targetlist.append(*auto_alloc(m_machine, render_target(*this, layoutfile, flags)));
2533   return &m_targetlist.append(*auto_alloc(machine(), render_target(*this, layoutfile, flags)));
25342534}
25352535
25362536
r11240r11241
26242624
26252625render_font *render_manager::font_alloc(const char *filename)
26262626{
2627   return auto_alloc(m_machine, render_font(*this, filename));
2627   return auto_alloc(machine(), render_font(*this, filename));
26282628}
26292629
26302630
r11240r11241
26342634
26352635void render_manager::font_free(render_font *font)
26362636{
2637   auto_free(m_machine, font);
2637   auto_free(machine(), font);
26382638}
26392639
26402640
r11240r11241
26612661
26622662render_container *render_manager::container_alloc(screen_device *screen)
26632663{
2664   render_container *container = auto_alloc(m_machine, render_container(*this, screen));
2664   render_container *container = auto_alloc(machine(), render_container(*this, screen));
26652665   if (screen != NULL)
26662666      m_screen_container_list.append(*container);
26672667   return container;
r11240r11241
26752675void render_manager::container_free(render_container *container)
26762676{
26772677   m_screen_container_list.detach(*container);
2678   auto_free(m_machine, container);
2678   auto_free(machine(), container);
26792679}
26802680
26812681
r11240r11241
27992799         container->get_user_settings(settings);
28002800
28012801         // output the color controls
2802         if (settings.m_brightness != m_machine.options().brightness())
2802         if (settings.m_brightness != machine().options().brightness())
28032803         {
28042804            xml_set_attribute_float(screennode, "brightness", settings.m_brightness);
28052805            changed = true;
28062806         }
28072807
2808         if (settings.m_contrast != m_machine.options().contrast())
2808         if (settings.m_contrast != machine().options().contrast())
28092809         {
28102810            xml_set_attribute_float(screennode, "contrast", settings.m_contrast);
28112811            changed = true;
28122812         }
28132813
2814         if (settings.m_gamma != m_machine.options().gamma())
2814         if (settings.m_gamma != machine().options().gamma())
28152815         {
28162816            xml_set_attribute_float(screennode, "gamma", settings.m_gamma);
28172817            changed = true;
src/emu/state.c
r11240r11241
156156         fatalerror("Duplicate save state function (%p, %p)", param, func);
157157
158158   // allocate a new entry
159   m_presave_list.append(*auto_alloc(m_machine, state_callback(func, param)));
159   m_presave_list.append(*auto_alloc(machine(), state_callback(func, param)));
160160}
161161
162162
r11240r11241
177177         fatalerror("Duplicate save state function (%p, %p)", param, func);
178178
179179   // allocate a new entry
180   m_postload_list.append(*auto_alloc(m_machine, state_callback(func, param)));
180   m_postload_list.append(*auto_alloc(machine(), state_callback(func, param)));
181181}
182182
183183
r11240r11241
194194   if (!m_reg_allowed)
195195   {
196196      logerror("Attempt to register save state entry after state registration is closed!\nModule %s tag %s name %s\n", module, tag, name);
197      if (m_machine.system().flags & GAME_SUPPORTS_SAVE)
197      if (machine().system().flags & GAME_SUPPORTS_SAVE)
198198         fatalerror("Attempt to register save state entry after state registration is closed!\nModule %s tag %s name %s\n", module, tag, name);
199199      m_illegal_regs++;
200200      return;
r11240r11241
222222   }
223223
224224   // insert us into the list
225   m_entry_list.insert_after(*auto_alloc(m_machine, state_entry(val, totalname, valsize, valcount)), insert_after);
225   m_entry_list.insert_after(*auto_alloc(machine(), state_entry(val, totalname, valsize, valcount)), insert_after);
226226}
227227
228228
r11240r11241
273273
274274   // verify the header and report an error if it doesn't match
275275   UINT32 sig = signature();
276   if (validate_header(header, m_machine.system().name, sig, popmessage, "Error: ")  != STATERR_NONE)
276   if (validate_header(header, machine().system().name, sig, popmessage, "Error: ")  != STATERR_NONE)
277277      return STATERR_INVALID_HEADER;
278278
279279   // determine whether or not to flip the data when done
r11240r11241
293293
294294   // call the post-load functions
295295   for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next())
296      (*func->m_func)(m_machine, func->m_param);
296      (*func->m_func)(machine(), func->m_param);
297297
298298   return STATERR_NONE;
299299}
r11240r11241
314314   memcpy(&header[0], s_magic_num, 8);
315315   header[8] = SAVE_VERSION;
316316   header[9] = NATIVE_ENDIAN_VALUE_LE_BE(0, SS_MSB_FIRST);
317   strncpy((char *)&header[0x0a], m_machine.system().name, 0x1c - 0x0a);
317   strncpy((char *)&header[0x0a], machine().system().name, 0x1c - 0x0a);
318318   UINT32 sig = signature();
319319   *(UINT32 *)&header[0x1c] = LITTLE_ENDIANIZE_INT32(sig);
320320
r11240r11241
327327
328328   // call the pre-save functions
329329   for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next())
330      (*func->m_func)(m_machine, func->m_param);
330      (*func->m_func)(machine(), func->m_param);
331331
332332   // then write all the data
333333   for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
src/emu/emupal.c
r11240r11241
6262class colortable_t
6363{
6464public:
65   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
65   colortable_t(running_machine &machine)
66      : m_machine(machine) { }
6667
67   running_machine *   m_machine;         /* associated machine */
68   running_machine &machine() const { return m_machine; }
69
6870   UINT32            entries;         /* number of entries */
6971   UINT32            palentries;         /* number of palette entries */
7072   UINT16 *         raw;            /* raw data about each entry */
7173   rgb_t *            palette;         /* palette entries */
74
75private:
76   running_machine &   m_machine;         /* associated machine */
7277};
7378
7479
r11240r11241
323328   assert(palettesize > 0);
324329
325330   /* allocate the colortable */
326   ctable = auto_alloc_clear(machine, colortable_t);
331   ctable = auto_alloc_clear(machine, colortable_t(machine));
327332
328333   /* fill in the basics */
329   ctable->m_machine = &machine;
330334   ctable->entries = machine.total_colors();
331335   ctable->palentries = palettesize;
332336
src/emu/cheat.c
r11240r11241
11251125void cheat_manager::set_enable(bool enable)
11261126{
11271127   // if the cheat engine is disabled, we're done
1128   if (!m_machine.options().cheat())
1128   if (!machine().options().cheat())
11291129      return;
11301130
11311131   // if we're enabled currently and we don't want to be, turn things off
r11240r11241
11601160void cheat_manager::reload()
11611161{
11621162   // if the cheat engine is disabled, we're done
1163   if (!m_machine.options().cheat())
1163   if (!machine().options().cheat())
11641164      return;
11651165
11661166   // free everything
r11240r11241
11751175   // load the cheat file, MESS will load a crc32.xml ( eg. 01234567.xml )
11761176    // and MAME will load gamename.xml
11771177   device_image_interface *image = NULL;
1178   for (bool gotone = m_machine.m_devicelist.first(image); gotone; gotone = image->next(image))
1178   for (bool gotone = machine().m_devicelist.first(image); gotone; gotone = image->next(image))
11791179      if (image->exists())
11801180      {
11811181         // if we are loading through software lists, try to load shortname.xml
r11240r11241
11991199
12001200   // if we haven't found the cheats yet, load by basename
12011201   if (m_cheatlist.count() == 0)
1202      load_cheats(m_machine.basename());
1202      load_cheats(machine().basename());
12031203
12041204   // temporary: save the file back out as output.xml for comparison
12051205   if (m_cheatlist.count() != 0)
r11240r11241
12151215bool cheat_manager::save_all(const char *filename)
12161216{
12171217   // open the file with the proper name
1218   emu_file cheatfile(m_machine.options().cheat_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
1218   emu_file cheatfile(machine().options().cheat_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
12191219   file_error filerr = cheatfile.open(filename, ".xml");
12201220
12211221   // if that failed, return nothing
r11240r11241
12621262      {
12631263         // output the text
12641264         ui_draw_text_full(&container, m_output[linenum],
1265               0.0f, (float)linenum * ui_get_line_height(m_machine), 1.0f,
1265               0.0f, (float)linenum * ui_get_line_height(machine()), 1.0f,
12661266               m_justify[linenum], WRAP_NEVER, DRAW_OPAQUE,
12671267               ARGB_WHITE, ARGB_BLACK, NULL, NULL);
12681268      }
r11240r11241
13891389{
13901390   // set up for accumulating output
13911391   m_lastline = 0;
1392   m_numlines = floor(1.0f / ui_get_line_height(m_machine));
1392   m_numlines = floor(1.0f / ui_get_line_height(machine()));
13931393   m_numlines = MIN(m_numlines, ARRAY_LENGTH(m_output));
13941394   for (int linenum = 0; linenum < ARRAY_LENGTH(m_output); linenum++)
13951395      m_output[linenum].reset();
r11240r11241
14111411void cheat_manager::load_cheats(const char *filename)
14121412{
14131413   xml_data_node *rootnode = NULL;
1414   emu_file cheatfile(m_machine.options().cheat_path(), OPEN_FLAG_READ);
1414   emu_file cheatfile(machine().options().cheat_path(), OPEN_FLAG_READ);
14151415   try
14161416   {
14171417      // open the file with the proper name
r11240r11241
14461446         for (xml_data_node *cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != NULL; cheatnode = xml_get_sibling(cheatnode->next, "cheat"))
14471447         {
14481448            // load this entry
1449            cheat_entry *curcheat = auto_alloc(m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
1449            cheat_entry *curcheat = auto_alloc(machine(), cheat_entry(*this, m_symtable, filename, *cheatnode));
14501450
14511451            // make sure we're not a duplicate
14521452            cheat_entry *scannode = NULL;
r11240r11241
14621462            if (scannode == NULL)
14631463               m_cheatlist.append(*curcheat);
14641464            else
1465               auto_free(m_machine, curcheat);
1465               auto_free(machine(), curcheat);
14661466         }
14671467
14681468         // free the file and loop for the next one
src/emu/state.h
r11240r11241
148148   state_manager(running_machine &machine);
149149
150150   // getters
151   running_machine &machine() const { return m_machine; }
151152   int registration_count() const { return m_entry_list.count(); }
152153   bool registration_allowed() const { return m_reg_allowed; }
153154
src/emu/speaker.c
r11240r11241
170170   }
171171
172172   // allocate the mixer stream
173   m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, m_machine.sample_rate());
173   m_mixer_stream = machine().sound().stream_alloc(*this, m_auto_allocated_inputs, 1, machine().sample_rate());
174174}
175175
176176
r11240r11241
182182
183183void speaker_device::device_post_load()
184184{
185   m_mixer_stream->set_sample_rate(m_machine.sample_rate());
185   m_mixer_stream->set_sample_rate(machine().sample_rate());
186186}
187187
188188
src/emu/schedule.c
r11240r11241
290290   }
291291
292292   // save the bits
293   m_machine->state().save_item("timer", name, index, NAME(m_param));
294   m_machine->state().save_item("timer", name, index, NAME(m_enabled));
295   m_machine->state().save_item("timer", name, index, NAME(m_period));
296   m_machine->state().save_item("timer", name, index, NAME(m_start));
297   m_machine->state().save_item("timer", name, index, NAME(m_expire));
293   machine().state().save_item("timer", name, index, NAME(m_param));
294   machine().state().save_item("timer", name, index, NAME(m_enabled));
295   machine().state().save_item("timer", name, index, NAME(m_period));
296   machine().state().save_item("timer", name, index, NAME(m_start));
297   machine().state().save_item("timer", name, index, NAME(m_expire));
298298}
299299
300300
r11240r11241
340340   m_quantum_minimum(ATTOSECONDS_IN_NSEC(1) / 1000)
341341{
342342   // append a single never-expiring timer so there is always one in the list
343   m_timer_list = &m_timer_allocator.alloc()->init(m_machine, NULL, NULL, NULL, true);
343   m_timer_list = &m_timer_allocator.alloc()->init(machine, NULL, NULL, NULL, true);
344344   m_timer_list->adjust(attotime::never);
345345
346346   // register global states
347   m_machine.state().save_item(NAME(m_basetime));
348   m_machine.state().register_postload(&state_postload_stub<device_scheduler, &device_scheduler::postload>, this);
347   machine.state().save_item(NAME(m_basetime));
348   machine.state().register_postload(&state_postload_stub<device_scheduler, &device_scheduler::postload>, this);
349349}
350350
351351
r11240r11241
401401
402402void device_scheduler::timeslice()
403403{
404   bool call_debugger = ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0);
404   bool call_debugger = ((machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
405405
406406   // build the execution list if we don't have one yet
407407   if (m_execute_list == NULL)
r11240r11241
562562
563563emu_timer *device_scheduler::timer_alloc(timer_expired_func callback, const char *name, void *ptr)
564564{
565   return &m_timer_allocator.alloc()->init(m_machine, callback, name, ptr, false);
565   return &m_timer_allocator.alloc()->init(machine(), callback, name, ptr, false);
566566}
567567
568568
r11240r11241
574574
575575void device_scheduler::timer_set(attotime duration, timer_expired_func callback, const char *name, int param, void *ptr)
576576{
577   m_timer_allocator.alloc()->init(m_machine, callback, name, ptr, true).adjust(duration, param);
577   m_timer_allocator.alloc()->init(machine(), callback, name, ptr, true).adjust(duration, param);
578578}
579579
580580
r11240r11241
586586
587587void device_scheduler::timer_pulse(attotime period, timer_expired_func callback, const char *name, int param, void *ptr)
588588{
589   m_timer_allocator.alloc()->init(m_machine, callback, name, ptr, false).adjust(period, param, period);
589   m_timer_allocator.alloc()->init(machine(), callback, name, ptr, false).adjust(period, param, period);
590590}
591591
592592
r11240r11241
719719   if (m_quantum_list.first() == NULL)
720720   {
721721      // set the core scheduling quantum
722      attotime min_quantum = m_machine.config().m_minimum_quantum;
722      attotime min_quantum = machine().config().m_minimum_quantum;
723723
724724      // if none specified default to 60Hz
725725      if (min_quantum == attotime::zero)
726726         min_quantum = attotime::from_hz(60);
727727
728728      // if the configuration specifies a device to make perfect, pick that as the minimum
729      if (m_machine.config().m_perfect_cpu_quantum != NULL)
729      if (machine().config().m_perfect_cpu_quantum != NULL)
730730      {
731         device_t *device = m_machine.device(m_machine.config().m_perfect_cpu_quantum);
731         device_t *device = machine().device(machine().config().m_perfect_cpu_quantum);
732732         if (device == NULL)
733            fatalerror("Device '%s' specified for perfect interleave is not present!", m_machine.config().m_perfect_cpu_quantum);
733            fatalerror("Device '%s' specified for perfect interleave is not present!", machine().config().m_perfect_cpu_quantum);
734734
735735         device_execute_interface *exec;
736736         if (!device->interface(exec))
737            fatalerror("Device '%s' specified for perfect interleave is not an executing device!", m_machine.config().m_perfect_cpu_quantum);
737            fatalerror("Device '%s' specified for perfect interleave is not an executing device!", machine().config().m_perfect_cpu_quantum);
738738
739739         min_quantum = min(attotime(0, exec->minimum_quantum()), min_quantum);
740740      }
r11240r11241
756756
757757   // iterate over all devices
758758   device_execute_interface *exec = NULL;
759   for (bool gotone = m_machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
759   for (bool gotone = machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
760760   {
761761      // append to the appropriate list
762762      exec->m_nextexec = NULL;
r11240r11241
875875         if (timer.m_device != NULL)
876876            timer.m_device->timer_expired(timer, timer.m_id, timer.m_param, timer.m_ptr);
877877         else if (timer.m_callback != NULL)
878            (*timer.m_callback)(m_machine, timer.m_ptr, timer.m_param);
878            (*timer.m_callback)(machine(), timer.m_ptr, timer.m_param);
879879
880880         g_profiler.stop();
881881      }
src/emu/schedule.h
r11240r11241
159159   ~device_scheduler();
160160
161161   // getters
162   running_machine &machine() const { return m_machine; }
162163   attotime time() const;
163164   emu_timer *first_timer() const { return m_timer_list; }
164165   device_execute_interface *currently_executing() const { return m_executing_device; }
src/emu/devimage.c
r11240r11241
320320            // " swlist % clonename % parentname "
321321            // below, we have the code to split the elements and to create paths to load from
322322
323            software_list *software_list_ptr = software_list_open(m_machine.options(), swlist, FALSE, NULL);
323            software_list *software_list_ptr = software_list_open(machine().options(), swlist, FALSE, NULL);
324324            if (software_list_ptr)
325325            {
326326               for (software_info *swinfo = software_list_find(software_list_ptr, swname, NULL); swinfo != NULL; )
r11240r11241
332332                     locationtag.cat(breakstr);
333333                     //printf("%s\n", locationtag.cstr());
334334                  }
335                  const char *parentname = software_get_clone(m_machine.options(), swlist, swinfo->shortname);
335                  const char *parentname = software_get_clone(machine().options(), swlist, swinfo->shortname);
336336                  if (parentname != NULL)
337337                     swinfo = software_list_find(software_list_ptr, parentname, NULL);
338338                  else
r11240r11241
343343               software_list_close(software_list_ptr);
344344            }
345345
346            if (software_get_support(m_machine.options(), swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
346            if (software_get_support(machine().options(), swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
347347               mame_printf_error("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist);
348348
349            if (software_get_support(m_machine.options(), swlist, swname) == SOFTWARE_SUPPORTED_NO)
349            if (software_get_support(machine().options(), swlist, swname) == SOFTWARE_SUPPORTED_NO)
350350               mame_printf_error("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist);
351351
352352            // check if locationtag actually contains two locations separated by '%'
r11240r11241
376376            // - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
377377            // try to load from list/setname
378378            if ((m_mame_file == NULL) && (tag2.cstr() != NULL))
379               filerr = common_process_file(m_machine.options(), tag2.cstr(), has_crc, crc, romp, &m_mame_file);
379               filerr = common_process_file(machine().options(), tag2.cstr(), has_crc, crc, romp, &m_mame_file);
380380            // try to load from list/parentname
381381            if ((m_mame_file == NULL) && (tag3.cstr() != NULL))
382               filerr = common_process_file(m_machine.options(), tag3.cstr(), has_crc, crc, romp, &m_mame_file);
382               filerr = common_process_file(machine().options(), tag3.cstr(), has_crc, crc, romp, &m_mame_file);
383383            // try to load from setname
384384            if ((m_mame_file == NULL) && (tag4.cstr() != NULL))
385               filerr = common_process_file(m_machine.options(), tag4.cstr(), has_crc, crc, romp, &m_mame_file);
385               filerr = common_process_file(machine().options(), tag4.cstr(), has_crc, crc, romp, &m_mame_file);
386386            // try to load from parentname
387387            if ((m_mame_file == NULL) && (tag5.cstr() != NULL))
388               filerr = common_process_file(m_machine.options(), tag5.cstr(), has_crc, crc, romp, &m_mame_file);
388               filerr = common_process_file(machine().options(), tag5.cstr(), has_crc, crc, romp, &m_mame_file);
389389
390390            if (filerr == FILERR_NONE)
391391            {
r11240r11241
489489    if (m_err!=0) {
490490      if (!m_init_phase)
491491      {
492         if (m_machine.phase() == MACHINE_PHASE_RUNNING)
492         if (machine().phase() == MACHINE_PHASE_RUNNING)
493493            popmessage("Error: Unable to %s image '%s': %s\n", is_create ? "create" : "load", path, error());
494494         else
495495            mame_printf_error("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, error());
r11240r11241
504504      {
505505         if (!m_init_phase)
506506         {
507            if (m_machine.phase() == MACHINE_PHASE_RUNNING)
507            if (machine().phase() == MACHINE_PHASE_RUNNING)
508508               popmessage("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded");
509509            else
510510               mame_printf_info("Image '%s' was successfully %s.\n", path, is_create ? "created" : "loaded");
src/emu/audit.c
r11240r11241
7979const char *driverpath = m_enumerator.config().m_devicelist.find("root")->searchpath();
8080
8181   // iterate over ROM sources and regions
82   bool anyfound = false;
83   bool anyrequired = false;
82   int found = 0;
83   int required = 0;
84   int shared_found = 0;
85   int shared_required = 0;
8486   for (const rom_source *source = rom_first_source(m_enumerator.config()); source != NULL; source = rom_next_source(*source))
8587   {
8688      // determine the search path for this source and iterate through the regions
r11240r11241
8991      // also determine if this is the driver's specific ROMs or not
9092      bool source_is_gamedrv = (dynamic_cast<const driver_device_config_base *>(source) != NULL);
9193
92// temporary hack: add the driver path
93astring combinedpath(m_searchpath, ";", driverpath);
94      // now iterate over regions and ROMs within
95      for (const rom_entry *region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
96      {
97// temporary hack: add the driver path & region name
98astring combinedpath(source->searchpath(), ";", driverpath);
99if (ROMREGION_ISLOADBYNAME(region))
100   combinedpath.cat(";").cat(ROMREGION_GETTAG(region));
94101m_searchpath = combinedpath;
95102
96      // now iterate over regions and ROMs within
97      for (const rom_entry *region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
98103         for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
99104         {
100105            hash_collection hashes(ROM_GETHASHDATA(rom));
106            bool shared = (also_used_by_parent(hashes) != -1);
101107
102108            // if a dump exists, then at least one entry is required
103109            if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
104               anyrequired = true;
110            {
111               required++;
112               if (shared)
113                  shared_required++;
114            }
105115
106116            // audit a file
107117            audit_record *record = NULL;
r11240r11241
117127               continue;
118128
119129            // if we got a record back,
120            if (record->status() != audit_record::STATUS_NOT_FOUND && source_is_gamedrv && also_used_by_parent(hashes) == -1)
121               anyfound = true;
130            if (record->status() != audit_record::STATUS_NOT_FOUND && source_is_gamedrv)
131            {
132               found++;
133               if (shared)
134                  shared_found++;
135            }
122136         }
137      }
123138   }
124139
125   // if we found nothing, we don't have the set at all
126   if (!anyfound && anyrequired)
140   // if we found nothing unique to this set & the set needs roms that aren't in the parent or the parent isn't found either, then we don't have the set at all
141   if (found == shared_found && required > 0 && (required != shared_required || shared_found == 0))
127142      m_record_list.reset();
128143
129144   // return a summary
src/emu/memory.c
r11240r11241
262262   ~memory_block();
263263
264264   // getters
265   running_machine &machine() const { return m_machine; }
265266   memory_block *next() const { return m_next; }
266267   offs_t bytestart() const { return m_bytestart; }
267268   offs_t byteend() const { return m_byteend; }
r11240r11241
336337
337338   // getters
338339   memory_bank *next() const { return m_next; }
340   running_machine &machine() const { return m_machine; }
339341   int index() const { return m_index; }
340342   int entry() const { return m_curentry; }
341343   bool anonymous() const { return m_anonymous; }
r11240r11241
17931795   : m_next(NULL),
17941796     m_config(*memory.space_config(spacenum)),
17951797     m_device(memory.device()),
1796     m_machine(memory.device().machine()),
17971798     m_map(NULL),
17981799     m_addrmask(0xffffffffUL >> (32 - m_config.m_addrbus_width)),
17991800     m_bytemask(address_to_byte_end(m_addrmask)),
r11240r11241
18061807     m_direct(*auto_alloc(memory.device().machine(), direct_read_data(*this))),
18071808     m_name(memory.space_config(spacenum)->name()),
18081809     m_addrchars((m_config.m_databus_width + 3) / 4),
1809     m_logaddrchars((m_config.m_logaddr_width + 3) / 4)
1810     m_logaddrchars((m_config.m_logaddr_width + 3) / 4),
1811     m_machine(memory.device().machine())
18101812{
18111813   // notify the device
18121814   memory.set_address_space(spacenum, *this);
r11240r11241
19341936
19351937void address_space::prepare_map()
19361938{
1937   const memory_region *devregion = (m_spacenum == AS_0) ? m_machine.region(m_device.tag()) : NULL;
1939   const memory_region *devregion = (m_spacenum == AS_0) ? machine().region(m_device.tag()) : NULL;
19381940   UINT32 devregionsize = (devregion != NULL) ? devregion->bytes() : 0;
19391941
19401942   // allocate the address map
r11240r11241
19591961      adjust_addresses(entry->m_bytestart, entry->m_byteend, entry->m_bytemask, entry->m_bytemirror);
19601962
19611963      // if we have a share entry, add it to our map
1962      if (entry->m_share != NULL && m_machine.memory_data->sharemap.find(entry->m_share) == NULL)
1964      if (entry->m_share != NULL && machine().memory_data->sharemap.find(entry->m_share) == NULL)
19631965      {
19641966         VPRINTF(("Creating share '%s' of length 0x%X\n", entry->m_share, entry->m_byteend + 1 - entry->m_bytestart));
1965         memory_share *share = auto_alloc(m_machine, memory_share(entry->m_byteend + 1 - entry->m_bytestart));
1966         m_machine.memory_data->sharemap.add(entry->m_share, share, false);
1967         memory_share *share = auto_alloc(machine(), memory_share(entry->m_byteend + 1 - entry->m_bytestart));
1968         machine().memory_data->sharemap.add(entry->m_share, share, false);
19671969      }
19681970
19691971      // if this is a ROM handler without a specified region, attach it to the implicit region
r11240r11241
19801982      // validate adjusted addresses against implicit regions
19811983      if (entry->m_region != NULL && entry->m_share == NULL && entry->m_baseptr == NULL)
19821984      {
1983         const memory_region *region = m_machine.region(entry->m_region);
1985         const memory_region *region = machine().region(entry->m_region);
19841986         if (region == NULL)
19851987            fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", m_device.tag(), m_name, entry->m_addrstart, entry->m_addrend, entry->m_region);
19861988
r11240r11241
19911993
19921994      // convert any region-relative entries to their memory pointers
19931995      if (entry->m_region != NULL)
1994         entry->m_memory = m_machine.region(entry->m_region)->base() + entry->m_rgnoffs;
1996         entry->m_memory = machine().region(entry->m_region)->base() + entry->m_rgnoffs;
19951997   }
19961998
19971999   // now loop over all the handlers and enforce the address mask
r11240r11241
20682070      case AMH_DEVICE_DELEGATE:
20692071         if (data.m_type == AMH_DRIVER_DELEGATE)
20702072         {
2071            object = m_machine.driver_data<driver_device>();
2073            object = machine().driver_data<driver_device>();
20722074            if (object == NULL)
20732075               throw emu_fatalerror("Attempted to map a driver delegate in space %s of device '%s' when there is no driver data\n", m_name, m_device.tag());
20742076         }
20752077         else
20762078         {
2077            object = m_machine.device(data.m_tag);
2079            object = machine().device(data.m_tag);
20782080            if (object == NULL)
20792081               throw emu_fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", data.m_tag, m_name, m_device.tag());
20802082         }
r11240r11241
21172119         break;
21182120
21192121      case AMH_LEGACY_DEVICE_HANDLER:
2120         device = m_machine.device(data.m_tag);
2122         device = machine().device(data.m_tag);
21212123         if (device == NULL)
21222124            fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", data.m_tag, m_name, m_device.tag());
21232125
r11240r11241
21622164
21632165void address_space::allocate_memory()
21642166{
2165   simple_list<memory_block> &blocklist = m_machine.memory_data->blocklist;
2167   simple_list<memory_block> &blocklist = machine().memory_data->blocklist;
21662168
21672169   // make a first pass over the memory map and track blocks with hardcoded pointers
21682170   // we do this to make sure they are found by space_find_backing_memory first
21692171   memory_block *prev_memblock_tail = blocklist.last();
21702172   for (address_map_entry *entry = m_map->m_entrylist.first(); entry != NULL; entry = entry->next())
21712173      if (entry->m_memory != NULL)
2172         blocklist.append(*auto_alloc(m_machine, memory_block(*this, entry->m_bytestart, entry->m_byteend, entry->m_memory)));
2174         blocklist.append(*auto_alloc(machine(), memory_block(*this, entry->m_bytestart, entry->m_byteend, entry->m_memory)));
21732175
21742176   // loop over all blocks just allocated and assign pointers from them
21752177   address_map_entry *unassigned = NULL;
r11240r11241
22162218      // we now have a block to allocate; do it
22172219      offs_t curbytestart = curblockstart * MEMORY_BLOCK_CHUNK;
22182220      offs_t curbyteend = curblockend * MEMORY_BLOCK_CHUNK + (MEMORY_BLOCK_CHUNK - 1);
2219      memory_block &block = blocklist.append(*auto_alloc(m_machine, memory_block(*this, curbytestart, curbyteend)));
2221      memory_block &block = blocklist.append(*auto_alloc(machine(), memory_block(*this, curbytestart, curbyteend)));
22202222
22212223      // assign memory that intersected the new block
22222224      unassigned = block_assign_intersecting(curbytestart, curbyteend, block.data());
r11240r11241
22372239      if (entry->m_baseptr != NULL)
22382240         *entry->m_baseptr = entry->m_memory;
22392241      if (entry->m_baseptroffs_plus1 != 0)
2240         *(void **)(reinterpret_cast<UINT8 *>(m_machine.driver_data<void>()) + entry->m_baseptroffs_plus1 - 1) = entry->m_memory;
2242         *(void **)(reinterpret_cast<UINT8 *>(machine().driver_data<void>()) + entry->m_baseptroffs_plus1 - 1) = entry->m_memory;
22412243      if (entry->m_genbaseptroffs_plus1 != 0)
2242         *(void **)((UINT8 *)&m_machine.generic + entry->m_genbaseptroffs_plus1 - 1) = entry->m_memory;
2244         *(void **)((UINT8 *)&machine().generic + entry->m_genbaseptroffs_plus1 - 1) = entry->m_memory;
22432245      if (entry->m_sizeptr != NULL)
22442246         *entry->m_sizeptr = entry->m_byteend - entry->m_bytestart + 1;
22452247      if (entry->m_sizeptroffs_plus1 != 0)
2246         *(size_t *)(reinterpret_cast<UINT8 *>(m_machine.driver_data<void>()) + entry->m_sizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
2248         *(size_t *)(reinterpret_cast<UINT8 *>(machine().driver_data<void>()) + entry->m_sizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
22472249      if (entry->m_gensizeptroffs_plus1 != 0)
2248         *(size_t *)((UINT8 *)&m_machine.generic + entry->m_gensizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
2250         *(size_t *)((UINT8 *)&machine().generic + entry->m_gensizeptroffs_plus1 - 1) = entry->m_byteend - entry->m_bytestart + 1;
22492251   }
22502252
22512253   // once this is done, find the starting bases for the banks
2252   for (memory_bank *bank = m_machine.memory_data->banklist.first(); bank != NULL; bank = bank->next())
2254   for (memory_bank *bank = machine().memory_data->banklist.first(); bank != NULL; bank = bank->next())
22532255      if (bank->base() == NULL && bank->references_space(*this, ROW_READWRITE))
22542256      {
22552257         // set the initial bank pointer
r11240r11241
22802282   bool found = false;
22812283
22822284   // loop over banks looking for a match
2283   for (memory_bank *bank = m_machine.memory_data->banklist.first(); bank != NULL; bank = bank->next())
2285   for (memory_bank *bank = machine().memory_data->banklist.first(); bank != NULL; bank = bank->next())
22842286   {
22852287      // consider this bank if it is used for reading and matches the address space
22862288      if (bank->references_space(*this, ROW_READ))
r11240r11241
23122314
23132315address_map_entry *address_space::block_assign_intersecting(offs_t bytestart, offs_t byteend, UINT8 *base)
23142316{
2315   memory_private *memdata = m_machine.memory_data;
2317   memory_private *memdata = machine().memory_data;
23162318   address_map_entry *unassigned = NULL;
23172319
23182320   // loop over the adjusted map and assign memory to any blocks we can
r11240r11241
24442446   if (rtag != NULL)
24452447   {
24462448      // find the port
2447      const input_port_config *port = m_machine.port(rtag);
2449      const input_port_config *port = machine().port(rtag);
24482450      if (port == NULL)
24492451         throw emu_fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, m_name, m_device.tag());
24502452
r11240r11241
24562458   if (wtag != NULL)
24572459   {
24582460      // find the port
2459      const input_port_config *port = m_machine.port(wtag);
2461      const input_port_config *port = machine().port(wtag);
24602462      if (port == NULL)
24612463         fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, m_name, m_device.tag());
24622464
r11240r11241
24662468   }
24672469
24682470   // update the memory dump
2469   generate_memdump(m_machine);
2471   generate_memdump(machine());
24702472}
24712473
24722474
r11240r11241
24972499   }
24982500
24992501   // update the memory dump
2500   generate_memdump(m_machine);
2502   generate_memdump(machine());
25012503}
25022504
25032505
r11240r11241
25082510
25092511void *address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read_or_write readorwrite, void *baseptr)
25102512{
2511   memory_private *memdata = m_machine.memory_data;
2513   memory_private *memdata = machine().memory_data;
25122514
25132515   VPRINTF(("address_space::install_ram_generic(%s-%s mask=%s mirror=%s, %s, %p)\n",
25142516          core_i64_hex_format(addrstart, m_addrchars), core_i64_hex_format(addrend, m_addrchars),
r11240r11241
25382540      // if we still don't have a pointer, and we're past the initialization phase, allocate a new block
25392541      if (bank.base() == NULL && memdata->initialized)
25402542      {
2541         if (m_machine.phase() >= MACHINE_PHASE_RESET)
2543         if (machine().phase() >= MACHINE_PHASE_RESET)
25422544            fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!");
2543         memory_block &block = memdata->blocklist.append(*auto_alloc(m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
2545         memory_block &block = memdata->blocklist.append(*auto_alloc(machine(), memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
25442546         bank.set_base(block.data());
25452547      }
25462548   }
r11240r11241
25672569      // if we still don't have a pointer, and we're past the initialization phase, allocate a new block
25682570      if (bank.base() == NULL && memdata->initialized)
25692571      {
2570         if (m_machine.phase() >= MACHINE_PHASE_RESET)
2572         if (machine().phase() >= MACHINE_PHASE_RESET)
25712573            fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!");
2572         memory_block &block = memdata->blocklist.append(*auto_alloc(m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
2574         memory_block &block = memdata->blocklist.append(*auto_alloc(machine(), memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
25732575         bank.set_base(block.data());
25742576      }
25752577   }
r11240r11241
25922594
25932595   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
25942596   read().handler_read(entry).set_delegate(handler, unitmask);
2595   generate_memdump(m_machine);
2597   generate_memdump(machine());
25962598   return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
25972599}
25982600
r11240r11241
26052607
26062608   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
26072609   write().handler_write(entry).set_delegate(handler, unitmask);
2608   generate_memdump(m_machine);
2610   generate_memdump(machine());
26092611   return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
26102612}
26112613
r11240r11241
26312633
26322634   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
26332635   read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
2634   generate_memdump(m_machine);
2636   generate_memdump(machine());
26352637   return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
26362638}
26372639
r11240r11241
26442646
26452647   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
26462648   write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
2647   generate_memdump(m_machine);
2649   generate_memdump(machine());
26482650   return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
26492651}
26502652
r11240r11241
26692671
26702672   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
26712673   read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
2672   generate_memdump(m_machine);
2674   generate_memdump(machine());
26732675   return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
26742676}
26752677
r11240r11241
26822684
26832685   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
26842686   write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
2685   generate_memdump(m_machine);
2687   generate_memdump(machine());
26862688   return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
26872689}
26882690
r11240r11241
27022704{
27032705   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
27042706   read().handler_read(entry).set_delegate(handler, unitmask);
2705   generate_memdump(m_machine);
2707   generate_memdump(machine());
27062708   return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
27072709}
27082710
r11240r11241
27102712{
27112713   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
27122714   write().handler_write(entry).set_delegate(handler, unitmask);
2713   generate_memdump(m_machine);
2715   generate_memdump(machine());
27142716   return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
27152717}
27162718
r11240r11241
27312733{
27322734   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
27332735   read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
2734   generate_memdump(m_machine);
2736   generate_memdump(machine());
27352737   return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
27362738}
27372739
r11240r11241
27392741{
27402742   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
27412743   write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
2742   generate_memdump(m_machine);
2744   generate_memdump(machine());
27432745   return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
27442746}
27452747
r11240r11241
27592761{
27602762   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
27612763   read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
2762   generate_memdump(m_machine);
2764   generate_memdump(machine());
27632765   return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
27642766}
27652767
r11240r11241
27672769{
27682770   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
27692771   write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
2770   generate_memdump(m_machine);
2772   generate_memdump(machine());
27712773   return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
27722774}
27732775
r11240r11241
27872789{
27882790   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
27892791   read().handler_read(entry).set_delegate(handler, unitmask);
2790   generate_memdump(m_machine);
2792   generate_memdump(machine());
27912793   return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
27922794}
27932795
r11240r11241
27952797{
27962798   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
27972799   write().handler_write(entry).set_delegate(handler, unitmask);
2798   generate_memdump(m_machine);
2800   generate_memdump(machine());
27992801   return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
28002802}
28012803
r11240r11241
28162818{
28172819   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
28182820   read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
2819   generate_memdump(m_machine);
2821   generate_memdump(machine());
28202822   return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
28212823}
28222824
r11240r11241
28242826{
28252827   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
28262828   write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
2827   generate_memdump(m_machine);
2829   generate_memdump(machine());
28282830   return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
28292831}
28302832
r11240r11241
28442846{
28452847   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
28462848   read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
2847   generate_memdump(m_machine);
2849   generate_memdump(machine());
28482850   return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
28492851}
28502852
r11240r11241
28522854{
28532855   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
28542856   write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
2855   generate_memdump(m_machine);
2857   generate_memdump(machine());
28562858   return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
28572859}
28582860
r11240r11241
28722874{
28732875   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
28742876   read().handler_read(entry).set_delegate(handler, unitmask);
2875   generate_memdump(m_machine);
2877   generate_memdump(machine());
28762878   return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
28772879}
28782880
r11240r11241
28802882{
28812883   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
28822884   write().handler_write(entry).set_delegate(handler, unitmask);
2883   generate_memdump(m_machine);
2885   generate_memdump(machine());
28842886   return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
28852887}
28862888
r11240r11241
29012903{
29022904   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
29032905   read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
2904   generate_memdump(m_machine);
2906   generate_memdump(machine());
29052907   return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
29062908}
29072909
r11240r11241
29092911{
29102912   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
29112913   write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
2912   generate_memdump(m_machine);
2914   generate_memdump(machine());
29132915   return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
29142916}
29152917
r11240r11241
29292931{
29302932   UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
29312933   read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
2932   generate_memdump(m_machine);
2934   generate_memdump(machine());
29332935   return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
29342936}
29352937
r11240r11241
29372939{
29382940   UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
29392941   write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
2940   generate_memdump(m_machine);
2942   generate_memdump(machine());
29412943   return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
29422944}
29432945
r11240r11241
29822984   }
29832985
29842986   // if not found there, look in the allocated blocks
2985   for (memory_block *block = m_machine.memory_data->blocklist.first(); block != NULL; block = block->next())
2987   for (memory_block *block = machine().memory_data->blocklist.first(); block != NULL; block = block->next())
29862988      if (block->contains(*this, bytestart, byteend))
29872989      {
29882990         VPRINTF(("found in allocated memory block %08X-%08X [%p]\n", block->bytestart(), block->byteend(), block->data() + (bytestart - block->bytestart())));
r11240r11241
30093011   // if we are sharing, and we don't have a pointer yet, create one
30103012   if (entry->m_share != NULL)
30113013   {
3012      memory_share *share = m_machine.memory_data->sharemap.find(entry->m_share);
3014      memory_share *share = machine().memory_data->sharemap.find(entry->m_share);
30133015      if (share != NULL && share->ptr() == NULL)
30143016         return true;
30153017   }
r11240r11241
30193021      return true;
30203022
30213023   // if we're reading from RAM or from ROM outside of address space 0 or its region, then yes, we do need backing
3022   const memory_region *region = m_machine.region(m_device.tag());
3024   const memory_region *region = machine().region(m_device.tag());
30233025   if (entry->m_read.m_type == AMH_RAM ||
30243026      (entry->m_read.m_type == AMH_ROM && (m_spacenum != AS_0 || region == NULL || entry->m_addrstart >= region->bytes())))
30253027      return true;
r11240r11241
30423044
30433045memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read_or_write readorwrite)
30443046{
3045   memory_private *memdata = m_machine.memory_data;
3047   memory_private *memdata = machine().memory_data;
30463048
30473049   // adjust the addresses, handling mirrors and such
30483050   offs_t bytemirror = addrmirror;
r11240r11241
30763078      }
30773079
30783080      // allocate the bank
3079      bank = auto_alloc(m_machine, memory_bank(*this, banknum, bytestart, byteend, tag));
3081      bank = auto_alloc(machine(), memory_bank(*this, banknum, bytestart, byteend, tag));
30803082      memdata->banklist.append(*bank);
30813083
30823084      // for named banks, add to the map and register for save states
r11240r11241
41044106memory_block::~memory_block()
41054107{
41064108   if (m_allocated != NULL)
4107      auto_free(m_machine, m_allocated);
4109      auto_free(machine(), m_allocated);
41084110}
41094111
41104112
r11240r11241
41534155
41544156memory_bank::~memory_bank()
41554157{
4156   auto_free(m_machine, m_entry);
4158   auto_free(machine(), m_entry);
41574159}
41584160
41594161
r11240r11241
42674269   int newcount = entrynum + 1;
42684270
42694271   // allocate a new array and copy from the old one; zero out the new entries
4270   bank_entry *newentry = auto_alloc_array(m_machine, bank_entry, newcount);
4272   bank_entry *newentry = auto_alloc_array(machine(), bank_entry, newcount);
42714273   memcpy(newentry, m_entry, sizeof(m_entry[0]) * m_entry_count);
42724274   memset(&newentry[m_entry_count], 0, (newcount - m_entry_count) * sizeof(m_entry[0]));
42734275
42744276   // free the old array and set the updated values
4275   auto_free(m_machine, m_entry);
4277   auto_free(machine(), m_entry);
42764278   m_entry = newentry;
42774279   m_entry_count = newcount;
42784280}
src/emu/memory.h
r11240r11241
540540   address_space *         m_next;            // next address space in the global list
541541   const address_space_config &m_config;      // configuration of this space
542542   device_t &            m_device;         // reference to the owning device
543   running_machine &      m_machine;         // reference to the owning machine
544543   address_map *         m_map;            // original memory map
545544   offs_t               m_addrmask;         // physical address mask
546545   offs_t               m_bytemask;         // byte-converted physical address mask
r11240r11241
554553   const char *         m_name;            // friendly name of the address space
555554   UINT8               m_addrchars;      // number of characters to use for physical addresses
556555   UINT8               m_logaddrchars;      // number of characters to use for logical addresses
556
557private:
558   running_machine &      m_machine;         // reference to the owning machine
557559};
558560
559561
src/emu/machine/timekpr.c
r11240r11241
200200   /* validate some basic stuff */
201201   assert(this != NULL);
202202
203   m_machine.base_datetime(systime);
203   machine().base_datetime(systime);
204204
205205   m_control = 0;
206206   m_seconds = make_bcd( systime.local_time.second );
r11240r11241
211211   m_month = make_bcd( systime.local_time.month + 1 );
212212   m_year = make_bcd( systime.local_time.year % 100 );
213213   m_century = make_bcd( systime.local_time.year / 100 );
214   m_data = auto_alloc_array( m_machine, UINT8, m_size );
214   m_data = auto_alloc_array( machine(), UINT8, m_size );
215215
216216   m_default_data = *region();
217217   if (m_default_data)
src/emu/machine/x76f100.c
r11240r11241
2323      va_start(v, s_fmt);
2424      vsprintf(buf, s_fmt, v);
2525      va_end(v);
26      logerror("x76f100 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
26      logerror("x76f100 %s %s: %s", config.tag(), machine().describe_context(), buf);
2727   }
2828}
2929
src/emu/machine/k033906.c
r11240r11241
6363
6464void k033906_device::device_start()
6565{
66   m_voodoo = m_machine.device(m_config.m_voodoo_tag);
66   m_voodoo = machine().device(m_config.m_voodoo_tag);
6767
68   m_reg = auto_alloc_array(m_machine, UINT32, 256);
69   m_ram = auto_alloc_array(m_machine, UINT32, 32768);
68   m_reg = auto_alloc_array(machine(), UINT32, 256);
69   m_ram = auto_alloc_array(machine(), UINT32, 32768);
7070
7171   m_reg_set = 0;
7272
r11240r11241
9191      case 0x0f:      return m_reg[0x0f];         // interrupt_line, interrupt_pin, min_gnt, max_lat
9292
9393      default:
94         fatalerror("%s: k033906_reg_r: %08X", m_machine.describe_context(), reg);
94         fatalerror("%s: k033906_reg_r: %08X", machine().describe_context(), reg);
9595   }
9696   return 0;
9797}
r11240r11241
139139         break;
140140
141141      default:
142         fatalerror("%s:K033906_w: %08X, %08X", m_machine.describe_context(), data, reg);
142         fatalerror("%s:K033906_w: %08X, %08X", machine().describe_context(), data, reg);
143143   }
144144}
145145
src/emu/machine/6526cia.c
r11240r11241
200200   for (int t = 0; t < (sizeof(m_timer) / sizeof(m_timer[0])); t++)
201201   {
202202      cia_timer *timer = &m_timer[t];
203      timer->m_timer = m_machine.scheduler().timer_alloc(FUNC(timer_proc), (void*)this);
203      timer->m_timer = machine().scheduler().timer_alloc(FUNC(timer_proc), (void*)this);
204204      timer->m_cia = this;
205205      timer->m_irq = 0x01 << t;
206206   }
r11240r11241
208208   /* setup TOD timer, if appropriate */
209209   if (m_config.m_tod_clock != 0)
210210   {
211      m_machine.scheduler().timer_pulse(attotime::from_hz(m_config.m_tod_clock), FUNC(clock_tod_callback), 0, (void *)this);
211      machine().scheduler().timer_pulse(attotime::from_hz(m_config.m_tod_clock), FUNC(clock_tod_callback), 0, (void *)this);
212212   }
213213
214214   /* state save support */
src/emu/machine/74123.c
r11240r11241
106106
107107void ttl74123_device::device_start()
108108{
109   m_timer = m_machine.scheduler().timer_alloc(FUNC(clear_callback), (void *)this);
109   m_timer = machine().scheduler().timer_alloc(FUNC(clear_callback), (void *)this);
110110
111111   /* start with the defaults */
112112   m_a = m_config.m_a;
r11240r11241
202202{
203203   int output = timer_running();
204204
205   m_machine.scheduler().timer_set( attotime::zero, FUNC(output_callback ), output, (void *)this);
205   machine().scheduler().timer_set( attotime::zero, FUNC(output_callback ), output, (void *)this);
206206
207207   if (LOG) logerror("74123 %s:  Output: %d\n", tag(), output);
208208}
src/emu/machine/6532riot.c
r11240r11241
121121   }
122122   else
123123   {
124      logerror("%s:6532RIOT chip #%d: no irq callback function\n", m_machine.describe_context(), m_index);
124      logerror("%s:6532RIOT chip #%d: no irq callback function\n", machine().describe_context(), m_index);
125125   }
126126}
127127
r11240r11241
238238   if ((offset & 0x14) == 0x14)
239239   {
240240      static const UINT8 timershift[4] = { 0, 3, 6, 10 };
241      attotime curtime = m_machine.time();
241      attotime curtime = machine().time();
242242      INT64 target;
243243
244244      /* A0-A1 contain the timer divisor */
r11240r11241
302302         }
303303         else
304304         {
305            logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", m_machine.describe_context(), tag(), 'A' + (offset & 1), data);
305            logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", machine().describe_context(), tag(), 'A' + (offset & 1), data);
306306         }
307307      }
308308
r11240r11241
390390         }
391391         else
392392         {
393            logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", m_machine.describe_context(), tag(), 'A' + (offset & 1));
393            logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", machine().describe_context(), tag(), 'A' + (offset & 1));
394394         }
395395
396396         /* apply the DDR to the result */
r11240r11241
522522   assert(this != NULL);
523523
524524   /* set static values */
525   m_index = m_machine.m_devicelist.indexof(RIOT6532, tag());
525   m_index = machine().m_devicelist.indexof(RIOT6532, tag());
526526
527527   /* configure the ports */
528528   devcb_resolve_read8(&m_port[0].m_in_func, &m_config.m_in_a_func, this);
r11240r11241
534534   devcb_resolve_write_line(&m_irq_func, &m_config.m_irq_func, this);
535535
536536   /* allocate timers */
537   m_timer = m_machine.scheduler().timer_alloc(FUNC(timer_end_callback), (void *)this);
537   m_timer = machine().scheduler().timer_alloc(FUNC(timer_end_callback), (void *)this);
538538
539539   /* register for save states */
540540   save_item(NAME(m_port[0].m_in));
src/emu/machine/6522via.c
r11240r11241
169169   }
170170    else
171171    {
172        val = 0xffff - time_to_cycles(m_machine.time() - m_time1);
172        val = 0xffff - time_to_cycles(machine().time() - m_time1);
173173   }
174174
175175   return val;
r11240r11241
217217    m_t1lh = 0xb5; /* ports are not written by kernel! */
218218    m_t2ll = 0xff; /* taken from vice */
219219    m_t2lh = 0xff;
220    m_time2 = m_time1 = m_machine.time();
220    m_time2 = m_time1 = machine().time();
221221    m_t1 = timer_alloc(TIMER_T1);
222222    m_t2 = timer_alloc(TIMER_T2);
223223    m_shift_timer = timer_alloc(TIMER_SHIFT);
r11240r11241
225225   /* Default clock is from CPU1 */
226226   if (clock() == 0)
227227    {
228      set_unscaled_clock(m_machine.firstcpu->clock());
228      set_unscaled_clock(machine().firstcpu->clock());
229229    }
230230
231231   /* save state register */
r11240r11241
304304   m_ifr |= data;
305305   if (TRACE_VIA)
306306    {
307      logerror("%s:6522VIA chip %s: IFR = %02X\n", m_machine.describe_context(), tag(), m_ifr);
307      logerror("%s:6522VIA chip %s: IFR = %02X\n", machine().describe_context(), tag(), m_ifr);
308308    }
309309
310310   if (m_ier & m_ifr)
r11240r11241
325325
326326   if (TRACE_VIA)
327327    {
328      logerror("%s:6522VIA chip %s: IFR = %02X\n", m_machine.describe_context(), tag(), m_ifr);
328      logerror("%s:6522VIA chip %s: IFR = %02X\n", machine().describe_context(), tag(), m_ifr);
329329    }
330330
331331   if (m_ifr & m_ier)
r11240r11241
441441                  m_out_b |= 0x80;
442442              }
443443              m_t1_active = 0;
444              m_time1 = m_machine.time();
444              m_time1 = machine().time();
445445          }
446446          if (m_ddr_b)
447447         {
r11240r11241
458458      // t2 timeout
459459      case TIMER_T2:
460460          m_t2_active = 0;
461          m_time2 = m_machine.time();
461          m_time2 = machine().time();
462462
463463          if (!(m_ifr & INT_T2))
464464          {
r11240r11241
492492                }
493493            else
494494                {
495               logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", m_machine.describe_context(), tag());
495               logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", machine().describe_context(), tag());
496496                }
497497         }
498498      }
r11240r11241
522522                }
523523            else
524524                {
525               logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", m_machine.describe_context(), tag());
525               logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", machine().describe_context(), tag());
526526                }
527527         }
528528      }
r11240r11241
558558            }
559559         else
560560            {
561            logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", m_machine.describe_context(), tag());
561            logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", machine().describe_context(), tag());
562562            }
563563      }
564564
r11240r11241
605605            }
606606         else
607607            {
608            val = (0x10000 - (time_to_cycles(m_machine.time() - m_time2) & 0xffff) - 1) & 0xff;
608            val = (0x10000 - (time_to_cycles(machine().time() - m_time2) & 0xffff) - 1) & 0xff;
609609            }
610610      }
611611      break;
r11240r11241
623623            }
624624         else
625625            {
626            val = (0x10000 - (time_to_cycles(m_machine.time() - m_time2) & 0xffff) - 1) >> 8;
626            val = (0x10000 - (time_to_cycles(machine().time() - m_time2) & 0xffff) - 1) >> 8;
627627            }
628628      }
629629      break;
r11240r11241
825825      {
826826         m_t2->adjust(cycles_to_time(TIMER2_VALUE));
827827         m_t2_active = 1;
828         m_time2 = m_machine.time();
828         m_time2 = machine().time();
829829      }
830830      break;
831831
r11240r11241
848848
849849      if (TRACE_VIA)
850850        {
851         logerror("%s:6522VIA chip %s: PCR = %02X\n", m_machine.describe_context(), tag(), data);
851         logerror("%s:6522VIA chip %s: PCR = %02X\n", machine().describe_context(), tag(), data);
852852        }
853853
854854      if (CA2_FIX_OUTPUT(data) && CA2_OUTPUT_LEVEL(data) ^ m_out_ca2)
r11240r11241
942942   if (state != m_in_ca1)
943943    {
944944      if (TRACE_VIA)
945         logerror("%s:6522VIA chip %s: CA1 = %02X\n", m_machine.describe_context(), tag(), state);
945         logerror("%s:6522VIA chip %s: CA1 = %02X\n", machine().describe_context(), tag(), state);
946946
947947      if ((CA1_LOW_TO_HIGH(m_pcr) && state) || (CA1_HIGH_TO_LOW(m_pcr) && !state))
948948      {
r11240r11241
954954                }
955955            else
956956                {
957                    logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", m_machine.describe_context(), tag());
957                    logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", machine().describe_context(), tag());
958958                }
959959         }
960960
r11240r11241
10241024                }
10251025            else
10261026                {
1027                    logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", m_machine.describe_context(), tag());
1027                    logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", machine().describe_context(), tag());
10281028                }
10291029         }
10301030         if (SO_EXT_CONTROL(m_acr) || SI_EXT_CONTROL(m_acr))
src/emu/machine/ds2401.c
r11240r11241
2020      va_start(v, s_fmt);
2121      vsprintf(buf, s_fmt, v);
2222      va_end(v);
23      logerror("ds2401 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
23      logerror("ds2401 %s %s: %s", config.tag(), machine().describe_context(), buf);
2424   }
2525}
2626
src/emu/machine/6840ptm.c
r11240r11241
132132   }
133133
134134
135   m_timer[0] = m_machine.scheduler().timer_alloc(FUNC(ptm6840_timer1_cb), (void *)this);
136   m_timer[1] = m_machine.scheduler().timer_alloc(FUNC(ptm6840_timer2_cb), (void *)this);
137   m_timer[2] = m_machine.scheduler().timer_alloc(FUNC(ptm6840_timer3_cb), (void *)this);
135   m_timer[0] = machine().scheduler().timer_alloc(FUNC(ptm6840_timer1_cb), (void *)this);
136   m_timer[1] = machine().scheduler().timer_alloc(FUNC(ptm6840_timer2_cb), (void *)this);
137   m_timer[2] = machine().scheduler().timer_alloc(FUNC(ptm6840_timer3_cb), (void *)this);
138138
139139   for (int i = 0; i < 3; i++)
140140   {
r11240r11241
500500
501501      case PTM_6840_STATUS:
502502      {
503         PLOG(("%s: MC6840 #%s: Status read = %04X\n", m_machine.describe_context(), tag(), m_status_reg));
503         PLOG(("%s: MC6840 #%s: Status read = %04X\n", machine().describe_context(), tag(), m_status_reg));
504504         m_status_read_since_int |= m_status_reg & 0x07;
505505         val = m_status_reg;
506506         break;
r11240r11241
522522
523523         m_lsb_buffer = result & 0xff;
524524
525         PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", m_machine.describe_context(), tag(), idx, result >> 8));
525         PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", machine().describe_context(), tag(), idx, result >> 8));
526526         val = result >> 8;
527527         break;
528528      }
r11240r11241
633633            reload_count(idx);
634634         }
635635
636         PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", m_machine.describe_context(), tag(), idx, m_latch[idx]));
636         PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", machine().describe_context(), tag(), idx, m_latch[idx]));
637637         break;
638638      }
639639   }
src/emu/machine/z80dma.c
r11240r11241
236236   devcb_resolve_write8(&m_out_iorq_func, &m_config.m_out_iorq_func, this);
237237
238238   // allocate timer
239   m_timer = m_machine.scheduler().timer_alloc(FUNC(static_timerproc), (void *)this);
239   m_timer = machine().scheduler().timer_alloc(FUNC(static_timerproc), (void *)this);
240240
241241   // register for state saving
242242   save_item(NAME(m_regs));
r11240r11241
876876void z80dma_device::rdy_w(int state)
877877{
878878   if (LOG) logerror("Z80DMA '%s' RDY: %d Active High: %d\n", tag(), state, READY_ACTIVE_HIGH);
879   m_machine.scheduler().synchronize(FUNC(static_rdy_write_callback), state, (void *)this);
879   machine().scheduler().synchronize(FUNC(static_rdy_write_callback), state, (void *)this);
880880}
881881
882882
src/emu/machine/ins8154.c
r11240r11241
133133   {
134134      if (VERBOSE)
135135      {
136         logerror("%s: INS8154 '%s' Read from invalid offset %02x!\n", m_machine.describe_context(), tag(), offset);
136         logerror("%s: INS8154 '%s' Read from invalid offset %02x!\n", machine().describe_context(), tag(), offset);
137137      }
138138      return 0xff;
139139   }
r11240r11241
207207   {
208208      if (VERBOSE)
209209      {
210         logerror("%s: INS8154 '%s' Write %02x to invalid offset %02x!\n", m_machine.describe_context(), tag(), data, offset);
210         logerror("%s: INS8154 '%s' Write %02x to invalid offset %02x!\n", machine().describe_context(), tag(), data, offset);
211211      }
212212      return;
213213   }
r11240r11241
225225   case 0x22:
226226      if (VERBOSE)
227227      {
228         logerror("%s: INS8154 '%s' ODRA set to %02x\n", m_machine.describe_context(), tag(), data);
228         logerror("%s: INS8154 '%s' ODRA set to %02x\n", machine().describe_context(), tag(), data);
229229      }
230230
231231      m_odra = data;
r11240r11241
234234   case 0x23:
235235      if (VERBOSE)
236236      {
237         logerror("%s: INS8154 '%s' ODRB set to %02x\n", m_machine.describe_context(), tag(), data);
237         logerror("%s: INS8154 '%s' ODRB set to %02x\n", machine().describe_context(), tag(), data);
238238      }
239239
240240      m_odrb = data;
r11240r11241
243243   case 0x24:
244244      if (VERBOSE)
245245      {
246         logerror("%s: INS8154 '%s' MDR set to %02x\n", m_machine.describe_context(), tag(), data);
246         logerror("%s: INS8154 '%s' MDR set to %02x\n", machine().describe_context(), tag(), data);
247247      }
248248
249249      m_mdr = data;
src/emu/machine/ds1302.c
r11240r11241
151151         if(m_icount == 8)   //Command start
152152         {
153153            system_time systime;
154            m_machine.base_datetime(systime);
154            machine().base_datetime(systime);
155155
156156            switch(m_shift_in)
157157            {
src/emu/machine/x76f041.c
r11240r11241
2525      va_start(v, s_fmt);
2626      vsprintf(buf, s_fmt, v);
2727      va_end(v);
28      logerror("x76f041 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
28      logerror("x76f041 %s %s: %s", config.tag(), machine().describe_context(), buf);
2929   }
3030}
3131
src/emu/machine/nvram.c
r11240r11241
179179      {
180180         UINT8 *nvram = reinterpret_cast<UINT8 *>(m_base);
181181         for (int index = 0; index < m_length; index++)
182            nvram[index] = m_machine.rand();
182            nvram[index] = machine().rand();
183183         break;
184184      }
185185
r11240r11241
231231   // find our shared pointer with the target RAM
232232   if (m_base == NULL)
233233   {
234      m_base = memory_get_shared(m_machine, tag(), m_length);
234      m_base = memory_get_shared(machine(), tag(), m_length);
235235      if (m_base == NULL)
236236         throw emu_fatalerror("NVRAM device '%s' has no corresponding AM_SHARE region", tag());
237237   }
src/emu/machine/i2cmem.c
r11240r11241
182182{
183183   if( m_config.m_page_size > 0 )
184184   {
185      m_page = auto_alloc_array( m_machine, UINT8, m_config.m_page_size );
185      m_page = auto_alloc_array( machine(), UINT8, m_config.m_page_size );
186186   }
187187}
188188
r11240r11241
262262void i2cmem_device::nvram_read( emu_file &file )
263263{
264264   int i2cmem_bytes = m_config.m_data_size;
265   UINT8 *buffer = auto_alloc_array( m_machine, UINT8, i2cmem_bytes );
265   UINT8 *buffer = auto_alloc_array( machine(), UINT8, i2cmem_bytes );
266266
267267   file.read( buffer, i2cmem_bytes );
268268
r11240r11241
271271      m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
272272   }
273273
274   auto_free( m_machine, buffer );
274   auto_free( machine(), buffer );
275275}
276276
277277//-------------------------------------------------
r11240r11241
282282void i2cmem_device::nvram_write( emu_file &file )
283283{
284284   int i2cmem_bytes = m_config.m_data_size;
285   UINT8 *buffer = auto_alloc_array( m_machine, UINT8, i2cmem_bytes );
285   UINT8 *buffer = auto_alloc_array( machine(), UINT8, i2cmem_bytes );
286286
287287   for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
288288   {
r11240r11241
291291
292292   file.write( buffer, i2cmem_bytes );
293293
294   auto_free( m_machine, buffer );
294   auto_free( machine(), buffer );
295295}
296296
297297
src/emu/machine/z80sti.c
r11240r11241
244244   devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
245245
246246   // create the counter timers
247   m_timer[TIMER_A] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
248   m_timer[TIMER_B] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
249   m_timer[TIMER_C] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
250   m_timer[TIMER_D] = m_machine.scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
247   m_timer[TIMER_A] = machine().scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
248   m_timer[TIMER_B] = machine().scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
249   m_timer[TIMER_C] = machine().scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
250   m_timer[TIMER_D] = machine().scheduler().timer_alloc(FUNC(static_timer_count), (void *)this);
251251
252252   // create serial receive clock timer
253253   if (m_config.m_rx_clock > 0)
254254   {
255      m_rx_timer = m_machine.scheduler().timer_alloc(FUNC(static_rx_tick), (void *)this);
255      m_rx_timer = machine().scheduler().timer_alloc(FUNC(static_rx_tick), (void *)this);
256256      m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock));
257257   }
258258
259259   // create serial transmit clock timer
260260   if (m_config.m_tx_clock > 0)
261261   {
262      m_tx_timer = m_machine.scheduler().timer_alloc(FUNC(static_tx_tick), (void *)this);
262      m_tx_timer = machine().scheduler().timer_alloc(FUNC(static_tx_tick), (void *)this);
263263      m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock));
264264   }
265265
src/emu/machine/f3853.c
r11240r11241
134134      }
135135   }
136136
137   m_timer = m_machine.scheduler().timer_alloc(FUNC(f3853_timer_callback), (void *)this );
137   m_timer = machine().scheduler().timer_alloc(FUNC(f3853_timer_callback), (void *)this );
138138
139139   save_item(NAME(m_high) );
140140   save_item(NAME(m_low) );
src/emu/machine/k056230.c
r11240r11241
6565{
6666   if(m_config.m_cpu)
6767   {
68      m_cpu = m_machine.device(m_config.m_cpu);
68      m_cpu = machine().device(m_config.m_cpu);
6969   }
7070   else
7171   {
r11240r11241
7474
7575   m_is_thunderh = m_config.m_is_thunderh;
7676
77   m_ram = auto_alloc_array(m_machine, UINT32, 0x2000);
77   m_ram = auto_alloc_array(machine(), UINT32, 0x2000);
7878
7979   save_pointer(NAME(m_ram), 0x2000);
8080}
r11240r11241
128128               {
129129                  device_set_input_line(m_cpu, INPUT_LINE_IRQ2, ASSERT_LINE);
130130               }
131               m_machine.scheduler().timer_set(attotime::from_usec(10), FUNC(network_irq_clear_callback), 0, (void*)this);
131               machine().scheduler().timer_set(attotime::from_usec(10), FUNC(network_irq_clear_callback), 0, (void*)this);
132132            }
133133         }
134134//          else
src/emu/machine/6850acia.c
r11240r11241
116116   m_tx_clock = m_config.m_tx_clock;
117117   m_tx_counter = 0;
118118   m_rx_counter = 0;
119   m_rx_timer = m_machine.scheduler().timer_alloc(FUNC(receive_event_callback), (void *)this);
120   m_tx_timer = m_machine.scheduler().timer_alloc(FUNC(transmit_event_callback), (void *)this);
119   m_rx_timer = machine().scheduler().timer_alloc(FUNC(receive_event_callback), (void *)this);
120   m_tx_timer = machine().scheduler().timer_alloc(FUNC(transmit_event_callback), (void *)this);
121121   m_first_reset = 1;
122122   m_status_read = 0;
123123   m_brk = 0;
r11240r11241
349349   }
350350   else
351351   {
352      logerror("%s:ACIA %p: Data write while in reset!\n", m_machine.describe_context(), this);
352      logerror("%s:ACIA %p: Data write while in reset!\n", machine().describe_context(), this);
353353   }
354354}
355355
src/emu/machine/mb3773.c
r11240r11241
105105
106106void mb3773_device::device_start()
107107{
108   m_watchdog_timer = m_machine.scheduler().timer_alloc( FUNC(watchdog_timeout), this );
108   m_watchdog_timer = machine().scheduler().timer_alloc( FUNC(watchdog_timeout), this );
109109   reset_timer();
110110
111111   save_item( NAME(m_ck) );
r11240r11241
156156
157157TIMER_CALLBACK( mb3773_device::watchdog_timeout )
158158{
159   reinterpret_cast<mb3773_device *>(ptr)->m_machine.schedule_soft_reset();
159   reinterpret_cast<mb3773_device *>(ptr)->machine().schedule_soft_reset();
160160}
src/emu/machine/z80dart.c
r11240r11241
293293   if (m_config.m_rx_clock_a != 0)
294294   {
295295      // allocate channel A receive timer
296      m_rxca_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_A]);
296      m_rxca_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_A]);
297297      m_rxca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_a));
298298   }
299299
300300   if (m_config.m_tx_clock_a != 0)
301301   {
302302      // allocate channel A transmit timer
303      m_txca_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_A]);
303      m_txca_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_A]);
304304      m_txca_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_a));
305305   }
306306
307307   if (m_config.m_rx_clock_b != 0)
308308   {
309309      // allocate channel B receive timer
310      m_rxcb_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_B]);
310      m_rxcb_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_rxc_tick), (void *)&m_channel[CHANNEL_B]);
311311      m_rxcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_rx_clock_b));
312312   }
313313
314314   if (m_config.m_tx_clock_b != 0)
315315   {
316316      // allocate channel B transmit timer
317      m_txcb_timer = m_machine.scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_B]);
317      m_txcb_timer = machine().scheduler().timer_alloc(FUNC(dart_channel::static_txc_tick), (void *)&m_channel[CHANNEL_B]);
318318      m_txcb_timer->adjust(attotime::zero, 0, attotime::from_hz(m_config.m_tx_clock_b));
319319   }
320320
src/emu/machine/at28c16.c
r11240r11241
129129
130130void at28c16_device::device_start()
131131{
132   m_write_timer = m_machine.scheduler().timer_alloc( FUNC(write_finished), this );
132   m_write_timer = machine().scheduler().timer_alloc( FUNC(write_finished), this );
133133
134134   save_item( NAME(m_a9_12v) );
135135   save_item( NAME(m_oe_12v) );
r11240r11241
187187
188188void at28c16_device::nvram_read( emu_file &file )
189189{
190   UINT8 *buffer = auto_alloc_array( m_machine, UINT8, AT28C16_TOTAL_BYTES );
190   UINT8 *buffer = auto_alloc_array( machine(), UINT8, AT28C16_TOTAL_BYTES );
191191
192192   file.read( buffer, AT28C16_TOTAL_BYTES );
193193
r11240r11241
196196      m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
197197   }
198198
199   auto_free( m_machine, buffer );
199   auto_free( machine(), buffer );
200200}
201201
202202//-------------------------------------------------
r11240r11241
206206
207207void at28c16_device::nvram_write( emu_file &file )
208208{
209   UINT8 *buffer = auto_alloc_array( m_machine, UINT8, AT28C16_TOTAL_BYTES );
209   UINT8 *buffer = auto_alloc_array( machine(), UINT8, AT28C16_TOTAL_BYTES );
210210
211211   for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
212212   {
r11240r11241
215215
216216   file.write( buffer, AT28C16_TOTAL_BYTES );
217217
218   auto_free( m_machine, buffer );
218   auto_free( machine(), buffer );
219219}
220220
221221
src/emu/machine/8237dma.c
r11240r11241
124124      devcb_resolve_write_line(&m_chan[i].m_out_dack_func, &m_config.m_out_dack_func[i], this);
125125   }
126126
127   m_timer = m_machine.scheduler().timer_alloc(FUNC(i8237_timerproc_callback), (void *)this);
127   m_timer = machine().scheduler().timer_alloc(FUNC(i8237_timerproc_callback), (void *)this);
128128}
129129
130130
src/emu/machine/eeprom.c
r11240r11241
302302   UINT32 eeprom_length = 1 << m_config.m_address_bits;
303303   UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
304304
305   UINT8 *buffer = auto_alloc_array(m_machine, UINT8, eeprom_bytes);
305   UINT8 *buffer = auto_alloc_array(machine(), UINT8, eeprom_bytes);
306306   file.read(buffer, eeprom_bytes);
307307   for (offs_t offs = 0; offs < eeprom_bytes; offs++)
308308      m_addrspace[0]->write_byte(offs, buffer[offs]);
309   auto_free(m_machine, buffer);
309   auto_free(machine(), buffer);
310310}
311311
312312
r11240r11241
320320   UINT32 eeprom_length = 1 << m_config.m_address_bits;
321321   UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
322322
323   UINT8 *buffer = auto_alloc_array(m_machine, UINT8, eeprom_bytes);
323   UINT8 *buffer = auto_alloc_array(machine(), UINT8, eeprom_bytes);
324324   for (offs_t offs = 0; offs < eeprom_bytes; offs++)
325325      buffer[offs] = m_addrspace[0]->read_byte(offs);
326326   file.write(buffer, eeprom_bytes);
327   auto_free(m_machine, buffer);
327   auto_free(machine(), buffer);
328328}
329329
330330
src/emu/machine/z80sio.c
r11240r11241
561561   int regnum = m_regs[0] & 7;
562562
563563   if (regnum != 0 || (regnum & 0xf8) != 0)
564      VPRINTF(("%s:sio_reg_w(%c,%d) = %02X\n", m_device->m_machine.describe_context(), 'A' + m_index, regnum, data));
564      VPRINTF(("%s:sio_reg_w(%c,%d) = %02X\n", m_device->machine().describe_context(), 'A' + m_index, regnum, data));
565565
566566   // write a new value to the selected register
567567   UINT8 old = m_regs[regnum];
r11240r11241
579579         switch (data & SIO_WR0_COMMAND_MASK)
580580         {
581581            case SIO_WR0_COMMAND_CH_RESET:
582               VPRINTF(("%s:SIO reset channel %c\n", m_device->m_machine.describe_context(), 'A' + m_index));
582               VPRINTF(("%s:SIO reset channel %c\n", m_device->machine().describe_context(), 'A' + m_index));
583583               reset();
584584               break;
585585
r11240r11241
640640         break;
641641   }
642642
643   VPRINTF(("%s:sio_reg_r(%c,%d) = %02x\n", m_device->m_machine.describe_context(), 'A' + m_index, regnum, m_status[regnum]));
643   VPRINTF(("%s:sio_reg_r(%c,%d) = %02x\n", m_device->machine().describe_context(), 'A' + m_index, regnum, m_status[regnum]));
644644
645645   return m_status[regnum];
646646}
r11240r11241
652652
653653void z80sio_device::sio_channel::data_write(UINT8 data)
654654{
655   VPRINTF(("%s:sio_data_w(%c) = %02X\n", m_device->m_machine.describe_context(), 'A' + m_index, data));
655   VPRINTF(("%s:sio_data_w(%c) = %02X\n", m_device->machine().describe_context(), 'A' + m_index, data));
656656
657657   // if tx not enabled, just ignore it
658658   if (!(m_regs[5] & SIO_WR5_TX_ENABLE))
r11240r11241
681681   // reset the receive interrupt
682682   clear_interrupt(INT_RECEIVE);
683683
684   VPRINTF(("%s:sio_data_r(%c) = %02X\n", m_device->m_machine.describe_context(), 'A' + m_index, m_inbuf));
684   VPRINTF(("%s:sio_data_r(%c) = %02X\n", m_device->machine().describe_context(), 'A' + m_index, m_inbuf));
685685
686686   return m_inbuf;
687687}
src/emu/machine/ds2404.c
r11240r11241
129129   m_rtc[3] = (current_time >> 16) & 0xff;
130130   m_rtc[4] = (current_time >> 24) & 0xff;
131131
132   emu_timer *timer = m_machine.scheduler().timer_alloc(FUNC(ds2404_tick_callback), (void *)this);
132   emu_timer *timer = machine().scheduler().timer_alloc(FUNC(ds2404_tick_callback), (void *)this);
133133   timer->adjust(attotime::from_hz(256), 0, attotime::from_hz(256));
134134}
135135
src/emu/machine/mc146818.c
r11240r11241
183183
184184void mc146818_device::device_start()
185185{
186   m_last_refresh = m_machine.time();
186   m_last_refresh = machine().time();
187187   emu_timer *timer = timer_alloc();
188188   if (m_config.m_type == mc146818_device_config::MC146818_UTC) {
189189      // hack: for apollo we increase the update frequency to stay in sync with real time
r11240r11241
327327   }
328328
329329   m_updated = true;  /* clock has been updated */
330   m_last_refresh = m_machine.time();
330   m_last_refresh = machine().time();
331331}
332332
333333
r11240r11241
387387   system_time systime;
388388   system_time::full_time current_time;
389389
390   m_machine.base_datetime(systime);
390   machine().base_datetime(systime);
391391
392392   current_time = m_config.m_type == mc146818_device_config::MC146818_UTC ? systime.utc_time: systime.local_time;
393393
src/emu/screen.c
r11240r11241
347347
348348screen_device::~screen_device()
349349{
350   m_machine.render().texture_free(m_texture[0]);
351   m_machine.render().texture_free(m_texture[1]);
350   machine().render().texture_free(m_texture[0]);
351   machine().render().texture_free(m_texture[1]);
352352   if (m_burnin != NULL)
353353      finalize_burnin();
354354   global_free(m_screen_overlay_bitmap);
r11240r11241
371371   m_container->set_user_settings(settings);
372372
373373   // allocate the VBLANK timers
374   m_vblank_begin_timer = m_machine.scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this);
375   m_vblank_end_timer = m_machine.scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this);
374   m_vblank_begin_timer = machine().scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this);
375   m_vblank_end_timer = machine().scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this);
376376
377377   // allocate a timer to reset partial updates
378   m_scanline0_timer = m_machine.scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
378   m_scanline0_timer = machine().scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
379379
380380   // allocate a timer to generate per-scanline updates
381   if ((m_machine.config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
382      m_scanline_timer = m_machine.scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
381   if ((machine().config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
382      m_scanline_timer = machine().scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
383383
384384   // configure the screen with the default parameters
385385   configure(m_config.m_width, m_config.m_height, m_config.m_visarea, m_config.m_refresh);
r11240r11241
389389   m_vblank_end_time = attotime(0, m_vblank_period);
390390
391391   // start the timer to generate per-scanline updates
392   if ((m_machine.config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
392   if ((machine().config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
393393      m_scanline_timer->adjust(time_until_pos(0));
394394
395395   // create burn-in bitmap
396   if (m_machine.options().burnin())
396   if (machine().options().burnin())
397397   {
398398      int width, height;
399      if (sscanf(m_machine.options().snap_size(), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
399      if (sscanf(machine().options().snap_size(), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
400400         width = height = 300;
401      m_burnin = auto_alloc(m_machine, bitmap_t(width, height, BITMAP_FORMAT_INDEXED64));
401      m_burnin = auto_alloc(machine(), bitmap_t(width, height, BITMAP_FORMAT_INDEXED64));
402402      if (m_burnin == NULL)
403403         fatalerror("Error allocating burn-in bitmap for screen at (%dx%d)\n", width, height);
404404      bitmap_fill(m_burnin, NULL, 0);
405405   }
406406
407407   // load the effect overlay
408   const char *overname = m_machine.options().effect();
408   const char *overname = machine().options().effect();
409409   if (overname != NULL && strcmp(overname, "none") != 0)
410410      load_effect_overlay(overname);
411411
r11240r11241
484484   m_vblank_begin_timer->adjust(time_until_vblank_start());
485485
486486   // adjust speed if necessary
487   m_machine.video().update_refresh_speed();
487   machine().video().update_refresh_speed();
488488}
489489
490490
r11240r11241
496496void screen_device::reset_origin(int beamy, int beamx)
497497{
498498   // compute the effective VBLANK start/end times
499   attotime curtime = m_machine.time();
499   attotime curtime = machine().time();
500500   m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime);
501501   m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period);
502502
r11240r11241
539539   if (m_width > curwidth || m_height > curheight)
540540   {
541541      // free what we have currently
542      m_machine.render().texture_free(m_texture[0]);
543      m_machine.render().texture_free(m_texture[1]);
544      auto_free(m_machine, m_bitmap[0]);
545      auto_free(m_machine, m_bitmap[1]);
542      machine().render().texture_free(m_texture[0]);
543      machine().render().texture_free(m_texture[1]);
544      auto_free(machine(), m_bitmap[0]);
545      auto_free(machine(), m_bitmap[1]);
546546
547547      // compute new width/height
548548      curwidth = MAX(m_width, curwidth);
r11240r11241
552552      palette_t *palette = NULL;
553553      switch (m_config.m_format)
554554      {
555         case BITMAP_FORMAT_INDEXED16:   m_texture_format = TEXFORMAT_PALETTE16;   palette = m_machine.palette;   break;
555         case BITMAP_FORMAT_INDEXED16:   m_texture_format = TEXFORMAT_PALETTE16;   palette = machine().palette;   break;
556556         case BITMAP_FORMAT_RGB15:      m_texture_format = TEXFORMAT_RGB15;      palette = NULL;            break;
557557         case BITMAP_FORMAT_RGB32:      m_texture_format = TEXFORMAT_RGB32;      palette = NULL;            break;
558558         default:                  fatalerror("Invalid bitmap format!");                                    break;
559559      }
560560
561561      // allocate bitmaps
562      m_bitmap[0] = auto_alloc(m_machine, bitmap_t(curwidth, curheight, m_config.m_format));
563      bitmap_set_palette(m_bitmap[0], m_machine.palette);
564      m_bitmap[1] = auto_alloc(m_machine, bitmap_t(curwidth, curheight, m_config.m_format));
565      bitmap_set_palette(m_bitmap[1], m_machine.palette);
562      m_bitmap[0] = auto_alloc(machine(), bitmap_t(curwidth, curheight, m_config.m_format));
563      bitmap_set_palette(m_bitmap[0], machine().palette);
564      m_bitmap[1] = auto_alloc(machine(), bitmap_t(curwidth, curheight, m_config.m_format));
565      bitmap_set_palette(m_bitmap[1], machine().palette);
566566
567567      // allocate textures
568      m_texture[0] = m_machine.render().texture_alloc();
568      m_texture[0] = machine().render().texture_alloc();
569569      m_texture[0]->set_bitmap(m_bitmap[0], &m_visarea, m_texture_format, palette);
570      m_texture[1] = m_machine.render().texture_alloc();
570      m_texture[1] = machine().render().texture_alloc();
571571      m_texture[1]->set_bitmap(m_bitmap[1], &m_visarea, m_texture_format, palette);
572572   }
573573}
r11240r11241
609609   LOG_PARTIAL_UPDATES(("Partial: update_partial(%s, %d): ", tag(), scanline));
610610
611611   // these two checks only apply if we're allowed to skip frames
612   if (!(m_machine.config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
612   if (!(machine().config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
613613   {
614614      // if skipping this frame, bail
615      if (m_machine.video().skip_this_frame())
615      if (machine().video().skip_this_frame())
616616      {
617617         LOG_PARTIAL_UPDATES(("skipped due to frameskipping\n"));
618618         return FALSE;
619619      }
620620
621621      // skip if this screen is not visible anywhere
622      if (!m_machine.render().is_live(*this))
622      if (!machine().render().is_live(*this))
623623      {
624624         LOG_PARTIAL_UPDATES(("skipped because screen not live\n"));
625625         return FALSE;
r11240r11241
696696
697697int screen_device::vpos() const
698698{
699   attoseconds_t delta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
699   attoseconds_t delta = (machine().time() - m_vblank_start_time).as_attoseconds();
700700   int vpos;
701701
702702   // round to the nearest pixel
r11240r11241
717717
718718int screen_device::hpos() const
719719{
720   attoseconds_t delta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
720   attoseconds_t delta = (machine().time() - m_vblank_start_time).as_attoseconds();
721721
722722   // round to the nearest pixel
723723   delta += m_pixeltime / 2;
r11240r11241
753753   attoseconds_t targetdelta = (attoseconds_t)vpos * m_scantime + (attoseconds_t)hpos * m_pixeltime;
754754
755755   // if we're past that time (within 1/2 of a pixel), head to the next frame
756   attoseconds_t curdelta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
756   attoseconds_t curdelta = (machine().time() - m_vblank_start_time).as_attoseconds();
757757   if (targetdelta <= curdelta + m_pixeltime / 2)
758758      targetdelta += m_frame_period;
759759   while (targetdelta <= curdelta)
r11240r11241
777777   attotime target_time = m_vblank_end_time;
778778   if (!vblank())
779779      target_time += attotime(0, m_frame_period);
780   return target_time - m_machine.time();
780   return target_time - machine().time();
781781}
782782
783783
r11240r11241
800800   // if not found, register
801801   if (*itemptr == NULL)
802802   {
803      *itemptr = auto_alloc(m_machine, callback_item);
803      *itemptr = auto_alloc(machine(), callback_item);
804804      (*itemptr)->m_next = NULL;
805805      (*itemptr)->m_callback = vblank_callback;
806806      (*itemptr)->m_param = param;
r11240r11241
816816void screen_device::vblank_begin_callback()
817817{
818818   // reset the starting VBLANK time
819   m_vblank_start_time = m_machine.time();
819   m_vblank_start_time = machine().time();
820820   m_vblank_end_time = m_vblank_start_time + attotime(0, m_vblank_period);
821821
822822   // call the screen specific callbacks
r11240r11241
824824      (*item->m_callback)(*this, item->m_param, true);
825825
826826   // if this is the primary screen and we need to update now
827   if (this == m_machine.primary_screen && !(m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
828      m_machine.video().frame_update();
827   if (this == machine().primary_screen && !(machine().config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
828      machine().video().frame_update();
829829
830830   // reset the VBLANK start timer for the next frame
831831   m_vblank_begin_timer->adjust(time_until_vblank_start());
r11240r11241
850850      (*item->m_callback)(*this, item->m_param, false);
851851
852852   // if this is the primary screen and we need to update now
853   if (this == m_machine.primary_screen && (m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
854      m_machine.video().frame_update();
853   if (this == machine().primary_screen && (machine().config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
854      machine().video().frame_update();
855855
856856   // increment the frame number counter
857857   m_frame_number++;
r11240r11241
899899bool screen_device::update_quads()
900900{
901901   // only update if live
902   if (m_machine.render().is_live(*this))
902   if (machine().render().is_live(*this))
903903   {
904904      // only update if empty and not a vector game; otherwise assume the driver did it directly
905      if (m_config.m_type != SCREEN_TYPE_VECTOR && (m_machine.config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
905      if (m_config.m_type != SCREEN_TYPE_VECTOR && (machine().config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
906906      {
907907         // if we're not skipping the frame and if the screen actually changed, then update the texture
908         if (!m_machine.video().skip_this_frame() && m_changed)
908         if (!machine().video().skip_this_frame() && m_changed)
909909         {
910910            rectangle fixedvis = m_visarea;
911911            fixedvis.max_x++;
912912            fixedvis.max_y++;
913913
914            palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? m_machine.palette : NULL;
914            palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? machine().palette : NULL;
915915            m_texture[m_curbitmap]->set_bitmap(m_bitmap[m_curbitmap], &fixedvis, m_texture_format, palette);
916916
917917            m_curtexture = m_curbitmap;
r11240r11241
965965      if (srcbitmap->format == BITMAP_FORMAT_INDEXED16)
966966      {
967967         const UINT16 *src = BITMAP_ADDR16(srcbitmap, srcy >> 16, 0);
968         const rgb_t *palette = palette_entry_list_adjusted(m_machine.palette);
968         const rgb_t *palette = palette_entry_list_adjusted(machine().palette);
969969         for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
970970         {
971971            rgb_t pixel = palette[src[srcx >> 16]];
r11240r11241
10151015   scaledvis.max_y = m_visarea.max_y * m_burnin->height / m_height;
10161016
10171017   // wrap a bitmap around the subregion we care about
1018   bitmap_t *finalmap = auto_alloc(m_machine, bitmap_t(scaledvis.max_x + 1 - scaledvis.min_x,
1018   bitmap_t *finalmap = auto_alloc(machine(), bitmap_t(scaledvis.max_x + 1 - scaledvis.min_x,
10191019                                    scaledvis.max_y + 1 - scaledvis.min_y,
10201020                                    BITMAP_FORMAT_ARGB32));
10211021
r11240r11241
10571057   // write the final PNG
10581058
10591059   // compute the name and create the file
1060   emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
1061   file_error filerr = file.open(m_machine.basename(), PATH_SEPARATOR "burnin-", tag(), ".png") ;
1060   emu_file file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
1061   file_error filerr = file.open(machine().basename(), PATH_SEPARATOR "burnin-", tag(), ".png") ;
10621062   if (filerr == FILERR_NONE)
10631063   {
10641064      png_info pnginfo = { 0 };
r11240r11241
10681068      // add two text entries describing the image
10691069      sprintf(text, APPNAME " %s", build_version);
10701070      png_add_text(&pnginfo, "Software", text);
1071      sprintf(text, "%s %s", m_machine.system().manufacturer, m_machine.system().description);
1071      sprintf(text, "%s %s", machine().system().manufacturer, machine().system().description);
10721072      png_add_text(&pnginfo, "System", text);
10731073
10741074      // now do the actual work
r11240r11241
10941094   fullname.cat(".png");
10951095
10961096   // load the file
1097   emu_file file(m_machine.options().art_path(), OPEN_FLAG_READ);
1097   emu_file file(machine().options().art_path(), OPEN_FLAG_READ);
10981098   m_screen_overlay_bitmap = render_load_png(file, NULL, fullname, NULL, NULL);
10991099   if (m_screen_overlay_bitmap != NULL)
11001100      m_container->set_overlay(m_screen_overlay_bitmap);
r11240r11241
11121112   if (m_config.m_screen_update != NULL) {
11131113      return (*m_config.m_screen_update)(this, &bitmap, &cliprect);
11141114   } else {
1115      m_machine.driver_data<driver_device>()->screen_update(*this, bitmap, cliprect);
1115      machine().driver_data<driver_device>()->screen_update(*this, bitmap, cliprect);
11161116   }
11171117   return 0;
11181118}
r11240r11241
11251125void screen_device::screen_eof()
11261126{
11271127   if (m_config.m_screen_eof != NULL) {
1128      return (*m_config.m_screen_eof)(this, m_machine);
1128      return (*m_config.m_screen_eof)(this, machine());
11291129   } else {
1130      m_machine.driver_data<driver_device>()->screen_eof();
1130      machine().driver_data<driver_device>()->screen_eof();
11311131   }
11321132}
11331133
src/emu/screen.h
r11240r11241
175175   // beam positioning and state
176176   int vpos() const;
177177   int hpos() const;
178   bool vblank() const { return (m_machine.time() < m_vblank_end_time); }
178   bool vblank() const { return (machine().time() < m_vblank_end_time); }
179179   bool hblank() const { int curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x); }
180180
181181   // timing
182182   attotime time_until_pos(int vpos, int hpos = 0) const;
183183   attotime time_until_vblank_start() const { return time_until_pos(m_visarea.max_y + 1); }
184184   attotime time_until_vblank_end() const;
185   attotime time_until_update() const { return (m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
185   attotime time_until_update() const { return (machine().config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
186186   attotime scan_period() const { return attotime(0, m_scantime); }
187187   attotime frame_period() const { return (this == NULL || !started()) ? DEFAULT_FRAME_PERIOD : attotime(0, m_frame_period); };
188188   UINT64 frame_number() const { return m_frame_number; }
r11240r11241
194194
195195   // additional helpers
196196   void register_vblank_callback(vblank_state_changed_func vblank_callback, void *param);
197   bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(m_machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
197   bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine(), (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
198198
199199   // internal to the video system
200200   bool update_quads();
src/emu/sound.c
r11240r11241
849849void sound_manager::set_attenuation(int attenuation)
850850{
851851   m_attenuation = attenuation;
852   m_machine.osd().set_mastervolume(m_muted ? -32 : m_attenuation);
852   machine().osd().set_mastervolume(m_muted ? -32 : m_attenuation);
853853}
854854
855855
r11240r11241
862862bool sound_manager::indexed_speaker_input(int index, speaker_input &info) const
863863{
864864   // scan through the speakers until we find the indexed input
865   for (info.speaker = downcast<speaker_device *>(m_machine.m_devicelist.first(SPEAKER)); info.speaker != NULL; info.speaker = info.speaker->next_speaker())
865   for (info.speaker = downcast<speaker_device *>(machine().m_devicelist.first(SPEAKER)); info.speaker != NULL; info.speaker = info.speaker->next_speaker())
866866   {
867867      if (index < info.speaker->inputs())
868868      {
r11240r11241
10031003
10041004   // force all the speaker streams to generate the proper number of samples
10051005   int samples_this_update = 0;
1006   for (speaker_device *speaker = downcast<speaker_device *>(m_machine.m_devicelist.first(SPEAKER)); speaker != NULL; speaker = speaker->next_speaker())
1006   for (speaker_device *speaker = downcast<speaker_device *>(machine().m_devicelist.first(SPEAKER)); speaker != NULL; speaker = speaker->next_speaker())
10071007      speaker->mix(m_leftmix, m_rightmix, samples_this_update, (m_muted & MUTE_REASON_SYSTEM));
10081008
10091009   // now downmix the final result
1010   UINT32 finalmix_step = m_machine.video().speed_factor();
1010   UINT32 finalmix_step = machine().video().speed_factor();
10111011   UINT32 finalmix_offset = 0;
10121012   INT16 *finalmix = m_finalmix;
10131013   int sample;
r11240r11241
10371037   if (finalmix_offset > 0)
10381038   {
10391039      if (!m_nosound_mode)
1040         m_machine.osd().update_audio_stream(finalmix, finalmix_offset / 2);
1041      m_machine.video().add_sound_to_recording(finalmix, finalmix_offset / 2);
1040         machine().osd().update_audio_stream(finalmix, finalmix_offset / 2);
1041      machine().video().add_sound_to_recording(finalmix, finalmix_offset / 2);
10421042      if (m_wavfile != NULL)
10431043         wav_add_data_16(m_wavfile, finalmix, finalmix_offset);
10441044   }
10451045
10461046   // see if we ticked over to the next second
1047   attotime curtime = m_machine.time();
1047   attotime curtime = machine().time();
10481048   bool second_tick = false;
10491049   if (curtime.seconds != m_last_update.seconds)
10501050   {
src/emu/sound.h
r11240r11241
220220   ~sound_manager();
221221
222222   // getters
223   running_machine &machine() const { return m_machine; }
223224   int attenuation() const { return m_attenuation; }
224225   sound_stream *first_stream() const { return m_stream_list.first(); }
225226   attotime last_update() const { return m_last_update; }
src/emu/input.c
r11240r11241
7878
7979
8080/* a single input device */
81struct _input_device
81class input_device
8282{
83   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
83public:
84   input_device(running_machine &machine)
85      : m_machine(machine) { }
8486
85   running_machine *      m_machine;            /* machine we are attached to */
87   running_machine &machine() const { return m_machine; }
88
8689   astring               name;               /* string name of device */
8790   input_device_class      devclass;            /* class of this device */
8891   int                  devindex;            /* device index of this device */
r11240r11241
9396   /* joystick information */
9497   joystick_map         joymap;               /* joystick map for this device */
9598   UINT8               lastmap;            /* last joystick map value for this device */
99
100private:
101   running_machine &      m_machine;            /* machine we are attached to */
96102};
97103
98104
r11240r11241
759765   assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
760766
761767   /* allocate a new device */
762   input_device *device = auto_alloc_clear(machine, input_device);
768   input_device *device = auto_alloc_clear(machine, input_device(machine));
763769   input_device **newlist = auto_alloc_array(machine, input_device *, devlist->count + 1);
764770   for (int devnum = 0; devnum < devlist->count; devnum++)
765771      newlist[devnum] = devlist->list[devnum];
r11240r11241
768774   devlist->list[devlist->count++] = device;
769775
770776   /* fill in the data */
771   device->m_machine = &machine;
772777   device->name.cpy(name);
773778   device->devclass = devclass;
774779   device->devindex = devlist->count - 1;
src/emu/drawgfx.c
r11240r11241
227227   gfx_element *gfx;
228228
229229   /* allocate memory for the gfx_element structure */
230   gfx = auto_alloc_clear(machine, gfx_element);
230   gfx = auto_alloc_clear(machine, gfx_element(machine));
231231
232232   /* fill in the data */
233233   gfx->width = width;
r11240r11241
243243   gfx->total_colors = total_colors;
244244
245245   gfx->srcdata = srcdata;
246   gfx->m_machine = &machine;
247246
248247   /* copy the layout */
249248   gfx->layout = *gl;
r11240r11241
379378   gfx->srcdata = base;
380379   gfx->dirty = &not_dirty;
381380   gfx->dirtyseq = 0;
382
383   gfx->m_machine = &machine;
384381}
385382
386383
src/emu/input.h
r11240r11241
559559typedef INT32 (*item_get_state_func)(void *device_internal, void *item_internal);
560560
561561/* (opaque) input device object */
562typedef struct _input_device input_device;
562class input_device;
563563
564564
565565
src/emu/drawgfx.h
r11240r11241
120120class gfx_element
121121{
122122public:
123   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
123   gfx_element(running_machine &machine)
124      : m_machine(machine) { }
124125
126   running_machine &machine() const { return m_machine; }
127
125128   UINT16         width;            /* current pixel width of each element (changeble with source clipping) */
126129   UINT16         height;            /* current pixel height of each element (changeble with source clipping) */
127130   UINT16         startx;            /* current source clip X offset */
r11240r11241
146149   UINT8 *         dirty;            /* dirty array for detecting tiles that need decoding */
147150   UINT32         dirtyseq;         /* sequence number; incremented each time a tile is dirtied */
148151
149   running_machine *m_machine;         /* pointer to the owning machine */
150152   gfx_layout      layout;            /* copy of the original layout */
153
154private:
155   running_machine &m_machine;         /* pointer to the owning machine */
151156};
152157
153158
src/emu/timer.c
r11240r11241
280280{
281281   // fetch the screen
282282   if (m_config.m_screen != NULL)
283      m_screen = downcast<screen_device *>(m_machine.device(m_config.m_screen));
283      m_screen = downcast<screen_device *>(machine().device(m_config.m_screen));
284284
285285   // allocate the timer
286286   m_timer = timer_alloc();
src/emu/debugint/debugint.c
r11240r11241
186186   ~DView()
187187   {
188188      this->target->debug_free(*this->container);
189      m_machine->debug_view().free_view(*this->view);
189      machine().debug_view().free_view(*this->view);
190190   }
191191
192192   running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
src/mess/devices/kermit.c
r11240r11241
8383
8484typedef struct {
8585
86   UINT8   m_pin[1024];     /* packet received */
87   UINT8   m_pout[1024];    /* packet sent */
88   UINT32  m_seq;           /* sequence number, starting at 0 */
89   UINT16  m_posin;         /* position in pin */
90   UINT16  m_posout;        /* position in pout */
91   UINT16  m_nbout;         /* size of pout */
86   UINT8   pin[1024];     /* packet received */
87   UINT8   pout[1024];    /* packet sent */
88   UINT32  seq;           /* sequence number, starting at 0 */
89   UINT16  posin;         /* position in pin */
90   UINT16  posout;        /* position in pout */
91   UINT16  nbout;         /* size of pout */
9292
93   UINT8   m_state;         /* current protocol state */
94   UINT8   m_retries;       /* packet retries remaining */
93   UINT8   state;         /* current protocol state */
94   UINT8   retries;       /* packet retries remaining */
9595
9696   /* (relevant) configuration information, sent in S and D packet */
97   UINT8   m_maxl; /* max packet length (value of <len>) */
98   UINT8   m_npad; /* number of padding characters before packet */
99   UINT8   m_padc; /* padding character */
100   UINT8   m_eol;  /* character to add after packet */
101   UINT8   m_qctl; /* escape character */
97   UINT8   maxl; /* max packet length (value of <len>) */
98   UINT8   npad; /* number of padding characters before packet */
99   UINT8   padc; /* padding character */
100   UINT8   eol;  /* character to add after packet */
101   UINT8   qctl; /* escape character */
102102
103   emu_timer* m_resend;           /* auto-resend packet */
103   emu_timer* resend;           /* auto-resend packet */
104104
105   device_image_interface* m_image;  /* underlying image */
105   device_image_interface* image;  /* underlying image */
106106
107   running_machine *m_machine;
108   kermit_config* m_conf;
107   running_machine *machine;
108   kermit_config* conf;
109109
110110} kermit;
111111
r11240r11241
165165{
166166   int i;
167167
168   for (i=1;i<state->m_nbout;i++)
169      if (kermit_is_ctl(state->m_pout[i]))
170         logerror( "send: not char %i at pos %i\n", state->m_pout[i], i  );
168   for (i=1;i<state->nbout;i++)
169      if (kermit_is_ctl(state->pout[i]))
170         logerror( "send: not char %i at pos %i\n", state->pout[i], i  );
171171
172   if ( state->m_nbout <= 0 ) return;
172   if ( state->nbout <= 0 ) return;
173173
174174   /* prepend padding and append eol */
175   if ( state->m_npad > 0 )
175   if ( state->npad > 0 )
176176   {
177      memmove( state->m_pout + state->m_npad, state->m_pout, state->m_nbout );
178      memset( state->m_pout, state->m_padc, state->m_npad );
179      state->m_nbout += state->m_npad;
177      memmove( state->pout + state->npad, state->pout, state->nbout );
178      memset( state->pout, state->padc, state->npad );
179      state->nbout += state->npad;
180180   }
181   state->m_pout[ state->m_nbout ] = state->m_eol;
182   state->m_nbout++;
181   state->pout[ state->nbout ] = state->eol;
182   state->nbout++;
183183
184   if ( state->m_conf && state->m_conf->send )
184   if ( state->conf && state->conf->send )
185185   {
186      state->m_conf->send( *state->m_machine, state->m_pout[ 0 ] );
186      state->conf->send( *state->machine, state->pout[ 0 ] );
187187   }
188   state->m_posout = 1;
188   state->posout = 1;
189189
190   state->m_retries = KERMIT_MAX_RETRIES;
191   state->m_resend->adjust( KERMIT_RETRY_DELAY, 0, KERMIT_RETRY_DELAY );
190   state->retries = KERMIT_MAX_RETRIES;
191   state->resend->adjust( KERMIT_RETRY_DELAY, 0, KERMIT_RETRY_DELAY );
192192}
193193
194194static void kermit_reset( kermit* state );
195195
196196static void kermit_resend( kermit* state )
197197{
198   if ( state->m_conf && state->m_conf->send )
198   if ( state->conf && state->conf->send )
199199   {
200200      /* retry */
201      if ( state->m_nbout == 0 ) return;
202      if ( state->m_retries <= 0 )
201      if ( state->nbout == 0 ) return;
202      if ( state->retries <= 0 )
203203      {
204204         kermit_reset( state );
205205         return;
206206      }
207207
208      state->m_conf->send( *state->m_machine, state->m_pout[ 0 ] );
208      state->conf->send( *state->machine, state->pout[ 0 ] );
209209
210      state->m_posout = 1;
211      state->m_retries--;
212      LOG(( "kermit: resend packet (%i tries left)\n", state->m_retries ));
210      state->posout = 1;
211      state->retries--;
212      LOG(( "kermit: resend packet (%i tries left)\n", state->retries ));
213213   }
214214}
215215
r11240r11241
217217static TIMER_CALLBACK( kermit_resend_cb )
218218{
219219   kermit* state = (kermit*) ptr;
220   if ( state->m_posout >= state->m_nbout)
220   if ( state->posout >= state->nbout)
221221   {
222222      kermit_resend( state );
223223   }
r11240r11241
228228{
229229   int len;
230230   LOG(( "kermit: send data packet\n" ));
231   for ( len = 2; len < state->m_maxl-2; len++ )
231   for ( len = 2; len < state->maxl-2; len++ )
232232   {
233233      UINT8 c;
234      if ( state->m_image->image_feof() ) break;
235      c = state->m_image->fgetc();
234      if ( state->image->image_feof() ) break;
235      c = state->image->fgetc();
236236      if ( kermit_is_ctl( c ) )
237237      {
238238         /* escape control char */
239         state->m_pout[ 2 + len ] = state->m_qctl;
239         state->pout[ 2 + len ] = state->qctl;
240240         len++;
241         state->m_pout[ 2 + len ] = kermit_ctl( c );
241         state->pout[ 2 + len ] = kermit_ctl( c );
242242      }
243      else if ( (c & 0x7f) == state->m_qctl )
243      else if ( (c & 0x7f) == state->qctl )
244244      {
245245         /* escape escape char */
246         state->m_pout[ 2 + len ] = state->m_qctl;
246         state->pout[ 2 + len ] = state->qctl;
247247         len++;
248         state->m_pout[ 2 + len ] = c;
248         state->pout[ 2 + len ] = c;
249249      }
250250      else
251251      {
252         state->m_pout[ 2 + len ] = c;
252         state->pout[ 2 + len ] = c;
253253      }
254254   }
255   state->m_pout[ 0 ] = KERMIT_SOH;
256   state->m_pout[ 1 ] = kermit_tochar( len + 1 );
257   state->m_pout[ 2 ] = kermit_tochar( state->m_seq & 63 );
258   state->m_pout[ 3 ] = KERMIT_DATA;
259   state->m_pout[ 2 + len ] = kermit_checksum( state->m_pout );
260   state->m_nbout = len + 3;
255   state->pout[ 0 ] = KERMIT_SOH;
256   state->pout[ 1 ] = kermit_tochar( len + 1 );
257   state->pout[ 2 ] = kermit_tochar( state->seq & 63 );
258   state->pout[ 3 ] = KERMIT_DATA;
259   state->pout[ 2 + len ] = kermit_checksum( state->pout );
260   state->nbout = len + 3;
261261   kermit_start_sending( state );
262262}
263263
264264/* write data from packet to the image */
265265static void kermit_write_data_packet( kermit* state )
266266{
267   int i, len = kermit_unchar( state->m_pin[1] );
267   int i, len = kermit_unchar( state->pin[1] );
268268   LOG(( "kermit: received data pack, len=%i\n", len ));
269269   for ( i = 4; i <= len; i++ )
270270   {
271      UINT8 c = state->m_pin[i];
272      if ( (c /*& 0x7f*/) == state->m_qctl )
271      UINT8 c = state->pin[i];
272      if ( (c /*& 0x7f*/) == state->qctl )
273273      {
274274         /* unescape */
275275         i++;
276         c = state->m_pin[i];
276         c = state->pin[i];
277277         if ( kermit_is_ctl( kermit_ctl( c ) ) )
278278         {
279279            c = kermit_ctl( c );
280280         }
281281      }
282      state->m_image->fwrite(&c, 1 );
282      state->image->fwrite(&c, 1 );
283283   }
284284}
285285
r11240r11241
287287static int kermit_validate_packet( kermit* state )
288288{
289289   int len;
290   if ( state->m_pin[ 0 ] != KERMIT_SOH ) return -1;
291   if ( !kermit_is_char( state->m_pin[1] ) ) return -1;
292   if ( !kermit_is_char( state->m_pin[2] ) ) return -1;
293   len = kermit_unchar( state->m_pin[1] );
294   if ( state->m_pin[ 1 + len ] != kermit_checksum( state->m_pin ) ) return -1;
290   if ( state->pin[ 0 ] != KERMIT_SOH ) return -1;
291   if ( !kermit_is_char( state->pin[1] ) ) return -1;
292   if ( !kermit_is_char( state->pin[2] ) ) return -1;
293   len = kermit_unchar( state->pin[1] );
294   if ( state->pin[ 1 + len ] != kermit_checksum( state->pin ) ) return -1;
295295   return 0;
296296}
297297
298298/* interpret configuration packet, <0 if error */
299299static int kermit_get_conf( kermit* state )
300300{
301   int len = kermit_unchar( state->m_pin[1] );
302   if ( len >= 4 ) state->m_maxl = kermit_unchar( state->m_pin[ 4 ] );
303   if ( len >= 6 ) state->m_npad = kermit_unchar( state->m_pin[ 6 ] );
304   if ( len >= 7 ) state->m_padc = kermit_ctl( state->m_pin[ 7 ] );
305   if ( len >= 8 ) state->m_eol  = kermit_unchar( state->m_pin[ 8 ] );
306   if ( len >= 9 ) state->m_qctl = state->m_pin[ 9 ];
301   int len = kermit_unchar( state->pin[1] );
302   if ( len >= 4 ) state->maxl = kermit_unchar( state->pin[ 4 ] );
303   if ( len >= 6 ) state->npad = kermit_unchar( state->pin[ 6 ] );
304   if ( len >= 7 ) state->padc = kermit_ctl( state->pin[ 7 ] );
305   if ( len >= 8 ) state->eol  = kermit_unchar( state->pin[ 8 ] );
306   if ( len >= 9 ) state->qctl = state->pin[ 9 ];
307307
308308   LOG(( "kermit: get conf: len=%i, maxl=%i, npad=%i, padc=%i, eol=%i, qctl=%i\n",
309         len, state->m_maxl, state->m_npad, state->m_padc, state->m_eol, state->m_qctl ));
309         len, state->maxl, state->npad, state->padc, state->eol, state->qctl ));
310310
311311   /* validation */
312   if ( state->m_maxl < 10 || state->m_maxl > 94 ) return -1;
312   if ( state->maxl < 10 || state->maxl > 94 ) return -1;
313313   return 0;
314314}
315315
r11240r11241
317317static void kermit_send_conf_packet( kermit* state, UINT8 h )
318318{
319319   LOG(( "kermit: send conf packet of type %c\n", h ));
320   state->m_seq = 0;
321   state->m_pout[  0 ] = KERMIT_SOH;
322   state->m_pout[  1 ] = kermit_tochar( 13 );
323   state->m_pout[  2 ] = kermit_tochar( state->m_seq & 63 );
324   state->m_pout[  3 ] = h;
325   state->m_pout[  4 ] = kermit_tochar( state->m_maxl );   /* maxl */
326   state->m_pout[  5 ] = kermit_tochar( 1 );             /* time: 1 sec */
327   state->m_pout[  6 ] = kermit_tochar( state->m_npad );   /* npad */
328   state->m_pout[  7 ] = kermit_ctl( state->m_padc );      /* padc */
329   state->m_pout[  8 ] = kermit_tochar( state->m_eol );    /* eol */
330   state->m_pout[  9 ] = state->m_qctl;                    /* qtcl */
331   state->m_pout[ 10 ] = 'N';                            /* qbin: no 8-bit quoting */
332   state->m_pout[ 11 ] = '1';                            /* chkt: single character checksum */
333   state->m_pout[ 12 ] = ' ';                            /* rept: no repeat count */
334   state->m_pout[ 13 ] = kermit_tochar( 0 );             /* capas: no capabilities */
335   state->m_pout[ 14 ] = kermit_checksum( state->m_pout );
336   state->m_nbout = 15;
320   state->seq = 0;
321   state->pout[  0 ] = KERMIT_SOH;
322   state->pout[  1 ] = kermit_tochar( 13 );
323   state->pout[  2 ] = kermit_tochar( state->seq & 63 );
324   state->pout[  3 ] = h;
325   state->pout[  4 ] = kermit_tochar( state->maxl );   /* maxl */
326   state->pout[  5 ] = kermit_tochar( 1 );             /* time: 1 sec */
327   state->pout[  6 ] = kermit_tochar( state->npad );   /* npad */
328   state->pout[  7 ] = kermit_ctl( state->padc );      /* padc */
329   state->pout[  8 ] = kermit_tochar( state->eol );    /* eol */
330   state->pout[  9 ] = state->qctl;                    /* qtcl */
331   state->pout[ 10 ] = 'N';                            /* qbin: no 8-bit quoting */
332   state->pout[ 11 ] = '1';                            /* chkt: single character checksum */
333   state->pout[ 12 ] = ' ';                            /* rept: no repeat count */
334   state->pout[ 13 ] = kermit_tochar( 0 );             /* capas: no capabilities */
335   state->pout[ 14 ] = kermit_checksum( state->pout );
336   state->nbout = 15;
337337   kermit_start_sending( state );
338338}
339339
340340/* sends a packet with no data */
341341static void kermit_send_simple_packet( kermit* state, UINT8 h  )
342342{
343   LOG(( "kermit: send empty packet of type %c, seq=%i\n", h, state->m_seq & 63 ));
344   state->m_pout[ 0 ] = KERMIT_SOH;
345   state->m_pout[ 1 ] = kermit_tochar( 3 );
346   state->m_pout[ 2 ] = kermit_tochar( state->m_seq & 63 );
347   state->m_pout[ 3 ] = h;
348   state->m_pout[ 4 ] = kermit_checksum( state->m_pout );
349   state->m_nbout = 5;
343   LOG(( "kermit: send empty packet of type %c, seq=%i\n", h, state->seq & 63 ));
344   state->pout[ 0 ] = KERMIT_SOH;
345   state->pout[ 1 ] = kermit_tochar( 3 );
346   state->pout[ 2 ] = kermit_tochar( state->seq & 63 );
347   state->pout[ 3 ] = h;
348   state->pout[ 4 ] = kermit_checksum( state->pout );
349   state->nbout = 5;
350350   kermit_start_sending( state );
351351}
352352
r11240r11241
354354static void kermit_send_string_packet( kermit* state, UINT8 h, const char* data )
355355{
356356   int i, len;
357   LOG(( "kermit: send string packet of type %c, data=%s, seq=%i\n", h, data, state->m_seq & 63 ));
358   for ( len = i = 0; (len < state->m_maxl - 5) && data[i]; i++  )
357   LOG(( "kermit: send string packet of type %c, data=%s, seq=%i\n", h, data, state->seq & 63 ));
358   for ( len = i = 0; (len < state->maxl - 5) && data[i]; i++  )
359359   {
360360      char c = data[i];
361361      if ( kermit_is_char( c ) && ( c != '_' ) && ( c != ' ' ) )
362362      {
363         state->m_pout[ 4 + len ] = c;
363         state->pout[ 4 + len ] = c;
364364         len++;
365365      }
366366   }
367   state->m_pout[ 0 ] = KERMIT_SOH;
368   state->m_pout[ 1 ] = kermit_tochar( len + 3 );
369   state->m_pout[ 2 ] = kermit_tochar( state->m_seq & 63 );
370   state->m_pout[ 3 ] = h;
371   state->m_pout[ 4 + len ] = kermit_checksum( state->m_pout );
372   state->m_nbout = len + 5;
367   state->pout[ 0 ] = KERMIT_SOH;
368   state->pout[ 1 ] = kermit_tochar( len + 3 );
369   state->pout[ 2 ] = kermit_tochar( state->seq & 63 );
370   state->pout[ 3 ] = h;
371   state->pout[ 4 + len ] = kermit_checksum( state->pout );
372   state->nbout = len + 5;
373373   kermit_start_sending( state );
374374}
375375
376376/* extract the string contained in received packet */
377377static char* kermit_string_in_packet( kermit* state )
378378{
379   int len = kermit_unchar( state->m_pin[1] );
380   state->m_pin[ len + 1 ] = 0;
381   return (char*) state->m_pin + 4;
379   int len = kermit_unchar( state->pin[1] );
380   state->pin[ len + 1 ] = 0;
381   return (char*) state->pin + 4;
382382}
383383
384384static void kermit_reset( kermit* state )
385385{
386386   /* default config */
387   state->m_maxl = KERMIT_MAXL;
388   state->m_npad = 0;
389   state->m_padc = 0;
390   state->m_eol  = KERMIT_EOL;
391   state->m_qctl = KERMIT_QCTL;
387   state->maxl = KERMIT_MAXL;
388   state->npad = 0;
389   state->padc = 0;
390   state->eol  = KERMIT_EOL;
391   state->qctl = KERMIT_QCTL;
392392
393   state->m_retries = KERMIT_MAX_RETRIES;
394   state->m_posin   = 0;
395   state->m_posout  = 0;
396   state->m_nbout   = 0;
397   state->m_state   = KERMIT_IDLE;
398   state->m_seq     = 0;
393   state->retries = KERMIT_MAX_RETRIES;
394   state->posin   = 0;
395   state->posout  = 0;
396   state->nbout   = 0;
397   state->state   = KERMIT_IDLE;
398   state->seq     = 0;
399399
400   if ( state->m_image )
400   if ( state->image )
401401   {
402      state->m_image->fseek( SEEK_SET, 0 );
402      state->image->fseek( SEEK_SET, 0 );
403403   }
404404
405   state->m_resend->adjust( attotime::never, 0, attotime::never );
405   state->resend->adjust( attotime::never, 0, attotime::never );
406406}
407407
408408
r11240r11241
411411{
412412   kermit* state = get_safe_token(device);
413413
414   LOG(( "get %i %2x %c (%i)\n", data, data, data, state->m_posin ));
414   LOG(( "get %i %2x %c (%i)\n", data, data, data, state->posin ));
415415
416416   /* get SOH */
417   if ( (data == KERMIT_SOH) && (state->m_posin <= 1) )
417   if ( (data == KERMIT_SOH) && (state->posin <= 1) )
418418   {
419      state->m_pin[ 0 ] = data;
420      state->m_posin = 1;
419      state->pin[ 0 ] = data;
420      state->posin = 1;
421421   }
422422
423423   /* get packet contents */
424   else if ( state->m_posin > 0 )
424   else if ( state->posin > 0 )
425425   {
426      if ( state->m_posin >= sizeof( state->m_pout ) )
426      if ( state->posin >= sizeof( state->pout ) )
427427      {
428428         LOG(( "kermit: too many bytes received\n" ));
429         state->m_posin = 0;
429         state->posin = 0;
430430         kermit_send_simple_packet( state, KERMIT_NAK );
431431         return;
432432      }
433433
434434      if (kermit_is_ctl(data))
435         logerror( "received: not char %i at pos %i\n", data, state->m_posin  );
435         logerror( "received: not char %i at pos %i\n", data, state->posin  );
436436
437      state->m_pin[ state->m_posin ] = data;
438      state->m_posin++;
437      state->pin[ state->posin ] = data;
438      state->posin++;
439439
440      if ( state->m_posin > 5 )
440      if ( state->posin > 5 )
441441      {
442442         int len, seq, typ;
443         if ( !kermit_is_char( state->m_pin[1] ) ||
444              (kermit_unchar( state->m_pin[1] ) < 3) ||
445              (kermit_unchar( state->m_pin[1] ) > state->m_maxl) )
443         if ( !kermit_is_char( state->pin[1] ) ||
444              (kermit_unchar( state->pin[1] ) < 3) ||
445              (kermit_unchar( state->pin[1] ) > state->maxl) )
446446         {
447            LOG(( "kermit: invalid packet size %i-32, not in 3-%i\n", state->m_pin[1], state->m_maxl ));
447            LOG(( "kermit: invalid packet size %i-32, not in 3-%i\n", state->pin[1], state->maxl ));
448448            kermit_resend( state );
449449            return;
450450         }
451451
452         len = kermit_unchar( state->m_pin[1] );
452         len = kermit_unchar( state->pin[1] );
453453
454         if ( state->m_posin >= len + 2 )
454         if ( state->posin >= len + 2 )
455455         {
456456            /* got packet! */
457            state->m_posin = 0;
457            state->posin = 0;
458458            if ( kermit_validate_packet( state ) )
459459            {
460460               LOG(( "kermit: invalid packet\n" ));
r11240r11241
462462               return;
463463            }
464464
465            typ = state->m_pin[3];
466            seq = kermit_unchar( state->m_pin[2] );
465            typ = state->pin[3];
466            seq = kermit_unchar( state->pin[2] );
467467
468468            LOG(( "kermit: received packet type=%c, seq=%i, len=%i\n",  typ, seq, len ));
469469
470            if ( !state->m_image )
470            if ( !state->image )
471471            {
472472               kermit_send_string_packet( state, KERMIT_ERR, "NO IMAGE" );
473473               return;
r11240r11241
481481
482482            case KERMIT_SEND:
483483               kermit_get_conf( state );
484               if ( state->m_maxl >= KERMIT_MAXL )
484               if ( state->maxl >= KERMIT_MAXL )
485485               {
486                  state->m_maxl = KERMIT_MAXL;
486                  state->maxl = KERMIT_MAXL;
487487               }
488488               kermit_send_conf_packet( state, KERMIT_ACK );
489               state->m_state = KERMIT_RECEIVE;
489               state->state = KERMIT_RECEIVE;
490490               break;
491491
492492            case KERMIT_FILE:
493493               LOG(( "kermit: got file name '%s'\n", kermit_string_in_packet( state ) ));
494               state->m_seq = seq;
494               state->seq = seq;
495495               kermit_send_simple_packet( state, KERMIT_ACK );
496496               break;
497497
498498            case KERMIT_DATA:
499499            case KERMIT_EOF:
500               if ( seq == ((state->m_seq + 1) & 63) )
500               if ( seq == ((state->seq + 1) & 63) )
501501               {
502502                  /* next packet */
503503                  if ( typ == KERMIT_DATA )
504504                  {
505505                     kermit_write_data_packet( state );
506506                  }
507                  state->m_seq = seq;
507                  state->seq = seq;
508508                  kermit_send_simple_packet( state, KERMIT_ACK );
509509               }
510               else if ( seq == (state->m_seq & 63) )
510               else if ( seq == (state->seq & 63) )
511511               {
512512                  /* same packet */
513513                  kermit_send_simple_packet( state, KERMIT_ACK );
r11240r11241
515515               else
516516               {
517517                  /* unexpected sequence number */
518                  LOG(( "kermit: got seq=%i, expected %i\n", seq, (state->m_seq + 1) & 63 ));
519                  state->m_seq++;
518                  LOG(( "kermit: got seq=%i, expected %i\n", seq, (state->seq + 1) & 63 ));
519                  state->seq++;
520520                  kermit_send_simple_packet( state, KERMIT_NAK );
521                  state->m_seq--;
521                  state->seq--;
522522               }
523523               break;
524524
525525            case KERMIT_EOT:
526526               /* send ack and reset */
527               state->m_seq = seq;
527               state->seq = seq;
528528               kermit_send_simple_packet( state, KERMIT_ACK );
529               state->m_state = KERMIT_RESET;
529               state->state = KERMIT_RESET;
530530               break;
531531
532532
r11240r11241
535535            case KERMIT_NAK:
536536            case KERMIT_ACK:
537537
538               if ( (typ == KERMIT_NAK) && (seq == 0) && (state->m_state == KERMIT_IDLE) )
538               if ( (typ == KERMIT_NAK) && (seq == 0) && (state->state == KERMIT_IDLE) )
539539               {
540540                  /* transfer start */
541541                  kermit_send_conf_packet( state, KERMIT_SEND );
542542                  break;
543543               }
544544
545               if ( ((seq == (state->m_seq & 63)) && (typ == KERMIT_ACK)) ||
546                    ((seq == ((state->m_seq + 1) & 63)) && (typ == KERMIT_NAK)) )
545               if ( ((seq == (state->seq & 63)) && (typ == KERMIT_ACK)) ||
546                    ((seq == ((state->seq + 1) & 63)) && (typ == KERMIT_NAK)) )
547547               {
548548                  /* send next packet */
549549
550                  state->m_seq = state->m_seq + 1;
550                  state->seq = state->seq + 1;
551551
552                  switch ( state->m_state )
552                  switch ( state->state )
553553                  {
554554                  case KERMIT_IDLE:
555555                     /* get conf & send file name */
556556                     kermit_get_conf( state );
557                     kermit_send_string_packet( state, KERMIT_FILE, state->m_image->basename() );
558                     state->m_state = KERMIT_SEND_DATA;;
557                     kermit_send_string_packet( state, KERMIT_FILE, state->image->basename() );
558                     state->state = KERMIT_SEND_DATA;;
559559                     break;
560560
561561                  case KERMIT_SEND_DATA:
562562                     /* send next data packet or EOF */
563                     if ( state->m_image->image_feof() )
563                     if ( state->image->image_feof() )
564564                     {
565565                        kermit_send_simple_packet( state, KERMIT_EOF );
566                        state->m_state = KERMIT_SEND_EOF;
566                        state->state = KERMIT_SEND_EOF;
567567                     }
568568                     else
569569                     {
r11240r11241
574574                  case KERMIT_SEND_EOF:
575575                          /* send EOT */
576576                     kermit_send_simple_packet( state, KERMIT_EOT );
577                     state->m_state = KERMIT_SEND_EOT;
577                     state->state = KERMIT_SEND_EOT;
578578                     break;
579579
580580                  case KERMIT_SEND_EOT:
581581                     /* reset */
582582                     kermit_reset( state );
583                     state->m_state = KERMIT_RESET;
583                     state->state = KERMIT_RESET;
584584                     break;
585585
586586                  }
587587               }
588588
589               else if ( (seq == (state->m_seq & 63)) && (typ == KERMIT_NAK) )
589               else if ( (seq == (state->seq & 63)) && (typ == KERMIT_NAK) )
590590               {
591591                  /* resend last packet */
592592                  kermit_resend( state );
r11240r11241
594594               else
595595               {
596596                  /* bad */
597                  LOG(( "kermit: expected to send %i, got seq=%i\n", (state->m_seq + 1) & 63, seq ));
597                  LOG(( "kermit: expected to send %i, got seq=%i\n", (state->seq + 1) & 63, seq ));
598598                  kermit_reset( state );
599599               }
600600               break;
r11240r11241
603603
604604            case KERMIT_ERR:
605605               LOG(( "kermit: got error '%s'\n", kermit_string_in_packet( state ) ));
606               state->m_seq = seq;
606               state->seq = seq;
607607               kermit_reset( state );
608608               break;
609609
610610            default:
611               LOG(( "kermit: ignoring packet type %c\n", state->m_pin[ 3 ] ));
611               LOG(( "kermit: ignoring packet type %c\n", state->pin[ 3 ] ));
612612               /* no abort, just ignoring */
613613            }
614614         }
r11240r11241
620620{
621621   kermit* state = get_safe_token(device);
622622
623   LOG(( "transmitted %i %2x %c, %i / %i\n", state->m_pout[ state->m_posout-1 ], state->m_pout[ state->m_posout-1 ], state->m_pout[ state->m_posout-1 ], state->m_posout - 1, state->m_nbout - 1 ));
623   LOG(( "transmitted %i %2x %c, %i / %i\n", state->pout[ state->posout-1 ], state->pout[ state->posout-1 ], state->pout[ state->posout-1 ], state->posout - 1, state->nbout - 1 ));
624624
625625   /* at end of packet */
626   if ( state->m_posout >= state->m_nbout )
626   if ( state->posout >= state->nbout )
627627   {
628      if ( state->m_state == KERMIT_RESET )
628      if ( state->state == KERMIT_RESET )
629629      {
630630         kermit_reset( state );
631631      }
632632      return;
633633   }
634634
635   if ( state->m_conf && state->m_conf->send )
635   if ( state->conf && state->conf->send )
636636   {
637      state->m_conf->send(*state->m_machine, state->m_pout[ state->m_posout ] );
637      state->conf->send(*state->machine, state->pout[ state->posout ] );
638638   }
639   state->m_posout++;
639   state->posout++;
640640}
641641
642642static DEVICE_START( kermit )
643643{
644644   kermit* state = get_safe_token(device);
645645   LOG(( "kermit: start\n" ));
646   state->m_image = NULL;
647   state->m_conf = (kermit_config*) device->baseconfig().static_config();
648   state->m_machine = &device->machine();
649   state->m_resend = device->machine().scheduler().timer_alloc(FUNC(kermit_resend_cb), state );
646   state->image = NULL;
647   state->conf = (kermit_config*) device->baseconfig().static_config();
648   state->machine = &device->machine();
649   state->resend = device->machine().scheduler().timer_alloc(FUNC(kermit_resend_cb), state );
650650   kermit_reset( state );
651651}
652652
r11240r11241
661661{
662662   kermit* state = get_safe_token(&image.device());
663663   LOG(( "kermit: image load\n" ));
664   state->m_image = &image;
664   state->image = &image;
665665   kermit_reset( state );
666666   return IMAGE_INIT_PASS;
667667}
r11240r11241
670670{
671671   kermit* state = get_safe_token(&image.device());
672672   LOG(( "kermit: image create\n" ));
673   state->m_image = &image;
673   state->image = &image;
674674   kermit_reset( state );
675675   return IMAGE_INIT_PASS;
676676}
r11240r11241
679679{
680680   kermit* state = get_safe_token(&image.device());
681681   LOG(( "kermit: image unload\n" ));
682   state->m_image = NULL;
682   state->image = NULL;
683683   kermit_reset( state );
684684}
685685
src/mess/machine/comxpl80.c
r11240r11241
253253      // read data from font ROM
254254      int font_rom = (input_port_read(this, "FONT") & 0x03) * 0x2000;
255255
256      m_plotter_data = m_machine.region("gfx2")->base()[font_rom | m_font_addr];
256      m_plotter_data = machine().region("gfx2")->base()[font_rom | m_font_addr];
257257   }
258258
259259   if (!BIT(data, 6))
src/mess/machine/c1581.c
r11240r11241
403403     m_cia(*this, M8520_TAG),
404404     m_fdc(*this, WD1770_TAG),
405405     m_image(*this, FLOPPY_0),
406     m_bus(m_machine.device(_config.m_bus_tag)),
406     m_bus(machine().device(_config.m_bus_tag)),
407407      m_config(_config)
408408{
409409}
src/mess/machine/ncr5380.c
r11240r11241
138138   // try to open the devices
139139   for (i = 0; i < m_config.scsidevs->devs_present; i++)
140140   {
141      SCSIAllocInstance( m_machine,
141      SCSIAllocInstance( machine(),
142142            m_config.scsidevs->devices[i].scsiClass,
143143            &m_scsi_devices[m_config.scsidevs->devices[i].scsiID],
144144            m_config.scsidevs->devices[i].diskregion );
r11240r11241
269269   }
270270
271271   if (VERBOSE)
272      logerror("NCR5380: read %s (reg %d) = %02x [PC=%x]\n", rnames[reg], reg, rv, cpu_get_pc(m_machine.firstcpu));
272      logerror("NCR5380: read %s (reg %d) = %02x [PC=%x]\n", rnames[reg], reg, rv, cpu_get_pc(machine().firstcpu));
273273
274274   return rv;
275275}
r11240r11241
279279   int reg = offset & 7;
280280
281281   if (VERBOSE)
282      logerror("NCR5380: %02x to %s (reg %d) [PC=%x]\n", data, wnames[reg], reg, cpu_get_pc(m_machine.firstcpu));
282      logerror("NCR5380: %02x to %s (reg %d) [PC=%x]\n", data, wnames[reg], reg, cpu_get_pc(machine().firstcpu));
283283
284284   switch( reg )
285285   {
r11240r11241
366366               if (get_cmd_len(m_5380_Command[0]) == m_cmd_ptr)
367367               {
368368                  if (VERBOSE)
369                     logerror("NCR5380: Command (to ID %d): %x %x %x %x %x %x %x %x %x %x (PC %x)\n", m_last_id, m_5380_Command[0], m_5380_Command[1], m_5380_Command[2], m_5380_Command[3], m_5380_Command[4], m_5380_Command[5], m_5380_Command[6], m_5380_Command[7], m_5380_Command[8], m_5380_Command[9], cpu_get_pc(m_machine.firstcpu));
369                     logerror("NCR5380: Command (to ID %d): %x %x %x %x %x %x %x %x %x %x (PC %x)\n", m_last_id, m_5380_Command[0], m_5380_Command[1], m_5380_Command[2], m_5380_Command[3], m_5380_Command[4], m_5380_Command[5], m_5380_Command[6], m_5380_Command[7], m_5380_Command[8], m_5380_Command[9], cpu_get_pc(machine().firstcpu));
370370
371371                  SCSISetCommand(m_scsi_devices[m_last_id], &m_5380_Command[0], 16);
372372                  SCSIExecCommand(m_scsi_devices[m_last_id], &m_d_limit);
r11240r11241
517517      // if a device wasn't already allocated
518518      if (!m_scsi_devices[m_config.scsidevs->devices[i].scsiID])
519519      {
520         SCSIAllocInstance( m_machine,
520         SCSIAllocInstance( machine(),
521521               m_config.scsidevs->devices[i].scsiClass,
522522               &m_scsi_devices[m_config.scsidevs->devices[i].scsiID],
523523               m_config.scsidevs->devices[i].diskregion );
src/mess/machine/x1.c
r11240r11241
7070
7171int x1_keyboard_device::z80daisy_irq_state()
7272{
73   x1_state *state = m_machine.driver_data<x1_state>();
73   x1_state *state = machine().driver_data<x1_state>();
7474   if(state->m_key_irq_flag != 0)
7575      return Z80_DAISY_INT;
7676   return 0;
r11240r11241
8484
8585int x1_keyboard_device::z80daisy_irq_ack()
8686{
87   x1_state *state = m_machine.driver_data<x1_state>();
87   x1_state *state = machine().driver_data<x1_state>();
8888   state->m_key_irq_flag = 0;
8989   cputag_set_input_line(device().machine(),"maincpu",INPUT_LINE_IRQ0,CLEAR_LINE);
9090   return state->m_key_irq_vector;
src/mess/machine/advision.c
r11240r11241
2828void advision_state::machine_start()
2929{
3030   /* configure EA banking */
31   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region("bios")->base(), 0);
32   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region(I8048_TAG)->base(), 0);
31   memory_configure_bank(machine(), "bank1", 0, 1, machine().region("bios")->base(), 0);
32   memory_configure_bank(machine(), "bank1", 1, 1, machine().region(I8048_TAG)->base(), 0);
3333   m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x03ff, "bank1");
34   memory_set_bank(m_machine, "bank1", 0);
34   memory_set_bank(machine(), "bank1", 0);
3535
3636   /* allocate external RAM */
37   m_ext_ram = auto_alloc_array(m_machine, UINT8, 0x400);
37   m_ext_ram = auto_alloc_array(machine(), UINT8, 0x400);
3838}
3939
4040void advision_state::machine_reset()
4141{
4242   /* enable internal ROM */
4343   device_set_input_line(m_maincpu, MCS48_INPUT_EA, CLEAR_LINE);
44   memory_set_bank(m_machine, "bank1", 0);
44   memory_set_bank(machine(), "bank1", 0);
4545
4646   /* reset sound CPU */
4747   device_set_input_line(m_soundcpu, INPUT_LINE_RESET, ASSERT_LINE);
r11240r11241
6060
6161   device_set_input_line(m_maincpu, MCS48_INPUT_EA, ea ? ASSERT_LINE : CLEAR_LINE);
6262
63   memory_set_bank(m_machine, "bank1", ea);
63   memory_set_bank(machine(), "bank1", ea);
6464
6565   m_rambank = (data & 0x03) << 8;
6666}
r11240r11241
163163READ8_MEMBER( advision_state::controller_r )
164164{
165165   // Get joystick switches
166   UINT8 in = input_port_read(m_machine, "joystick");
166   UINT8 in = input_port_read(machine(), "joystick");
167167   UINT8 data = in | 0x0f;
168168
169169   // Get buttons
src/mess/machine/mb89352.c
r11240r11241
159159    // initialise SCSI devices, if any present
160160    for(x=0;x<m_config.scsidevs->devs_present;x++)
161161    {
162       SCSIAllocInstance(m_machine, m_config.scsidevs->devices[x].scsiClass,
162       SCSIAllocInstance(machine(), m_config.scsidevs->devices[x].scsiClass,
163163            &m_SCSIdevices[m_config.scsidevs->devices[x].scsiID],
164164            m_config.scsidevs->devices[x].diskregion );
165165    }
r11240r11241
220220//      if (!m_SCSIdevices[m_config.scsidevs->devices[i].scsiID])
221221      {
222222         SCSIDeleteInstance( m_SCSIdevices[m_config.scsidevs->devices[i].scsiID] );
223         SCSIAllocInstance( m_machine,
223         SCSIAllocInstance( machine(),
224224               m_config.scsidevs->devices[i].scsiClass,
225225               &m_SCSIdevices[m_config.scsidevs->devices[i].scsiID],
226226               m_config.scsidevs->devices[i].diskregion );
src/mess/machine/psxcd.c
r11240r11241
153153
154154void psxcd_device::device_start()
155155{
156   unsigned int sysclk=m_machine.device<cpu_device>("maincpu")->clock()/2;
156   unsigned int sysclk=machine().device<cpu_device>("maincpu")->clock()/2;
157157   start_read_delay=(sysclk/60);
158158   read_sector_cycles=(sysclk/75);
159159   preread_delay=(read_sector_cycles>>2)-500;
r11240r11241
203203      m_timerinuse[i] = false;
204204   }
205205
206   m_cddevice = m_machine.device(m_devname);
206   m_cddevice = machine().device(m_devname);
207207   if (m_cddevice)
208208   {
209209      m_cd = cd_get_cdrom_file(m_cddevice);
r11240r11241
212212      {
213213//         printf("psxcd: found disc!\n");
214214         driver = open_mess_drv();
215         driver->set_machine(m_machine);
215         driver->set_machine(machine());
216216         driver->set_cdrom_file(m_cd);
217217      }
218218      else
r11240r11241
262262   }
263263
264264   #ifdef debug_cdrom_registers
265      printf("cdrom: read byte %08x = %02x (PC=%x)\n",addr,ret,cpu_get_pc(m_machine.device("maincpu")));
265      printf("cdrom: read byte %08x = %02x (PC=%x)\n",addr,ret,cpu_get_pc(machine().device("maincpu")));
266266   #endif
267267
268268   return ret;
r11240r11241
275275void psxcd_device::write_byte(const unsigned int addr, const unsigned char byte)
276276{
277277   #ifdef debug_cdrom_registers
278      printf("cdrom: write byte %08x = %02x (PC=%x)\n",addr,byte,cpu_get_pc(m_machine.device("maincpu")));
278      printf("cdrom: write byte %08x = %02x (PC=%x)\n",addr,byte,cpu_get_pc(machine().device("maincpu")));
279279   #endif
280280
281281   switch (addr&3)
r11240r11241
931931
932932   if (doint)
933933   {
934      psx_irq_set(m_machine, 0x0004);
934      psx_irq_set(machine(), 0x0004);
935935   }
936936
937937   add_result(res);
r11240r11241
10111011   // Avoid returning results after sector read results -
10121012   // delay the sector read slightly if necessary
10131013
1014   UINT64 systime = m_machine.device<cpu_device>("maincpu")->total_cycles();
1014   UINT64 systime = machine().device<cpu_device>("maincpu")->total_cycles();
10151015   if ((next_read_event) && ((systime+ev->t)>(next_sector_t)))
10161016   {
10171017      UINT32 hz = m_sysclock / (delay + 2000);
r11240r11241
11741174                  if (xa_prefetch_sector==-1)
11751175                  {
11761176                     xa_prefetch_sector=cursec;
1177                     m_machine.device<spu_device>("spu")->flush_xa();
1177                     machine().device<spu_device>("spu")->flush_xa();
11781178                  }
11791179
11801180                  unsigned char *xaptr;
r11240r11241
12051205                            ((xasub->file==sub->file) &&
12061206                              (xasub->channel==sub->channel))))
12071207                     {
1208                        if (! m_machine.device<spu_device>("spu")->play_xa(xa_prefetch_sector,xaptr))
1208                        if (! machine().device<spu_device>("spu")->play_xa(xa_prefetch_sector,xaptr))
12091209                           break;
12101210                     }
12111211                     xa_prefetch_sector++;
12121212                  }
12131213               #else
1214                  m_machine.device<spu_device>("spu")->play_xa(0,rawsec+16);
1214                  machine().device<spu_device>("spu")->play_xa(0,rawsec+16);
12151215               #endif
12161216
12171217               status|=status_playing;
r11240r11241
13101310
13111311   if (! isdata)
13121312   {
1313      return m_machine.device<spu_device>("spu")->play_cdda(sector,rawsec);
1313      return machine().device<spu_device>("spu")->play_cdda(sector,rawsec);
13141314   } else
13151315   {
13161316      return true;
r11240r11241
13411341         if (cdda_prefetch_sector==-1)
13421342         {
13431343            cdda_prefetch_sector=cursec;
1344            m_machine.device<spu_device>("spu")->flush_cdda();
1344            machine().device<spu_device>("spu")->flush_cdda();
13451345         }
13461346
13471347         unsigned char *cddaptr;
r11240r11241
14211421      unsigned int cyc=read_sector_cycles;
14221422
14231423      event *ev=new event;
1424      ev->t=next_sector_t - m_machine.device<cpu_device>("maincpu")->total_cycles();
1424      ev->t=next_sector_t - machine().device<cpu_device>("maincpu")->total_cycles();
14251425      ev->type=event_play_sector;
14261426
14271427      next_sector_t+=cyc;
r11240r11241
14551455
14561456      unsigned int cyc=read_sector_cycles;
14571457      if (mode&mode_double_speed) cyc>>=1;
1458      next_sector_t=ev->t+(cyc-preread_delay)+m_machine.device<cpu_device>("maincpu")->total_cycles();
1458      next_sector_t=ev->t+(cyc-preread_delay)+machine().device<cpu_device>("maincpu")->total_cycles();
14591459   } else
14601460   {
14611461      memcpy(lastsechdr,buf+12,8);
r11240r11241
14751475
14761476      //
14771477
1478      ev->t=next_sector_t - m_machine.device<cpu_device>("maincpu")->total_cycles();
1478      ev->t=next_sector_t - machine().device<cpu_device>("maincpu")->total_cycles();
14791479      ev->type=event_read_sector;
14801480
14811481      //read_next_sector();
r11240r11241
15051505   unsigned int cyc=read_sector_cycles;
15061506   if (mode&mode_double_speed) cyc>>=1;
15071507
1508   INT64 systime=m_machine.device<cpu_device>("maincpu")->total_cycles();
1508   INT64 systime=machine().device<cpu_device>("maincpu")->total_cycles();
15091509
15101510   systime+=start_read_delay;
15111511
r11240r11241
15561556
15571557   unsigned int cyc=read_sector_cycles;
15581558
1559   next_sector_t=m_machine.device<cpu_device>("maincpu")->total_cycles()+cyc;
1559   next_sector_t=machine().device<cpu_device>("maincpu")->total_cycles()+cyc;
15601560
15611561   event *ev=new event;
1562   ev->t=next_sector_t - m_machine.device<cpu_device>("maincpu")->total_cycles();
1562   ev->t=next_sector_t - machine().device<cpu_device>("maincpu")->total_cycles();
15631563   ev->type=event_play_sector;
15641564
15651565   next_sector_t+=cyc;
r11240r11241
16001600   }
16011601
16021602   unsigned int sector=msf_to_sector(curpos);
1603   m_machine.device<spu_device>("spu")->flush_xa(sector);
1604   m_machine.device<spu_device>("spu")->flush_cdda(sector);
1603   machine().device<spu_device>("spu")->flush_xa(sector);
1604   machine().device<spu_device>("spu")->flush_cdda(sector);
16051605}
16061606
16071607//
src/mess/machine/vic1112.c
r11240r11241
7979{
8080   m_via0_irq = state;
8181
82   device_set_input_line(m_machine.firstcpu, M6502_IRQ_LINE, (m_via0_irq | m_via1_irq) ? ASSERT_LINE : CLEAR_LINE);
82   device_set_input_line(machine().firstcpu, M6502_IRQ_LINE, (m_via0_irq | m_via1_irq) ? ASSERT_LINE : CLEAR_LINE);
8383}
8484
8585
r11240r11241
177177{
178178   m_via1_irq = state;
179179
180   device_set_input_line(m_machine.firstcpu, M6502_IRQ_LINE, (m_via0_irq | m_via1_irq) ? ASSERT_LINE : CLEAR_LINE);
180   device_set_input_line(machine().firstcpu, M6502_IRQ_LINE, (m_via0_irq | m_via1_irq) ? ASSERT_LINE : CLEAR_LINE);
181181}
182182
183183READ8_MEMBER( vic1112_device::dio_r )
r11240r11241
297297    : device_t(_machine, _config),
298298     m_via0(*this, M6522_0_TAG),
299299     m_via1(*this, M6522_1_TAG),
300     m_bus(m_machine.device(_config.m_bus_tag)),
300     m_bus(machine().device(_config.m_bus_tag)),
301301      m_config(_config)
302302{
303303}
r11240r11241
309309
310310void vic1112_device::device_start()
311311{
312   address_space *program = m_machine.firstcpu->memory().space(AS_PROGRAM);
312   address_space *program = machine().firstcpu->memory().space(AS_PROGRAM);
313313
314314   // map VIAs to VIC-20 address space
315315   program->install_readwrite_handler(0x9800, 0x980f, 0, 0, read8_delegate(FUNC(via6522_device::read), (via6522_device*)m_via0), write8_delegate(FUNC(via6522_device::write), (via6522_device*)m_via0));
src/mess/machine/genpc.c
r11240r11241
572572 
573573void ibm5160_mb_device::install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name)
574574{   
575   int buswidth = m_machine.firstcpu->memory().space_config(AS_IO)->m_databus_width;
575   int buswidth = machine().firstcpu->memory().space_config(AS_IO)->m_databus_width;
576576   switch(buswidth)
577577   {
578578      case 8:
r11240r11241
589589
590590void ibm5160_mb_device::install_device_write(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_device_func whandler, const char *whandler_name)
591591{   
592   int buswidth = m_machine.firstcpu->memory().space_config(AS_IO)->m_databus_width;
592   int buswidth = machine().firstcpu->memory().space_config(AS_IO)->m_databus_width;
593593   switch(buswidth)
594594   {
595595      case 8:
r11240r11241
645645   install_device(this,    0x0080, 0x0087, 0, 0, FUNC(pc_page_r), FUNC(pc_page_w) );   
646646   install_device_write(this,    0x00a0, 0x00a1, 0, 0, FUNC(nmi_enable_w));   
647647   /* MESS managed RAM */
648   if ( ram_get_ptr(m_machine.device(RAM_TAG)) )
649      memory_set_bankptr( m_machine, "bank10", ram_get_ptr(m_machine.device(RAM_TAG)) );   
648   if ( ram_get_ptr(machine().device(RAM_TAG)) )
649      memory_set_bankptr( machine(), "bank10", ram_get_ptr(machine().device(RAM_TAG)) );   
650650}
651651 
652652IRQ_CALLBACK(ibm5160_mb_device::pc_irq_callback)
r11240r11241
785785         * 6-7  The number of floppy disk drives
786786         */
787787      data = input_port_read(this, "DSW0") & 0xF3;
788      switch ( ram_get_size(m_machine.device(RAM_TAG)) )
788      switch ( ram_get_size(machine().device(RAM_TAG)) )
789789      {
790790      case 16 * 1024:
791791         data |= 0x00;
r11240r11241
823823      /* read hi nibble of SW2 */
824824      data = data & 0xf0;
825825
826      switch ( ram_get_size(m_machine.device(RAM_TAG)) - 64 * 1024 )
826      switch ( ram_get_size(machine().device(RAM_TAG)) - 64 * 1024 )
827827      {
828828      case 64 * 1024:      data |= 0x00; break;
829829      case 128 * 1024:   data |= 0x02; break;
r11240r11241
841841      case 896 * 1024:   data |= 0x0B; break;
842842      case 960 * 1024:   data |= 0x0D; break;
843843      }
844      if ( ram_get_size(m_machine.device(RAM_TAG)) > 960 * 1024 )
844      if ( ram_get_size(machine().device(RAM_TAG)) > 960 * 1024 )
845845         data |= 0x0D;
846846
847847      PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
src/mess/machine/fm_scsi.c
r11240r11241
8181    // initialise SCSI devices, if any present
8282    for(x=0;x<m_config.scsidevs->devs_present;x++)
8383    {
84       SCSIAllocInstance(m_machine, m_config.scsidevs->devices[x].scsiClass,
84       SCSIAllocInstance(machine(), m_config.scsidevs->devices[x].scsiClass,
8585            &m_SCSIdevices[m_config.scsidevs->devices[x].scsiID],
8686            m_config.scsidevs->devices[x].diskregion );
8787    }
r11240r11241
144144//      if (!m_SCSIdevices[m_config.scsidevs->devices[i].scsiID])
145145      {
146146         SCSIDeleteInstance( m_SCSIdevices[m_config.scsidevs->devices[i].scsiID] );
147         SCSIAllocInstance( m_machine,
147         SCSIAllocInstance( machine(),
148148               m_config.scsidevs->devices[i].scsiClass,
149149               &m_SCSIdevices[m_config.scsidevs->devices[i].scsiID],
150150               m_config.scsidevs->devices[i].diskregion );
src/mess/machine/sorcerer.c
r11240r11241
176176      m_serial_timer->adjust(attotime::zero);
177177#endif
178178
179      UINT8 sound = input_port_read(m_machine, "CONFIG") & 8;
179      UINT8 sound = input_port_read(machine(), "CONFIG") & 8;
180180
181181      cassette_change_state(m_cass1,
182182         ((BIT(data, 4)) && (sound)) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
r11240r11241
216216WRITE8_MEMBER(sorcerer_state::sorcerer_ff_w)
217217{
218218   /* reading the config switch */
219   switch (input_port_read(m_machine, "CONFIG") & 0x06)
219   switch (input_port_read(machine(), "CONFIG") & 0x06)
220220   {
221221      case 0: /* speaker */
222222         dac_data_w(m_dac, data);
r11240r11241
275275   };
276276
277277   /* bit 5 - vsync (inverted) */
278   data |= (((~input_port_read(m_machine, "VS")) & 0x01)<<5);
278   data |= (((~input_port_read(machine(), "VS")) & 0x01)<<5);
279279
280280   /* bits 4..0 - keyboard data */
281   data |= (input_port_read(m_machine, keynames[m_keyboard_line]) & 0x1f);
281   data |= (input_port_read(machine(), keynames[m_keyboard_line]) & 0x1f);
282282
283283   return data;
284284}
src/mess/machine/abcbus.c
r11240r11241
135135   for ( ; daisy->devname != NULL; daisy++)
136136   {
137137      // find the device
138      device_t *target = m_machine.device(daisy->devname);
138      device_t *target = machine().device(daisy->devname);
139139      if (target == NULL)
140140         fatalerror("Unable to locate device '%s'", daisy->devname);
141141
r11240r11241
145145         fatalerror("Device '%s' does not implement the abcbus interface!", daisy->devname);
146146
147147      // append to the end
148      *tailptr = auto_alloc(m_machine, daisy_entry(target));
148      *tailptr = auto_alloc(machine(), daisy_entry(target));
149149      tailptr = &(*tailptr)->m_next;
150150   }
151151}
src/mess/machine/cs4031.c
r11240r11241
153153
154154void cs4031_device::device_start()
155155{
156   device_t *ram_device = m_machine.device(RAM_TAG);
156   device_t *ram_device = machine().device(RAM_TAG);
157157
158158   // make sure the ram device is already running
159159   if (!ram_device->started())
160160      throw device_missing_dependencies();
161161
162   device_t *cpu = m_machine.device(m_config.m_cputag);
162   device_t *cpu = machine().device(m_config.m_cputag);
163163   m_space = cpu->memory().space(AS_PROGRAM);
164   m_isa = m_machine.region(m_config.m_isatag)->base();
165   m_bios = m_machine.region(m_config.m_biostag)->base();
164   m_isa = machine().region(m_config.m_isatag)->base();
165   m_bios = machine().region(m_config.m_biostag)->base();
166166
167167   m_ram = ram_get_ptr(ram_device);
168168   UINT32 ram_size = ram_get_size(ram_device);
src/mess/machine/osborne1.c
r11240r11241
551551
552552int osborne1_daisy_device::z80daisy_irq_state()
553553{
554   osborne1_state *state = m_machine.driver_data<osborne1_state>();
554   osborne1_state *state = machine().driver_data<osborne1_state>();
555555   return ( state->m_pia_1_irq_state ? Z80_DAISY_INT : 0 );
556556}
557557
r11240r11241
563563
564564int osborne1_daisy_device::z80daisy_irq_ack()
565565{
566   osborne1_state *state = m_machine.driver_data<osborne1_state>();
566   osborne1_state *state = machine().driver_data<osborne1_state>();
567567   /* Enable ROM and I/O when IRQ is acknowledged */
568568   UINT8 old_bankswitch = state->m_bankswitch;
569569   address_space* space = device().machine().device("maincpu")->memory().space(AS_PROGRAM);
src/mess/machine/psxcddrv.h
r11240r11241
5252protected:
5353   void cancel_io();
5454   void set_native_sector_size(const unsigned int sz);
55   running_machine *m_machine;
5655   UINT32 timestamp_frequency;
5756   cdrom_file   *m_cd;
57private:
58   running_machine *m_machine;
5859
5960public:
6061   cdrom_driver();
src/mess/machine/comx35.c
r11240r11241
128128{
129129   UINT8 result;
130130   
131   switch (m_machine.phase())
131   switch (machine().phase())
132132   {
133133      case MACHINE_PHASE_RESET:
134134      case MACHINE_PHASE_RUNNING:
135         result = input_port_read(m_machine, "EXPANSION");
135         result = input_port_read(machine(), "EXPANSION");
136136         break;
137137
138138      default:
r11240r11241
145145
146146bool comx35_state::is_expansion_box_installed()
147147{
148   return (&m_machine.region(CDP1802_TAG)->base()[0xe800] != 0x00);
148   return (&machine().region(CDP1802_TAG)->base()[0xe800] != 0x00);
149149}
150150
151151bool comx35_state::is_dos_card_active()
r11240r11241
246246
247247UINT8 comx35_state::printer_r()
248248{
249   int printer = input_port_read(m_machine, "PRINTER") & 0x07;
249   int printer = input_port_read(machine(), "PRINTER") & 0x07;
250250   UINT8 data = 0;
251251
252252   switch (printer)
r11240r11241
285285
286286void comx35_state::printer_w(UINT8 data)
287287{
288   int printer = input_port_read(m_machine, "PRINTER") & 0x07;
288   int printer = input_port_read(machine(), "PRINTER") & 0x07;
289289
290290   switch (printer)
291291   {
r11240r11241
337337      }
338338
339339      if (m_slot > 0)
340         m_bank = input_port_read(m_machine, slotnames[m_slot]);
340         m_bank = input_port_read(machine(), slotnames[m_slot]);
341341   }
342342   else
343343   {
r11240r11241
415415      break;
416416   }
417417
418   memory_set_bank(m_machine, "bank1", bank);
418   memory_set_bank(machine(), "bank1", bank);
419419}
420420
421421WRITE8_MEMBER( comx35_state::bank_select_w )
r11240r11241
445445      break;
446446
447447   case BANK_JOYCARD:
448      data = input_port_read(m_machine, "JOY1");
448      data = input_port_read(machine(), "JOY1");
449449      break;
450450
451451   case BANK_80_COLUMNS:
r11240r11241
477477      break;
478478
479479   case BANK_JOYCARD:
480      data = input_port_read(m_machine, "JOY2");
480      data = input_port_read(machine(), "JOY2");
481481      break;
482482
483483   case BANK_80_COLUMNS:
r11240r11241
557557   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
558558
559559   /* opbase handling for DOS Card */
560   program->set_direct_update_handler(direct_update_delegate(FUNC(comx35_opbase_handler), &m_machine));
560   program->set_direct_update_handler(direct_update_delegate(FUNC(comx35_opbase_handler), &machine()));
561561
562562   /* BASIC ROM banking */
563563   program->install_read_bank(0x1000, 0x17ff, "bank2");
564564   program->unmap_write(0x1000, 0x17ff);
565   memory_configure_bank(m_machine, "bank2", 0, 1, m_machine.region(CDP1802_TAG)->base() + 0x1000, 0); // normal ROM
566   memory_configure_bank(m_machine, "bank2", 1, 1, m_machine.region(CDP1802_TAG)->base() + 0xe000, 0); // expansion box ROM
565   memory_configure_bank(machine(), "bank2", 0, 1, machine().region(CDP1802_TAG)->base() + 0x1000, 0); // normal ROM
566   memory_configure_bank(machine(), "bank2", 1, 1, machine().region(CDP1802_TAG)->base() + 0xe000, 0); // expansion box ROM
567567
568   memory_configure_bank(m_machine, "bank3", 0, 1, m_machine.region(CDP1802_TAG)->base() + 0xe000, 0);
569   memory_set_bank(m_machine, "bank3", 0);
568   memory_configure_bank(machine(), "bank3", 0, 1, machine().region(CDP1802_TAG)->base() + 0xe000, 0);
569   memory_set_bank(machine(), "bank3", 0);
570570
571571   if (is_expansion_box_installed())
572572   {
573573      program->install_read_bank(0xe000, 0xefff, "bank3");
574574      program->unmap_write(0xe000, 0xefff);
575      memory_set_bank(m_machine, "bank2", 1);
575      memory_set_bank(machine(), "bank2", 1);
576576   }
577577   else
578578   {
579579      program->unmap_readwrite(0xe000, 0xefff);
580      memory_set_bank(m_machine, "bank2", 0);
580      memory_set_bank(machine(), "bank2", 0);
581581   }
582582
583583   /* card slot banking */
584   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(CDP1802_TAG)->base() + 0xc000, 0);
585   memory_configure_bank(m_machine, "bank1", BANK_FLOPPY, 1, m_machine.region("fdc")->base(), 0);
586   memory_configure_bank(m_machine, "bank1", BANK_PRINTER_PARALLEL, 1, m_machine.region("printer")->base(), 0);
587   memory_configure_bank(m_machine, "bank1", BANK_PRINTER_PARALLEL_FM, 1, m_machine.region("printer_fm")->base(), 0);
588   memory_configure_bank(m_machine, "bank1", BANK_PRINTER_SERIAL, 1, m_machine.region("rs232")->base(), 0);
589   memory_configure_bank(m_machine, "bank1", BANK_PRINTER_THERMAL, 1, m_machine.region("thermal")->base(), 0);
590   memory_configure_bank(m_machine, "bank1", BANK_JOYCARD, 1, m_machine.region(CDP1802_TAG)->base(), 0);
591   memory_configure_bank(m_machine, "bank1", BANK_80_COLUMNS, 1, m_machine.region("80column")->base(), 0);
592   memory_configure_bank(m_machine, "bank1", BANK_RAMCARD, 4, ram_get_ptr(m_ram), 0x2000);
584   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(CDP1802_TAG)->base() + 0xc000, 0);
585   memory_configure_bank(machine(), "bank1", BANK_FLOPPY, 1, machine().region("fdc")->base(), 0);
586   memory_configure_bank(machine(), "bank1", BANK_PRINTER_PARALLEL, 1, machine().region("printer")->base(), 0);
587   memory_configure_bank(machine(), "bank1", BANK_PRINTER_PARALLEL_FM, 1, machine().region("printer_fm")->base(), 0);
588   memory_configure_bank(machine(), "bank1", BANK_PRINTER_SERIAL, 1, machine().region("rs232")->base(), 0);
589   memory_configure_bank(machine(), "bank1", BANK_PRINTER_THERMAL, 1, machine().region("thermal")->base(), 0);
590   memory_configure_bank(machine(), "bank1", BANK_JOYCARD, 1, machine().region(CDP1802_TAG)->base(), 0);
591   memory_configure_bank(machine(), "bank1", BANK_80_COLUMNS, 1, machine().region("80column")->base(), 0);
592   memory_configure_bank(machine(), "bank1", BANK_RAMCARD, 4, ram_get_ptr(m_ram), 0x2000);
593593
594   memory_set_bank(m_machine, "bank1", 0);
594   memory_set_bank(machine(), "bank1", 0);
595595
596596   if (!is_expansion_box_installed())
597597   {
r11240r11241
599599   }
600600
601601   /* allocate reset timer */
602   m_reset_timer = m_machine.scheduler().timer_alloc(FUNC(reset_tick));
602   m_reset_timer = machine().scheduler().timer_alloc(FUNC(reset_tick));
603603
604604   /* register for state saving */
605   m_machine.state().register_postload(comx35_state_save_postload, NULL);
606   state_save_register_global(m_machine, m_reset);
607   state_save_register_global(m_machine, m_cdp1802_q);
608   state_save_register_global(m_machine, m_cdp1802_ef4);
609   state_save_register_global(m_machine, m_iden);
610   state_save_register_global(m_machine, m_slot);
611   state_save_register_global(m_machine, m_bank);
612   state_save_register_global(m_machine, m_rambank);
613   state_save_register_global(m_machine, m_dma);
614   state_save_register_global(m_machine, m_fdc_addr);
615   state_save_register_global(m_machine, m_fdc_irq);
616   state_save_register_global(m_machine, m_fdc_drq_enable);
605   machine().state().register_postload(comx35_state_save_postload, NULL);
606   state_save_register_global(machine(), m_reset);
607   state_save_register_global(machine(), m_cdp1802_q);
608   state_save_register_global(machine(), m_cdp1802_ef4);
609   state_save_register_global(machine(), m_iden);
610   state_save_register_global(machine(), m_slot);
611   state_save_register_global(machine(), m_bank);
612   state_save_register_global(machine(), m_rambank);
613   state_save_register_global(machine(), m_dma);
614   state_save_register_global(machine(), m_fdc_addr);
615   state_save_register_global(machine(), m_fdc_irq);
616   state_save_register_global(machine(), m_fdc_drq_enable);
617617}
618618
619619void comx35_state::machine_reset()
src/mess/machine/64h156.c
r11240r11241
180180      if (!m_yb)
181181      {
182182         // simulate weak bits with randomness
183         m_yb = m_machine.rand() & 0xff;
183         m_yb = machine().rand() & 0xff;
184184      }
185185
186186      set_byte_line(byte);
src/mess/machine/gamepock.c
r11240r11241
119119
120120   if ( m_port_a & 0x80 )
121121   {
122      data &= input_port_read(m_machine, "IN0");
122      data &= input_port_read(machine(), "IN0");
123123   }
124124
125125   if ( m_port_a & 0x40 )
126126   {
127      data &= input_port_read(m_machine, "IN1");
127      data &= input_port_read(machine(), "IN1");
128128   }
129129
130130   return data;
src/mess/machine/c1551.c
r11240r11241
496496   m_irq_timer->adjust(attotime::from_hz(120), 0, attotime::from_hz(120));
497497
498498   // map TPI1 to host CPU memory space
499   address_space *program = m_machine.firstcpu->memory().space(AS_PROGRAM);
499   address_space *program = machine().firstcpu->memory().space(AS_PROGRAM);
500500   UINT32 start_address = m_config.m_address ? 0xfec0 : 0xfef0;
501501
502502   program->install_legacy_readwrite_handler(*m_tpi1, start_address, start_address + 7, FUNC(tpi6525_r), FUNC(tpi6525_w));
src/mess/machine/isa_hdc.c
r11240r11241
207207   m_isa->add_isa_card(this, m_config.m_isa_num);
208208   m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, "hdc", "hdc");
209209   m_isa->install_device(this, 0x0320, 0x0323, 0, 0, FUNC(pc_HDC_r), FUNC(pc_HDC_w) );   
210   buffer = auto_alloc_array(m_machine, UINT8, 17*4*512);
211   timer = m_machine.scheduler().timer_alloc(FUNC(pc_hdc_command), this);
210   buffer = auto_alloc_array(machine(), UINT8, 17*4*512);
211   timer = machine().scheduler().timer_alloc(FUNC(pc_hdc_command), this);
212212}
213213
214214//-------------------------------------------------
r11240r11241
251251   switch( id )
252252   {
253253   case 0:
254      img = dynamic_cast<device_image_interface *>(m_machine.device(subtag(tempstring,"primary")));
254      img = dynamic_cast<device_image_interface *>(machine().device(subtag(tempstring,"primary")));
255255      break;
256256   case 1:
257      img = dynamic_cast<device_image_interface *>(m_machine.device(subtag(tempstring,"slave")));
257      img = dynamic_cast<device_image_interface *>(machine().device(subtag(tempstring,"slave")));
258258      break;   
259259   }
260260   if ( img == NULL )
r11240r11241
537537   {
538538      command_name = hdc_command_names[cmd] ? hdc_command_names[cmd] : "Unknown";
539539      logerror("pc_hdc_command(): Executing command; pc=0x%08x cmd=0x%02x (%s) drv=%d\n",
540         (unsigned) cpu_get_reg(m_machine.firstcpu, STATE_GENPC), cmd, command_name, drv);
540         (unsigned) cpu_get_reg(machine().firstcpu, STATE_GENPC), cmd, command_name, drv);
541541   }
542542
543543   switch (cmd)
r11240r11241
575575         if (LOG_HDC_STATUS)
576576         {
577577            logerror("hdc read pc=0x%08x D:%d C:%d H:%d S:%d N:%d CTL:$%02x\n",
578               (unsigned) cpu_get_reg(m_machine.firstcpu, STATE_GENPC), drv, cylinder[drv], head[drv], sector[drv], sector_cnt[drv], control[drv]);
578               (unsigned) cpu_get_reg(machine().firstcpu, STATE_GENPC), drv, cylinder[drv], head[drv], sector[drv], sector_cnt[drv], control[drv]);
579579         }
580580
581581         if (test_ready())
r11240r11241
590590         if (LOG_HDC_STATUS)
591591         {
592592            logerror("hdc write pc=0x%08x  D:%d C:%d H:%d S:%d N:%d CTL:$%02x\n",
593               (unsigned) cpu_get_reg(m_machine.firstcpu, STATE_GENPC), drv, cylinder[drv], head[drv], sector[drv], sector_cnt[drv], control[drv]);
593               (unsigned) cpu_get_reg(machine().firstcpu, STATE_GENPC), drv, cylinder[drv], head[drv], sector[drv], sector_cnt[drv], control[drv]);
594594         }
595595
596596         if (test_ready())
r11240r11241
704704      if (--data_cnt == 0)
705705      {
706706         if (LOG_HDC_STATUS)
707            logerror("pc_hdc_data_w(): Launching command; pc=0x%08x\n", (unsigned) cpu_get_reg(m_machine.firstcpu, STATE_GENPC));
707            logerror("pc_hdc_data_w(): Launching command; pc=0x%08x\n", (unsigned) cpu_get_reg(machine().firstcpu, STATE_GENPC));
708708
709709            status &= ~STA_COMMAND;
710710         status &= ~STA_REQUEST;
r11240r11241
743743void isa8_hdc_device::pc_hdc_control_w(int data)
744744{
745745   if (LOG_HDC_STATUS)
746      logerror("%s: pc_hdc_control_w(): control write %d\n", m_machine.describe_context(), data);
746      logerror("%s: pc_hdc_control_w(): control write %d\n", machine().describe_context(), data);
747747
748748   hdc_control = data;
749749
src/mess/machine/mpc105.c
r11240r11241
144144            |   (((m_bank_registers[(bank / 4) + 6] >> (bank % 4) * 8)) & 0x03) << 28
145145            | 0x000FFFFF;
146146
147         end = MIN(end, begin + ram_get_size(m_machine.device(RAM_TAG)) - 1);
147         end = MIN(end, begin + ram_get_size(machine().device(RAM_TAG)) - 1);
148148
149149         if ((begin + 0x100000) <= end)
150150         {
151151            if (LOG_MPC105)
152               logerror("\tbank #%d [%02d]: 0x%08X - 0x%08X [%p-%p]\n", bank, bank + m_bank_base, begin, end, ram_get_ptr(m_machine.device(RAM_TAG)), ram_get_ptr(m_machine.device(RAM_TAG)) + (end - begin));
152               logerror("\tbank #%d [%02d]: 0x%08X - 0x%08X [%p-%p]\n", bank, bank + m_bank_base, begin, end, ram_get_ptr(machine().device(RAM_TAG)), ram_get_ptr(machine().device(RAM_TAG)) + (end - begin));
153153
154154            if (m_bank_base > 0)
155155            {
156156               sprintf(bank_str,"bank%d",bank + m_bank_base);
157               memory_set_bankptr(m_machine, bank_str, ram_get_ptr(m_machine.device(RAM_TAG)));
157               memory_set_bankptr(machine(), bank_str, ram_get_ptr(machine().device(RAM_TAG)));
158158            }
159159         }
160160      }
src/mess/machine/lux21046.c
r11240r11241
429429     m_maincpu(*this, Z80_TAG),
430430     m_dma(*this, Z80DMA_TAG),
431431     m_fdc(*this, SAB1793_TAG),
432     m_image0(m_machine.device(FLOPPY_0)),
433     m_image1(m_machine.device(FLOPPY_1)),
432     m_image0(machine().device(FLOPPY_0)),
433     m_image1(machine().device(FLOPPY_1)),
434434     m_cs(false),
435435     m_fdc_irq(0),
436436     m_dma_irq(0),
src/mess/machine/super80.c
r11240r11241
159159
160160READ8_MEMBER( super80_state::super80_f2_r )
161161{
162   UINT8 data = input_port_read(m_machine, "DSW") & 0xf0;   // dip switches on pcb
162   UINT8 data = input_port_read(machine(), "DSW") & 0xf0;   // dip switches on pcb
163163   data |= m_cass_data[2];         // bit 0 = output of U1, bit 1 = MDS cass state, bit 2 = current wave_state
164164   data |= 0x08;            // bit 3 - not used
165165   return data;
r11240r11241
179179   UINT8 bits = data ^ m_last_data;
180180   m_shared = data;
181181   speaker_level_w(m_speaker, BIT(data, 3));            /* bit 3 - speaker */
182   if (BIT(bits, 1)) super80_cassette_motor(m_machine, BIT(data, 1));   /* bit 1 - cassette motor */
182   if (BIT(bits, 1)) super80_cassette_motor(machine(), BIT(data, 1));   /* bit 1 - cassette motor */
183183   cassette_output(m_cass, BIT(data, 0) ? -1.0 : +1.0);   /* bit 0 - cass out */
184184
185185   m_last_data = data;
r11240r11241
190190   UINT8 bits = data ^ m_last_data;
191191   m_shared = data | 0x14;
192192   speaker_level_w(m_speaker, BIT(data, 3));            /* bit 3 - speaker */
193   if (BIT(bits, 1)) super80_cassette_motor(m_machine, BIT(data, 1));   /* bit 1 - cassette motor */
193   if (BIT(bits, 1)) super80_cassette_motor(machine(), BIT(data, 1));   /* bit 1 - cassette motor */
194194   cassette_output(m_cass, BIT(data, 0) ? -1.0 : +1.0);   /* bit 0 - cass out */
195195
196196   m_last_data = data;
r11240r11241
201201void super80_state::machine_reset()
202202{
203203   m_shared=0xff;
204   m_machine.scheduler().timer_set(attotime::from_usec(10), FUNC(super80_reset));
205   memory_set_bank(m_machine, "boot", 1);
204   machine().scheduler().timer_set(attotime::from_usec(10), FUNC(super80_reset));
205   memory_set_bank(machine(), "boot", 1);
206206}
207207
208208static void driver_init_common( running_machine &machine )
src/mess/machine/isa.c
r11240r11241
152152{
153153   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
154154   space->install_readwrite_bank(start, end, mask, mirror, tag );
155   memory_set_bankptr(m_machine, tag, data);
155   memory_set_bankptr(machine(), tag, data);
156156}
157157
158158void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, const char *region)
r11240r11241
161161   address_space *space = m_maincpu->memory().space(AS_PROGRAM);   
162162   space->install_read_bank(start, end, mask, mirror, tag);
163163   space->unmap_write(start, end, mask, mirror);     
164   memory_set_bankptr(m_machine, tag, m_machine.region(dev->subtag(tempstring, region))->base());
164   memory_set_bankptr(machine(), tag, machine().region(dev->subtag(tempstring, region))->base());
165165}
166166
167167// interrupt request from isa card
src/mess/machine/lux10828.c
r11240r11241
470470     m_maincpu(*this, Z80_TAG),
471471     m_pio(*this, Z80PIO_TAG),
472472     m_fdc(*this, FD1791_TAG),
473     m_image0(m_machine.device(FLOPPY_0)),
474     m_image1(m_machine.device(FLOPPY_1)),
473     m_image0(machine().device(FLOPPY_0)),
474     m_image1(machine().device(FLOPPY_1)),
475475     m_cs(false),
476476     m_fdc_irq(0),
477477     m_fdc_drq(0),
src/mess/machine/abc77.c
r11240r11241
480480
481481   if (m_keylatch == 1)
482482   {
483      watchdog_reset(m_machine);
483      watchdog_reset(machine());
484484   }
485485
486486   // beep
src/mess/video/vidbrain.c
r11240r11241
333333void vidbrain_state::video_start()
334334{
335335   // register for state saving
336   state_save_register_global_array(m_machine, m_vlsi_ram);
337   state_save_register_global(m_machine, m_y_int);
338   state_save_register_global(m_machine, m_fmod);
339   state_save_register_global(m_machine, m_bg);
340   state_save_register_global(m_machine, m_cmd);
341   state_save_register_global(m_machine, m_freeze_x);
342   state_save_register_global(m_machine, m_freeze_y);
343   state_save_register_global(m_machine, m_field);
336   state_save_register_global_array(machine(), m_vlsi_ram);
337   state_save_register_global(machine(), m_y_int);
338   state_save_register_global(machine(), m_fmod);
339   state_save_register_global(machine(), m_bg);
340   state_save_register_global(machine(), m_cmd);
341   state_save_register_global(machine(), m_freeze_x);
342   state_save_register_global(machine(), m_freeze_y);
343   state_save_register_global(machine(), m_field);
344344}
345345
346346
r11240r11241
354354
355355   if (!(m_cmd & COMMAND_ENB))
356356   {
357      bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
357      bitmap_fill(&bitmap, &cliprect, get_black_pen(machine()));
358358      return 0;
359359   }
360360
src/mess/video/isa_mda.c
r11240r11241
205205void isa8_mda_device::device_start()
206206{       
207207   m_isa->add_isa_card(this, m_config.m_isa_num);
208   videoram = auto_alloc_array(m_machine, UINT8, 0x1000);
208   videoram = auto_alloc_array(machine(), UINT8, 0x1000);
209209   m_isa->install_device(this, 0x3b0, 0x3bf, 0, 0, FUNC(pc_MDA_r), FUNC(pc_MDA_w) );
210210   m_isa->install_bank(0xb0000, 0xb0fff, 0, 0x07000, "bank_mda", videoram);   
211211   
212212   /* Initialise the mda palette */
213213   for(int i = 0; i < (sizeof(mda_palette) / 3); i++)
214      palette_set_color_rgb(m_machine, i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);   
214      palette_set_color_rgb(machine(), i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);   
215215}
216216 
217217//-------------------------------------------------
r11240r11241
227227   hsync = 0;
228228   
229229   astring tempstring;
230   chr_gen = m_machine.region(subtag(tempstring, "gfx1"))->base();   
230   chr_gen = machine().region(subtag(tempstring, "gfx1"))->base();   
231231}
232232
233233/***************************************************************************
r11240r11241
653653 
654654void isa8_hercules_device::device_start()
655655{       
656   videoram = auto_alloc_array(m_machine, UINT8, 0x10000);
656   videoram = auto_alloc_array(machine(), UINT8, 0x10000);
657657
658658   m_isa->install_device(this, 0x3b0, 0x3bf, 0, 0, FUNC(hercules_r), FUNC(hercules_w) );
659659   m_isa->install_bank(0xb0000, 0xbffff, 0, 0, "bank_hercules", videoram);
660660
661661   /* Initialise the mda palette */
662662   for(int i = 0; i < (sizeof(mda_palette) / 3); i++)
663      palette_set_color_rgb(m_machine, i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);   
663      palette_set_color_rgb(machine(), i, mda_palette[i][0], mda_palette[i][1], mda_palette[i][2]);   
664664}
665665 
666666//-------------------------------------------------
r11240r11241
673673   configuration_switch = 0;
674674
675675   astring tempstring;
676   chr_gen = m_machine.region(subtag(tempstring, "gfx1"))->base();   
676   chr_gen = machine().region(subtag(tempstring, "gfx1"))->base();   
677677}
678678
679679/***************************************************************************
src/mess/video/tmc600.c
r11240r11241
114114void tmc600_state::video_start()
115115{
116116   // allocate memory
117   m_color_ram = auto_alloc_array(m_machine, UINT8, TMC600_PAGE_RAM_SIZE);
117   m_color_ram = auto_alloc_array(machine(), UINT8, TMC600_PAGE_RAM_SIZE);
118118
119119   // find memory regions
120   m_char_rom = m_machine.region("chargen")->base();
120   m_char_rom = machine().region("chargen")->base();
121121
122122   // register for state saving
123   state_save_register_global_pointer(m_machine, m_color_ram, TMC600_PAGE_RAM_SIZE);
123   state_save_register_global_pointer(machine(), m_color_ram, TMC600_PAGE_RAM_SIZE);
124124
125   state_save_register_global(m_machine, m_vismac_reg_latch);
126   state_save_register_global(m_machine, m_vismac_color_latch);
127   state_save_register_global(m_machine, m_vismac_bkg_latch);
128   state_save_register_global(m_machine, m_blink);
125   state_save_register_global(machine(), m_vismac_reg_latch);
126   state_save_register_global(machine(), m_vismac_color_latch);
127   state_save_register_global(machine(), m_vismac_bkg_latch);
128   state_save_register_global(machine(), m_blink);
129129}
130130
131131static const gfx_layout tmc600_charlayout =
src/mess/video/advision.c
r11240r11241
2121void advision_state::video_start()
2222{
2323   m_video_hpos = 0;
24   m_display = auto_alloc_array(m_machine, UINT8, 8 * 8 * 256);
24   m_display = auto_alloc_array(machine(), UINT8, 8 * 8 * 256);
2525   memset(m_display, 0, 8 * 8 * 256);
2626}
2727
src/mess/video/abc800.c
r11240r11241
9292void abc800_state::video_start()
9393{
9494   // find memory regions
95   m_char_rom = m_machine.region(MC6845_TAG)->base();
96   m_fgctl_prom = m_machine.region("hru2")->base();
95   m_char_rom = machine().region(MC6845_TAG)->base();
96   m_fgctl_prom = machine().region("hru2")->base();
9797
9898   // register for state saving
99   state_save_register_global(m_machine, m_hrs);
100   state_save_register_global(m_machine, m_fgctl);
99   state_save_register_global(machine(), m_hrs);
100   state_save_register_global(machine(), m_fgctl);
101101}
102102
103103
r11240r11241
108108bool abc800c_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
109109{
110110   // clear screen
111   bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
111   bitmap_fill(&bitmap, &cliprect, get_black_pen(machine()));
112112
113113   // draw HR graphics
114114   hr_update(&bitmap, &cliprect);
r11240r11241
280280   screen.set_visible_area(0, 767, 0, 311);
281281
282282   // clear screen
283   bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
283   bitmap_fill(&bitmap, &cliprect, get_black_pen(machine()));
284284
285285   // draw HR graphics
286286   hr_update(&bitmap, &cliprect);
src/mess/video/abc80.c
r11240r11241
201201void abc80_state::video_start()
202202{
203203   // find memory regions
204   m_char_rom = m_machine.region("chargen")->base();
205   m_hsync_prom = m_machine.region("hsync")->base();
206   m_vsync_prom = m_machine.region("vsync")->base();
207   m_line_prom = m_machine.region("line")->base();
208   m_attr_prom = m_machine.region("attr")->base();
204   m_char_rom = machine().region("chargen")->base();
205   m_hsync_prom = machine().region("hsync")->base();
206   m_vsync_prom = machine().region("vsync")->base();
207   m_line_prom = machine().region("line")->base();
208   m_attr_prom = machine().region("attr")->base();
209209
210210   // register for state saving
211   state_save_register_global(m_machine, m_blink);
212   state_save_register_global(m_machine, m_latch);
211   state_save_register_global(machine(), m_blink);
212   state_save_register_global(machine(), m_latch);
213213}
214214
215215
src/mess/video/atarist.c
r11240r11241
6363   m_shifter_rr[2] <<= 1;
6464   m_shifter_rr[3] <<= 1;
6565
66   return m_machine.pens[color];
66   return machine().pens[color];
6767}
6868
6969
r11240r11241
8787      m_shifter_shift = 0;
8888   }
8989
90   return m_machine.pens[color];
90   return machine().pens[color];
9191}
9292
9393
r11240r11241
124124      break;
125125   }
126126
127   return m_machine.pens[color];
127   return machine().pens[color];
128128}
129129
130130
r11240r11241
134134
135135void st_state::shifter_tick()
136136{
137   int y = m_machine.primary_screen->vpos();
138   int x = m_machine.primary_screen->hpos();
137   int y = machine().primary_screen->vpos();
138   int x = machine().primary_screen->hpos();
139139
140140   pen_t pen;
141141
r11240r11241
154154      break;
155155
156156   default:
157      pen = get_black_pen(m_machine);
157      pen = get_black_pen(machine());
158158      break;
159159   }
160160
161   *BITMAP_ADDR32(m_machine.generic.tmpbitmap, y, x) = pen;
161   *BITMAP_ADDR32(machine().generic.tmpbitmap, y, x) = pen;
162162}
163163
164164
r11240r11241
205205
206206void st_state::glue_tick()
207207{
208   int y = m_machine.primary_screen->vpos();
209   int x = m_machine.primary_screen->hpos();
208   int y = machine().primary_screen->vpos();
209   int x = machine().primary_screen->hpos();
210210
211211   int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end);
212212   int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end);
r11240r11241
242242   {
243243   case 0:
244244      pen = shift_mode_0();
245      *BITMAP_ADDR32(m_machine.generic.tmpbitmap, y, x) = pen;
245      *BITMAP_ADDR32(machine().generic.tmpbitmap, y, x) = pen;
246246      pen = shift_mode_0();
247      *BITMAP_ADDR32(m_machine.generic.tmpbitmap, y, x+1) = pen;
247      *BITMAP_ADDR32(machine().generic.tmpbitmap, y, x+1) = pen;
248248      pen = shift_mode_0();
249      *BITMAP_ADDR32(m_machine.generic.tmpbitmap, y, x+2) = pen;
249      *BITMAP_ADDR32(machine().generic.tmpbitmap, y, x+2) = pen;
250250      pen = shift_mode_0();
251      *BITMAP_ADDR32(m_machine.generic.tmpbitmap, y, x+3) = pen;
251      *BITMAP_ADDR32(machine().generic.tmpbitmap, y, x+3) = pen;
252252      break;
253253
254254   case 1:
r11240r11241
260260      break;
261261
262262   default:
263      pen = get_black_pen(m_machine);
263      pen = get_black_pen(machine());
264264      break;
265265   }
266266}
r11240r11241
438438   m_shifter_palette[offset] = data;
439439   logerror("SHIFTER Palette[%x] = %x\n", offset, data);
440440
441   palette_set_color_rgb(m_machine, offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data));
441   palette_set_color_rgb(machine(), offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data));
442442}
443443
444444
r11240r11241
534534   m_shifter_palette[offset] = data;
535535   logerror("SHIFTER palette %x = %x\n", offset, data);
536536
537   palette_set_color_rgb(m_machine, offset, r, g, b);
537   palette_set_color_rgb(machine(), offset, r, g, b);
538538}
539539
540540
r11240r11241
10581058            m_mfp->i3_w(m_blitter_done);
10591059
10601060            int nops = BLITTER_NOPS[m_blitter_op][m_blitter_hop]; // each NOP takes 4 cycles
1061            m_machine.scheduler().timer_set(attotime::from_hz((Y2/4)/(4*nops)), FUNC(atarist_blitter_tick));
1061            machine().scheduler().timer_set(attotime::from_hz((Y2/4)/(4*nops)), FUNC(atarist_blitter_tick));
10621062         }
10631063      }
10641064   }
r11240r11241
10801080
10811081void st_state::video_start()
10821082{
1083   m_shifter_timer = m_machine.scheduler().timer_alloc(FUNC(atarist_shifter_tick));
1084   m_glue_timer = m_machine.scheduler().timer_alloc(FUNC(atarist_glue_tick));
1083   m_shifter_timer = machine().scheduler().timer_alloc(FUNC(atarist_shifter_tick));
1084   m_glue_timer = machine().scheduler().timer_alloc(FUNC(atarist_glue_tick));
10851085
1086//  m_shifter_timer->adjust(m_machine.primary_screen->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns
1087   m_glue_timer->adjust(m_machine.primary_screen->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns
1086//  m_shifter_timer->adjust(machine().primary_screen->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns
1087   m_glue_timer->adjust(machine().primary_screen->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns
10881088
10891089   /* register for state saving */
1090   state_save_register_global(m_machine, m_shifter_base);
1091   state_save_register_global(m_machine, m_shifter_ofs);
1092   state_save_register_global(m_machine, m_shifter_sync);
1093   state_save_register_global(m_machine, m_shifter_mode);
1094   state_save_register_global_array(m_machine, m_shifter_palette);
1095   state_save_register_global_array(m_machine, m_shifter_rr);
1096   state_save_register_global_array(m_machine, m_shifter_ir);
1097   state_save_register_global(m_machine, m_shifter_bitplane);
1098   state_save_register_global(m_machine, m_shifter_shift);
1099   state_save_register_global(m_machine, m_shifter_h);
1100   state_save_register_global(m_machine, m_shifter_v);
1101   state_save_register_global(m_machine, m_shifter_de);
1090   state_save_register_global(machine(), m_shifter_base);
1091   state_save_register_global(machine(), m_shifter_ofs);
1092   state_save_register_global(machine(), m_shifter_sync);
1093   state_save_register_global(machine(), m_shifter_mode);
1094   state_save_register_global_array(machine(), m_shifter_palette);
1095   state_save_register_global_array(machine(), m_shifter_rr);
1096   state_save_register_global_array(machine(), m_shifter_ir);
1097   state_save_register_global(machine(), m_shifter_bitplane);
1098   state_save_register_global(machine(), m_shifter_shift);
1099   state_save_register_global(machine(), m_shifter_h);
1100   state_save_register_global(machine(), m_shifter_v);
1101   state_save_register_global(machine(), m_shifter_de);
11021102
1103   state_save_register_global_array(m_machine, m_blitter_halftone);
1104   state_save_register_global(m_machine, m_blitter_src_inc_x);
1105   state_save_register_global(m_machine, m_blitter_src_inc_y);
1106   state_save_register_global(m_machine, m_blitter_dst_inc_x);
1107   state_save_register_global(m_machine, m_blitter_dst_inc_y);
1108   state_save_register_global(m_machine, m_blitter_src);
1109   state_save_register_global(m_machine, m_blitter_dst);
1110   state_save_register_global(m_machine, m_blitter_endmask1);
1111   state_save_register_global(m_machine, m_blitter_endmask2);
1112   state_save_register_global(m_machine, m_blitter_endmask3);
1113   state_save_register_global(m_machine, m_blitter_xcount);
1114   state_save_register_global(m_machine, m_blitter_ycount);
1115   state_save_register_global(m_machine, m_blitter_xcountl);
1116   state_save_register_global(m_machine, m_blitter_hop);
1117   state_save_register_global(m_machine, m_blitter_op);
1118   state_save_register_global(m_machine, m_blitter_ctrl);
1119   state_save_register_global(m_machine, m_blitter_skew);
1103   state_save_register_global_array(machine(), m_blitter_halftone);
1104   state_save_register_global(machine(), m_blitter_src_inc_x);
1105   state_save_register_global(machine(), m_blitter_src_inc_y);
1106   state_save_register_global(machine(), m_blitter_dst_inc_x);
1107   state_save_register_global(machine(), m_blitter_dst_inc_y);
1108   state_save_register_global(machine(), m_blitter_src);
1109   state_save_register_global(machine(), m_blitter_dst);
1110   state_save_register_global(machine(), m_blitter_endmask1);
1111   state_save_register_global(machine(), m_blitter_endmask2);
1112   state_save_register_global(machine(), m_blitter_endmask3);
1113   state_save_register_global(machine(), m_blitter_xcount);
1114   state_save_register_global(machine(), m_blitter_ycount);
1115   state_save_register_global(machine(), m_blitter_xcountl);
1116   state_save_register_global(machine(), m_blitter_hop);
1117   state_save_register_global(machine(), m_blitter_op);
1118   state_save_register_global(machine(), m_blitter_ctrl);
1119   state_save_register_global(machine(), m_blitter_skew);
11201120
11211121   set_screen_parameters();
11221122
1123   VIDEO_START_NAME(generic_bitmapped)(m_machine);
1123   VIDEO_START_NAME(generic_bitmapped)(machine());
11241124}
11251125
11261126
r11240r11241
11331133   st_state::video_start();
11341134
11351135   // register for state saving
1136   state_save_register_global(m_machine, m_shifter_lineofs);
1137   state_save_register_global(m_machine, m_shifter_pixelofs);
1136   state_save_register_global(machine(), m_shifter_lineofs);
1137   state_save_register_global(machine(), m_shifter_pixelofs);
11381138}
src/mess/video/pc4.c
r11240r11241
3333                  else
3434                  {
3535                     //draw CGROM characters
36                     *BITMAP_ADDR16(&bitmap, l*9 + y, i*6 + x) = BIT(m_machine.region("charset")->base()[m_ddram[char_pos]*8+y], 4-x);
36                     *BITMAP_ADDR16(&bitmap, l*9 + y, i*6 + x) = BIT(machine().region("charset")->base()[m_ddram[char_pos]*8+y], 4-x);
3737
3838                  }
3939
src/mess/video/osi.c
r11240r11241
2828   /* randomize video memory contents */
2929   for (addr = 0; addr < OSI600_VIDEORAM_SIZE; addr++)
3030   {
31      m_video_ram[addr] = m_machine.rand() & 0xff;
31      m_video_ram[addr] = machine().rand() & 0xff;
3232   }
3333
3434   /* randomize color memory contents */
r11240r11241
3636   {
3737      for (addr = 0; addr < OSI630_COLORRAM_SIZE; addr++)
3838      {
39         m_color_ram[addr] = m_machine.rand() & 0x0f;
39         m_color_ram[addr] = machine().rand() & 0x0f;
4040      }
4141   }
4242}
r11240r11241
5959         {
6060            UINT8 videoram_data = m_video_ram[videoram_addr];
6161            UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff;
62            UINT8 charrom_data = m_machine.region("chargen")->base()[charrom_addr];
62            UINT8 charrom_data = machine().region("chargen")->base()[charrom_addr];
6363
6464            for (bit = 0; bit < 8; bit++)
6565            {
r11240r11241
9292         {
9393            UINT8 videoram_data = m_video_ram[videoram_addr];
9494            UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff;
95            UINT8 charrom_data = m_machine.region("chargen")->base()[charrom_addr];
95            UINT8 charrom_data = machine().region("chargen")->base()[charrom_addr];
9696
9797            for (bit = 0; bit < 8; bit++)
9898            {
r11240r11241
132132      {
133133         UINT8 videoram_data = m_video_ram[videoram_addr++];
134134         UINT16 charrom_addr = ((videoram_data << 3) | line) & 0x7ff;
135         UINT8 charrom_data = m_machine.region("chargen")->base()[charrom_addr];
135         UINT8 charrom_data = machine().region("chargen")->base()[charrom_addr];
136136
137137         for (bit = 0; bit < 8; bit++)
138138         {
src/mess/video/upd7220.c
r11240r11241
774774    devcb_resolve_write_line(&m_out_blank_func, &m_config.m_out_blank_func, this);
775775
776776   // find screen
777   m_screen = m_machine.device<screen_device>(m_config.m_screen_tag);
777   m_screen = machine().device<screen_device>(m_config.m_screen_tag);
778778
779779   // register for state saving
780780   save_item(NAME(m_ra));
r11240r11241
15891589
15901590void upd7220_device::draw_graphics_line(bitmap_t *bitmap, UINT32 addr, int y, int wd)
15911591{
1592   address_space *space = m_machine.device("maincpu")->memory().space(AS_PROGRAM);
1592   address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
15931593   int sx;
15941594
15951595   for (sx = 0; sx < m_pitch * 2; sx++)
src/mess/video/v1050.c
r11240r11241
123123void v1050_state::video_start()
124124{
125125   /* allocate memory */
126   m_attr_ram = auto_alloc_array(m_machine, UINT8, V1050_VIDEORAM_SIZE);
126   m_attr_ram = auto_alloc_array(machine(), UINT8, V1050_VIDEORAM_SIZE);
127127
128128   /* register for state saving */
129   state_save_register_global(m_machine, m_attr);
130   state_save_register_global_pointer(m_machine, m_attr_ram, V1050_VIDEORAM_SIZE);
129   state_save_register_global(machine(), m_attr);
130   state_save_register_global_pointer(machine(), m_attr_ram, V1050_VIDEORAM_SIZE);
131131}
132132
133133/* Video Update */
src/mess/video/cgc7900.c
r11240r11241
101101      UINT8 g = (data >> 8) & 0xff;
102102      UINT8 r = (data >> 16) & 0xff;
103103
104      palette_set_color_rgb(m_machine, i + 8, r, g, b);
104      palette_set_color_rgb(machine(), i + 8, r, g, b);
105105   }
106106}
107107
r11240r11241
191191void cgc7900_state::video_start()
192192{
193193   /* find memory regions */
194   m_char_rom = m_machine.region("gfx1")->base();
194   m_char_rom = machine().region("gfx1")->base();
195195}
196196
197197/*-------------------------------------------------
src/mess/video/zx8301.c
r11240r11241
173173void zx8301_device::device_start()
174174{
175175   // get the CPU
176   m_cpu = m_machine.device<cpu_device>(m_config.cpu_tag);
176   m_cpu = machine().device<cpu_device>(m_config.cpu_tag);
177177   assert(m_cpu != NULL);
178178
179179   // get the screen device
180   m_screen = m_machine.device<screen_device>(m_config.screen_tag);
180   m_screen = machine().device<screen_device>(m_config.screen_tag);
181181   assert(m_screen != NULL);
182182
183183   // resolve callbacks
r11240r11241
380380   }
381381   else
382382   {
383      bitmap_fill(bitmap, cliprect, get_black_pen(m_machine));
383      bitmap_fill(bitmap, cliprect, get_black_pen(machine()));
384384   }
385385}
src/mess/video/fmtowns.c
r11240r11241
17901790{
17911791   m_video.towns_vram_wplane = 0x00;
17921792   m_video.towns_sprite_page = 0;
1793   m_video.sprite_timer = m_machine.scheduler().timer_alloc(FUNC(towns_sprite_done));
1793   m_video.sprite_timer = machine().scheduler().timer_alloc(FUNC(towns_sprite_done));
17941794}
17951795
17961796bool towns_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/video/newbrain.c
r11240r11241
44void newbrain_state::video_start()
55{
66   /* find memory regions */
7   m_char_rom = m_machine.region("chargen")->base();
7   m_char_rom = machine().region("chargen")->base();
88
99   /* register for state saving */
1010   save_item(NAME(m_tvcnsl));
r11240r11241
109109   }
110110   else
111111   {
112      bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
112      bitmap_fill(&bitmap, &cliprect, get_black_pen(machine()));
113113   }
114114
115115   return 0;
src/mess/video/ef9345.c
r11240r11241
169169
170170void ef9345_device::device_start()
171171{
172   m_screen = m_machine.device<screen_device>(m_config.screen_tag);
172   m_screen = machine().device<screen_device>(m_config.screen_tag);
173173
174174   assert(m_screen != NULL);
175175
r11240r11241
179179   m_videoram = space(0);
180180   m_charset = region();
181181
182   m_screen_out = auto_bitmap_alloc(m_machine, 496, m_screen->height() , BITMAP_FORMAT_INDEXED16);
182   m_screen_out = auto_bitmap_alloc(machine(), 496, m_screen->height() , BITMAP_FORMAT_INDEXED16);
183183
184184   m_blink_timer->adjust(attotime::from_msec(500), 0, attotime::from_msec(500));
185185
src/mess/video/comx35.c
r11240r11241
102102void comx35_state::video_start()
103103{
104104   // allocate memory
105   m_charram = auto_alloc_array(m_machine, UINT8, COMX35_CHARRAM_SIZE);
106   m_videoram = auto_alloc_array(m_machine, UINT8, COMX35_VIDEORAM_SIZE);
105   m_charram = auto_alloc_array(machine(), UINT8, COMX35_CHARRAM_SIZE);
106   m_videoram = auto_alloc_array(machine(), UINT8, COMX35_VIDEORAM_SIZE);
107107
108108   // register for save state
109   state_save_register_global_pointer(m_machine, m_charram, COMX35_CHARRAM_SIZE);
110   state_save_register_global_pointer(m_machine, m_videoram, COMX35_VIDEORAM_SIZE);
109   state_save_register_global_pointer(machine(), m_charram, COMX35_CHARRAM_SIZE);
110   state_save_register_global_pointer(machine(), m_videoram, COMX35_VIDEORAM_SIZE);
111111}
112112
113113bool comx35_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/video/abc802.c
r11240r11241
209209void abc802_state::video_start()
210210{
211211   // find memory regions
212   m_char_rom = m_machine.region(MC6845_TAG)->base();
212   m_char_rom = machine().region(MC6845_TAG)->base();
213213
214214   // register for state saving
215   state_save_register_global(m_machine, m_flshclk_ctr);
216   state_save_register_global(m_machine, m_flshclk);
217   state_save_register_global(m_machine, m_80_40_mux);
215   state_save_register_global(machine(), m_flshclk_ctr);
216   state_save_register_global(machine(), m_flshclk);
217   state_save_register_global(machine(), m_80_40_mux);
218218}
219219
220220
src/mess/video/abc806.c
r11240r11241
473473   m_40 = 1;
474474
475475   // find memory regions
476   m_char_rom = m_machine.region(MC6845_TAG)->base();
477   m_rad_prom = m_machine.region("rad")->base();
478   m_hru2_prom = m_machine.region("hru2")->base();
476   m_char_rom = machine().region(MC6845_TAG)->base();
477   m_rad_prom = machine().region("rad")->base();
478   m_hru2_prom = machine().region("hru2")->base();
479479
480480   // allocate memory
481   m_char_ram = auto_alloc_array(m_machine, UINT8, ABC806_CHAR_RAM_SIZE);
482   m_color_ram = auto_alloc_array(m_machine, UINT8, ABC806_ATTR_RAM_SIZE);
481   m_char_ram = auto_alloc_array(machine(), UINT8, ABC806_CHAR_RAM_SIZE);
482   m_color_ram = auto_alloc_array(machine(), UINT8, ABC806_ATTR_RAM_SIZE);
483483
484484   // register for state saving
485   state_save_register_global_pointer(m_machine, m_char_ram, ABC806_CHAR_RAM_SIZE);
486   state_save_register_global_pointer(m_machine, m_color_ram, ABC806_ATTR_RAM_SIZE);
487   state_save_register_global_pointer(m_machine, m_video_ram, ABC806_VIDEO_RAM_SIZE);
488   state_save_register_global(m_machine, m_txoff);
489   state_save_register_global(m_machine, m_40);
490   state_save_register_global(m_machine, m_flshclk_ctr);
491   state_save_register_global(m_machine, m_flshclk);
492   state_save_register_global(m_machine, m_attr_data);
493   state_save_register_global(m_machine, m_hrs);
494   state_save_register_global_array(m_machine, m_hrc);
495   state_save_register_global(m_machine, m_sync);
496   state_save_register_global(m_machine, m_v50_addr);
497   state_save_register_global(m_machine, m_hru2_a8);
498   state_save_register_global(m_machine, m_vsync_shift);
499   state_save_register_global(m_machine, m_vsync);
500   state_save_register_global(m_machine, m_d_vsync);
485   state_save_register_global_pointer(machine(), m_char_ram, ABC806_CHAR_RAM_SIZE);
486   state_save_register_global_pointer(machine(), m_color_ram, ABC806_ATTR_RAM_SIZE);
487   state_save_register_global_pointer(machine(), m_video_ram, ABC806_VIDEO_RAM_SIZE);
488   state_save_register_global(machine(), m_txoff);
489   state_save_register_global(machine(), m_40);
490   state_save_register_global(machine(), m_flshclk_ctr);
491   state_save_register_global(machine(), m_flshclk);
492   state_save_register_global(machine(), m_attr_data);
493   state_save_register_global(machine(), m_hrs);
494   state_save_register_global_array(machine(), m_hrc);
495   state_save_register_global(machine(), m_sync);
496   state_save_register_global(machine(), m_v50_addr);
497   state_save_register_global(machine(), m_hru2_a8);
498   state_save_register_global(machine(), m_vsync_shift);
499   state_save_register_global(machine(), m_vsync);
500   state_save_register_global(machine(), m_d_vsync);
501501}
502502
503503
src/mess/video/abc1600.c
r11240r11241
10111011void abc1600_state::video_start()
10121012{
10131013   // allocate video RAM
1014   m_video_ram = auto_alloc_array(m_machine, UINT16, VIDEORAM_SIZE);
1014   m_video_ram = auto_alloc_array(machine(), UINT16, VIDEORAM_SIZE);
10151015   
10161016   // find memory regions
1017   m_wrmsk_rom = m_machine.region("wrmsk")->base();
1018   m_shinf_rom = m_machine.region("shinf")->base();
1019   m_drmsk_rom = m_machine.region("drmsk")->base();
1017   m_wrmsk_rom = machine().region("wrmsk")->base();
1018   m_shinf_rom = machine().region("shinf")->base();
1019   m_drmsk_rom = machine().region("drmsk")->base();
10201020
10211021   // state saving
10221022   save_pointer(NAME(m_video_ram), VIDEORAM_SIZE);
r11240r11241
10591059   }
10601060   else
10611061   {
1062      bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
1062      bitmap_fill(&bitmap, &cliprect, get_black_pen(machine()));
10631063   }
10641064
10651065   return 0;
src/mess/video/ibm_vga.c
r11240r11241
323323{
324324   int buswidth;
325325   astring tempstring;
326   address_space *spaceio = m_machine.firstcpu->memory().space(AS_IO);
327   address_space *space = m_machine.firstcpu->memory().space(AS_PROGRAM);
328   space->install_rom(0xc0000, 0xc5fff, m_machine.region(subtag(tempstring, "vga"))->base());
329   buswidth = m_machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
326   address_space *spaceio = machine().firstcpu->memory().space(AS_IO);
327   address_space *space = machine().firstcpu->memory().space(AS_PROGRAM);
328   space->install_rom(0xc0000, 0xc5fff, machine().region(subtag(tempstring, "vga"))->base());
329   buswidth = machine().firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
330330   switch(buswidth)
331331   {
332332      case 8:
r11240r11241
351351         fatalerror("VGA: Bus width %d not supported", buswidth);
352352         break;
353353   }
354   m_videoram = auto_alloc_array(m_machine, UINT8, 0x40000);
354   m_videoram = auto_alloc_array(machine(), UINT8, 0x40000);
355355   space->install_readwrite_bank(0xa0000, 0xbffff, "vga_bank" );
356   memory_set_bankptr(m_machine,"vga_bank", m_videoram);
356   memory_set_bankptr(machine(),"vga_bank", m_videoram);
357357}
358358
359359/*-------------------------------------------------
r11240r11241
383383   memset(m_dac_color,0,sizeof(m_dac_color));
384384
385385   for (int i = 0; i < 0x100; i++)   
386      palette_set_color_rgb(m_machine, i, 0, 0, 0);   
386      palette_set_color_rgb(machine(), i, 0, 0, 0);   
387387}
src/mess/includes/gmaster.h
r11240r11241
2424      : driver_device(machine, config) { }
2525
2626   GMASTER_VIDEO m_video;
27   GMASTER_MACHINE m_machine;
27   GMASTER_MACHINE m_gmachine;
2828};
2929
3030
src/mess/drivers/vip.c
r11240r11241
440440
441441bool vip_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
442442{
443   switch (input_port_read(m_machine, "VIDEO"))
443   switch (input_port_read(machine(), "VIDEO"))
444444   {
445445   case VIDEO_CDP1861:
446446      m_vdc->update_screen(&bitmap, &cliprect);
r11240r11241
458458
459459READ_LINE_MEMBER( vip_state::clear_r )
460460{
461   return BIT(input_port_read(m_machine, "RUN"), 0);
461   return BIT(input_port_read(machine(), "RUN"), 0);
462462}
463463
464464READ_LINE_MEMBER( vip_state::ef2_r )
465465{
466   set_led_status(m_machine, LED_TAPE, (cassette_input(m_cassette) > 0));
466   set_led_status(machine(), LED_TAPE, (cassette_input(m_cassette) > 0));
467467
468468   return cassette_input(m_cassette) < 0;
469469}
470470
471471READ_LINE_MEMBER( vip_state::ef3_r )
472472{
473   return BIT(input_port_read(m_machine, "KEYPAD"), m_keylatch);
473   return BIT(input_port_read(machine(), "KEYPAD"), m_keylatch);
474474}
475475
476476READ_LINE_MEMBER( vip_state::ef4_r )
477477{
478   switch (input_port_read(m_machine, "KEYBOARD"))
478   switch (input_port_read(machine(), "KEYBOARD"))
479479   {
480480   case KEYBOARD_VP580:
481      return BIT(input_port_read(m_machine, "VP-580"), m_keylatch);
481      return BIT(input_port_read(machine(), "VP-580"), m_keylatch);
482482   }
483483
484484   return 0;
r11240r11241
501501WRITE_LINE_MEMBER( vip_state::q_w )
502502{
503503   // sound output
504   switch (input_port_read(m_machine, "SOUND"))
504   switch (input_port_read(machine(), "SOUND"))
505505   {
506506   case SOUND_SPEAKER:
507507      discrete_sound_w(m_beeper, NODE_01, state);
r11240r11241
524524   }
525525
526526   // Q led
527   set_led_status(m_machine, LED_Q, state);
527   set_led_status(machine(), LED_Q, state);
528528
529529   // tape output
530530   cassette_output(m_cassette, state ? 1.0 : -1.0);
r11240r11241
532532
533533WRITE8_MEMBER( vip_state::dma_w )
534534{
535   switch (input_port_read(m_machine, "VIDEO"))
535   switch (input_port_read(machine(), "VIDEO"))
536536   {
537537   case VIDEO_CDP1861:
538538      m_vdc->dma_w(space, offset, data);
r11240r11241
581581   /* randomize RAM contents */
582582   for (UINT16 addr = 0; addr < ram_get_size(m_ram); addr++)
583583   {
584      ram[addr] = m_machine.rand() & 0xff;
584      ram[addr] = machine().rand() & 0xff;
585585   }
586586
587587   /* allocate color RAM */
588   m_colorram = auto_alloc_array(m_machine, UINT8, VP590_COLOR_RAM_SIZE);
588   m_colorram = auto_alloc_array(machine(), UINT8, VP590_COLOR_RAM_SIZE);
589589
590590   /* enable power LED */
591   set_led_status(m_machine, LED_POWER, 1);
591   set_led_status(machine(), LED_POWER, 1);
592592
593593   /* reset sound */
594594   discrete_sound_w(m_beeper, NODE_01, 0);
r11240r11241
597597   vp550_q_w(m_vp551, 0);
598598
599599   /* register for state saving */
600   state_save_register_global_pointer(m_machine, m_colorram, VP590_COLOR_RAM_SIZE);
601   state_save_register_global(m_machine, m_color);
602   state_save_register_global(m_machine, m_keylatch);
600   state_save_register_global_pointer(machine(), m_colorram, VP590_COLOR_RAM_SIZE);
601   state_save_register_global(machine(), m_color);
602   state_save_register_global(machine(), m_keylatch);
603603}
604604
605605void vip_state::machine_reset()
r11240r11241
617617   m_vp551->reset();
618618
619619   /* configure video */
620   switch (input_port_read(m_machine, "VIDEO"))
620   switch (input_port_read(machine(), "VIDEO"))
621621   {
622622   case VIDEO_CDP1861:
623623      io->unmap_write(0x05, 0x05);
r11240r11241
631631   }
632632
633633   /* configure audio */
634   switch (input_port_read(m_machine, "SOUND"))
634   switch (input_port_read(machine(), "SOUND"))
635635   {
636636   case SOUND_SPEAKER:
637637      vp595_install_write_handlers(m_vp595, io, 0);
r11240r11241
659659   }
660660
661661   /* enable ROM all thru address space */
662   program->install_rom(0x0000, 0x01ff, 0, 0xfe00, m_machine.region(CDP1802_TAG)->base());
662   program->install_rom(0x0000, 0x01ff, 0, 0xfe00, machine().region(CDP1802_TAG)->base());
663663}
664664
665665/* Machine Drivers */
src/mess/drivers/plan80.c
r11240r11241
4747   UINT8 data = 0xff;
4848
4949   if (m_kbd_row == 0xfe)
50      data = input_port_read(m_machine, "LINE0");
50      data = input_port_read(machine(), "LINE0");
5151   else
5252   if (m_kbd_row == 0xfd)
53      data = input_port_read(m_machine, "LINE1");
53      data = input_port_read(machine(), "LINE1");
5454   else
5555   if (m_kbd_row == 0xfb)
56      data = input_port_read(m_machine, "LINE2");
56      data = input_port_read(machine(), "LINE2");
5757   else
5858   if (m_kbd_row == 0xf7)
59      data = input_port_read(m_machine, "LINE3");
59      data = input_port_read(machine(), "LINE3");
6060   else
6161   if (m_kbd_row == 0xef)
62      data = input_port_read(m_machine, "LINE4");
62      data = input_port_read(machine(), "LINE4");
6363
6464   return data;
6565}
src/mess/drivers/pb1000.c
r11240r11241
304304   m_gatearray[offset] = data&0xff;
305305
306306   if (m_gatearray[0])
307      memory_set_bankptr(m_machine, "bank1", m_machine.region("card1")->base());
307      memory_set_bankptr(machine(), "bank1", machine().region("card1")->base());
308308   else if (m_gatearray[1])
309      memory_set_bankptr(m_machine, "bank1", m_machine.region("card2")->base());
309      memory_set_bankptr(machine(), "bank1", machine().region("card2")->base());
310310   else
311      memory_set_bankptr(m_machine, "bank1", m_machine.region("rom")->base());
311      memory_set_bankptr(machine(), "bank1", machine().region("rom")->base());
312312}
313313
314314bool pb1000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
r11240r11241
495495
496496void pb1000_state::machine_start()
497497{
498   memory_set_bankptr(m_machine, "bank1", m_machine.region("rom")->base());
498   memory_set_bankptr(machine(), "bank1", machine().region("rom")->base());
499499
500   m_kb_timer = m_machine.scheduler().timer_alloc(FUNC(keyboard_timer));
500   m_kb_timer = machine().scheduler().timer_alloc(FUNC(keyboard_timer));
501501   m_kb_timer->adjust(attotime::from_hz(192), 0, attotime::from_hz(192));
502502}
503503
src/mess/drivers/elf.c
r11240r11241
1616#include "elf2.lh"
1717
1818#define RUN   \
19   BIT(input_port_read(m_machine, "SPECIAL"), 0)
19   BIT(input_port_read(machine(), "SPECIAL"), 0)
2020
2121#define LOAD \
22   BIT(input_port_read(m_machine, "SPECIAL"), 1)
22   BIT(input_port_read(machine(), "SPECIAL"), 1)
2323
2424#define MEMORY_PROTECT \
25   BIT(input_port_read(m_machine, "SPECIAL"), 2)
25   BIT(input_port_read(machine(), "SPECIAL"), 2)
2626
2727#define INPUT \
28   BIT(input_port_read(m_machine, "SPECIAL"), 3)
28   BIT(input_port_read(machine(), "SPECIAL"), 3)
2929
3030/* Read/Write Handlers */
3131
r11240r11241
254254   /* setup memory banking */
255255   program->install_read_bank(0x0000, 0x00ff, "bank1");
256256   program->install_write_handler(0x0000, 0x00ff, write8_delegate(FUNC(elf2_state::memory_w), this));
257   memory_configure_bank(m_machine, "bank1", 0, 1, ram_get_ptr(m_ram), 0);
258   memory_set_bank(m_machine, "bank1", 0);
257   memory_configure_bank(machine(), "bank1", 0, 1, ram_get_ptr(m_ram), 0);
258   memory_set_bank(machine(), "bank1", 0);
259259
260260   /* register for state saving */
261261   save_item(NAME(m_data));
src/mess/drivers/pc8401a.c
r11240r11241
4242   /* scan keyboard */
4343   for (row = 0; row < 10; row++)
4444   {
45      UINT8 data = input_port_read(m_machine, keynames[row]);
45      UINT8 data = input_port_read(machine(), keynames[row]);
4646
4747      if (data != 0xff)
4848      {
r11240r11241
8686         /* internal ROM */
8787         program->install_read_bank(0x0000, 0x7fff, "bank1");
8888         program->unmap_write(0x0000, 0x7fff);
89         memory_set_bank(m_machine, "bank1", rombank);
89         memory_set_bank(machine(), "bank1", rombank);
9090      }
9191      else
9292      {
r11240r11241
9898
9999   case 1: /* RAM 0000H to 7FFFH */
100100      program->install_readwrite_bank(0x0000, 0x7fff, "bank1");
101      memory_set_bank(m_machine, "bank1", 4);
101      memory_set_bank(machine(), "bank1", 4);
102102      //logerror("0x0000-0x7fff = RAM 0-7fff\n");
103103      break;
104104
105105   case 2:   /* RAM 8000H to FFFFH */
106106      program->install_readwrite_bank(0x0000, 0x7fff, "bank1");
107      memory_set_bank(m_machine, "bank1", 5);
107      memory_set_bank(machine(), "bank1", 5);
108108      //logerror("0x0000-0x7fff = RAM 8000-ffff\n");
109109      break;
110110
r11240r11241
117117   {
118118   case 0: /* cell addresses 0000H to 3FFFH */
119119      program->install_readwrite_bank(0x8000, 0xbfff, "bank3");
120      memory_set_bank(m_machine, "bank3", 0);
120      memory_set_bank(machine(), "bank3", 0);
121121      //logerror("0x8000-0xbfff = RAM 0-3fff\n");
122122      break;
123123
124124   case 1: /* cell addresses 4000H to 7FFFH */
125125      program->install_readwrite_bank(0x8000, 0xbfff, "bank3");
126      memory_set_bank(m_machine, "bank3", 1);
126      memory_set_bank(machine(), "bank3", 1);
127127      //logerror("0x8000-0xbfff = RAM 4000-7fff\n");
128128      break;
129129
130130   case 2: /* cell addresses 8000H to BFFFH */
131131      program->install_readwrite_bank(0x8000, 0xbfff, "bank3");
132      memory_set_bank(m_machine, "bank3", 2);
132      memory_set_bank(machine(), "bank3", 2);
133133      //logerror("0x8000-0xbfff = RAM 8000-bfff\n");
134134      break;
135135
r11240r11241
137137      if (ram_get_size(m_ram) > 64)
138138      {
139139         program->install_readwrite_bank(0x8000, 0xbfff, "bank3");
140         memory_set_bank(m_machine, "bank3", 3); // TODO or 4
140         memory_set_bank(machine(), "bank3", 3); // TODO or 4
141141      }
142142      else
143143      {
r11240r11241
152152      /* CRT video RAM */
153153      program->install_readwrite_bank(0xc000, 0xdfff, "bank4");
154154      program->unmap_readwrite(0xe000, 0xe7ff);
155      memory_set_bank(m_machine, "bank4", 1);
155      memory_set_bank(machine(), "bank4", 1);
156156      //logerror("0xc000-0xdfff = video RAM\n");
157157   }
158158   else
159159   {
160160      /* RAM */
161161      program->install_readwrite_bank(0xc000, 0xe7ff, "bank4");
162      memory_set_bank(m_machine, "bank4", 0);
162      memory_set_bank(machine(), "bank4", 0);
163163      //logerror("0xc000-0e7fff = RAM c000-e7fff\n");
164164   }
165165}
r11240r11241
261261
262262READ8_MEMBER( pc8401a_state::io_rom_data_r )
263263{
264   UINT8 *iorom = m_machine.region("iorom")->base();
264   UINT8 *iorom = machine().region("iorom")->base();
265265
266266   //logerror("I/O ROM read from %05x\n", m_io_addr);
267267
r11240r11241
491491   m_rtc->cs_w(1);
492492
493493   /* allocate CRT video RAM */
494   m_crt_ram = auto_alloc_array(m_machine, UINT8, PC8401A_CRT_VIDEORAM_SIZE);
494   m_crt_ram = auto_alloc_array(machine(), UINT8, PC8401A_CRT_VIDEORAM_SIZE);
495495
496496   UINT8 *ram = ram_get_ptr(m_ram);
497497
498498   /* set up A0/A1 memory banking */
499   memory_configure_bank(m_machine, "bank1", 0, 4, m_machine.region(Z80_TAG)->base(), 0x8000);
500   memory_configure_bank(m_machine, "bank1", 4, 2, ram, 0x8000);
501   memory_set_bank(m_machine, "bank1", 0);
499   memory_configure_bank(machine(), "bank1", 0, 4, machine().region(Z80_TAG)->base(), 0x8000);
500   memory_configure_bank(machine(), "bank1", 4, 2, ram, 0x8000);
501   memory_set_bank(machine(), "bank1", 0);
502502
503503   /* set up A2 memory banking */
504   memory_configure_bank(m_machine, "bank3", 0, 5, ram, 0x4000);
505   memory_set_bank(m_machine, "bank3", 0);
504   memory_configure_bank(machine(), "bank3", 0, 5, ram, 0x4000);
505   memory_set_bank(machine(), "bank3", 0);
506506
507507   /* set up A3 memory banking */
508   memory_configure_bank(m_machine, "bank4", 0, 1, ram + 0xc000, 0);
509   memory_configure_bank(m_machine, "bank4", 1, 1, m_crt_ram, 0);
510   memory_set_bank(m_machine, "bank4", 0);
508   memory_configure_bank(machine(), "bank4", 0, 1, ram + 0xc000, 0);
509   memory_configure_bank(machine(), "bank4", 1, 1, m_crt_ram, 0);
510   memory_set_bank(machine(), "bank4", 0);
511511
512512   /* set up A4 memory banking */
513   memory_configure_bank(m_machine, "bank5", 0, 1, ram + 0xe800, 0);
514   memory_set_bank(m_machine, "bank5", 0);
513   memory_configure_bank(machine(), "bank5", 0, 1, ram + 0xe800, 0);
514   memory_set_bank(machine(), "bank5", 0);
515515
516516   /* bank switch */
517517   bankswitch(0);
src/mess/drivers/pc9801.c
r11240r11241
309309{
310310   //pc9801_state *state = machine.driver_data<pc9801_state>();
311311
312   m_tvram = auto_alloc_array(m_machine, UINT8, 0x4000);
312   m_tvram = auto_alloc_array(machine(), UINT8, 0x4000);
313313
314314   // find memory regions
315   m_char_rom = m_machine.region("chargen")->base();
315   m_char_rom = machine().region("chargen")->base();
316316
317   VIDEO_START_NAME(generic_bitmapped)(m_machine);
317   VIDEO_START_NAME(generic_bitmapped)(machine());
318318}
319319
320320bool pc9801_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/drivers/tec1.c
r11240r11241
132132
133133READ8_MEMBER( tec1_state::tec1_kbd_r )
134134{
135   cputag_set_input_line(m_machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
135   cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
136136   return m_kbd;
137137}
138138
r11240r11241
207207
208208MACHINE_START_MEMBER( tec1_state )
209209{
210   m_kbd_timer = m_machine.scheduler().timer_alloc(FUNC(tec1_kbd_callback));
210   m_kbd_timer = machine().scheduler().timer_alloc(FUNC(tec1_kbd_callback));
211211   m_kbd_timer->adjust( attotime::zero, 0, attotime::from_hz(500) );
212212}
213213
src/mess/drivers/mc1000.c
r11240r11241
2929   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
3030
3131   /* MC6845 video RAM */
32   memory_set_bank(m_machine, "bank2", m_mc6845_bank);
32   memory_set_bank(machine(), "bank2", m_mc6845_bank);
3333
3434   /* extended RAM */
3535   if (ram_get_size(m_ram) > 16*1024)
r11240r11241
5858      program->install_readwrite_bank(0x8000, 0x97ff, "bank4");
5959   }
6060
61   memory_set_bank(m_machine, "bank4", m_mc6847_bank);
61   memory_set_bank(machine(), "bank4", m_mc6847_bank);
6262
6363   /* extended RAM */
6464   if (ram_get_size(m_ram) > 16*1024)
r11240r11241
297297
298298   if (!BIT(m_keylatch, 0))
299299   {
300      data &= input_port_read(m_machine, "ROW0");
301      if (input_port_read(m_machine, "JOYBKEYMAP")) data &= input_port_read(m_machine, "JOYB");
300      data &= input_port_read(machine(), "ROW0");
301      if (input_port_read(machine(), "JOYBKEYMAP")) data &= input_port_read(machine(), "JOYB");
302302   }
303303   if (!BIT(m_keylatch, 1))
304304   {
305      data &= input_port_read(m_machine, "ROW1");
306      if (input_port_read(m_machine, "JOYAKEYMAP")) data &= input_port_read(m_machine, "JOYA");
305      data &= input_port_read(machine(), "ROW1");
306      if (input_port_read(machine(), "JOYAKEYMAP")) data &= input_port_read(machine(), "JOYA");
307307   }
308   if (!BIT(m_keylatch, 2)) data &= input_port_read(m_machine, "ROW2");
309   if (!BIT(m_keylatch, 3)) data &= input_port_read(m_machine, "ROW3");
310   if (!BIT(m_keylatch, 4)) data &= input_port_read(m_machine, "ROW4");
311   if (!BIT(m_keylatch, 5)) data &= input_port_read(m_machine, "ROW5");
312   if (!BIT(m_keylatch, 6)) data &= input_port_read(m_machine, "ROW6");
313   if (!BIT(m_keylatch, 7)) data &= input_port_read(m_machine, "ROW7");
308   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "ROW2");
309   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "ROW3");
310   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "ROW4");
311   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "ROW5");
312   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "ROW6");
313   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "ROW7");
314314
315   data = (input_port_read(m_machine, "MODIFIERS") & 0xc0) | (data & 0x3f);
315   data = (input_port_read(machine(), "MODIFIERS") & 0xc0) | (data & 0x3f);
316316
317317   if (cassette_input(m_cassette) < +0.0)   data &= 0x7f;
318318
r11240r11241
336336   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
337337
338338   /* setup memory banking */
339   UINT8 *rom = m_machine.region(Z80_TAG)->base();
339   UINT8 *rom = machine().region(Z80_TAG)->base();
340340   
341341   program->install_readwrite_bank(0x0000, 0x1fff, "bank1");
342   memory_configure_bank(m_machine, "bank1", 0, 1, rom, 0);
343   memory_configure_bank(m_machine, "bank1", 1, 1, rom + 0xc000, 0);
344   memory_set_bank(m_machine, "bank1", 1);
342   memory_configure_bank(machine(), "bank1", 0, 1, rom, 0);
343   memory_configure_bank(machine(), "bank1", 1, 1, rom + 0xc000, 0);
344   memory_set_bank(machine(), "bank1", 1);
345345
346346   m_rom0000 = 1;
347347
348348   program->install_readwrite_bank(0x2000, 0x27ff, "bank2");
349   memory_configure_bank(m_machine, "bank2", 0, 1, rom + 0x2000, 0);
350   memory_configure_bank(m_machine, "bank2", 1, 1, m_mc6845_video_ram, 0);
351   memory_set_bank(m_machine, "bank2", 0);
349   memory_configure_bank(machine(), "bank2", 0, 1, rom + 0x2000, 0);
350   memory_configure_bank(machine(), "bank2", 1, 1, m_mc6845_video_ram, 0);
351   memory_set_bank(machine(), "bank2", 0);
352352
353   memory_configure_bank(m_machine, "bank3", 0, 1, rom + 0x4000, 0);
354   memory_set_bank(m_machine, "bank3", 0);
353   memory_configure_bank(machine(), "bank3", 0, 1, rom + 0x4000, 0);
354   memory_set_bank(machine(), "bank3", 0);
355355
356   memory_configure_bank(m_machine, "bank4", 0, 1, m_mc6847_video_ram, 0);
357   memory_configure_bank(m_machine, "bank4", 1, 1, rom + 0x8000, 0);
358   memory_set_bank(m_machine, "bank4", 0);
356   memory_configure_bank(machine(), "bank4", 0, 1, m_mc6847_video_ram, 0);
357   memory_configure_bank(machine(), "bank4", 1, 1, rom + 0x8000, 0);
358   memory_set_bank(machine(), "bank4", 0);
359359
360   memory_configure_bank(m_machine, "bank5", 0, 1, rom + 0x9800, 0);
361   memory_set_bank(m_machine, "bank5", 0);
360   memory_configure_bank(machine(), "bank5", 0, 1, rom + 0x9800, 0);
361   memory_set_bank(machine(), "bank5", 0);
362362
363363   bankswitch();
364364
r11240r11241
373373
374374void mc1000_state::machine_reset()
375375{
376   memory_set_bank(m_machine, "bank1", 1);
376   memory_set_bank(machine(), "bank1", 1);
377377
378378   m_rom0000 = 1;
379379}
src/mess/drivers/adam.c
r11240r11241
258258      if (BIT(m_adamnet, 1))
259259      {
260260         program->unmap_readwrite(0x0000, 0x5fff);
261         program->install_rom(0x6000, 0x7fff, m_machine.region("wp")->base() + 0x8000);
261         program->install_rom(0x6000, 0x7fff, machine().region("wp")->base() + 0x8000);
262262      }
263263      else
264264      {
265         program->install_rom(0x0000, 0x7fff, m_machine.region("wp")->base());
265         program->install_rom(0x0000, 0x7fff, machine().region("wp")->base());
266266      }
267267      break;
268268
r11240r11241
278278      break;
279279
280280   case LO_OS7_ROM_INTERNAL_RAM:
281      program->install_rom(0x0000, 0x1fff, m_machine.region("os7")->base());
281      program->install_rom(0x0000, 0x1fff, machine().region("os7")->base());
282282      program->install_ram(0x2000, 0x7fff, ram + 0x2000);
283283      break;
284284   }
r11240r11241
290290      break;
291291
292292   case HI_ROM_EXPANSION:
293      program->install_rom(0x8000, 0xffff, m_machine.region("xrom")->base());
293      program->install_rom(0x8000, 0xffff, machine().region("xrom")->base());
294294      break;
295295
296296   case HI_RAM_EXPANSION:
297297      if (m_game)
298298      {
299         program->install_rom(0x8000, 0xffff, m_machine.region("cart")->base());
299         program->install_rom(0x8000, 0xffff, machine().region("cart")->base());
300300      }
301301      else
302302      {
r11240r11241
308308      break;
309309
310310   case HI_CARTRIDGE_ROM:
311      program->install_rom(0x8000, 0xffff, m_machine.region("cart")->base());
311      program->install_rom(0x8000, 0xffff, machine().region("cart")->base());
312312      break;
313313   }
314314}
r11240r11241
409409   {
410410      m_reset = 1;
411411
412      m_machine.device(M6801_KB_TAG)->reset();
413      m_machine.device(M6801_DDP_TAG)->reset();
414      m_machine.device(M6801_PRN_TAG)->reset();
415      m_machine.device(M6801_FDC_TAG)->reset();
412      machine().device(M6801_KB_TAG)->reset();
413      machine().device(M6801_DDP_TAG)->reset();
414      machine().device(M6801_PRN_TAG)->reset();
415      machine().device(M6801_FDC_TAG)->reset();
416416      wd17xx_mr_w(m_fdc, 0);
417417      wd17xx_mr_w(m_fdc, 1);
418      //m_machine.device(M6801_SPI_TAG)->reset();
418      //machine().device(M6801_SPI_TAG)->reset();
419419
420420      m_reset = 0;
421421   }
r11240r11241
605605
606606   UINT8 data = 0xff;
607607
608   if (!BIT(m_key_y, 0)) data &= input_port_read(m_machine, "Y0");
609   if (!BIT(m_key_y, 1)) data &= input_port_read(m_machine, "Y1");
610   if (!BIT(m_key_y, 2)) data &= input_port_read(m_machine, "Y2");
611   if (!BIT(m_key_y, 3)) data &= input_port_read(m_machine, "Y3");
612   if (!BIT(m_key_y, 4)) data &= input_port_read(m_machine, "Y4");
613   if (!BIT(m_key_y, 5)) data &= input_port_read(m_machine, "Y5");
614   if (!BIT(m_key_y, 6)) data &= input_port_read(m_machine, "Y6");
615   if (!BIT(m_key_y, 7)) data &= input_port_read(m_machine, "Y7");
616   if (!BIT(m_key_y, 8)) data &= input_port_read(m_machine, "Y8");
617   if (!BIT(m_key_y, 9)) data &= input_port_read(m_machine, "Y9");
618   if (!BIT(m_key_y, 10)) data &= input_port_read(m_machine, "Y10");
619   if (!BIT(m_key_y, 11)) data &= input_port_read(m_machine, "Y11");
620   if (!BIT(m_key_y, 12)) data &= input_port_read(m_machine, "Y12");
608   if (!BIT(m_key_y, 0)) data &= input_port_read(machine(), "Y0");
609   if (!BIT(m_key_y, 1)) data &= input_port_read(machine(), "Y1");
610   if (!BIT(m_key_y, 2)) data &= input_port_read(machine(), "Y2");
611   if (!BIT(m_key_y, 3)) data &= input_port_read(machine(), "Y3");
612   if (!BIT(m_key_y, 4)) data &= input_port_read(machine(), "Y4");
613   if (!BIT(m_key_y, 5)) data &= input_port_read(machine(), "Y5");
614   if (!BIT(m_key_y, 6)) data &= input_port_read(machine(), "Y6");
615   if (!BIT(m_key_y, 7)) data &= input_port_read(machine(), "Y7");
616   if (!BIT(m_key_y, 8)) data &= input_port_read(machine(), "Y8");
617   if (!BIT(m_key_y, 9)) data &= input_port_read(machine(), "Y9");
618   if (!BIT(m_key_y, 10)) data &= input_port_read(machine(), "Y10");
619   if (!BIT(m_key_y, 11)) data &= input_port_read(machine(), "Y11");
620   if (!BIT(m_key_y, 12)) data &= input_port_read(machine(), "Y12");
621621
622622   return data;
623623}
r11240r11241
11971197
11981198READ8_MEMBER( adam_state::input1_r )
11991199{
1200   return coleco_paddle1_read(m_machine, m_joy_mode, m_joy_status0);
1200   return coleco_paddle1_read(machine(), m_joy_mode, m_joy_status0);
12011201}
12021202
12031203
r11240r11241
12071207
12081208READ8_MEMBER( adam_state::input2_r )
12091209{
1210   return coleco_paddle1_read(m_machine, m_joy_mode, m_joy_status1);
1210   return coleco_paddle1_read(machine(), m_joy_mode, m_joy_status1);
12111211}
12121212
12131213
r11240r11241
16171617   TMS9928A_configure(&tms9928a_interface);
16181618
16191619   // register for state saving
1620   state_save_register_global(m_machine, m_mioc);
1621   state_save_register_global(m_machine, m_game);
1622   state_save_register_global(m_machine, m_adamnet);
1623   state_save_register_global_array(m_machine, m_txd);
1624   state_save_register_global(m_machine, m_rxd);
1625   state_save_register_global(m_machine, m_reset);
1626   state_save_register_global(m_machine, m_ba);
1627   state_save_register_global(m_machine, m_dma);
1628   state_save_register_global(m_machine, m_bwr);
1629   state_save_register_global(m_machine, m_data_in);
1630   state_save_register_global(m_machine, m_data_out);
1631   state_save_register_global(m_machine, m_key_y);
1632   state_save_register_global(m_machine, m_joy_mode);
1633   state_save_register_global(m_machine, m_joy_status0);
1634   state_save_register_global(m_machine, m_joy_status1);
1635   state_save_register_global(m_machine, m_vdp_nmi);
1636   state_save_register_global(m_machine, m_wr0);
1637   state_save_register_global(m_machine, m_wr1);
1638   state_save_register_global(m_machine, m_track);
1620   state_save_register_global(machine(), m_mioc);
1621   state_save_register_global(machine(), m_game);
1622   state_save_register_global(machine(), m_adamnet);
1623   state_save_register_global_array(machine(), m_txd);
1624   state_save_register_global(machine(), m_rxd);
1625   state_save_register_global(machine(), m_reset);
1626   state_save_register_global(machine(), m_ba);
1627   state_save_register_global(machine(), m_dma);
1628   state_save_register_global(machine(), m_bwr);
1629   state_save_register_global(machine(), m_data_in);
1630   state_save_register_global(machine(), m_data_out);
1631   state_save_register_global(machine(), m_key_y);
1632   state_save_register_global(machine(), m_joy_mode);
1633   state_save_register_global(machine(), m_joy_status0);
1634   state_save_register_global(machine(), m_joy_status1);
1635   state_save_register_global(machine(), m_vdp_nmi);
1636   state_save_register_global(machine(), m_wr0);
1637   state_save_register_global(machine(), m_wr1);
1638   state_save_register_global(machine(), m_track);
16391639}
16401640
16411641
r11240r11241
16451645
16461646void adam_state::machine_reset()
16471647{
1648   device_image_interface *image = dynamic_cast<device_image_interface *>(m_machine.device("cart"));
1648   device_image_interface *image = dynamic_cast<device_image_interface *>(machine().device("cart"));
16491649
16501650    if (image->exists())
16511651   {
src/mess/drivers/msbc1.c
r11240r11241
6666
6767void msbc1_state::machine_reset()
6868{
69   void *ram = m_machine.firstcpu->memory().space(AS_PROGRAM)->get_write_ptr(0);
70   UINT8 *rom = m_machine.region(MC68000R12_TAG)->base();
69   void *ram = machine().firstcpu->memory().space(AS_PROGRAM)->get_write_ptr(0);
70   UINT8 *rom = machine().region(MC68000R12_TAG)->base();
7171
7272   memcpy(ram, rom, 8);
7373
74   m_machine.firstcpu->reset();
74   machine().firstcpu->reset();
7575}
7676
7777static GENERIC_TERMINAL_INTERFACE( terminal_intf )
src/mess/drivers/mycom.c
r11240r11241
120120
121121VIDEO_START_MEMBER( mycom_state )
122122{
123   m_p_videoram = m_machine.region("vram")->base();
124   m_p_chargen = m_machine.region("chargen")->base();
123   m_p_videoram = machine().region("vram")->base();
124   m_p_chargen = machine().region("chargen")->base();
125125}
126126
127127SCREEN_UPDATE_MEMBER( mycom_state )
r11240r11241
545545
546546MACHINE_START_MEMBER(mycom_state)
547547{
548   m_p_ram = m_machine.region("maincpu")->base();
548   m_p_ram = machine().region("maincpu")->base();
549549}
550550
551551MACHINE_RESET_MEMBER(mycom_state)
552552{
553   memory_set_bank(m_machine, "boot", 1);
553   memory_set_bank(machine(), "boot", 1);
554554   m_upper_sw = 0x10000;
555555   m_0a = 0;
556556}
src/mess/drivers/pes.c
r11240r11241
124124/* Port Handlers */
125125WRITE8_MEMBER( pes_state::rsws_w )
126126{
127   pes_state *state = m_machine.driver_data<pes_state>();
127   pes_state *state = machine().driver_data<pes_state>();
128128   m_wsstate = data&0x1; // /ws is bit 0
129129   m_rsstate = (data&0x2)>>1; // /rs is bit 1
130130#ifdef DEBUG_PORTS
r11240r11241
136136
137137WRITE8_MEMBER( pes_state::port1_w )
138138{
139   pes_state *state = m_machine.driver_data<pes_state>();
139   pes_state *state = machine().driver_data<pes_state>();
140140#ifdef DEBUG_PORTS
141141   logerror("port1 write: tms5220 data written: %02X\n", data);
142142#endif
r11240r11241
147147READ8_MEMBER( pes_state::port1_r )
148148{
149149   UINT8 data = 0xFF;
150   pes_state *state = m_machine.driver_data<pes_state>();
150   pes_state *state = machine().driver_data<pes_state>();
151151   data = tms5220_status_r(state->m_speech, 0);
152152#ifdef DEBUG_PORTS
153153   logerror("port1 read: tms5220 data read: 0x%02X\n", data);
r11240r11241
184184READ8_MEMBER( pes_state::port3_r )
185185{
186186   UINT8 data = m_port3_state & 0xE3; // return last written state with rts, /rdy and /int masked out
187   pes_state *state = m_machine.driver_data<pes_state>();
187   pes_state *state = machine().driver_data<pes_state>();
188188   // check rts state; if virtual fifo is nonzero, rts is set, otherwise it is cleared
189189   if (state->m_infifo_tail_ptr != state->m_infifo_head_ptr)
190190   {
r11240r11241
219219
220220   m_port3_state = 0; // reset the openbus state of port 3
221221   //cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, ASSERT_LINE); // this causes debugger to fail badly if included
222   devtag_reset(m_machine, "tms5220"); // reset the 5220
222   devtag_reset(machine(), "tms5220"); // reset the 5220
223223}
224224
225225/******************************************************************************
src/mess/drivers/xor100.c
r11240r11241
6767      if (m_bank < banks)
6868      {
6969         program->install_write_bank(0x0000, 0xffff, "bank1");
70         memory_set_bank(m_machine, "bank1", 1 + m_bank);
70         memory_set_bank(machine(), "bank1", 1 + m_bank);
7171      }
7272      else
7373      {
r11240r11241
7676
7777      program->install_read_bank(0x0000, 0xf7ff, 0x07ff, 0, "bank2");
7878      program->install_read_bank(0xf800, 0xffff, "bank3");
79      memory_set_bank(m_machine, "bank2", 0);
80      memory_set_bank(m_machine, "bank3", 0);
79      memory_set_bank(machine(), "bank2", 0);
80      memory_set_bank(machine(), "bank3", 0);
8181      break;
8282
8383   case EPROM_F800:
r11240r11241
8585      {
8686         program->install_write_bank(0x0000, 0xffff, "bank1");
8787         program->install_read_bank(0x0000, 0xf7ff, "bank2");
88         memory_set_bank(m_machine, "bank1", 1 + m_bank);
89         memory_set_bank(m_machine, "bank2", 1 + m_bank);
88         memory_set_bank(machine(), "bank1", 1 + m_bank);
89         memory_set_bank(machine(), "bank2", 1 + m_bank);
9090      }
9191      else
9292      {
r11240r11241
9595      }
9696
9797      program->install_read_bank(0xf800, 0xffff, "bank3");
98      memory_set_bank(m_machine, "bank3", 0);
98      memory_set_bank(machine(), "bank3", 0);
9999      break;
100100
101101   case EPROM_OFF:
r11240r11241
104104         program->install_write_bank(0x0000, 0xffff, "bank1");
105105         program->install_read_bank(0x0000, 0xf7ff, "bank2");
106106         program->install_read_bank(0xf800, 0xffff, "bank3");
107         memory_set_bank(m_machine, "bank1", 1 + m_bank);
108         memory_set_bank(m_machine, "bank2", 1 + m_bank);
109         memory_set_bank(m_machine, "bank3", 1 + m_bank);
107         memory_set_bank(machine(), "bank1", 1 + m_bank);
108         memory_set_bank(machine(), "bank2", 1 + m_bank);
109         memory_set_bank(machine(), "bank3", 1 + m_bank);
110110      }
111111      else
112112      {
r11240r11241
534534{
535535   int banks = ram_get_size(m_ram) / 0x10000;
536536   UINT8 *ram = ram_get_ptr(m_ram);
537   UINT8 *rom = m_machine.region(Z80_TAG)->base();
537   UINT8 *rom = machine().region(Z80_TAG)->base();
538538
539539   /* setup memory banking */
540   memory_configure_bank(m_machine, "bank1", 1, banks, ram, 0x10000);
541   memory_configure_bank(m_machine, "bank2", 0, 1, rom, 0);
542   memory_configure_bank(m_machine, "bank2", 1, banks, ram, 0x10000);
543   memory_configure_bank(m_machine, "bank3", 0, 1, rom, 0);
544   memory_configure_bank(m_machine, "bank3", 1, banks, ram + 0xf800, 0x10000);
540   memory_configure_bank(machine(), "bank1", 1, banks, ram, 0x10000);
541   memory_configure_bank(machine(), "bank2", 0, 1, rom, 0);
542   memory_configure_bank(machine(), "bank2", 1, banks, ram, 0x10000);
543   memory_configure_bank(machine(), "bank3", 0, 1, rom, 0);
544   memory_configure_bank(machine(), "bank3", 1, banks, ram + 0xf800, 0x10000);
545545
546546   /* register for state saving */
547   state_save_register_global(m_machine, m_mode);
548   state_save_register_global(m_machine, m_bank);
549   state_save_register_global(m_machine, m_fdc_irq);
550   state_save_register_global(m_machine, m_fdc_drq);
551   state_save_register_global(m_machine, m_fdc_dden);
547   state_save_register_global(machine(), m_mode);
548   state_save_register_global(machine(), m_bank);
549   state_save_register_global(machine(), m_fdc_irq);
550   state_save_register_global(machine(), m_fdc_drq);
551   state_save_register_global(machine(), m_fdc_dden);
552552}
553553
554554void xor100_state::machine_reset()
src/mess/drivers/dolphin.c
r11240r11241
8181{
8282   UINT8 keyin, i, data = 0xff;
8383
84   keyin = input_port_read(m_machine, "X0");
84   keyin = input_port_read(machine(), "X0");
8585   if (keyin != 0xff)
8686      for (i = 0; i < 8; i++)
8787         if BIT(~keyin, i)
r11240r11241
9090            break;
9191         }
9292
93   keyin = input_port_read(m_machine, "X1");
93   keyin = input_port_read(machine(), "X1");
9494   if (keyin != 0xff)
9595      for (i = 0; i < 8; i++)
9696         if BIT(~keyin, i)
r11240r11241
9999            break;
100100         }
101101
102   data &= input_port_read(m_machine, "X2");
102   data &= input_port_read(machine(), "X2");
103103
104104   return data;
105105}
src/mess/drivers/d6800.c
r11240r11241
165165
166166READ_LINE_MEMBER( d6800_state::d6800_keydown_r )
167167{
168   UINT8 data = input_port_read(m_machine, "LINE0")
169              & input_port_read(m_machine, "LINE1")
170              & input_port_read(m_machine, "LINE2")
171              & input_port_read(m_machine, "LINE3");
168   UINT8 data = input_port_read(machine(), "LINE0")
169              & input_port_read(machine(), "LINE1")
170              & input_port_read(machine(), "LINE2")
171              & input_port_read(machine(), "LINE3");
172172
173173   return (data==0xff) ? 0 : 1;
174174}
175175
176176READ_LINE_MEMBER( d6800_state::d6800_fn_key_r )
177177{
178   return input_port_read(m_machine, "SPECIAL");
178   return input_port_read(machine(), "SPECIAL");
179179}
180180
181181WRITE_LINE_MEMBER( d6800_state::d6800_screen_w )
r11240r11241
210210{
211211   UINT8 data = 15;
212212
213   if (!BIT(m_keylatch, 4)) data &= input_port_read(m_machine, "LINE0");
214   if (!BIT(m_keylatch, 5)) data &= input_port_read(m_machine, "LINE1");
215   if (!BIT(m_keylatch, 6)) data &= input_port_read(m_machine, "LINE2");
216   if (!BIT(m_keylatch, 7)) data &= input_port_read(m_machine, "LINE3");
213   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "LINE0");
214   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "LINE1");
215   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "LINE2");
216   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "LINE3");
217217
218218   return data | m_keylatch;
219219}
src/mess/drivers/beehive.c
r11240r11241
5959
6060VIDEO_START_MEMBER( beehive_state )
6161{
62   m_p_chargen = m_machine.region("chargen")->base();
63   m_p_videoram = m_machine.region("maincpu")->base()+0x81fa;
62   m_p_chargen = machine().region("chargen")->base();
63   m_p_videoram = machine().region("maincpu")->base()+0x81fa;
6464}
6565
6666/* This system appears to have inline attribute bytes of unknown meaning.
src/mess/drivers/tmc600.c
r11240r11241
196196
197197READ_LINE_MEMBER( tmc600_state::clear_r )
198198{
199   return BIT(input_port_read(m_machine, "RUN"), 0);
199   return BIT(input_port_read(machine(), "RUN"), 0);
200200}
201201
202202READ_LINE_MEMBER( tmc600_state::ef2_r )
r11240r11241
207207READ_LINE_MEMBER( tmc600_state::ef3_r )
208208{
209209   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
210   UINT8 data = ~input_port_read(m_machine, keynames[m_keylatch / 8]);
210   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
211211
212212   return BIT(data, m_keylatch % 8);
213213}
r11240r11241
252252   }
253253
254254   /* register for state saving */
255   state_save_register_global(m_machine, m_keylatch);
255   state_save_register_global(machine(), m_keylatch);
256256}
257257
258258/* Machine Drivers */
src/mess/drivers/ace.c
r11240r11241
7171{
7272   UINT8 data = 0xff;
7373
74   if (!BIT(offset, 8)) data &= input_port_read(m_machine, "A8");
75   if (!BIT(offset, 9)) data &= input_port_read(m_machine, "A9");
76   if (!BIT(offset, 10)) data &= input_port_read(m_machine, "A10");
77   if (!BIT(offset, 11)) data &= input_port_read(m_machine, "A11");
78   if (!BIT(offset, 12)) data &= input_port_read(m_machine, "A12");
79   if (!BIT(offset, 13)) data &= input_port_read(m_machine, "A13");
80   if (!BIT(offset, 14)) data &= input_port_read(m_machine, "A14");
74   if (!BIT(offset, 8)) data &= input_port_read(machine(), "A8");
75   if (!BIT(offset, 9)) data &= input_port_read(machine(), "A9");
76   if (!BIT(offset, 10)) data &= input_port_read(machine(), "A10");
77   if (!BIT(offset, 11)) data &= input_port_read(machine(), "A11");
78   if (!BIT(offset, 12)) data &= input_port_read(machine(), "A12");
79   if (!BIT(offset, 13)) data &= input_port_read(machine(), "A13");
80   if (!BIT(offset, 14)) data &= input_port_read(machine(), "A14");
8181
8282   if (!BIT(offset, 15))
8383   {
84      data &= input_port_read(m_machine, "A15");
84      data &= input_port_read(machine(), "A15");
8585
8686      cassette_output(m_cassette, -1);
8787      speaker_level_w(m_speaker, 0);
src/mess/drivers/bcs3.c
r11240r11241
216216
217217VIDEO_START_MEMBER( bcs3_state )
218218{
219   m_p_chargen = m_machine.region("chargen")->base();
219   m_p_chargen = machine().region("chargen")->base();
220220}
221221
222222static SCREEN_UPDATE( bcs3 )
src/mess/drivers/abc80.c
r11240r11241
681681   }
682682
683683   /* register for state saving */
684   state_save_register_global(m_machine, m_key_data);
685   state_save_register_global(m_machine, m_key_strobe);
686   state_save_register_global(m_machine, m_pio_astb);
684   state_save_register_global(machine(), m_key_data);
685   state_save_register_global(machine(), m_key_strobe);
686   state_save_register_global(machine(), m_pio_astb);
687687}
688688
689689
src/mess/drivers/mpf1.c
r11240r11241
220220   UINT8 data = 0x7f;
221221
222222   /* bit 0 to 5, keyboard rows 0 to 5 */
223   if (!BIT(m_lednum, 0)) data &= input_port_read(m_machine, "PC0");
224   if (!BIT(m_lednum, 1)) data &= input_port_read(m_machine, "PC1");
225   if (!BIT(m_lednum, 2)) data &= input_port_read(m_machine, "PC2");
226   if (!BIT(m_lednum, 3)) data &= input_port_read(m_machine, "PC3");
227   if (!BIT(m_lednum, 4)) data &= input_port_read(m_machine, "PC4");
228   if (!BIT(m_lednum, 5)) data &= input_port_read(m_machine, "PC5");
223   if (!BIT(m_lednum, 0)) data &= input_port_read(machine(), "PC0");
224   if (!BIT(m_lednum, 1)) data &= input_port_read(machine(), "PC1");
225   if (!BIT(m_lednum, 2)) data &= input_port_read(machine(), "PC2");
226   if (!BIT(m_lednum, 3)) data &= input_port_read(machine(), "PC3");
227   if (!BIT(m_lednum, 4)) data &= input_port_read(machine(), "PC4");
228   if (!BIT(m_lednum, 5)) data &= input_port_read(machine(), "PC5");
229229
230230   /* bit 6, user key */
231   data &= input_port_read(m_machine, "SPECIAL") & 1 ? 0xff : 0xbf;
231   data &= input_port_read(machine(), "SPECIAL") & 1 ? 0xff : 0xbf;
232232
233233   /* bit 7, tape input */
234234   data |= (cassette_input(m_cassette) > 0 ? 1 : 0) << 7;
r11240r11241
261261   }
262262
263263   /* bit 7, tape output, tone and led */
264   set_led_status(m_machine, 0, !BIT(data, 7));
264   set_led_status(machine(), 0, !BIT(data, 7));
265265   speaker_level_w(m_speaker, BIT(data, 7));
266266   cassette_output(m_cassette, BIT(data, 7));
267267}
r11240r11241
346346
347347void mpf1_state::machine_start()
348348{
349   m_led_refresh_timer = m_machine.scheduler().timer_alloc(FUNC(led_refresh));
349   m_led_refresh_timer = machine().scheduler().timer_alloc(FUNC(led_refresh));
350350
351351   /* register for state saving */
352352   save_item(NAME(m_break));
src/mess/drivers/sg1000.c
r11240r11241
110110{
111111   if (data & 0x01)
112112   {
113      m_tvdraw_data = input_port_read(m_machine, "TVDRAW_X");
113      m_tvdraw_data = input_port_read(machine(), "TVDRAW_X");
114114
115115      if (m_tvdraw_data < 4) m_tvdraw_data = 4;
116116      if (m_tvdraw_data > 251) m_tvdraw_data = 251;
117117   }
118118   else
119119   {
120      m_tvdraw_data = input_port_read(m_machine, "TVDRAW_Y") + 32;
120      m_tvdraw_data = input_port_read(machine(), "TVDRAW_Y") + 32;
121121   }
122122}
123123
r11240r11241
127127
128128READ8_MEMBER( sg1000_state::tvdraw_status_r )
129129{
130   return input_port_read(m_machine, "TVDRAW_PEN");
130   return input_port_read(machine(), "TVDRAW_PEN");
131131}
132132
133133/*-------------------------------------------------
r11240r11241
573573
574574   static const char *const keynames[] = { "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7" };
575575
576   return input_port_read(m_machine, keynames[m_keylatch]);
576   return input_port_read(machine(), keynames[m_keylatch]);
577577}
578578
579579READ8_MEMBER( sc3000_state::ppi_pb_r )
r11240r11241
594594   static const char *const keynames[] = { "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7" };
595595
596596   /* keyboard */
597   UINT8 data = input_port_read(m_machine, keynames[m_keylatch]);
597   UINT8 data = input_port_read(machine(), keynames[m_keylatch]);
598598
599599   /* cartridge contact */
600600   data |= 0x10;
r11240r11241
711711   }
712712
713713   /* ROM selection */
714   memory_set_bank(m_machine, "bank1", BIT(data, 6));
714   memory_set_bank(machine(), "bank1", BIT(data, 6));
715715
716716   /* printer strobe */
717717   centronics_strobe_w(m_centronics, BIT(data, 7));
r11240r11241
791791   case 40 * 1024:
792792      program->install_read_bank(0x8000, 0x9fff, "bank1");
793793      program->unmap_write(0x8000, 0x9fff);
794      memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(Z80_TAG)->base() + 0x8000, 0);
795      memory_set_bank(m_machine, "bank1", 0);
794      memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base() + 0x8000, 0);
795      memory_set_bank(machine(), "bank1", 0);
796796      break;
797797
798798   case 48 * 1024:
799799      program->install_read_bank(0x8000, 0xbfff, "bank1");
800800      program->unmap_write(0x8000, 0xbfff);
801      memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(Z80_TAG)->base() + 0x8000, 0);
802      memory_set_bank(m_machine, "bank1", 0);
801      memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base() + 0x8000, 0);
802      memory_set_bank(machine(), "bank1", 0);
803803      break;
804804
805805   default:
r11240r11241
971971   TMS9928A_configure(&tms9928a_interface);
972972
973973   /* toggle light gun crosshair */
974   m_machine.scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
974   machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
975975
976976   /* register for state saving */
977   state_save_register_global(m_machine, m_tvdraw_data);
977   state_save_register_global(machine(), m_tvdraw_data);
978978}
979979
980980/*-------------------------------------------------
r11240r11241
987987   TMS9928A_configure(&tms9928a_interface);
988988
989989   /* toggle light gun crosshair */
990   m_machine.scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
990   machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
991991
992992   /* register for state saving */
993   state_save_register_global(m_machine, m_tvdraw_data);
994   state_save_register_global(m_machine, m_keylatch);
993   state_save_register_global(machine(), m_tvdraw_data);
994   state_save_register_global(machine(), m_keylatch);
995995}
996996
997997/*-------------------------------------------------
r11240r11241
10181018   floppy_drive_set_index_pulse_callback(m_floppy0, sf7000_fdc_index_callback);
10191019
10201020   /* configure memory banking */
1021   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(Z80_TAG)->base(), 0);
1022   memory_configure_bank(m_machine, "bank1", 1, 1, ram_get_ptr(m_ram), 0);
1023   memory_configure_bank(m_machine, "bank2", 0, 1, ram_get_ptr(m_ram), 0);
1021   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base(), 0);
1022   memory_configure_bank(machine(), "bank1", 1, 1, ram_get_ptr(m_ram), 0);
1023   memory_configure_bank(machine(), "bank2", 0, 1, ram_get_ptr(m_ram), 0);
10241024
10251025   /* register for state saving */
1026   state_save_register_global(m_machine, m_keylatch);
1027   state_save_register_global(m_machine, m_fdc_irq);
1028   state_save_register_global(m_machine, m_fdc_index);
1026   state_save_register_global(machine(), m_keylatch);
1027   state_save_register_global(machine(), m_fdc_irq);
1028   state_save_register_global(machine(), m_fdc_index);
10291029}
10301030
10311031/*-------------------------------------------------
r11240r11241
10341034
10351035void sf7000_state::machine_reset()
10361036{
1037   memory_set_bank(m_machine, "bank1", 0);
1038   memory_set_bank(m_machine, "bank2", 0);
1037   memory_set_bank(machine(), "bank1", 0);
1038   memory_set_bank(machine(), "bank2", 0);
10391039}
10401040
10411041/***************************************************************************
src/mess/drivers/eti660.c
r11240r11241
131131
132132READ_LINE_MEMBER( eti660_state::clear_r )
133133{
134   return BIT(input_port_read(m_machine, "SPECIAL"), 0);
134   return BIT(input_port_read(machine(), "SPECIAL"), 0);
135135}
136136
137137READ_LINE_MEMBER( eti660_state::ef2_r )
r11240r11241
141141
142142READ_LINE_MEMBER( eti660_state::ef4_r )
143143{
144   return BIT(input_port_read(m_machine, "SPECIAL"), 1);
144   return BIT(input_port_read(machine(), "SPECIAL"), 1);
145145}
146146
147147WRITE_LINE_MEMBER( eti660_state::q_w )
r11240r11241
150150   cdp1864_aoe_w(m_cti, state);
151151
152152   /* PULSE led */
153   set_led_status(m_machine, LED_PULSE, state);
153   set_led_status(machine(), LED_PULSE, state);
154154
155155   /* tape output */
156156   cassette_output(m_cassette, state ? 1.0 : -1.0);
r11240r11241
203203
204204   UINT8 data = 0xf0;
205205
206   if (!BIT(m_keylatch, 0)) data &= input_port_read(m_machine, "PA0");
207   if (!BIT(m_keylatch, 1)) data &= input_port_read(m_machine, "PA1");
208   if (!BIT(m_keylatch, 2)) data &= input_port_read(m_machine, "PA2");
209   if (!BIT(m_keylatch, 3)) data &= input_port_read(m_machine, "PA3");
206   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "PA0");
207   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "PA1");
208   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "PA2");
209   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "PA3");
210210
211211   return data;
212212}
src/mess/drivers/px8.c
r11240r11241
7777{
7878   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
7979   UINT8 *ram = ram_get_ptr(m_ram);
80   UINT8 *ipl_rom = m_machine.region(UPD70008_TAG)->base();
80   UINT8 *ipl_rom = machine().region(UPD70008_TAG)->base();
8181
8282   if (!m_bank0)
8383   {
r11240r11241
452452
453453   switch (m_ksc)
454454   {
455   case 0: data = input_port_read(m_machine, "KSC0"); break;
456   case 1: data = input_port_read(m_machine, "KSC1"); break;
457   case 2: data = input_port_read(m_machine, "KSC2"); break;
458   case 3: data = input_port_read(m_machine, "KSC3"); break;
459   case 4: data = input_port_read(m_machine, "KSC4"); break;
460   case 5: data = input_port_read(m_machine, "KSC5"); break;
461   case 6: data = input_port_read(m_machine, "KSC6"); break;
462   case 7: data = input_port_read(m_machine, "KSC7"); break;
463   case 8: data = input_port_read(m_machine, "KSC8"); break;
464   case 9: data = input_port_read(m_machine, "SW4");  break;
455   case 0: data = input_port_read(machine(), "KSC0"); break;
456   case 1: data = input_port_read(machine(), "KSC1"); break;
457   case 2: data = input_port_read(machine(), "KSC2"); break;
458   case 3: data = input_port_read(machine(), "KSC3"); break;
459   case 4: data = input_port_read(machine(), "KSC4"); break;
460   case 5: data = input_port_read(machine(), "KSC5"); break;
461   case 6: data = input_port_read(machine(), "KSC6"); break;
462   case 7: data = input_port_read(machine(), "KSC7"); break;
463   case 8: data = input_port_read(machine(), "KSC8"); break;
464   case 9: data = input_port_read(machine(), "SW4");  break;
465465   }
466466
467467   return data;
src/mess/drivers/phc25.c
r11240r11241
297297void phc25_state::video_start()
298298{
299299   /* find memory regions */
300   m_char_rom = m_machine.region(Z80_TAG)->base() + 0x5000;
300   m_char_rom = machine().region(Z80_TAG)->base() + 0x5000;
301301}
302302
303303bool phc25_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/drivers/mikromik.c
r11240r11241
6363   {
6464   case 0: /* IC24 A8 */
6565      //logerror("IC24 A8 %u\n", d);
66      memory_set_bank(m_machine, "bank1", d);
66      memory_set_bank(machine(), "bank1", d);
6767
6868      if (d)
6969      {
r11240r11241
110110      floppy_drive_set_ready_state(m_floppy0, d, 1);
111111      floppy_drive_set_ready_state(m_floppy1, d, 1);
112112
113      if (input_port_read(m_machine, "T5")) upd765_ready_w(m_fdc, d);
113      if (input_port_read(machine(), "T5")) upd765_ready_w(m_fdc, d);
114114      break;
115115   }
116116}
r11240r11241
323323void mm1_state::video_start()
324324{
325325   // find memory regions
326   m_char_rom = m_machine.region("chargen")->base();
326   m_char_rom = machine().region("chargen")->base();
327327
328   VIDEO_START_NAME(generic_bitmapped)(m_machine);
328   VIDEO_START_NAME(generic_bitmapped)(machine());
329329}
330330
331331bool mm1_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
r11240r11241
561561{
562562   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
563563
564   UINT8 data = input_port_read(m_machine, keynames[m_drive]);
565   UINT8 special = input_port_read(m_machine, "SPECIAL");
564   UINT8 data = input_port_read(machine(), keynames[m_drive]);
565   UINT8 special = input_port_read(machine(), "SPECIAL");
566566   int ctrl = BIT(special, 0);
567567   int shift = BIT(special, 2) & BIT(special, 1);
568568   UINT8 keydata = 0xff;
r11240r11241
658658   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
659659
660660   /* find memory regions */
661   m_key_rom = m_machine.region("keyboard")->base();
661   m_key_rom = machine().region("keyboard")->base();
662662
663663   /* setup memory banking */
664664   program->install_read_bank(0x0000, 0x0fff, "bank1");
665665   program->unmap_write(0x0000, 0x0fff);
666   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region("bios")->base(), 0);
667   memory_configure_bank(m_machine, "bank1", 1, 1, ram_get_ptr(m_machine.device(RAM_TAG)), 0);
668   memory_set_bank(m_machine, "bank1", 0);
666   memory_configure_bank(machine(), "bank1", 0, 1, machine().region("bios")->base(), 0);
667   memory_configure_bank(machine(), "bank1", 1, 1, ram_get_ptr(machine().device(RAM_TAG)), 0);
668   memory_set_bank(machine(), "bank1", 0);
669669
670670   /* register for state saving */
671   state_save_register_global(m_machine, m_sense);
672   state_save_register_global(m_machine, m_drive);
673   state_save_register_global(m_machine, m_llen);
674   state_save_register_global(m_machine, m_intc);
675   state_save_register_global(m_machine, m_rx21);
676   state_save_register_global(m_machine, m_tx21);
677   state_save_register_global(m_machine, m_rcl);
678   state_save_register_global(m_machine, m_recall);
679   state_save_register_global(m_machine, m_dack3);
671   state_save_register_global(machine(), m_sense);
672   state_save_register_global(machine(), m_drive);
673   state_save_register_global(machine(), m_llen);
674   state_save_register_global(machine(), m_intc);
675   state_save_register_global(machine(), m_rx21);
676   state_save_register_global(machine(), m_tx21);
677   state_save_register_global(machine(), m_rcl);
678   state_save_register_global(machine(), m_recall);
679   state_save_register_global(machine(), m_dack3);
680680}
681681
682682void mm1_state::machine_reset()
r11240r11241
688688   for (i = 0; i < 8; i++) ls259_w(*program, i, 0);
689689
690690   /* set FDC ready */
691   if (!input_port_read(m_machine, "T5")) upd765_ready_w(m_fdc, 1);
691   if (!input_port_read(machine(), "T5")) upd765_ready_w(m_fdc, 1);
692692
693693   /* reset FDC */
694694   upd765_reset_w(m_fdc, 1);
src/mess/drivers/phunsy.c
r11240r11241
7171WRITE8_MEMBER( phunsy_state::phunsy_ctrl_w )
7272{
7373   if (LOG)
74      logerror("%s: phunsy_ctrl_w %02x\n", m_machine.describe_context(), data);
74      logerror("%s: phunsy_ctrl_w %02x\n", machine().describe_context(), data);
7575
7676   m_u_bank = data >> 4;
7777   m_q_bank = data & 0x0F;
r11240r11241
7979   switch( m_u_bank )
8080   {
8181   case 0x00:   /* RAM */
82      memory_set_bankptr( m_machine, "bank1", m_ram_1800 );
82      memory_set_bankptr( machine(), "bank1", m_ram_1800 );
8383      break;
8484   case 0x01:   /* MDCR program */
8585   case 0x02:   /* Disassembler */
8686   case 0x03:   /* Label handler */
87      memory_set_bankptr( m_machine, "bank1", m_machine.region("maincpu")->base() + ( 0x800 * m_u_bank ) );
87      memory_set_bankptr( machine(), "bank1", machine().region("maincpu")->base() + ( 0x800 * m_u_bank ) );
8888      break;
8989   default:   /* Not used */
9090      break;
9191   }
9292
93   memory_set_bankptr( m_machine, "bank2", m_machine.region("ram_4000")->base() + 0x4000 * m_q_bank );
93   memory_set_bankptr( machine(), "bank2", machine().region("ram_4000")->base() + 0x4000 * m_q_bank );
9494}
9595
9696
9797WRITE8_MEMBER( phunsy_state::phunsy_data_w )
9898{
9999   if (LOG)
100      logerror("%s: phunsy_data_w %02x\n", m_machine.describe_context(), data);
100      logerror("%s: phunsy_data_w %02x\n", machine().describe_context(), data);
101101
102102   m_data_out = data;
103103
r11240r11241
124124   UINT8 data;
125125
126126   if (LOG)
127      logerror("%s: phunsy_data_r\n", m_machine.describe_context());
127      logerror("%s: phunsy_data_r\n", machine().describe_context());
128128
129129   if ( m_data_out & 0x02 )
130130   {
r11240r11241
184184
185185MACHINE_RESET_MEMBER(phunsy_state)
186186{
187   memory_set_bankptr( m_machine, "bank1", m_ram_1800 );
188   memory_set_bankptr( m_machine, "bank2", m_machine.region("ram_4000")->base() );
187   memory_set_bankptr( machine(), "bank1", m_ram_1800 );
188   memory_set_bankptr( machine(), "bank2", machine().region("ram_4000")->base() );
189189
190190   m_u_bank = 0;
191191   m_q_bank = 0;
r11240r11241
206206
207207VIDEO_START_MEMBER( phunsy_state )
208208{
209   m_p_chargen = m_machine.region( "chargen" )->base();
209   m_p_chargen = machine().region( "chargen" )->base();
210210}
211211
212212
src/mess/drivers/studio2.c
r11240r11241
365365
366366READ_LINE_MEMBER( studio2_state::clear_r )
367367{
368   return BIT(input_port_read(m_machine, "CLEAR"), 0);
368   return BIT(input_port_read(machine(), "CLEAR"), 0);
369369}
370370
371371READ_LINE_MEMBER( studio2_state::ef3_r )
372372{
373   return BIT(input_port_read(m_machine, "A"), m_keylatch);
373   return BIT(input_port_read(machine(), "A"), m_keylatch);
374374}
375375
376376READ_LINE_MEMBER( studio2_state::ef4_r )
377377{
378   return BIT(input_port_read(m_machine, "B"), m_keylatch);
378   return BIT(input_port_read(machine(), "B"), m_keylatch);
379379}
380380
381381WRITE_LINE_MEMBER( studio2_state::q_w )
src/mess/drivers/osi.c
r11240r11241
230230
231231   for (bit = 0; bit < 8; bit++)
232232   {
233      if (!BIT(m_keylatch, bit)) data &= input_port_read(m_machine, keynames[bit]);
233      if (!BIT(m_keylatch, bit)) data &= input_port_read(machine(), keynames[bit]);
234234   }
235235
236236   return data;
r11240r11241
640640   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
641641
642642   /* configure RAM banking */
643   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(M6502_TAG)->base(), 0);
644   memory_set_bank(m_machine, "bank1", 0);
643   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(M6502_TAG)->base(), 0);
644   memory_set_bank(machine(), "bank1", 0);
645645
646646   switch (ram_get_size(m_ram))
647647   {
r11240r11241
665665   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
666666
667667   /* configure RAM banking */
668   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(M6502_TAG)->base(), 0);
669   memory_set_bank(m_machine, "bank1", 0);
668   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(M6502_TAG)->base(), 0);
669   memory_set_bank(machine(), "bank1", 0);
670670
671671   switch (ram_get_size(m_ram))
672672   {
src/mess/drivers/mekd2.c
r11240r11241
168168WRITE_LINE_MEMBER( mekd2_state::mekd2_nmi_w )
169169{
170170   if (state)
171      cputag_set_input_line(m_machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
171      cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
172172   else
173      m_machine.scheduler().timer_set(attotime::from_usec(18), FUNC(mekd2_trace));
173      machine().scheduler().timer_set(attotime::from_usec(18), FUNC(mekd2_trace));
174174}
175175
176176
r11240r11241
197197      if (BIT(m_digit, i))
198198      {
199199         sprintf(kbdrow,"X%d",i);
200         m_keydata &= input_port_read(m_machine, kbdrow);
200         m_keydata &= input_port_read(machine(), kbdrow);
201201      }
202202   }
203203
src/mess/drivers/mirage.c
r11240r11241
8585
8686void mirage_state::machine_reset()
8787{
88   es5503_set_base(m_machine.device("es5503"), m_machine.region("ensoniq")->base());
88   es5503_set_base(machine().device("es5503"), machine().region("ensoniq")->base());
8989
9090   last_sndram_bank = 0;
91   memory_set_bankptr(m_machine, "sndbank", m_machine.region("ensoniq")->base() );
91   memory_set_bankptr(machine(), "sndbank", machine().region("ensoniq")->base() );
9292}
9393
9494static ADDRESS_MAP_START( mirage_map, AS_PROGRAM, 8, mirage_state )
src/mess/drivers/rex6000.c
r11240r11241
123123      case 1:      //bank 1 high
124124      {
125125         //bank 1 start at 0x8000
126         UINT8 *bank_base = get_bank_ptr(m_machine, MAKE_BANK(m_bank[0], m_bank[1]&0x0f) + 4);
126         UINT8 *bank_base = get_bank_ptr(machine(), MAKE_BANK(m_bank[0], m_bank[1]&0x0f) + 4);
127127
128128         if (bank_base != NULL)
129129         {
130130            program->install_readwrite_bank(0x8000, 0x9fff, "bank1");
131            memory_set_bankptr(m_machine, "bank1", bank_base);
131            memory_set_bankptr(machine(), "bank1", bank_base);
132132         }
133133         else
134134         {
r11240r11241
140140      case 2:      //bank 2 low
141141      case 3:      //bank 2 high
142142      {
143         UINT8 *bank_base = get_bank_ptr(m_machine, MAKE_BANK(m_bank[2], m_bank[3]&0x1f));
143         UINT8 *bank_base = get_bank_ptr(machine(), MAKE_BANK(m_bank[2], m_bank[3]&0x1f));
144144
145145         if (bank_base != NULL)
146146         {
147147            program->install_readwrite_bank(0xa000, 0xbfff, "bank2");
148            memory_set_bankptr(m_machine, "bank2", bank_base);
148            memory_set_bankptr(machine(), "bank2", bank_base);
149149         }
150150         else
151151         {
r11240r11241
276276
277277READ8_MEMBER( rex6000_state::touchscreen_r )
278278{
279   UINT16 x = input_port_read(m_machine, "PENX");
280   UINT16 y = input_port_read(m_machine, "PENY");
281   UINT16 battery = input_port_read(m_machine, "BATTERY");
279   UINT16 x = input_port_read(machine(), "PENX");
280   UINT16 y = input_port_read(machine(), "PENY");
281   UINT16 battery = input_port_read(machine(), "BATTERY");
282282
283283   switch (offset)
284284   {
285285      case 0x08:
286         return ((input_port_read(m_machine, "INPUT") & 0x40) ? 0x20 : 0x00) | 0X10;
286         return ((input_port_read(machine(), "INPUT") & 0x40) ? 0x20 : 0x00) | 0X10;
287287      case 0x09:
288288         if (m_touchscreen[4] & 0x80)
289289            return (battery>>0) & 0xff;
r11240r11241
369369{
370370   UINT8 *ram = ram_get_ptr(m_ram);
371371
372   memory_set_bankptr(m_machine, "bank1", (UINT8*)m_machine.region("flash0")->base() + 0x8000);
373   memory_set_bankptr(m_machine, "bank2", (UINT8*)m_machine.region("flash0")->base());
374   memory_set_bankptr(m_machine, "ram", ram + 0x4000);
372   memory_set_bankptr(machine(), "bank1", (UINT8*)machine().region("flash0")->base() + 0x8000);
373   memory_set_bankptr(machine(), "bank2", (UINT8*)machine().region("flash0")->base());
374   memory_set_bankptr(machine(), "ram", ram + 0x4000);
375375
376376   memset(ram, 0, ram_get_size(m_ram));
377377   memset(m_bank, 0, sizeof(m_bank));
r11240r11241
389389
390390bool rex6000_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
391391{
392   UINT8 *lcd_base = get_bank_ptr(m_machine, m_lcd_addr);
392   UINT8 *lcd_base = get_bank_ptr(machine(), m_lcd_addr);
393393
394394   if (m_lcd_enabled && lcd_base != NULL)
395395   {
src/mess/drivers/v1050.c
r11240r11241
127127   if (BIT(m_bank, 0))
128128   {
129129      program->install_readwrite_bank(0x0000, 0x1fff, "bank1");
130      memory_set_bank(m_machine, "bank1", bank);
130      memory_set_bank(machine(), "bank1", bank);
131131   }
132132   else
133133   {
134134      program->install_read_bank(0x0000, 0x1fff, "bank1");
135135      program->unmap_write(0x0000, 0x1fff);
136      memory_set_bank(m_machine, "bank1", 3);
136      memory_set_bank(machine(), "bank1", 3);
137137   }
138138
139   memory_set_bank(m_machine, "bank2", bank);
139   memory_set_bank(machine(), "bank2", bank);
140140
141141   if (bank == 2)
142142   {
r11240r11241
146146   {
147147      program->install_readwrite_bank(0x4000, 0x7fff, "bank3");
148148      program->install_readwrite_bank(0x8000, 0xbfff, "bank4");
149      memory_set_bank(m_machine, "bank3", bank);
150      memory_set_bank(m_machine, "bank4", bank);
149      memory_set_bank(machine(), "bank3", bank);
150      memory_set_bank(machine(), "bank4", bank);
151151   }
152152
153   memory_set_bank(m_machine, "bank5", bank);
153   memory_set_bank(machine(), "bank5", bank);
154154}
155155
156156/* Keyboard HACK */
r11240r11241
224224   int table = 0, row, col;
225225   int keydata = 0xff;
226226
227   UINT8 line_mod = input_port_read(m_machine, "ROW12");
227   UINT8 line_mod = input_port_read(machine(), "ROW12");
228228
229229   if((line_mod & 0x07) && (line_mod & 0x18))
230230   {
r11240r11241
242242   /* scan keyboard */
243243   for (row = 0; row < 12; row++)
244244   {
245      UINT8 data = input_port_read(m_machine, keynames[row]);
245      UINT8 data = input_port_read(machine(), keynames[row]);
246246
247247      for (col = 0; col < 8; col++)
248248      {
r11240r11241
346346{
347347    static const char *const KEY_ROW[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8", "X9", "XA", "XB" };
348348
349    return input_port_read(m_machine, KEY_ROW[m_keylatch]);
349    return input_port_read(machine(), KEY_ROW[m_keylatch]);
350350}
351351
352352WRITE8_MEMBER( v1050_state::keyboard_w )
r11240r11241
11081108   device_set_irq_callback(m_maincpu, v1050_int_ack);
11091109
11101110   /* setup memory banking */
1111   UINT8 *ram = ram_get_ptr(m_machine.device(RAM_TAG));
1111   UINT8 *ram = ram_get_ptr(machine().device(RAM_TAG));
11121112
1113   memory_configure_bank(m_machine, "bank1", 0, 2, ram, 0x10000);
1114   memory_configure_bank(m_machine, "bank1", 2, 1, ram + 0x1c000, 0);
1115   memory_configure_bank(m_machine, "bank1", 3, 1, m_machine.region(Z80_TAG)->base(), 0);
1113   memory_configure_bank(machine(), "bank1", 0, 2, ram, 0x10000);
1114   memory_configure_bank(machine(), "bank1", 2, 1, ram + 0x1c000, 0);
1115   memory_configure_bank(machine(), "bank1", 3, 1, machine().region(Z80_TAG)->base(), 0);
11161116
11171117   program->install_readwrite_bank(0x2000, 0x3fff, "bank2");
1118   memory_configure_bank(m_machine, "bank2", 0, 2, ram + 0x2000, 0x10000);
1119   memory_configure_bank(m_machine, "bank2", 2, 1, ram + 0x1e000, 0);
1118   memory_configure_bank(machine(), "bank2", 0, 2, ram + 0x2000, 0x10000);
1119   memory_configure_bank(machine(), "bank2", 2, 1, ram + 0x1e000, 0);
11201120
11211121   program->install_readwrite_bank(0x4000, 0x7fff, "bank3");
1122   memory_configure_bank(m_machine, "bank3", 0, 2, ram + 0x4000, 0x10000);
1122   memory_configure_bank(machine(), "bank3", 0, 2, ram + 0x4000, 0x10000);
11231123
11241124   program->install_readwrite_bank(0x8000, 0xbfff, "bank4");
1125   memory_configure_bank(m_machine, "bank4", 0, 2, ram + 0x8000, 0x10000);
1125   memory_configure_bank(machine(), "bank4", 0, 2, ram + 0x8000, 0x10000);
11261126
11271127   program->install_readwrite_bank(0xc000, 0xffff, "bank5");
1128   memory_configure_bank(m_machine, "bank5", 0, 3, ram + 0xc000, 0);
1128   memory_configure_bank(machine(), "bank5", 0, 3, ram + 0xc000, 0);
11291129
11301130   bankswitch();
11311131
11321132   /* register for state saving */
1133   state_save_register_global(m_machine, m_int_mask);
1134   state_save_register_global(m_machine, m_int_state);
1135   state_save_register_global(m_machine, m_f_int_enb);
1136   state_save_register_global(m_machine, m_keylatch);
1137   state_save_register_global(m_machine, m_keydata);
1138   state_save_register_global(m_machine, m_keyavail);
1139   state_save_register_global(m_machine, m_kb_so);
1140   state_save_register_global(m_machine, m_rxrdy);
1141   state_save_register_global(m_machine, m_txrdy);
1142   state_save_register_global(m_machine, m_baud_sel);
1143   state_save_register_global(m_machine, m_bank);
1133   state_save_register_global(machine(), m_int_mask);
1134   state_save_register_global(machine(), m_int_state);
1135   state_save_register_global(machine(), m_f_int_enb);
1136   state_save_register_global(machine(), m_keylatch);
1137   state_save_register_global(machine(), m_keydata);
1138   state_save_register_global(machine(), m_keyavail);
1139   state_save_register_global(machine(), m_kb_so);
1140   state_save_register_global(machine(), m_rxrdy);
1141   state_save_register_global(machine(), m_txrdy);
1142   state_save_register_global(machine(), m_baud_sel);
1143   state_save_register_global(machine(), m_bank);
11441144}
11451145
11461146void v1050_state::machine_reset()
src/mess/drivers/ql.c
r11240r11241
248248
249249   UINT8 data = 0;
250250
251   if (BIT(m_keylatch, 0)) data |= input_port_read(m_machine, "ROW0") | input_port_read(m_machine, "JOY0");
252   if (BIT(m_keylatch, 1)) data |= input_port_read(m_machine, "ROW1") | input_port_read(m_machine, "JOY1");
253   if (BIT(m_keylatch, 2)) data |= input_port_read(m_machine, "ROW2");
254   if (BIT(m_keylatch, 3)) data |= input_port_read(m_machine, "ROW3");
255   if (BIT(m_keylatch, 4)) data |= input_port_read(m_machine, "ROW4");
256   if (BIT(m_keylatch, 5)) data |= input_port_read(m_machine, "ROW5");
257   if (BIT(m_keylatch, 6)) data |= input_port_read(m_machine, "ROW6");
258   if (BIT(m_keylatch, 7)) data |= input_port_read(m_machine, "ROW7");
251   if (BIT(m_keylatch, 0)) data |= input_port_read(machine(), "ROW0") | input_port_read(machine(), "JOY0");
252   if (BIT(m_keylatch, 1)) data |= input_port_read(machine(), "ROW1") | input_port_read(machine(), "JOY1");
253   if (BIT(m_keylatch, 2)) data |= input_port_read(machine(), "ROW2");
254   if (BIT(m_keylatch, 3)) data |= input_port_read(machine(), "ROW3");
255   if (BIT(m_keylatch, 4)) data |= input_port_read(machine(), "ROW4");
256   if (BIT(m_keylatch, 5)) data |= input_port_read(machine(), "ROW5");
257   if (BIT(m_keylatch, 6)) data |= input_port_read(machine(), "ROW6");
258   if (BIT(m_keylatch, 7)) data |= input_port_read(machine(), "ROW7");
259259
260260   return data;
261261}
r11240r11241
265265   UINT8   result = 0;
266266
267267   if(LOG_DISK_READ)
268      logerror("%s DiskIO:Read of %08X\n",m_machine.describe_context(),m_disk_io_base+offset);
268      logerror("%s DiskIO:Read of %08X\n",machine().describe_context(),m_disk_io_base+offset);
269269     
270270   switch (offset)
271271   {
r11240r11241
273273      case 0x0001   : result=wd17xx_r(m_fdc, offset); break;
274274      case 0x0002   : result=wd17xx_r(m_fdc, offset); break;
275275      case 0x0003   : result=wd17xx_r(m_fdc, offset); break;
276      default      : logerror("%s DiskIO undefined read : from %08X\n",m_machine.describe_context(),m_disk_io_base+offset); break;   
276      default      : logerror("%s DiskIO undefined read : from %08X\n",machine().describe_context(),m_disk_io_base+offset); break;   
277277   }
278278   
279279   return result;
r11240r11241
282282WRITE8_MEMBER( ql_state::disk_io_w )
283283{
284284   if(LOG_DISK_WRITE)
285      logerror("%s DiskIO:Write %02X to %08X\n",m_machine.describe_context(),data,m_disk_io_base+offset);
285      logerror("%s DiskIO:Write %02X to %08X\n",machine().describe_context(),data,m_disk_io_base+offset);
286286
287287   switch (offset)
288288   {
r11240r11241
296296                   m_printer_char=data;
297297      case 0x2000   : if(m_disk_type==DISK_TYPE_TRUMP)
298298                  trump_card_set_control(data);break;
299      default      : logerror("%s DiskIO undefined write : %02X to %08X\n",m_machine.describe_context(),data,m_disk_io_base+offset); break;     
299      default      : logerror("%s DiskIO undefined write : %02X to %08X\n",machine().describe_context(),data,m_disk_io_base+offset); break;     
300300   }
301301}
302302
r11240r11241
310310      space.unmap_readwrite(0x0c0000, 0x0fffff);
311311   
312312   // Setup trumcard rom mapped to rom so unlink us
313   space.install_rom(0x010000, 0x018000, &m_machine.region(M68008_TAG)->base()[TRUMP_ROM_BASE]);
313   space.install_rom(0x010000, 0x018000, &machine().region(M68008_TAG)->base()[TRUMP_ROM_BASE]);
314314
315   return m_machine.region(M68008_TAG)->base()[TRUMP_ROM_BASE+offset];   
315   return machine().region(M68008_TAG)->base()[TRUMP_ROM_BASE+offset];   
316316}
317317
318318READ8_MEMBER( ql_state::cart_rom_r )
319319{
320320   // Setup trumcard rom mapped in at $c0000   
321   space.install_rom(0x0c0000, 0x0c8000, &m_machine.region(M68008_TAG)->base()[TRUMP_ROM_BASE]);
321   space.install_rom(0x0c0000, 0x0c8000, &machine().region(M68008_TAG)->base()[TRUMP_ROM_BASE]);
322322
323323   // Setup cart rom to rom handler, so unlink us
324   space.install_rom(0x0c000, 0x0ffff, &m_machine.region(M68008_TAG)->base()[CART_ROM_BASE]);
324   space.install_rom(0x0c000, 0x0ffff, &machine().region(M68008_TAG)->base()[CART_ROM_BASE]);
325325
326   return m_machine.region(M68008_TAG)->base()[CART_ROM_BASE+offset];
326   return machine().region(M68008_TAG)->base()[CART_ROM_BASE+offset];
327327}
328328
329329void ql_state::trump_card_set_control(UINT8 data)
r11240r11241
927927void ql_state::machine_start()
928928{
929929   // register for state saving
930   state_save_register_global(m_machine, m_keylatch);
931   state_save_register_global(m_machine, m_ipl);
932   state_save_register_global(m_machine, m_comdata);
933   state_save_register_global(m_machine, m_baudx4);
934   state_save_register_global(m_machine, m_printer_char);
935   state_save_register_global(m_machine, m_disk_io_byte);
930   state_save_register_global(machine(), m_keylatch);
931   state_save_register_global(machine(), m_ipl);
932   state_save_register_global(machine(), m_comdata);
933   state_save_register_global(machine(), m_baudx4);
934   state_save_register_global(machine(), m_printer_char);
935   state_save_register_global(machine(), m_disk_io_byte);
936936}
937937
938938void ql_state::machine_reset()
939939{
940940   address_space    *program    = m_maincpu->memory().space(AS_PROGRAM);
941941
942   m_disk_type=input_port_read(m_machine,QL_CONFIG_PORT) & DISK_TYPE_MASK;
942   m_disk_type=input_port_read(machine(),QL_CONFIG_PORT) & DISK_TYPE_MASK;
943943   logerror("disktype=%d\n",m_disk_type);
944944
945945   m_printer_char=0;
r11240r11241
974974   {
975975      case DISK_TYPE_SANDY :
976976         logerror("Configuring SandySuperDisk\n");
977         program->install_rom(0x0c0000, 0x0c3fff, &m_machine.region(M68008_TAG)->base()[SANDY_ROM_BASE]);
977         program->install_rom(0x0c0000, 0x0c3fff, &machine().region(M68008_TAG)->base()[SANDY_ROM_BASE]);
978978         program->install_read_handler(SANDY_IO_BASE, SANDY_IO_END, 0, 0, read8_delegate(FUNC(ql_state::disk_io_r), this));
979979         program->install_write_handler(SANDY_IO_BASE, SANDY_IO_END, 0, 0, write8_delegate(FUNC(ql_state::disk_io_w), this));
980980         m_disk_io_base=SANDY_IO_BASE;
src/mess/drivers/cgc7900.c
r11240r11241
406406
407407void cgc7900_state::machine_reset()
408408{
409   UINT8* user1 = m_machine.region(M68000_TAG)->base();
409   UINT8* user1 = machine().region(M68000_TAG)->base();
410410
411411   memcpy((UINT8*)m_chrom_ram,user1,8);
412412
src/mess/drivers/abc80x.c
r11240r11241
301301   else
302302   {
303303      // BASIC ROM selected
304      program->install_rom(0x0000, 0x3fff, m_machine.region(Z80_TAG)->base());
304      program->install_rom(0x0000, 0x3fff, machine().region(Z80_TAG)->base());
305305   }
306306}
307307
r11240r11241
317317   if (m_lrs)
318318   {
319319      // ROM and video RAM selected
320      program->install_rom(0x0000, 0x77ff, m_machine.region(Z80_TAG)->base());
320      program->install_rom(0x0000, 0x77ff, machine().region(Z80_TAG)->base());
321321      program->install_ram(0x7800, 0x7fff, m_char_ram);
322322   }
323323   else
r11240r11241
356356         //logerror("%04x-%04x: Video RAM %04x (32K)\n", start_addr, end_addr, videoram_offset);
357357
358358         program->install_readwrite_bank(start_addr, end_addr, bank_name);
359         memory_configure_bank(m_machine, bank_name, 1, 1, m_video_ram + videoram_offset, 0);
360         memory_set_bank(m_machine, bank_name, 1);
359         memory_configure_bank(machine(), bank_name, 1, 1, m_video_ram + videoram_offset, 0);
360         memory_set_bank(machine(), bank_name, 1);
361361      }
362362
363363      for (bank = 9; bank <= 16; bank++)
r11240r11241
370370         //logerror("%04x-%04x: Work RAM (32K)\n", start_addr, end_addr);
371371
372372         program->install_readwrite_bank(start_addr, end_addr, bank_name);
373         memory_set_bank(m_machine, bank_name, 0);
373         memory_set_bank(machine(), bank_name, 0);
374374      }
375375   }
376376   else
r11240r11241
390390            //logerror("%04x-%04x: Video RAM %04x (4K)\n", start_addr, end_addr, videoram_offset);
391391
392392            program->install_readwrite_bank(start_addr, end_addr, bank_name);
393            memory_configure_bank(m_machine, bank_name, 1, 1, m_video_ram + videoram_offset, 0);
394            memory_set_bank(m_machine, bank_name, 1);
393            memory_configure_bank(machine(), bank_name, 1, 1, m_video_ram + videoram_offset, 0);
394            memory_set_bank(machine(), bank_name, 1);
395395         }
396396         else
397397         {
r11240r11241
405405
406406               program->install_read_bank(start_addr, end_addr, bank_name);
407407               program->unmap_write(start_addr, end_addr);
408               memory_set_bank(m_machine, bank_name, 0);
408               memory_set_bank(machine(), bank_name, 0);
409409               break;
410410
411411            case 8:
r11240r11241
415415               program->install_read_bank(0x7000, 0x77ff, bank_name);
416416               program->unmap_write(0x7000, 0x77ff);
417417               program->install_readwrite_handler(0x7800, 0x7fff, 0, 0, read8_delegate(FUNC(abc806_state::charram_r),this), write8_delegate(FUNC(abc806_state::charram_w),this));
418               memory_set_bank(m_machine, bank_name, 0);
418               memory_set_bank(machine(), bank_name, 0);
419419               break;
420420
421421            default:
r11240r11241
423423               //logerror("%04x-%04x: Work RAM (4K)\n", start_addr, end_addr);
424424
425425               program->install_readwrite_bank(start_addr, end_addr, bank_name);
426               memory_set_bank(m_machine, bank_name, 0);
426               memory_set_bank(machine(), bank_name, 0);
427427               break;
428428            }
429429         }
r11240r11241
456456            program->install_readwrite_bank(start_addr, end_addr, bank_name);
457457         }
458458
459         memory_configure_bank(m_machine, bank_name, 1, 1, m_video_ram + videoram_offset, 0);
460         memory_set_bank(m_machine, bank_name, 1);
459         memory_configure_bank(machine(), bank_name, 1, 1, m_video_ram + videoram_offset, 0);
460         memory_set_bank(machine(), bank_name, 1);
461461      }
462462   }
463463}
r11240r11241
554554
555555   if (m_kb_stb && m_kb_row < 12)
556556   {
557      data = input_port_read(m_machine, ABC800_KEY_ROW[m_kb_row]);
557      data = input_port_read(machine(), ABC800_KEY_ROW[m_kb_row]);
558558   }
559559
560560   return data;
r11240r11241
12711271   m_kb_txd = 1;
12721272
12731273   // register for state saving
1274   state_save_register_global(m_machine, m_fetch_charram);
1275   state_save_register_global(m_machine, m_kb_row);
1276   state_save_register_global(m_machine, m_kb_txd);
1277   state_save_register_global(m_machine, m_kb_clk);
1278   state_save_register_global(m_machine, m_kb_stb);
1279   state_save_register_global(m_machine, m_pling);
1280   state_save_register_global(m_machine, m_sio_rxcb);
1281   state_save_register_global(m_machine, m_sio_txcb);
1274   state_save_register_global(machine(), m_fetch_charram);
1275   state_save_register_global(machine(), m_kb_row);
1276   state_save_register_global(machine(), m_kb_txd);
1277   state_save_register_global(machine(), m_kb_clk);
1278   state_save_register_global(machine(), m_kb_stb);
1279   state_save_register_global(machine(), m_pling);
1280   state_save_register_global(machine(), m_sio_rxcb);
1281   state_save_register_global(machine(), m_sio_txcb);
12821282}
12831283
12841284
r11240r11241
12881288
12891289void abc800_state::machine_reset()
12901290{
1291   m_sb = input_port_read(m_machine, "SB");
1291   m_sb = input_port_read(machine(), "SB");
12921292
12931293   m_fetch_charram = 0;
12941294   bankswitch();
r11240r11241
13071307void abc802_state::machine_start()
13081308{
13091309   // register for state saving
1310   state_save_register_global(m_machine, m_lrs);
1311   state_save_register_global(m_machine, m_pling);
1312   state_save_register_global(m_machine, m_keylatch);
1310   state_save_register_global(machine(), m_lrs);
1311   state_save_register_global(machine(), m_pling);
1312   state_save_register_global(machine(), m_keylatch);
13131313}
13141314
13151315
r11240r11241
13191319
13201320void abc802_state::machine_reset()
13211321{
1322   UINT8 config = input_port_read(m_machine, "CONFIG");
1323   m_sb = input_port_read(m_machine, "SB");
1322   UINT8 config = input_port_read(machine(), "CONFIG");
1323   m_sb = input_port_read(machine(), "SB");
13241324
13251325   // memory banking
13261326   m_lrs = 1;
r11240r11241
13461346
13471347void abc806_state::machine_start()
13481348{
1349   UINT8 *mem = m_machine.region(Z80_TAG)->base();
1349   UINT8 *mem = machine().region(Z80_TAG)->base();
13501350   UINT32 videoram_size = ram_get_size(m_ram) - (32 * 1024);
13511351   int bank;
13521352   char bank_name[10];
13531353
13541354   // setup memory banking
1355   m_video_ram = auto_alloc_array(m_machine, UINT8, videoram_size);
1355   m_video_ram = auto_alloc_array(machine(), UINT8, videoram_size);
13561356
13571357   for (bank = 1; bank <= 16; bank++)
13581358   {
13591359      sprintf(bank_name,"bank%d",bank);
1360      memory_configure_bank(m_machine, bank_name, 0, 1, mem + (0x1000 * (bank - 1)), 0);
1361      memory_configure_bank(m_machine, bank_name, 1, 1, m_video_ram, 0);
1362      memory_set_bank(m_machine, bank_name, 0);
1360      memory_configure_bank(machine(), bank_name, 0, 1, mem + (0x1000 * (bank - 1)), 0);
1361      memory_configure_bank(machine(), bank_name, 1, 1, m_video_ram, 0);
1362      memory_set_bank(machine(), bank_name, 0);
13631363   }
13641364
13651365   // register for state saving
1366   state_save_register_global(m_machine, m_keydtr);
1367   state_save_register_global(m_machine, m_eme);
1368   state_save_register_global(m_machine, m_fetch_charram);
1369   state_save_register_global_array(m_machine, m_map);
1370   state_save_register_global(m_machine, m_keylatch);
1366   state_save_register_global(machine(), m_keydtr);
1367   state_save_register_global(machine(), m_eme);
1368   state_save_register_global(machine(), m_fetch_charram);
1369   state_save_register_global_array(machine(), m_map);
1370   state_save_register_global(machine(), m_keylatch);
13711371}
13721372
13731373
r11240r11241
13771377
13781378void abc806_state::machine_reset()
13791379{
1380   m_sb = input_port_read(m_machine, "SB");
1380   m_sb = input_port_read(machine(), "SB");
13811381
13821382   // setup memory banking
13831383   int bank;
r11240r11241
13861386   for (bank = 1; bank <= 16; bank++)
13871387   {
13881388      sprintf(bank_name,"bank%d",bank);
1389      memory_set_bank(m_machine, bank_name, 0);
1389      memory_set_bank(machine(), bank_name, 0);
13901390   }
13911391
13921392   bankswitch();
src/mess/drivers/bigbord2.c
r11240r11241
445445void bigbord2_state::video_start()
446446{
447447   /* find memory regions */
448   m_char_rom = m_machine.region("chargen")->base();
448   m_char_rom = machine().region("chargen")->base();
449449}
450450
451451
r11240r11241
491491   floppy_install_load_proc(m_floppy1, bigbord2_load_proc);
492492
493493   /* register for state saving */
494   state_save_register_global(m_machine, m_term_data);
495   state_save_register_global(m_machine, m_scroll);
496   state_save_register_global(m_machine, m_ncset2);
497   state_save_register_global(m_machine, m_vatt);
498   state_save_register_global(m_machine, m_fdc_irq);
499   state_save_register_global(m_machine, m_fdc_drq);
500   state_save_register_global(m_machine, m_8n5);
501   state_save_register_global(m_machine, m_dsdd);
494   state_save_register_global(machine(), m_term_data);
495   state_save_register_global(machine(), m_scroll);
496   state_save_register_global(machine(), m_ncset2);
497   state_save_register_global(machine(), m_vatt);
498   state_save_register_global(machine(), m_fdc_irq);
499   state_save_register_global(machine(), m_fdc_drq);
500   state_save_register_global(machine(), m_8n5);
501   state_save_register_global(machine(), m_dsdd);
502502}
503503
504504void bigbord2_state::machine_reset()
src/mess/drivers/tmc1800.c
r11240r11241
169169{
170170   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
171171   UINT8 *ram = ram_get_ptr(m_ram);
172   UINT8 *rom = m_machine.region(CDP1802_TAG)->base();
172   UINT8 *rom = machine().region(CDP1802_TAG)->base();
173173   
174174   if (m_roc)
175175   {
r11240r11241
482482
483483READ_LINE_MEMBER( tmc1800_state::clear_r )
484484{
485   return BIT(input_port_read(m_machine, "RUN"), 0);
485   return BIT(input_port_read(machine(), "RUN"), 0);
486486}
487487
488488READ_LINE_MEMBER( tmc1800_state::ef2_r )
r11240r11241
493493READ_LINE_MEMBER( tmc1800_state::ef3_r )
494494{
495495   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
496   UINT8 data = ~input_port_read(m_machine, keynames[m_keylatch / 8]);
496   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
497497
498498   return BIT(data, m_keylatch % 8);
499499}
r11240r11241
523523
524524READ_LINE_MEMBER( osc1000b_state::clear_r )
525525{
526   return BIT(input_port_read(m_machine, "RUN"), 0);
526   return BIT(input_port_read(machine(), "RUN"), 0);
527527}
528528
529529READ_LINE_MEMBER( osc1000b_state::ef2_r )
r11240r11241
534534READ_LINE_MEMBER( osc1000b_state::ef3_r )
535535{
536536   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
537   UINT8 data = ~input_port_read(m_machine, keynames[m_keylatch / 8]);
537   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
538538
539539   return BIT(data, m_keylatch % 8);
540540}
r11240r11241
564564
565565READ_LINE_MEMBER( tmc2000_state::clear_r )
566566{
567   return BIT(input_port_read(m_machine, "RUN"), 0);
567   return BIT(input_port_read(machine(), "RUN"), 0);
568568}
569569
570570READ_LINE_MEMBER( tmc2000_state::ef2_r )
r11240r11241
575575READ_LINE_MEMBER( tmc2000_state::ef3_r )
576576{
577577   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
578   UINT8 data = ~input_port_read(m_machine, keynames[m_keylatch / 8]);
578   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
579579
580580   return BIT(data, m_keylatch % 8);
581581}
r11240r11241
586586   cdp1864_aoe_w(m_cti, state);
587587
588588   /* set Q led status */
589   set_led_status(m_machine, 1, state);
589   set_led_status(machine(), 1, state);
590590
591591   /* tape output */
592592   cassette_output(m_cassette, state ? 1.0 : -1.0);
r11240r11241
625625
626626READ_LINE_MEMBER( nano_state::clear_r )
627627{
628   int run = BIT(input_port_read(m_machine, "RUN"), 0);
629   int monitor = BIT(input_port_read(m_machine, "MONITOR"), 0);
628   int run = BIT(input_port_read(machine(), "RUN"), 0);
629   int monitor = BIT(input_port_read(machine(), "MONITOR"), 0);
630630
631631   return run & monitor;
632632}
r11240r11241
639639READ_LINE_MEMBER( nano_state::ef3_r )
640640{
641641   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
642   UINT8 data = ~input_port_read(m_machine, keynames[m_keylatch / 8]);
642   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
643643
644644   return BIT(data, m_keylatch % 8);
645645}
r11240r11241
650650   cdp1864_aoe_w(m_cti, state);
651651
652652   /* set Q led status */
653   set_led_status(m_machine, 1, state);
653   set_led_status(machine(), 1, state);
654654
655655   /* tape output */
656656   cassette_output(m_cassette, state ? 1.0 : -1.0);
r11240r11241
706706{
707707   UINT16 addr;
708708
709   m_colorram = auto_alloc_array(m_machine, UINT8, TMC2000_COLORRAM_SIZE);
709   m_colorram = auto_alloc_array(machine(), UINT8, TMC2000_COLORRAM_SIZE);
710710
711711   // randomize color RAM contents
712712   for (addr = 0; addr < TMC2000_COLORRAM_SIZE; addr++)
713713   {
714      m_colorram[addr] = m_machine.rand() & 0xff;
714      m_colorram[addr] = machine().rand() & 0xff;
715715   }
716716
717717   // state saving
r11240r11241
737737void nano_state::machine_start()
738738{
739739   /* allocate monitor timer */
740   m_ef4_timer = m_machine.scheduler().timer_alloc(FUNC(nano_ef4_tick));
740   m_ef4_timer = machine().scheduler().timer_alloc(FUNC(nano_ef4_tick));
741741
742742   /* register for state saving */
743743   save_item(NAME(m_keylatch));
r11240r11241
753753
754754   /* enable ROM */
755755   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
756   UINT8 *rom = m_machine.region(CDP1802_TAG)->base();
756   UINT8 *rom = machine().region(CDP1802_TAG)->base();
757757   program->install_rom(0x0000, 0x01ff, 0, 0x7e00, rom);
758758}
759759
src/mess/drivers/crvision.c
r11240r11241
584584
585585   for (i = 0; i < 8; i++)
586586   {
587      value = input_port_read(m_machine, keynames[pa][i]);
587      value = input_port_read(machine(), keynames[pa][i]);
588588
589589      if (value != 0xff)
590590      {
r11240r11241
680680
681681   UINT8 data = 0xff;
682682
683   if (!BIT(m_keylatch, 0)) data &= input_port_read(m_machine, "ROW0");
684   if (!BIT(m_keylatch, 1)) data &= input_port_read(m_machine, "ROW1");
685   if (!BIT(m_keylatch, 2)) data &= input_port_read(m_machine, "ROW2");
686   if (!BIT(m_keylatch, 3)) data &= input_port_read(m_machine, "ROW3");
687   if (!BIT(m_keylatch, 4)) data &= input_port_read(m_machine, "ROW4");
688   if (!BIT(m_keylatch, 5)) data &= input_port_read(m_machine, "ROW5");
689   if (!BIT(m_keylatch, 6)) data &= input_port_read(m_machine, "ROW6");
690   if (!BIT(m_keylatch, 7)) data &= input_port_read(m_machine, "ROW7");
683   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "ROW0");
684   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "ROW1");
685   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "ROW2");
686   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "ROW3");
687   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "ROW4");
688   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "ROW5");
689   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "ROW6");
690   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "ROW7");
691691
692692   return data;
693693}
r11240r11241
712712{
713713   UINT8 data = 0xff;
714714
715   if (!BIT(m_joylatch, 0)) data &= input_port_read(m_machine, "JOY0");
716   if (!BIT(m_joylatch, 1)) data &= input_port_read(m_machine, "JOY1");
717   if (!BIT(m_joylatch, 2)) data &= input_port_read(m_machine, "JOY2");
718   if (!BIT(m_joylatch, 3)) data &= input_port_read(m_machine, "JOY3");
715   if (!BIT(m_joylatch, 0)) data &= input_port_read(machine(), "JOY0");
716   if (!BIT(m_joylatch, 1)) data &= input_port_read(machine(), "JOY1");
717   if (!BIT(m_joylatch, 2)) data &= input_port_read(machine(), "JOY2");
718   if (!BIT(m_joylatch, 3)) data &= input_port_read(machine(), "JOY3");
719719
720720   return data;
721721}
src/mess/drivers/fmtowns.c
r11240r11241
22632263
22642264void towns_state::driver_start()
22652265{
2266   m_pic_master = m_machine.device("pic8259_master");
2267   m_pic_slave = m_machine.device("pic8259_slave");
2268   m_towns_vram = auto_alloc_array(m_machine,UINT32,0x20000);
2269   m_towns_gfxvram = auto_alloc_array(m_machine,UINT8,0x80000);
2270   m_towns_txtvram = auto_alloc_array(m_machine,UINT8,0x20000);
2271   //towns_sprram = auto_alloc_array(m_machine,UINT8,0x20000);
2272   m_towns_serial_rom = auto_alloc_array(m_machine,UINT8,256/8);
2273   towns_init_serial_rom(m_machine);
2274   towns_init_rtc(m_machine);
2275   m_towns_rtc_timer = m_machine.scheduler().timer_alloc(FUNC(rtc_second));
2276   m_towns_kb_timer = m_machine.scheduler().timer_alloc(FUNC(poll_keyboard));
2277   m_towns_mouse_timer = m_machine.scheduler().timer_alloc(FUNC(towns_mouse_timeout));
2278   m_towns_wait_timer = m_machine.scheduler().timer_alloc(FUNC(towns_wait_end));
2279   m_towns_freerun_counter = m_machine.scheduler().timer_alloc(FUNC(towns_freerun_inc));
2266   m_pic_master = machine().device("pic8259_master");
2267   m_pic_slave = machine().device("pic8259_slave");
2268   m_towns_vram = auto_alloc_array(machine(),UINT32,0x20000);
2269   m_towns_gfxvram = auto_alloc_array(machine(),UINT8,0x80000);
2270   m_towns_txtvram = auto_alloc_array(machine(),UINT8,0x20000);
2271   //towns_sprram = auto_alloc_array(machine(),UINT8,0x20000);
2272   m_towns_serial_rom = auto_alloc_array(machine(),UINT8,256/8);
2273   towns_init_serial_rom(machine());
2274   towns_init_rtc(machine());
2275   m_towns_rtc_timer = machine().scheduler().timer_alloc(FUNC(rtc_second));
2276   m_towns_kb_timer = machine().scheduler().timer_alloc(FUNC(poll_keyboard));
2277   m_towns_mouse_timer = machine().scheduler().timer_alloc(FUNC(towns_mouse_timeout));
2278   m_towns_wait_timer = machine().scheduler().timer_alloc(FUNC(towns_wait_end));
2279   m_towns_freerun_counter = machine().scheduler().timer_alloc(FUNC(towns_freerun_inc));
22802280
22812281   // CD-ROM init
2282   m_towns_cd.read_timer = m_machine.scheduler().timer_alloc(FUNC(towns_cdrom_read_byte), (void*)m_machine.device("dma_1"));
2282   m_towns_cd.read_timer = machine().scheduler().timer_alloc(FUNC(towns_cdrom_read_byte), (void*)machine().device("dma_1"));
22832283
2284   device_set_irq_callback(m_machine.device("maincpu"), towns_irq_callback);
2285   m_machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x100000,ram_get_size(m_machine.device(RAM_TAG))-1,0xffffffff,0,NULL);
2284   device_set_irq_callback(machine().device("maincpu"), towns_irq_callback);
2285   machine().device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0x100000,ram_get_size(machine().device(RAM_TAG))-1,0xffffffff,0,NULL);
22862286
22872287}
22882288
r11240r11241
22972297{
22982298   address_space *program;
22992299
2300   m_maincpu = m_machine.device("maincpu");
2300   m_maincpu = machine().device("maincpu");
23012301   program = m_maincpu->memory().space(AS_PROGRAM);
2302   m_dma_1 = m_machine.device("dma_1");
2303   m_dma_2 = m_machine.device("dma_2");
2304   m_fdc = m_machine.device("fdc");
2305   m_pic_master = m_machine.device("pic8259_master");
2306   m_pic_slave = m_machine.device("pic8259_slave");
2307   m_pit = m_machine.device("pit");
2308   m_messram = m_machine.device(RAM_TAG);
2309   m_cdrom = m_machine.device("cdrom");
2310   m_cdda = m_machine.device("cdda");
2311   m_speaker = m_machine.device("speaker");
2312   m_scsi = m_machine.device<fmscsi_device>("scsi");
2313   m_hd0 = m_machine.device("harddisk0");
2314   m_hd1 = m_machine.device("harddisk1");
2315   m_hd2 = m_machine.device("harddisk2");
2316   m_hd3 = m_machine.device("harddisk3");
2317   m_hd4 = m_machine.device("harddisk4");
2318   m_ram = m_machine.device(RAM_TAG);
2302   m_dma_1 = machine().device("dma_1");
2303   m_dma_2 = machine().device("dma_2");
2304   m_fdc = machine().device("fdc");
2305   m_pic_master = machine().device("pic8259_master");
2306   m_pic_slave = machine().device("pic8259_slave");
2307   m_pit = machine().device("pit");
2308   m_messram = machine().device(RAM_TAG);
2309   m_cdrom = machine().device("cdrom");
2310   m_cdda = machine().device("cdda");
2311   m_speaker = machine().device("speaker");
2312   m_scsi = machine().device<fmscsi_device>("scsi");
2313   m_hd0 = machine().device("harddisk0");
2314   m_hd1 = machine().device("harddisk1");
2315   m_hd2 = machine().device("harddisk2");
2316   m_hd3 = machine().device("harddisk3");
2317   m_hd4 = machine().device("harddisk4");
2318   m_ram = machine().device(RAM_TAG);
23192319   m_ftimer = 0x00;
23202320   m_nmi_mask = 0x00;
23212321   m_compat_mode = 0x00;
src/mess/drivers/mikrolab.c
r11240r11241
4040   UINT8 data = 0xff;
4141
4242   if (BIT(m_kp_matrix, 4))
43      data &= input_port_read(m_machine, "LINE1");
43      data &= input_port_read(machine(), "LINE1");
4444   if (BIT(m_kp_matrix, 5))
45      data &= input_port_read(m_machine, "LINE2");
45      data &= input_port_read(machine(), "LINE2");
4646   if (BIT(m_kp_matrix, 6))
47      data &= input_port_read(m_machine, "LINE3");
47      data &= input_port_read(machine(), "LINE3");
4848
4949   return data;
5050}
src/mess/drivers/gmaster.c
r11240r11241
1616{
1717   gmaster_state *state = space->machine().driver_data<gmaster_state>();
1818    UINT8 data = 0;
19    if (state->m_machine.ports[2] & 1)
19    if (state->m_gmachine.ports[2] & 1)
2020   {
2121      data = space->machine().region("maincpu")->base()[0x4000 + offset];
2222      logerror("%.4x external memory %.4x read %.2x\n", (int)cpu_get_reg(&space->device(), CPUINFO_INT_PC), 0x4000 + offset, data);
r11240r11241
3939    return data;
4040}
4141
42#define BLITTER_Y ((state->m_machine.ports[2]&4)|(state->m_video.data[0]&3))
42#define BLITTER_Y ((state->m_gmachine.ports[2]&4)|(state->m_video.data[0]&3))
4343
4444static WRITE8_HANDLER( gmaster_io_w )
4545{
4646   gmaster_state *state = space->machine().driver_data<gmaster_state>();
47    if (state->m_machine.ports[2] & 1)
47    if (state->m_gmachine.ports[2] & 1)
4848   {
4949      space->machine().region("maincpu")->base()[0x4000 + offset] = data;
5050      logerror("%.4x external memory %.4x written %.2x\n", (int)cpu_get_reg(&space->device(), CPUINFO_INT_PC), 0x4000 + offset, data);
r11240r11241
105105static READ8_HANDLER( gmaster_port_r )
106106{
107107   //gmaster_state *state = space->machine().driver_data<gmaster_state>();
108//  UINT8 data = state->m_machine.ports[offset];
108//  UINT8 data = state->m_gmachine.ports[offset];
109109    UINT8 data = 0xff;
110110    switch (offset)
111111   {
r11240r11241
121121static WRITE8_HANDLER( gmaster_port_w )
122122{
123123   gmaster_state *state = space->machine().driver_data<gmaster_state>();
124    state->m_machine.ports[offset] = data;
124    state->m_gmachine.ports[offset] = data;
125125    logerror("%.4x port %d written %.2x\n", (int)cpu_get_reg(&space->device(), CPUINFO_INT_PC), offset, data);
126126    switch (offset)
127127   {
src/mess/drivers/newbrain.c
r11240r11241
8686      case 0:
8787         /* ROM */
8888         memory_install_rom_helper(program, bank_name, bank_start, bank_end);
89         memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region("eim")->base() + eim_bank_start, 0);
89         memory_configure_bank(machine(), bank_name, 0, 1, machine().region("eim")->base() + eim_bank_start, 0);
9090         break;
9191
9292      case 2:
9393         /* RAM */
9494         memory_install_ram_helper(program, bank_name, bank_start, bank_end);
95         memory_configure_bank(m_machine, bank_name, 0, 1, m_eim_ram + eim_bank_start, 0);
95         memory_configure_bank(machine(), bank_name, 0, 1, m_eim_ram + eim_bank_start, 0);
9696         break;
9797
9898      default:
r11240r11241
118118      {
119119         /* all banks point to ROM at 0xe000 */
120120         memory_install_rom_helper(program, bank_name, bank_start, bank_end);
121         memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region(Z80_TAG)->base() + 0xe000, 0);
121         memory_configure_bank(machine(), bank_name, 0, 1, machine().region(Z80_TAG)->base() + 0xe000, 0);
122122      }
123123      else
124124      {
125         memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region(Z80_TAG)->base() + bank_start, 0);
125         memory_configure_bank(machine(), bank_name, 0, 1, machine().region(Z80_TAG)->base() + bank_start, 0);
126126
127127         if (bank < 5)
128128         {
r11240r11241
132132         else if (bank == 5)
133133         {
134134            /* 0x8000-0x9fff */
135            if (m_machine.region("eim")->base())
135            if (machine().region("eim")->base())
136136            {
137137               /* expansion interface ROM */
138138               memory_install_rom_helper(program, bank_name, bank_start, bank_end);
139               memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region("eim")->base() + 0x4000, 0);
139               memory_configure_bank(machine(), bank_name, 0, 1, machine().region("eim")->base() + 0x4000, 0);
140140            }
141141            else
142142            {
143143               /* mirror of 0xa000-0xbfff */
144               if (m_machine.region(Z80_TAG)->base()[0xa001] == 0)
144               if (machine().region(Z80_TAG)->base()[0xa001] == 0)
145145               {
146146                  /* unmapped on the M model */
147147                  memory_install_unmapped(program, bank_name, bank_start, bank_end);
r11240r11241
152152                  memory_install_rom_helper(program, bank_name, bank_start, bank_end);
153153               }
154154
155               memory_configure_bank(m_machine, bank_name, 0, 1, m_machine.region(Z80_TAG)->base() + 0xa000, 0);
155               memory_configure_bank(machine(), bank_name, 0, 1, machine().region(Z80_TAG)->base() + 0xa000, 0);
156156            }
157157         }
158158         else if (bank == 6)
159159         {
160160            /* 0xa000-0xbfff */
161            if (m_machine.region(Z80_TAG)->base()[0xa001] == 0)
161            if (machine().region(Z80_TAG)->base()[0xa001] == 0)
162162            {
163163               /* unmapped on the M model */
164164               memory_install_unmapped(program, bank_name, bank_start, bank_end);
r11240r11241
176176         }
177177      }
178178
179      memory_set_bank(m_machine, bank_name, 0);
179      memory_set_bank(machine(), bank_name, 0);
180180   }
181181}
182182
r11240r11241
472472         m_keylatch = 0;
473473      }
474474
475      m_keydata = input_port_read(m_machine, keynames[m_keylatch]);
475      m_keydata = input_port_read(machine(), keynames[m_keylatch]);
476476
477477      output_set_digit_value(m_keylatch, m_segment_data[m_keylatch]);
478478   }
r11240r11241
12661266   m_copregint = 1;
12671267
12681268   /* allocate reset timer */
1269   m_reset_timer = m_machine.scheduler().timer_alloc(FUNC(reset_tick));
1269   m_reset_timer = machine().scheduler().timer_alloc(FUNC(reset_tick));
12701270   m_reset_timer->adjust(attotime::from_usec(get_reset_t()));
12711271
12721272   /* allocate power up timer */
1273   m_pwrup_timer = m_machine.scheduler().timer_alloc(FUNC(pwrup_tick));
1273   m_pwrup_timer = machine().scheduler().timer_alloc(FUNC(pwrup_tick));
12741274   m_pwrup_timer->adjust(attotime::from_usec(get_pwrup_t()));
12751275
12761276   /* initialize variables */
r11240r11241
13141314   newbrain_state::machine_start();
13151315
13161316   /* allocate expansion RAM */
1317   m_eim_ram = auto_alloc_array(m_machine, UINT8, NEWBRAIN_EIM_RAM_SIZE);
1317   m_eim_ram = auto_alloc_array(machine(), UINT8, NEWBRAIN_EIM_RAM_SIZE);
13181318
13191319   /* register for state saving */
13201320   save_pointer(NAME(m_eim_ram), NEWBRAIN_EIM_RAM_SIZE);
src/mess/drivers/qtsbc.c
r11240r11241
6666
6767MACHINE_RESET_MEMBER(qtsbc_state)
6868{
69   UINT8* bios = m_machine.region("maincpu")->base()+0x10000;
69   UINT8* bios = machine().region("maincpu")->base()+0x10000;
7070   memcpy(m_ram, bios, 0x800);
7171}
7272
src/mess/drivers/ccs2422.c
r11240r11241
7070
7171MACHINE_RESET_MEMBER(ccs2422_state)
7272{
73   UINT8* user1 = m_machine.region("user1")->base();
73   UINT8* user1 = machine().region("user1")->base();
7474   memcpy((UINT8*)m_ccs_ram, user1, 0x0800);
7575
7676   // this should be rom/ram banking
src/mess/drivers/mes.c
r11240r11241
5353
5454VIDEO_START_MEMBER( mes_state )
5555{
56   m_p_chargen = m_machine.region("chargen")->base();
56   m_p_chargen = machine().region("chargen")->base();
5757}
5858
5959/* This system appears to have 2 screens. Not implemented.
src/mess/drivers/bullet.c
r11240r11241
100100{
101101   if (m_brom)
102102   {
103      memory_set_bank(m_machine, "bank1", 2);
103      memory_set_bank(machine(), "bank1", 2);
104104   }
105105   else
106106   {
107      memory_set_bank(m_machine, "bank1", m_segst);
107      memory_set_bank(machine(), "bank1", m_segst);
108108   }
109109
110   memory_set_bank(m_machine, "bank2", m_segst);
111   memory_set_bank(m_machine, "bank3", m_segst);
112   memory_set_bank(m_machine, "bank4", 0);
110   memory_set_bank(machine(), "bank2", m_segst);
111   memory_set_bank(machine(), "bank3", m_segst);
112   memory_set_bank(machine(), "bank4", 0);
113113}
114114
115115
r11240r11241
176176   UINT8 data = 0x10;
177177
178178   // DIP switches
179   data |= input_port_read(m_machine, "SW1") & 0x0f;
179   data |= input_port_read(machine(), "SW1") & 0x0f;
180180
181181   // floppy interrupt
182182   data |= wd17xx_intrq_r(m_fdc) << 6;
r11240r11241
653653   // setup memory banking
654654   UINT8 *ram = ram_get_ptr(m_ram);
655655
656   memory_configure_bank(m_machine, "bank1", 0, 2, ram, 0x10000);
657   memory_configure_bank(m_machine, "bank1", 2, 1, m_machine.region(Z80_TAG)->base(), 0);
658   memory_configure_bank(m_machine, "bank2", 0, 2, ram, 0x10000);
659   memory_configure_bank(m_machine, "bank3", 0, 2, ram + 0x0020, 0x10000);
660   memory_configure_bank(m_machine, "bank4", 0, 1, ram + 0xc000, 0);
656   memory_configure_bank(machine(), "bank1", 0, 2, ram, 0x10000);
657   memory_configure_bank(machine(), "bank1", 2, 1, machine().region(Z80_TAG)->base(), 0);
658   memory_configure_bank(machine(), "bank2", 0, 2, ram, 0x10000);
659   memory_configure_bank(machine(), "bank3", 0, 2, ram + 0x0020, 0x10000);
660   memory_configure_bank(machine(), "bank4", 0, 1, ram + 0xc000, 0);
661661
662662   // register for state saving
663   state_save_register_global(m_machine, m_segst);
664   state_save_register_global(m_machine, m_brom);
665   state_save_register_global(m_machine, m_exdma);
666   state_save_register_global(m_machine, m_buf);
667   state_save_register_global(m_machine, m_fdrdy);
668   state_save_register_global(m_machine, m_dartardy);
669   state_save_register_global(m_machine, m_dartbrdy);
670   state_save_register_global(m_machine, m_winrdy);
671   state_save_register_global(m_machine, m_exrdy1);
672   state_save_register_global(m_machine, m_exrdy2);
663   state_save_register_global(machine(), m_segst);
664   state_save_register_global(machine(), m_brom);
665   state_save_register_global(machine(), m_exdma);
666   state_save_register_global(machine(), m_buf);
667   state_save_register_global(machine(), m_fdrdy);
668   state_save_register_global(machine(), m_dartardy);
669   state_save_register_global(machine(), m_dartbrdy);
670   state_save_register_global(machine(), m_winrdy);
671   state_save_register_global(machine(), m_exrdy1);
672   state_save_register_global(machine(), m_exrdy2);
673673}
674674
675675
src/mess/drivers/kyocera.c
r11240r11241
123123      program->unmap_write(0x0000, 0x7fff);
124124   }
125125
126   memory_set_bank(m_machine, "bank1", rom_bank);
126   memory_set_bank(machine(), "bank1", rom_bank);
127127
128128   switch (ram_bank)
129129   {
r11240r11241
158158      break;
159159   }
160160
161   memory_set_bank(m_machine, "bank2", ram_bank);
161   memory_set_bank(machine(), "bank2", ram_bank);
162162}
163163
164164WRITE8_MEMBER( pc8201_state::bank_w )
r11240r11241
274274   data |= 0x20;
275275
276276   // low power sensor
277   data |= BIT(input_port_read(m_machine, "BATTERY"), 0) << 7;
277   data |= BIT(input_port_read(machine(), "BATTERY"), 0) << 7;
278278
279279   return data;
280280}
r11240r11241
317317   data |= 0x20;
318318
319319   // low power sensor
320   data |= BIT(input_port_read(m_machine, "BATTERY"), 0) << 7;
320   data |= BIT(input_port_read(machine(), "BATTERY"), 0) << 7;
321321
322322   return data;
323323}
r11240r11241
392392
393393   if (m_rom_sel)
394394   {
395      data = m_machine.region("option")->base()[m_rom_addr & 0x1ffff];
395      data = machine().region("option")->base()[m_rom_addr & 0x1ffff];
396396   }
397397
398398   return data;
r11240r11241
436436    */
437437
438438   /* ROM bank selection */
439   memory_set_bank(m_machine, "bank1", BIT(data, 0));
439   memory_set_bank(machine(), "bank1", BIT(data, 0));
440440
441441   /* printer strobe */
442442   centronics_strobe_w(m_centronics, BIT(data, 1));
r11240r11241
450450
451451READ8_MEMBER( kc85_state::keyboard_r )
452452{
453   return read_keyboard(m_machine, m_keylatch);
453   return read_keyboard(machine(), m_keylatch);
454454}
455455
456456void tandy200_state::bankswitch(UINT8 data)
r11240r11241
471471   {
472472      program->install_read_bank(0x0000, 0x7fff, "bank1");
473473      program->unmap_write(0x0000, 0x7fff);
474      memory_set_bank(m_machine, "bank1", rom_bank);
474      memory_set_bank(machine(), "bank1", rom_bank);
475475   }
476476
477477   if (ram_get_size(m_ram) < ((ram_bank + 1) * 24 * 1024))
r11240r11241
482482   else
483483   {
484484      program->install_readwrite_bank(0xa000, 0xffff, "bank2");
485      memory_set_bank(m_machine, "bank2", ram_bank);
485      memory_set_bank(machine(), "bank2", ram_bank);
486486   }
487487}
488488
r11240r11241
498498
499499READ8_MEMBER( tandy200_state::stbk_r )
500500{
501   return read_keyboard(m_machine, m_keylatch);
501   return read_keyboard(machine(), m_keylatch);
502502}
503503
504504WRITE8_MEMBER( tandy200_state::stbk_w )
r11240r11241
11211121   /* configure ROM banking */
11221122   program->install_read_bank(0x0000, 0x7fff, "bank1");
11231123   program->unmap_write(0x0000, 0x7fff);
1124   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(I8085_TAG)->base(), 0);
1125   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region("option")->base(), 0);
1126   memory_set_bank(m_machine, "bank1", 0);
1124   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(I8085_TAG)->base(), 0);
1125   memory_configure_bank(machine(), "bank1", 1, 1, machine().region("option")->base(), 0);
1126   memory_set_bank(machine(), "bank1", 0);
11271127
11281128   /* configure RAM banking */
11291129   switch (ram_get_size(m_ram))
r11240r11241
11381138      break;
11391139   }
11401140
1141   memory_configure_bank(m_machine, "bank2", 0, 1, ram_get_ptr(m_ram), 0);
1142   memory_set_bank(m_machine, "bank2", 0);
1141   memory_configure_bank(machine(), "bank2", 0, 1, ram_get_ptr(m_ram), 0);
1142   memory_set_bank(machine(), "bank2", 0);
11431143
11441144   /* register for state saving */
1145   state_save_register_global(m_machine, m_bank);
1146   state_save_register_global(m_machine, m_keylatch);
1147   state_save_register_global(m_machine, m_buzzer);
1148   state_save_register_global(m_machine, m_bell);
1145   state_save_register_global(machine(), m_bank);
1146   state_save_register_global(machine(), m_keylatch);
1147   state_save_register_global(machine(), m_buzzer);
1148   state_save_register_global(machine(), m_bell);
11491149}
11501150
11511151void pc8201_state::machine_start()
r11240r11241
11571157   m_rtc->oe_w(1);
11581158
11591159   /* configure ROM banking */
1160   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(I8085_TAG)->base(), 0);
1161   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region("option")->base(), 0);
1162   memory_configure_bank(m_machine, "bank1", 2, 2, ram + 0x8000, 0x8000);
1163   memory_set_bank(m_machine, "bank1", 0);
1160   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(I8085_TAG)->base(), 0);
1161   memory_configure_bank(machine(), "bank1", 1, 1, machine().region("option")->base(), 0);
1162   memory_configure_bank(machine(), "bank1", 2, 2, ram + 0x8000, 0x8000);
1163   memory_set_bank(machine(), "bank1", 0);
11641164
11651165   /* configure RAM banking */
1166   memory_configure_bank(m_machine, "bank2", 0, 1, ram, 0);
1167   memory_configure_bank(m_machine, "bank2", 2, 2, ram + 0x8000, 0x8000);
1168   memory_set_bank(m_machine, "bank2", 0);
1166   memory_configure_bank(machine(), "bank2", 0, 1, ram, 0);
1167   memory_configure_bank(machine(), "bank2", 2, 2, ram + 0x8000, 0x8000);
1168   memory_set_bank(machine(), "bank2", 0);
11691169
11701170   bankswitch(0);
11711171
11721172   /* register for state saving */
1173   state_save_register_global(m_machine, m_bank);
1174   state_save_register_global(m_machine, m_keylatch);
1175   state_save_register_global(m_machine, m_buzzer);
1176   state_save_register_global(m_machine, m_bell);
1177   state_save_register_global(m_machine, m_iosel);
1173   state_save_register_global(machine(), m_bank);
1174   state_save_register_global(machine(), m_keylatch);
1175   state_save_register_global(machine(), m_buzzer);
1176   state_save_register_global(machine(), m_bell);
1177   state_save_register_global(machine(), m_iosel);
11781178}
11791179
11801180void trsm100_state::machine_start()
r11240r11241
11881188   /* configure ROM banking */
11891189   program->install_read_bank(0x0000, 0x7fff, "bank1");
11901190   program->unmap_write(0x0000, 0x7fff);
1191   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(I8085_TAG)->base(), 0);
1192   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region("option")->base(), 0);
1193   memory_set_bank(m_machine, "bank1", 0);
1191   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(I8085_TAG)->base(), 0);
1192   memory_configure_bank(machine(), "bank1", 1, 1, machine().region("option")->base(), 0);
1193   memory_set_bank(machine(), "bank1", 0);
11941194
11951195   /* configure RAM banking */
11961196   switch (ram_get_size(m_ram))
r11240r11241
12151215      break;
12161216   }
12171217
1218   memory_configure_bank(m_machine, "bank2", 0, 1, ram_get_ptr(m_ram), 0);
1219   memory_set_bank(m_machine, "bank2", 0);
1218   memory_configure_bank(machine(), "bank2", 0, 1, ram_get_ptr(m_ram), 0);
1219   memory_set_bank(machine(), "bank2", 0);
12201220
12211221   /* register for state saving */
1222   state_save_register_global(m_machine, m_bank);
1223   state_save_register_global(m_machine, m_keylatch);
1224   state_save_register_global(m_machine, m_buzzer);
1225   state_save_register_global(m_machine, m_bell);
1222   state_save_register_global(machine(), m_bank);
1223   state_save_register_global(machine(), m_keylatch);
1224   state_save_register_global(machine(), m_buzzer);
1225   state_save_register_global(machine(), m_bell);
12261226}
12271227
12281228void tandy200_state::machine_start()
12291229{
12301230   /* configure ROM banking */
1231   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(I8085_TAG)->base(), 0);
1232   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region(I8085_TAG)->base() + 0x10000, 0);
1233   memory_configure_bank(m_machine, "bank1", 2, 1, m_machine.region("option")->base(), 0);
1234   memory_set_bank(m_machine, "bank1", 0);
1231   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(I8085_TAG)->base(), 0);
1232   memory_configure_bank(machine(), "bank1", 1, 1, machine().region(I8085_TAG)->base() + 0x10000, 0);
1233   memory_configure_bank(machine(), "bank1", 2, 1, machine().region("option")->base(), 0);
1234   memory_set_bank(machine(), "bank1", 0);
12351235
12361236   /* configure RAM banking */
1237   memory_configure_bank(m_machine, "bank2", 0, 3, ram_get_ptr(m_ram), 0x6000);
1238   memory_set_bank(m_machine, "bank2", 0);
1237   memory_configure_bank(machine(), "bank2", 0, 3, ram_get_ptr(m_ram), 0x6000);
1238   memory_set_bank(machine(), "bank2", 0);
12391239
12401240   /* register for state saving */
1241   state_save_register_global(m_machine, m_bank);
1242   state_save_register_global(m_machine, m_tp);
1243   state_save_register_global(m_machine, m_keylatch);
1244   state_save_register_global(m_machine, m_buzzer);
1245   state_save_register_global(m_machine, m_bell);
1241   state_save_register_global(machine(), m_bank);
1242   state_save_register_global(machine(), m_tp);
1243   state_save_register_global(machine(), m_keylatch);
1244   state_save_register_global(machine(), m_buzzer);
1245   state_save_register_global(machine(), m_bell);
12461246}
12471247
12481248static const cassette_config kc85_cassette_config =
src/mess/drivers/mccpm.c
r11240r11241
5959
6060MACHINE_RESET_MEMBER(mccpm_state)
6161{
62   UINT8* bios = m_machine.region("maincpu")->base();
62   UINT8* bios = machine().region("maincpu")->base();
6363   memcpy(m_ram, bios, 0x1000);
6464}
6565
src/mess/drivers/comx35.c
r11240r11241
281281
282282READ_LINE_MEMBER( comx35_state::shift_r )
283283{
284   return BIT(input_port_read(m_machine, "MODIFIERS"), 0);
284   return BIT(input_port_read(machine(), "MODIFIERS"), 0);
285285}
286286
287287READ_LINE_MEMBER( comx35_state::control_r )
288288{
289   return BIT(input_port_read(m_machine, "MODIFIERS"), 1);
289   return BIT(input_port_read(machine(), "MODIFIERS"), 1);
290290}
291291
292292static CDP1871_INTERFACE( comx35_cdp1871_intf )
src/mess/drivers/jtc.c
r11240r11241
542542void jtces40_state::video_start()
543543{
544544   /* allocate memory */
545   m_video_ram = auto_alloc_array(m_machine, UINT8, JTC_ES40_VIDEORAM_SIZE);
546   m_color_ram_r = auto_alloc_array(m_machine, UINT8, JTC_ES40_VIDEORAM_SIZE);
547   m_color_ram_g = auto_alloc_array(m_machine, UINT8, JTC_ES40_VIDEORAM_SIZE);
548   m_color_ram_b = auto_alloc_array(m_machine, UINT8, JTC_ES40_VIDEORAM_SIZE);
545   m_video_ram = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
546   m_color_ram_r = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
547   m_color_ram_g = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
548   m_color_ram_b = auto_alloc_array(machine(), UINT8, JTC_ES40_VIDEORAM_SIZE);
549549
550550   /* register for state saving */
551551   save_item(NAME(m_video_bank));
src/mess/drivers/tiki100.c
r11240r11241
5858         program->install_readwrite_handler(0x0000, 0x7fff, read8_delegate(FUNC(tiki100_state::gfxram_r), this), write8_delegate(FUNC(tiki100_state::gfxram_w), this));
5959         program->install_readwrite_bank(0x8000, 0xffff, "bank3");
6060
61         memory_set_bank(m_machine, "bank1", BANK_VIDEO_RAM);
62         memory_set_bank(m_machine, "bank2", BANK_VIDEO_RAM);
63         memory_set_bank(m_machine, "bank3", BANK_RAM);
61         memory_set_bank(machine(), "bank1", BANK_VIDEO_RAM);
62         memory_set_bank(machine(), "bank2", BANK_VIDEO_RAM);
63         memory_set_bank(machine(), "bank3", BANK_RAM);
6464      }
6565   }
6666   else
r11240r11241
7373         program->install_readwrite_bank(0x4000, 0x7fff, "bank2");
7474         program->install_readwrite_bank(0x8000, 0xffff, "bank3");
7575
76         memory_set_bank(m_machine, "bank1", BANK_ROM);
77         memory_set_bank(m_machine, "bank2", BANK_RAM);
78         memory_set_bank(m_machine, "bank3", BANK_RAM);
76         memory_set_bank(machine(), "bank1", BANK_ROM);
77         memory_set_bank(machine(), "bank2", BANK_RAM);
78         memory_set_bank(machine(), "bank3", BANK_RAM);
7979      }
8080      else
8181      {
r11240r11241
8484         program->install_readwrite_bank(0x4000, 0x7fff, "bank2");
8585         program->install_readwrite_bank(0x8000, 0xffff, "bank3");
8686
87         memory_set_bank(m_machine, "bank1", BANK_RAM);
88         memory_set_bank(m_machine, "bank2", BANK_RAM);
89         memory_set_bank(m_machine, "bank3", BANK_RAM);
87         memory_set_bank(machine(), "bank1", BANK_RAM);
88         memory_set_bank(machine(), "bank2", BANK_RAM);
89         memory_set_bank(machine(), "bank3", BANK_RAM);
9090      }
9191   }
9292}
r11240r11241
9696READ8_MEMBER( tiki100_state::keyboard_r )
9797{
9898   static const char *const keynames[] = { "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9", "ROW10", "ROW11", "ROW12" };
99   UINT8 data = input_port_read(m_machine, keynames[m_keylatch]);
99   UINT8 data = input_port_read(machine(), keynames[m_keylatch]);
100100
101101   m_keylatch++;
102102
r11240r11241
134134      int color = data & 0x0f;
135135      UINT8 colordata = ~m_palette;
136136
137      palette_set_color_rgb(m_machine, color, pal3bit(colordata >> 5), pal3bit(colordata >> 2), pal2bit(colordata >> 0));
137      palette_set_color_rgb(machine(), color, pal3bit(colordata >> 5), pal3bit(colordata >> 2), pal2bit(colordata >> 0));
138138   }
139139}
140140
r11240r11241
189189   floppy_drive_set_ready_state(m_floppy1, BIT(data, 6), 1);
190190
191191   /* GRAFIKK key led */
192   set_led_status(m_machine, 1, BIT(data, 5));
192   set_led_status(machine(), 1, BIT(data, 5));
193193
194194   /* LOCK key led */
195   set_led_status(m_machine, 2, BIT(data, 7));
195   set_led_status(machine(), 2, BIT(data, 7));
196196
197197   /* bankswitch */
198198   m_rome = BIT(data, 2);
r11240r11241
548548void tiki100_state::machine_start()
549549{
550550   /* allocate video RAM */
551   m_video_ram = auto_alloc_array(m_machine, UINT8, TIKI100_VIDEORAM_SIZE);
551   m_video_ram = auto_alloc_array(machine(), UINT8, TIKI100_VIDEORAM_SIZE);
552552
553553   /* setup memory banking */
554554   UINT8 *ram = ram_get_ptr(m_ram);
555555
556   memory_configure_bank(m_machine, "bank1", BANK_ROM, 1, m_machine.region(Z80_TAG)->base(), 0);
557   memory_configure_bank(m_machine, "bank1", BANK_RAM, 1, ram, 0);
558   memory_configure_bank(m_machine, "bank1", BANK_VIDEO_RAM, 1, m_video_ram, 0);
556   memory_configure_bank(machine(), "bank1", BANK_ROM, 1, machine().region(Z80_TAG)->base(), 0);
557   memory_configure_bank(machine(), "bank1", BANK_RAM, 1, ram, 0);
558   memory_configure_bank(machine(), "bank1", BANK_VIDEO_RAM, 1, m_video_ram, 0);
559559
560   memory_configure_bank(m_machine, "bank2", BANK_RAM, 1, ram + 0x4000, 0);
561   memory_configure_bank(m_machine, "bank2", BANK_VIDEO_RAM, 1, m_video_ram + 0x4000, 0);
560   memory_configure_bank(machine(), "bank2", BANK_RAM, 1, ram + 0x4000, 0);
561   memory_configure_bank(machine(), "bank2", BANK_VIDEO_RAM, 1, m_video_ram + 0x4000, 0);
562562
563   memory_configure_bank(m_machine, "bank3", BANK_RAM, 1, ram + 0x8000, 0);
563   memory_configure_bank(machine(), "bank3", BANK_RAM, 1, ram + 0x8000, 0);
564564
565565   bankswitch();
566566
src/mess/drivers/homez80.c
r11240r11241
4343{
4444   char kbdrow[8];
4545   sprintf(kbdrow,"LINE%d",offset);
46   return input_port_read(m_machine, kbdrow);
46   return input_port_read(machine(), kbdrow);
4747}
4848
4949static ADDRESS_MAP_START(homez80_mem, AS_PROGRAM, 8, homez80_state)
src/mess/drivers/abc1600.c
r11240r11241
414414      if (!BOOTE && (offset < 0x4000))
415415      {
416416         // _BOOTCE
417         UINT8 *rom = m_machine.region(MC68008P8_TAG)->base();
417         UINT8 *rom = machine().region(MC68008P8_TAG)->base();
418418         data = rom[offset];
419419      }
420420      else
r11240r11241
545545   // DMA status
546546   data |= m_cause;
547547   
548   watchdog_reset(m_machine);
548   watchdog_reset(machine());
549549
550550   return data;
551551}
src/mess/drivers/ob68k1a.c
r11240r11241
313313
314314   // set reset vector
315315   void *ram = program->get_write_ptr(0);
316   UINT8 *rom = m_machine.region(MC68000L10_TAG)->base();
316   UINT8 *rom = machine().region(MC68000L10_TAG)->base();
317317
318318   memcpy(ram, rom, 8);
319319
320   m_machine.firstcpu->reset();
320   machine().firstcpu->reset();
321321}
322322
323323
src/mess/drivers/tandy2k.c
r11240r11241
273273
274274   UINT8 data = 0xff;
275275
276   if (!BIT(m_keylatch, 0)) data &= input_port_read(m_machine, "Y0");
277   if (!BIT(m_keylatch, 1)) data &= input_port_read(m_machine, "Y1");
278   if (!BIT(m_keylatch, 2)) data &= input_port_read(m_machine, "Y2");
279   if (!BIT(m_keylatch, 3)) data &= input_port_read(m_machine, "Y3");
280   if (!BIT(m_keylatch, 4)) data &= input_port_read(m_machine, "Y4");
281   if (!BIT(m_keylatch, 5)) data &= input_port_read(m_machine, "Y5");
282   if (!BIT(m_keylatch, 6)) data &= input_port_read(m_machine, "Y6");
283   if (!BIT(m_keylatch, 7)) data &= input_port_read(m_machine, "Y7");
284   if (!BIT(m_keylatch, 8)) data &= input_port_read(m_machine, "Y8");
285   if (!BIT(m_keylatch, 9)) data &= input_port_read(m_machine, "Y9");
286   if (!BIT(m_keylatch, 10)) data &= input_port_read(m_machine, "Y10");
287   if (!BIT(m_keylatch, 11)) data &= input_port_read(m_machine, "Y11");
276   if (!BIT(m_keylatch, 0)) data &= input_port_read(machine(), "Y0");
277   if (!BIT(m_keylatch, 1)) data &= input_port_read(machine(), "Y1");
278   if (!BIT(m_keylatch, 2)) data &= input_port_read(machine(), "Y2");
279   if (!BIT(m_keylatch, 3)) data &= input_port_read(machine(), "Y3");
280   if (!BIT(m_keylatch, 4)) data &= input_port_read(machine(), "Y4");
281   if (!BIT(m_keylatch, 5)) data &= input_port_read(machine(), "Y5");
282   if (!BIT(m_keylatch, 6)) data &= input_port_read(machine(), "Y6");
283   if (!BIT(m_keylatch, 7)) data &= input_port_read(machine(), "Y7");
284   if (!BIT(m_keylatch, 8)) data &= input_port_read(machine(), "Y8");
285   if (!BIT(m_keylatch, 9)) data &= input_port_read(machine(), "Y9");
286   if (!BIT(m_keylatch, 10)) data &= input_port_read(machine(), "Y10");
287   if (!BIT(m_keylatch, 11)) data &= input_port_read(machine(), "Y11");
288288
289289   return ~data;
290290}
r11240r11241
852852   program->install_ram(0x00000, ram_size - 1, ram);
853853
854854   /* patch out i186 relocation register check */
855   UINT8 *rom = m_machine.region(I80186_TAG)->base();
855   UINT8 *rom = machine().region(I80186_TAG)->base();
856856   rom[0x1f16] = 0x90;
857857   rom[0x1f17] = 0x90;
858858
859859   /* register for state saving */
860   state_save_register_global(m_machine, m_dma_mux);
861   state_save_register_global(m_machine, m_kben);
862   state_save_register_global(m_machine, m_keylatch);
863   state_save_register_global(m_machine, m_extclk);
864   state_save_register_global(m_machine, m_rxrdy);
865   state_save_register_global(m_machine, m_txrdy);
866   state_save_register_global(m_machine, m_pb_sel);
867   state_save_register_global(m_machine, m_vidouts);
868   state_save_register_global(m_machine, m_clkspd);
869   state_save_register_global(m_machine, m_clkcnt);
870   state_save_register_global(m_machine, m_outspkr);
871   state_save_register_global(m_machine, m_spkrdata);
860   state_save_register_global(machine(), m_dma_mux);
861   state_save_register_global(machine(), m_kben);
862   state_save_register_global(machine(), m_keylatch);
863   state_save_register_global(machine(), m_extclk);
864   state_save_register_global(machine(), m_rxrdy);
865   state_save_register_global(machine(), m_txrdy);
866   state_save_register_global(machine(), m_pb_sel);
867   state_save_register_global(machine(), m_vidouts);
868   state_save_register_global(machine(), m_clkspd);
869   state_save_register_global(machine(), m_clkcnt);
870   state_save_register_global(machine(), m_outspkr);
871   state_save_register_global(machine(), m_spkrdata);
872872}
873873
874874/* Machine Driver */
src/mess/drivers/x07.c
r11240r11241
772772   }
773773   else                     //charset
774774   {
775      return m_machine.region("gfx1")->base()[pos];
775      return machine().region("gfx1")->base()[pos];
776776   }
777777}
778778
r11240r11241
782782
783783   if (m_kb_on)
784784   {
785      UINT8 shift = (input_port_read(m_machine, "A1") & 0x01);
785      UINT8 shift = (input_port_read(machine, "A1") & 0x01);
786786      UINT16 udk_s = udk_offset[(shift*6) +  idx - 1];
787787
788788      /* First 3 chars are used for description */
r11240r11241
803803void x07_state::kb_scan_keys(running_machine &machine, UINT8 keycode)
804804{
805805   UINT8 modifier;
806   UINT8 a1 = input_port_read(m_machine, "A1");
807   UINT8 bz = input_port_read(m_machine, "BZ");
806   UINT8 a1 = input_port_read(machine, "A1");
807   UINT8 bz = input_port_read(machine, "BZ");
808808
809809   if (m_kb_on)
810810   {
r11240r11241
13391339
13401340void x07_state::machine_start()
13411341{
1342   m_rsta_clear = m_machine.scheduler().timer_alloc(FUNC(rsta_clear));
1343   m_rstb_clear = m_machine.scheduler().timer_alloc(FUNC(rstb_clear));
1344   m_beep_stop = m_machine.scheduler().timer_alloc(FUNC(beep_stop));
1345   m_k7irq = m_machine.scheduler().timer_alloc(FUNC(k7_irq));
1342   m_rsta_clear = machine().scheduler().timer_alloc(FUNC(rsta_clear));
1343   m_rstb_clear = machine().scheduler().timer_alloc(FUNC(rstb_clear));
1344   m_beep_stop = machine().scheduler().timer_alloc(FUNC(beep_stop));
1345   m_k7irq = machine().scheduler().timer_alloc(FUNC(k7_irq));
13461346
13471347   /* Save State */
1348   state_save_register_global(m_machine, m_sleep);
1349   state_save_register_global(m_machine, m_warm_start);
1350   state_save_register_global(m_machine, m_udk_on);
1351   state_save_register_global(m_machine, m_draw_udk);
1352   state_save_register_global(m_machine, m_sp_on);
1353   state_save_register_global(m_machine, m_font_code);
1354   state_save_register_global(m_machine, m_lcd_on);
1355   state_save_register_global(m_machine, m_scroll_min);
1356   state_save_register_global(m_machine, m_scroll_max);
1357   state_save_register_global(m_machine, m_blink);
1358   state_save_register_global(m_machine, m_kb_on);
1359   state_save_register_global(m_machine, m_repeat_key);
1360   state_save_register_global(m_machine, m_kb_size);
1361   state_save_register_global(m_machine, m_prn_sendbit);
1362   state_save_register_global(m_machine, m_prn_char_code);
1363   state_save_register_global(m_machine, m_prn_size);
1364   state_save_register_global(m_machine, m_k7on);
1365   state_save_register_global(m_machine, m_k7size);
1366   state_save_register_global(m_machine, m_k7pos);
1367   state_save_register_global_array(m_machine, m_t6834_ram);
1368   state_save_register_global_array(m_machine, m_regs_r);
1369   state_save_register_global_array(m_machine, m_regs_w);
1370   state_save_register_global_array(m_machine, m_alarm);
1371   state_save_register_global_2d_array(m_machine, m_lcd_map);
1372   state_save_register_global_array(m_machine, m_prn_buffer);
1373   state_save_register_global_pointer(m_machine, m_k7data, m_k7size);
1374   state_save_register_global(m_machine, m_in.read);
1375   state_save_register_global(m_machine, m_in.write);
1376   state_save_register_global_array(m_machine, m_in.data);
1377   state_save_register_global(m_machine, m_out.read);
1378   state_save_register_global(m_machine, m_out.write);
1379   state_save_register_global_array(m_machine, m_out.data);
1380   state_save_register_global(m_machine, m_locate.x);
1381   state_save_register_global(m_machine, m_locate.y);
1382   state_save_register_global(m_machine, m_locate.on);
1383   state_save_register_global(m_machine, m_cursor.x);
1384   state_save_register_global(m_machine, m_cursor.y);
1385   state_save_register_global(m_machine, m_cursor.on);
1348   state_save_register_global(machine(), m_sleep);
1349   state_save_register_global(machine(), m_warm_start);
1350   state_save_register_global(machine(), m_udk_on);
1351   state_save_register_global(machine(), m_draw_udk);
1352   state_save_register_global(machine(), m_sp_on);
1353   state_save_register_global(machine(), m_font_code);
1354   state_save_register_global(machine(), m_lcd_on);
1355   state_save_register_global(machine(), m_scroll_min);
1356   state_save_register_global(machine(), m_scroll_max);
1357   state_save_register_global(machine(), m_blink);
1358   state_save_register_global(machine(), m_kb_on);
1359   state_save_register_global(machine(), m_repeat_key);
1360   state_save_register_global(machine(), m_kb_size);
1361   state_save_register_global(machine(), m_prn_sendbit);
1362   state_save_register_global(machine(), m_prn_char_code);
1363   state_save_register_global(machine(), m_prn_size);
1364   state_save_register_global(machine(), m_k7on);
1365   state_save_register_global(machine(), m_k7size);
1366   state_save_register_global(machine(), m_k7pos);
1367   state_save_register_global_array(machine(), m_t6834_ram);
1368   state_save_register_global_array(machine(), m_regs_r);
1369   state_save_register_global_array(machine(), m_regs_w);
1370   state_save_register_global_array(machine(), m_alarm);
1371   state_save_register_global_2d_array(machine(), m_lcd_map);
1372   state_save_register_global_array(machine(), m_prn_buffer);
1373   state_save_register_global_pointer(machine(), m_k7data, m_k7size);
1374   state_save_register_global(machine(), m_in.read);
1375   state_save_register_global(machine(), m_in.write);
1376   state_save_register_global_array(machine(), m_in.data);
1377   state_save_register_global(machine(), m_out.read);
1378   state_save_register_global(machine(), m_out.write);
1379   state_save_register_global_array(machine(), m_out.data);
1380   state_save_register_global(machine(), m_locate.x);
1381   state_save_register_global(machine(), m_locate.y);
1382   state_save_register_global(machine(), m_locate.on);
1383   state_save_register_global(machine(), m_cursor.x);
1384   state_save_register_global(machine(), m_cursor.y);
1385   state_save_register_global(machine(), m_cursor.on);
13861386
13871387   /* install RAM */
13881388   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
r11240r11241
14181418   m_prn_char_code = 0;
14191419   m_prn_size = 0;
14201420
1421   m_regs_r[2] = input_port_read(m_machine, "CARDBATTERY");
1421   m_regs_r[2] = input_port_read(machine(), "CARDBATTERY");
14221422
14231423   cpu_set_reg(m_maincpu, Z80_PC, 0xc3c3);
14241424}
src/mess/drivers/nanos.c
r11240r11241
273273
274274VIDEO_START_MEMBER( nanos_state )
275275{
276   m_p_chargen = m_machine.region("chargen")->base();
276   m_p_chargen = machine().region("chargen")->base();
277277}
278278
279279SCREEN_UPDATE_MEMBER( nanos_state )
r11240r11241
451451
452452MACHINE_RESET_MEMBER(nanos_state)
453453{
454   address_space *space = m_machine.device("maincpu")->memory().space(AS_PROGRAM);
454   address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
455455
456456   space->install_write_bank(0x0000, 0x0fff, "bank3");
457457   space->install_write_bank(0x1000, 0xffff, "bank2");
458458
459   memory_set_bankptr(m_machine, "bank1", m_machine.region("maincpu")->base());
460   memory_set_bankptr(m_machine, "bank2", ram_get_ptr(m_machine.device(RAM_TAG)) + 0x1000);
461   memory_set_bankptr(m_machine, "bank3", ram_get_ptr(m_machine.device(RAM_TAG)));
459   memory_set_bankptr(machine(), "bank1", machine().region("maincpu")->base());
460   memory_set_bankptr(machine(), "bank2", ram_get_ptr(machine().device(RAM_TAG)) + 0x1000);
461   memory_set_bankptr(machine(), "bank3", ram_get_ptr(machine().device(RAM_TAG)));
462462
463463   floppy_mon_w(floppy_get_device(space->machine(), 0), CLEAR_LINE);
464464   floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1,1);
src/mess/drivers/k8915.c
r11240r11241
8484
8585MACHINE_RESET_MEMBER(k8915_state)
8686{
87   memory_set_bank(m_machine, "boot", 1);
87   memory_set_bank(machine(), "boot", 1);
8888}
8989
9090static DRIVER_INIT(k8915)
r11240r11241
9595
9696VIDEO_START_MEMBER( k8915_state )
9797{
98   m_p_chargen = m_machine.region("chargen")->base();
98   m_p_chargen = machine().region("chargen")->base();
9999}
100100
101101SCREEN_UPDATE_MEMBER( k8915_state )
src/mess/drivers/c10.c
r11240r11241
6161
6262MACHINE_RESET_MEMBER(c10_state)
6363{
64   memory_set_bank(m_machine, "boot", 1);
65   m_machine.scheduler().timer_set(attotime::from_usec(4), FUNC(c10_reset));
64   memory_set_bank(machine(), "boot", 1);
65   machine().scheduler().timer_set(attotime::from_usec(4), FUNC(c10_reset));
6666}
6767
6868VIDEO_START_MEMBER( c10_state )
6969{
70   m_p_chargen = m_machine.region("chargen")->base();
70   m_p_chargen = machine().region("chargen")->base();
7171}
7272
7373/* This system appears to have inline attribute bytes of unknown meaning.
src/mess/drivers/huebler.c
r11240r11241
3636{
3737   static const char *const keynames[] = { "Y0", "Y1", "Y2", "Y3", "Y4", "Y5", "Y6", "Y7", "Y8", "Y9", "Y10", "Y11", "Y12", "Y13", "Y14", "Y15" };
3838
39   UINT8 data = input_port_read(m_machine, keynames[m_key_a8 ? m_key_d6 : m_key_d7]);
39   UINT8 data = input_port_read(machine(), keynames[m_key_a8 ? m_key_d6 : m_key_d7]);
4040
4141   int a8 = (data & 0x0f) == 0x0f;
4242
r11240r11241
8080
8181    */
8282
83   UINT8 special = input_port_read(m_machine, "SPECIAL");
83   UINT8 special = input_port_read(machine(), "SPECIAL");
8484
8585   int ctrl = BIT(special, 0);
8686   int shift = BIT(special, 2) & BIT(special, 1);
r11240r11241
224224void amu880_state::video_start()
225225{
226226   // find memory regions
227   m_char_rom = m_machine.region("chargen")->base();
227   m_char_rom = machine().region("chargen")->base();
228228}
229229
230230bool amu880_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
r11240r11241
350350void amu880_state::machine_start()
351351{
352352   /* find memory regions */
353   m_kb_rom = m_machine.region("keyboard")->base();
353   m_kb_rom = machine().region("keyboard")->base();
354354
355355   /* register for state saving */
356   state_save_register_global(m_machine, m_key_d6);
357   state_save_register_global(m_machine, m_key_d7);
358   state_save_register_global(m_machine, m_key_a4);
359   state_save_register_global(m_machine, m_key_a5);
360   state_save_register_global(m_machine, m_key_a8);
356   state_save_register_global(machine(), m_key_d6);
357   state_save_register_global(machine(), m_key_d7);
358   state_save_register_global(machine(), m_key_a4);
359   state_save_register_global(machine(), m_key_a5);
360   state_save_register_global(machine(), m_key_a8);
361361}
362362
363363/* Machine Driver */
src/mess/drivers/compis.c
r11240r11241
8080   // find memory regions
8181//   m_char_rom = machine.region("pcg")->base();
8282
83   VIDEO_START_NAME(generic_bitmapped)(m_machine);
83   VIDEO_START_NAME(generic_bitmapped)(machine());
8484}
8585
8686bool compis_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/drivers/vidbrain.c
r11240r11241
8888
8989   UINT8 data = 0;//input_port_read(machine, "JOY-R");
9090
91   if (BIT(m_keylatch, 0)) data |= input_port_read(m_machine, "IO00");
92   if (BIT(m_keylatch, 1)) data |= input_port_read(m_machine, "IO01");
93   if (BIT(m_keylatch, 2)) data |= input_port_read(m_machine, "IO02");
94   if (BIT(m_keylatch, 3)) data |= input_port_read(m_machine, "IO03");
95   if (BIT(m_keylatch, 4)) data |= input_port_read(m_machine, "IO04");
96   if (BIT(m_keylatch, 5)) data |= input_port_read(m_machine, "IO05");
97   if (BIT(m_keylatch, 6)) data |= input_port_read(m_machine, "IO06");
98   if (BIT(m_keylatch, 7)) data |= input_port_read(m_machine, "IO07");
99   if (!BIT(m_cmd, 4)) data |= input_port_read(m_machine, "UV201-31");
91   if (BIT(m_keylatch, 0)) data |= input_port_read(machine(), "IO00");
92   if (BIT(m_keylatch, 1)) data |= input_port_read(machine(), "IO01");
93   if (BIT(m_keylatch, 2)) data |= input_port_read(machine(), "IO02");
94   if (BIT(m_keylatch, 3)) data |= input_port_read(machine(), "IO03");
95   if (BIT(m_keylatch, 4)) data |= input_port_read(machine(), "IO04");
96   if (BIT(m_keylatch, 5)) data |= input_port_read(machine(), "IO05");
97   if (BIT(m_keylatch, 6)) data |= input_port_read(machine(), "IO06");
98   if (BIT(m_keylatch, 7)) data |= input_port_read(machine(), "IO07");
99   if (!BIT(m_cmd, 4)) data |= input_port_read(machine(), "UV201-31");
100100
101101   return data;
102102}
r11240r11241
429429   device_set_irq_callback(m_maincpu, vidbrain_int_ack);
430430
431431   // register for state saving
432   state_save_register_global(m_machine, m_vector);
433   state_save_register_global(m_machine, m_int_enable);
434   state_save_register_global(m_machine, m_ext_int_latch);
435   state_save_register_global(m_machine, m_timer_int_latch);
436   state_save_register_global(m_machine, m_keylatch);
437   state_save_register_global(m_machine, m_joy_enable);
438   state_save_register_global(m_machine, m_sound_clk);
432   state_save_register_global(machine(), m_vector);
433   state_save_register_global(machine(), m_int_enable);
434   state_save_register_global(machine(), m_ext_int_latch);
435   state_save_register_global(machine(), m_timer_int_latch);
436   state_save_register_global(machine(), m_keylatch);
437   state_save_register_global(machine(), m_joy_enable);
438   state_save_register_global(machine(), m_sound_clk);
439439}
440440
441441
src/mess/drivers/czk80.c
r11240r11241
7676
7777MACHINE_RESET_MEMBER(czk80_state)
7878{
79   UINT8* bios = m_machine.region("maincpu")->base() + 0xe000;
79   UINT8* bios = machine().region("maincpu")->base() + 0xe000;
8080   memcpy(m_ram, bios, 0x2000);
8181   memcpy(m_ram+0xe000, bios, 0x2000);
8282}
src/mess/drivers/exp85.c
r11240r11241
185185   /* setup memory banking */
186186   program->install_read_bank(0x0000, 0x07ff, "bank1");
187187   program->unmap_write(0x0000, 0x07ff);
188   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(I8085A_TAG)->base() + 0xf000, 0);
189   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region(I8085A_TAG)->base(), 0);
190   memory_set_bank(m_machine, "bank1", 0);
188   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(I8085A_TAG)->base() + 0xf000, 0);
189   memory_configure_bank(machine(), "bank1", 1, 1, machine().region(I8085A_TAG)->base(), 0);
190   memory_set_bank(machine(), "bank1", 0);
191191}
192192
193193/* Machine Driver */
src/mess/drivers/trs80m2.c
r11240r11241
6868   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
6969   int table = 0, row, col;
7070
71   if (input_port_read(m_machine, "ROW9") & 0x07)
71   if (input_port_read(machine(), "ROW9") & 0x07)
7272   {
7373      /* shift, upper case */
7474      table = 1;
7575   }
7676
77   if (input_port_read(m_machine, "ROW9") & 0x18)
77   if (input_port_read(machine(), "ROW9") & 0x18)
7878   {
7979      /* ctrl */
8080      table = 2;
r11240r11241
8383   /* scan keyboard */
8484   for (row = 0; row < 9; row++)
8585   {
86      UINT8 data = input_port_read(m_machine, keynames[row]);
86      UINT8 data = input_port_read(machine(), keynames[row]);
8787
8888      for (col = 0; col < 8; col++)
8989      {
r11240r11241
144144void trs80m2_state::bankswitch()
145145{
146146   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
147   UINT8 *rom = m_machine.region(Z80_TAG)->base();
147   UINT8 *rom = machine().region(Z80_TAG)->base();
148148   UINT8 *ram = ram_get_ptr(m_ram);
149149   int last_page = (ram_get_size(m_ram) / 0x8000) - 1;
150150
r11240r11241
304304{
305305   static const char *const KEY_ROW[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9", "ROW10", "ROW11" };
306306
307   return input_port_read(m_machine, KEY_ROW[m_key_latch]);
307   return input_port_read(machine(), KEY_ROW[m_key_latch]);
308308}
309309
310310WRITE8_MEMBER( trs80m2_state::keyboard_ctrl_w )
r11240r11241
691691void trs80m2_state::video_start()
692692{
693693   /* find memory regions */
694   m_char_rom = m_machine.region(MC6845_TAG)->base();
694   m_char_rom = machine().region(MC6845_TAG)->base();
695695}
696696
697697bool trs80m2_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
698698{
699699   if (m_blnkvid)
700700   {
701      bitmap_fill(&bitmap, &cliprect, get_black_pen(m_machine));
701      bitmap_fill(&bitmap, &cliprect, get_black_pen(machine()));
702702   }
703703   else
704704   {
src/mess/drivers/m5.c
r11240r11241
7474   data |= centronics_busy_r(m_centronics) << 1;
7575
7676   // RESET key
77   data |= input_port_read(m_machine, "RESET");
77   data |= input_port_read(machine(), "RESET");
7878
7979   return data;
8080}
r11240r11241
640640   }
641641
642642   // register for state saving
643   state_save_register_global(m_machine, m_fd5_data);
644   state_save_register_global(m_machine, m_fd5_com);
645   state_save_register_global(m_machine, m_intra);
646   state_save_register_global(m_machine, m_ibfa);
647   state_save_register_global(m_machine, m_obfa);
643   state_save_register_global(machine(), m_fd5_data);
644   state_save_register_global(machine(), m_fd5_com);
645   state_save_register_global(machine(), m_intra);
646   state_save_register_global(machine(), m_ibfa);
647   state_save_register_global(machine(), m_obfa);
648648}
649649
650650
src/mess/drivers/a5105.c
r11240r11241
402402void a5105_state::video_start()
403403{
404404   // find memory regions
405   m_char_rom = m_machine.region("pcg")->base();
405   m_char_rom = machine().region("pcg")->base();
406406
407   VIDEO_START_NAME(generic_bitmapped)(m_machine);
407   VIDEO_START_NAME(generic_bitmapped)(machine());
408408}
409409
410410bool a5105_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/drivers/bw12.c
r11240r11241
7878      break;
7979   }
8080
81   memory_set_bank(m_machine, "bank1", m_bank);
81   memory_set_bank(machine(), "bank1", m_bank);
8282}
8383
8484void bw12_state::floppy_motor_off()
r11240r11241
405405void bw12_state::video_start()
406406{
407407   /* find memory regions */
408   m_char_rom = m_machine.region("chargen")->base();
408   m_char_rom = machine().region("chargen")->base();
409409}
410410
411411bool bw12_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
r11240r11241
587587
588588READ_LINE_MEMBER( bw12_state::ay3600_shift_r )
589589{
590   return BIT(input_port_read(m_machine, "MODIFIERS"), 0);
590   return BIT(input_port_read(machine(), "MODIFIERS"), 0);
591591}
592592
593593READ_LINE_MEMBER( bw12_state::ay3600_control_r )
594594{
595   return BIT(input_port_read(m_machine, "MODIFIERS"), 1);
595   return BIT(input_port_read(machine(), "MODIFIERS"), 1);
596596}
597597
598598WRITE_LINE_MEMBER( bw12_state::ay3600_data_ready_w )
r11240r11241
642642void bw12_state::machine_start()
643643{
644644   /* setup memory banking */
645   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(Z80_TAG)->base(), 0);
646   memory_configure_bank(m_machine, "bank1", 1, 1, ram_get_ptr(m_ram), 0);
647   memory_configure_bank(m_machine, "bank1", 2, 2, ram_get_ptr(m_ram) + 0x10000, 0x8000);
645   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base(), 0);
646   memory_configure_bank(machine(), "bank1", 1, 1, ram_get_ptr(m_ram), 0);
647   memory_configure_bank(machine(), "bank1", 2, 2, ram_get_ptr(m_ram) + 0x10000, 0x8000);
648648
649649   /* register for state saving */
650   state_save_register_global(m_machine, m_bank);
651   state_save_register_global(m_machine, m_pit_out2);
652   state_save_register_global_array(m_machine, m_key_data);
653   state_save_register_global(m_machine, m_key_sin);
654   state_save_register_global(m_machine, m_key_stb);
655   state_save_register_global(m_machine, m_key_shift);
656   state_save_register_global(m_machine, m_fdc_int);
657   state_save_register_global(m_machine, m_motor_on);
658   state_save_register_global(m_machine, m_motor0);
659   state_save_register_global(m_machine, m_motor1);
650   state_save_register_global(machine(), m_bank);
651   state_save_register_global(machine(), m_pit_out2);
652   state_save_register_global_array(machine(), m_key_data);
653   state_save_register_global(machine(), m_key_sin);
654   state_save_register_global(machine(), m_key_stb);
655   state_save_register_global(machine(), m_key_shift);
656   state_save_register_global(machine(), m_fdc_int);
657   state_save_register_global(machine(), m_motor_on);
658   state_save_register_global(machine(), m_motor0);
659   state_save_register_global(machine(), m_motor1);
660660}
661661
662662void bw12_state::machine_reset()
src/mess/drivers/et3400.c
r11240r11241
3636   UINT8 data = 0xff;
3737
3838   if (~offset & 4)
39      data &= input_port_read(m_machine, "X2");
39      data &= input_port_read(machine(), "X2");
4040   if (~offset & 2)
41      data &= input_port_read(m_machine, "X1");
41      data &= input_port_read(machine(), "X1");
4242   if (~offset & 1)
43      data &= input_port_read(m_machine, "X0");
43      data &= input_port_read(machine(), "X0");
4444
4545   return data;
4646}
src/mess/drivers/prestige.c
r11240r11241
126126   switch (offset)
127127   {
128128   case 0:
129      memory_set_bank(m_machine, "bank1", data & 0x3f);
129      memory_set_bank(machine(), "bank1", data & 0x3f);
130130      break;
131131
132132   case 1:
133133      if (m_bank[5] & 0x08)
134         memory_set_bank(m_machine, "bank2", 0x40 + (data & 1));
134         memory_set_bank(machine(), "bank2", 0x40 + (data & 1));
135135      else
136         memory_set_bank(m_machine, "bank2", data & 0x3f);
136         memory_set_bank(machine(), "bank2", data & 0x3f);
137137      break;
138138
139139   case 2:
140140      if (m_bank[5] & 0x04)
141         memory_set_bank(m_machine, "bank3", 0x40 + (data & 1));
141         memory_set_bank(machine(), "bank3", 0x40 + (data & 1));
142142      else
143         memory_set_bank(m_machine, "bank3", data & 0x3f);
143         memory_set_bank(machine(), "bank3", data & 0x3f);
144144      break;
145145
146146   case 3:
147147      if (m_bank[5] & 0x02)
148         memory_set_bank(m_machine, "bank4", 0x04 + (data & 0x03));
148         memory_set_bank(machine(), "bank4", 0x04 + (data & 0x03));
149149      else
150         memory_set_bank(m_machine, "bank4", data & 0x03);
150         memory_set_bank(machine(), "bank4", data & 0x03);
151151      break;
152152
153153   case 4:
154      memory_set_bank(m_machine, "bank5", data & 0x03);
154      memory_set_bank(machine(), "bank5", data & 0x03);
155155      break;
156156
157157   case 5:
158      if (input_port_read(m_machine, "CART_TYPE") == 0x01)
158      if (input_port_read(machine(), "CART_TYPE") == 0x01)
159159      {
160160         //cartridge memory is writable
161161         if (data & 0x08)
r11240r11241
200200
201201   for (int line=0; line<8; line++)
202202      if (!(m_kb_matrix & (1<<line)))
203         data &= input_port_read(m_machine, bitnames[offset][line]);
203         data &= input_port_read(machine(), bitnames[offset][line]);
204204
205205   return data;
206206}
r11240r11241
217217   switch( offset )
218218   {
219219      case 0:      //x-axis
220         data = (input_port_read(m_machine, "MOUSEX") - m_mousex);
220         data = (input_port_read(machine(), "MOUSEX") - m_mousex);
221221         break;
222222      case 1:      //y-axis
223         data = (input_port_read(m_machine, "MOUSEY") - m_mousey);
223         data = (input_port_read(machine(), "MOUSEY") - m_mousey);
224224         break;
225225   }
226226
r11240r11241
232232   switch( offset )
233233   {
234234      case 0:      //x-axis
235         m_mousex = input_port_read(m_machine, "MOUSEX");
235         m_mousex = input_port_read(machine(), "MOUSEX");
236236         break;
237237      case 1:      //y-axis
238         m_mousey = input_port_read(m_machine, "MOUSEY");
238         m_mousey = input_port_read(machine(), "MOUSEY");
239239         break;
240240   }
241241}
r11240r11241
420420
421421   device_set_irq_callback(m_maincpu, prestige_int_ack);
422422
423   memory_configure_bank(m_machine, "bank1", 0, 64, m_machine.region("maincpu")->base(), 0x4000);
424   memory_configure_bank(m_machine, "bank2", 0, 64, m_machine.region("maincpu")->base(), 0x4000);
425   memory_configure_bank(m_machine, "bank2", 64, 2, m_machine.region("cart")->base(), 0x4000);
426   memory_configure_bank(m_machine, "bank3", 0, 64, m_machine.region("maincpu")->base(), 0x4000);
427   memory_configure_bank(m_machine, "bank3", 64, 2, m_machine.region("cart")->base(), 0x4000);
428   memory_configure_bank(m_machine, "bank4", 0, 4, ram, 0x2000);
429   memory_configure_bank(m_machine, "bank4", 4, 4, m_machine.region("cart")->base(), 0x2000);
430   memory_configure_bank(m_machine, "bank5", 0, 4, ram, 0x2000);
423   memory_configure_bank(machine(), "bank1", 0, 64, machine().region("maincpu")->base(), 0x4000);
424   memory_configure_bank(machine(), "bank2", 0, 64, machine().region("maincpu")->base(), 0x4000);
425   memory_configure_bank(machine(), "bank2", 64, 2, machine().region("cart")->base(), 0x4000);
426   memory_configure_bank(machine(), "bank3", 0, 64, machine().region("maincpu")->base(), 0x4000);
427   memory_configure_bank(machine(), "bank3", 64, 2, machine().region("cart")->base(), 0x4000);
428   memory_configure_bank(machine(), "bank4", 0, 4, ram, 0x2000);
429   memory_configure_bank(machine(), "bank4", 4, 4, machine().region("cart")->base(), 0x2000);
430   memory_configure_bank(machine(), "bank5", 0, 4, ram, 0x2000);
431431
432   memory_set_bank(m_machine, "bank1", 0);
433   memory_set_bank(m_machine, "bank2", 0);
434   memory_set_bank(m_machine, "bank3", 0);
435   memory_set_bank(m_machine, "bank4", 0);
436   memory_set_bank(m_machine, "bank5", 0);
432   memory_set_bank(machine(), "bank1", 0);
433   memory_set_bank(machine(), "bank2", 0);
434   memory_set_bank(machine(), "bank3", 0);
435   memory_set_bank(machine(), "bank4", 0);
436   memory_set_bank(machine(), "bank5", 0);
437437
438438   //pointer to the videoram
439439   m_vram = ram;
src/mess/drivers/ngp.c
r11240r11241
210210   switch( offset )
211211   {
212212   case 0x30:   /* Read controls */
213      data = input_port_read( m_machine, "Controls" );
213      data = input_port_read( machine(), "Controls" );
214214      break;
215215   case 0x31:
216      data = input_port_read( m_machine, "Power" ) & 0x01;
216      data = input_port_read( machine(), "Power" ) & 0x01;
217217      /* Sub-batttery OK */
218218      data |= 0x02;
219219      break;
r11240r11241
603603
604604void ngp_state::machine_start()
605605{
606   m_seconds_timer = m_machine.scheduler().timer_alloc(FUNC(ngp_seconds_callback));
606   m_seconds_timer = machine().scheduler().timer_alloc(FUNC(ngp_seconds_callback));
607607   m_seconds_timer->adjust( attotime::from_seconds(1), 0, attotime::from_seconds(1) );
608608}
609609
r11240r11241
611611void ngp_state::machine_reset()
612612{
613613   m_old_to3 = 0;
614   m_tlcs900 = m_machine.device( "maincpu" );
615   m_z80 = m_machine.device( "soundcpu" );
616   m_t6w28 = m_machine.device( "t6w28" );
617   m_dac_l = m_machine.device( "dac_l" );
618   m_dac_r = m_machine.device( "dac_r" );
619   m_k1ge = m_machine.device( "k1ge" );
614   m_tlcs900 = machine().device( "maincpu" );
615   m_z80 = machine().device( "soundcpu" );
616   m_t6w28 = machine().device( "t6w28" );
617   m_dac_l = machine().device( "dac_l" );
618   m_dac_r = machine().device( "dac_r" );
619   m_k1ge = machine().device( "k1ge" );
620620
621621   device_suspend( m_z80, SUSPEND_REASON_HALT, 1 );
622622   device_set_input_line( m_z80, 0, CLEAR_LINE );
src/mess/drivers/pc1500.c
r11240r11241
247247
248248   data |= (m_rtc->tp_r()<<5);
249249   data |= (m_rtc->data_out_r()<<6);
250   data |= (input_port_read(m_machine, "ON")<<7);
250   data |= (input_port_read(machine(), "ON")<<7);
251251
252252   return data;
253253}
src/mess/drivers/prof80.c
r11240r11241
7777   int table = 0, row, col;
7878   int keydata = -1;
7979
80   if (input_port_read(m_machine, "ROW9") & 0x07)
80   if (input_port_read(machine(), "ROW9") & 0x07)
8181   {
8282      /* shift, upper case */
8383      table = 1;
8484   }
8585
86   if (input_port_read(m_machine, "ROW9") & 0x18)
86   if (input_port_read(machine(), "ROW9") & 0x18)
8787   {
8888      /* ctrl */
8989      table = 2;
r11240r11241
9292   /* scan keyboard */
9393   for (row = 0; row < 9; row++)
9494   {
95      UINT8 data = input_port_read(m_machine, keynames[row]);
95      UINT8 data = input_port_read(machine(), keynames[row]);
9696
9797      for (col = 0; col < 8; col++)
9898      {
r11240r11241
136136{
137137   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
138138   UINT8 *ram = ram_get_ptr(m_ram);
139   UINT8 *rom = m_machine.region(Z80_TAG)->base();
139   UINT8 *rom = machine().region(Z80_TAG)->base();
140140   int bank;
141141
142142   for (bank = 0; bank < 16; bank++)
r11240r11241
370370   data |= !m_motor;
371371
372372   /* JS4 */
373   switch (input_port_read(m_machine, "J4"))
373   switch (input_port_read(machine(), "J4"))
374374   {
375375   case 0: js4 = 0; break;
376376   case 1: js4 = 1; break;
r11240r11241
382382   data |= js4 << 4;
383383
384384   /* JS5 */
385   switch (input_port_read(m_machine, "J5"))
385   switch (input_port_read(machine(), "J5"))
386386   {
387387   case 0: js5 = 0; break;
388388   case 1: js5 = 1; break;
r11240r11241
459459{
460460   m_page = BIT(data, 7);
461461
462   memory_set_bank(m_machine, "videoram", m_page);
462   memory_set_bank(machine(), "videoram", m_page);
463463}
464464
465465READ8_MEMBER( grip_state::stat_r )
r11240r11241
483483   int js0 = 0, js1 = 0;
484484
485485   /* JS0 */
486   switch (input_port_read(m_machine, "GRIP-J3A"))
486   switch (input_port_read(machine(), "GRIP-J3A"))
487487   {
488488   case 0: js0 = 0; break;
489489   case 1: js0 = 1; break;
r11240r11241
495495   data |= js0 << 4;
496496
497497   /* JS1 */
498   switch (input_port_read(m_machine, "GRIP-J3B"))
498   switch (input_port_read(machine(), "GRIP-J3B"))
499499   {
500500   case 0: js1 = 0; break;
501501   case 1: js1 = 1; break;
r11240r11241
11421142   floppy_drive_set_index_pulse_callback(m_floppy0, prof80_fdc_index_callback);
11431143
11441144   /* allocate floppy motor off timer */
1145   m_floppy_motor_off_timer = m_machine.scheduler().timer_alloc(FUNC(floppy_motor_off_tick));
1145   m_floppy_motor_off_timer = machine().scheduler().timer_alloc(FUNC(floppy_motor_off_tick));
11461146
11471147   /* bank switch */
11481148   bankswitch();
r11240r11241
11751175   prof80_state::machine_start();
11761176
11771177   /* allocate video RAM */
1178   m_video_ram = auto_alloc_array(m_machine, UINT8, GRIP_VIDEORAM_SIZE);
1178   m_video_ram = auto_alloc_array(machine(), UINT8, GRIP_VIDEORAM_SIZE);
11791179
11801180   /* setup GRIP memory banking */
1181   memory_configure_bank(m_machine, "videoram", 0, 2, m_video_ram, 0x8000);
1182   memory_set_bank(m_machine, "videoram", 0);
1181   memory_configure_bank(machine(), "videoram", 0, 2, m_video_ram, 0x8000);
1182   memory_set_bank(machine(), "videoram", 0);
11831183
11841184   /* register for state saving */
11851185   save_item(NAME(m_vol0));
src/mess/drivers/savia84.c
r11240r11241
155155   {
156156      char kbdrow[4];
157157      sprintf(kbdrow,"X%d",m_kbd);
158      return input_port_read(m_machine, kbdrow);
158      return input_port_read(machine(), kbdrow);
159159   }
160160   else
161161      return 0xff;
src/mess/drivers/prof180x.c
r11240r11241
210210void prof180x_state::machine_start()
211211{
212212   // register for state saving
213   state_save_register_global(m_machine, m_c0);
214   state_save_register_global(m_machine, m_c1);
215   state_save_register_global(m_machine, m_c2);
216   state_save_register_global(m_machine, m_mm0);
217   state_save_register_global(m_machine, m_mm1);
213   state_save_register_global(machine(), m_c0);
214   state_save_register_global(machine(), m_c1);
215   state_save_register_global(machine(), m_c2);
216   state_save_register_global(machine(), m_mm0);
217   state_save_register_global(machine(), m_mm1);
218218}
219219
220220void prof180x_state::machine_reset()
src/mess/drivers/eacc.c
r11240r11241
135135
136136READ_LINE_MEMBER( eacc_state::eacc_distance_r )
137137{
138   return m_machine.rand() & 1; // needs random pulses to simulate movement
138   return machine().rand() & 1; // needs random pulses to simulate movement
139139}
140140
141141READ_LINE_MEMBER( eacc_state::eacc_fuel_sensor_r )
142142{
143   return m_machine.rand() & 1; // needs random pulses to simulate acceleration
143   return machine().rand() & 1; // needs random pulses to simulate acceleration
144144}
145145
146146WRITE_LINE_MEMBER( eacc_state::eacc_cb2_w )
r11240r11241
153153   UINT8 data = m_digit;
154154
155155   if (BIT(m_digit, 3))
156      data |= input_port_read(m_machine, "X0");
156      data |= input_port_read(machine(), "X0");
157157   if (BIT(m_digit, 4))
158      data |= input_port_read(m_machine, "X1");
158      data |= input_port_read(machine(), "X1");
159159   if (BIT(m_digit, 5))
160      data |= input_port_read(m_machine, "X2");
160      data |= input_port_read(machine(), "X2");
161161   if (BIT(m_digit, 6))
162      data |= input_port_read(m_machine, "X3");
162      data |= input_port_read(machine(), "X3");
163163
164164   return data;
165165}
r11240r11241
198198
199199WRITE8_MEMBER( eacc_state::eacc_digit_w )
200200{
201   device_set_input_line(m_machine.device("maincpu"), INPUT_LINE_NMI, CLEAR_LINE);
201   device_set_input_line(machine().device("maincpu"), INPUT_LINE_NMI, CLEAR_LINE);
202202   m_digit = data & 0xf8;
203203   eacc_display();
204204}
src/mess/drivers/pc2000.c
r11240r11241
6868
6969   for (int line=0; line<8; line++)
7070      if (m_mux_data & (1<<line))
71         data &= input_port_read(m_machine, bitnames[offset][line]);
71         data &= input_port_read(machine(), bitnames[offset][line]);
7272
7373   return data;
7474}
r11240r11241
8080
8181WRITE8_MEMBER( pc2000_state::rombank1_w )
8282{
83   memory_set_bank(m_machine, "bank1", data & 0x0f);
83   memory_set_bank(machine(), "bank1", data & 0x0f);
8484}
8585
8686WRITE8_MEMBER( pc2000_state::rombank2_w )
8787{
8888   if (data == 0x80)
8989   {
90      memory_set_bank(m_machine, "bank2", data & 0x10);   //cartridge
90      memory_set_bank(machine(), "bank2", data & 0x10);   //cartridge
9191   }
9292   else
9393   {
94      memory_set_bank(m_machine, "bank2", data & 0x0f);
94      memory_set_bank(machine(), "bank2", data & 0x0f);
9595   }
9696}
9797
r11240r11241
286286
287287void pc2000_state::machine_start()
288288{
289   UINT8 *bios = m_machine.region("bios")->base();
290   UINT8 *cart = m_machine.region("cart")->base();
289   UINT8 *bios = machine().region("bios")->base();
290   UINT8 *cart = machine().region("cart")->base();
291291
292   memory_configure_bank(m_machine, "bank1", 0, 0x10, bios, 0x4000);
293   memory_configure_bank(m_machine, "bank2", 0, 0x10, bios, 0x4000);
294   memory_configure_bank(m_machine, "bank2", 0x10, 1, cart, 0x4000);
292   memory_configure_bank(machine(), "bank1", 0, 0x10, bios, 0x4000);
293   memory_configure_bank(machine(), "bank2", 0, 0x10, bios, 0x4000);
294   memory_configure_bank(machine(), "bank2", 0x10, 1, cart, 0x4000);
295295}
296296
297297void pc2000_state::machine_reset()
298298{
299299   //set the initial bank
300   memory_set_bank(m_machine, "bank1", 0);
301   memory_set_bank(m_machine, "bank2", 0);
300   memory_set_bank(machine(), "bank1", 0);
301   memory_set_bank(machine(), "bank2", 0);
302302}
303303
304304static PALETTE_INIT( pc2000 )
src/mess/drivers/beta.c
r11240r11241
102102
103103   switch (m_ls145_p)
104104   {
105   case 6: data &= input_port_read(m_machine, "Q6"); break;
106   case 7: data &= input_port_read(m_machine, "Q7"); break;
107   case 8: data &= input_port_read(m_machine, "Q8"); break;
108   case 9: data &= input_port_read(m_machine, "Q9"); break;
105   case 6: data &= input_port_read(machine(), "Q6"); break;
106   case 7: data &= input_port_read(machine(), "Q7"); break;
107   case 8: data &= input_port_read(machine(), "Q8"); break;
108   case 9: data &= input_port_read(machine(), "Q9"); break;
109109   default:
110110      if (!m_eprom_oe && !m_eprom_ce)
111111      {
112         data = m_machine.region(EPROM_TAG)->base()[m_eprom_addr & 0x7ff];
112         data = machine().region(EPROM_TAG)->base()[m_eprom_addr & 0x7ff];
113113         popmessage("EPROM read %04x = %02x\n", m_eprom_addr & 0x7ff, data);
114114      }
115115   }
r11240r11241
196196   if (BIT(data, 6) && (!BIT(m_old_data, 7) && BIT(data, 7)))
197197   {
198198      popmessage("EPROM write %04x = %02x\n", m_eprom_addr & 0x7ff, m_eprom_data);
199      m_machine.region(EPROM_TAG)->base()[m_eprom_addr & 0x7ff] &= m_eprom_data;
199      machine().region(EPROM_TAG)->base()[m_eprom_addr & 0x7ff] &= m_eprom_data;
200200   }
201201
202202   m_old_data = data;
r11240r11241
224224
225225void beta_state::machine_start()
226226{
227   m_led_refresh_timer = m_machine.scheduler().timer_alloc(FUNC(led_refresh));
227   m_led_refresh_timer = machine().scheduler().timer_alloc(FUNC(led_refresh));
228228
229229   /* register for state saving */
230230   save_item(NAME(m_eprom_oe));
src/mess/drivers/pc8001.c
r11240r11241
344344void pc8001_state::video_start()
345345{
346346   // find memory regions
347   m_char_rom = m_machine.region("chargen")->base();
347   m_char_rom = machine().region("chargen")->base();
348348}
349349
350350bool pc8001_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
r11240r11241
499499   /* setup memory banking */
500500   UINT8 *ram = ram_get_ptr(m_ram);
501501   
502   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region("n80")->base(), 0);
502   memory_configure_bank(machine(), "bank1", 1, 1, machine().region("n80")->base(), 0);
503503   program->install_read_bank(0x0000, 0x5fff, "bank1");
504504   program->unmap_write(0x0000, 0x5fff);
505505
506506   switch (ram_get_size(m_ram))
507507   {
508508   case 16*1024:
509      memory_configure_bank(m_machine, "bank3", 0, 1, ram, 0);
509      memory_configure_bank(machine(), "bank3", 0, 1, ram, 0);
510510      program->unmap_readwrite(0x6000, 0xbfff);
511511      program->unmap_readwrite(0x8000, 0xbfff);
512512      program->install_readwrite_bank(0xc000, 0xffff, "bank3");
513513      break;
514514
515515   case 32*1024:
516      memory_configure_bank(m_machine, "bank3", 0, 1, ram, 0);
516      memory_configure_bank(machine(), "bank3", 0, 1, ram, 0);
517517      program->unmap_readwrite(0x6000, 0xbfff);
518518      program->install_readwrite_bank(0x8000, 0xffff, "bank3");
519519      break;
520520
521521   case 64*1024:
522      memory_configure_bank(m_machine, "bank1", 0, 1, ram, 0);
523      memory_configure_bank(m_machine, "bank2", 0, 1, ram + 0x6000, 0);
524      memory_configure_bank(m_machine, "bank3", 0, 1, ram + 0x8000, 0);
522      memory_configure_bank(machine(), "bank1", 0, 1, ram, 0);
523      memory_configure_bank(machine(), "bank2", 0, 1, ram + 0x6000, 0);
524      memory_configure_bank(machine(), "bank3", 0, 1, ram + 0x8000, 0);
525525      program->install_readwrite_bank(0x0000, 0x5fff, "bank1");
526526      program->install_readwrite_bank(0x6000, 0xbfff, "bank2");
527527      program->install_readwrite_bank(0x8000, 0xffff, "bank3");
528      memory_set_bank(m_machine, "bank2", 0);
528      memory_set_bank(machine(), "bank2", 0);
529529      break;
530530   }
531531
532   memory_set_bank(m_machine, "bank1", 1);
533   memory_set_bank(m_machine, "bank3", 0);
532   memory_set_bank(machine(), "bank1", 1);
533   memory_set_bank(machine(), "bank3", 0);
534534
535535   /* register for state saving */
536536   save_item(NAME(m_width80));
src/mess/drivers/poly880.c
r11240r11241
179179   {
180180      if (BIT(m_digit, i))
181181      {
182         if (!BIT(input_port_read(m_machine, "KI1"), i)) data &= ~0x10;
183         if (!BIT(input_port_read(m_machine, "KI2"), i)) data &= ~0x20;
184         if (!BIT(input_port_read(m_machine, "KI3"), i)) data &= ~0x80;
182         if (!BIT(input_port_read(machine(), "KI1"), i)) data &= ~0x10;
183         if (!BIT(input_port_read(machine(), "KI2"), i)) data &= ~0x20;
184         if (!BIT(input_port_read(machine(), "KI3"), i)) data &= ~0x80;
185185      }
186186   }
187187
src/mess/drivers/univac.c
r11240r11241
8787
8888VIDEO_START_MEMBER(univac_state)
8989{
90   m_p_chargen = m_machine.region("chargen")->base();
90   m_p_chargen = machine().region("chargen")->base();
9191}
9292
9393SCREEN_UPDATE_MEMBER(univac_state)
src/mess/drivers/pc4.c
r11240r11241
3838
3939   for (int line=0; line<8; line++)
4040      if (!(offset & (1<<line)))
41         data &= input_port_read(m_machine, bitnames[line]);
41         data &= input_port_read(machine(), bitnames[line]);
4242
4343   return data;
4444}
r11240r11241
4646WRITE8_MEMBER( pc4_state::bank_w )
4747{
4848   //printf("set bank %x\n", data);
49   memory_set_bank(m_machine, "rombank", data&0x07);
49   memory_set_bank(machine(), "rombank", data&0x07);
5050}
5151
5252WRITE8_MEMBER( pc4_state::beep_w )
r11240r11241
181181
182182void pc4_state::machine_start()
183183{
184   UINT8* rom_base = (UINT8 *)m_machine.region("maincpu")->base();
184   UINT8* rom_base = (UINT8 *)machine().region("maincpu")->base();
185185
186   memory_configure_bank(m_machine, "rombank", 0, 8, rom_base, 0x4000);
187   memory_set_bank(m_machine, "rombank", 0);
186   memory_configure_bank(machine(), "rombank", 0, 8, rom_base, 0x4000);
187   memory_set_bank(machine(), "rombank", 0);
188188
189189   m_busy_timer = timer_alloc(BUSY_TIMER);
190190   m_blink_timer = timer_alloc(BLINKING_TIMER);
src/mess/drivers/bw2.c
r11240r11241
3131
3232int bw2_state::get_ramdisk_size()
3333{
34   return input_port_read(m_machine, "RAMCARD") * 256;
34   return input_port_read(machine(), "RAMCARD") * 256;
3535}
3636
3737/* Memory */
r11240r11241
115115      break;
116116   }
117117
118   memory_set_bank(m_machine, "bank1", m_bank);
118   memory_set_bank(machine(), "bank1", m_bank);
119119}
120120
121121void bw2_state::ramcard_bankswitch(UINT8 data)
r11240r11241
195195      break;
196196   }
197197
198   memory_set_bank(m_machine, "bank1", m_bank);
198   memory_set_bank(machine(), "bank1", m_bank);
199199}
200200
201201WRITE8_MEMBER( bw2_state::ramcard_bank_w )
r11240r11241
214214      program->install_readwrite_bank(0x0000, 0x7fff, "bank1");
215215   }
216216
217   memory_configure_bank(m_machine, "bank1", BANK_RAMCARD_RAM, 1, m_ramcard_ram + bank_offset, 0);
218   memory_set_bank(m_machine, "bank1", m_bank);
217   memory_configure_bank(machine(), "bank1", BANK_RAMCARD_RAM, 1, m_ramcard_ram + bank_offset, 0);
218   memory_set_bank(machine(), "bank1", m_bank);
219219}
220220
221221/* Floppy */
r11240r11241
455455
456456   if (m_kb_row <= 9)
457457   {
458      data = input_port_read(m_machine, rownames[m_kb_row]);
458      data = input_port_read(machine(), rownames[m_kb_row]);
459459   }
460460
461461   return data;
r11240r11241
624624void bw2_state::machine_start()
625625{
626626   /* allocate memory */
627   m_work_ram = auto_alloc_array(m_machine, UINT8, ram_get_size(m_ram));
628   m_video_ram = auto_alloc_array(m_machine, UINT8, BW2_VIDEORAM_SIZE);
629   m_ramcard_ram = auto_alloc_array(m_machine, UINT8, BW2_RAMCARD_SIZE);
627   m_work_ram = auto_alloc_array(machine(), UINT8, ram_get_size(m_ram));
628   m_video_ram = auto_alloc_array(machine(), UINT8, BW2_VIDEORAM_SIZE);
629   m_ramcard_ram = auto_alloc_array(machine(), UINT8, BW2_RAMCARD_SIZE);
630630
631631   /* memory banking */
632   memory_configure_bank(m_machine, "bank1", BANK_RAM1, 1, m_work_ram, 0);
633   memory_configure_bank(m_machine, "bank1", BANK_VRAM, 1, m_video_ram, 0);
634   memory_configure_bank(m_machine, "bank1", BANK_ROM, 1, m_machine.region("ic1")->base(), 0);
632   memory_configure_bank(machine(), "bank1", BANK_RAM1, 1, m_work_ram, 0);
633   memory_configure_bank(machine(), "bank1", BANK_VRAM, 1, m_video_ram, 0);
634   memory_configure_bank(machine(), "bank1", BANK_ROM, 1, machine().region("ic1")->base(), 0);
635635
636636   /* register for state saving */
637   state_save_register_global(m_machine, m_kb_row);
638   state_save_register_global_pointer(m_machine, m_work_ram, ram_get_size(m_ram));
639   state_save_register_global_pointer(m_machine, m_ramcard_ram, BW2_RAMCARD_SIZE);
640   state_save_register_global(m_machine, m_bank);
641   state_save_register_global(m_machine, m_drive);
642   state_save_register_global(m_machine, m_mtron);
643   state_save_register_global(m_machine, m_mfdbk);
644   state_save_register_global_pointer(m_machine, m_video_ram, BW2_VIDEORAM_SIZE);
637   state_save_register_global(machine(), m_kb_row);
638   state_save_register_global_pointer(machine(), m_work_ram, ram_get_size(m_ram));
639   state_save_register_global_pointer(machine(), m_ramcard_ram, BW2_RAMCARD_SIZE);
640   state_save_register_global(machine(), m_bank);
641   state_save_register_global(machine(), m_drive);
642   state_save_register_global(machine(), m_mtron);
643   state_save_register_global(machine(), m_mfdbk);
644   state_save_register_global_pointer(machine(), m_video_ram, BW2_VIDEORAM_SIZE);
645645}
646646
647647void bw2_state::machine_reset()
648648{
649   address_space *io = m_machine.device(Z80_TAG)->memory().space(AS_IO);
649   address_space *io = machine().device(Z80_TAG)->memory().space(AS_IO);
650650
651651   if (get_ramdisk_size() > 0)
652652   {
653653      // RAMCARD installed
654654
655      memory_configure_bank(m_machine, "bank1", BANK_RAMCARD_ROM, 1, m_machine.region("ramcard")->base(), 0);
656      memory_configure_bank(m_machine, "bank1", BANK_RAM3, 2, m_work_ram + 0x8000, 0x8000);
657      memory_configure_bank(m_machine, "bank1", BANK_RAMCARD_RAM, 1, m_ramcard_ram, 0);
658      memory_configure_bank(m_machine, "bank1", BANK_RAM6, 1, m_work_ram + 0x18000, 0);
655      memory_configure_bank(machine(), "bank1", BANK_RAMCARD_ROM, 1, machine().region("ramcard")->base(), 0);
656      memory_configure_bank(machine(), "bank1", BANK_RAM3, 2, m_work_ram + 0x8000, 0x8000);
657      memory_configure_bank(machine(), "bank1", BANK_RAMCARD_RAM, 1, m_ramcard_ram, 0);
658      memory_configure_bank(machine(), "bank1", BANK_RAM6, 1, m_work_ram + 0x18000, 0);
659659
660660      io->install_write_handler(0x30, 0x30, 0, 0x0f, write8_delegate(FUNC(bw2_state::ramcard_bank_w), this), 0);
661661   }
r11240r11241
663663   {
664664      // no RAMCARD
665665
666      memory_configure_bank(m_machine, "bank1", BANK_RAM2, 5, m_work_ram + 0x8000, 0x8000);
666      memory_configure_bank(machine(), "bank1", BANK_RAM2, 5, m_work_ram + 0x8000, 0x8000);
667667
668668      io->unmap_write(0x30, 0x30, 0, 0x0f);
669669   }
670670
671   memory_set_bank(m_machine, "bank1", BANK_ROM);
671   memory_set_bank(machine(), "bank1", BANK_ROM);
672672}
673673
674674static MACHINE_CONFIG_START( bw2, bw2_state )
src/mess/drivers/portfoli.c
r11240r11241
220220
221221   for (int row = 0; row < 8; row++)
222222   {
223      UINT8 data = input_port_read(m_machine, keynames[row]);
223      UINT8 data = input_port_read(machine(), keynames[row]);
224224
225225      if (data != 0xff)
226226      {
r11240r11241
361361   data |= (m_pid != PID_NONE) << 5;
362362
363363   /* battery status */
364   data |= BIT(input_port_read(m_machine, "BATTERY"), 0) << 6;
364   data |= BIT(input_port_read(machine(), "BATTERY"), 0) << 6;
365365
366366   return data;
367367}
r11240r11241
456456   if (BIT(data, 0))
457457   {
458458      // system ROM
459      UINT8 *rom = m_machine.region(M80C88A_TAG)->base();
459      UINT8 *rom = machine().region(M80C88A_TAG)->base();
460460      program->install_rom(0xc0000, 0xdffff, rom);
461461   }
462462   else
r11240r11241
784784   device_set_irq_callback(m_maincpu, portfolio_int_ack);
785785
786786   /* memory expansions */
787   switch (ram_get_size(m_machine.device(RAM_TAG)))
787   switch (ram_get_size(machine().device(RAM_TAG)))
788788   {
789789   case 128 * 1024:
790790      program->unmap_readwrite(0x1f000, 0x9efff);
r11240r11241
801801   m_pid = 0xff;
802802
803803   /* register for state saving */
804   state_save_register_global(m_machine, m_ip);
805   state_save_register_global(m_machine, m_ie);
806   state_save_register_global(m_machine, m_sivr);
807   state_save_register_global(m_machine, m_counter);
808   state_save_register_global(m_machine, m_keylatch);
809   state_save_register_global(m_machine, m_contrast);
810   state_save_register_global(m_machine, m_pid);
804   state_save_register_global(machine(), m_ip);
805   state_save_register_global(machine(), m_ie);
806   state_save_register_global(machine(), m_sivr);
807   state_save_register_global(machine(), m_counter);
808   state_save_register_global(machine(), m_keylatch);
809   state_save_register_global(machine(), m_contrast);
810   state_save_register_global(machine(), m_pid);
811811}
812812
813813//-------------------------------------------------
r11240r11241
819819   address_space *io = m_maincpu->memory().space(AS_IO);
820820
821821   // peripherals
822   m_pid = input_port_read(m_machine, "PERIPHERAL");
822   m_pid = input_port_read(machine(), "PERIPHERAL");
823823
824824   io->unmap_readwrite(0x8070, 0x807b);
825825   io->unmap_readwrite(0x807d, 0x807e);
src/mess/drivers/mc10.c
r11240r11241
8787{
8888   UINT8 result = 0xff;
8989
90   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(m_machine, "pb0");
91   if (!BIT(m_keyboard_strobe, 1)) result &= input_port_read(m_machine, "pb1");
92   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(m_machine, "pb2");
93   if (!BIT(m_keyboard_strobe, 3)) result &= input_port_read(m_machine, "pb3");
94   if (!BIT(m_keyboard_strobe, 4)) result &= input_port_read(m_machine, "pb4");
95   if (!BIT(m_keyboard_strobe, 5)) result &= input_port_read(m_machine, "pb5");
96   if (!BIT(m_keyboard_strobe, 6)) result &= input_port_read(m_machine, "pb6");
97   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(m_machine, "pb7");
90   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(machine(), "pb0");
91   if (!BIT(m_keyboard_strobe, 1)) result &= input_port_read(machine(), "pb1");
92   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(machine(), "pb2");
93   if (!BIT(m_keyboard_strobe, 3)) result &= input_port_read(machine(), "pb3");
94   if (!BIT(m_keyboard_strobe, 4)) result &= input_port_read(machine(), "pb4");
95   if (!BIT(m_keyboard_strobe, 5)) result &= input_port_read(machine(), "pb5");
96   if (!BIT(m_keyboard_strobe, 6)) result &= input_port_read(machine(), "pb6");
97   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(machine(), "pb7");
9898
9999   return result;
100100}
r11240r11241
141141   UINT8 result = 0xeb;
142142
143143   /* bit 1, keyboard line pa6 */
144   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(m_machine, "pb0") >> 5;
145   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(m_machine, "pb2") >> 5;
146   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(m_machine, "pb7") >> 5;
144   if (!BIT(m_keyboard_strobe, 0)) result &= input_port_read(machine(), "pb0") >> 5;
145   if (!BIT(m_keyboard_strobe, 2)) result &= input_port_read(machine(), "pb2") >> 5;
146   if (!BIT(m_keyboard_strobe, 7)) result &= input_port_read(machine(), "pb7") >> 5;
147147
148148   /* bit 2, printer ots input */
149149   result |= (printer_is_ready(m_printer) ? 0 : 4);
src/mess/drivers/dim68k.c
r11240r11241
204204
205205MACHINE_RESET_MEMBER(dim68k_state)
206206{
207   UINT8* ROM = m_machine.region("bootrom")->base();
207   UINT8* ROM = machine().region("bootrom")->base();
208208
209209   memcpy((UINT8*)m_ram, ROM, 0x2000);
210210
211   m_machine.device("maincpu")->reset();
211   machine().device("maincpu")->reset();
212212}
213213
214214VIDEO_START_MEMBER( dim68k_state )
215215{
216   m_p_chargen = m_machine.region("chargen")->base();
216   m_p_chargen = machine().region("chargen")->base();
217217}
218218
219219SCREEN_UPDATE_MEMBER( dim68k_state )
src/mess/drivers/coleco.c
r11240r11241
6868
6969READ8_MEMBER( coleco_state::paddle_1_r )
7070{
71   return coleco_paddle1_read(m_machine, m_joy_mode, m_joy_status[0]);
71   return coleco_paddle1_read(machine(), m_joy_mode, m_joy_status[0]);
7272}
7373
7474READ8_MEMBER( coleco_state::paddle_2_r )
7575{
76   return coleco_paddle2_read(m_machine, m_joy_mode, m_joy_status[1]);
76   return coleco_paddle2_read(machine(), m_joy_mode, m_joy_status[1]);
7777}
7878
7979WRITE8_MEMBER( coleco_state::paddle_off_w )
r11240r11241
227227
228228   m_maincpu->set_input_line_vector(INPUT_LINE_IRQ0, 0xff);
229229
230   memset(&m_machine.region(Z80_TAG)->base()[0x6000], 0xff, 0x400);   // initialize RAM
230   memset(&machine().region(Z80_TAG)->base()[0x6000], 0xff, 0x400);   // initialize RAM
231231}
232232
233233//static int coleco_cart_verify(const UINT8 *cartdata, size_t size)
src/mess/drivers/lc80.c
r11240r11241
241241   {
242242      if (!BIT(m_digit, i))
243243      {
244         if (!BIT(input_port_read(m_machine, "ROW0"), i)) data &= ~0x10;
245         if (!BIT(input_port_read(m_machine, "ROW1"), i)) data &= ~0x20;
246         if (!BIT(input_port_read(m_machine, "ROW2"), i)) data &= ~0x40;
247         if (!BIT(input_port_read(m_machine, "ROW3"), i)) data &= ~0x80;
244         if (!BIT(input_port_read(machine(), "ROW0"), i)) data &= ~0x10;
245         if (!BIT(input_port_read(machine(), "ROW1"), i)) data &= ~0x20;
246         if (!BIT(input_port_read(machine(), "ROW2"), i)) data &= ~0x40;
247         if (!BIT(input_port_read(machine(), "ROW3"), i)) data &= ~0x80;
248248      }
249249   }
250250
r11240r11241
279279   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
280280
281281   /* setup memory banking */
282   memory_configure_bank(m_machine, "bank1", 0, 1, m_machine.region(Z80_TAG)->base(), 0); // TODO
283   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region(Z80_TAG)->base(), 0);
284   memory_set_bank(m_machine, "bank1", 1);
282   memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base(), 0); // TODO
283   memory_configure_bank(machine(), "bank1", 1, 1, machine().region(Z80_TAG)->base(), 0);
284   memory_set_bank(machine(), "bank1", 1);
285285
286   memory_configure_bank(m_machine, "bank2", 0, 1, m_machine.region(Z80_TAG)->base() + 0x800, 0); // TODO
287   memory_configure_bank(m_machine, "bank2", 1, 1, m_machine.region(Z80_TAG)->base() + 0x800, 0);
288   memory_set_bank(m_machine, "bank2", 1);
286   memory_configure_bank(machine(), "bank2", 0, 1, machine().region(Z80_TAG)->base() + 0x800, 0); // TODO
287   memory_configure_bank(machine(), "bank2", 1, 1, machine().region(Z80_TAG)->base() + 0x800, 0);
288   memory_set_bank(machine(), "bank2", 1);
289289
290   memory_configure_bank(m_machine, "bank3", 0, 1, m_machine.region(Z80_TAG)->base() + 0x1000, 0); // TODO
291   memory_configure_bank(m_machine, "bank3", 1, 1, m_machine.region(Z80_TAG)->base() + 0x1000, 0);
292   memory_set_bank(m_machine, "bank3", 1);
290   memory_configure_bank(machine(), "bank3", 0, 1, machine().region(Z80_TAG)->base() + 0x1000, 0); // TODO
291   memory_configure_bank(machine(), "bank3", 1, 1, machine().region(Z80_TAG)->base() + 0x1000, 0);
292   memory_set_bank(machine(), "bank3", 1);
293293
294   memory_configure_bank(m_machine, "bank4", 0, 1, m_machine.region(Z80_TAG)->base() + 0x2000, 0);
295   memory_set_bank(m_machine, "bank4", 0);
294   memory_configure_bank(machine(), "bank4", 0, 1, machine().region(Z80_TAG)->base() + 0x2000, 0);
295   memory_set_bank(machine(), "bank4", 0);
296296
297297   program->install_readwrite_bank(0x0000, 0x07ff, "bank1");
298298   program->install_readwrite_bank(0x0800, 0x0fff, "bank2");
src/mess/drivers/4004clk.c
r11240r11241
3333
3434READ8_MEMBER(nixieclock_state::data_r)
3535{
36   return input_port_read(m_machine, "INPUT") & 0x0f;
36   return input_port_read(machine(), "INPUT") & 0x0f;
3737}
3838
3939static UINT8 nixie_to_num(UINT16 val)
src/mess/drivers/c80.c
r11240r11241
9898   {
9999      if (!BIT(m_keylatch, i))
100100      {
101         if (!BIT(input_port_read(m_machine, "ROW0"), i)) data &= ~0x01;
102         if (!BIT(input_port_read(m_machine, "ROW1"), i)) data &= ~0x02;
103         if (!BIT(input_port_read(m_machine, "ROW2"), i)) data &= ~0x04;
101         if (!BIT(input_port_read(machine(), "ROW0"), i)) data &= ~0x01;
102         if (!BIT(input_port_read(machine(), "ROW1"), i)) data &= ~0x02;
103         if (!BIT(input_port_read(machine(), "ROW2"), i)) data &= ~0x04;
104104      }
105105   }
106106
src/mess/drivers/tmc2000e.c
r11240r11241
158158
159159READ_LINE_MEMBER( tmc2000e_state::clear_r )
160160{
161   return BIT(input_port_read(m_machine, "RUN"), 0);
161   return BIT(input_port_read(machine(), "RUN"), 0);
162162}
163163
164164READ_LINE_MEMBER( tmc2000e_state::ef2_r )
r11240r11241
169169READ_LINE_MEMBER( tmc2000e_state::ef3_r )
170170{
171171   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
172   UINT8 data = ~input_port_read(m_machine, keynames[m_keylatch / 8]);
172   UINT8 data = ~input_port_read(machine(), keynames[m_keylatch / 8]);
173173
174174   return BIT(data, m_keylatch % 8);
175175}
r11240r11241
182182
183183   // set Q led status
184184
185   set_led_status(m_machine, 1, state);
185   set_led_status(machine(), 1, state);
186186
187187   // tape out
188188
r11240r11241
220220void tmc2000e_state::machine_start()
221221{
222222   /* allocate color RAM */
223   m_colorram = auto_alloc_array(m_machine, UINT8, TMC2000E_COLORRAM_SIZE);
223   m_colorram = auto_alloc_array(machine(), UINT8, TMC2000E_COLORRAM_SIZE);
224224
225225   /* register for state saving */
226226   save_pointer(NAME(m_colorram), TMC2000E_COLORRAM_SIZE);
src/mess/drivers/cd2650.c
r11240r11241
9292
9393VIDEO_START_MEMBER(cd2650_state)
9494{
95   m_p_chargen = m_machine.region("chargen")->base();
95   m_p_chargen = machine().region("chargen")->base();
9696}
9797
9898SCREEN_UPDATE_MEMBER(cd2650_state)
src/mess/drivers/tek405x.c
r11240r11241
127127   switch (lbs)
128128   {
129129   case LBS_RBC:
130      program->install_rom(0x8800, 0xa7ff, m_machine.region(MC6800_TAG)->base() + 0x800);
130      program->install_rom(0x8800, 0xa7ff, machine().region(MC6800_TAG)->base() + 0x800);
131131      break;
132132
133133   case LBS_BSOFL:
134      program->install_rom(0x8800, 0xa7ff, m_machine.region("020_0147_00")->base());
134      program->install_rom(0x8800, 0xa7ff, machine().region("020_0147_00")->base());
135135      break;
136136
137137   case LBS_BSCOM:
138      program->install_rom(0x8800, 0xa7ff, m_machine.region("672_0799_08")->base());
138      program->install_rom(0x8800, 0xa7ff, machine().region("672_0799_08")->base());
139139      break;
140140
141141   default:
r11240r11241
643643    */
644644
645645   UINT8 data = 0;
646   UINT8 special = input_port_read(m_machine, "SPECIAL");
646   UINT8 special = input_port_read(machine(), "SPECIAL");
647647
648648   // keyboard column
649649   data = m_kc;
r11240r11241
672672    */
673673
674674   UINT8 data = 0;
675   UINT8 special = input_port_read(m_machine, "SPECIAL");
675   UINT8 special = input_port_read(machine(), "SPECIAL");
676676
677677   // shift
678678   data |= (BIT(special, 0) & BIT(special, 1));
src/mess/drivers/pegasus.c
r11240r11241
9393
9494WRITE_LINE_MEMBER( pegasus_state::pegasus_firq_clr )
9595{
96   cputag_set_input_line(m_machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
96   cputag_set_input_line(machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
9797}
9898
9999READ8_MEMBER( pegasus_state::pegasus_keyboard_r )
r11240r11241
101101   static const char *const keynames[] = { "X0", "X1", "X2", "X3", "X4", "X5", "X6", "X7" };
102102   UINT8 bit,data = 0xff;
103103   for (bit = 0; bit < 8; bit++)
104      if (!BIT(m_kbd_row, bit)) data &= input_port_read(m_machine, keynames[bit]);
104      if (!BIT(m_kbd_row, bit)) data &= input_port_read(machine(), keynames[bit]);
105105
106106   m_kbd_irq = (data == 0xff) ? 1 : 0;
107107   if (m_control_bits & 8) data<<=4;
r11240r11241
317317
318318VIDEO_START_MEMBER( pegasus_state )
319319{
320   m_p_chargen = m_machine.region("chargen")->base();
320   m_p_chargen = machine().region("chargen")->base();
321321}
322322
323323static const UINT8 mcm6571a_shift[] =
r11240r11241
476476
477477MACHINE_START_MEMBER( pegasus_state )
478478{
479   m_p_pcgram = m_machine.region("pcg")->base();
479   m_p_pcgram = machine().region("pcg")->base();
480480}
481481
482482MACHINE_RESET_MEMBER( pegasus_state )
src/mess/drivers/vg5k.c
r11240r11241
298298
299299void vg5k_state::machine_start()
300300{
301   state_save_register_global(m_machine, m_ef9345_offset);
301   state_save_register_global(machine(), m_ef9345_offset);
302302}
303303
304304void vg5k_state::machine_reset()
src/mess/drivers/tsispch.c
r11240r11241
160160
161161WRITE8_MEMBER( tsispch_state::i8251_rxd )
162162{
163   msm8251_receive_character(m_machine.device("i8251a_u15"), data);
163   msm8251_receive_character(machine().device("i8251a_u15"), data);
164164}
165165static GENERIC_TERMINAL_INTERFACE( tsispch_terminal_intf )
166166{
r11240r11241
199199    * which makes this register read 0xFC
200200    * When s4-7 is turned on, it reads 0xBC
201201    */
202   data = input_port_read(m_machine, "s4");
202   data = input_port_read(machine(), "s4");
203203   return data;
204204}
205205
r11240r11241
212212      When 0 is written to a bit, the led turns on.
213213      See notes at beginning of file for more info.
214214   */
215   tsispch_state *state = m_machine.driver_data<tsispch_state>();
215   tsispch_state *state = machine().driver_data<tsispch_state>();
216216   state->m_paramReg = data;
217   cputag_set_input_line(m_machine, "dsp", INPUT_LINE_RESET, BIT(data,6)?CLEAR_LINE:ASSERT_LINE);
217   cputag_set_input_line(machine(), "dsp", INPUT_LINE_RESET, BIT(data,6)?CLEAR_LINE:ASSERT_LINE);
218218#ifdef DEBUG_PARAM
219219   //fprintf(stderr,"8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; UNK0: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0));
220220   logerror("8086: Parameter Reg written: UNK7: %d, DSPRST6: %d; UNK5: %d; LED4: %d; LED3: %d; LED2: %d; LED1: %d; UNK0: %d\n", BIT(data,7), BIT(data,6), BIT(data,5), BIT(data,4), BIT(data,3), BIT(data,2), BIT(data,1), BIT(data,0));
r11240r11241
227227*****************************************************************************/
228228READ16_MEMBER( tsispch_state::dsp_data_r )
229229{
230   upd7725_device *upd7725 = m_machine.device<upd7725_device>("dsp");
230   upd7725_device *upd7725 = machine().device<upd7725_device>("dsp");
231231#ifdef DEBUG_DSP
232232   UINT8 temp;
233233   temp = upd7725->snesdsp_read(true);
r11240r11241
240240
241241WRITE16_MEMBER( tsispch_state::dsp_data_w )
242242{
243   upd7725_device *upd7725 = m_machine.device<upd7725_device>("dsp");
243   upd7725_device *upd7725 = machine().device<upd7725_device>("dsp");
244244#ifdef DEBUG_DSP_W
245245   fprintf(stderr, "dsp data write: %02x\n", data);
246246#endif
r11240r11241
249249
250250READ16_MEMBER( tsispch_state::dsp_status_r )
251251{
252   upd7725_device *upd7725 = m_machine.device<upd7725_device>("dsp");
252   upd7725_device *upd7725 = machine().device<upd7725_device>("dsp");
253253#ifdef DEBUG_DSP
254254   UINT8 temp;
255255   temp = upd7725->snesdsp_read(false);
r11240r11241
263263WRITE16_MEMBER( tsispch_state::dsp_status_w )
264264{
265265   fprintf(stderr, "warning: upd772x status register should never be written to!\n");
266   upd7725_device *upd7725 = m_machine.device<upd7725_device>("dsp");
266   upd7725_device *upd7725 = machine().device<upd7725_device>("dsp");
267267   upd7725->snesdsp_write(false, data);
268268}
269269
r11240r11241
276276   int i;
277277   for (i=0; i<32; i++) m_infifo[i] = 0;
278278   m_infifo_tail_ptr = m_infifo_head_ptr = 0;
279   device_set_irq_callback(m_machine.device("maincpu"), irq_callback);
279   device_set_irq_callback(machine().device("maincpu"), irq_callback);
280280   fprintf(stderr,"machine reset\n");
281281}
282282
src/mess/drivers/fidelz80.c
r11240r11241
627627   switch (m_kp_matrix & 0xf0)
628628   {
629629      case 0xe0:
630         data = input_port_read(m_machine, "LINE1");
630         data = input_port_read(machine(), "LINE1");
631631         break;
632632      case 0xd0:
633         data = input_port_read(m_machine, "LINE2");
633         data = input_port_read(machine(), "LINE2");
634634         break;
635635      case 0xb0:
636         data = input_port_read(m_machine, "LINE3");
636         data = input_port_read(machine(), "LINE3");
637637         break;
638638      case 0x70:
639         data = input_port_read(m_machine, "LINE4");
639         data = input_port_read(machine(), "LINE4");
640640         break;
641641   }
642642
r11240r11241
652652
653653      m_led_selected = data;
654654
655      update_display(m_machine);
655      update_display(machine());
656656   }
657657
658658   // ignoring the language switch enable for now, is bit 0x40
r11240r11241
670670    -xxx xxxx ??
671671    */
672672
673   return input_port_read(m_machine, "LEVEL");
673   return input_port_read(machine(), "LEVEL");
674674}
675675
676676WRITE8_MEMBER( fidelz80_state::cc10_porta_w )
r11240r11241
679679
680680   m_digit_data = data;
681681
682   update_display(m_machine);
682   update_display(machine());
683683}
684684
685685READ8_MEMBER( fidelz80_state::vcc_portb_r )
r11240r11241
700700   {
701701      m_digit_data = data;
702702
703      update_display(m_machine);
703      update_display(machine());
704704   }
705705}
706706
r11240r11241
789789   switch (m_kp_matrix)
790790   {
791791      case 0x01:
792         data = input_port_read(m_machine, "LINE1");
792         data = input_port_read(machine(), "LINE1");
793793         break;
794794      case 0x02:
795         data = input_port_read(m_machine, "LINE2");
795         data = input_port_read(machine(), "LINE2");
796796         break;
797797      case 0x04:
798         data = input_port_read(m_machine, "LINE3");
798         data = input_port_read(machine(), "LINE3");
799799         break;
800800      case 0x08:
801         data = input_port_read(m_machine, "LINE4");
801         data = input_port_read(machine(), "LINE4");
802802         break;
803803      case 0x10:
804         data = input_port_read(m_machine, "LINE5");
804         data = input_port_read(machine(), "LINE5");
805805         break;
806806      case 0x20:
807         data = input_port_read(m_machine, "LINE6");
807         data = input_port_read(machine(), "LINE6");
808808         break;
809809      case 0x40:
810         data = input_port_read(m_machine, "LINE7");
810         data = input_port_read(machine(), "LINE7");
811811         break;
812812      case 0x80:
813         data = input_port_read(m_machine, "LINE8");
813         data = input_port_read(machine(), "LINE8");
814814         break;
815815      default:
816816         data = 0xf0;
src/mess/drivers/sun1.c
r11240r11241
7777
7878MACHINE_RESET_MEMBER(sun1_state)
7979{
80   UINT8* user1 = m_machine.region("user1")->base();
80   UINT8* user1 = machine().region("user1")->base();
8181
8282   memcpy((UINT8*)m_ram,user1,0x4000);
8383
84   m_machine.device("maincpu")->reset();
84   machine().device("maincpu")->reset();
8585   m_term_data = 0;
8686}
8787
src/mess/drivers/pcfx.c
r11240r11241
5454
5555void pcfx_state::machine_reset()
5656{
57   memory_set_bankptr( m_machine, "bank1", m_machine.region("user1")->base() );
57   memory_set_bankptr( machine(), "bank1", machine().region("user1")->base() );
5858}
5959
6060
src/mess/drivers/h19.c
r11240r11241
302302
303303VIDEO_START_MEMBER( h19_state )
304304{
305   m_p_chargen = m_machine.region("chargen")->base();
305   m_p_chargen = machine().region("chargen")->base();
306306}
307307
308308SCREEN_UPDATE_MEMBER( h19_state )
src/mess/drivers/pro80.c
r11240r11241
6161{
6262   UINT8 data = 0x0f;
6363
64   if (!BIT(m_digit_sel, 0)) data &= input_port_read(m_machine, "LINE0");
65   if (!BIT(m_digit_sel, 1)) data &= input_port_read(m_machine, "LINE1");
66   if (!BIT(m_digit_sel, 2)) data &= input_port_read(m_machine, "LINE2");
67   if (!BIT(m_digit_sel, 3)) data &= input_port_read(m_machine, "LINE3");
68   if (!BIT(m_digit_sel, 4)) data &= input_port_read(m_machine, "LINE4");
69   if (!BIT(m_digit_sel, 5)) data &= input_port_read(m_machine, "LINE5");
64   if (!BIT(m_digit_sel, 0)) data &= input_port_read(machine(), "LINE0");
65   if (!BIT(m_digit_sel, 1)) data &= input_port_read(machine(), "LINE1");
66   if (!BIT(m_digit_sel, 2)) data &= input_port_read(machine(), "LINE2");
67   if (!BIT(m_digit_sel, 3)) data &= input_port_read(machine(), "LINE3");
68   if (!BIT(m_digit_sel, 4)) data &= input_port_read(machine(), "LINE4");
69   if (!BIT(m_digit_sel, 5)) data &= input_port_read(machine(), "LINE5");
7070
7171   return data;
7272}
src/mess/drivers/e01.c
r11240r11241
9595
9696READ8_MEMBER( e01_state::ram_select_r )
9797{
98   memory_set_bank(m_machine, "bank1", 0);
99   memory_set_bank(m_machine, "bank3", 0);
98   memory_set_bank(machine(), "bank1", 0);
99   memory_set_bank(machine(), "bank3", 0);
100100
101101   return 0;
102102}
r11240r11241
358358void e01_state::machine_start()
359359{
360360   UINT8 *ram = ram_get_ptr(m_ram);
361   UINT8 *rom = m_machine.region(R65C102_TAG)->base();
361   UINT8 *rom = machine().region(R65C102_TAG)->base();
362362
363363   /* setup memory banking */
364   memory_configure_bank(m_machine, "bank1", 0, 1, ram, 0);
365   memory_configure_bank(m_machine, "bank1", 1, 1, rom, 0);
366   memory_set_bank(m_machine, "bank1", 1);
364   memory_configure_bank(machine(), "bank1", 0, 1, ram, 0);
365   memory_configure_bank(machine(), "bank1", 1, 1, rom, 0);
366   memory_set_bank(machine(), "bank1", 1);
367367
368   memory_configure_bank(m_machine, "bank2", 0, 1, ram, 0);
369   memory_set_bank(m_machine, "bank2", 0);
368   memory_configure_bank(machine(), "bank2", 0, 1, ram, 0);
369   memory_set_bank(machine(), "bank2", 0);
370370
371   memory_configure_bank(m_machine, "bank3", 0, 1, ram + 0xfd00, 0);
372   memory_configure_bank(m_machine, "bank3", 1, 1, rom + 0xfd00, 0);
373   memory_set_bank(m_machine, "bank3", 1);
371   memory_configure_bank(machine(), "bank3", 0, 1, ram + 0xfd00, 0);
372   memory_configure_bank(machine(), "bank3", 1, 1, rom + 0xfd00, 0);
373   memory_set_bank(machine(), "bank3", 1);
374374
375   memory_configure_bank(m_machine, "bank4", 0, 1, ram + 0xfd00, 0);
376   memory_set_bank(m_machine, "bank4", 0);
375   memory_configure_bank(machine(), "bank4", 0, 1, ram + 0xfd00, 0);
376   memory_set_bank(machine(), "bank4", 0);
377377
378378   /* register for state saving */
379379   save_item(NAME(m_adlc_ie));
r11240r11241
391391
392392void e01_state::machine_reset()
393393{
394   memory_set_bank(m_machine, "bank1", 1);
395   memory_set_bank(m_machine, "bank3", 1);
394   memory_set_bank(machine(), "bank1", 1);
395   memory_set_bank(machine(), "bank3", 1);
396396}
397397
398398/***************************************************************************
src/mess/drivers/zrt80.c
r11240r11241
5858READ8_MEMBER( zrt80_state::zrt80_10_r )
5959{
6060   UINT8 ret = m_term_data;
61   cputag_set_input_line(m_machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
61   cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
6262   return ret;
6363}
6464
r11240r11241
7070
7171WRITE8_MEMBER(zrt80_state::zrt80_30_w)
7272{
73   m_machine.scheduler().timer_set(attotime::from_msec(100), FUNC(zrt80_beepoff));
73   machine().scheduler().timer_set(attotime::from_msec(100), FUNC(zrt80_beepoff));
7474   beep_set_state(m_beep, 1);
7575}
7676
7777WRITE8_MEMBER(zrt80_state::zrt80_38_w)
7878{
79   m_machine.scheduler().timer_set(attotime::from_msec(400), FUNC(zrt80_beepoff));
79   machine().scheduler().timer_set(attotime::from_msec(400), FUNC(zrt80_beepoff));
8080   beep_set_state(m_beep, 1);
8181}
8282
r11240r11241
193193
194194VIDEO_START_MEMBER( zrt80_state )
195195{
196   m_p_chargen = m_machine.region("chargen")->base();
196   m_p_chargen = machine().region("chargen")->base();
197197}
198198
199199SCREEN_UPDATE_MEMBER( zrt80_state )
r11240r11241
268268WRITE8_MEMBER( zrt80_state::zrt80_kbd_put )
269269{
270270   m_term_data = data;
271   cputag_set_input_line(m_machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
271   cputag_set_input_line(machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
272272}
273273
274274static GENERIC_TERMINAL_INTERFACE( zrt80_terminal_intf )
src/mess/drivers/ti89.c
r11240r11241
9393         data = m_timer_val;
9494         break;
9595      case 0x0d:
96         data = ((!m_on_key) << 9) | keypad_r(m_machine);
96         data = ((!m_on_key) << 9) | keypad_r(machine());
9797         break;
9898      default:
9999         data= m_io_hw1[offset & 0x0f];
r11240r11241
421421
422422void ti68k_state::machine_start()
423423{
424   UINT16 *rom = (UINT16 *)m_machine.region("flash")->base();
424   UINT16 *rom = (UINT16 *)machine().region("flash")->base();
425425   int i;
426426
427427   m_flash_mem = !((rom[0x32] & 0x0f) != 0);
src/mess/drivers/xerox820.c
r11240r11241
9090   int table = 0, row, col;
9191   int keydata = -1;
9292
93   if (input_port_read(m_machine, "ROW9") & 0x07)
93   if (input_port_read(machine(), "ROW9") & 0x07)
9494   {
9595      /* shift, upper case */
9696      table = 1;
9797   }
9898
99   if (input_port_read(m_machine, "ROW9") & 0x18)
99   if (input_port_read(machine(), "ROW9") & 0x18)
100100   {
101101      /* ctrl */
102102      table = 2;
r11240r11241
105105   /* scan keyboard */
106106   for (row = 0; row < 9; row++)
107107   {
108      UINT8 data = input_port_read(m_machine, keynames[row]);
108      UINT8 data = input_port_read(machine(), keynames[row]);
109109
110110      for (col = 0; col < 8; col++)
111111      {
r11240r11241
145145   if (bank)
146146   {
147147      /* ROM */
148      program->install_rom(0x0000, 0x0fff, m_machine.region("monitor")->base());
148      program->install_rom(0x0000, 0x0fff, machine().region("monitor")->base());
149149      program->unmap_readwrite(0x1000, 0x1fff);
150150      program->install_ram(0x3000, 0x3fff, m_video_ram);
151151   }
r11240r11241
164164   if (bank)
165165   {
166166      /* ROM */
167      program->install_rom(0x0000, 0x17ff, m_machine.region("monitor")->base());
167      program->install_rom(0x0000, 0x17ff, machine().region("monitor")->base());
168168      program->unmap_readwrite(0x1800, 0x2fff);
169169      program->install_ram(0x3000, 0x3fff, m_video_ram);
170170      program->unmap_readwrite(0x4000, 0xbfff);
r11240r11241
614614void xerox820_state::video_start()
615615{
616616   /* find memory regions */
617   m_char_rom = m_machine.region("chargen")->base();
617   m_char_rom = machine().region("chargen")->base();
618618}
619619
620620
r11240r11241
706706   floppy_install_load_proc(m_floppy1, xerox820_load_proc);
707707
708708   /* register for state saving */
709   state_save_register_global(m_machine, m_keydata);
710   state_save_register_global(m_machine, m_scroll);
711   state_save_register_global(m_machine, m_ncset2);
712   state_save_register_global(m_machine, m_vatt);
713   state_save_register_global(m_machine, m_fdc_irq);
714   state_save_register_global(m_machine, m_fdc_drq);
715   state_save_register_global(m_machine, m_8n5);
716   state_save_register_global(m_machine, m_dsdd);
709   state_save_register_global(machine(), m_keydata);
710   state_save_register_global(machine(), m_scroll);
711   state_save_register_global(machine(), m_ncset2);
712   state_save_register_global(machine(), m_vatt);
713   state_save_register_global(machine(), m_fdc_irq);
714   state_save_register_global(machine(), m_fdc_drq);
715   state_save_register_global(machine(), m_8n5);
716   state_save_register_global(machine(), m_dsdd);
717717}
718718
719719void xerox820_state::machine_reset()
src/mess/drivers/ptcsol.c
r11240r11241
500500
501501MACHINE_START_MEMBER( sol20_state )
502502{
503   m_cassette_timer = m_machine.scheduler().timer_alloc(FUNC(sol20_cassette_tc));
503   m_cassette_timer = machine().scheduler().timer_alloc(FUNC(sol20_cassette_tc));
504504}
505505
506506MACHINE_RESET_MEMBER( sol20_state )
r11240r11241
521521   ay31015_set_input_pin( m_uart, AY31015_CS, 1 );
522522
523523   // set switched uart pins
524   data = input_port_read(m_machine, "S4");
524   data = input_port_read(machine(), "S4");
525525   ay31015_set_input_pin( m_uart_s, AY31015_CS, 0 );
526526   ay31015_set_input_pin( m_uart_s, AY31015_NB1, BIT(data, 1) ? 1 : 0);
527527   ay31015_set_input_pin( m_uart_s, AY31015_NB2, BIT(data, 2) ? 1 : 0);
r11240r11241
531531   ay31015_set_input_pin( m_uart_s, AY31015_CS, 1 );
532532
533533   // set rs232 baud rate
534   data = input_port_read(m_machine, "S3");
534   data = input_port_read(machine(), "S3");
535535
536536   if (data > 1)
537537      do
r11240r11241
541541      }
542542      while (!(data & 1) && (s_count < 7)); // find which switch is used
543543
544   if ((s_count == 7) && (input_port_read(m_machine, "CONFIG")&1)) // if highest, look at jumper
544   if ((s_count == 7) && (input_port_read(machine(), "CONFIG")&1)) // if highest, look at jumper
545545      s_clock = 9600 << 4;
546546   else
547547      s_clock = s_bauds[s_count] << 4;
r11240r11241
551551   ay31015_set_transmitter_clock( m_uart_s, s_clock);
552552
553553   // boot-bank
554   memory_set_bank(m_machine, "boot", 1);
555   m_machine.scheduler().timer_set(attotime::from_usec(9), FUNC(sol20_boot));
554   memory_set_bank(machine(), "boot", 1);
555   machine().scheduler().timer_set(attotime::from_usec(9), FUNC(sol20_boot));
556556}
557557
558558static DRIVER_INIT( sol20 )
r11240r11241
563563
564564VIDEO_START_MEMBER( sol20_state )
565565{
566   m_p_chargen = m_machine.region("chargen")->base();
566   m_p_chargen = machine().region("chargen")->base();
567567}
568568
569569SCREEN_UPDATE_MEMBER( sol20_state )
src/mess/drivers/cosmicos.c
r11240r11241
8787   {
8888      if (BIT(m_keylatch, i))
8989      {
90         UINT8 keydata = input_port_read(m_machine, keynames[i]);
90         UINT8 keydata = input_port_read(machine(), keynames[i]);
9191
9292         if (BIT(keydata, 0)) data |= 0x01;
9393         if (BIT(keydata, 1)) data |= 0x02;
r11240r11241
414414
415415READ_LINE_MEMBER( cosmicos_state::ef1_r )
416416{
417   UINT8 special = input_port_read(m_machine, "SPECIAL");
417   UINT8 special = input_port_read(machine(), "SPECIAL");
418418
419419   return BIT(special, 0);
420420}
421421
422422READ_LINE_MEMBER( cosmicos_state::ef2_r )
423423{
424   UINT8 special = input_port_read(m_machine, "SPECIAL");
424   UINT8 special = input_port_read(machine(), "SPECIAL");
425425   int casin = cassette_input(m_cassette) < 0.0;
426426
427427   output_set_led_value(LED_CASSETTE, casin);
r11240r11241
431431
432432READ_LINE_MEMBER( cosmicos_state::ef3_r )
433433{
434   UINT8 special = input_port_read(m_machine, "SPECIAL");
434   UINT8 special = input_port_read(machine(), "SPECIAL");
435435
436436   return BIT(special, 2) | BIT(special, 3);
437437}
438438
439439READ_LINE_MEMBER( cosmicos_state::ef4_r )
440440{
441   return BIT(input_port_read(m_machine, "BUTTONS"), 0);
441   return BIT(input_port_read(machine(), "BUTTONS"), 0);
442442}
443443
444444static COSMAC_SC_WRITE( cosmicos_sc_w )
src/mess/drivers/argo.c
r11240r11241
254254
255255MACHINE_RESET_MEMBER(argo_state)
256256{
257   memory_set_bank(m_machine, "boot", 1);
258   m_machine.scheduler().timer_set(attotime::from_usec(5), FUNC(argo_boot));
257   memory_set_bank(machine(), "boot", 1);
258   machine().scheduler().timer_set(attotime::from_usec(5), FUNC(argo_boot));
259259}
260260
261261DRIVER_INIT( argo )
r11240r11241
266266
267267VIDEO_START_MEMBER( argo_state )
268268{
269   m_p_chargen = m_machine.region("chargen")->base();
269   m_p_chargen = machine().region("chargen")->base();
270270}
271271
272272SCREEN_UPDATE_MEMBER( argo_state )
src/mess/drivers/psion.c
r11240r11241
350350        ---- --x- pulse
351351        ---- ---x battery status
352352        */
353      return kb_read(m_machine) | input_port_read(m_machine, "BATTERY") | input_port_read(m_machine, "ON") | (m_kb_counter == 0x7ff)<<1 | m_pulse<<1;
353      return kb_read(machine()) | input_port_read(machine(), "BATTERY") | input_port_read(machine(), "ON") | (m_kb_counter == 0x7ff)<<1 | m_pulse<<1;
354354   case 0x17:
355355      /* datapack control lines */
356356      {
r11240r11241
402402      {
403403         m_ram_bank=0;
404404         m_rom_bank=0;
405         update_banks(m_machine);
405         update_banks(machine());
406406      }
407407      else
408408         m_kb_counter++;
r11240r11241
411411      if (offset == 0x2a0 && m_ram_bank_count)
412412      {
413413         m_ram_bank++;
414         update_banks(m_machine);
414         update_banks(machine());
415415      }
416416      else
417417         m_enable_nmi = 1;
r11240r11241
420420      if (offset == 0x2e0 && m_rom_bank_count)
421421      {
422422         m_rom_bank++;
423         update_banks(m_machine);
423         update_banks(machine());
424424      }
425425      else
426426         m_enable_nmi = 0;
r11240r11241
636636
637637void psion_state::machine_start()
638638{
639   if (!strcmp(m_machine.system().name, "psionlam"))
639   if (!strcmp(machine().system().name, "psionlam"))
640640   {
641641      m_rom_bank_count = 3;
642642      m_ram_bank_count = 0;
643643   }
644   else if (!strcmp(m_machine.system().name, "psionp350"))
644   else if (!strcmp(machine().system().name, "psionp350"))
645645   {
646646      m_rom_bank_count = 0;
647647      m_ram_bank_count = 5;
648648   }
649   else if (!strncmp(m_machine.system().name, "psionlz", 7))
649   else if (!strncmp(machine().system().name, "psionlz", 7))
650650   {
651651      m_rom_bank_count = 3;
652652      m_ram_bank_count = 3;
653653   }
654   else if (!strcmp(m_machine.system().name, "psionp464"))
654   else if (!strcmp(machine().system().name, "psionp464"))
655655   {
656656      m_rom_bank_count = 3;
657657      m_ram_bank_count = 9;
r11240r11241
664664
665665   if (m_rom_bank_count)
666666   {
667      UINT8* rom_base = (UINT8 *)m_machine.region("maincpu")->base();
667      UINT8* rom_base = (UINT8 *)machine().region("maincpu")->base();
668668
669      memory_configure_bank(m_machine, "rombank", 0, 1, rom_base + 0x8000, 0x4000);
670      memory_configure_bank(m_machine, "rombank", 1, m_rom_bank_count-1, rom_base + 0x10000, 0x4000);
671      memory_set_bank(m_machine, "rombank", 0);
669      memory_configure_bank(machine(), "rombank", 0, 1, rom_base + 0x8000, 0x4000);
670      memory_configure_bank(machine(), "rombank", 1, m_rom_bank_count-1, rom_base + 0x10000, 0x4000);
671      memory_set_bank(machine(), "rombank", 0);
672672   }
673673
674674   if (m_ram_bank_count)
675675   {
676      m_paged_ram = auto_alloc_array(m_machine, UINT8, m_ram_bank_count * 0x4000);
677      memory_configure_bank(m_machine, "rambank", 0, m_ram_bank_count, m_paged_ram, 0x4000);
678      memory_set_bank(m_machine, "rambank", 0);
676      m_paged_ram = auto_alloc_array(machine(), UINT8, m_ram_bank_count * 0x4000);
677      memory_configure_bank(machine(), "rambank", 0, m_ram_bank_count, m_paged_ram, 0x4000);
678      memory_set_bank(machine(), "rambank", 0);
679679   }
680680
681   state_save_register_global(m_machine, m_kb_counter);
682   state_save_register_global(m_machine, m_enable_nmi);
683   state_save_register_global(m_machine, m_tcsr_value);
684   state_save_register_global(m_machine, m_stby_pwr);
685   state_save_register_global(m_machine, m_pulse);
686   state_save_register_global(m_machine, m_rom_bank);
687   state_save_register_global(m_machine, m_ram_bank);
688   state_save_register_global(m_machine, m_port2_ddr);
689   state_save_register_global(m_machine, m_port2);
690   state_save_register_global(m_machine, m_port6_ddr);
691   state_save_register_global(m_machine, m_port6);
692   state_save_register_global_pointer(m_machine, m_paged_ram, m_ram_bank_count * 0x4000);
681   state_save_register_global(machine(), m_kb_counter);
682   state_save_register_global(machine(), m_enable_nmi);
683   state_save_register_global(machine(), m_tcsr_value);
684   state_save_register_global(machine(), m_stby_pwr);
685   state_save_register_global(machine(), m_pulse);
686   state_save_register_global(machine(), m_rom_bank);
687   state_save_register_global(machine(), m_ram_bank);
688   state_save_register_global(machine(), m_port2_ddr);
689   state_save_register_global(machine(), m_port2);
690   state_save_register_global(machine(), m_port6_ddr);
691   state_save_register_global(machine(), m_port6);
692   state_save_register_global_pointer(machine(), m_paged_ram, m_ram_bank_count * 0x4000);
693693}
694694
695695void psion_state::machine_reset()
r11240r11241
701701   m_pulse=0;
702702
703703   if (m_rom_bank_count || m_ram_bank_count)
704      update_banks(m_machine);
704      update_banks(machine());
705705}
706706
707707bool psion_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
src/mess/drivers/vixen.c
r11240r11241
9292{
9393   logerror("CTL %u\n", data);
9494
95   memory_set_bank(m_machine, "bank3", BIT(data, 0));
95   memory_set_bank(machine(), "bank3", BIT(data, 0));
9696}
9797
9898
r11240r11241
372372void vixen_state::video_start()
373373{
374374   // find memory regions
375   m_sync_rom = m_machine.region("video")->base();
376   m_char_rom = m_machine.region("chargen")->base();
375   m_sync_rom = machine().region("video")->base();
376   m_char_rom = machine().region("chargen")->base();
377377
378378   // register for state saving
379   state_save_register_global(m_machine, m_alt);
380   state_save_register_global(m_machine, m_256);
381   state_save_register_global(m_machine, m_vsync);
382   state_save_register_global_pointer(m_machine, m_video_ram, 0x1000);
379   state_save_register_global(machine(), m_alt);
380   state_save_register_global(machine(), m_256);
381   state_save_register_global(machine(), m_vsync);
382   state_save_register_global_pointer(machine(), m_video_ram, 0x1000);
383383}
384384
385385
r11240r11241
471471{
472472   UINT8 data = 0xff;
473473
474   if (!BIT(m_col, 0)) data &= input_port_read(m_machine, "ROW0");
475   if (!BIT(m_col, 1)) data &= input_port_read(m_machine, "ROW1");
476   if (!BIT(m_col, 2)) data &= input_port_read(m_machine, "ROW2");
477   if (!BIT(m_col, 3)) data &= input_port_read(m_machine, "ROW3");
478   if (!BIT(m_col, 4)) data &= input_port_read(m_machine, "ROW4");
479   if (!BIT(m_col, 5)) data &= input_port_read(m_machine, "ROW5");
480   if (!BIT(m_col, 6)) data &= input_port_read(m_machine, "ROW6");
481   if (!BIT(m_col, 7)) data &= input_port_read(m_machine, "ROW7");
474   if (!BIT(m_col, 0)) data &= input_port_read(machine(), "ROW0");
475   if (!BIT(m_col, 1)) data &= input_port_read(machine(), "ROW1");
476   if (!BIT(m_col, 2)) data &= input_port_read(machine(), "ROW2");
477   if (!BIT(m_col, 3)) data &= input_port_read(machine(), "ROW3");
478   if (!BIT(m_col, 4)) data &= input_port_read(machine(), "ROW4");
479   if (!BIT(m_col, 5)) data &= input_port_read(machine(), "ROW5");
480   if (!BIT(m_col, 6)) data &= input_port_read(machine(), "ROW6");
481   if (!BIT(m_col, 7)) data &= input_port_read(machine(), "ROW7");
482482
483483   return data;
484484}
r11240r11241
741741   // configure memory banking
742742   UINT8 *ram = ram_get_ptr(m_ram);
743743
744   memory_configure_bank(m_machine, "bank1", 0, 1, ram, 0);
745   memory_configure_bank(m_machine, "bank1", 1, 1, m_machine.region(Z8400A_TAG)->base(), 0);
744   memory_configure_bank(machine(), "bank1", 0, 1, ram, 0);
745   memory_configure_bank(machine(), "bank1", 1, 1, machine().region(Z8400A_TAG)->base(), 0);
746746
747   memory_configure_bank(m_machine, "bank2", 0, 1, ram, 0);
748   memory_configure_bank(m_machine, "bank2", 1, 1, m_video_ram, 0);
747   memory_configure_bank(machine(), "bank2", 0, 1, ram, 0);
748   memory_configure_bank(machine(), "bank2", 1, 1, m_video_ram, 0);
749749
750   memory_configure_bank(m_machine, "bank3", 0, 1, m_video_ram, 0);
751   memory_configure_bank(m_machine, "bank3", 1, 1, m_machine.region(Z8400A_TAG)->base(), 0);
750   memory_configure_bank(machine(), "bank3", 0, 1, m_video_ram, 0);
751   memory_configure_bank(machine(), "bank3", 1, 1, machine().region(Z8400A_TAG)->base(), 0);
752752
753   memory_configure_bank(m_machine, "bank4", 0, 1, m_video_ram, 0);
753   memory_configure_bank(machine(), "bank4", 0, 1, m_video_ram, 0);
754754
755755   // register for state saving
756   state_save_register_global(m_machine, m_reset);
757   state_save_register_global(m_machine, m_col);
758   state_save_register_global(m_machine, m_cmd_d0);
759   state_save_register_global(m_machine, m_cmd_d1);
760   state_save_register_global(m_machine, m_fdint);
756   state_save_register_global(machine(), m_reset);
757   state_save_register_global(machine(), m_col);
758   state_save_register_global(machine(), m_cmd_d0);
759   state_save_register_global(machine(), m_cmd_d1);
760   state_save_register_global(machine(), m_fdint);
761761}
762762
763763
r11240r11241
772772   program->install_read_bank(0x0000, 0xefff, 0xfff, 0, "bank1");
773773   program->install_write_bank(0x0000, 0xefff, 0xfff, 0, "bank2");
774774
775   memory_set_bank(m_machine, "bank1", 1);
776   memory_set_bank(m_machine, "bank2", 1);
777   memory_set_bank(m_machine, "bank3", 1);
775   memory_set_bank(machine(), "bank1", 1);
776   memory_set_bank(machine(), "bank2", 1);
777   memory_set_bank(machine(), "bank3", 1);
778778
779779   m_reset = 1;
780780
src/ldplayer/ldpdriv.c
r11240r11241
1/******************************************************************************
2
3    ldpdriv.c
4
5    mamedriv.c substitute file for "ldplayer" MAME builds.
6
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10    The list of used drivers. Drivers have to be included here to be recognized
11    by the executable.
12
13    To save some typing, we use a hack here. This file is recursively #included
14    twice, with different definitions of the DRIVER() macro. The first one
15    declares external references to the drivers; the second one builds an array
16    storing all the drivers.
17
18******************************************************************************/
19
20#include "emu.h"
21
22#ifndef DRIVER_RECURSIVE
23
24#define DRIVER_RECURSIVE
25
26/* step 1: declare all external references */
27#define DRIVER(NAME) extern game_driver driver_##NAME;
28#include "ldpdriv.c"
29
30/* step 2: define the drivers[] array */
31#undef DRIVER
32#define DRIVER(NAME) &driver_##NAME,
33const game_driver * const drivers[] =
34{
35#include "ldpdriv.c"
36   0   /* end of array */
37};
38
39#else   /* DRIVER_RECURSIVE */
40
41   DRIVER( ldv1000 )   /* Pioneer LD-V1000 */
42   DRIVER( pr8210 )   /* Pioneer PR-8210 */
43
44#endif   /* DRIVER_RECURSIVE */
src/ldplayer/ldplayer.mak
r11240r11241
4444#-------------------------------------------------
4545
4646DRVLIBS = \
47   $(LDPOBJ)/ldpdriv.o \
4847   $(EMUDRIVERS)/emudummy.o \
4948   $(LDPOBJ)/ldplayer.o \
5049
src/ldplayer/ldplayer.c
r11240r11241
2626 *
2727 *************************************/
2828
29enum
30{
31   CMD_SCAN_REVERSE,
32   CMD_STEP_REVERSE,
33   CMD_SLOW_REVERSE,
34   CMD_FAST_REVERSE,
35   CMD_SCAN_FORWARD,
36   CMD_STEP_FORWARD,
37   CMD_SLOW_FORWARD,
38   CMD_FAST_FORWARD,
39   CMD_PLAY,
40   CMD_PAUSE,
41   CMD_FRAME_TOGGLE,
42   CMD_CHAPTER_TOGGLE,
43   CMD_CH1_TOGGLE,
44   CMD_CH2_TOGGLE,
45   CMD_0,
46   CMD_1,
47   CMD_2,
48   CMD_3,
49   CMD_4,
50   CMD_5,
51   CMD_6,
52   CMD_7,
53   CMD_8,
54   CMD_9,
55   CMD_SEARCH
56};
57
58
59
6029/*************************************
6130 *
6231 *  Globals
6332 *
6433 *************************************/
6534
66static astring filename;
35class ldplayer_state : public driver_device
36{
37public:
38   // construction/destruction
39   ldplayer_state(running_machine &machine, const driver_device_config_base &config)
40      : driver_device(machine, config),
41        m_last_controls(0),
42        m_playing(false),
43        m_laserdisc(*this, "laserdisc") { }
6744
68static input_port_value last_controls;
69static UINT8 playing;
45   // callback hook
46   static chd_file *get_disc_static(device_t *device) { return device->machine().driver_data<ldplayer_state>()->get_disc(); }
7047
71static emu_timer *pr8210_bit_timer;
72static UINT32 pr8210_command_buffer_in, pr8210_command_buffer_out;
73static UINT8 pr8210_command_buffer[10];
48protected:
49   // device overrides
50   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
51   virtual void machine_start();
52   virtual void machine_reset();
7453
75static void (*execute_command)(device_t *laserdisc, int command);
54   // internal helpers
55   chd_file *get_disc();
56   void process_commands();
57   
58   // derived classes
59   virtual void execute_command(int command) { assert(false); }
7660
61   // timer IDs
62   enum
63   {
64      TIMER_ID_AUTOPLAY,
65      TIMER_ID_VSYNC_UPDATE
66   };
7767
68   // commands
69   enum
70   {
71      CMD_SCAN_REVERSE,
72      CMD_STEP_REVERSE,
73      CMD_SLOW_REVERSE,
74      CMD_FAST_REVERSE,
75      CMD_SCAN_FORWARD,
76      CMD_STEP_FORWARD,
77      CMD_SLOW_FORWARD,
78      CMD_FAST_FORWARD,
79      CMD_PLAY,
80      CMD_PAUSE,
81      CMD_FRAME_TOGGLE,
82      CMD_CHAPTER_TOGGLE,
83      CMD_CH1_TOGGLE,
84      CMD_CH2_TOGGLE,
85      CMD_0,
86      CMD_1,
87      CMD_2,
88      CMD_3,
89      CMD_4,
90      CMD_5,
91      CMD_6,
92      CMD_7,
93      CMD_8,
94      CMD_9,
95      CMD_SEARCH
96   };
7897
98   // internal state
99   astring m_filename;
100   input_port_value m_last_controls;
101   bool m_playing;
102   required_device<laserdisc_device> m_laserdisc;
103};
104
105
106class pr8210_state : public ldplayer_state
107{
108public:
109   // construction/destruction
110   pr8210_state(running_machine &machine, const driver_device_config_base &config)
111      : ldplayer_state(machine, config),
112        m_bit_timer(timer_alloc(TIMER_ID_BIT)),
113        m_command_buffer_in(0),
114        m_command_buffer_out(0) { }
115
116protected:
117   // device overrides
118   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
119   virtual void machine_reset();
120
121   // command execution hook
122   virtual void execute_command(int command);
123   
124   // internal helpers
125   inline void add_command(UINT8 command);
126
127   // timer IDs
128   enum
129   {
130      TIMER_ID_BIT = 100,
131      TIMER_ID_BIT_OFF
132   };
133
134   // internal state
135   emu_timer *m_bit_timer;
136   UINT32 m_command_buffer_in;
137   UINT32 m_command_buffer_out;
138   UINT8 m_command_buffer[10];
139};
140
141
142class ldv1000_state : public ldplayer_state
143{
144public:
145   // construction/destruction
146   ldv1000_state(running_machine &machine, const driver_device_config_base &config)
147      : ldplayer_state(machine, config) { }
148
149protected:
150   // command execution hook
151   virtual void execute_command(int command);
152};
153
154
155
79156/*************************************
80157 *
81158 *  Disc location
82159 *
83160 *************************************/
84161
85static void free_string(running_machine &machine)
162chd_file *ldplayer_state::get_disc()
86163{
87}
164   // open a path to the ROMs and find the first CHD file
165   file_enumerator path(machine().options().media_path());
88166
89
90static chd_file *get_disc(device_t *device)
91{
167   // iterate while we get new objects
168   const osd_directory_entry *dir;
92169   emu_file *image_file = NULL;
93170   chd_file *image_chd = NULL;
94
95   /* open a path to the ROMs and find the first CHD file */
96   file_enumerator path(device->machine().options().media_path());
97   const osd_directory_entry *dir;
98
99   /* iterate while we get new objects */
100171   while ((dir = path.next()) != NULL)
101172   {
102173      int length = strlen(dir->name);
103174
104      /* look for files ending in .chd */
175      // look for files ending in .chd
105176      if (length > 4 &&
106177         dir->name[length - 4] == '.' &&
107178         tolower(dir->name[length - 3]) == 'c' &&
108179         tolower(dir->name[length - 2]) == 'h' &&
109180         tolower(dir->name[length - 1]) == 'd')
110181      {
111         file_error filerr;
112         chd_error chderr;
113
114         /* open the file itself via our search path */
115         image_file = auto_alloc(device->machine(), emu_file(device->machine().options().media_path(), OPEN_FLAG_READ));
116         filerr = image_file->open(dir->name);
182         // open the file itself via our search path
183         image_file = auto_alloc(machine(), emu_file(machine().options().media_path(), OPEN_FLAG_READ));
184         file_error filerr = image_file->open(dir->name);
117185         if (filerr == FILERR_NONE)
118186         {
119            /* try to open the CHD */
120            chderr = chd_open_file(*image_file, CHD_OPEN_READ, NULL, &image_chd);
187            // try to open the CHD
188            chd_error chderr = chd_open_file(*image_file, CHD_OPEN_READ, NULL, &image_chd);
121189            if (chderr == CHDERR_NONE)
122190            {
123               set_disk_handle(device->machine(), "laserdisc", *image_file, *image_chd);
124               filename.cpy(dir->name);
125               device->machine().add_notifier(MACHINE_NOTIFY_EXIT, free_string);
191               set_disk_handle(machine(), "laserdisc", *image_file, *image_chd);
192               m_filename.cpy(dir->name);
126193               break;
127194            }
128195         }
129196
130         /* close the file on failure */
131         auto_free(device->machine(), image_file);
197         // close the file on failure
198         auto_free(machine(), image_file);
132199         image_file = NULL;
133200      }
134201   }
135202
136   /* if we failed, pop a message and exit */
203   // if we failed, pop a message and exit
137204   if (image_file == NULL)
138      fatalerror("No valid image file found!\n");
205      throw emu_fatalerror("No valid image file found!\n");
139206
140   return get_disk_handle(device->machine(), "laserdisc");
207   return get_disk_handle(machine(), "laserdisc");
141208}
142209
143210
r11240r11241
148215 *
149216 *************************************/
150217
151static void process_commands(device_t *laserdisc)
218void ldplayer_state::process_commands()
152219{
153   input_port_value controls = input_port_read(laserdisc->machine(), "controls");
220   input_port_value controls = input_port_read(machine(), "controls");
154221   int number;
155222
156   /* step backwards */
157   if (!(last_controls & 0x01) && (controls & 0x01))
158      (*execute_command)(laserdisc, CMD_STEP_REVERSE);
223   // step backwards
224   if (!(m_last_controls & 0x01) && (controls & 0x01))
225      execute_command(CMD_STEP_REVERSE);
159226
160   /* step forwards */
161   if (!(last_controls & 0x02) && (controls & 0x02))
162      (*execute_command)(laserdisc, CMD_STEP_FORWARD);
227   // step forwards
228   if (!(m_last_controls & 0x02) && (controls & 0x02))
229      execute_command(CMD_STEP_FORWARD);
163230
164   /* scan backwards */
231   // scan backwards
165232   if (controls & 0x04)
166      (*execute_command)(laserdisc, CMD_SCAN_REVERSE);
233      execute_command(CMD_SCAN_REVERSE);
167234
168   /* scan forwards */
235   // scan forwards
169236   if (controls & 0x08)
170      (*execute_command)(laserdisc, CMD_SCAN_FORWARD);
237      execute_command(CMD_SCAN_FORWARD);
171238
172   /* slow backwards */
173   if (!(last_controls & 0x10) && (controls & 0x10))
174      (*execute_command)(laserdisc, CMD_SLOW_REVERSE);
239   // slow backwards
240   if (!(m_last_controls & 0x10) && (controls & 0x10))
241      execute_command(CMD_SLOW_REVERSE);
175242
176   /* slow forwards */
177   if (!(last_controls & 0x20) && (controls & 0x20))
178      (*execute_command)(laserdisc, CMD_SLOW_FORWARD);
243   // slow forwards
244   if (!(m_last_controls & 0x20) && (controls & 0x20))
245      execute_command(CMD_SLOW_FORWARD);
179246
180   /* fast backwards */
247   // fast backwards
181248   if (controls & 0x40)
182      (*execute_command)(laserdisc, CMD_FAST_REVERSE);
249      execute_command(CMD_FAST_REVERSE);
183250
184   /* fast forwards */
251   // fast forwards
185252   if (controls & 0x80)
186      (*execute_command)(laserdisc, CMD_FAST_FORWARD);
253      execute_command(CMD_FAST_FORWARD);
187254
188   /* play/pause */
189   if (!(last_controls & 0x100) && (controls & 0x100))
255   // play/pause
256   if (!(m_last_controls & 0x100) && (controls & 0x100))
190257   {
191      playing = !playing;
192      (*execute_command)(laserdisc, playing ? CMD_PLAY : CMD_PAUSE);
258      m_playing = !m_playing;
259      execute_command(m_playing ? CMD_PLAY : CMD_PAUSE);
193260   }
194261
195   /* toggle frame display */
196   if (!(last_controls & 0x200) && (controls & 0x200))
197      (*execute_command)(laserdisc, CMD_FRAME_TOGGLE);
262   // toggle frame display
263   if (!(m_last_controls & 0x200) && (controls & 0x200))
264      execute_command(CMD_FRAME_TOGGLE);
198265
199   /* toggle chapter display */
200   if (!(last_controls & 0x400) && (controls & 0x400))
201      (*execute_command)(laserdisc, CMD_CHAPTER_TOGGLE);
266   // toggle chapter display
267   if (!(m_last_controls & 0x400) && (controls & 0x400))
268      execute_command(CMD_CHAPTER_TOGGLE);
202269
203   /* toggle left channel */
204   if (!(last_controls & 0x800) && (controls & 0x800))
205      (*execute_command)(laserdisc, CMD_CH1_TOGGLE);
270   // toggle left channel
271   if (!(m_last_controls & 0x800) && (controls & 0x800))
272      execute_command(CMD_CH1_TOGGLE);
206273
207   /* toggle right channel */
208   if (!(last_controls & 0x1000) && (controls & 0x1000))
209      (*execute_command)(laserdisc, CMD_CH2_TOGGLE);
274   // toggle right channel
275   if (!(m_last_controls & 0x1000) && (controls & 0x1000))
276      execute_command(CMD_CH2_TOGGLE);
210277
211   /* numbers */
278   // numbers
212279   for (number = 0; number < 10; number++)
213      if (!(last_controls & (0x10000 << number)) && (controls & (0x10000 << number)))
214         (*execute_command)(laserdisc, CMD_0 + number);
280      if (!(m_last_controls & (0x10000 << number)) && (controls & (0x10000 << number)))
281         execute_command(CMD_0 + number);
215282
216   /* enter */
217   if (!(last_controls & 0x4000000) && (controls & 0x4000000))
218      (*execute_command)(laserdisc, CMD_SEARCH);
283   // enter
284   if (!(m_last_controls & 0x4000000) && (controls & 0x4000000))
285      execute_command(CMD_SEARCH);
219286
220   last_controls = controls;
287   m_last_controls = controls;
221288}
222289
223290
224static TIMER_CALLBACK( vsync_update )
291void ldplayer_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
225292{
226   device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
227   int vblank_scanline;
228   attotime target;
293   switch (id)
294   {
295      case TIMER_ID_VSYNC_UPDATE:
296      {
297         // handle commands
298         if (param == 0)
299            process_commands();
229300
230   /* handle commands */
231   if (!param)
232      process_commands(laserdisc);
233
234   /* set a timer to go off on the next VBLANK */
235   vblank_scanline = machine.primary_screen->visible_area().max_y + 1;
236   target = machine.primary_screen->time_until_pos(vblank_scanline);
237   machine.scheduler().timer_set(target, FUNC(vsync_update));
301         // set a timer to go off on the next VBLANK
302         int vblank_scanline = machine().primary_screen->visible_area().max_y + 1;
303         attotime target = machine().primary_screen->time_until_pos(vblank_scanline);
304         timer_set(target, TIMER_ID_VSYNC_UPDATE);
305         break;
306      }
307     
308      case TIMER_ID_AUTOPLAY:
309         // start playing
310         execute_command(CMD_PLAY);
311         m_playing = true;
312         break;
313   }
238314}
239315
240316
241static MACHINE_START( ldplayer )
317void ldplayer_state::machine_start()
242318{
243   vsync_update(machine, NULL, 1);
319   // start the vsync timer going
320   timer_set(attotime::zero, TIMER_ID_VSYNC_UPDATE, 1);
244321}
245322
246323
247static TIMER_CALLBACK( autoplay )
324void ldplayer_state::machine_reset()
248325{
249   device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
326   // set up a timer to start playing immediately
327   timer_set(attotime::zero, TIMER_ID_AUTOPLAY);
250328
251   /* start playing */
252   (*execute_command)(laserdisc, CMD_PLAY);
253   playing = TRUE;
329   // indicate the name of the file we opened
330   popmessage("Opened %s\n", m_filename.cstr());
254331}
255332
256333
257static MACHINE_RESET( ldplayer )
258{
259   /* set up a timer to start playing immediately */
260   machine.scheduler().timer_set(attotime::zero, FUNC(autoplay));
261334
262   /* indicate the name of the file we opened */
263   popmessage("Opened %s\n", filename.cstr());
264}
265
266
267
268335/*************************************
269336 *
270337 *  PR-8210 implementation
271338 *
272339 *************************************/
273340
274INLINE void pr8210_add_command(UINT8 command)
341void pr8210_state::add_command(UINT8 command)
275342{
276   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = (command & 0x1f) | 0x20;
277   pr8210_command_buffer[pr8210_command_buffer_in++ % ARRAY_LENGTH(pr8210_command_buffer)] = 0x00 | 0x20;
343   m_command_buffer[m_command_buffer_in++ % ARRAY_LENGTH(m_command_buffer)] = (command & 0x1f) | 0x20;
344   m_command_buffer[m_command_buffer_in++ % ARRAY_LENGTH(m_command_buffer)] = 0x00 | 0x20;
278345}
279346
280347
281static TIMER_CALLBACK( pr8210_bit_off_callback )
348void pr8210_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
282349{
283   device_t *laserdisc = (device_t *)ptr;
350   switch (id)
351   {
352      case TIMER_ID_BIT:
353      {
354         attotime duration = attotime::from_msec(30);
355         UINT8 bitsleft = param >> 16;
356         UINT8 data = param;
284357
285   /* deassert the control line */
286   laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE);
287}
358         // if we have bits, process
359         if (bitsleft != 0)
360         {
361            // assert the line and set a timer for deassertion
362            laserdisc_line_w(m_laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
363            timer_set(attotime::from_usec(250), TIMER_ID_BIT_OFF);
288364
365            // space 0 bits apart by 1msec, and 1 bits by 2msec
366            duration = attotime::from_msec((data & 0x80) ? 2 : 1);
367            data <<= 1;
368            bitsleft--;
369         }
289370
290static TIMER_CALLBACK( pr8210_bit_callback )
291{
292   attotime duration = attotime::from_msec(30);
293   device_t *laserdisc = (device_t *)ptr;
294   UINT8 bitsleft = param >> 16;
295   UINT8 data = param;
296
297   /* if we have bits, process */
298   if (bitsleft != 0)
299   {
300      /* assert the line and set a timer for deassertion */
301      laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
302      machine.scheduler().timer_set(attotime::from_usec(250), FUNC(pr8210_bit_off_callback), 0, ptr);
303
304      /* space 0 bits apart by 1msec, and 1 bits by 2msec */
305      duration = attotime::from_msec((data & 0x80) ? 2 : 1);
306      data <<= 1;
307      bitsleft--;
371         // if we're out of bits, queue up the next command
372         else if (bitsleft == 0 && m_command_buffer_in != m_command_buffer_out)
373         {
374            data = m_command_buffer[m_command_buffer_out++ % ARRAY_LENGTH(m_command_buffer)];
375            bitsleft = 12;
376         }
377         m_bit_timer->adjust(duration, (bitsleft << 16) | data);
378         break;
379      }
380     
381      // deassert the control line
382      case TIMER_ID_BIT_OFF:
383         laserdisc_line_w(m_laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE);
384         break;
385     
386      // others to the parent class
387      default:
388         ldplayer_state::device_timer(timer, id, param, ptr);
389         break;
308390   }
309
310   /* if we're out of bits, queue up the next command */
311   else if (bitsleft == 0 && pr8210_command_buffer_in != pr8210_command_buffer_out)
312   {
313      data = pr8210_command_buffer[pr8210_command_buffer_out++ % ARRAY_LENGTH(pr8210_command_buffer)];
314      bitsleft = 12;
315   }
316   pr8210_bit_timer->adjust(duration, (bitsleft << 16) | data);
317391}
318392
319393
320static MACHINE_START( pr8210 )
394void pr8210_state::machine_reset()
321395{
322   device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
323   MACHINE_START_CALL(ldplayer);
324   pr8210_bit_timer = machine.scheduler().timer_alloc(FUNC(pr8210_bit_callback), (void *)laserdisc);
396   ldplayer_state::machine_reset();
397   m_bit_timer->adjust(attotime::zero);
325398}
326399
327400
328static MACHINE_RESET( pr8210 )
401void pr8210_state::execute_command(int command)
329402{
330   MACHINE_RESET_CALL(ldplayer);
331   pr8210_bit_timer->adjust(attotime::zero);
332}
333
334
335static void pr8210_execute(device_t *laserdisc, int command)
336{
337403   static const UINT8 digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 };
338404
339405   switch (command)
340406   {
341407      case CMD_SCAN_REVERSE:
342         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
343            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
408         if (m_command_buffer_in == m_command_buffer_out ||
409            m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
344410         {
345            pr8210_add_command(0x1c);
346            playing = TRUE;
411            add_command(0x1c);
412            m_playing = true;
347413         }
348414         break;
349415
350416      case CMD_STEP_REVERSE:
351         pr8210_add_command(0x12);
352         playing = FALSE;
417         add_command(0x12);
418         m_playing = false;
353419         break;
354420
355421      case CMD_SLOW_REVERSE:
356         pr8210_add_command(0x02);
357         playing = TRUE;
422         add_command(0x02);
423         m_playing = true;
358424         break;
359425
360426      case CMD_FAST_REVERSE:
361         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
362            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
427         if (m_command_buffer_in == m_command_buffer_out ||
428            m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
363429         {
364            pr8210_add_command(0x0c);
365            playing = TRUE;
430            add_command(0x0c);
431            m_playing = true;
366432         }
367433         break;
368434
369435      case CMD_SCAN_FORWARD:
370         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
371            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
436         if (m_command_buffer_in == m_command_buffer_out ||
437            m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
372438         {
373            pr8210_add_command(0x08);
374            playing = TRUE;
439            add_command(0x08);
440            m_playing = true;
375441         }
376442         break;
377443
378444      case CMD_STEP_FORWARD:
379         pr8210_add_command(0x04);
380         playing = FALSE;
445         add_command(0x04);
446         m_playing = false;
381447         break;
382448
383449      case CMD_SLOW_FORWARD:
384         pr8210_add_command(0x18);
385         playing = TRUE;
450         add_command(0x18);
451         m_playing = true;
386452         break;
387453
388454      case CMD_FAST_FORWARD:
389         if (pr8210_command_buffer_in == pr8210_command_buffer_out ||
390            pr8210_command_buffer_in == (pr8210_command_buffer_out + 1) % ARRAY_LENGTH(pr8210_command_buffer))
455         if (m_command_buffer_in == m_command_buffer_out ||
456            m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
391457         {
392            pr8210_add_command(0x10);
393            playing = TRUE;
458            add_command(0x10);
459            m_playing = true;
394460         }
395461         break;
396462
397463      case CMD_PLAY:
398         pr8210_add_command(0x14);
399         playing = TRUE;
464         add_command(0x14);
465         m_playing = true;
400466         break;
401467
402468      case CMD_PAUSE:
403         pr8210_add_command(0x0a);
404         playing = FALSE;
469         add_command(0x0a);
470         m_playing = false;
405471         break;
406472
407473      case CMD_FRAME_TOGGLE:
408         pr8210_add_command(0x0b);
474         add_command(0x0b);
409475         break;
410476
411477      case CMD_CHAPTER_TOGGLE:
412         pr8210_add_command(0x06);
478         add_command(0x06);
413479         break;
414480
415481      case CMD_CH1_TOGGLE:
416         pr8210_add_command(0x0e);
482         add_command(0x0e);
417483         break;
418484
419485      case CMD_CH2_TOGGLE:
420         pr8210_add_command(0x16);
486         add_command(0x16);
421487         break;
422488
423489      case CMD_0:
r11240r11241
430496      case CMD_7:
431497      case CMD_8:
432498      case CMD_9:
433         pr8210_add_command(digits[command - CMD_0]);
499         add_command(digits[command - CMD_0]);
434500         break;
435501
436502      case CMD_SEARCH:
437         pr8210_add_command(0x1a);
438         playing = FALSE;
503         add_command(0x1a);
504         m_playing = false;
439505         break;
440506   }
441507}
r11240r11241
448514 *
449515 *************************************/
450516
451static void ldv1000_execute(device_t *laserdisc, int command)
517void ldv1000_state::execute_command(int command)
452518{
453519   static const UINT8 digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f };
454520   switch (command)
455521   {
456522      case CMD_SCAN_REVERSE:
457         laserdisc_data_w(laserdisc, 0xf8);
458         playing = TRUE;
523         laserdisc_data_w(m_laserdisc, 0xf8);
524         m_playing = true;
459525         break;
460526
461527      case CMD_STEP_REVERSE:
462         laserdisc_data_w(laserdisc, 0xfe);
463         playing = FALSE;
528         laserdisc_data_w(m_laserdisc, 0xfe);
529         m_playing = false;
464530         break;
465531
466532      case CMD_SCAN_FORWARD:
467         laserdisc_data_w(laserdisc, 0xf0);
468         playing = TRUE;
533         laserdisc_data_w(m_laserdisc, 0xf0);
534         m_playing = true;
469535         break;
470536
471537      case CMD_STEP_FORWARD:
472         laserdisc_data_w(laserdisc, 0xf6);
473         playing = FALSE;
538         laserdisc_data_w(m_laserdisc, 0xf6);
539         m_playing = false;
474540         break;
475541
476542      case CMD_PLAY:
477         laserdisc_data_w(laserdisc, 0xfd);
478         playing = TRUE;
543         laserdisc_data_w(m_laserdisc, 0xfd);
544         m_playing = true;
479545         break;
480546
481547      case CMD_PAUSE:
482         laserdisc_data_w(laserdisc, 0xa0);
483         playing = FALSE;
548         laserdisc_data_w(m_laserdisc, 0xa0);
549         m_playing = false;
484550         break;
485551
486552      case CMD_FRAME_TOGGLE:
487         laserdisc_data_w(laserdisc, 0xf1);
553         laserdisc_data_w(m_laserdisc, 0xf1);
488554         break;
489555
490556      case CMD_0:
r11240r11241
497563      case CMD_7:
498564      case CMD_8:
499565      case CMD_9:
500         laserdisc_data_w(laserdisc, digits[command - CMD_0]);
566         laserdisc_data_w(m_laserdisc, digits[command - CMD_0]);
501567         break;
502568
503569      case CMD_SEARCH:
504         laserdisc_data_w(laserdisc, 0xf7);
505         playing = FALSE;
570         laserdisc_data_w(m_laserdisc, 0xf7);
571         m_playing = false;
506572         break;
507573   }
508574}
r11240r11241
551617 *
552618 *************************************/
553619
554static MACHINE_CONFIG_FRAGMENT( ldplayer_core )
620static MACHINE_CONFIG_START( ldplayer_core, ldplayer_state )
555621
556   MCFG_MACHINE_START(ldplayer)
557   MCFG_MACHINE_RESET(ldplayer)
558
559   /* audio hardware */
622   // audio hardware
560623   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
561624
562625   MCFG_SOUND_ADD("ldsound", LASERDISC_SOUND, 0)
r11240r11241
570633MACHINE_CONFIG_END
571634
572635
573static MACHINE_CONFIG_DERIVED( ldv1000, ldplayer_ntsc )
636static MACHINE_CONFIG_DERIVED_CLASS( ldv1000, ldplayer_ntsc, ldv1000_state )
574637   MCFG_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "screen", "ldsound")
575   MCFG_LASERDISC_GET_DISC(get_disc)
638   MCFG_LASERDISC_GET_DISC(ldplayer_state::get_disc_static)
576639MACHINE_CONFIG_END
577640
578641
579static MACHINE_CONFIG_DERIVED( pr8210, ldplayer_ntsc )
580   MCFG_MACHINE_START(pr8210)
581   MCFG_MACHINE_RESET(pr8210)
642static MACHINE_CONFIG_DERIVED_CLASS( pr8210, ldplayer_ntsc, pr8210_state )
582643   MCFG_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "screen", "ldsound")
583   MCFG_LASERDISC_GET_DISC(get_disc)
644   MCFG_LASERDISC_GET_DISC(ldplayer_state::get_disc_static)
584645MACHINE_CONFIG_END
585646
586647
r11240r11241
604665
605666/*************************************
606667 *
607 *  Driver initialization
608 *
609 *************************************/
610
611static DRIVER_INIT( ldv1000 ) { execute_command = ldv1000_execute; }
612static DRIVER_INIT( pr8210 )  { execute_command = pr8210_execute; }
613
614
615
616/*************************************
617 *
618668 *  Game drivers
619669 *
620670 *************************************/
621671
622GAME( 2008, ldv1000, 0, ldv1000, ldplayer, ldv1000, ROT0, "MAME", "Pioneer LDV-1000 Simulator", 0 )
623GAMEL(2008, pr8210,  0, pr8210,  ldplayer, pr8210,  ROT0, "MAME", "Pioneer PR-8210 Simulator", 0, layout_pr8210 )
672GAME( 2008, ldv1000, 0, ldv1000, ldplayer, 0, ROT0, "MAME", "Pioneer LDV-1000 Simulator", 0 )
673GAMEL(2008, pr8210,  0, pr8210,  ldplayer, 0, ROT0, "MAME", "Pioneer PR-8210 Simulator", 0, layout_pr8210 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team