Previous 15994 Revisions Next

r6050 Monday 12th October, 2009 at 11:07:23 UTC by Nathan Woods
Updated to MAME 0.134u3
[docs]messnew.txt
[src/emu]mame.c sound.c streams.c streams.h
[src/emu/cpu/e132xs]e132xs.c
[src/emu/cpu/m68000]m68k_in.c m68kcpu.c m68kmmu.h
[src/emu/cpu/minx]minx.h
[src/emu/cpu/mips]psx.c
[src/emu/cpu/tms32025]tms32025.c
[src/emu/cpu/tms34010]34010ops.c tms34010.c
[src/emu/cpu/tms57002]tms57002.h
[src/emu/cpu/z8000]z8000.c z8000ops.c
[src/emu/debug]debugcpu.c debugvw.c textbuf.h
[src/emu/sound]disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_sys.c disc_wav.c discrete.c discrete.h
[src/lib/util]astring.c astring.h avcomp.c avcomp.h aviio.c aviio.h bitmap.c bitmap.h cdrom.c cdrom.h chd.c chd.h corefile.c corefile.h corestr.c corestr.h coreutil.c coreutil.h harddisk.c harddisk.h huffman.c huffman.h jedparse.c jedparse.h options.c options.h palette.c palette.h png.c png.h pool.c pool.h unicode.c unicode.h unzip.c unzip.h vbiparse.c vbiparse.h xmlfile.c xmlfile.h
[src/mame]mame.mak mamedriv.c
[src/mame/audio]8080bw.c asteroid.c avalnche.c blockade.c canyon.c circus.c cliffhgr.c crbaloon.c dkong.c dragrace.c galaxian.c hitme.c irem.c llander.c m79amb.c madalien.c mario.c mw8080bw.c nitedrvr.c phoenix.c poolshrk.c qix.c skyraid.c snk6502.c spiders.c sprint8.c starshp1.c tank8.c
[src/mame/drivers]arkanoid.c attckufo.c backfire.c bingor.c btime.c galaxian.c galdrvr.c hshavoc.c ironhors.c megadriv.c megadriv.h megaplay.c megatech.c model3.c multfish.c multigam.c mw8080bw.c norautp.c puckpkmn.c stv.c taito_h.c topshoot.c
[src/mame/includes]arkanoid.h genesis.h mw8080bw.h
[src/mame/machine]arkanoid.c scudsp.c snes7110.c snesdsp2.c snesobc1.c snesrtc.c snessdd1.c snesst10.c
[src/mame/video]atari.c vdc.c
[src/mess/drivers]osi.c
[src/osd]osdcomm.h osdcore.h osdepend.h
[src/osd/osdmini]minidir.c minifile.c minimain.c* minimisc.c minisync.c minitime.c miniwork.c osdmini.mak
[src/osd/windows]d3d8intf.c d3d9intf.c d3dintf.h debugwin.c debugwin.h drawd3d.c drawdd.c drawgdi.c drawnone.c eivc.h eivcx86.h input.c input.h ledutil.c mame.rc osinline.h output.c output.h sound.c sound.h strconv.c strconv.h vconv.c video.c video.h winalloc.c windir.c window.c window.h windows.mak winfile.c winmain.c winmain.h winmisc.c winprefix.h winsync.c wintime.c winutf8.c winutf8.h winutil.c winutil.h winwork.c

src/mame/audio/phoenix.c
r6049r6050
370370                 NODE_22,
371371                 NODE_23)
372372   DISCRETE_RCFILTER(NODE_25,
373                 1,
374373                 NODE_24,
375374                 1.0/(1.0/RES_K(10) + 1.0/RES_K(100)),   /* R19, R20 */
376375                 CAP_U(.047))                     /* C5 */
r6049r6050
429428               &phoenix_effect2_mixer2)
430429   /* C22 charging is R45 in parallel with R46, R42 and the 555 CV internal resistance */
431430   DISCRETE_RCFILTER(NODE_37,
432                 1,                  /* ENAB */
433431                 NODE_36,
434432                 1.0/ (1.0/RES_K(5.1) + (1.0/(RES_K(5.1) + 1.0/(1.0/RES_K(10) + 1.0/RES_K(5) + 1.0/RES_K(10)) ))),
435433                 CAP_U(100))   /* R45, R46, R42, internal 555 Rs, C22 */
src/mame/audio/avalnche.c
r6049r6050
117117   /************************************************/
118118   DISCRETE_LFSR_NOISE(AVALNCHE_NOISE, AVALNCHE_ATTRACT_EN, AVALNCHE_ATTRACT_EN, 15750.0, AVALNCHE_SOUNDLVL_DATA, 0, 0, &avalnche_lfsr)
119119   DISCRETE_ADDER2(NODE_30, 1, NODE_20, AVALNCHE_NOISE)
120   DISCRETE_RCFILTER(AVALNCHE_SOUNDLVL_AUD0_SND, 1, NODE_30, 556.7, 1e-7)
120   DISCRETE_RCFILTER(AVALNCHE_SOUNDLVL_AUD0_SND, NODE_30, 556.7, 1e-7)
121121
122122   /************************************************/
123123   /* Final mix and output.                        */
src/mame/audio/galaxian.c
r6049r6050
344344      DISCRETE_LOGIC_INVERT(NODE_170, GAL_INP_FIRE)
345345      DISCRETE_MULTIPLY(NODE_171, TTL_OUT, GAL_INP_FIRE)
346346      DISCRETE_MULTIPLY(NODE_172, TTL_OUT, NODE_170) // inverted
347      DISCRETE_RCFILTER(NODE_173, 1, NODE_172, GAL_R47, GAL_C28)
347      DISCRETE_RCFILTER(NODE_173, NODE_172, GAL_R47, GAL_C28)
348348      /* Mix noise and 163 */
349349      DISCRETE_TRANSFORM5(NODE_177, NODE_152, TTL_OUT, 1.0/GAL_R46, NODE_173, 1.0/GAL_R48,
350350            "01*2*34*+" )
src/mame/audio/hitme.c
r6049r6050
7373   DISCRETE_555_ASTABLE(NODE_24,1,22e3,39e3,NODE_23,&desc_hitme_555)
7474
7575   /* The output of the 555 timer is fed through a simple CR filter in the amp stage. */
76   DISCRETE_CRFILTER(HITME_FINAL_SND,1,NODE_24,1e3,50e-6)
76   DISCRETE_CRFILTER(HITME_FINAL_SND,NODE_24,1e3,50e-6)
7777
7878   /* We scale the final output of 3.8 to 16-bit range and output it at full volume */
7979   DISCRETE_OUTPUT(HITME_FINAL_SND,32000.0/3.8)
src/mame/audio/asteroid.c
r6049r6050
113113   /************************************************/
114114   DISCRETE_DAC_R1(NODE_30, ASTEROID_THUMP_DATA, 3.5, &asteroid_thump_dac1) // CMOS
115115   DISCRETE_555_CC(NODE_31, ASTEROID_THUMP_EN, NODE_30, RES_K(22), CAP_U(0.22), 0, 0, RES_K(18), &asteroid_thump_555cc)
116   DISCRETE_RCFILTER(NODE_32, 1, NODE_31, RES_K(3.3), CAP_U(0.1))
116   DISCRETE_RCFILTER(NODE_32, NODE_31, RES_K(3.3), CAP_U(0.1))
117117   DISCRETE_GAIN(ASTEROID_THUMP_SND, NODE_32, 30)
118118
119119   /************************************************/
r6049r6050
135135   DISCRETE_TRANSFORM4(NODE_42, ASTEROID_SAUCER_SEL, -250, NODE_41, 750, "01*2+3+")   // Large saucer is 250hz lower
136136
137137   DISCRETE_TRIANGLEWAVE(NODE_43, ASTEROID_SAUCER_SND_EN, NODE_42, 76.1, 0, 0)
138   DISCRETE_RCFILTER(ASTEROID_SAUCER_SND, 1, NODE_43, 1, 1.0e-5)
138   DISCRETE_RCFILTER(ASTEROID_SAUCER_SND, NODE_43, 1, 1.0e-5)
139139
140140   /************************************************/
141141   /* The Ship Fire sound is produced by a 555     */
r6049r6050
147147   DISCRETE_ADDER2(NODE_52, 1, NODE_51, 7.0)   /* Amplitude */
148148   DISCRETE_TRANSFORM3(NODE_53, 4500, NODE_50, 67, "01/2+")   /* Duty */
149149   DISCRETE_SQUAREWAVE(NODE_54, ASTEROID_SHIP_FIRE_EN, NODE_50, NODE_52, NODE_53, 0, 0)
150   DISCRETE_RCFILTER(ASTEROID_SHIP_FIRE_SND, 1, NODE_54, 1, 1.0e-5)
150   DISCRETE_RCFILTER(ASTEROID_SHIP_FIRE_SND, NODE_54, 1, 1.0e-5)
151151
152152   /************************************************/
153153   /* The Saucer Fire sound is produced by a 555   */
r6049r6050
159159   DISCRETE_ADDER2(NODE_62, 1, NODE_61, 7.0)   /* Amplitude */
160160   DISCRETE_TRANSFORM3(NODE_63, 4500, NODE_60, 67, "01/2+")   /* Duty */
161161   DISCRETE_SQUAREWAVE(NODE_64, ASTEROID_SAUCER_FIRE_EN, NODE_60, NODE_62, NODE_63, 0, 0)
162   DISCRETE_RCFILTER(ASTEROID_SAUCER_FIRE_SND, 1, NODE_64, 2, 1.0e-5)
162   DISCRETE_RCFILTER(ASTEROID_SAUCER_FIRE_SND, NODE_64, 2, 1.0e-5)
163163
164164   /************************************************/
165165   /* Thrust noise is a gated noise source         */
r6049r6050
171171   DISCRETE_LFSR_NOISE(ASTEROID_NOISE, ASTEROID_NOISE_RESET, ASTEROID_NOISE_RESET, 12000.0, 1.0, 0, 0, &asteroid_lfsr)
172172
173173   DISCRETE_GAIN(NODE_70, ASTEROID_NOISE, 600.0*7.6)
174   DISCRETE_RCFILTER(NODE_71, ASTEROID_THRUST_EN, NODE_70, 2200, 1e-6)
174   DISCRETE_RCFILTER(NODE_71, NODE_70, 2200, 1e-6)
175   DISCRETE_MULTIPLY(NODE_72, NODE_71, ASTEROID_THRUST_EN)
175176   /* TBD - replace this line with a Sallen-Key Bandpass macro */
176   DISCRETE_FILTER2(NODE_72, 1, NODE_71, 89.5, (1.0 / 7.6), DISC_FILTER_BANDPASS)
177   DISCRETE_FILTER2(NODE_73, 1, NODE_72, 89.5, (1.0 / 7.6), DISC_FILTER_BANDPASS)
177178   /* TBD - replace this line with a Active Lowpass macro */
178   DISCRETE_FILTER1(ASTEROID_THRUST_SND, 1, NODE_72, 160, DISC_FILTER_LOWPASS)
179   DISCRETE_FILTER1(ASTEROID_THRUST_SND, 1, NODE_73, 160, DISC_FILTER_LOWPASS)
179180
180181   /************************************************/
181182   /* Explosion generation circuit, pitch and vol  */
r6049r6050
195196   DISCRETE_SQUAREWFIX(NODE_82, 1, NODE_80, 1.0, NODE_81, 1.0/2, 0)   /* Pitch clock */
196197   DISCRETE_SAMPLHOLD(NODE_83, ASTEROID_NOISE, NODE_82, DISC_SAMPHOLD_REDGE)
197198   DISCRETE_MULTIPLY(NODE_84, NODE_83, ASTEROID_EXPLODE_DATA)
198   DISCRETE_RCFILTER(ASTEROID_EXPLODE_SND, 1, NODE_84, 3042, 1e-6)
199   DISCRETE_RCFILTER(ASTEROID_EXPLODE_SND, NODE_84, 3042, 1e-6)
199200
200201   /************************************************/
201202   /* Life enable is just 3KHz tone from the clock */
r6049r6050
241242   DISCRETE_LFSR_NOISE(ASTEROID_NOISE, ASTEROID_NOISE_RESET, ASTEROID_NOISE_RESET, 12000.0, 1.0, 0, 0, &asteroid_lfsr)
242243
243244   DISCRETE_GAIN(NODE_70, ASTEROID_NOISE, 1000.0*7.6)
244   DISCRETE_RCFILTER(NODE_71, ASTEROID_THRUST_EN, NODE_70, 2200, 1e-6)
245   DISCRETE_RCFILTER(NODE_71, NODE_70, 2200, 1e-6)
246   DISCRETE_MULTIPLY(NODE_72, NODE_71, ASTEROID_THRUST_EN)
245247   /* TBD - replace this line with a Sallen-Key Bandpass macro */
246   DISCRETE_FILTER2(NODE_72, 1, NODE_71, 89.5, (1.0 / 7.6), DISC_FILTER_BANDPASS)
248   DISCRETE_FILTER2(NODE_73, 1, NODE_72, 89.5, (1.0 / 7.6), DISC_FILTER_BANDPASS)
247249   /* TBD - replace this line with a Active Lowpass macro */
248   DISCRETE_FILTER1(ASTEROID_THRUST_SND, 1, NODE_72, 160, DISC_FILTER_LOWPASS)
250   DISCRETE_FILTER1(ASTEROID_THRUST_SND, 1, NODE_73, 160, DISC_FILTER_LOWPASS)
249251
250252   /************************************************/
251253   /* Explosion generation circuit, pitch and vol  */
r6049r6050
265267   DISCRETE_SQUAREWFIX(NODE_82, 1, NODE_80, 1.0, NODE_81, 1.0/2, 0)   /* Pitch clock */
266268   DISCRETE_SAMPLHOLD(NODE_83, ASTEROID_NOISE, NODE_82, DISC_SAMPHOLD_REDGE)
267269   DISCRETE_MULTIPLY(NODE_84, NODE_83, ASTEROID_EXPLODE_DATA)
268   DISCRETE_RCFILTER(ASTEROID_EXPLODE_SND, 1, NODE_84, 3042, 1e-6)
270   DISCRETE_RCFILTER(ASTEROID_EXPLODE_SND, NODE_84, 3042, 1e-6)
269271
270272   /************************************************/
271273   /* Combine all 7 sound sources with a double    */
src/mame/audio/cliffhgr.c
r6049r6050
3737   DISCRETE_ONOFF(NODE_05,CLIFF_ENABLE_SND_1,NODE_03)
3838   DISCRETE_ONOFF(NODE_06,CLIFF_ENABLE_SND_2,NODE_04)
3939
40   DISCRETE_RCFILTER(NODE_07,1,NODE_05,1.0/(1.0/RES_K(4.7)+1.0/RES_K(10)), CAP_U(0.1))
41   DISCRETE_RCFILTER(NODE_08,1,NODE_06,1.0/(1.0/RES_K(5.1)+1.0/RES_K(12)), CAP_U(0.1))
40   DISCRETE_RCFILTER(NODE_07,NODE_05,1.0/(1.0/RES_K(4.7)+1.0/RES_K(10)), CAP_U(0.1))
41   DISCRETE_RCFILTER(NODE_08,NODE_06,1.0/(1.0/RES_K(5.1)+1.0/RES_K(12)), CAP_U(0.1))
4242
4343   DISCRETE_GAIN(NODE_09,NODE_07,RES_K(10)/(RES_K(4.7)+RES_K(10)))
4444   DISCRETE_GAIN(NODE_10,NODE_08,RES_K(12)/(RES_K(5.1)+RES_K(12)))
src/mame/audio/poolshrk.c
r6049r6050
7474   /* Bump is just a triggered 128V signal         */
7575   /************************************************/
7676   DISCRETE_SQUAREWFIX(NODE_20, POOLSHRK_BUMP_EN, 15750.0/2.0/128.0, 3.4, 50.0, 3.4/2, 0.0)   // 128V signal 3.4V
77   DISCRETE_RCFILTER(POOLSHRK_BUMP_SND, 1, NODE_20, 470, 4.7e-6)   // Filtered by R53/C14
77   DISCRETE_RCFILTER(POOLSHRK_BUMP_SND, NODE_20, 470, 4.7e-6)   // Filtered by R53/C14
7878
7979   /************************************************/
8080   /* Score is a triggered 0-15 count of the       */
src/mame/audio/blockade.c
r6049r6050
3131   /* oscillator to 0Hz.  (OUT02 = FF)             */
3232   /************************************************/
3333   DISCRETE_NOTE(BLOCKADE_NOTE, 1, 93681.5, BLOCKADE_NOTE_DATA, 255, 1, DISC_CLK_IS_FREQ | DISC_OUT_IS_ENERGY)
34   DISCRETE_CRFILTER(NODE_10, 1, BLOCKADE_NOTE, RES_K(35), CAP_U(.01))
34   DISCRETE_CRFILTER(NODE_10, BLOCKADE_NOTE, RES_K(35), CAP_U(.01))
3535
3636   DISCRETE_OUTPUT(NODE_10, 7500)
3737DISCRETE_SOUND_END
src/mame/audio/dragrace.c
r6049r6050
9191   /* 0k = 214Hz.   250k = 4416Hz                  */
9292   /* NOTE: freqs are ripped from Sprint for now.  */
9393   /************************************************/
94   DISCRETE_RCFILTER(NODE_20, 1, DRAGRACE_MOTOR1_DATA, 119898, 2.2e-6)
94   DISCRETE_RCFILTER(NODE_20, DRAGRACE_MOTOR1_DATA, 119898, 2.2e-6)
9595   DISCRETE_ADJUSTMENT_TAG(NODE_21, (214.0-27.0)/12/31, (4416.0-27.0)/12/31, DISC_LOGADJ, "MOTOR1")
9696   DISCRETE_MULTIPLY(NODE_22, NODE_20, NODE_21)
9797
9898   DISCRETE_MULTADD(NODE_23, NODE_22, 2, 27.0/6)   /* F1 = /12*2 = /6 */
9999   DISCRETE_SQUAREWAVE(NODE_24, 1, NODE_23, (581.6/3), 50.0, 0, 0)
100   DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 10000, 1e-7)
100   DISCRETE_RCFILTER(NODE_25, NODE_24, 10000, 1e-7)
101101
102102   DISCRETE_MULTADD(NODE_26, NODE_22, 3, 27.0/4)   /* F2 = /12*3 = /4 */
103103   DISCRETE_SQUAREWAVE(NODE_27, 1, NODE_26, (581.6/3), 50.0, 0, 0)
104   DISCRETE_RCFILTER(NODE_28, 1, NODE_27, 10000, 1e-7)
104   DISCRETE_RCFILTER(NODE_28, NODE_27, 10000, 1e-7)
105105
106106   DISCRETE_MULTADD(NODE_29, NODE_22, 4, 27.0/3)   /* F3 = /12*4 = /3 */
107107   DISCRETE_SQUAREWAVE(NODE_30, 1, NODE_29, (581.6/3), 100.0/3, 0, 360.0/3)
108   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, 10000, 1e-7)
108   DISCRETE_RCFILTER(NODE_31, NODE_30, 10000, 1e-7)
109109
110110   DISCRETE_ADDER3(DRAGRACE_MOTOR1_SND, DRAGRACE_MOTOR1_EN, NODE_25, NODE_28, NODE_31)
111111
r6049r6050
114114   /* Car1.  But I shifted the frequencies up for  */
115115   /* it to sound different from car1.             */
116116   /************************************************/
117   DISCRETE_RCFILTER(NODE_40, 1, DRAGRACE_MOTOR2_DATA, 119898, 2.2e-6)
117   DISCRETE_RCFILTER(NODE_40, DRAGRACE_MOTOR2_DATA, 119898, 2.2e-6)
118118   DISCRETE_ADJUSTMENT_TAG(NODE_41, (214.0-27.0)/12/31, (4416.0-27.0)/12/31, DISC_LOGADJ, "MOTOR2")
119119   DISCRETE_MULTIPLY(NODE_42, NODE_40, NODE_41)
120120
121121   DISCRETE_MULTADD(NODE_43, NODE_42, 2, 27.0/6)   /* F1 = /12*2 = /6 */
122122   DISCRETE_SQUAREWAVE(NODE_44, 1, NODE_43, (581.6/3), 50.0, 0, 0)
123   DISCRETE_RCFILTER(NODE_45, 1, NODE_44, 10000, 1e-7)
123   DISCRETE_RCFILTER(NODE_45, NODE_44, 10000, 1e-7)
124124
125125   DISCRETE_MULTADD(NODE_46, NODE_42, 3, 27.0/4)   /* F2 = /12*3 = /4 */
126126   DISCRETE_SQUAREWAVE(NODE_47, 1, NODE_46, (581.6/3), 50.0, 0, 0)
127   DISCRETE_RCFILTER(NODE_48, 1, NODE_47, 10000, 1e-7)
127   DISCRETE_RCFILTER(NODE_48, NODE_47, 10000, 1e-7)
128128
129129   DISCRETE_MULTADD(NODE_49, NODE_42, 4, 27.0/3)   /* F3 = /12*4 = /3 */
130130   DISCRETE_SQUAREWAVE(NODE_50, 1, NODE_49, (581.6/3), 100.0/3, 0, 360.0/3)
131   DISCRETE_RCFILTER(NODE_51, 1, NODE_50, 10000, 1e-7)
131   DISCRETE_RCFILTER(NODE_51, NODE_50, 10000, 1e-7)
132132
133133   DISCRETE_ADDER3(DRAGRACE_MOTOR2_SND, DRAGRACE_MOTOR2_EN, NODE_45, NODE_48, NODE_51)
134134
r6049r6050
144144
145145   DISCRETE_RAMP(NODE_61, DRAGRACE_EXPLODE1_EN, DRAGRACE_EXPLODE1_EN, (1000.0-0.0)/1, 1000.0, 0.0, 1000.0)
146146   DISCRETE_MULTIPLY(NODE_62, DRAGRACE_NOISE, NODE_61)
147   DISCRETE_RCFILTER(DRAGRACE_EXPLODE1_SND, DRAGRACE_KLEXPL1_EN, NODE_62, 1500, 2.2e-7)
147   DISCRETE_RCFILTER(NODE_63, NODE_62, 1500, 2.2e-7)
148   DISCRETE_MULTIPLY(DRAGRACE_EXPLODE1_SND, NODE_63, DRAGRACE_KLEXPL1_EN)
148149
149150   DISCRETE_RAMP(NODE_66, DRAGRACE_EXPLODE2_EN, DRAGRACE_EXPLODE2_EN, (1000.0-0.0)/1, 1000.0, 0.0, 1000.0)
150151   DISCRETE_MULTIPLY(NODE_67, DRAGRACE_NOISE, NODE_66)
151   DISCRETE_RCFILTER(DRAGRACE_EXPLODE2_SND, DRAGRACE_KLEXPL2_EN, NODE_67, 1500, 2.2e-7)
152   DISCRETE_RCFILTER(NODE_68, NODE_67, 1500, 2.2e-7)
153   DISCRETE_MULTIPLY(DRAGRACE_EXPLODE2_SND, NODE_68, DRAGRACE_KLEXPL2_EN)
152154
153155   /************************************************/
154156   /* Skid circuits takes the noise output from    */
r6049r6050
165167   /************************************************/
166168   DISCRETE_INVERT(NODE_70, DRAGRACE_NOISE)
167169   DISCRETE_MULTADD(NODE_71, NODE_70, 940.0-630.0, ((940.0-630.0)/2)+630.0)
168   DISCRETE_RCFILTER(NODE_72, 1, NODE_71, 1000, 1e-5)
170   DISCRETE_RCFILTER(NODE_72, NODE_71, 1000, 1e-5)
169171   DISCRETE_SQUAREWAVE(NODE_73, 1, NODE_72, 407.8, 31.5, 0, 0.0)
170172   DISCRETE_ONOFF(DRAGRACE_SCREECH1_SND, DRAGRACE_SCREECH1_EN, NODE_73)
171173   DISCRETE_ONOFF(DRAGRACE_SCREECH2_SND, DRAGRACE_SCREECH2_EN, NODE_73)
src/mame/audio/starshp1.c
r6049r6050
133133   DISC_MIXER_IS_RESISTOR,
134134   {STARSHP1_R66, STARSHP1_R126, STARSHP1_R59 + STARSHP1_R60, STARSHP1_R74, STARSHP1_R75},
135135   {0},   /* no resistor nodes */
136   {0, STARSHP1_C78, STARSHP1_C36, 0, 0},
136   {0, STARSHP1_C78, 0, 0, 0},
137137   0,
138138   STARSHP1_R76,
139139   0,      /* no cF */
r6049r6050
157157   DISCRETE_INPUT_LOGIC(STARSHP1_SL1)
158158   DISCRETE_INPUT_LOGIC(STARSHP1_KICKER)
159159   DISCRETE_INPUT_LOGIC(STARSHP1_PHASOR_ON)
160   DISCRETE_INPUT_NOT  (STARSHP1_MOLVL)
160161   DISCRETE_INPUT_NOT  (STARSHP1_ATTRACT)      /* Inverted by Q9 */
161   /* when MOLVL is high, R58 is grounded, reducing the gain by 50% */
162   /* we will cheat and calculate that now */
163#define STARSHP1_MOLVL_GAIN         STARSHP1_MOLVL
164#define STARSHP1_MOLVL_GAIN_VAL      RES_VOLTAGE_DIVIDER(STARSHP1_R59, STARSHP1_R58)
165   DISCRETE_INPUTX_LOGIC(STARSHP1_MOLVL_GAIN, -STARSHP1_MOLVL_GAIN_VAL, STARSHP1_MOLVL_GAIN_VAL, 1)
166162
167163   /************************************************
168164     * Noise
r6049r6050
186182                  NODE_21,
187183                  STARSHP1_NOISE_AMPLITUDE)
188184   DISCRETE_RCFILTER(   NODE_23,
189                  1,                     /* ENAB */
190185                  NODE_22,
191186                  STARSHP1_FAKE_MC3340_COMPENSATION_R,
192187                  STARSHP1_C61)
193188   /* when NOISE_FREQ is high (NOISE_FREQ_INV is low), C59 is in circuit */
194189   DISCRETE_RCFILTER(   NODE_24,
195                  1,                     /* ENAB */
196190                  NODE_22,
197191                  STARSHP1_FAKE_MC3340_COMPENSATION_R,
198192                  STARSHP1_C61 + STARSHP1_C59)
r6049r6050
246240                  STARSHP1_C34,
247241                  5, -10, NODE_41,         /* VPOS,VNEG,VCHARGE */
248242                  DISC_566_OUT_TRIANGLE)
243   DISCRETE_SWITCH(NODE_43,
244                  1,                     /* ENAB */
245                  STARSHP1_MOLVL,            /* SWITCH */
246                  STARSHP1_R59 + RES_2_PARALLEL(STARSHP1_R58, STARSHP1_R60 + STARSHP1_R76),
247                  STARSHP1_R59 + STARSHP1_R60 + STARSHP1_R76)
248   DISCRETE_CRFILTER(NODE_44,
249                  NODE_42,               /* IN0 */
250                  NODE_43,               /* RVAL*/
251                  STARSHP1_C36)
252   DISCRETE_SWITCH(NODE_45,                  /* gain affect of voltage divider */
253                  1,                     /* ENAB */
254                  STARSHP1_MOLVL,            /* SWITCH */
255                  RES_VOLTAGE_DIVIDER(STARSHP1_R59, STARSHP1_R58), 1)
249256   DISCRETE_MULTIPLY(   STARSHP1_MOTOR_SND,
250                  NODE_42,
251                  STARSHP1_MOLVL_GAIN)
257                  NODE_44,
258                  NODE_45)
252259
253260   /************************************************
254261     * SL1, SL2
r6049r6050
266273                  &starshp1_555_b10)
267274   /* use switch instead of logic AND, so we can switch between
268275     * 0V and the anti-aliased TTL level out that we set NODE_51 to. */
269   DISCRETE_SWITCH(   STARSHP1_SL1_SND,         /* IC A10, pin 11 */
270                  1,                     /* ENAB */
271                  STARSHP1_SL1,
272                  0,
273                  NODE_51)
274   DISCRETE_SWITCH(   STARSHP1_SL2_SND,         /* IC A10, pin 8 */
275                  1,                     /* ENAB */
276                  STARSHP1_SL2,
277                  0,
278                  NODE_51)
276   DISCRETE_ONOFF(      STARSHP1_SL1_SND,         /* IC A10, pin 11 */
277                  STARSHP1_SL1, NODE_51)
278   DISCRETE_ONOFF(      STARSHP1_SL2_SND,         /* IC A10, pin 8 */
279                  STARSHP1_SL2, NODE_51)
279280
280281   /************************************************
281282     * Mixing and output
src/mame/audio/8080bw.c
r6049r6050
263263 * Final Mixing and Output
264264 *
265265 ******************************************************************************/
266   DISCRETE_CRFILTER(NODE_90, 1, NODE_22, RES_K(10), CAP_U(0.1))
266   DISCRETE_CRFILTER(NODE_90, NODE_22, RES_K(10), CAP_U(0.1))
267267
268268   DISCRETE_OUTPUT(NODE_90, 21000)
269269
r6049r6050
347347   {DISC_OP_AMP_OSCILLATOR_VCO_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP, RES_M(1), RES_K(680), RES_K(680), RES_M(1), RES_M(1), RES_K(120), RES_M(1), 0, CAP_P(180), 12};
348348
349349static const discrete_op_amp_tvca_info polaris_sonar_tvca_info =
350   { RES_M(2.7), RES_K(680), 0, RES_K(680), RES_K(1), RES_K(120), RES_K(560), 0, 0, 0, 0, CAP_U(1), 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_TRG1, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0_INV, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
350   { RES_M(2.7), RES_K(680), 0, RES_K(680), RES_K(1), RES_K(120), RES_K(560), 0, 0, 0, 0, CAP_U(1), 0, 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_TRG1, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0_INV, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
351351
352352static const discrete_op_amp_osc_info polaris_boat_mod_info =
353353   {DISC_OP_AMP_OSCILLATOR_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP, RES_M(1), RES_K(10), RES_K(100), RES_K(120), RES_M(1), 0, 0, 0, CAP_U(.22), 12};
r6049r6050
356356   {DISC_OP_AMP_OSCILLATOR_VCO_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP, RES_M(1), RES_K(680), RES_K(680), RES_M(1), RES_M(1), 0, 0, 0, CAP_P(180), 12};
357357
358358static const discrete_op_amp_tvca_info polaris_shot_tvca_info =
359   { RES_M(2.7), RES_K(680), RES_K(680), RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(1), 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0_INV, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
359   { RES_M(2.7), RES_K(680), RES_K(680), RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(1), 0, 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0_INV, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
360360
361361static const discrete_op_amp_tvca_info polaris_shiphit_tvca_info =
362   { RES_M(2.7), RES_K(680), RES_K(680), RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(1), 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0_INV, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
362   { RES_M(2.7), RES_K(680), RES_K(680), RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(1), 0, 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0_INV, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
363363
364364static const discrete_op_amp_tvca_info polaris_exp_tvca_info =
365   { RES_M(2.7), RES_K(680), 0, RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(.33), 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
365   { RES_M(2.7), RES_K(680), 0, RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(.33), 0, 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
366366
367367// The schematic shows a .22uF cap but Guru's board has a 1uF
368368static const discrete_op_amp_tvca_info polaris_hit_tvca_info =
369   { RES_M(2.7), RES_K(1360), RES_K(1360), RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(1), 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG1, DISC_OP_AMP_TRIGGER_FUNCTION_TRG01_NAND, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
369   { RES_M(2.7), RES_K(1360), RES_K(1360), RES_K(680), RES_K(1), 0, RES_K(680), 0, 0, 0, 0, CAP_U(1), 0, 0, 0, 12, 12, 12, 12, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG1, DISC_OP_AMP_TRIGGER_FUNCTION_TRG01_NAND, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE, DISC_OP_AMP_TRIGGER_FUNCTION_NONE};
370370
371371// The schematic shows a 1uF cap but Guru's board has a 2.2uF
372372static const discrete_integrate_info polaris_plane_integrate_info =
r6049r6050
574574 ******************************************************************************/
575575   DISCRETE_OP_AMP_TRIG_VCA(NODE_70, POLARIS_SX3_EN, 0, 0, POLARIS_NOISE_LO, 0, &polaris_exp_tvca_info)
576576
577   DISCRETE_RCFILTER(NODE_71, 1, NODE_70, 560.0, CAP_U(.22))
578   DISCRETE_RCFILTER(POLARIS_EXPLOSIONSND, 1, NODE_71, RES_K(6.8), CAP_U(.22))
577   DISCRETE_RCFILTER(NODE_71, NODE_70, 560.0, CAP_U(.22))
578   DISCRETE_RCFILTER(POLARIS_EXPLOSIONSND, NODE_71, RES_K(6.8), CAP_U(.22))
579579
580580/******************************************************************************
581581 *
r6049r6050
759759   DISCRETE_SQUAREWFIX(NODE_20, 1, SCHASER_4V, DEFAULT_TTL_V_LOGIC_1, 50, 0, 0)
760760   DISCRETE_SQUAREWFIX(NODE_21, 1, SCHASER_8V, DEFAULT_TTL_V_LOGIC_1, 50, 0, 0)
761761   DISCRETE_SWITCH(NODE_22, SCHASER_DOT_EN, SCHASER_DOT_SEL, NODE_20, NODE_21)
762   DISCRETE_RCFILTER(NODE_23, 1, NODE_22, 560, CAP_U(.1))
763   DISCRETE_RCFILTER(NODE_24, 1, NODE_23, RES_K(6.8) + 560, CAP_U(.1))
762   DISCRETE_RCFILTER(NODE_23, NODE_22, 560, CAP_U(.1))
763   DISCRETE_RCFILTER(NODE_24, NODE_23, RES_K(6.8) + 560, CAP_U(.1))
764764   DISCRETE_MULTIPLY(SCHASER_DOT_SND, NODE_24, SCHASER_VR3)
765765
766766   /************************************************/
767767   /* Explosion/Effect filtering                   */
768768   /************************************************/
769   DISCRETE_RCFILTER(NODE_30, 1, SCHASER_EXP_STREAM, 560, CAP_U(.1))
770   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, RES_K(6.8) + 560, CAP_U(.1))
771   DISCRETE_CRFILTER(NODE_32, 1, NODE_31, RES_K(6.8) + 560 + RES_K(2) + RES_K(50), CAP_U(1))
769   DISCRETE_RCFILTER(NODE_30, SCHASER_EXP_STREAM, 560, CAP_U(.1))
770   DISCRETE_RCFILTER(NODE_31, NODE_30, RES_K(6.8) + 560, CAP_U(.1))
771   DISCRETE_CRFILTER(NODE_32, NODE_31, RES_K(6.8) + 560 + RES_K(2) + RES_K(50), CAP_U(1))
772772   DISCRETE_MULTIPLY(SCHASER_EXP_SND, NODE_32, SCHASER_VR2)
773773
774774   /************************************************/
775775   /* Music is just a 1 bit DAC                    */
776776   /************************************************/
777   DISCRETE_CRFILTER(NODE_40, 1, SCHASER_MUSIC_BIT, RES_K(470) + RES_K(50), CAP_U(.01))
777   DISCRETE_CRFILTER(NODE_40, SCHASER_MUSIC_BIT, RES_K(470) + RES_K(50), CAP_U(.01))
778778   DISCRETE_MULTIPLY(SCHASER_MUSIC_SND, NODE_40, SCHASER_VR1)
779779
780780   /************************************************/
src/mame/audio/m79amb.c
r6049r6050
233233            12, 0, 12,               /* VPOS,VNEG,VCHARGE */
234234            DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE)
235235   DISCRETE_CRFILTER(NODE_53,
236            M79AMB_MC_CONTROL_EN,      /* Q13 */
237236            NODE_52, M79AMB_R41 + M79AMB_R42 + M79AMB_R43, M79AMB_C22)
238   DISCRETE_GAIN(M79AMB_MC_SND, NODE_53, RES_VOLTAGE_DIVIDER(M79AMB_R41 + M79AMB_R42, 2200))//M79AMB_R43))
237   DISCRETE_MULTIPLY(NODE_54, NODE_53, M79AMB_MC_CONTROL_EN)
238   DISCRETE_GAIN(M79AMB_MC_SND, NODE_54, RES_VOLTAGE_DIVIDER(M79AMB_R41 + M79AMB_R42, 2200))//M79AMB_R43))
239239
240240   /************************************************
241241     * Tank, Truck, Jeep
r6049r6050
249249            M79AMB_TANK_TRUCK_JEEP_EN,      /* Q16, Q17 */
250250              NODE_60)
251251   DISCRETE_CRFILTER(NODE_62,
252            1,                        /* ENAB */
253252            NODE_61, M79AMB_R48 + M79AMB_R49, M79AMB_C26)
254253   DISCRETE_GAIN(NODE_63, NODE_62, RES_VOLTAGE_DIVIDER(M79AMB_R48, M79AMB_R49))
255254   DISCRETE_RCFILTER(M79AMB_TANK_TRUCK_JEEP_SND,
256            1,                        /* ENAB */
257255            NODE_63, RES_2_PARALLEL(M79AMB_R48, M79AMB_R49), M79AMB_C27)
258256
259257   /************************************************
r6049r6050
273271            12, 0, 12,               /* VPOS,VNEG,VCHARGE */
274272            DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE)
275273   DISCRETE_CRFILTER(NODE_73,
276            M79AMB_WHISTLE_A_EN,      /* Q16, Q17 */
277274            NODE_72, M79AMB_R57 + M79AMB_R58 + M79AMB_R59, M79AMB_C31)
278   DISCRETE_GAIN(M79AMB_WHISTLE_A_SND, NODE_73, RES_VOLTAGE_DIVIDER(M79AMB_R57 + M79AMB_R58, M79AMB_R59))
275   DISCRETE_MULTIPLY(NODE_74, NODE_73, M79AMB_WHISTLE_A_EN) /* Q16, Q17 */
276   DISCRETE_GAIN(M79AMB_WHISTLE_A_SND, NODE_74, RES_VOLTAGE_DIVIDER(M79AMB_R57 + M79AMB_R58, M79AMB_R59))
279277
280278   /************************************************
281279     * Whisle B
r6049r6050
294292            12, 0, 12,               /* VPOS,VNEG,VCHARGE */
295293            DISC_566_OUT_DC | DISC_566_OUT_TRIANGLE)
296294   DISCRETE_CRFILTER(NODE_83,
297            M79AMB_WHISTLE_B_EN,      /* Q19, Q20*/
298295            NODE_82, M79AMB_R67 + M79AMB_R68 + M79AMB_R69, M79AMB_C35)
299   DISCRETE_GAIN(M79AMB_WHISTLE_B_SND, NODE_83, RES_VOLTAGE_DIVIDER(M79AMB_R67 + M79AMB_R68, M79AMB_R69))
296   DISCRETE_MULTIPLY(NODE_84, NODE_83, M79AMB_WHISTLE_B_EN) /* Q19, Q20*/
297   DISCRETE_GAIN(M79AMB_WHISTLE_B_SND, NODE_84, RES_VOLTAGE_DIVIDER(M79AMB_R67 + M79AMB_R68, M79AMB_R69))
300298
301299   /************************************************
302300     * Mixer
r6049r6050
312310            M79AMB_WHISTLE_B_SND,
313311            &m79amb_final_mix)
314312   DISCRETE_RCFILTER(NODE_91,
315            1,                     /* ENAB */
316313            NODE_90, M79AMB_R86, M79AMB_C41)
317314
318315   DISCRETE_OUTPUT(NODE_91, 32000.0/5)
src/mame/audio/qix.c
r6049r6050
7878   DISCRETE_SWITCH(NODE_22, 1, QIX_VOL_DATA_R, QIX_DAC_DATA, NODE_21)
7979
8080   /* Filter the DC using the lowest case filter. */
81   DISCRETE_CRFILTER(NODE_13, 1, NODE_12, RES_K(1.5), CAP_U(1))
82   DISCRETE_CRFILTER(NODE_23, 1, NODE_22, RES_K(1.5), CAP_U(1))
81   DISCRETE_CRFILTER(NODE_13, NODE_12, RES_K(1.5), CAP_U(1))
82   DISCRETE_CRFILTER(NODE_23, NODE_22, RES_K(1.5), CAP_U(1))
8383
8484   DISCRETE_OUTPUT(NODE_13, 1)
8585   DISCRETE_OUTPUT(NODE_23, 1)
src/mame/audio/spiders.c
r6049r6050
137137
138138   // Fire envelope
139139   DISCRETE_MULTIPLY(NODE_41, DEFAULT_TTL_V_LOGIC_1, SPIDERS_FIRE_EN)
140   DISCRETE_RCFILTER(NODE_42, 1, NODE_41,RES_K(2.2),CAP_U(47)) //R11, C11
140   DISCRETE_RCFILTER(NODE_42, NODE_41,RES_K(2.2),CAP_U(47)) //R11, C11
141141   DISCRETE_TRANSFORM4(NODE_43, NODE_40, NODE_42, 2.5, 24.5,"012*3/-")
142142
143143   DISCRETE_555_ASTABLE_CV(NODE_44, 1, RES_K(10), RES_K(22), CAP_N(100), NODE_43, &spiders_fire_555a) //R10, R18, C12
src/mame/audio/llander.c
r6049r6050
5959   DISCRETE_INPUT_PULSE(LLANDER_NOISE_RESET, 1)
6060
6161   DISCRETE_LFSR_NOISE(NODE_20, 1, LLANDER_NOISE_RESET, 12000, 1, 0, 0, &llander_lfsr)   // 12KHz Noise source for thrust
62   DISCRETE_RCFILTER(LLANDER_NOISE, 1, NODE_20, 2247, 1e-6)
62   DISCRETE_RCFILTER(LLANDER_NOISE, NODE_20, 2247, 1e-6)
6363
6464   DISCRETE_SQUAREWFIX(LLANDER_TONE_3K_SND, LLANDER_TONE3K_EN, 3000, 9.2, 50, 0, 0)   // 3KHz
6565
src/mame/audio/canyon.c
r6049r6050
122122   /* This adjusts the high end.                   */
123123   /* 0k = 214Hz.   250k = 4416Hz                  */
124124   /************************************************/
125   DISCRETE_RCFILTER(NODE_20, 1, CANYON_MOTOR1_DATA, 123000, 1e-6)
125   DISCRETE_RCFILTER(NODE_20, CANYON_MOTOR1_DATA, 123000, 1e-6)
126126   DISCRETE_ADJUSTMENT_TAG(NODE_21, (214.0-27.0)/12/15, (4416.0-27.0)/12/15, DISC_LOGADJ, "MOTOR1")
127127   DISCRETE_MULTIPLY(NODE_22, NODE_20, NODE_21)
128128
129129   DISCRETE_MULTADD(NODE_23, NODE_22, 2, 27.0/6)   /* F1 = /12*2 = /6 */
130130   DISCRETE_SQUAREWAVE(NODE_24, 1, NODE_23, (142.9/3), 50.0, 0, 0)
131   DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 10000, 1e-7)
131   DISCRETE_RCFILTER(NODE_25, NODE_24, 10000, 1e-7)
132132
133133   DISCRETE_MULTADD(NODE_26, NODE_22, 3, 27.0/4)   /* F2 = /12*3 = /4 */
134134   DISCRETE_SQUAREWAVE(NODE_27, 1, NODE_26, (142.9/3), 50.0, 0, 0)
135   DISCRETE_RCFILTER(NODE_28, 1, NODE_27, 10000, 1e-7)
135   DISCRETE_RCFILTER(NODE_28, NODE_27, 10000, 1e-7)
136136
137137   DISCRETE_MULTADD(NODE_29, NODE_22, 4, 27.0/3)   /* F3 = /12*4 = /3 */
138138   DISCRETE_SQUAREWAVE(NODE_30, 1, NODE_29, (142.9/3), 100.0/3, 0, 360.0/3)
139   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, 10000, 1e-7)
139   DISCRETE_RCFILTER(NODE_31, NODE_30, 10000, 1e-7)
140140
141141   DISCRETE_ADDER3(CANYON_MOTORSND1, CANYON_ATTRACT1_EN, NODE_25, NODE_28, NODE_31)
142142
r6049r6050
145145   /* for 1.  But I shifted the frequencies up for */
146146   /* it to sound different from motor 1.          */
147147   /************************************************/
148   DISCRETE_RCFILTER(NODE_40, 1, CANYON_MOTOR2_DATA, 123000, 1e-6)
148   DISCRETE_RCFILTER(NODE_40, CANYON_MOTOR2_DATA, 123000, 1e-6)
149149   DISCRETE_ADJUSTMENT_TAG(NODE_41, (214.0-27.0)/12/15, (4416.0-27.0)/12/15, DISC_LOGADJ, "MOTOR2")
150150   DISCRETE_MULTIPLY(NODE_42, NODE_40, NODE_41)
151151
152152   DISCRETE_MULTADD(NODE_43, NODE_42, 2, 27.0/6)   /* F1 = /12*2 = /6 */
153153   DISCRETE_SQUAREWAVE(NODE_44, 1, NODE_43, (142.9/3), 50.0, 0, 0)
154   DISCRETE_RCFILTER(NODE_45, 1, NODE_44, 10000, 1e-7)
154   DISCRETE_RCFILTER(NODE_45, NODE_44, 10000, 1e-7)
155155
156156   DISCRETE_MULTADD(NODE_46, NODE_42, 3, 27.0/4)   /* F2 = /12*3 = /4 */
157157   DISCRETE_SQUAREWAVE(NODE_47, 1, NODE_46, (142.9/3), 50.0, 0, 0)
158   DISCRETE_RCFILTER(NODE_48, 1, NODE_47, 10000, 1e-7)
158   DISCRETE_RCFILTER(NODE_48, NODE_47, 10000, 1e-7)
159159
160160   DISCRETE_MULTADD(NODE_49, NODE_42, 4, 27.0/3)   /* F3 = /12*4 = /3 */
161161   DISCRETE_SQUAREWAVE(NODE_50, 1, NODE_49, (142.9/3), 100.0/3, 0, 360.0/3)
162   DISCRETE_RCFILTER(NODE_51, 1, NODE_50, 10000, 1e-7)
162   DISCRETE_RCFILTER(NODE_51, NODE_50, 10000, 1e-7)
163163
164164   DISCRETE_ADDER3(CANYON_MOTORSND2, CANYON_ATTRACT2_EN, NODE_45, NODE_48, NODE_51)
165165
r6049r6050
176176   DISCRETE_LFSR_NOISE(CANYON_NOISE, NODE_60, NODE_60, 15750.0/4, 1.0, 0, 0, &canyon_lfsr)
177177
178178   DISCRETE_MULTIPLY(NODE_61, CANYON_NOISE, CANYON_EXPLODE_DATA)
179   DISCRETE_RCFILTER(CANYON_EXPLODESND, 1, NODE_61, 545, 5e-6)
179   DISCRETE_RCFILTER(CANYON_EXPLODESND, NODE_61, 545, 5e-6)
180180
181181   /************************************************/
182182   /* Whistle circuit is a 555 capacitor charge    */
src/mame/audio/circus.c
r6049r6050
7979   /************************************************/
8080   /* Music is just a 1 bit DAC                    */
8181   /************************************************/
82   DISCRETE_CRFILTER(CIRCUS_MUSIC_SND, 1, CIRCUS_MUSIC_BIT, RES_K(50), CAP_U(.1))   /* 50K is just an average value */
82   DISCRETE_CRFILTER(CIRCUS_MUSIC_SND, CIRCUS_MUSIC_BIT, RES_K(50), CAP_U(.1))   /* 50K is just an average value */
8383
8484   DISCRETE_OUTPUT(CIRCUS_MUSIC_SND, 1)
8585DISCRETE_SOUND_END
r6049r6050
161161   /************************************************/
162162   /* Music is just a 1 bit DAC                    */
163163   /************************************************/
164   DISCRETE_RCFILTER(NODE_20, 1, ROBOTBWL_MUSIC_BIT, RES_K(10), CAP_U(.47))
165   DISCRETE_CRFILTER(ROBOTBWL_MUSIC_SND, 1, NODE_20, RES_K(10) + RES_K(22), CAP_U(.1))
164   DISCRETE_RCFILTER(NODE_20, ROBOTBWL_MUSIC_BIT, RES_K(10), CAP_U(.47))
165   DISCRETE_CRFILTER(ROBOTBWL_MUSIC_SND, NODE_20, RES_K(10) + RES_K(22), CAP_U(.1))
166166
167167   DISCRETE_OUTPUT(ROBOTBWL_MUSIC_SND, 1)
168168DISCRETE_SOUND_END
src/mame/audio/crbaloon.c
r6049r6050
105105    * square wave.
106106    ************************************************/
107107   DISCRETE_555_ASTABLE(NODE_10, 1, RES_K(10), RES_K(100), CAP_U(1), &desc_crbaloon_laugh_osc)
108   DISCRETE_CRFILTER_VREF(NODE_11, 1, NODE_10,
108   DISCRETE_CRFILTER_VREF(NODE_11, NODE_10,
109109      1.0/(1.0/RES_K(5) + 1.0/RES_K(10) + 1.0/RES_K(100)), // 5k & 10k are 555 internal
110110      CAP_U(10),
111111      /* The following will calculate the reference control voltage with no signal applied to the cap. */
112112      5.0* (1.0/(1.0/RES_K(10) + 1.0/RES_K(100))) / (RES_K(5)+(1.0/(1.0/RES_K(10) + 1.0/RES_K(100)))) )
113113   DISCRETE_555_ASTABLE_CV(NODE_12, CRBALOON_LAUGH_EN, RES_K(1), RES_K(22), CAP_U(.1), NODE_11, &desc_crbaloon_laugh_osc)
114114   DISCRETE_MULTIPLY(NODE_13, NODE_12, CRBALOON_VR2)
115   DISCRETE_CRFILTER(CRBALOON_LAUGH_SND, 1, NODE_13, RES_K(20), CAP_U(1))
115   DISCRETE_CRFILTER(CRBALOON_LAUGH_SND, NODE_13, RES_K(20), CAP_U(1))
116116
117117   /************************************************
118118    * Music Generator is amplitude modulated by a
r6049r6050
124124   DISCRETE_ONOFF(NODE_22, CRBALOON_MUSIC_EN, NODE_21)
125125//  DISCRETE_RAMP(NODE_21, 1, RAMP, GRAD, MIN, MAX, CLAMP)
126126   DISCRETE_MULTIPLY(NODE_23, NODE_22, CRBALOON_VR3)
127   DISCRETE_CRFILTER(CRBALOON_MUSIC_SND, 1, NODE_23, RES_K(50), CAP_U(1))
127   DISCRETE_CRFILTER(CRBALOON_MUSIC_SND, NODE_23, RES_K(50), CAP_U(1))
128128
129129   /************************************************
130130    * Final mix and output.
131131    ************************************************/
132132   DISCRETE_ADDER2(NODE_90, 1, CRBALOON_LAUGH_SND, CRBALOON_MUSIC_SND)
133   DISCRETE_CRFILTER(NODE_91, 1, NODE_90, RES_K(100), CAP_U(1))
133   DISCRETE_CRFILTER(NODE_91, NODE_90, RES_K(100), CAP_U(1))
134134
135135   DISCRETE_OUTPUT(NODE_91, 65000.0/12)
136136
src/mame/audio/snk6502.c
r6049r6050
365365   DISCRETE_SWITCH(NODE_11, 1, FANTASY_NOISE_LOGIC, 0, NODE_10)
366366
367367   DISCRETE_OP_AMP_FILTER(NODE_20, 1, NODE_11, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &fantasy_filter)
368   DISCRETE_RCFILTER(NODE_21, 1, NODE_20, RES_K(22), CAP_U(.01))
369   DISCRETE_RCFILTER(NODE_22, 1, NODE_21, RES_K(22) +  RES_K(22), CAP_P(2200))
370   DISCRETE_RCFILTER(NODE_23, 1, NODE_22, RES_K(22) + RES_K(22) +  RES_K(22), CAP_U(.001))
368   DISCRETE_RCFILTER(NODE_21, NODE_20, RES_K(22), CAP_U(.01))
369   DISCRETE_RCFILTER(NODE_22, NODE_21, RES_K(22) +  RES_K(22), CAP_P(2200))
370   DISCRETE_RCFILTER(NODE_23, NODE_22, RES_K(22) + RES_K(22) +  RES_K(22), CAP_U(.001))
371371
372372   DISCRETE_OUTPUT(NODE_23, 32760.0/12)
373373DISCRETE_SOUND_END
src/mame/audio/irem.c
r6049r6050
327327
328328   /* Sallen - Key Filter */
329329   /* TODO: R12, C30: This looks like a band pass */
330   DISCRETE_RCFILTER(NODE_25, 1, NODE_20, M52_R12, M52_C30)
330   DISCRETE_RCFILTER(NODE_25, NODE_20, M52_R12, M52_C30)
331331   DISCRETE_SALLEN_KEY_FILTER(NODE_30, 1, NODE_25, DISC_SALLEN_KEY_LOW_PASS, &m52_sound_c_sallen_key)
332332
333333   /* Mix signals */
334334   DISCRETE_MIXER2(NODE_40, 1, NODE_10, NODE_25, &m52_sound_c_mix1)
335   DISCRETE_CRFILTER(NODE_45, 1, NODE_40, M52_R10+M52_R9, M52_C28)
335   DISCRETE_CRFILTER(NODE_45, NODE_40, M52_R10+M52_R9, M52_C28)
336336
337337   DISCRETE_OUTPUT(NODE_40, 18.0)
338338
src/mame/audio/dkong.c
r6049r6050
439439   /* Trigger */
440440   DISCRETE_RCDISC_MODULATED(NODE_60,DS_SOUND0_INV,NODE_55,DK_R36,DK_R18,DK_R35,DK_R17,DK_C25,DK_SUP_V)
441441   /* Filter and divide - omitted C22 */
442   DISCRETE_CRFILTER(NODE_61, 1, NODE_60, DK_R15+DK_R16, DK_C23)
442   DISCRETE_CRFILTER(NODE_61, NODE_60, DK_R15+DK_R16, DK_C23)
443443   DISCRETE_MULTIPLY(DS_OUT_SOUND2, NODE_61, DK_R15/(DK_R15+DK_R16))
444444   DISCRETE_TASK_END()
445445
r6049r6050
448448   /************************************************/
449449
450450   DISCRETE_TASK_START(1)
451   /* Mixing - DAC */
452   DISCRETE_ADJUSTMENT_TAG(DS_ADJ_DAC, 0, 1, DISC_LINADJ, "VR2")
453
451454   /* Buffer DAC first to input stream 0 */
452455   DISCRETE_INPUT_BUFFER(DS_DAC, 0)
453456   //DISCRETE_INPUT_DATA(DS_DAC)
r6049r6050
467470
468471   /* Adjustment VR2 */
469472#if DK_NO_FILTERS
470   DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_71, DS_ADJ_DAC)
473   DISCRETE_MULTIPLY(DS_OUT_DAC, NODE_71, DS_ADJ_DAC)
471474#else
472475   DISCRETE_MULTIPLY(DS_OUT_DAC, NODE_73, DS_ADJ_DAC)
473476#endif
r6049r6050
478481   /************************************************/
479482
480483   DISCRETE_TASK_START(2)
481   /* Mixing - DAC */
482   DISCRETE_ADJUSTMENT_TAG(DS_ADJ_DAC, 0, 1, DISC_LINADJ, "VR2")
483484
484485   DISCRETE_MIXER4(NODE_288, 1, DS_OUT_SOUND0, DS_OUT_SOUND1, DS_OUT_DAC, DS_OUT_SOUND2, &dkong_mixer_desc)
485486
486487   /* Amplifier: internal amplifier */
487488   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
488489   DISCRETE_RCINTEGRATE(NODE_294,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
489   DISCRETE_CRFILTER(NODE_295,1,NODE_294, RES_K(50), DK_C13)
490   DISCRETE_CRFILTER(NODE_295,NODE_294, RES_K(50), DK_C13)
490491   /*DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13) */
491492   /* EZV20 equivalent filter circuit ... */
492   DISCRETE_CRFILTER(NODE_296,1,NODE_295, RES_K(1), CAP_U(4.7))
493   DISCRETE_CRFILTER(NODE_296,NODE_295, RES_K(1), CAP_U(4.7))
493494#if DK_NO_FILTERS
494495   DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10)
495496#else
r6049r6050
704705   DISCRETE_555_ASTABLE_CV(NODE_43, DS_SOUND6, RES_K(47), RES_K(27), RS_C49, NODE_42, &radarscp_555_vco_desc)
705706
706707   DISCRETE_RCDISC_MODULATED(NODE_44,DS_SOUND0_INV,NODE_43,RS_R39,RS_R18,RS_R37,RS_R38,RS_C22,DK_SUP_V)
707   DISCRETE_CRFILTER(NODE_45, 1, NODE_44, RS_R15+RS_R16, RS_C33)
708   DISCRETE_CRFILTER(NODE_45, NODE_44, RS_R15+RS_R16, RS_C33)
708709   DISCRETE_MULTIPLY(DS_OUT_SOUND0, NODE_45, RS_R15/(RS_R15+RS_R16))
709710
710711   /************************************************/
r6049r6050
721722
722723   DISCRETE_RCINTEGRATE(NODE_55,NODE_52,RS_R46, RS_R46,0,RS_C45,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1)
723724   DISCRETE_TRANSFORM4(NODE_56, NODE_55, DS_SOUND7,NODE_54,2.5, "01*23<*")
724   DISCRETE_CRFILTER(NODE_57, 1, NODE_56, RS_R43+RS_R44, RS_C46)
725   DISCRETE_CRFILTER(NODE_57, NODE_56, RS_R43+RS_R44, RS_C46)
725726   DISCRETE_MULTIPLY(DS_OUT_SOUND7, NODE_57, RS_R44/(RS_R43+RS_R44))
726727
727728   /************************************************/
r6049r6050
753754   /* Amplifier: internal amplifier */
754755   DISCRETE_ADDER2(NODE_289,1,NODE_288,5.0*43.0/(100.0+43.0))
755756   DISCRETE_RCINTEGRATE(NODE_294,NODE_289,0,150,1000, CAP_U(33),DK_SUP_V,DISC_RC_INTEGRATE_TYPE3)
756   DISCRETE_CRFILTER(NODE_295,1,NODE_294, 1000, DK_C13)
757   DISCRETE_CRFILTER(NODE_295,NODE_294, 1000, DK_C13)
757758   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 * 3)
758759
759760DISCRETE_SOUND_END
r6049r6050
894895
895896   DISCRETE_LS123(NODE_110, DS_SOUND0_INV, JR_R8, JR_C14)
896897   DISCRETE_TRANSFORM2(NODE_111, TTL_HIGH, NODE_110, "01-")
897   DISCRETE_RCFILTER(NODE_112, 1, NODE_111, JR_R10, JR_C17)
898   DISCRETE_RCFILTER(NODE_112, NODE_111, JR_R10, JR_C17)
898899   DISCRETE_74LS624(NODE_113, NODE_112, DK_SUP_V, JR_C18, DISC_LS624_OUT_ENERGY)
899900
900901   DISCRETE_LOGIC_XOR(NODE_115, NODE_105, NODE_106)
901902
902903   DISCRETE_TRANSFORM2(NODE_116, NODE_107, TTL_HIGH, "0!1*")
903   DISCRETE_RCFILTER(NODE_117, 1, NODE_116, JR_R11, JR_C16)
904   DISCRETE_RCFILTER(NODE_117, NODE_116, JR_R11, JR_C16)
904905   DISCRETE_74LS624(NODE_118, NODE_117, DK_SUP_V, JR_C19, DISC_LS624_OUT_COUNT_F)
905906
906907   DISCRETE_LOGIC_NAND(NODE_120, NODE_115, NODE_110)
r6049r6050
921922   /* The following circuit does not match 100%, however works.
922923     * To be exact, we need a C-R-C-R circuit, we actually do not have.
923924     */
924   DISCRETE_CRFILTER_VREF(NODE_16, 1, NODE_15, JR_R4, JR_C23, 2.5)
925   DISCRETE_RCFILTER(DS_OUT_SOUND1, 1, NODE_16, JR_R19, JR_C21)
925   DISCRETE_CRFILTER_VREF(NODE_16, NODE_15, JR_R4, JR_C23, 2.5)
926   DISCRETE_RCFILTER(DS_OUT_SOUND1, NODE_16, JR_R19, JR_C21)
926927DISCRETE_TASK_END()
927928
928929   /************************************************/
r6049r6050
937938   /* The following circuit does not match 100%, however works.
938939     * To be exact, we need a C-R-C-R circuit, we actually do not have.
939940     */
940   DISCRETE_CRFILTER_VREF(NODE_27, 1, NODE_26, JR_R6, JR_C30, 2.5)
941   DISCRETE_RCFILTER(DS_OUT_SOUND2, 1, NODE_27, JR_R2, JR_C25)
941   DISCRETE_CRFILTER_VREF(NODE_27, NODE_26, JR_R6, JR_C30, 2.5)
942   DISCRETE_RCFILTER(DS_OUT_SOUND2, NODE_27, JR_R2, JR_C25)
942943DISCRETE_TASK_END()
943944
944945   /************************************************/
r6049r6050
947948
948949DISCRETE_TASK_START(1)
949950   DISCRETE_LOGIC_INVERT(DS_SOUND9,DS_SOUND9_INV)
950   DISCRETE_RCFILTER(NODE_90, 1, DS_SOUND9_INV, JR_R14, JR_C26)
951   DISCRETE_RCFILTER(NODE_90, DS_SOUND9_INV, JR_R14, JR_C26)
951952   DISCRETE_MULTIPLY(NODE_91, NODE_90, TTL_HIGH)
952953   DISCRETE_74LS624( NODE_92, NODE_91, DK_SUP_V, JR_C37, DISC_LS624_OUT_ENERGY)
953954   DISCRETE_ENERGY_NAND(NODE_93, NODE_92, DS_SOUND9)
r6049r6050
986987   /* Amplifier: internal amplifier
987988     * Just a 1:n amplifier without filters - just the output filter
988989     */
989   DISCRETE_CRFILTER(NODE_295,1,NODE_288, 1000, JR_C13)
990   DISCRETE_CRFILTER(NODE_295,NODE_288, 1000, JR_C13)
990991   DISCRETE_OUTPUT(NODE_295, 32767.0/5.0 * 10)
991992DISCRETE_TASK_END()
992993
src/mame/audio/skyraid.c
r6049r6050
341341     * Jet, Plane sound
342342     ************************************************/
343343   DISCRETE_RCFILTER(NODE_30,            /* IC J6, pin 5 */
344      1,                           /* ENAB */
345344      SKYRAID_PLANE_SWEEP_EN,            /* IN0 */
346345      RES_2_PARALLEL(SKYRAID_R25, SKYRAID_R24), SKYRAID_C49)
347346   DISCRETE_566(NODE_31,               /* IC J6, pin 3 */
r6049r6050
391390      SKYRAID_PLANE_SND,
392391      &skyraid_mixer)
393392   DISCRETE_CRFILTER(NODE_93,
394      1,                  /* ENAB */
395393      NODE_92,            /* IN0 */
396394      SKYRAID_R122 + RES_6_PARALLEL(SKYRAID_R120, SKYRAID_R32, SKYRAID_R29, SKYRAID_R30, SKYRAID_R31, RES_2_PARALLEL(SKYRAID_R27, SKYRAID_R28)),
397395      SKYRAID_C93)
src/mame/audio/sprint8.c
r6049r6050
158158 * we will just tell the monostable it was triggered once and ignore C17/R40.
159159 */
160160#define SPRINT8_MOTOR_CIRCUIT(_car)                                                            \
161DISCRETE_RCFILTER(NODE_RELATIVE(NODE_30, _car - 1), 1, NODE_RELATIVE(SPRINT8_MOTOR1_EN, _car - 1), SPRINT8_R89, SPRINT8_C26)    \
161DISCRETE_RCFILTER(NODE_RELATIVE(NODE_30, _car - 1), NODE_RELATIVE(SPRINT8_MOTOR1_EN, _car - 1), SPRINT8_R89, SPRINT8_C26)    \
162162DISCRETE_ADDER2(NODE_RELATIVE(NODE_40, _car - 1), 1, NODE_RELATIVE(NODE_30, _car - 1), 0.7)   /* add Q21 shift */             \
163163DISCRETE_555_ASTABLE_CV(NODE_RELATIVE(NODE_50, _car - 1), 1, SPRINT8_R39, 0, SPRINT8_C27, NODE_RELATIVE(NODE_40, _car - 1), &sprint8_motor_555a_desc) \
164164DISCRETE_555_MSTABLE(NODE_RELATIVE(NODE_60, _car - 1), 1, NODE_RELATIVE(NODE_50, _car - 1), SPRINT8_R41, SPRINT8_C28, &sprint8_motor_555m_desc)       \
r6049r6050
200200   DISCRETE_TASK_START(1)
201201   DISCRETE_GAIN(NODE_70, SPRINT8_NOISE, DEFAULT_TTL_V_LOGIC_1 * RES_VOLTAGE_DIVIDER(SPRINT8_R148, SPRINT8_R147))
202202   DISCRETE_CRFILTER_VREF(NODE_71,
203      1,                              /* ENAB */
204203      NODE_70,                        /* IN0 */
205204      RES_2_PARALLEL(SPRINT8_R148, SPRINT8_R147) + RES_2_PARALLEL(RES_K(5), RES_K(10)),
206205      SPRINT8_C90,
r6049r6050
227226      &sprint8_crash_screech_mixer)
228227
229228   DISCRETE_CRFILTER_VREF(NODE_76,
230      1,                              /* ENAB */
231229      NODE_75,                        /* IN0 */
232230      SPRINT8_R93 + SPRINT8_R91, SPRINT8_C63,
233231      5)                              /* VREF */
src/mame/audio/madalien.c
r6049r6050
222222      15, 1, 0, DISC_CLK_BY_COUNT)   // 4-bit binary up counter
223223   DISCRETE_DAC_R1(NODE_55, NODE_54, DEFAULT_TTL_V_LOGIC_1, &madalien_effect1a_dac)
224224   DISCRETE_DAC_R1(NODE_56, NODE_54, DEFAULT_TTL_V_LOGIC_1, &madalien_effect1b_dac)
225   DISCRETE_RCFILTER(NODE_57, 1, NODE_56, RES_K(22)/2 + RES_K(22), CAP_U(.033))
225   DISCRETE_RCFILTER(NODE_57, NODE_56, RES_K(22)/2 + RES_K(22), CAP_U(.033))
226226   DISCRETE_COMP_ADDER(NODE_59, MADALIEN_8910_PORTB_23, &madalien_effect_1b_vol_r)
227227
228228   /************************************************
229229     * Enemy motor
230230     ************************************************/
231   DISCRETE_CRFILTER(NODE_60, 1, MADALIEN_8910_PORTB_7, RES_K(100), CAP_U(4.7))
231   DISCRETE_CRFILTER(NODE_60, MADALIEN_8910_PORTB_7, RES_K(100), CAP_U(4.7))
232232   // 2 diodes clamp it positive.
233233   DISCRETE_CLAMP(NODE_62, NODE_60, 0, 12)
234234   // the 0.047uF cap to ground just removes real world spikes.
src/mame/audio/mario.c
r6049r6050
11#include "driver.h"
22#include "cpu/z80/z80.h"
33#include "cpu/mcs48/mcs48.h"
4#include "sound/dac.h"
54#include "sound/ay8910.h"
65#include "sound/discrete.h"
76
r6049r6050
203202
204203   double  sample_t = node->info->sample_time;
205204   double  vn, exponent, t = 0;
206   int      update_exponent = 0;
205   int      update_exponent;
207206   double   t1, t2;
208207
209   if (MARIO_CUSTOM_IN1 > 0.001)
208   if (EXPECTED(MARIO_CUSTOM_IN1 > 0.001))
210209      t1   = 0.5 / LS624_F(MARIO_CUSTOM_IN1, 1);
211210   else
212211      /* close enough to 0, so we can speed things up by no longer call pow() */
213212      t1 = context->dt_in1_at_0;
214213
215   if (MARIO_CUSTOM_IN2 > 0.001)
214   if (EXPECTED(MARIO_CUSTOM_IN2 > 0.001))
216215      t2   = 0.5 / LS624_F(MARIO_CUSTOM_IN2, 2);
217216   else
218217      t2 = context->dt_in2_at_0;
r6049r6050
222221      /* state before time advance */
223222      vn = (double) (context->state1 ^ context->state2);
224223      vn *= MARIO_CUSTOM_VOUT;
224      update_exponent = 0;
225225      if (context->remain1 < context->remain2)
226226      {
227         if (context->remain1 < sample_t)
227         if (EXPECTED(context->remain1 < sample_t))
228228         {
229229            t = context->remain1;
230230            update_exponent = 1;
r6049r6050
242242      }
243243      else
244244      {
245         if (context->remain2 < sample_t)
245         if (EXPECTED(context->remain2 < sample_t))
246246         {
247247            t = context->remain2;
248248            update_exponent = 1;
r6049r6050
259259         }
260260      }
261261
262      if (update_exponent)
262      if (EXPECTED(update_exponent))
263263         exponent = RC_CHARGE_EXP_DT(context->r1_c3, t);
264264      else
265265         exponent = context->exponent_c3;
r6049r6050
313313    DISCRETE_TASK_START(1)
314314    DISCRETE_INPUT_PULSE(DS_SOUND0_INV, 1)
315315   DISCRETE_LS123(NODE_10, DS_SOUND0_INV, MR_R17, MR_C14)
316   DISCRETE_RCFILTER(NODE_11, 1, NODE_10, MR_R6, MR_C3 )
316   DISCRETE_RCFILTER(NODE_11, NODE_10, MR_R6, MR_C3 )
317317   DISCRETE_CUSTOM7(NODE_12, NODE_10, NODE_11, NODE_11, MR_C6, MR_C17,
318318         MR_MIXER_RPAR, MR_C31, &mario_custom_run_info)
319319   DISCRETE_MULTIPLY(DS_OUT_SOUND0, NODE_12, MR_MIXER_RPAR / MR_R20)
r6049r6050
326326   DISCRETE_TASK_START(1)
327327   DISCRETE_INPUT_PULSE(DS_SOUND1_INV, 1)
328328   DISCRETE_LS123(NODE_20, DS_SOUND1_INV, MR_R18, MR_C15)
329   DISCRETE_RCFILTER(NODE_21, 1, NODE_20, MR_R7, MR_C4 )
329   DISCRETE_RCFILTER(NODE_21, NODE_20, MR_R7, MR_C4 )
330330   DISCRETE_CUSTOM7(NODE_22, NODE_20, NODE_21, NODE_21, MR_C5, MR_C16,
331331      MR_MIXER_RPAR, MR_C31, &mario_custom_run_info)
332332   DISCRETE_MULTIPLY(DS_OUT_SOUND1, NODE_22, MR_MIXER_RPAR / MR_R19)
r6049r6050
344344
345345   DISCRETE_LS123(NODE_110, DS_SOUND7_INV, MR_R61, MR_C41)
346346   DISCRETE_TRANSFORM2(NODE_111, NODE_110, TTL_HIGH, "0!1*")
347   DISCRETE_RCFILTER(NODE_112, 1, NODE_111, MR_R65, MR_C44)
347   DISCRETE_RCFILTER(NODE_112, NODE_111, MR_R65, MR_C44)
348348   DISCRETE_74LS624(NODE_113, NODE_112, RUN_VCO_VOLTAGE /*VSS*/, MR_C40, DISC_LS624_OUT_LOGIC)
349349
350350   DISCRETE_LOGIC_XOR(NODE_115, NODE_102, NODE_113)
351351
352   DISCRETE_RCFILTER(NODE_117, 1, NODE_104, MR_R64, MR_C43)
352   DISCRETE_RCFILTER(NODE_117, NODE_104, MR_R64, MR_C43)
353353   DISCRETE_74LS624(NODE_118, NODE_117, RUN_VCO_VOLTAGE /*VSS*/, MR_C39, DISC_LS624_OUT_COUNT_F)
354354
355355   DISCRETE_LOGIC_AND(NODE_120, NODE_115, NODE_110)
356356   DISCRETE_MULTIPLY(NODE_121, NODE_120, TTL_HIGH * MR_MIXER_RPAR / MR_R41)
357   DISCRETE_RCFILTER(DS_OUT_SOUND7, 1, NODE_121, MR_MIXER_RPAR, MR_C31)
357   DISCRETE_RCFILTER(DS_OUT_SOUND7, NODE_121, MR_MIXER_RPAR, MR_C31)
358358   DISCRETE_TASK_END()
359359
360360   /************************************************/
r6049r6050
368368   DISCRETE_TASK_START(1)
369369   DISCRETE_INPUT_BUFFER(DS_DAC, 0)
370370   DISCRETE_MULTIPLY(NODE_170, DS_DAC, TTL_HIGH/256.0)
371   DISCRETE_RCFILTER(NODE_171, 1, NODE_170, RES_K(750), CAP_P(200))
371   DISCRETE_RCFILTER(NODE_171, NODE_170, RES_K(750), CAP_P(200))
372372
373373   DISCRETE_MULTIPLY(NODE_172, NODE_171, MR_MIXER_RPAR / MR_R40)
374   DISCRETE_RCFILTER(DS_OUT_DAC, 1, NODE_172, MR_MIXER_RPAR, MR_C31)
374   DISCRETE_RCFILTER(DS_OUT_DAC, NODE_172, MR_MIXER_RPAR, MR_C31)
375375   DISCRETE_TASK_END()
376376
377377
r6049r6050
385385   /* Amplifier: internal amplifier
386386     * Just a 1:n amplifier without filters and no output capacitor
387387     */
388   DISCRETE_CRFILTER(NODE_296, 1, NODE_295, RES_2_PARALLEL(MR_R42, MR_R43), MR_C32)
388   DISCRETE_CRFILTER(NODE_296, NODE_295, RES_2_PARALLEL(MR_R42, MR_R43), MR_C32)
389389   /* EZV20 (Monitor) ouput capacitor / Speaker */
390   DISCRETE_CRFILTER(NODE_297, 1, NODE_296, 6, CAP_U(22))
390   DISCRETE_CRFILTER(NODE_297, NODE_296, 6, CAP_U(22))
391391   DISCRETE_OUTPUT(NODE_297, 32767.0/5.0 * 10)
392392   //DISCRETE_WAVELOG1(DS_OUT_SOUND0, 32767/5.0)
393393   //DISCRETE_WAVELOG2(NODE_296, 32767/5.0 * 2, DS_SOUND7_INV, 10000)
src/mame/audio/tank8.c
r6049r6050
150150   DISCRETE_LOGIC_INVERT(NODE_30, TANK8_MOTOR1_EN)
151151   DISCRETE_DAC_R1(NODE_32, TANK8_MOTOR1_EN, 3.6, &tank8_dac)
152152   DISCRETE_555_ASTABLE_CV(NODE_33, NODE_30, RES_K(220), RES_K(39), CAP_U(0.22), NODE_32, &tank8_555_a)
153   DISCRETE_CRFILTER_VREF(NODE_34, 1, NODE_33, RES_K(22), CAP_U(0.001), 5.0)
153   DISCRETE_CRFILTER_VREF(NODE_34, NODE_33, RES_K(22), CAP_U(0.001), 5.0)
154154   DISCRETE_555_MSTABLE(NODE_35, 1, NODE_34, RES_K(56), CAP_U(0.1), &tank8_555_m)
155155   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR1, 1, NODE_35, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
156156
157157   DISCRETE_LOGIC_INVERT(NODE_40, TANK8_MOTOR2_EN)
158158   DISCRETE_DAC_R1(NODE_42, TANK8_MOTOR2_EN, 3.6, &tank8_dac)
159159   DISCRETE_555_ASTABLE_CV(NODE_43, NODE_40, RES_K(220), RES_K(39), CAP_U(0.22), NODE_42, &tank8_555_a)
160   DISCRETE_CRFILTER_VREF(NODE_44, 1, NODE_43, RES_K(22), CAP_U(0.001), 5.0)
160   DISCRETE_CRFILTER_VREF(NODE_44, NODE_43, RES_K(22), CAP_U(0.001), 5.0)
161161   DISCRETE_555_MSTABLE(NODE_45, 1, NODE_44, RES_K(56), CAP_U(0.1), &tank8_555_m)
162162   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR2, 1, NODE_45, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
163163
164164   DISCRETE_LOGIC_INVERT(NODE_50, TANK8_MOTOR3_EN)
165165   DISCRETE_DAC_R1(NODE_52, TANK8_MOTOR3_EN, 3.6, &tank8_dac)
166166   DISCRETE_555_ASTABLE_CV(NODE_53, NODE_50, RES_K(220), RES_K(39), CAP_U(0.22), NODE_52, &tank8_555_a)
167   DISCRETE_CRFILTER_VREF(NODE_54, 1 , NODE_53, RES_K(22), CAP_U(0.001), 5.0)
167   DISCRETE_CRFILTER_VREF(NODE_54, NODE_53, RES_K(22), CAP_U(0.001), 5.0)
168168   DISCRETE_555_MSTABLE(NODE_55, 1, NODE_54, RES_K(56), CAP_U(0.1), &tank8_555_m)
169169   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR3, 1, NODE_55, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
170170
171171   DISCRETE_LOGIC_INVERT(NODE_60, TANK8_MOTOR4_EN)
172172   DISCRETE_DAC_R1(NODE_62, TANK8_MOTOR4_EN, 3.6, &tank8_dac)
173173   DISCRETE_555_ASTABLE_CV(NODE_63, NODE_60, RES_K(220), RES_K(39), CAP_U(0.22), NODE_62, &tank8_555_a)
174   DISCRETE_CRFILTER_VREF(NODE_64, 1, NODE_63, RES_K(22), CAP_U(0.001), 5.0)
174   DISCRETE_CRFILTER_VREF(NODE_64, NODE_63, RES_K(22), CAP_U(0.001), 5.0)
175175   DISCRETE_555_MSTABLE(NODE_65, 1, NODE_64, RES_K(56), CAP_U(0.1), &tank8_555_m)
176176   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR4, 1, NODE_65, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
177177
178178   DISCRETE_LOGIC_INVERT(NODE_70, TANK8_MOTOR5_EN)
179179   DISCRETE_DAC_R1(NODE_72, TANK8_MOTOR5_EN, 3.6, &tank8_dac)
180180   DISCRETE_555_ASTABLE_CV(NODE_73, NODE_70, RES_K(220), RES_K(39), CAP_U(0.22), NODE_72, &tank8_555_a)
181   DISCRETE_CRFILTER_VREF(NODE_74, 1, NODE_73, RES_K(22), CAP_U(0.001), 5.0)
181   DISCRETE_CRFILTER_VREF(NODE_74, NODE_73, RES_K(22), CAP_U(0.001), 5.0)
182182   DISCRETE_555_MSTABLE(NODE_75, 1, NODE_74, RES_K(56), CAP_U(0.1), &tank8_555_m)
183183   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR5, 1, NODE_75, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
184184
185185   DISCRETE_LOGIC_INVERT(NODE_80, TANK8_MOTOR6_EN)
186186   DISCRETE_DAC_R1(NODE_82, TANK8_MOTOR6_EN, 3.6, &tank8_dac)
187187   DISCRETE_555_ASTABLE_CV(NODE_83, NODE_80, RES_K(220), RES_K(39), CAP_U(0.22), NODE_82, &tank8_555_a)
188   DISCRETE_CRFILTER_VREF(NODE_84, 1, NODE_83, RES_K(22), CAP_U(0.001), 5.0)
188   DISCRETE_CRFILTER_VREF(NODE_84, NODE_83, RES_K(22), CAP_U(0.001), 5.0)
189189   DISCRETE_555_MSTABLE(NODE_85, 1, NODE_84, RES_K(56), CAP_U(0.1), &tank8_555_m)
190190   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR6, 1, NODE_85, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
191191
192192   DISCRETE_LOGIC_INVERT(NODE_90, TANK8_MOTOR7_EN)
193193   DISCRETE_DAC_R1(NODE_92, TANK8_MOTOR7_EN, 3.6, &tank8_dac)
194194   DISCRETE_555_ASTABLE_CV(NODE_93, NODE_90, RES_K(220), RES_K(39), CAP_U(0.22), NODE_92, &tank8_555_a)
195   DISCRETE_CRFILTER_VREF(NODE_94, 1, NODE_93, RES_K(22), CAP_U(0.001), 5.0)
195   DISCRETE_CRFILTER_VREF(NODE_94, NODE_93, RES_K(22), CAP_U(0.001), 5.0)
196196   DISCRETE_555_MSTABLE(NODE_95, 1, NODE_94, RES_K(56), CAP_U(0.1), &tank8_555_m)
197197   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR7, 1, NODE_95, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
198198
199199   DISCRETE_LOGIC_INVERT(NODE_100, TANK8_MOTOR8_EN)
200200   DISCRETE_DAC_R1(NODE_102, TANK8_MOTOR8_EN, 3.6, &tank8_dac)
201201   DISCRETE_555_ASTABLE_CV(NODE_103, NODE_100, RES_K(220), RES_K(39), CAP_U(0.22), NODE_102, &tank8_555_a)
202   DISCRETE_CRFILTER_VREF(NODE_104, 1, NODE_103, RES_K(22), CAP_U(0.001), 5.0)
202   DISCRETE_CRFILTER_VREF(NODE_104, NODE_103, RES_K(22), CAP_U(0.001), 5.0)
203203   DISCRETE_555_MSTABLE(NODE_105, 1, NODE_104, RES_K(56), CAP_U(0.1), &tank8_555_m)
204204   DISCRETE_OP_AMP_FILTER(TANK8_MOTOR8, 1, NODE_105, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &tank8_filt)
205205
r6049r6050
213213   DISCRETE_DIVIDE(NODE_111,1,TANK8_BUGLE_DATA2,7875.0)
214214   DISCRETE_SQUAREWAVE2(NODE_112,TANK8_BUGLE_EN,3.4, NODE_110, NODE_111,1.7,0)
215215   DISCRETE_RCDISC3(NODE_113,1, NODE_112, RES_K(10),RES_K(1),CAP_U(0.1), 0.5)
216   DISCRETE_CRFILTER(TANK8_BUGLE, 1, NODE_113, RES_K(47), CAP_U(.01))
216   DISCRETE_CRFILTER(TANK8_BUGLE, NODE_113, RES_K(47), CAP_U(.01))
217217
218218   /************************************************/
219219   /* Noise generator is built from 2 shift        */
r6049r6050
246246   /************************************************/
247247   DISCRETE_ADDER2(NODE_125, 1 , NODE_122, NODE_124 )
248248   DISCRETE_MULTIPLY(NODE_126, NODE_120, NODE_125 )
249   DISCRETE_RCFILTER(NODE_127, 1, NODE_126, RES_K(47), CAP_U(0.1))
249   DISCRETE_RCFILTER(NODE_127, NODE_126, RES_K(47), CAP_U(0.1))
250250   DISCRETE_ADJUSTMENT_TAG(NODE_128,
251251            1.0,            // min gain of E5
252252            1.0 + 100.0/22,      // max gain of E5 = 1 + r132/r101
src/mame/audio/mw8080bw.c
r6049r6050
8080   0,
8181   CAP_U(.001),         /* c500 */
8282   0,
83   0,
83   0, 0,
8484   12,         /* v1 */
8585   0,         /* v2 */
8686   0,         /* v3 */
r6049r6050
327327   /* 47K resistor (R601) and 0.047uF capacitor (C601)
328328       There is also a 50K pot acting as a volume control, but we output at
329329       the maximum volume as MAME has its own volume adjustment */
330   DISCRETE_CRFILTER(TORNBASE_TONE_SND_FILT, 1, TORNBASE_TONE_SND, RES_K(47), CAP_U(0.047))
330   DISCRETE_CRFILTER(TORNBASE_TONE_SND_FILT, TORNBASE_TONE_SND, RES_K(47), CAP_U(0.047))
331331
332332   /* amplify for output */
333333   DISCRETE_OUTPUT(TORNBASE_TONE_SND_FILT, 32767)
r6049r6050
554554
555555   /* The following circuits remove DC poping noises when the tone is switched in/out. */
556556   DISCRETE_CRFILTER_VREF(NODE_40,
557               1,                     /* ENAB */
558557               NODE_36,               /* IN0 */
559558               RES_K(250),               /* R311, R312, R402, R403 in parallel */
560559               CAP_U(0.1),               /* c301 */
r6049r6050
565564               2.5,                  /* INP0 - center voltage of R402, R403 */
566565               NODE_40)               /* INP1 */
567566   DISCRETE_CRFILTER(NODE_42,
568               1,                     /* ENAB */
569567               NODE_41,               /* IN0 */
570568               RES_K(56 + 390),         /* R404 + R405 */
571569               CAP_P(0.01)   )            /* C401 */
572570   DISCRETE_RCFILTER(NODE_43,
573               1,                     /* ENAB */
574571               NODE_42,               /* IN0 */
575572               RES_K(56),               /* R404 */
576573               CAP_P(4700)   )            /* C400 */
r6049r6050
653650   0,
654651   CAP_U(.001),
655652   0,
656   0,
653   0, 0,
657654   12,
658655   0,
659656   0,
r6049r6050
682679   0,
683680   CAP_U(0.22),
684681   0,
685   0,
682   0, 0,
686683   12,
687684   0,
688685   0,
r6049r6050
708705   0,
709706   0,
710707   0,
711   0,
708   0, 0,
712709   CAP_U(1),
713710   0,
714711   0,
r6049r6050
788785   DISCRETE_LFSR_NOISE(BOOTHILL_NOISE, 1, 1, 7700, 12.0, 0, 12.0/2, &midway_lfsr)
789786
790787   DISCRETE_OP_AMP_TRIG_VCA(NODE_30, BOOTHILL_LEFT_SHOT_EN, 0, 0, BOOTHILL_NOISE, 0, &boothill_shot_tvca_info)
791   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, RES_K(12), CAP_U(.01))
792   DISCRETE_RCFILTER(BOOTHILL_L_SHOT_SND, 1, NODE_31, RES_K(12) + RES_K(68), CAP_U(.0022))
788   DISCRETE_RCFILTER(NODE_31, NODE_30, RES_K(12), CAP_U(.01))
789   DISCRETE_RCFILTER(BOOTHILL_L_SHOT_SND, NODE_31, RES_K(12) + RES_K(68), CAP_U(.0022))
793790
794791   DISCRETE_OP_AMP_TRIG_VCA(NODE_35, BOOTHILL_RIGHT_SHOT_EN, 0, 0, BOOTHILL_NOISE, 0, &boothill_shot_tvca_info)
795   DISCRETE_RCFILTER(NODE_36, 1, NODE_35, RES_K(12), CAP_U(.01))
796   DISCRETE_RCFILTER(BOOTHILL_R_SHOT_SND, 1, NODE_36, RES_K(12) + RES_K(68), CAP_U(.0033))
792   DISCRETE_RCFILTER(NODE_36, NODE_35, RES_K(12), CAP_U(.01))
793   DISCRETE_RCFILTER(BOOTHILL_R_SHOT_SND, NODE_36, RES_K(12) + RES_K(68), CAP_U(.0033))
797794
798795   /************************************************
799796     * Hit sounds
800797     ************************************************/
801798   DISCRETE_OP_AMP_TRIG_VCA(NODE_40, BOOTHILL_LEFT_HIT_EN, 0, 0, BOOTHILL_NOISE, 0, &boothill_hit_tvca_info)
802   DISCRETE_RCFILTER(NODE_41, 1, NODE_40, RES_K(12), CAP_U(.033))
803   DISCRETE_RCFILTER(BOOTHILL_L_HIT_SND, 1, NODE_41, RES_K(12) + RES_K(100), CAP_U(.0033))
799   DISCRETE_RCFILTER(NODE_41, NODE_40, RES_K(12), CAP_U(.033))
800   DISCRETE_RCFILTER(BOOTHILL_L_HIT_SND, NODE_41, RES_K(12) + RES_K(100), CAP_U(.0033))
804801
805802   DISCRETE_OP_AMP_TRIG_VCA(NODE_45, BOOTHILL_RIGHT_HIT_EN, 0, 0, BOOTHILL_NOISE, 0, &boothill_hit_tvca_info)
806   DISCRETE_RCFILTER(NODE_46, 1, NODE_45, RES_K(12), CAP_U(.0033))
807   DISCRETE_RCFILTER(BOOTHILL_R_HIT_SND, 1, NODE_46, RES_K(12) + RES_K(100), CAP_U(.0022))
803   DISCRETE_RCFILTER(NODE_46, NODE_45, RES_K(12), CAP_U(.0033))
804   DISCRETE_RCFILTER(BOOTHILL_R_HIT_SND, NODE_46, RES_K(12) + RES_K(100), CAP_U(.0022))
808805
809806   /************************************************
810807     * Combine all sound sources.
r6049r6050
933930   0,         /* r11 - not used */
934931   CAP_U(1),   /* C300 */
935932   0,         /* c2 - not used */
936   0,         /* c3 - not used */
933   0, 0,      /* c3, c4 - not used */
937934   5,         /* v1 */
938935   0,         /* v2 */
939936   0,         /* v3 */
r6049r6050
10301027
10311028   /* The following circuits remove DC poping noises when the tone is switched in/out. */
10321029   DISCRETE_CRFILTER_VREF(NODE_31,
1033               1,                     /* ENAB */
10341030               NODE_30,               /* IN0 */
10351031               RES_K(250),               /* R409, R415, R414, R413 in parallel */
10361032               CAP_U(0.1),               /* c401 */
r6049r6050
10411037               2.5,                  /* INP0 - center voltage of R413, R414 */
10421038               NODE_31)               /* INP1 */
10431039   DISCRETE_CRFILTER(NODE_33,
1044               1,                     /* ENAB */
10451040               NODE_32,               /* IN0 */
10461041               RES_K(56 + 47 + 200),      /* R412 + R408 + part of R411 */
10471042               CAP_P(0.01)   )            /* C404 */
10481043   DISCRETE_RCFILTER(CHECKMAT_TONE_SND,
1049               1,                     /* ENAB */
10501044               NODE_33,               /* IN0 */
10511045               RES_K(56),               /* R412 */
10521046               CAP_P(4700)   )            /* C403 */
r6049r6050
11321126   0,
11331127   CAP_U(0.47),
11341128   0,
1135   0,
1129   0, 0,
11361130   12,         /* v1 */
11371131   0,         /* v2 */
11381132   0,         /* v3 */
r6049r6050
12361230   DISCRETE_LFSR_NOISE(DESERTGU_NOISE, 1, 1, 7515, 12.0, 0, 12.0/2, &midway_lfsr)
12371231
12381232   DISCRETE_OP_AMP_TRIG_VCA(NODE_30, DESERTGU_RIFLE_SHOT_EN, 0, 0, DESERTGU_NOISE, 0, &desertgu_rifle_shot_tvca_info)
1239   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, RES_K(12), CAP_U(.01))
1240   DISCRETE_CRFILTER(DESERTGU_RIFLE_SHOT_SND, 1, NODE_31, RES_K(12) + RES_K(68), CAP_U(.0022))
1233   DISCRETE_RCFILTER(NODE_31, NODE_30, RES_K(12), CAP_U(.01))
1234   DISCRETE_CRFILTER(DESERTGU_RIFLE_SHOT_SND, NODE_31, RES_K(12) + RES_K(68), CAP_U(.0022))
12411235
12421236   /************************************************
12431237     * Bottle hit sound
r6049r6050
18011795   CAP_U(.015),   /* c300 */
18021796   CAP_U(.1),      /* c301 */
18031797   CAP_U(.082),   /* c302 */
1798   0,            /* no c4 */
18041799   5,         /* v1 */
18051800   5,         /* v2 */
18061801   5,         /* v3 */
r6049r6050
18421837   0,0,0,0,
18431838   CAP_U(1),      /* c201 */
18441839   0,
1845   0,
1840   0, 0,
18461841   5,         /* v1 */
18471842   0,         /* v2 */
18481843   0,         /* v3 */
r6049r6050
19091904   DISCRETE_LFSR_NOISE(CLOWNS_NOISE, 1, 1, 7700, 12.0, 0, 12.0/2, &midway_lfsr)
19101905
19111906   DISCRETE_OP_AMP_TRIG_VCA(NODE_30, CLOWNS_POP_TOP_EN, CLOWNS_POP_MIDDLE_EN, CLOWNS_POP_BOTTOM_EN, CLOWNS_NOISE, 0, &clowns_pop_tvca_info)
1912   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, RES_K(15), CAP_U(.01))
1913   DISCRETE_CRFILTER(NODE_32, 1, NODE_31, RES_K(15) + RES_K(39), CAP_U(.01))
1907   DISCRETE_RCFILTER(NODE_31, NODE_30, RES_K(15), CAP_U(.01))
1908   DISCRETE_CRFILTER(NODE_32, NODE_31, RES_K(15) + RES_K(39), CAP_U(.01))
19141909   DISCRETE_GAIN(CLOWNS_POP_SND, NODE_32, RES_K(39)/(RES_K(15) + RES_K(39)))
19151910
19161911   /************************************************
r6049r6050
20522047#define SPACWALK_R305      RES_K(3680)
20532048#define SPACWALK_R307      RES_K(20)
20542049#define SPACWALK_R308      RES_K(20)   /* not labeled but it's beside R307 */
2050#define SPACWALK_R400      RES_K(1)
2051#define SPACWALK_R401      RES_K(200)
2052#define SPACWALK_R403      RES_K(51)
2053#define SPACWALK_R404      RES_K(220)
2054#define SPACWALK_R406      RES_M(1)
2055#define SPACWALK_R407      RES_K(820)
2056#define SPACWALK_R410      RES_K(47)
2057#define SPACWALK_R411      RES_K(300)
2058#define SPACWALK_R412      RES_K(330)
2059#define SPACWALK_R413      RES_M(1)
2060#define SPACWALK_R414      RES_M(1)
2061#define SPACWALK_R416      RES_M(4.7)
2062#define SPACWALK_R417      RES_K(10)
2063#define SPACWALK_R418      RES_K(100)
20552064#define SPACWALK_R419      RES_K(2.7)
20562065#define SPACWALK_R420      RES_K(20)
20572066#define SPACWALK_R421      RES_K(11)
r6049r6050
20692078#define SPACWALK_C302      CAP_U(2.2)
20702079#define SPACWALK_C303      CAP_U(0.0047)
20712080#define SPACWALK_C304      CAP_U(0.0047)   /* not labeled but it's beside C303 */
2081#define SPACWALK_C401      CAP_U(1)
2082#define SPACWALK_C402      CAP_U(0.68)
2083#define SPACWALK_C403      CAP_U(0.0022)
2084#define SPACWALK_C451      CAP_U(0.001)
2085#define SPACWALK_C452      CAP_U(0.001)
2086#define SPACWALK_C453      CAP_U(0.001)
20722087#define SPACWALK_C602      CAP_U(1)
20732088
20742089
r6049r6050
20782093   SPACWALK_RJ3, 0, SPACWALK_R300,                  /* r5, r6, r7 */
20792094   SPACWALK_RJ3, SPACWALK_R301,                  /* r8, r9 */
20802095   SPACWALK_RJ3, SPACWALK_R302,                  /* r10, r11 */
2081   SPACWALK_C300, SPACWALK_C301, SPACWALK_C302,      /* c1, c2, c3 */
2096   SPACWALK_C300, SPACWALK_C301, SPACWALK_C302, 0,      /* c1, c2, c3, c4 */
20822097   5, 5, 5, 12,                              /* v1, v2, v3, vP */
20832098   DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
20842099   DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
r6049r6050
21012116   SPACWALK_R207,   SPACWALK_R205, 0, SPACWALK_R208,   /* r1, r2, r3, r4 */
21022117   SPACWALK_RJ3, 0, SPACWALK_R206,                  /* r5, r6, r7 */
21032118   0, 0, 0, 0               ,                  /* r8, r9, r10, r11 */
2104   SPACWALK_C201, 0, 0,                        /* c1, c2, c3 */
2119   SPACWALK_C201, 0, 0, 0,                        /* c1, c2, c3, c4 */
21052120   5, 0, 0, 12,                              /* v1, v2, v3, vP */
21062121   DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
21072122   DISC_OP_AMP_TRIGGER_FUNCTION_NONE,
r6049r6050
21112126   DISC_OP_AMP_TRIGGER_FUNCTION_NONE
21122127};
21132128
2129static const discrete_integrate_info spacwalk_sb_miss_integrate =
2130{
2131   DISC_INTEGRATE_OP_AMP_1 | DISC_OP_AMP_IS_NORTON,
2132   SPACWALK_R406, SPACWALK_R401, 0, SPACWALK_C402,   /* r1, r2, r3, c */
2133   12, 12,   /* v1, vP */
2134   0, 0, 0   /* f0, f1, f2 */
2135};
2136
2137static const discrete_op_amp_osc_info spacwalk_sb_miss_vco =
2138{
2139   DISC_OP_AMP_OSCILLATOR_VCO_3 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_SQW,
2140   SPACWALK_R407, SPACWALK_R412, SPACWALK_R410, SPACWALK_R411, SPACWALK_R413, 0, 0, 0,   /* r1, r2, r3, r4, r5, r6, r7, r8 */
2141   SPACWALK_C403, 12                                    /* c, vP */
2142};
2143
2144static const discrete_op_amp_filt_info spacwalk_sb_miss_filter =
2145{
2146   /* we use r1, not r2 because vref is taken into acount by the CRFILTER */
2147   SPACWALK_R417, 0, SPACWALK_R414, 0, SPACWALK_R416,   /* r1, r2, r3, r4, rF */
2148   SPACWALK_C451, SPACWALK_C452, 0,               /* c1, c2, c3 */
2149   0, 12, 0                                 /* vRef, vP, vN */
2150};
2151
2152static const discrete_op_amp_info spacwalk_sb_miss_amp =
2153{
2154   DISC_OP_AMP_IS_NORTON,
2155   SPACWALK_R418, SPACWALK_R404, 0, SPACWALK_R403,   /* r1, r2, r3, r4 */
2156   0,   /* c */
2157   0, 12,   /* vN, vP */
2158};
2159
21142160static const discrete_op_amp_osc_info spacwalk_spaceship_osc =
21152161{
2116   DISC_OP_AMP_OSCILLATOR_2 | DISC_OP_AMP_IS_NORTON,
2162   DISC_OP_AMP_OSCILLATOR_2 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP,
21172163   RES_K(75), RES_M(1), RES_M(6.8), RES_M(2.4), 0, 0, 0, 0,   /* r1, r2, r3, r4, r5, r6, r7, r8 */
21182164   CAP_U(2.2), 12                                    /* c, vP */
21192165};
r6049r6050
21392185 ************************************************/
21402186#define SPACWALK_SPRINGBOARD_HIT_CIRCUIT(_num)                                              \
21412187DISCRETE_RCFILTER(NODE_RELATIVE(NODE_29, _num),                                             \
2142   1,                                    /* ENAB */                              \
21432188   SPACWALK_NOISE,                           /* IN0 */                               \
21442189   RES_K(330), CAP_U(.1))                                                                  \
21452190DISCRETE_RCFILTER(NODE_RELATIVE(NODE_31, _num),                                             \
2146   1,                                    /* ENAB */                              \
21472191   NODE_RELATIVE(NODE_29, _num),               /* IN0 */                               \
21482192   RES_K(330) + RES_K(150), CAP_U(.1))                                                     \
21492193DISCRETE_OP_AMP_VCO1(NODE_RELATIVE(NODE_33, _num),   /* IC M2-3, pin 5 */                    \
r6049r6050
22022246      SPACWALK_NOISE, 0,                  /* IN0, IN1 */
22032247      &spacwalk_hit_tvca_info)
22042248   DISCRETE_RCFILTER(NODE_21,
2205      1,                              /* ENAB */
22062249      NODE_20,                        /* IN0 */
22072250      SPACWALK_R307, SPACWALK_C303)
22082251   DISCRETE_RCFILTER(SPACWALK_TARGET_HIT_SND,
2209      1,                              /* ENAB */
22102252      NODE_21,                        /* IN0 */
22112253      SPACWALK_R307 + SPACWALK_R308, SPACWALK_C304)
22122254
r6049r6050
22202262   /************************************************
22212263     * Springboard miss sound
22222264     ************************************************/
2223   DISCRETE_CONSTANT(SPACWALK_SPRINGBOARD_MISS_SND, 0)
2265   DISCRETE_RCDISC2(NODE_50,               /* voltage on C401 */
2266      SPACWALK_SPRINGBOARD_MISS_EN,         /* SWITCH */
2267      OP_AMP_NORTON_VBE, RES_2_PARALLEL(SPACWALK_R401, SPACWALK_R407),   /* INP0,RVAL0 */
2268      12.0 - .5, SPACWALK_R400,            /* INP1,RVAL1 */
2269      SPACWALK_C401)
2270   DISCRETE_INTEGRATE(NODE_51,               /* IC K4, pin 9 */
2271      NODE_50, 0,                        /* TRG0,TRG1*/
2272      &spacwalk_sb_miss_integrate)
2273   DISCRETE_OP_AMP_VCO1(NODE_52,            /* IC K4, pin 5 */
2274      1,                              /* ENAB */
2275      NODE_50,                        /* VMOD1 */
2276      &spacwalk_sb_miss_vco)
2277   DISCRETE_CRFILTER(NODE_53,
2278      NODE_52,                        /* IN0 */
2279      SPACWALK_R417, SPACWALK_C453)
2280   /* this filter type probably does not work right. I need to test it. */
2281   DISCRETE_OP_AMP_FILTER(NODE_54,            /* IC K3, pin 5 */
2282      1,                              /* ENAB */
2283      NODE_53, 0,                        /* INP0,INP1 */
2284      DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON, &spacwalk_sb_miss_filter)
2285   DISCRETE_OP_AMP(SPACWALK_SPRINGBOARD_MISS_SND,   /* IC K4, pin 10 */
2286      1,                              /* ENAB */
2287      NODE_54, NODE_51,                  /* IN0,IN1 */
2288      &spacwalk_sb_miss_amp)
22242289
22252290   /************************************************
22262291     * Space ship sound
22272292     ************************************************/
2228   DISCRETE_OP_AMP_OSCILLATOR(NODE_60,         /* 2.2uF cap near IC JK-2 */
2293   DISCRETE_OP_AMP_OSCILLATOR(NODE_60,         /* voltage on 2.2uF cap near IC JK-2 */
22292294      1,                              /* ENAB */
22302295      &spacwalk_spaceship_osc)
22312296   DISCRETE_OP_AMP_VCO1(NODE_61,            /* IC JK-2, pin 5 */
r6049r6050
22332298      NODE_60,                        /* VMOD1*/
22342299      &spacwalk_spaceship_vco)
22352300   DISCRETE_RCFILTER(NODE_62,
2236      1,                              /* ENAB */
22372301      NODE_61,                        /* IN0 */
22382302      RES_K(1), CAP_U(0.15))
22392303   DISCRETE_RCFILTER(SPACWALK_SPACE_SHIP_SND,
2240      1,                              /* ENAB */
22412304      NODE_62,                        /* IN0 */
22422305      RES_K(1) + RES_K(10), CAP_U(0.015))
22432306
r6049r6050
22962359 *
22972360 *  Shuffleboard
22982361 *
2362 *  Discrete sound emulation: Oct 2009, D.R.
2363 *
22992364 *************************************/
23002365
2301/* Noise clock was breadboarded and measured at 1210Hz */
2366 /* Discrete Sound Input Nodes */
2367#define SHUFFLE_ROLLING_1_EN      NODE_01
2368#define SHUFFLE_ROLLING_2_EN      NODE_02
2369#define SHUFFLE_ROLLING_3_EN      NODE_03
2370#define SHUFFLE_FOUL_EN            NODE_04
2371#define SHUFFLE_ROLLOVER_EN         NODE_05
2372#define SHUFFLE_CLICK_EN         NODE_06
23022373
2374/* Discrete Sound Output Nodes */
2375#define SHUFFLE_NOISE            NODE_10
2376#define SHUFFLE_ROLLING_SND         NODE_11
2377#define SHUFFLE_FOUL_SND         NODE_12
2378#define SHUFFLE_ROLLOVER_SND      NODE_13
2379#define SHUFFLE_CLICK_SND         NODE_14
23032380
2381/* Parts List - Resistors */
2382#define SHUFFLE_R300   RES_K(33)
2383#define SHUFFLE_R400   RES_K(200)
2384#define SHUFFLE_R401   RES_K(3)
2385#define SHUFFLE_R402   RES_K(5.6)
2386#define SHUFFLE_R403   RES_K(5.6)
2387#define SHUFFLE_R404   RES_M(1)
2388#define SHUFFLE_R406   RES_K(300)
2389#define SHUFFLE_R407   RES_K(680)
2390#define SHUFFLE_R408   RES_K(680)
2391#define SHUFFLE_R409   RES_K(680)
2392#define SHUFFLE_R410   RES_K(680)
2393#define SHUFFLE_R411   RES_K(680)
2394#define SHUFFLE_R412   RES_M(2.7)
2395#define SHUFFLE_R500   RES_K(300)
2396#define SHUFFLE_R503   RES_M(2.7)
2397#define SHUFFLE_R504   RES_K(680)
2398#define SHUFFLE_R505   RES_K(680)
2399#define SHUFFLE_R506   RES_K(100)
2400#define SHUFFLE_R507   RES_K(47)
2401#define SHUFFLE_R508   RES_K(47)
2402#define SHUFFLE_R509   RES_K(100)
2403#define SHUFFLE_R511   RES_M(2)
2404#define SHUFFLE_R512   RES_M(5.6)
2405#define SHUFFLE_R513   RES_K(680)
2406#define SHUFFLE_R514   RES_M(1.5)
2407#define SHUFFLE_R515   RES_M(1)
2408#define SHUFFLE_R516   RES_K(510)
2409
2410/* Parts List - Capacitors */
2411#define SHUFFLE_C300   CAP_U(0.1)
2412#define SHUFFLE_C400   CAP_U(0.1)
2413#define SHUFFLE_C401   CAP_U(1)
2414#define SHUFFLE_C402   CAP_U(1)
2415#define SHUFFLE_C403   CAP_U(1)
2416#define SHUFFLE_C404   CAP_U(0.1)
2417#define SHUFFLE_C405   CAP_U(0.1)
2418#define SHUFFLE_C500   CAP_U(0.1)
2419#define SHUFFLE_C503   CAP_U(0.0022)
2420#define SHUFFLE_C504   CAP_U(0.0022)
2421#define SHUFFLE_C505   CAP_U(0.33)
2422#define SHUFFLE_C506   CAP_U(1)
2423#define SHUFFLE_C507   CAP_U(1)
2424#define SHUFFLE_C508   CAP_U(1)
2425
2426#define SHUFFLE_HSYNC   15750   /* unmeasured */
2427#define SHUFFLE_1V      SHUFFLE_HSYNC / 2
2428#define SHUFFLE_32V      SHUFFLE_1V / 32
2429
2430
2431static const discrete_op_amp_tvca_info shuffle_rolling_tvca =
2432{
2433   SHUFFLE_R512, 0, 0, SHUFFLE_R511,               /* r1, r2, r3, r4 */
2434   RES_K(10), 0, SHUFFLE_R516,                     /* r5, r6, r7 */
2435   RES_K(10), SHUFFLE_R515,                     /* r8, r9 */
2436   RES_K(10), SHUFFLE_R514,                     /* r10, r11 */
2437   SHUFFLE_C508, SHUFFLE_C507, SHUFFLE_C506, SHUFFLE_C505,      /* c1, c2, c3, c4 */
2438   12, 12, 12, 12,                              /* v1, v2, v3, vP */
2439   0, 0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, 0,         /* f0, f1, f2, f3 */
2440   DISC_OP_AMP_TRIGGER_FUNCTION_TRG1,               /* f4 */
2441   DISC_OP_AMP_TRIGGER_FUNCTION_TRG2               /* f5 */
2442};
2443
2444static const discrete_op_amp_info shuffle_rolling_amp =
2445{
2446   DISC_OP_AMP_IS_NORTON,
2447   SHUFFLE_R513, SHUFFLE_R505, SHUFFLE_R503, SHUFFLE_R504,   /* r1, r2, r3, r4 */
2448   0,                  /* c */
2449   0, 12,               /* vN, vP */
2450};
2451
2452static const discrete_op_amp_tvca_info shuffle_foul_tvca =
2453{
2454   SHUFFLE_R412, SHUFFLE_R411, 0, SHUFFLE_R408,      /* r1, r2, r3, r4 */
2455   RES_K(1), 0, SHUFFLE_R406,                     /* r5, r6, r7 */
2456   0, 0, 0, 0,                                 /* r8, r9, r10, r11 */
2457   SHUFFLE_C404, 0, 0,   0,                        /* c1, c2, c3, c4 */
2458   5, 0, 0, 12,                              /* v1, v2, v3, vP */
2459   0, 0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, 0, 0, 0   /* f0, f1, f2, f3, f4, f5 */
2460};
2461
2462static const discrete_op_amp_tvca_info shuffle_rollover_tvca =
2463{
2464   SHUFFLE_R404, SHUFFLE_R410, 0, SHUFFLE_R407,      /* r1, r2, r3, r4 */
2465   RES_K(10), 0, SHUFFLE_R409,                     /* r5, r6, r7 */
2466   0, 0, 0, 0,                                 /* r8, r9, r10, r11 */
2467   SHUFFLE_C405, 0, 0,   0,                        /* c1, c2, c3, c4 */
2468   12, 0, 0, 12,                              /* v1, v2, v3, vP */
2469   0, 0, DISC_OP_AMP_TRIGGER_FUNCTION_TRG0, 0, 0, 0   /* f0, f1, f2, f3, f4, f5 */
2470};
2471
2472static const discrete_mixer_desc shuffle_mixer =
2473{
2474   DISC_MIXER_IS_RESISTOR,
2475   {SHUFFLE_R500, SHUFFLE_R400, SHUFFLE_R403 + SHUFFLE_R402 + SHUFFLE_R401, SHUFFLE_R300},
2476   {0},      /* r_nodes */
2477   {SHUFFLE_C500, SHUFFLE_C400, SHUFFLE_C401, SHUFFLE_C300},
2478   0, 0, 0, 0, 0 ,1      /* rI, rF, cF, cAmp, vRef, gain */
2479};
2480
2481
2482static DISCRETE_SOUND_START(shuffle)
2483   DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLING_1_EN)
2484   DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLING_2_EN)
2485   DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLING_3_EN)
2486   DISCRETE_INPUT_LOGIC(SHUFFLE_FOUL_EN)
2487   DISCRETE_INPUT_LOGIC(SHUFFLE_ROLLOVER_EN)
2488   DISCRETE_INPUTX_LOGIC(SHUFFLE_CLICK_EN, 11.5, 0, 0)
2489
2490   /* Noise clock was breadboarded and measured at 1210Hz */
2491   DISCRETE_LFSR_NOISE(SHUFFLE_NOISE,         /* IC N5, pin 10 */
2492      1, 1,                           /* ENAB, RESET */
2493      1210, 12.0, 0, 12.0 / 2, &midway_lfsr)   /* CLK,AMPL,FEED,BIAS,LFSRTB */
2494
2495   /************************************************
2496     * Shuffle rolling
2497     ************************************************/
2498   DISCRETE_OP_AMP_TRIG_VCA(NODE_20,         /* IC P3-4, pin 5 */
2499      SHUFFLE_ROLLING_1_EN, SHUFFLE_ROLLING_2_EN, SHUFFLE_ROLLING_3_EN,   /* TRG0,TRG1,TRG2 */
2500      0, 0,                           /*IN0,IN1 */
2501      &shuffle_rolling_tvca)
2502   DISCRETE_OP_AMP(NODE_21,               /* IC P3-4, pin 4 */
2503      1,                              /* ENAB */
2504      SHUFFLE_NOISE, NODE_20,               /* IN0,IN1 */
2505      &shuffle_rolling_amp)
2506   /* filter not accurate */
2507   DISCRETE_FILTER1(NODE_22, 1, NODE_21, 800, DISC_FILTER_LOWPASS)
2508   DISCRETE_GAIN(SHUFFLE_ROLLING_SND, NODE_22, .2)
2509
2510   /************************************************
2511     * Foul
2512     ************************************************/
2513   DISCRETE_SQUAREWFIX(NODE_30,            /* 32V is a guess, scan of schematic is missing actual tone value used */
2514      1, SHUFFLE_32V, DEFAULT_TTL_V_LOGIC_1, 50, DEFAULT_TTL_V_LOGIC_1 / 2, 0)   /* ENAB,FREQ,AMP,DUTY,BIAS,PHASE */
2515   DISCRETE_OP_AMP_TRIG_VCA(SHUFFLE_FOUL_SND,   /* IC M3-4, pin 5 */
2516      SHUFFLE_FOUL_EN, 0, 0,               /* TRG0,TRG1,TRG2 */
2517      NODE_30, 0,                        /*IN0,IN1 */
2518      &shuffle_foul_tvca)
2519
2520   /************************************************
2521     * Shuffle rollover
2522     ************************************************/
2523   DISCRETE_OP_AMP_TRIG_VCA(NODE_40,         /* IC M3-4, pin 4 */
2524      SHUFFLE_ROLLOVER_EN, 0, 0,            /* TRG0,TRG1,TRG2 */
2525      SHUFFLE_NOISE, 0,                  /*IN0,IN1 */
2526      &shuffle_rollover_tvca)
2527   DISCRETE_RCFILTER(NODE_41,
2528      NODE_40,                        /* IN0 */
2529      SHUFFLE_R403, SHUFFLE_C403)
2530   DISCRETE_RCFILTER(SHUFFLE_ROLLOVER_SND,
2531      NODE_41,                        /* IN0 */
2532      SHUFFLE_R403 + SHUFFLE_R402, SHUFFLE_C402)
2533
2534   /************************************************
2535     * Click
2536     ************************************************/
2537   /* filter not accurate */
2538   DISCRETE_FILTER1(NODE_50, 1, SHUFFLE_CLICK_EN, 300, DISC_FILTER_LOWPASS)
2539   DISCRETE_GAIN(SHUFFLE_CLICK_SND, NODE_50, .3)
2540
2541   /************************************************
2542     * Combine all sound sources.
2543     ************************************************/
2544   DISCRETE_MIXER4(NODE_90,
2545      1,                              /* ENAB */
2546      SHUFFLE_ROLLING_SND,
2547      SHUFFLE_FOUL_SND,
2548      SHUFFLE_ROLLOVER_SND,
2549      SHUFFLE_CLICK_SND,
2550      &shuffle_mixer)
2551   DISCRETE_OUTPUT(NODE_90, 59200)
2552DISCRETE_SOUND_END
2553
2554
23042555MACHINE_DRIVER_START( shuffle_audio )
23052556   MDRV_SPEAKER_STANDARD_MONO("mono")
2557
2558   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
2559   MDRV_SOUND_CONFIG_DISCRETE(shuffle)
2560   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
23062561MACHINE_DRIVER_END
23072562
23082563
2309WRITE8_HANDLER( shuffle_audio_1_w )
2564WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
23102565{
2311   /* if (data & 0x01)  enable CLICK (balls collide) sound */
2566   discrete_sound_w(device, SHUFFLE_CLICK_EN, (data >> 0) & 0x01);
23122567
2313   /* if (data & 0x02)  enable SHUFFLE ROLLOVER sound */
2568   discrete_sound_w(device, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
23142569
2315   sound_global_enable(space->machine, (data >> 2) & 0x01);
2570   sound_global_enable(device->machine, (data >> 2) & 0x01);
23162571
2317   /* set SHUFFLE ROLLING sound((data >> 3) & 0x07)  0, if not rolling,
2318                                                      faster rolling = higher number */
2572   discrete_sound_w(device, NODE_29, (data >> 3) & 0x07);
23192573
2574   discrete_sound_w(device, SHUFFLE_ROLLING_3_EN, (data >> 3) & 0x01);
2575   discrete_sound_w(device, SHUFFLE_ROLLING_2_EN, (data >> 4) & 0x01);
2576   discrete_sound_w(device, SHUFFLE_ROLLING_1_EN, (data >> 5) & 0x01);
2577
23202578   /* D6 and D7 are not connected */
23212579}
23222580
23232581
2324WRITE8_HANDLER( shuffle_audio_2_w )
2582WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
23252583{
2326   /* if (data & 0x01)  enable FOUL sound */
2584   discrete_sound_w(device, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
23272585
23282586   coin_counter_w(0, (data >> 1) & 0x01);
23292587
r6049r6050
23522610   /************************************************
23532611     * Filter it to be AC.
23542612     ************************************************/
2355   DISCRETE_CRFILTER(NODE_91, 1, MIDWAY_TONE_SND, RES_K(100), CAP_U(0.1))
2613   DISCRETE_CRFILTER(NODE_91, MIDWAY_TONE_SND, RES_K(100), CAP_U(0.1))
23562614
23572615   DISCRETE_OUTPUT(NODE_91, 5000)
23582616
r6049r6050
25722830   0,                           /* no r11 */
25732831   CAP_U(1),                     /* C506 */
25742832   0,                           /* no c2 */
2575   0,                           /* no c3 */
2833   0, 0,                        /* no c3, c4 */
25762834   12,                           /* v1 */
25772835   0,                           /* no v2 */
25782836   0,                           /* no v3 */
r6049r6050
26012859   0,                           /* no r11 */
26022860   CAP_U(2.2),                     /* C304 */
26032861   0,                           /* no c2 */
2604   0,                           /* no c3 */
2862   0, 0,                        /* no c3, c4 */
26052863   5,                           /* v1 */
26062864   0,                           /* no v2 */
26072865   0,                           /* no v3 */
r6049r6050
26302888   0,                           /* no r11 */
26312889   CAP_U(2.2),                     /* C400 */
26322890   0,                           /* no c2 */
2633   0,                           /* no c3 */
2891   0, 0,                        /* no c3, c4 */
26342892   12,                           /* v1 */
26352893   0,                           /* no v2 */
26362894   0,                           /* no v3 */
r6049r6050
27312989               DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON,
27322990               &spcenctr_enemy_ship_shot_filt)
27332991   DISCRETE_CRFILTER(SPCENCTR_ENEMY_SHIP_SHOT_SND,
2734               1,                           /* ENAB */
27352992               NODE_23,                     /* IN0 */
27362993               RES_K(1.8),                     /* R116 */
27372994               CAP_U(0.1) )                  /* C104 */
r6049r6050
27583015               0,                           /* MIN */
27593016               12)                           /* MAX */
27603017   DISCRETE_CRFILTER(NODE_34,
2761               1,                           /* ENAB */
27623018               SPCENCTR_NOISE,                  /* IN0 */
27633019               RES_M(1) + RES_K(330),            /* R507, R509 */
27643020               CAP_U(0.1) )                  /* C503 */
r6049r6050
28363092               0,                     /* no IN1 */
28373093               &spcenctr_explosion_tvca)
28383094   DISCRETE_RCFILTER(NODE_71,
2839               1,                     /* ENAB */
28403095               NODE_70,               /* IN0 */
28413096               RES_K(1.8),               /* R405 */
28423097               CAP_U(0.22) )            /* C401 */
28433098   DISCRETE_RCFILTER(SPCENCTR_EXPLOSION_SND,
2844               1,                     /* ENAB */
28453099               NODE_71,               /* IN0 */
28463100               RES_K(1.8) + RES_K(3.6),   /* R405 + R406 */
28473101               CAP_U(0.22) )            /* C402 */
r6049r6050
30623316   0,                           /* no r11 */
30633317   CAP_U(0.1),                     /* C1050 */
30643318   0,                           /* no c2 */
3065   0,                           /* no c3 */
3319   0, 0,                        /* no c3, c4 */
30663320   5,                           /* v1 */
30673321   0,                           /* no v2 */
30683322   0,                           /* no v3 */
r6049r6050
31023356               0,                     /* no IN1 */
31033357               &bowler_fowl_tvca)
31043358   DISCRETE_CRFILTER(BOWLER_FOWL_SND,
3105               1,                     /* ENAB */
31063359               NODE_21,               /* IN0 */
31073360               RES_K(68),               /* R1120 */
31083361               CAP_U(0.1) )            /* C1048 */
r6049r6050
34843737   0,                           /* no r11 */
34853738   CAP_U(1),                     /* C26 */
34863739   0,                           /* no c2 */
3487   0,                           /* no c3 */
3740   0, 0,                        /* no c3, c4 */
34883741   12.0 - OP_AMP_NORTON_VBE,         /* v1 */
34893742   0,                           /* no v2 */
34903743   0,                           /* no v3 */
r6049r6050
35703823   0,                           /* no r11 */
35713824   CAP_U(0.1),                     /* C14 */
35723825   0,                           /* no c2 */
3573   0,                           /* no c3 */
3826   0, 0,                        /* no c3, c4 */
35743827   5,                           /* v1 */
35753828   0,                           /* no v2 */
35763829   0,                           /* no v3 */
r6049r6050
36663919               CAP_U(0.1),                              /* C29 */           \
36673920               &invaders_thump_555)                                                \
36683921   DISCRETE_RCFILTER(INVADERS_NODE(32, _board),                                        \
3669               1,                                    /* ENAB */          \
36703922               INVADERS_NODE(31, _board),                  /* IN0 */           \
36713923               100,                                 /* R132 */          \
36723924               CAP_U(4.7) )                           /* C31 */           \
36733925   DISCRETE_RCFILTER(INVADERS_NODE(INVADERS_FLEET_SND, _board),                        \
3674               1,                                    /* ENAB */          \
36753926               INVADERS_NODE(32, _board),                  /* IN0 */           \
36763927               100 + 100,                              /* R132 + R133 */   \
36773928               CAP_U(10) )                              /* C32 */
r6049r6050
37473998               0,                                    /* no IN1 */        \
37483999               &invaders_explosion_tvca)                                           \
37494000   DISCRETE_RCFILTER(INVADERS_NODE(62, _board),                                        \
3750               1,                                    /* ENAB */          \
37514001               INVADERS_NODE(61, _board),                  /* IN0 */           \
37524002               RES_K(5.6),                              /* R84 */           \
37534003               CAP_U(0.1) )                           /* C27 */           \
37544004   DISCRETE_RCFILTER(INVADERS_NODE(INVADERS_EXPLOSION_SND, _board),                    \
3755               1,                                    /* ENAB */          \
37564005               INVADERS_NODE(62, _board),                  /* IN0 */           \
37574006               RES_K(5.6) + RES_K(6.8),                  /* R84 + R85 */     \
37584007               CAP_U(0.1) )                           /* C28 */
r6049r6050
37814030               0,                                          /* MIN */               \
37824031               12)                                          /* MAX */               \
37834032   DISCRETE_CRFILTER(INVADERS_NODE(74, _board),                                               \
3784               1,                                          /* ENAB */              \
37854033               INVADERS_NOISE,                                 /* IN0 */               \
37864034               RES_M(1) + RES_K(330),                           /* R29, R11 */          \
37874035               CAP_U(0.1) )                                 /* C57 */               \
r6049r6050
39084156#define BLUESHRK_SHARK_SND      NODE_15
39094157#define BLUESHRK_SHOT_SND      NODE_16
39104158
4159/* Parts List - Resistors */
4160#define BLUESHRK_R300   RES_M(1)
4161#define BLUESHRK_R301   RES_K(100)
4162#define BLUESHRK_R302   RES_M(1)
4163#define BLUESHRK_R303   RES_K(33)
4164#define BLUESHRK_R304   RES_K(120)
4165#define BLUESHRK_R305   RES_M(1)
4166#define BLUESHRK_R306   RES_K(470)
4167#define BLUESHRK_R307   RES_K(680)
4168#define BLUESHRK_R308   RES_M(1)
4169#define BLUESHRK_R309   RES_M(1)
4170#define BLUESHRK_R310   RES_K(680)
4171#define BLUESHRK_R311   RES_K(1)
4172#define BLUESHRK_R312   RES_K(100)
4173#define BLUESHRK_R313   RES_M(1)
4174#define BLUESHRK_R314   RES_M(1)
4175#define BLUESHRK_R315   RES_M(4.7)
4176#define BLUESHRK_R316   RES_M(2.2)
4177#define BLUESHRK_R317   RES_K(10)
4178#define BLUESHRK_R318   RES_M(1)
4179#define BLUESHRK_R319   RES_K(680)
4180#define BLUESHRK_R320   RES_M(2.7)
4181#define BLUESHRK_R321   RES_K(680)
4182#define BLUESHRK_R324   RES_K(750)
4183#define BLUESHRK_R520   RES_K(510)
4184#define BLUESHRK_R521   RES_K(22)
4185#define BLUESHRK_R529   RES_K(33)
4186#define BLUESHRK_R601   RES_K(47)
4187#define BLUESHRK_R602   RES_K(22)
4188#define BLUESHRK_R603   RES_K(39)
4189#define BLUESHRK_R604   RES_K(1)
4190#define BLUESHRK_R605   RES_M(1)
4191#define BLUESHRK_R730   RES_K(56)
39114192
3912static const discrete_555_desc blueshrk_555_H1A =
4193/* Parts List - Capacitors */
4194#define BLUESHRK_C300   CAP_U(0.1)
4195#define BLUESHRK_C301   CAP_P(470)
4196#define BLUESHRK_C302   CAP_P(470)
4197#define BLUESHRK_C303   CAP_U(0.47)
4198#define BLUESHRK_C304   CAP_U(1)
4199#define BLUESHRK_C305   CAP_U(1)
4200#define BLUESHRK_C508   CAP_U(1)
4201#define BLUESHRK_C600   CAP_U(2.2)
4202#define BLUESHRK_C602   CAP_U(0.022)
4203#define BLUESHRK_C603   CAP_U(0.01)
4204#define BLUESHRK_C604   CAP_U(0.015)
4205#define BLUESHRK_C606   CAP_U(1)
4206#define BLUESHRK_C704   CAP_U(1)
4207#define BLUESHRK_C900   CAP_U(10)
4208
4209
4210static const discrete_op_amp_osc_info blueshark_octopus_osc =
39134211{
3914   DISC_555_OUT_SQW | DISC_555_OUT_DC | DISC_555_TRIGGER_IS_LOGIC,
3915   5,            /* B+ voltage of 555 */
3916   DEFAULT_555_VALUES
4212   DISC_OP_AMP_OSCILLATOR_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_CAP,
4213   BLUESHRK_R300, BLUESHRK_R303, BLUESHRK_R301, BLUESHRK_R304, BLUESHRK_R302, 0, 0, 0,   /* r1, r2, r3, r4, r5, r6, r7, r8 */
4214   BLUESHRK_C300, 12            /*c, vP */
39174215};
39184216
4217static const discrete_op_amp_osc_info blueshark_octopus_vco =
4218{
4219   DISC_OP_AMP_OSCILLATOR_VCO_1 | DISC_OP_AMP_IS_NORTON | DISC_OP_AMP_OSCILLATOR_OUT_SQW,
4220   BLUESHRK_R305, BLUESHRK_R306, BLUESHRK_R307, BLUESHRK_R309, BLUESHRK_R308, 0, 0, 0,   /* r1, r2, r3, r4, r5, r6, r7, r8 */
4221   BLUESHRK_C301, 12            /*c, vP */
4222};
39194223
4224static const discrete_op_amp_1sht_info blueshark_octopus_oneshot =
4225{
4226   DISC_OP_AMP_1SHT_1 | DISC_OP_AMP_IS_NORTON,
4227   BLUESHRK_R315, BLUESHRK_R312, BLUESHRK_R314, BLUESHRK_R313, BLUESHRK_R316,   /* r1, r2, r3, r4, r5 */
4228   BLUESHRK_C303, BLUESHRK_C302,                                    /* c1, c2 */
4229   0, 12                                                      /* vN, vP */
4230};
4231
4232static const discrete_integrate_info blueshark_octopus_integrate =
4233{
4234   DISC_INTEGRATE_OP_AMP_1 | DISC_OP_AMP_IS_NORTON,
4235   BLUESHRK_R318, BLUESHRK_R317, 0, BLUESHRK_C304,      /* r1, r2, r3, c */
4236   12, 12,                                    /* v1, vP */
4237   0, 0, 0                                    /* f0, f1, f2 */
4238};
4239
4240static const discrete_op_amp_info blueshark_octopus_amp =
4241{
4242   DISC_OP_AMP_IS_NORTON,
4243   BLUESHRK_R310, BLUESHRK_R319, BLUESHRK_R320, BLUESHRK_R321,   /* r1, r2, r3, r4 */
4244   0, 0, 12                                          /* c, vN, vP */
4245};
4246
39204247static const discrete_555_desc blueshrk_555_H1B =
39214248{
39224249   DISC_555_OUT_ENERGY | DISC_555_OUT_DC,
r6049r6050
39284255
39294256static const discrete_mixer_desc blueshrk_mixer =
39304257{
3931   DISC_MIXER_IS_OP_AMP,
3932   { RES_K(750),
3933     1.0/(1.0/RES_K(510) + 1.0/RES_K(22)),
3934     RES_M(1),
3935     RES_K(56) },
3936   { 0 },
3937   { CAP_U(1),
3938     CAP_U(1),
3939     CAP_U(1),
3940     CAP_U(1) },
3941   0,
3942   RES_K(100),
3943   0,
3944   CAP_U(0.1),
3945   0,      /* Vref */
3946   700      /* final gain */
4258   DISC_MIXER_IS_RESISTOR,
4259   {BLUESHRK_R324, RES_2_PARALLEL(BLUESHRK_R520, BLUESHRK_R521) + BLUESHRK_R529, BLUESHRK_R604 + BLUESHRK_R605, BLUESHRK_R730},
4260   {0},   /* r_node */
4261   {BLUESHRK_C305, BLUESHRK_C508, BLUESHRK_C606, BLUESHRK_C704},
4262   0, 0, 0, BLUESHRK_C900, 0, 1   /* rI, rF, cF, cAmp, vRef, gain */
39474263};
39484264
3949
39504265static DISCRETE_SOUND_START(blueshrk)
39514266
39524267   /************************************************
39534268     * Input register mapping
39544269     ************************************************/
3955   DISCRETE_INPUT_LOGIC(BLUESHRK_OCTOPUS_EN)
4270   DISCRETE_INPUTX_LOGIC(BLUESHRK_OCTOPUS_EN, 12, 0, 0)
39564271   DISCRETE_INPUT_LOGIC(BLUESHRK_HIT_EN)
39574272   DISCRETE_INPUT_LOGIC(BLUESHRK_SHARK_EN)
39584273   DISCRETE_INPUT_LOGIC(BLUESHRK_SHOT_EN)
r6049r6050
39614276   /************************************************
39624277     * Octopus sound
39634278     ************************************************/
3964   DISCRETE_CONSTANT(BLUESHRK_OCTOPUS_SND, 0)   /* placeholder for incomplete sound */
4279   DISCRETE_OP_AMP_OSCILLATOR(NODE_20,         /* IC M5, pin 5 */
4280      1,                              /* ENAB */
4281      &blueshark_octopus_osc)
4282   DISCRETE_OP_AMP_VCO1(NODE_21,            /* IC M5, pin 10 */
4283      1,                              /* ENAB */
4284      NODE_20,                        /* VMOD1 */
4285      &blueshark_octopus_vco)
4286   DISCRETE_OP_AMP_ONESHOT(NODE_22,         /* IC J5, pin 10 */
4287      BLUESHRK_OCTOPUS_EN, &blueshark_octopus_oneshot)
4288   DISCRETE_INTEGRATE(NODE_23,               /* IC J5, pin 5 */
4289      NODE_22, 0,                        /* TRG0,TRG1 */
4290      &blueshark_octopus_integrate)
4291   DISCRETE_OP_AMP(BLUESHRK_OCTOPUS_SND,      /* IC J5, pin 4 */
4292      1,                              /* ENAB */
4293      NODE_21, NODE_23,                  /* IN0,IN1 */
4294      &blueshark_octopus_amp)
39654295
39664296   /************************************************
4297     * Shot sound
4298     ************************************************/
4299   DISCRETE_CONSTANT(BLUESHRK_SHOT_SND, 0)      /* placeholder for incomplete sound */
4300
4301   /************************************************
39674302     * Hit sound
39684303     ************************************************/
3969   /* the 555 trigger is connected to the cap, so when reset goes high, the 555 is triggered */
3970   /* but the 555_MSTABLE does not currently allow connection of the trigger to the cap */
3971   /* so we will cheat and add a pulse 1 sample wide to trigger it */
3972   DISCRETE_ONESHOT(NODE_30, BLUESHRK_HIT_EN, 1, /* 1 sample wide */ 0, DISC_ONESHOT_REDGE | DISC_ONESHOT_NORETRIG | DISC_OUT_ACTIVE_LOW)
3973   DISCRETE_555_MSTABLE(NODE_31, BLUESHRK_HIT_EN, NODE_30, RES_K(47), CAP_U(2.2), &blueshrk_555_H1A)
3974   DISCRETE_LOGIC_INVERT(NODE_32, BLUESHRK_HIT_EN)
3975   DISCRETE_COUNTER(NODE_33, 1, /*RST*/ NODE_32, /*CLK*/ NODE_31, 1, DISC_COUNT_UP, 0, DISC_CLK_ON_F_EDGE)
3976   DISCRETE_SWITCH(NODE_34, 1, NODE_33, CAP_U(0.015) + CAP_U(0.01), CAP_U(0.022))
3977   DISCRETE_555_ASTABLE(BLUESHRK_HIT_SND, BLUESHRK_HIT_EN, RES_K(22), RES_K(39), NODE_34, &blueshrk_555_H1B)
4304   DISCRETE_COUNTER(NODE_40,                     /* IC H3, pin 5 */
4305      1, BLUESHRK_HIT_EN,                        /* ENAB,RESET */
4306      FREQ_OF_555(BLUESHRK_R601, 0, BLUESHRK_C600),   /* CLK */
4307      1, DISC_COUNT_UP, 0,                     /* MAX,DIR,INIT0 */
4308      DISC_CLK_IS_FREQ)
4309   DISCRETE_SWITCH(NODE_41,               /* value of toggled caps */
4310      1,                              /* ENAB */
4311      NODE_40,                        /* SWITCH */
4312      BLUESHRK_C602 + BLUESHRK_C603,         /* INP0 - IC H3, pin 5 low */
4313      BLUESHRK_C604)                     /* INP1 - IC H3, pin 6 low  */
4314   DISCRETE_555_ASTABLE(BLUESHRK_HIT_SND,      /* IC H2, pin 2 */
4315      BLUESHRK_HIT_EN,                  /* RESET */
4316      BLUESHRK_R602, BLUESHRK_R603, NODE_41,   /* R1,R2,C */
4317      &blueshrk_555_H1B)
39784318
39794319   /************************************************
39804320     * Shark sound
r6049r6050
39824322   DISCRETE_CONSTANT(BLUESHRK_SHARK_SND, 0)   /* paceholder for incomplete sound */
39834323
39844324   /************************************************
3985     * Shot sound
3986     ************************************************/
3987   DISCRETE_CONSTANT(BLUESHRK_SHOT_SND, 0)      /* placeholder for incomplete sound */
3988
3989   /************************************************
39904325     * Combine all sound sources.
39914326     ************************************************/
3992   DISCRETE_MIXER4(NODE_91, BLUESHRK_GAME_ON_EN, BLUESHRK_OCTOPUS_SND, BLUESHRK_HIT_SND, BLUESHRK_SHARK_SND, BLUESHRK_SHOT_SND, &blueshrk_mixer)
4327   DISCRETE_MIXER4(NODE_91,
4328      BLUESHRK_GAME_ON_EN,
4329      BLUESHRK_OCTOPUS_SND,
4330      BLUESHRK_SHOT_SND,
4331      BLUESHRK_HIT_SND,
4332      BLUESHRK_SHARK_SND,
4333      &blueshrk_mixer)
39934334
3994   DISCRETE_OUTPUT(NODE_91, 1)
4335   DISCRETE_OUTPUT(NODE_91, 240000)
39954336DISCRETE_SOUND_END
39964337
39974338
r6049r6050
40074348{
40084349   discrete_sound_w(device, BLUESHRK_GAME_ON_EN, (data >> 0) & 0x01);
40094350
4010   /* discrete_sound_w(device, BLUESHRK_SHOT_EN, (data >> 1) & 0x01); */
4351   discrete_sound_w(device, BLUESHRK_SHOT_EN, (data >> 1) & 0x01);
40114352
40124353   discrete_sound_w(device, BLUESHRK_HIT_EN, (data >> 2) & 0x01);
40134354
4014   /* discrete_sound_w(device, BLUESHRK_SHARK_EN, (data >> 3) & 0x01); */
4355   discrete_sound_w(device, BLUESHRK_SHARK_EN, (data >> 3) & 0x01);
40154356
40164357   /* if (data & 0x10)  enable KILLED DIVER sound, this circuit
40174358       doesn't appear to be on the schematics */
40184359
4019   /* discrete_sound_w(device, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01); */
4360   discrete_sound_w(device, BLUESHRK_OCTOPUS_EN, (data >> 5) & 0x01);
40204361
40214362   /* D6 and D7 are not connected */
40224363}
src/mame/audio/nitedrvr.c
r6049r6050
7979   /* This adjusts the high end.                   */
8080   /* 0k = 214Hz.   250k = 4416Hz                  */
8181   /************************************************/
82   DISCRETE_RCFILTER(NODE_20, 1, NITEDRVR_MOTOR_DATA, 123037, 2.2e-6)
82   DISCRETE_RCFILTER(NODE_20, NITEDRVR_MOTOR_DATA, 123037, 2.2e-6)
8383   DISCRETE_ADJUSTMENT_TAG(NODE_21, (214.0-27.0)/12/31, (4416.0-27.0)/12/31, DISC_LOGADJ, "MOTOR")
8484   DISCRETE_MULTIPLY(NODE_22, NODE_20, NODE_21)
8585
8686   DISCRETE_MULTADD(NODE_23, NODE_22, 2, 27.0/6)   /* F1 = /12*2 = /6 */
8787   DISCRETE_SQUAREWAVE(NODE_24, 1, NODE_23, (786.7/3), 50.0, 0, 0)
88   DISCRETE_RCFILTER(NODE_25, 1, NODE_24, 10000, 1e-7)
88   DISCRETE_RCFILTER(NODE_25, NODE_24, 10000, 1e-7)
8989
9090   DISCRETE_MULTADD(NODE_26, NODE_22, 3, 27.0/4)   /* F2 = /12*3 = /4 */
9191   DISCRETE_SQUAREWAVE(NODE_27, 1, NODE_26, (786.7/3), 50.0, 0, 0)
92   DISCRETE_RCFILTER(NODE_28, 1, NODE_27, 10000, 1e-7)
92   DISCRETE_RCFILTER(NODE_28, NODE_27, 10000, 1e-7)
9393
9494   DISCRETE_MULTADD(NODE_29, NODE_22, 4, 27.0/3)   /* F3 = /12*4 = /3 */
9595   DISCRETE_SQUAREWAVE(NODE_30, 1, NODE_29, (786.7/3), 100.0/3, 0, 360.0/3)
96   DISCRETE_RCFILTER(NODE_31, 1, NODE_30, 10000, 1e-7)
96   DISCRETE_RCFILTER(NODE_31, NODE_30, 10000, 1e-7)
9797
9898   DISCRETE_ADDER3(NITEDRVR_MOTOR_SND, NITEDRVR_ATTRACT_EN, NODE_25, NODE_28, NODE_31)
9999
r6049r6050
108108   DISCRETE_LFSR_NOISE(NITEDRVR_NOISE, NITEDRVR_CRASH_EN, NITEDRVR_CRASH_EN, 15750.0/2/4, 1.0, 0, 0, &nitedrvr_lfsr)
109109
110110   DISCRETE_MULTIPLY(NODE_62, NITEDRVR_NOISE, NITEDRVR_BANG_DATA)
111   DISCRETE_RCFILTER(NITEDRVR_BANG_SND, 1, NODE_62, 545.6, 3.3e-7)
111   DISCRETE_RCFILTER(NITEDRVR_BANG_SND, NODE_62, 545.6, 3.3e-7)
112112
113113   /************************************************/
114114   /* Skid circuits ripped from other drivers      */
r6049r6050
127127   /*  the duty variance is so small we ignore it  */
128128   /************************************************/
129129   DISCRETE_INVERT(NODE_70, NITEDRVR_NOISE)
130   DISCRETE_RCFILTER(NODE_71, 1, NODE_70, 1000, 1e-5)
130   DISCRETE_RCFILTER(NODE_71, NODE_70, 1000, 1e-5)
131131   DISCRETE_MULTADD(NODE_72, NODE_71, 940.0-630.0, ((940.0-630.0)/2)+630.0)
132132   DISCRETE_SQUAREWAVE(NITEDRVR_SCREECH1_SND, NITEDRVR_SKID1_EN, NODE_72, 226.9, 31.5, 0, 0.0)
133133
src/mame/machine/scudsp.c
r6049r6050
5151******************************************************************************************/
5252#include "driver.h"
5353#include "machine/scudsp.h"
54#include "osd_cpu.h"
5554#include "sound/scsp.h"
5655
5756/*DSP macros*/
r6049r6050
420419         SET_V(((dsp_reg.pl.si) ^ (dsp_reg.acl.si)) & ((dsp_reg.pl.si) ^ (i3)) & 0x80000000);
421420         break;
422421      case 0x6:   /* AD2 */
423         i1 = COMBINE_64_32_32((INT32)dsp_reg.ph.si,dsp_reg.pl.si);
424         i2 = COMBINE_64_32_32((INT32)dsp_reg.ach.si,dsp_reg.acl.si);
422         i1 = CONCAT_64((INT32)dsp_reg.ph.si,dsp_reg.pl.si);
423         i2 = CONCAT_64((INT32)dsp_reg.ach.si,dsp_reg.acl.si);
425424         dsp_reg.alu = i1 + i2;
426425         SET_Z((dsp_reg.alu & S64(0xffffffffffff)) == 0);
427426         SET_S((dsp_reg.alu & S64(0x800000000000)) > 0);
src/mame/machine/snesdsp2.c
r6049r6050
44
55  File to handle emulation of the SNES "DSP-2" add-on chip.
66
7  Original C++ code by byuu, based on research by Overload
7  Original C++ code by byuu, based on research by Overload.
8  Byuu's code is released under GNU General Public License
9  version 2 as published by the Free Software Foundation.
10  The implementation below is released under the MAME license
11  for use in MAME, MESS and derivatives by permission of the
12  author
813
9  MAME/MESS C conversion by etabeta
10
1114***************************************************************************/
1215
1316static int DSP2_waiting_for_command = 0;
src/mame/machine/snes7110.c
r6049r6050
1/***************************************************************************
2
3  snes7110.c
4
5  File to handle emulation of the SNES "SPC7110" add-on chip.
6
7  Based on C++ implementation by Byuu in BSNES.
8
9  Byuu's code is released under GNU General Public License
10  version 2 as published by the Free Software Foundation.
11  The implementation below is released under the MAME license
12  for use in MAME, MESS and derivatives by permission of the
13  author
14
15***************************************************************************/
16
17
118static const UINT32 spc7110_decomp_buffer_size = 64;
219
320static const UINT8 spc7110_evolution_table[53][4] =
src/mame/machine/snessdd1.c
r6049r6050
1/***************************************************************************
2
3  snessdd1.c
4
5  File to handle emulation of the SNES "S-DD1" add-on chip.
6
7  Based on Andreas Naive Public Domain code.
8
9***************************************************************************/
10
111static UINT8 sdd1_read(running_machine* machine, UINT32 addr);
212
313typedef struct //Input Manager
src/mame/machine/snesobc1.c
r6049r6050
44
55  File to handle emulation of the SNES "OBC-1" add-on chip.
66
7  Original C++ code by byuu
7  Original C++ code by byuu.
8  Byuu's code is released under GNU General Public License
9  version 2 as published by the Free Software Foundation.
10  The implementation below is released under the MAME license
11  for use in MAME, MESS and derivatives by permission of the author.
812
9  MAME/MESS C conversion by etabeta
10
1113***************************************************************************/
1214
1315#include "includes/snes.h"
src/mame/machine/snesrtc.c
r6049r6050
1/***************************************************************************
2
3  snessdd1.c
4
5  File to handle emulation of the SNES "S-RTC" add-on chip.
6
7  Based on C++ implementation by Byuu in BSNES.
8
9  Byuu's code is released under GNU General Public License
10  version 2 as published by the Free Software Foundation.
11  The implementation below is released under the MAME license
12  for use in MAME, MESS and derivatives by permission of the
13  author
14
15***************************************************************************/
16
117enum
218{
319   RTCM_Ready,
src/mame/machine/snesst10.c
r6049r6050
88    Overload and Feather.
99    This implementation is based on byuu's BSNES C++ version
1010
11    Byuu's code is released under GNU General Public License
12    version 2 as published by the Free Software Foundation.
13    The implementation below is released under the MAME license
14    for use in MAME, MESS and derivatives by permission of the author.
15
1116***************************************************************************/
1217
1318typedef struct
src/mame/machine/arkanoid.c
r6049r6050
141141Bootlegs stuff
142142
143143The bootlegs simulate the missing MCU behaviour with writes to 0xd018 and reads value back from 0xf002.
144Fortunately, 'arkangc', 'arkbloc2' and 'arkblock' has patched code not to bother with that.
144Fortunately, 'arkangc', 'arkangc2', 'block2', 'arkbloc2' and 'arkblock' has patched code not to bother with that.
145145So I've fixed 'arkbl3' and 'paddle2' to return the expected values (code is strongly similar).
146However, 'block2' is the only bootleg that writes some values to 0xd018 and reads them back from 0xf000.
146147
147148Some bootlegs also test some bits from 0xd008 after reading the paddle value at 0xd018.
148149Their effect is completely unknown but I need to set some bits to 1 so the games are playable :
r6049r6050
155156           . you can use the "fire" button (the game never shoots)
156157           . you are awarded points as in a normal game
157158           . sounds are played
159  - 'block2' :
160       * bit 1 must be set to 1 or you enter sort of endless "demo mode" when you start :
161           . you can't control the paddle (it automoves by following the ball)
162           . you can use the "fire" button (the game never shoots)
163           . you are awarded points as in a normal game
164           . sounds are played
158165  - 'arkblock' : NO read from 0xd008 !
159166  - 'arkbloc2' :
160167       * bit 5 must sometimes be set to 1 or you can't reach right side of the screen
r6049r6050
183190*/
184191
185192
193#define LOG_F000_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f000_r - cmd = %02x - val = %02x\n",cpu_get_pc(space->cpu),arkanoid_bootleg_cmd,arkanoid_bootleg_val);
186194#define LOG_F002_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_f002_r - cmd = %02x - val = %02x\n",cpu_get_pc(space->cpu),arkanoid_bootleg_cmd,arkanoid_bootleg_val);
187195#define LOG_D018_W if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - cmd = %02x\n",cpu_get_pc(space->cpu),data,arkanoid_bootleg_cmd);
188196#define LOG_D008_R if (ARKANOID_BOOTLEG_VERBOSE) logerror("%04x: arkanoid_bootleg_d008_r - val = %02x\n",cpu_get_pc(space->cpu),arkanoid_bootleg_d008_val);
r6049r6050
191199static UINT8 arkanoid_bootleg_cmd;
192200
193201/* Kludge for some bootlegs that read this address */
202READ8_HANDLER( arkanoid_bootleg_f000_r )
203{
204   UINT8 arkanoid_bootleg_val = 0x00;
205
206   switch (arkanoid_bootleg_id)
207   {
208      case ARKANGC:   /* There are no reads from 0xf000 in these bootlegs */
209      case ARKBLOCK:
210      case ARKANGC2:
211      case ARKBLOC2:
212      case ARKGCBL:
213      case PADDLE2:
214         switch (arkanoid_bootleg_cmd)
215         {
216            default:
217               break;
218         }
219         LOG_F000_R
220         break;
221      case BLOCK2:
222         switch (arkanoid_bootleg_cmd)
223         {
224            case 0x05:  /* Check 1 */
225               arkanoid_bootleg_val = 0x05;
226               break;
227            case 0x0a:  /* Check 2 */
228               arkanoid_bootleg_val = 0x0a;
229               break;
230            default:
231               break;
232         }
233         LOG_F000_R
234         break;
235      default:
236         logerror("%04x: arkanoid_bootleg_f000_r - cmd = %02x - unknown bootleg !\n",cpu_get_pc(space->cpu),arkanoid_bootleg_cmd);
237         break;
238   }
239
240   return arkanoid_bootleg_val;
241}
242
243/* Kludge for some bootlegs that read this address */
194244READ8_HANDLER( arkanoid_bootleg_f002_r )
195245{
196246   UINT8 arkanoid_bootleg_val = 0x00;
r6049r6050
206256         }
207257         LOG_F002_R
208258         break;
209      case ARKANGC2:  /* There are no reads from 0xf002 in this bootleg */
259      case ARKANGC2:  /* There are no reads from 0xf002 in these bootlegs */
260      case BLOCK2:
210261         switch (arkanoid_bootleg_cmd)
211262         {
212263            default:
r6049r6050
360411         }
361412         LOG_D018_W
362413         break;
414      case BLOCK2:
415         switch (data)
416         {
417            case 0x05:  /* Check 1 */
418               if (cpu_get_pc(space->cpu) == 0x0363)
419                  arkanoid_bootleg_cmd = 0x05;
420               break;
421            case 0x0a:  /* Check 2 */
422               if (cpu_get_pc(space->cpu) == 0x0372)
423                  arkanoid_bootleg_cmd = 0x0a;
424               break;
425            default:
426               arkanoid_bootleg_cmd = 0x00;
427               break;
428         }
429         LOG_D018_W
430         break;
363431      case ARKBLOC2:
364432         switch (data)
365433         {
r6049r6050
507575         }
508576         LOG_D018_W
509577         break;
578
510579      default:
511580         logerror("%04x: arkanoid_bootleg_d018_w - data = %02x - unknown bootleg !\n",cpu_get_pc(space->cpu),data);
512581         break;
513582   }
514583}
515584
585READ8_HANDLER( block2_bootleg_f000_r )
586{
587   return arkanoid_bootleg_cmd;
588}
589
516590/* Kludge for some bootlegs that read this address */
517591READ8_HANDLER( arkanoid_bootleg_d008_r )
518592{
r6049r6050
534608         arkanoid_bootleg_d008_bit[5] = 0;  /* untested bit */
535609         break;
536610      case ARKANGC2:
611      case BLOCK2:
537612         arkanoid_bootleg_d008_bit[0] = 0;  /* untested bit */
538613         arkanoid_bootleg_d008_bit[1] = 1;  /* check code at 0x0cad */
539614         arkanoid_bootleg_d008_bit[2] = 0;  /* untested bit */
src/mame/mamedriv.c
r6049r6050
174174   DRIVER( streakng )   /* [1980] Shoei */
175175   DRIVER( pacmanbl )   /* bootleg */
176176   DRIVER( pacmanbla )   /* bootleg */
177   DRIVER( phoenxp2 )   /* bootleg */
178   DRIVER( atlantisb )   /* bootleg */
177179   DRIVER( devilfsg )   /* (c) 1984 Vision / Artic (bootleg?) */
178180   DRIVER( zigzag )   /* (c) 1982 LAX */
179181   DRIVER( zigzag2 )   /* (c) 1982 LAX */
r6049r6050
17591761   DRIVER( arkbloc2 )   /* bootleg */
17601762   DRIVER( arkgcbl )   /* bootleg */
17611763   DRIVER( paddle2 )   /* bootleg */
1764   DRIVER( block2 )   /* bootleg */
17621765   DRIVER( arkatayt )   /* bootleg */
17631766   DRIVER( arktayt2 )   /* bootleg */
17641767   DRIVER( arkatour )   /* ??? (c) 1987 Taito America Corporation + Romstar license (US) */
r6049r6050
18891892   /* Taito H-System games */
18901893   DRIVER( syvalion )   /* B51 (c) 1988 Taito Corporation (Japan) */
18911894   DRIVER( recordbr )   /* B56 (c) 1988 Taito Corporation Japan (World) */
1895   DRIVER( gogold )   /* B56 (c) 1988 Taito Corporation (Japan) */
18921896   DRIVER( dleague )   /* C02 (c) 1990 Taito Corporation (Japan) */
18931897
18941898   /* Taito B-System games */
r6049r6050
35173521   DRIVER( astrob2 )   /* (c) 1981 */
35183522   DRIVER( astrob2a )   /* (c) 1981 */
35193523   DRIVER( astrob1 )   /* (c) 1981 */
3524   DRIVER( astrode )   /* (c) 1981 */
35203525   DRIVER( 005 )      /* (c) 1981 */
35213526   DRIVER( monsterb )   /* (c) 1982 */
35223527   DRIVER( monsterb2 )   /* (c) 1982 */
r6049r6050
40744079   DRIVER( sanjeon )   /* 1999.04 Sanjun Sujun (Sega / Deniam) */
40754080   DRIVER( danchih )   /* 1999.06 Danchi de Hanafuda Okusan Komeya Desuyo! (Altron (Tecmo License)) */
40764081   DRIVER( ffreveng )   /* 1999.09 Final Fight Revenge (Capcom) */
4077                  /* 2000.12 Danchi de Quiz Okusan Yontaku Desuyo! (Altron) */
4082   DRIVER( danchiq )   /* 2000.12 Danchi de Quiz Okusan Yontaku Desuyo! (Altron) */
40784083
40794084   /* Sega Model 2 Games */
40804085
r6049r6050
91529157   DRIVER( 4roses )   /* (c) 1999 Unknown */
91539158   DRIVER( 4rosesa )   /* (c) 1999 Unknown */
91549159   DRIVER( big10 )      /* (c) 198? Unknown */
9155   DRIVER( bingor1 )   /* (c) 198? Unknown */
9156   DRIVER( bingor2 )   /* (c) 198? Unknown */
9157   DRIVER( bingor3 )   /* (c) 198? Unknown */
9158   DRIVER( bingor4 )   /* (c) 198? Unknown */
9160   DRIVER( bingor1 )   /* (c) 2002 Unknown */
9161   DRIVER( bingor2 )   /* (c) 2002 Unknown */
9162   DRIVER( bingor3 )   /* (c) 2002 Unknown */
9163   DRIVER( bingor4 )   /* (c) 2002 Unknown */
9164   DRIVER( bingor5 )   /* (c) 2002 Unknown */
91599165
91609166   /* InterFlip / Recreativos Franco */
91619167   DRIVER( videopkr )   /* (c) 1984 InterFlip */
r6049r6050
95479553   /* Hi-Soft */
95489554   DRIVER( himesiki )   /* (c) 1989 Hi-Soft */
95499555
9550   /* Hi-Lo Poker-based */
9551   DRIVER( gtipoker )   /* (c) 1983 GTI Inc */
9556   /* Draw Poker Hi-Lo based */
95529557   DRIVER( norautp )   /* (c) 1988? Noraut Ltd */
95539558   DRIVER( norautjp )   /* (c) 1988? Noraut Ltd */
95549559   DRIVER( norautrh )   /* (c) 1988? Noraut Ltd */
95559560   DRIVER( norautu )   /* (c) 1988? Noraut Ltd */
95569561   DRIVER( norautv3 )   /* (c) 1988? Noraut Ltd */
95579562   DRIVER( norautpn )   /* (c) 1990? unknown */
9563   DRIVER( pma )      /* PMA */
9564   DRIVER( dphl )      /* (c) M. Kramer Inc. 1983 */
9565   DRIVER( dphla )      /* unknown */
9566   DRIVER( gtipoker )   /* (c) 1983 GTI Inc */
9567   DRIVER( tpoker2 )   /* (c) 1993 Micro Manufacturing, Inc. */
95589568
95599569   /* Sanki Denshi Kogyo */
95609570   DRIVER( pachifev )   /* (c) 1983? */
r6049r6050
95869596   //DRIVER( mfish_8 ) /* (c) 2002 */
95879597   //DRIVER( mfish_9 ) /* (c) 2002 */
95889598   //DRIVER( mfish_10 )    /* (c) 2002 */
9589   //DRIVER( mfish_11 )    /* (c) 2002 */
9599   DRIVER( mfish_11 )   /* (c) 2002 */
95909600   DRIVER( mfish_12 )   /* (c) 2002 */
95919601   DRIVER( mfish_12a )   /* (c) 2002 */
95929602   //DRIVER( mfish_13 )    /* (c) 2002 */
r6049r6050
96389648   //DRIVER( garage_3 )    /* (c) 2004 */
96399649   DRIVER( garage_4 )   /* (c) 2004 */
96409650   DRIVER( garage_4a )   /* (c) 2004 */
9651   DRIVER( garage_4b )   /* (c) 2004 */
96419652   DRIVER( garage_5 )   /* (c) 2004 */
96429653   DRIVER( garage_5a )   /* (c) 2004 */
96439654
r6049r6050
96519662   /* Sweet Life */
96529663   DRIVER( sweetl )   /* (c) 2004 */
96539664   DRIVER( sweetla )   /* (c) 2004 */
9665   DRIVER( sweetlb )   /* (c) 2004 */
96549666
96559667   /* Resident */
96569668   //DRIVER( resdnt )  /* (c) 2004 */
r6049r6050
96639675
96649676   /* Pirate */
96659677   //DRIVER( pirate )  /* (c) 2005 */
9666   DRIVER( pirate_1 )   /* (c) 2005 */
9667   //DRIVER( pirate_2 )/* (c) 2005 */
9678   DRIVER( pirate_2 )   /* (c) 2005 */
9679   DRIVER( pirate_3 )   /* (c) 2005 */
96689680
9681   /* Pirate 2 */
9682   DRIVER( pirate2 )   /* (c) 2006 */
9683   DRIVER( pirate2a )   /* (c) 2006 */
9684   DRIVER( pirate2b )   /* (c) 2006 */
9685   DRIVER( pirate2c )   /* (c) 2006 */
9686   DRIVER( pirate2d )   /* (c) 2006 */
9687   DRIVER( pirate2e )   /* (c) 2006 */
9688
96699689   /* Island 2 */
96709690   DRIVER( island2 )   /* (c) 2006 */
96719691   DRIVER( island2a )   /* (c) 2006 */
r6049r6050
96749694   DRIVER( keks )      /* (c) 2006 */
96759695   DRIVER( keksa )      /* (c) 2006 */
96769696   DRIVER( keksb )      /* (c) 2006 */
9697   DRIVER( keksc )      /* (c) 2006 */
96779698   DRIVER( keks_2 )   /* (c) 2006 */
96789699   DRIVER( keks_2a )   /* (c) 2006 */
9700   DRIVER( keks_2b )   /* (c) 2006 */
96799701
96809702/* Drivers below are mechanical games, usually with no video display, requiring external artwork to function.
96819703       These are currently mostly 'fruit machine' style games, although this may later be extended to system logic
src/mame/includes/mw8080bw.h
r6049r6050
147147WRITE8_DEVICE_HANDLER( spacwalk_audio_2_w );
148148
149149MACHINE_DRIVER_EXTERN( shuffle_audio );
150WRITE8_HANDLER( shuffle_audio_1_w );
151WRITE8_HANDLER( shuffle_audio_2_w );
150WRITE8_DEVICE_HANDLER( shuffle_audio_1_w );
151WRITE8_DEVICE_HANDLER( shuffle_audio_2_w );
152152
153153MACHINE_DRIVER_EXTERN( dogpatch_audio );
154154WRITE8_HANDLER( dogpatch_audio_w );
src/mame/includes/arkanoid.h
r6049r6050
33   ARKUNK=0,  /* unknown bootlegs for inclusion of possible new sets */
44   ARKANGC,
55   ARKANGC2,
6   BLOCK2,
67   ARKBLOCK,
78   ARKBLOC2,
89   ARKGCBL,
r6049r6050
4748extern CUSTOM_INPUT( arkanoid_68705_input_r );
4849extern CUSTOM_INPUT( arkanoid_input_mux );
4950
51extern READ8_HANDLER( arkanoid_bootleg_f000_r );
5052extern READ8_HANDLER( arkanoid_bootleg_f002_r );
5153extern WRITE8_HANDLER( arkanoid_bootleg_d018_w );
5254extern READ8_HANDLER( arkanoid_bootleg_d008_r );
src/mame/includes/genesis.h
r6049r6050
11/* Todo, reorganise, cleanup etc.*/
22
3/*----------- defined in drivers/megaplay.c -----------*/
4
5extern UINT16 *ic36_ram;
6extern UINT8 bios_6204;
7extern UINT8 bios_ctrl[6];
8
9/*----------- defined in drivers/megatech.c -----------*/
10
11extern UINT32 bios_ctrl_inputs;
12
13/*----------- defined in drivers/genesis.c -----------*/
14
15extern UINT8 *genesis_z80_ram;
16extern UINT16 *genesis_68k_ram;
17extern MACHINE_START( genesis );
18extern MACHINE_RESET( genesis );
19extern WRITE16_HANDLER ( genesis_io_w );
20extern UINT16 *genesis_io_ram;
21extern READ16_HANDLER(genesis_ctrl_r);
22extern READ16_HANDLER ( megaplay_68k_to_z80_r );
23extern READ8_HANDLER ( genesis_z80_r );
24extern READ8_HANDLER ( genesis_z80_bank_r );
25extern WRITE8_HANDLER ( genesis_z80_w );
26extern WRITE16_HANDLER(genesis_ctrl_w);
27extern WRITE16_HANDLER ( genesis_68k_to_z80_w );
28extern READ16_HANDLER ( genesis_68k_to_z80_r );
29extern INTERRUPT_GEN( genesis_vblank_interrupt );
30extern void genesis_irq2_interrupt(const device_config *device, int state);
31
323/*----------- defined in video/genesis.c -----------*/
334
345extern UINT8      genesis_vdp_regs[];
r6049r6050
367extern UINT16      genesis_sp_pal_lookup[];
378
389VIDEO_START( genesis );
39VIDEO_START( segac2 );
4010
4111VIDEO_UPDATE( genesis );
42VIDEO_UPDATE( segac2 );
43VIDEO_UPDATE( megaplay );
4412
45void segac2_enable_display(running_machine *machine, int enable);
46
4713void system18_vdp_start(running_machine *machine);
4814void system18_vdp_update(bitmap_t *bitmap, const rectangle *cliprect);
4915
src/mame/mame.mak
r6049r6050
11031103   $(DRIVERS)/coolridr.o \
11041104   $(DRIVERS)/deniam.o $(VIDEO)/deniam.o \
11051105   $(DRIVERS)/dotrikun.o $(VIDEO)/dotrikun.o \
1106   $(DRIVERS)/genesis.o $(VIDEO)/genesis.o \
1106   $(VIDEO)/genesis.o \
11071107   $(DRIVERS)/gpworld.o \
11081108   $(DRIVERS)/hikaru.o \
11091109   $(DRIVERS)/hshavoc.o \
src/mame/video/vdc.c
r6049r6050
77#define STATE_VDW      2
88#define STATE_VCR      3
99
10/* todo: replace this with the PAIR structure from 'osd_cpu.h' */
10/* todo: replace this with the PAIR structure */
1111typedef union
1212{
1313#ifdef LSB_FIRST
src/mame/video/atari.c
r6049r6050
15121512         gtia.r.but[i] &= (button_port >> i) & 1;
15131513      }
15141514
1515      /* button registers for xl/xe */
1516      if (button_count == 2)
1517      {
1518         gtia.r.but[2] = 1; /* not used on xl/xe */
1519         gtia.r.but[3] = 0; /* 1 if external cartridge is inserted */
1520      }
1515      /* specify buttons not relevant to this Atari variant */
1516      for (i = button_count; i < 4; i++)
1517         gtia.r.but[i] = 1;
15211518
15221519      handle_keyboard(machine);
15231520
src/mame/drivers/norautp.c
r6049r6050
88
99  Games running on this hardware:
1010
11  -- Z80 based --
12
1113   * Noraut Poker,                 1988,  Noraut Ltd.
1214   * Noraut Joker Poker,           1988,  Noraut Ltd.
1315   * Noraut Red Hot Joker Poker,   1988,  Noraut Ltd.
1416   * Noraut Poker (NTX10A),        1988,  Noraut Ltd.
1517   * Noraut Joker Poker (V3.010a), 1988,  Noraut Ltd.
16   * GTI Poker,                    1983,  GTI Inc.
1718   * Noraut Poker (bootleg),       198?,  Unknown.
19   * PMA Poker,                    198?,  PMA.
1820
21  -- 8080A based --
1922
23   * Draw Poker Hi-Lo,             1983,  M. Kramer Manufacturing.
24   * Draw Poker Hi-Lo (alt),       1983,  Unknown.
25   * GTI Poker,                    1983,  GTI Inc.
26   * Turbo Poker 2,                1993,  Micro Manufacturing, Inc.
27
28
29  This hardware emulation opened a big can of worms. :)
30  You can see the legal issues in the following link:
31  http://www.altlaw.org/v1/cases/533481
32
2033  Special thanks to Alan Griffin, that kindly helped providing good references
21  that allowed me to improve the system emulation.
34  that allowed me to improve the Noraut system emulation.
2235
2336
2437*******************************************************************************
r6049r6050
389402
390403
391404*******************************************************************************
405*******************************************************************************
392406
393407
408  Draw Poker Hi-Lo (1983).
409  "NYMF O II" hardware.
410  M. Kramer Inc.
411
412  PCB layout (Draw Poker Hi-Lo)
413   ___________________________________________________________________________
414  |  _________                       ______                                   |
415  | |HCF4093BE|           SN74174N  | U51  |  NE555P  916C472X2PE  ULN2003A   |
416  | |         |                     |______|                                  |
417  | |         |                                                               |
418  | |MC14040  |  74123N   SN74157N            74161N  SN7486N      ULN2003A   |
419  | |         |                                                               |
420  | |         |                                                               |
421  | |MWS5101  |  SN7404N  SN74166N  898-1-R   74161N               ULN2003A   |__
422  | |         |                                                                __|
423  | |         |            ______    _______                     ___________   __|
424  | |5101E-1  |           | U31  |  |DIP-SW | 74161N  SN74157N  |AM8255 APC |  __|
425  | |_________|           |______|  |_______|                   |___________|  __|
426  |   ______                                                     ___________   __|
427  |  | U26  |             2111A-2   2111A-2   74161N  SN74157N  | U20       |  __|
428  |  |______|                                                   |___________|  __|
429  |   ______     ______    ___________                                         __|
430  |  | U19  |   | U18  |  |AM8255 APC |       74161N  SN74157N     898-1-R     __|
431  |  |______|   |______|  |___________|                                        __|
432  |              ______    __________                                         |
433  |  74LS541N   | U12  |  |i D8228   |   OSC  74161N  SN7486N      SN7404N    |
434  |             |______|  |__________|                                        |
435  |              __________                                                   |
436  |  DM7405N    |i P8080A  |     SN74LS155AN  iP8224  SN74157N 7411N 7474PC   |
437  |             |__________|                                                  |
438  |___________________________________________________________________________|
439
440  OSC = 18.14 MHz
441
442  U12 = AM2732
443  U18 = AM2732
444  U31 = AM2732A
445  U51 = N82S129N
446
447  U26, U19, U20 = unpopulated
448
449  Edge connector is not JAMMA
450
451
452*******************************************************************************
453
454
455  Hardware Layout (Draw Poker Hi-Lo (alt)):
456
457  Board layout/pcb tracks almost Identical to NORAUT boards.
458
459  - CPU:             1x INTEL P8080A : L1087022 : INTEL '79.
460  - RAM:             4x 2111A-2 Static Random Access Memory 256 x 4 bit.
461  - I/O:             3x 8255 Peripeheral Interface Adapter.
462  - Prg ROMs:        2x 2716 U11,U16 Eprom.
463  - Gfx ROMs:        1x 2716 U27 Eprom :EXACT MATCH WITH NORAUT V3010A CHAR ROM.
464  - Sound:           Discrete.
465  - Crystal:         1x 18.000 MHz.
466
467  PCB silksceened: REV A.
468  PCB MARKED: Solderside "81 16".
469  Component side "J3 018".
470
471  U11 2716 EPROM MARKED:"2B27".
472  U16 2716 EPROM MARKED:"4D30".
473
474  Frequency measured on CPU P8080A (pins 15 & 22) = 2.00056 MHz.
475
476  No date information found on PCB or in Roms.
477  Some dates found on some of the IC's
478  U6: 1979 :SOLDERED TO BOARD
479  U10:1975 :SOLDERED TO BOARD
480  U15:1979 :SOLDERED TO BOARD
481  U23:1981 :IN SOCKET
482  U27:1977 :IN SOCKET
483
484
485
486  PCB Layout (Draw Poker Hi-Lo (alt)):                                        Edge Connector 36x2
487   ______________________________________________________________________________________________
488  |                         _________    _________    _____        .........     _________       |
489  |                        |74LS174N |  |74LS153N |  |NE555|       .........    |ULN2003A |      |
490  |       NO IC            |_________|  |_________|  |_____|       16-2-472     |_________|      |
491  |        U46                 U45          U44        U43            U42          U41           |
492  |                                                                                              |
493  |                                                                                              |
494  |                         _________    _________    _________    _________     _________       |
495  |                        |74LS157N |  | 74153N  |  | 74161N  |  |  7486N  |   |ULN2003A |      |
496  |       NO IC            |_________|  |_________|  |_________|  |_________|   |_________|      |
497  |        U40                 U39          U38          U37          U36           U35          |
498  |                                                                                              |
499  |                                                                                              | 36
500  |  _________              _________   916C471X2PE   _________    _________     _________       |___
501  | |  7404N  |            | 74166N  |   .........   | 74161N  |  | 74153N  |   |ULN2003A |       ___|
502  | |_________|            |_________|   .........   |_________|  |_________|   |_________|       ___|
503  |     U34                    U33          U32          U31          U30           U29           ___|
504  |                                   DIP SW x 8                               ________________   ___|
505  |               _____________    _______________    _________    _________  |                |  ___|
506  |  _________   |             |  |1|2|3|4|5|6|7|8|  | 74161N  |  | 74157N  | |    P8255A-5    |  ___|
507  | | 2111A-2 |  |    2716     |  |_|_|_|_|_|_|_|_|  |_________|  |_________| |________________|  ___|
508  | |_________|  |_____________|         U26             U25          U24            U23          ___|
509  |     U28            U27                                                                        ___|
510  |                                                                            ________________   ___|
511  |                                                                           |                |  ___|
512  |  _________        _________       _________       _________    _________  |    D8255AC-5   |  ___|
513  | | 2111A-2 |      | 2111A-2 |     | 2111A-2 |     | 74161N  |  | 74157N  | |________________|  ___|
514  | |_________|      |_________|     |_________|     |_________|  |_________|        U17          ___|
515  |     U22              U21             U20             U19          U18                         ___|
516  |                                                                                               ___|
517  |  ______________       ________________                                                        ___|
518  | |              |     |                |           _________    _________     916C471X2PE      ___|
519  | |     2716     |     |   AM8255A PC   |          | 74161N  |  | 74157N  |     .........       ___|
520  | |______________|     |________________|          |_________|  |_________|     .........       ___|
521  |       U16                   U15                      U14          U13            U12          ___|
522  |                                                                                              |
523  |  ______________         ____________       _________       _________        _________        | 01
524  | |              |       |            |     | 74161N  |     | 7486N   |      |  7404N  |       |
525  | |     2716     |       |  i P8228   |     |_________|     |_________|      |_________|       |
526  | |______________|       |____________|         U9              U8               U7            |
527  |       U11                   U10           XTAL                                               |
528  |                                          .----. 18Mhz                                        |
529  |  ____________________     __________      _________    _________    _________    _________   |
530  | |                    |   |  74155N  |    | i P8224 |  | 74157N  |  |  7411N  |  |  7474N  |  |
531  | |     i P8080A       |   |__________|    |_________|  |_________|  |_________|  |_________|  |
532  | |____________________|        U5              U4           U3           U2           U1      |
533  |           U6                                                                                 |
534  |______________________________________________________________________________________________|
535
536
537
538  Noraut old Draw Poker Hi-Lo discrete audio circuitry
539  ----------------------------------------------------
540
541  3x ULN2003A (Darlington transistor array)
542  1x NE555P   (Timer)
543  1x F 2N4401 (NPN General Purpose Amplifier)
544
545
546  .------.                              .------------.              .-------.
547  |  U17 |                              |   NE555P   |              |2N4401 |
548  |      |                             4|            |3     R3      |       |
549  |   PC7|------------------------------|RST      OUT|-----ZZZZ-----|B     E|-------> Audio Out.
550  |   PC6|----------.                  6|            |8             |   C   |
551  |   PC5|-----.    |3-in         .-----|THR      VCC|-----------.  '---+---'  .----> Audio Out.
552  |   PC4|--.  |  .-+------.      |    5|            |7          |      |      |
553  |      |  |  |  |ULN2003A|      |  .--|CVOLT   DISC|--.        |      |      |
554  |      |  |  |  '-+------'      |  |  |            |  |        +------'    --+--
555  |      |  |  |    |3-out   C1   |  |  |    GND     |  |        |            GND
556  | 8255 |  |  |    '--------||---+  |  '-----+------'  |        |             -
557  |      |  |  '--.               |  |        |1        |        |             '
558  |      |  |     |2-in           |  |        |         |        |
559  '------'  |  .--+-----.         |  |   C5   |         |        |
560            |  |ULN2003A|         |  '---||---+         |        |   +5V
561            |  '--+-----'         |           |         |        |   -+-
562            |     |2-out     C2   |      C4   |         |    C6  |    |
563            |     '----------||---+------||---+-------. | .--||--+----'
564            |2-in                 |           |       | | |      |
565          .-+------.              |         --+--      '-'       |
566          |ULN2003A|              |          GND        |        |
567          '-+------'              |           -         |        |
568            |2-out           C3   |     R1    '         |   R2   |
569            '----------------||---+----ZZZZ-------------+--ZZZZ--'
570
571
572
573  R1 = 120 K ; Tolerance +/- 5%
574  R2 = 1 K   ; Tolerance +/- 5%
575  R3 = 1 K   ; Tolerance +/- 5%
576
577  C1 = .01 Z
578  C2 = .022 Z
579  C3 = 503   ; 50.000 pf = 50 nf = 0.05 uf.
580  C4 = .01 Z
581  C5 = .01 Z
582  C6 = .1 Z
583
584
585  All Capacitors are Ceramic Disc.
586
587  ----------------------------------------------------------------------------
588
589  Ports Map:
590  ----------
591
592  U23:
593  PPI-0 (); PortA IN.
594  DIP Switches bank:
595
596  7654 3210
597  ---- ---x  * DIP switch 8
598  ---- --x-  * DIP switch 7
599  ---- -x--  * DIP switch 6
600  ---- x---  * DIP switch 5
601  ---x ----  * DIP switch 4
602  --x- ----  * DIP switch 3
603  -x-- ----  * DIP switch 2
604  x--- ----  * DIP switch 1
605
606
607*******************************************************************************
608
609
610  Hardware Layout (Turbo Poker 2 by Micro MFG):
611
612
613  - CPU:             1x NEC D8080AFC-1 (U42).
614  - BUS:             1x 8224 (U43)
615  - RAM:             2x 2111-1 Static Random Access Memory 256 x 4 bit (U33 & U34).
616  - I/O:             3x Intel P8255A Peripeheral Interface Adapter (U31, U36 & U38).
617  - Prg ROMs:        1x 27256 (U39).
618  - Gfx ROMs:        1x 2732 (U30).
619  - Sound:           Discrete.
620  - Crystal:         1x 18.000 MHz.
621
622
623  Etched in copper on board:    TP2
624
625  .U30  2732a    ; stickered  (c) 1993 MICRO MFG TURBO POKER CHAR, ROM.
626
627  .U35  unknown  ; stickered  (c) 1993 MICRO MFG TP2#01 U35\IC4 16228 022194.
628
629   Continuity errors when trying to read as a standard eprom.
630   Silkscreened below the chip 'CUSTOM I.C.'. Looks like a normal EPROM.
631
632  .U39  27256    ; stickered  (c) 1993 MICRO MFG TURBO-2 U39-014 US UTBK 022190.
633
634  .U38  8255     ; stickered  MICRO MANUFACTURING, INC.  DATE: 02-24-1994  SER# LKY-PCB-142728.
635
636  .U37  MMI PAL12L6-2  ; Blue dot on it. Saved in Jedec format.
637
638  .U44  DS1220AD-150   ; Dallas 2K x 8 CMOS nonvolatile SRAM.
639
640  .U23  82S131         ; Bipolar PROM.
641
642
643
644        27256 @U39                               Estimated U35 pinouts
645
646       .----------.                                   .----------.
647  VPP -|01      28|- VCC                         GND -|01      28|- Pin 10 of U14 (7404)
648  A12 -|02      27|- A14                         VCC -|02      27|- A7
649   A7 -|03      26|- A13                         VCC -|03      26|- A6
650   A6 -|04      25|- A8                          N/C -|04      25|- A5
651   A5 -|05      24|- A9            Pull-up to pin 02 -|05      24|- A4
652   A4 -|06      23|- A11                         VCC -|06      23|- A3
653   A3 -|07      22|- /OE                         N/C -|07      22|- A2
654   A2 -|08      21|- A10            Pin 9 of U37 PAL -|08      21|- A1
655   A1 -|09      20|- /CE            Pin 8 of U37 PAL -|09      20|- A0
656   A0 -|10      19|- D7         Pin 24 of U42 (8080) -|10      19|- D7
657   D0 -|11      18|- D6             Pin 7 of U37 PAL -|11      18|- D6
658   D1 -|12      17|- D5                           D0 -|12      17|- D5
659   D2 -|13      16|- D4                           D1 -|13      16|- D4
660  GND -|14      15|- D3                           D2 -|14      15|- D3
661       '----------'                                   '----------'
662
663
664  PCB Layout (Turbo Poker 2 by Micro MFG):                                         Edge Connector 36x2
665   ___________________________________________________________________________________________________
666  |  _________    _________    _________    _________    _________       _____      ________     _    |
667  | | 74LS161 |  | 74LS161 |  | 74LS161 |  | 74LS161 |  | 74LS161 |     | 555 |    | KA2657 |  /   \  |
668  | |_________|  |_________|  |_________|  |_________|  |_________|     |_____|    |________! | VR1 | |
669  |     U1           U2           U3           U4           U5            U6           U7      \ _ /  |
670  |                                                                                                   |
671  |  _________    _________    _________    _________    _________                  ________          |
672  | | 74LS161 |  | 74LS157 |  | 74LS157 |  | 74LS157 |  | 74LS157 |                | KA2657 |         |
673  | |_________|  |_________|  |_________|  |_________|  |_________|                |________!         |
674  |     U8           U9           U10          U11          U12                       U13             |
675  |                                                                                                   |
676  |  _________    _________    _________    _________    _________     _________    ________          | 36
677  | | 74LS04P |  | 74LS11N |  | 74LS04P |  | DV7486N |  | DV7486N |   | CTS8427 |  | KA2657 |         |___
678  | |_________|  |_________|  |_________|  |_________|  |_________|   |_________|  |________!          ___|
679  |     U14          U15          U16          U17          U18       U19 (resnet)    U20              ___|
680  |                                                                                                    ___|
681  |  _________    _________    _________       _________________       _________    _______________    ___|
682  | |  74123  |  | 74LS174 |  | 82S131N |     | PLD ?? (R dot)  |     | CTS8427 |  |1|2|3|4|5|6|7|8|   ___|
683  | |_________|  |_________|  |_________|     |_________________|     |_________|  |_|_|_|_|_|_|_|_|   ___|
684  |     U21          U22          U23                 U24             U25 (resnet)  U26 (DIP SW x 8)   ___|
685  |                                                                                                    ___|
686  |  _________    _________    _________       __________________        ________________________      ___|
687  | |  7474N  |  | 74LS157 |  | 74LS166 |     |                  |      |                        |     ___|
688  | |_________|  |_________|  |_________|     | 2732A (char ROM) |      |     Intel  P8255A      |     ___|
689  |     U27          U28          U29         |__________________|      |________________________|     ___|
690  |                                                   U30                          U31                 ___|
691  |  _________    __________   __________      ____________________      ________________________      ___|
692  | |  7474N  |  | SY2111-1 | | SY2111-1 |    |                    |    |                        |     ___|
693  | |_________|  |__________| |__________|    | Unknown custom ROM |    |     Intel  P8255A      |     ___|
694  |     U32          U33          U34         |____________________|    |________________________|     ___|
695  |                                                    U35                         U36                 ___|
696  |  _______________   ____________________    ____________________                                    ___|
697  | |PAL12L6 (B dot)| |                    |  |                    |                                   ___|
698  | |_______________| |  8255 (stickered)  |  |     27256 ROM      |                                  |
699  |       U37         |____________________|  |____________________|                  __________      | 01
700  |                           U38                    U39                             | TRW 8022 |     |
701  |  ____________     _____________________    ____________________                  |__________|     |
702  | | Intel 8224 |   |                     |  |                    |                     U45          |
703  | |____________|   |   NEC  D8080AFC-1   |  |   8224 Clock GEN   |     ___________________          |
704  |      U41         |_____________________|  |____________________|    |  Dallas DS1220AD  |         |
705  |  ______                   U42                    U43                | Non Volatile SRAM |         |
706  | | Xtal |                                                            |___________________|         |
707  | | 18MHz|                                                                     U44                  |
708  | |______|                                                                                          |
709  |___________________________________________________________________________________________________|
710
711
712
713*******************************************************************************
714
715
394716  *** Game Notes ***
395717
396718
r6049r6050
414736  ***  Memory Map  ***
415737  --------------------
416738
739
740  Noraut HW:
741
417742  0x0000 - 0x1FFF    ; ROM space.
418  0x6000 - 0x63FF    ; NVRAM.
743  0x2000 - 0x23FF    ; NVRAM.
419744
420745  0x60 - 0x63        ; PPI 8255 0 - DIP Switches, lamps & counters.
421746  0xA0 - 0xA3        ; PPI 8255 1 - Regular Inputs, sound lines & remaining lamps.
422747  0xC0 - 0xC3        ; PPI 8255 2 - Video RAM access & other stuff.
423748
424749
750  DPHL HW:
751
752  0x0000 - 0x1FFF    ; ROM space.
753  0x5000 - 0x53FF    ; NVRAM.
754
755  0x7C - 0x7F        ; PPI 8255 0 - DIP Switches, lamps & counters.
756  0xBC - 0xBF        ; PPI 8255 1 - Regular Inputs, sound lines & remaining lamps.
757  0xDC - 0xDF        ; PPI 8255 2 - Video RAM access & other stuff.
758
759
425760*******************************************************************************
426761
427762
r6049r6050
524859  - Fixed the discrete sound system diagram, based on real sound references.
525860
526861
862  [2009-10-12]
863
864  - Added Draw Poker Hi-Lo hardware support, based on 8080A CPU.
865  - Mirrored the PPI's offsets to simplify/merge the hardware emulation.
866  - Added hardware documentation and PCB layouts from both DPHL sets.
867  - Added DPHL discrete sound circuitry scheme/documentation.
868  - Added Turbo Poker 2 from Micro Manufacturing.
869  - Added PMA poker.
870  - Documented the Turbo Poker 2 hardware.
871  - Added Turbo Poker 2 PCB layout from hi-res picture.
872  - Switched to the new PPI core.
873  - Commented out the 3rd PPI device till handshaked strobe lines can be
874    properly emulated. For now, all VRAM access is through direct handlers.
875    This allow to remove the hacks per set needed to boot the games.
876
877
527878  TODO:
528879
529880  - Analize PPI-2 at 0xc0-0xc3. OBF handshake line (PC7) doesn't seems to work properly.
881  - Discrete sound to DPHL sets.
530882  - Find if wide chars are hardcoded or tied to a bit.
531883  - Save support.
532884
r6049r6050
534886*******************************************************************************/
535887
536888
537#define MASTER_CLOCK   XTAL_18_432MHz
538#define CPU_CLOCK      MASTER_CLOCK / 8   /* 2.30275 MHz - Measured: 2.305 MHz */
889#define NORAUT_MASTER_CLOCK      XTAL_18_432MHz
890#define DPHL_MASTER_CLOCK      XTAL_18MHz
891#define NORAUT_CPU_CLOCK      NORAUT_MASTER_CLOCK / 8      /* 2.30275 MHz - Measured: 2.305 MHz */
892#define DPHL_CPU_CLOCK         DPHL_MASTER_CLOCK / 9      /* 2 MHz (from 8224) */
539893
540894#include "driver.h"
541895#include "cpu/z80/z80.h"
542#include "machine/8255ppi.h"
896#include "cpu/i8085/i8085.h"
897#include "machine/i8255a.h"
543898#include "norautp.h"
544899
545900#include "noraut11.lh"
r6049r6050
6971052   PC0-PC2 could be set as input or output.
6981053*/
6991054
700static READ8_DEVICE_HANDLER( ppi2_portc_r )
701{
702   UINT8 ppi2_pcmix = 0;
703   UINT8 hndshk = 0x80;   /* simulating the handshake lines (bits 3-7) */
704   ppi2_pcmix = (hndshk | (input_port_read(device->machine, "IN2") & 0x07));
1055//static READ8_DEVICE_HANDLER( ppi2_portc_r )
1056//{
1057//  UINT8 ppi2_pcmix = 0;
1058//  UINT8 hndshk = 0x80;    /* simulating the handshake lines (bits 3-7) */
1059//  ppi2_pcmix = (hndshk | (input_port_read(device->machine, "IN2") & 0x07));
7051060//  popmessage("portc read: %02x", ppi2_pcmix);
7061061
707   return ppi2_pcmix;
708}
1062//  return ppi2_pcmix;
7091063
710static WRITE8_DEVICE_HANDLER( ppi2_portc_w )
1064//  return (devtag_get_device(device->machine, "ppi8255_2") || (input_port_read(device->machine, "IN2") & 0x07));
1065//}
1066
1067//static WRITE8_DEVICE_HANDLER( ppi2_portc_w )
1068//{
1069//  /* PC0-PC2 don't seems to be connected to any output */
1070//  popmessage("portc write: %02x", data);
1071//}
1072
1073
1074/*game waits for /OBF signal (bit 7) to be set.*/
1075static READ8_HANDLER( test_r )
7111076{
712   /* PC0-PC2 don't seems to be connected to any output */
713//  popmessage("portc write: %02x", data);
1077   return 0xff;
7141078}
7151079
716static READ8_DEVICE_HANDLER( vram_data_r )
1080static READ8_HANDLER( vram_data_r )
1081//static READ8_DEVICE_HANDLER( vram_data_r )
7171082{
7181083   return np_vram[np_addr];
7191084}
7201085
721static WRITE8_DEVICE_HANDLER( vram_data_w )
1086static WRITE8_HANDLER( vram_data_w )
1087//static WRITE8_DEVICE_HANDLER( vram_data_w )
7221088{
7231089   np_vram[np_addr] = data & 0xff;
1090
1091   /* trigger 8255-2 port C bit 7 (/OBF) */
1092//  i8255a_pc7_w(devtag_get_device(device->machine, "ppi8255_2"), 0);
1093//  i8255a_pc7_w(devtag_get_device(device->machine, "ppi8255_2"), 1);
1094
7241095}
7251096
726static WRITE8_DEVICE_HANDLER( vram_addr_w )
1097static WRITE8_HANDLER( vram_addr_w )
1098//static WRITE8_DEVICE_HANDLER( vram_addr_w )
7271099{
7281100   np_addr = data;
7291101}
r6049r6050
7381110/*************************
7391111* Memory Map Information *
7401112*************************/
1113/*
7411114
1115  CPU & PPI settings by set...
1116
1117  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1118  |   Set    |   CPU   | PPI-0 offset | config | PPI-1 offset | config | PPI-2 offset |         config         |
1119  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1120  | norautp  |   Z80   |  0x60-0x63   |  0x90  |  0xA0-0xA3   |  0x92  |  0xC0-0xC3   |  0xC1 (PC0-2 as input) |
1121  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1122  | norautjp |   Z80   |  0x60-0x63   |  0x90  |  0xA0-0xA3   |  0x92  |  0xC0-0xC3   |  0xC1 (PC0-2 as input) |
1123  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1124  | norautrh |   Z80   |  0x60-0x63   |  0x90  |  0xA0-0xA3   |  0x92  |  0xC0-0xC3   |          0xC0          |
1125  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1126  | norautu  | unknown |   unknown    |        |   unknown    |        |   unknown    |                        |
1127  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1128  | norautv3 |   Z80   |   unknown    |        |   unknown    |        |   unknown    |                        |
1129  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1130  | gtipoker |  8080A  |  0x7C-0x7F   |  0x90  |  0xBC-0xBF   |  0x92  |  0xDC-0xDF   |          0xC0          |
1131  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1132  | norautpn |   Z80   |  0x60-0x63   |  0x90  |  0xA0-0xA3   |  0x92  |  0xC0-0xC3   |          0xC0          |
1133  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1134  | dphl     |  8080A  |  0x7C-0x7F   |  0x90  |  0xBC-0xBF   |  0x92  |  0xDC-0xDF   |          0xC0          |
1135  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1136  | dphla    |  8080A  |  0x60-0x63   |  0x90  |  0xA0-0xA3   |  0x92  |  0xC0-0xC3   |          0xC0          |
1137  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1138  | pma      |   Z80   |  0x7C-0x7F   |  0x90  |  0xBC-0xBF   |  0x92  |  0xDC-0xDF   |          0xC0          |
1139  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1140  | tpoker2  |  8080A  |  0x7C-0x7F   |  0x90  |  0xBC-0xBF   |  0x92  |  0xDC-0xDF   |          0xC0          |
1141  +----------+---------+--------------+--------+--------------+--------+--------------+------------------------+
1142
1143*/
7421144static ADDRESS_MAP_START( norautp_map, ADDRESS_SPACE_PROGRAM, 8 )
1145   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
7431146   AM_RANGE(0x0000, 0x1fff) AM_ROM
744   AM_RANGE(0x6000, 0x63ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
1147   AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
7451148ADDRESS_MAP_END
7461149
7471150static ADDRESS_MAP_START( norautp_portmap, ADDRESS_SPACE_IO, 8 )
7481151   ADDRESS_MAP_GLOBAL_MASK(0xff)
749   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)
750   AM_RANGE(0xa0, 0xa3) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)
751   AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w)
1152   AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w)
1153   AM_RANGE(0xa0, 0xa3) AM_MIRROR(0x1c) AM_DEVREADWRITE("ppi8255_1", i8255a_r, i8255a_w)
1154//  AM_RANGE(0xc0, 0xc3) AM_MIRROR(0x3c) AM_DEVREADWRITE("ppi8255_2", i8255a_r, i8255a_w)
1155   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x3c) AM_READWRITE(vram_data_r, vram_data_w)
1156   AM_RANGE(0xc1, 0xc1) AM_MIRROR(0x3c) AM_WRITE(vram_addr_w)
1157   AM_RANGE(0xc2, 0xc2) AM_MIRROR(0x3c) AM_READ(test_r)
1158   AM_RANGE(0xef, 0xef) AM_READ(test2_r)
7521159ADDRESS_MAP_END
7531160
7541161/*
7551162  Video RAM R/W:
7561163
757  c0 --> W  ; data
1164  c0 --> W  ; data (hanshaked)
7581165  c1 --> W  ; addressing
759  c2 --> R  ; status
760  c3 --> W  ; alternate 00 & 01 (control?)
1166  c2 --> R  ; status (handshaking lines) + input (PC0-2)
1167  c3 --> W  ; PPI control + alternate 00 & 01 (PC1 out?)
7611168
1169  PPI Mirror isn't accurate.
1170  There are writes to 0xF7 and reads + compare to 0xEF.
1171  Don't know what's supposed to be mirrored there.
1172
7621173*/
7631174
1175static ADDRESS_MAP_START( nortest1_map, ADDRESS_SPACE_PROGRAM, 8 )
1176   ADDRESS_MAP_GLOBAL_MASK(0x7fff)
1177   AM_RANGE(0x0000, 0x2fff) AM_ROM
1178   AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
1179ADDRESS_MAP_END
1180
7641181static ADDRESS_MAP_START( norautxp_map, ADDRESS_SPACE_PROGRAM, 8 )
7651182   AM_RANGE(0x0000, 0xcfff) AM_ROM   /* need to be checked */
7661183   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* need to be checked */
r6049r6050
7681185
7691186static ADDRESS_MAP_START( norautxp_portmap, ADDRESS_SPACE_IO, 8 )
7701187   ADDRESS_MAP_GLOBAL_MASK(0xff)
771//  AM_RANGE(0x60, 0x63) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)
772//  AM_RANGE(0xa0, 0xa3) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)
773//  AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w)
7741188ADDRESS_MAP_END
7751189
1190
1191/***** 8080 based ****/
1192
1193static ADDRESS_MAP_START( dphl_map, ADDRESS_SPACE_PROGRAM, 8 )
1194   ADDRESS_MAP_GLOBAL_MASK(0x7fff)   /* A15 not connected */
1195   AM_RANGE(0x0000, 0x1fff) AM_ROM
1196   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
1197ADDRESS_MAP_END
1198
1199static ADDRESS_MAP_START( dphla_map, ADDRESS_SPACE_PROGRAM, 8 )
1200   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
1201   AM_RANGE(0x0000, 0x1fff) AM_ROM
1202   AM_RANGE(0x2000, 0x23ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
1203ADDRESS_MAP_END
1204
7761205static ADDRESS_MAP_START( gtipoker_map, ADDRESS_SPACE_PROGRAM, 8 )
1206   ADDRESS_MAP_GLOBAL_MASK(0x7fff)   /* similar to DPHL */
7771207   AM_RANGE(0x0000, 0x1fff) AM_ROM
778   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
1208   AM_RANGE(0x5000, 0x53ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
7791209ADDRESS_MAP_END
7801210
781static ADDRESS_MAP_START( gtipoker_portmap, ADDRESS_SPACE_IO, 8 )
782   ADDRESS_MAP_GLOBAL_MASK(0xff)
783   AM_RANGE(0x7c, 0x7f) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)
784   AM_RANGE(0xbc, 0xbf) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)
785   AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w)
786   AM_RANGE(0xef, 0xef) AM_READ(test2_r)
1211static ADDRESS_MAP_START( dphltest_map, ADDRESS_SPACE_PROGRAM, 8 )
1212//  ADDRESS_MAP_GLOBAL_MASK(0x7fff) /* A15 not connected */
1213   AM_RANGE(0x0000, 0x6fff) AM_ROM
1214   AM_RANGE(0x7000, 0x7fff) AM_RAM
1215   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
7871216ADDRESS_MAP_END
7881217
1218/*
1219DPHL
7891220
1221  7F -> 90
1222  BF -> 92
1223  DF -> C0 (hndshk)
1224
1225DPHLA
1226
1227  63 -> 90
1228  A3 -> 92
1229  C3 -> C0 (hndshk)
1230
1231*/
1232
7901233/*************************
7911234*      Input Ports       *
7921235*************************/
r6049r6050
10041447*      PPI 8255 (x3) Interface      *
10051448************************************/
10061449
1007static const ppi8255_interface ppi8255_intf[3] =
1450static I8255A_INTERFACE (ppi8255_intf_0)
10081451{
1009   {   /* (60-63) Mode 0 - Port A set as input */
1010      DEVCB_INPUT_PORT("DSW1"),      /* Port A read */
1011      DEVCB_NULL,                  /* Port B read */
1012      DEVCB_NULL,                  /* Port C read */
1013      DEVCB_NULL,                  /* Port A write */
1014      DEVCB_HANDLER(mainlamps_w),      /* Port B write */
1015      DEVCB_HANDLER(counterlamps_w)   /* Port C write */
1016   },
1017   {   /* (a0-a3) Mode 0 - Ports A & B set as input */
1018      DEVCB_INPUT_PORT("IN0"),      /* Port A read */
1019      DEVCB_INPUT_PORT("IN1"),      /* Port B read */
1020      DEVCB_NULL,                  /* Port C read */
1021      DEVCB_NULL,                  /* Port A write */
1022      DEVCB_NULL,                  /* Port B write */
1023      DEVCB_HANDLER(soundlamps_w)      /* Port C write */
1024   },
1025   {   /* (c0-c3) Group A Mode 2 (5-handshacked bidirectional port)
1026                   Group B Mode 0, output;  (see below for lines PC0-PC2) */
1027      DEVCB_HANDLER(vram_data_r),      /* Port A read */
1028      DEVCB_NULL,                  /* Port B read */
1029      DEVCB_HANDLER(ppi2_portc_r),   /* Port C read */
1030      DEVCB_HANDLER(vram_data_w),      /* Port A write (vram_data_w tied) */
1031      DEVCB_HANDLER(vram_addr_w),      /* Port B write (vram_addr_w tied) */
1032      DEVCB_HANDLER(ppi2_portc_w)      /* Port C write */
1033   }
1452   /* (60-63) Mode 0 - Port A set as input */
1453   DEVCB_INPUT_PORT("DSW1"),      /* Port A read */
1454   DEVCB_NULL,                  /* Port B read */
1455   DEVCB_NULL,                  /* Port C read */
1456   DEVCB_NULL,                  /* Port A write */
1457   DEVCB_HANDLER(mainlamps_w),      /* Port B write */
1458   DEVCB_HANDLER(counterlamps_w)   /* Port C write */
1459};
1460
1461static I8255A_INTERFACE (ppi8255_intf_1)
1462{
1463   /* (a0-a3) Mode 0 - Ports A & B set as input */
1464   DEVCB_INPUT_PORT("IN0"),      /* Port A read */
1465   DEVCB_INPUT_PORT("IN1"),      /* Port B read */
1466   DEVCB_NULL,                  /* Port C read */
1467   DEVCB_NULL,                  /* Port A write */
1468   DEVCB_NULL,                  /* Port B write */
1469   DEVCB_HANDLER(soundlamps_w)      /* Port C write */
1470};
1471
1472//static I8255A_INTERFACE (ppi8255_intf_2)
1473//{
1474    /* (c0-c3) Group A Mode 2 (5-lines handshacked bidirectional port)
1475               Group B Mode 0, output;  (see below for lines PC0-PC2) */
1476//  DEVCB_HANDLER(vram_data_r),     /* Port A read (VRAM data read)*/
1477//  DEVCB_NULL,                     /* Port B read */
1478//  DEVCB_HANDLER(ppi2_portc_r),    /* Port C read */
1479//  DEVCB_HANDLER(vram_data_w),     /* Port A write (VRAM data write) */
1480//  DEVCB_HANDLER(vram_addr_w),     /* Port B write (VRAM address write) */
1481//  DEVCB_HANDLER(ppi2_portc_w)     /* Port C write */
1482
10341483   /*  PPI-2 is configured as mixed mode2 and mode0 output.
10351484        It means that port A should be bidirectional and port B just as output.
1036        Port C as hshk regs, and P0-P2 as output (noraut11) or input (noraut12).
1485        Port C as hshk regs, and P0-P2 as input (norautp, norautjp) or output (other sets).
10371486    */
1038};
1487//};
10391488
10401489
10411490/*************************
r6049r6050
10451494static MACHINE_DRIVER_START( norautp )
10461495
10471496   /* basic machine hardware */
1048   MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK)
1497   MDRV_CPU_ADD("maincpu", Z80, NORAUT_CPU_CLOCK)
10491498   MDRV_CPU_PROGRAM_MAP(norautp_map)
10501499   MDRV_CPU_IO_MAP(norautp_portmap)
10511500   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
r6049r6050
10531502   MDRV_NVRAM_HANDLER(generic_0fill)
10541503
10551504   /* 3x 8255 */
1056   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
1057   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
1058   MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
1505   MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 )
1506   MDRV_I8255A_ADD( "ppi8255_1", ppi8255_intf_1 )
1507//  MDRV_I8255A_ADD( "ppi8255_2", ppi8255_intf_2 )
10591508
10601509   /* video hardware */
10611510   MDRV_SCREEN_ADD("screen", RASTER)
r6049r6050
10841533
10851534   MDRV_CPU_MODIFY("maincpu")
10861535   MDRV_CPU_PROGRAM_MAP(norautxp_map)
1087   MDRV_CPU_IO_MAP(norautxp_portmap)
1536   MDRV_CPU_IO_MAP(norautp_portmap)
10881537
10891538MACHINE_DRIVER_END
10901539
1091static MACHINE_DRIVER_START( gtipoker )
1540static MACHINE_DRIVER_START( nortest1 )
10921541   MDRV_IMPORT_FROM(norautp)
10931542
10941543   MDRV_CPU_MODIFY("maincpu")
1544   MDRV_CPU_PROGRAM_MAP(nortest1_map)
1545   MDRV_CPU_IO_MAP(norautp_portmap)
1546
1547MACHINE_DRIVER_END
1548
1549
1550/**** 8080A based ****/
1551
1552static MACHINE_DRIVER_START( dphl )
1553   /* basic machine hardware */
1554   MDRV_CPU_ADD("maincpu", 8080, DPHL_CPU_CLOCK)
1555   MDRV_CPU_PROGRAM_MAP(dphl_map)
1556   MDRV_CPU_IO_MAP(norautp_portmap)
1557
1558   /* 3x 8255 */
1559   MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf_0 )
1560   MDRV_I8255A_ADD( "ppi8255_1", ppi8255_intf_1 )
1561//  MDRV_I8255A_ADD( "ppi8255_2", ppi8255_intf_2 )
1562
1563   /* video hardware */
1564   MDRV_SCREEN_ADD("screen", RASTER)
1565   MDRV_SCREEN_REFRESH_RATE(60)
1566   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1567   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1568   MDRV_SCREEN_SIZE(32*16, 32*16)
1569   MDRV_SCREEN_VISIBLE_AREA(3*16, 31*16-1, (0*16) + 8, 16*16-1)
1570
1571   MDRV_GFXDECODE(norautp)
1572
1573   MDRV_PALETTE_INIT(norautp)
1574   MDRV_PALETTE_LENGTH(8)
1575   MDRV_VIDEO_START(norautp)
1576   MDRV_VIDEO_UPDATE(norautp)
1577
1578   /* sound hardware */
1579   MDRV_SPEAKER_STANDARD_MONO("mono")
1580   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
1581   MDRV_SOUND_CONFIG_DISCRETE(norautp)
1582   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1583MACHINE_DRIVER_END
1584
1585static MACHINE_DRIVER_START( gtipoker )
1586   MDRV_IMPORT_FROM(dphl)
1587
1588   MDRV_CPU_MODIFY("maincpu")
10951589   MDRV_CPU_PROGRAM_MAP(gtipoker_map)
1096   MDRV_CPU_IO_MAP(gtipoker_portmap)
1590   MDRV_CPU_IO_MAP(norautp_portmap)
1591//  MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
10971592
10981593MACHINE_DRIVER_END
10991594
1595static MACHINE_DRIVER_START( dphla )
1596   MDRV_IMPORT_FROM(dphl)
11001597
1598   MDRV_CPU_MODIFY("maincpu")
1599   MDRV_CPU_PROGRAM_MAP(dphla_map)
1600   MDRV_CPU_IO_MAP(norautp_portmap)
1601
1602MACHINE_DRIVER_END
1603
1604static MACHINE_DRIVER_START( dphltest )
1605   MDRV_IMPORT_FROM(dphl)
1606
1607   MDRV_CPU_MODIFY("maincpu")
1608   MDRV_CPU_PROGRAM_MAP(dphltest_map)
1609   MDRV_CPU_IO_MAP(norautp_portmap)
1610
1611   MDRV_NVRAM_HANDLER(generic_0fill)
1612
1613MACHINE_DRIVER_END
1614
1615
11011616/*************************
11021617*        Rom Load        *
11031618*************************/
r6049r6050
12921807   ROM_LOAD( "gu27.bin",  0x0800, 0x0800, CRC(174a5eec) SHA1(44d84a0cf29a0bf99674d95084c905d3bb0445ad) )
12931808ROM_END
12941809
1810/*
12951811
1812  Draw Poker Hi-Lo (1983).
1813  "NYMF O II" hardware.
1814  M. Kramer Inc.
1815
1816*/
1817
1818ROM_START( dphl )
1819   ROM_REGION( 0x10000, "maincpu", 0 )
1820   ROM_LOAD( "dphl_6468.u12", 0x0000, 0x1000, CRC(d8c4fe5c) SHA1(6bc745fefb8a3a21ca281d519895828047526de7) )
1821   ROM_LOAD( "dphl_36e3.u18", 0x1000, 0x1000, CRC(06cf6789) SHA1(587d883c399348b518e3be4d1dc2581824055328) )
1822
1823   ROM_REGION( 0x1000,  "gfx", 0 )
1824//  ROM_FILL(              0x0000, 0x0800, 0xff )
1825   ROM_LOAD( "dphl_model_2_cgi_3939.u31",  0x0000, 0x1000, CRC(2028db2c) SHA1(0f81bb71e88c60df3817f58c28715ce2ea01ad4d) )
1826
1827   ROM_REGION( 0x0100,  "proms", 0 )
1828   ROM_LOAD( "98ce.u51",  0x0000, 0x0100, CRC(812dc1f1) SHA1(b2af33ff36f2eca2f782bc2239bc9e54c2564f6a) )
1829ROM_END
1830
1831ROM_START( dphla )
1832   ROM_REGION( 0x10000, "maincpu", 0 )
1833   ROM_LOAD( "2b27.u11", 0x0000, 0x0800, CRC(3a7ece95) SHA1(bc7c89e3f490da0723b3a7617ab9a747f8db7ea7) )
1834   ROM_LOAD( "4d30.u16", 0x0800, 0x0800, CRC(32594684) SHA1(cda1ed09ec30082d23e690058261523e0d34938e) )
1835
1836   ROM_REGION( 0x1000,  "gfx", 0 )
1837   ROM_FILL(              0x0000, 0x0800, 0xff )
1838   ROM_LOAD( "char.u27",  0x0800, 0x0800, CRC(174a5eec) SHA1(44d84a0cf29a0bf99674d95084c905d3bb0445ad) )
1839ROM_END
1840
1841/*
1842
1843  PCB silkscreened PMA-32-C.
1844  Someone had written "poker" on it.
1845
1846  CPU:   LH0080 (Sharp Z80).
1847  I/O:   3x PPI 8255.
1848  Xtal:  18 MHz.
1849  NVRAM: Yes, battery attached.
1850
1851  ROMs: 2x 2732 (E4 & E5).
1852        1x 2716 (J2).
1853
1854  PROM: tb24s10n (D3) read as 82s129.
1855
1856*/
1857ROM_START( pma )
1858   ROM_REGION( 0x10000, "maincpu", 0 )
1859   ROM_LOAD( "pma.e5", 0x0000, 0x1000, CRC(e05ab5b9) SHA1(8bd13e8ed723ac256545f19bef4fa3fe507ab9d5) )
1860   ROM_RELOAD(         0x1000, 0x1000 )
1861   ROM_LOAD( "pma.e4", 0x2000, 0x1000, CRC(0f8b11fc) SHA1(7292b0ac368c469ff2e1ede1765c08f1ccc1a36c) )
1862
1863   ROM_REGION( 0x1000,  "gfx", 0 )
1864   ROM_FILL(           0x0000, 0x0800, 0xff )
1865   ROM_LOAD( "pma.j2", 0x0800, 0x0800, CRC(412fc492) SHA1(094ea0ffd0c22274cfe164f07c009ffe022331fd) )
1866
1867   ROM_REGION( 0x0200,  "proms", 0 )
1868   ROM_LOAD( "pma.d3",  0x0000, 0x0200, CRC(6e172c11) SHA1(b52439a5075cc68ae2792946a5ce973d9f8e4104) )
1869ROM_END
1870
1871/*
1872
1873  Turbo Poker 2 by Micro MFG.
1874
1875  - CPU:             1x NEC D8080AFC-1 (U42).
1876  - BUS:             1x 8224 (U43)
1877  - RAM:             2x 2111-1 Static Random Access Memory 256 x 4 bit (U33 & U34).
1878  - I/O:             3x Intel P8255A Peripeheral Interface Adapter (U31, U36 & U38).
1879  - Prg ROMs:        1x 27256 (U39).
1880  - Gfx ROMs:        1x 2732 (U30).
1881  - Sound:           Discrete.
1882  - Crystal:         1x 18.000 MHz.
1883
1884*/
1885ROM_START( tpoker2 )
1886   ROM_REGION( 0x10000, "maincpu", 0 )
1887   ROM_LOAD( "tp2.u39", 0x0000, 0x8000, CRC(543149fe) SHA1(beb61a27c2797341e23e020e754d63fde3b4fbb2) )
1888
1889   ROM_REGION( 0x1000,  "gfx", 0 )
1890   ROM_LOAD( "tp2.u30", 0x0000, 0x1000, CRC(6df86e08) SHA1(a451f71db7b59500b99207234ef95793afc11f03) )
1891
1892   ROM_REGION( 0x0800,  "other", 0 )
1893   ROM_LOAD( "tp2.u44", 0x0000, 0x0800, CRC(6b5453b7) SHA1(6793952800de067fd76b889f4f7c62c8474b8c3a) )
1894
1895   ROM_REGION( 0x0400,  "proms", 0 )
1896   ROM_LOAD( "tp2.u23", 0x0000, 0x0400, CRC(0222124f) SHA1(5cd8d24ee8e6525a5f9e6a93fa8854f36f4319ee) )
1897
1898   ROM_REGION( 0x0034,  "plds", 0 )
1899   ROM_LOAD( "tp2_pld.u37",  0x0000, 0x0034, CRC(25651948) SHA1(62cd4d73c6ca8ea5d4beb9ae262d1383f8149462) )
1900ROM_END
1901
1902
12961903/**************************
12971904*       Driver Init       *
12981905**************************/
r6049r6050
13071914*/
13081915static DRIVER_INIT( norautrh )
13091916{
1310   UINT8 *ROM = memory_region(machine, "maincpu");
1311   ROM[0x1110] = 0x00;
1312   ROM[0x1111] = 0x00;
1917//  UINT8 *ROM = memory_region(machine, "maincpu");
1918//  ROM[0x1110] = 0x00;
1919//  ROM[0x1111] = 0x00;
13131920}
13141921
13151922static DRIVER_INIT( norautpn )
13161923{
1317   UINT8 *ROM = memory_region(machine, "maincpu");
1318   ROM[0x0827] = 0x00;
1319   ROM[0x0828] = 0x00;
1924//  UINT8 *ROM = memory_region(machine, "maincpu");
1925//  ROM[0x0827] = 0x00;
1926//  ROM[0x0828] = 0x00;
13201927}
13211928
1929static DRIVER_INIT( norautu )
1930{
1931//  UINT8 *ROM = memory_region(machine, "maincpu");
1932//  ROM[0x083c] = 0x00;
1933//  ROM[0x083d] = 0x00;
1934//  ROM[0x083e] = 0x00;
1935}
1936
13221937static DRIVER_INIT( gtipoker )
13231938{
13241939//  UINT8 *ROM = memory_region(machine, "maincpu");
13251940//  ROM[0x0cc6] = 0x00;
13261941//  ROM[0x0cc7] = 0x00;
1942//  ROM[0x0cc8] = 0x00;
1943//  ROM[0x10a5] = 0x00;
1944//  ROM[0x10a6] = 0x00;
1945//  ROM[0x10a7] = 0x00;
13271946}
13281947
1948static DRIVER_INIT( dphl )
1949{
1950//  UINT8 *ROM = memory_region(machine, "maincpu");
1951//  ROM[0x1510] = 0x00;
1952//  ROM[0x1511] = 0x00;
1953//  ROM[0x1512] = 0x00;
1954}
13291955
1956static DRIVER_INIT( dphla )
1957{
1958//  UINT8 *ROM = memory_region(machine, "maincpu");
1959//  ROM[0x0b09] = 0x00;
1960//  ROM[0x0b0a] = 0x00;
1961//  ROM[0x0b0b] = 0x00;
1962}
1963
1964
13301965/*************************
13311966*      Game Drivers      *
13321967*************************/
13331968
1334/*     YEAR  NAME      PARENT   MACHINE   INPUT     INIT      ROT    COMPANY        FULLNAME                       FLAGS                              LAYOUT */
1335GAMEL( 1988, norautp,  0,       norautp,  norautp,  0,        ROT0, "Noraut Ltd.", "Noraut Poker",                 0,                     layout_noraut11 )
1336GAMEL( 1988, norautjp, norautp, norautp,  norautp,  0,        ROT0, "Noraut Ltd.", "Noraut Joker Poker",           0,                     layout_noraut11 )
1337GAMEL( 1988, norautrh, 0,       norautp,  norautrh, norautrh, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker",   0,                     layout_noraut12 )
1338GAME(  1988, norautu,  0,       norautxp, norautp,  0,        ROT0, "Noraut Ltd.", "Noraut Poker (NTX10A)",        GAME_NOT_WORKING )
1339GAME(  1988, norautv3, 0,       norautxp, norautp,  0,        ROT0, "Noraut Ltd.", "Noraut Joker Poker (V3.010a)", GAME_NOT_WORKING )
1340GAME(  1983, gtipoker, 0,       gtipoker, norautpn, gtipoker, ROT0, "GTI Inc",     "GTI Poker",                    GAME_NOT_WORKING )
1969/*     YEAR  NAME      PARENT   MACHINE   INPUT     INIT      ROT    COMPANY                      FULLNAME                       FLAGS                              LAYOUT */
1970GAMEL( 1988, norautp,  0,       norautp,  norautp,  0,        ROT0, "Noraut Ltd.",               "Noraut Poker",                 0,                     layout_noraut11 )
1971GAMEL( 1988, norautjp, norautp, norautp,  norautp,  0,        ROT0, "Noraut Ltd.",               "Noraut Joker Poker",           0,                     layout_noraut11 )
1972GAMEL( 1988, norautrh, 0,       norautp,  norautrh, norautrh, ROT0, "Noraut Ltd.",               "Noraut Red Hot Joker Poker",   0,                     layout_noraut12 )
1973GAME(  1988, norautu,  0,       norautxp, norautp,  norautu,  ROT0, "Noraut Ltd.",               "Noraut Poker (NTX10A)",        GAME_NOT_WORKING )
1974GAME(  1988, norautv3, 0,       norautxp, norautp,  0,        ROT0, "Noraut Ltd.",               "Noraut Joker Poker (V3.010a)", GAME_NOT_WORKING )
1975GAME(  1983, pma,      0,       nortest1, norautp,  0,        ROT0, "PMA",                       "PMA Poker",                    GAME_NOT_WORKING )
13411976
13421977/*The following has everything uncertain, seems a bootleg/hack and doesn't have any identification strings in program rom. */
1343GAMEL( 198?, norautpn, norautp, norautp,  norautpn, norautpn, ROT0, "bootleg?",    "Noraut Poker (bootleg)",       0,                     layout_noraut12 )
1978GAMEL( 198?, norautpn, norautp, norautp,  norautpn, norautpn, ROT0, "bootleg?",                  "Noraut Poker (bootleg)",       0,                     layout_noraut12 )
1979
1980/* The following ones are 'Draw Poker Hi-Lo', running in a i8080a based hardware */
1981GAME(  1983, dphl,     0,       dphl,     norautp,  dphl,     ROT0, "M. Kramer Manufacturing.",  "Draw Poker Hi-Lo (M.Kramer)",  GAME_NOT_WORKING )
1982GAME(  1983, dphla,    0,       dphla,    norautp,  dphla,    ROT0, "Unknown",                   "Draw Poker Hi-Lo (alt)",       GAME_NOT_WORKING )
1983
1984GAME(  1983, gtipoker, 0,       gtipoker, norautpn, gtipoker, ROT0, "GTI Inc",                   "GTI Poker",                    GAME_NOT_WORKING )
1985GAME(  1993, tpoker2,  0,       dphltest, norautp,  0,        ROT0, "Micro Manufacturing, Inc.", "Turbo Poker 2",                GAME_NOT_WORKING )
src/mame/drivers/mw8080bw.c
r6049r6050
19511951   AM_RANGE(0x01, 0x01) AM_MIRROR(0x08) AM_WRITE(mb14241_0_shift_count_w)
19521952   AM_RANGE(0x02, 0x02) AM_MIRROR(0x08) AM_WRITE(mb14241_0_shift_data_w)
19531953   AM_RANGE(0x04, 0x04) AM_MIRROR(0x08) AM_WRITE(watchdog_reset_w)
1954   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_1_w)
1955   AM_RANGE(0x06, 0x06) AM_MIRROR(0x08) AM_WRITE(shuffle_audio_2_w)
1954   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_DEVWRITE("discrete", shuffle_audio_1_w)
1955   AM_RANGE(0x06, 0x06) AM_MIRROR(0x08) AM_DEVWRITE("discrete", shuffle_audio_2_w)
19561956ADDRESS_MAP_END
19571957
19581958
r6049r6050
20052005   MDRV_WATCHDOG_TIME_INIT(USEC(255000000 / (MW8080BW_PIXEL_CLOCK / MW8080BW_HTOTAL / MW8080BW_VTOTAL)))
20062006
20072007   /* audio hardware */
2008   /* MDRV_IMPORT_FROM(shuffle_audio) */
2008   MDRV_IMPORT_FROM(shuffle_audio)
20092009
20102010MACHINE_DRIVER_END
20112011
r6049r6050
31833183/* 630 */ GAMEL(1978, clowns1,  clowns,   clowns,   clowns1,  0, ROT0,   "Midway", "Clowns (rev. 1)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE , layout_clowns )
31843184/* 640 */ GAMEL(1978, spacwalk, 0,        spacwalk, spacwalk, 0, ROT0,   "Midway", "Space Walk", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE, layout_spacwalk )
31853185/* 642 */ GAME( 1978, einning,  0,        dplay,    einning,  0, ROT0,   "Midway", "Extra Inning", GAME_SUPPORTS_SAVE  )
3186/* 643 */ GAME( 1978, shuffle,  0,        shuffle,  shuffle,  0, ROT90,  "Midway", "Shuffleboard", GAME_NO_SOUND | GAME_SUPPORTS_SAVE  )
3186/* 643 */ GAME( 1978, shuffle,  0,        shuffle,  shuffle,  0, ROT90,  "Midway", "Shuffleboard", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  )
31873187/* 644 */ GAME( 1977, dogpatch, 0,        dogpatch, dogpatch, 0, ROT0,   "Midway", "Dog Patch", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  )
31883188/* 645 */ GAME( 1980, spcenctr, 0,        spcenctr, spcenctr, 0, ROT0,   "Midway", "Space Encounters", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE  )
31893189/* 652 */ GAMEL(1979, phantom2, 0,        phantom2, phantom2, 0, ROT0,   "Midway", "Phantom II", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE , layout_hoa0a0ff )
src/mame/drivers/btime.c
r6049r6050
13921392   DISCRETE_OP_AMP_FILTER(NODE_30, 1, NODE_04, NODE_NC, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &btime_opamp_desc)
13931393
13941394   DISCRETE_MIXER2(NODE_40, 1, NODE_22, NODE_30, &btime_sound_mixer_desc)
1395   DISCRETE_CRFILTER(NODE_41, 1, NODE_40, RES_K(10), CAP_U(10))
1395   DISCRETE_CRFILTER(NODE_41, NODE_40, RES_K(10), CAP_U(10))
13961396
13971397   /* Amplifier is upc1181H3
13981398     *
r6049r6050
14051405     */
14061406
14071407   /* Assuming a 4 Ohm impedance speaker */
1408   DISCRETE_CRFILTER(NODE_43, 1, NODE_41, 3.0, CAP_U(100))
1408   DISCRETE_CRFILTER(NODE_43, NODE_41, 3.0, CAP_U(100))
14091409
14101410   DISCRETE_OUTPUT(NODE_43, 32767.0 / 5. * 35.0)
14111411
src/mame/drivers/hshavoc.c
r6049r6050
4040#include "sound/2612intf.h"
4141#include "sound/sn76496.h"
4242
43#include "genesis.h"
43#include "megadriv.h"
4444
45#define MASTER_CLOCK      53693100
46
47
4845static INPUT_PORTS_START( hshavoc )
4946   PORT_START("IN0")   /* 16bit */
5047   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) )
r6049r6050
9794   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
9895INPUT_PORTS_END
9996
100static ADDRESS_MAP_START( topshoot_map, ADDRESS_SPACE_PROGRAM, 16 )
101   AM_RANGE(0x000000, 0x0fffff) AM_ROM                                          /* Cartridge Program Rom */
102   AM_RANGE(0x200000, 0x201fff) AM_WRITENOP // tested
103   AM_RANGE(0x202000, 0x2023ff) AM_RAM // tested
104   AM_RANGE(0xa00000, 0xa0ffff) AM_READWRITE(genesis_68k_to_z80_r, genesis_68k_to_z80_w)
105   AM_RANGE(0xa10000, 0xa1001f) AM_WRITE(genesis_io_w) AM_BASE(&genesis_io_ram)         /* Genesis Input */
106   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
107   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(genesis_vdp_r, genesis_vdp_w)               /* VDP Access */
108   AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(3)
109   AM_RANGE(0xfe0000, 0xfeffff) AM_RAMBANK(4)
110   AM_RANGE(0xff0000, 0xffffff) AM_RAM AM_BASE(&genesis_68k_ram)                     /* Main Ram */
111ADDRESS_MAP_END
11297
113
114static ADDRESS_MAP_START( genesis_z80_map, ADDRESS_SPACE_PROGRAM, 8 )
115    AM_RANGE(0x0000, 0x1fff) AM_RAMBANK(1) AM_BASE(&genesis_z80_ram)
116    AM_RANGE(0x2000, 0x3fff) AM_RAMBANK(2) /* mirror */
117   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(genesis_z80_r, genesis_z80_w)
118   AM_RANGE(0x8000, 0xffff) AM_READ(genesis_z80_bank_r)
119 // AM_RANGE(0x8000, 0xffff) AM_WRITE(genesis_z80_bank_w)
120ADDRESS_MAP_END
121
122
123static MACHINE_DRIVER_START( genesis_base )
124   /*basic machine hardware */
125   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK / 7)
126   MDRV_CPU_VBLANK_INT("screen", genesis_vblank_interrupt)
127
128   MDRV_CPU_ADD("genesis_snd_z80", Z80, MASTER_CLOCK / 15)
129   MDRV_CPU_PROGRAM_MAP(genesis_z80_map)
130   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) /* from vdp at scanline 0xe0 */
131
132   MDRV_QUANTUM_TIME(HZ(6000))
133
134   MDRV_MACHINE_START(genesis)
135   MDRV_MACHINE_RESET(genesis)
136
137   /* video hardware */
138   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
139
140   MDRV_SCREEN_ADD("screen", RASTER)
141   MDRV_SCREEN_REFRESH_RATE(60)
142   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
143   MDRV_SCREEN_SIZE(342,262)
144   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223)
145
146   MDRV_PALETTE_LENGTH(64)
147
148   MDRV_VIDEO_START(genesis)
149   MDRV_VIDEO_UPDATE(genesis)
150
151   /* sound hardware */
152   MDRV_SPEAKER_STANDARD_MONO("mono")
153
154   MDRV_SOUND_ADD("ym", YM3438, MASTER_CLOCK/7)
155   MDRV_SOUND_ROUTE(0, "mono", 0.50)
156   MDRV_SOUND_ROUTE(1, "mono", 0.50)
157MACHINE_DRIVER_END
158
159
160static MACHINE_DRIVER_START( hshavoc )
161   /* basic machine hardware */
162   MDRV_IMPORT_FROM( genesis_base )
163   MDRV_CPU_MODIFY("maincpu")
164   MDRV_CPU_PROGRAM_MAP(topshoot_map)
165
166   /* sound hardware */
167   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/15)
168   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
169MACHINE_DRIVER_END
170
17198ROM_START( hshavoc )
17299   ROM_REGION( 0x200000, "maincpu", 0 )
173100   ROM_LOAD16_BYTE( "d-25.11a", 0x000000, 0x080000, CRC(6a155060) SHA1(ecb47bd428786e50e300a062b5038f943419a389) )
r6049r6050
186113   ROM_REGION( 0x200000, "maincpu", 0 )
187114   ROM_LOAD( "hsh.rom", 0x000000, 0x100000, CRC(17be551c) SHA1(0dc1969098716ba332978b89356f62961417682b) )
188115ROM_END
116
189117#endif
190118
191static READ16_HANDLER( vdp_fake_r )
192{
193   return mame_rand(space->machine);
194}
195
196static DRIVER_INIT(genesis)
197{
198   /* hack -- fix vdp emulation instead */
199   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xC00004, 0xC00005, 0, 0, vdp_fake_r);
200
201   memory_set_bankptr(machine, 3, memory_region(machine, "maincpu") );
202   memory_set_bankptr(machine, 4, genesis_68k_ram );
203}
204
205119static DRIVER_INIT(hshavoc)
206120{
207121
r6049r6050
210124
211125   static const UINT16 typedat[16] = {
212126      1,1,1,1, 1,1,1,1,
213      1,0,0,1, 1,0,1,1
214      };
127      1,0,0,1, 1,0,1,1  };
215128
216129   /* this decryption is wrong / incomplete, maybe it uses slightly different decryption for opcodes / data */
217130   /* I think the PIC that exists on the PCB controls a state-based encryption... there is a large amount
r6049r6050
222135
223136   int rom_size = 0xe8000;
224137
225   for (x=0;x<rom_size/2;x++)
138   for (x = 0; x < rom_size / 2; x++)
226139   {
227140      src[x] = BITSWAP16(src[x],
228                        7, 15,6, 14,
141                                7, 15,6, 14,
229142                                5, 2, 1, 10,
230143                                13,4, 12,3,
231                                11,0, 8, 9
232                        );
144                                11,0, 8, 9 );
233145
234146
147      if (typedat[x & 0xf] == 1)
148         src[x] = src[x] ^ 0x0501;
149      else
150         src[x] = src[x] ^ 0x0406;
235151
236152
237      if (typedat[x&0xf]==1) src[x] = src[x]^0x0501;
238      else src[x] = src[x]^0x0406;
153      if (src[x] & 0x0400)
154         src[x] ^= 0x0200;
239155
240
241      if(src[x]&0x0400) src[x]^=0x0200;
242
243
244      if (typedat[x&0xf]==0)
156      if (typedat[x & 0xf] == 0)
245157      {
246         if(src[x]&0x0100) src[x]^=0x0004;
158         if (src[x] & 0x0100)
159            src[x] ^= 0x0004;
247160
248161         src[x] = BITSWAP16(src[x], 15,14,13,12,
249                               11,9, 10,8,
250                               7, 6, 5, 4,
251                              3, 2, 1, 0);
162                                             11,9, 10,8,
163                                             7, 6, 5, 4,
164                                             3, 2, 1, 0 );
252165      }
253
254166   }
255167
256168   /* START e? from e80000 to end you need THIS ALONE to match the genesis rom */
257   for (x=rom_size/2;x<0x100000/2;x++)
169   for (x = rom_size / 2; x < 0x100000 / 2; x++)
258170   {
259171      src[x] = BITSWAP16(src[x],
260                        7, 15,6, 14,
172                                7, 15,6, 14,
261173                                5, 2, 1, 10,
262174                                13,4, 12,3,
263                                11,0, 8, 9
264                        );
175                                11,0, 8, 9 );
265176
266177      src[x] = BITSWAP16(src[x],
267                        15, 14,13, 12,
268                                11, 10, 9, 2,
269                                7,6, 5,4,
270                                3,8, 0, 1
271                        );
272
178                                15,14,13,12,
179                                11,10,9, 2,
180                                7, 6, 5, 4,
181                                3, 8, 0, 1 );
273182   }
274183   /* EMD e80000 - end */
275184
276   src[0]^=0x0107;
277   src[1]^=0x0107;
278   src[2]^=0x0107;
279   src[3]^=0x0707; //? 0701 not 0107 .. conditional 0x600 extra xor?, different 'typemap' ??
185   src[0] ^= 0x0107;
186   src[1] ^= 0x0107;
187   src[2] ^= 0x0107;
188   src[3] ^= 0x0707; //? 0701 not 0107 .. conditional 0x600 extra xor?, different 'typemap' ??
280189
281190   /* I'm pretty sure c42 is where the startup code is located, comparing genesis version
282191       and this there is at least one jump in the genesis version to the startup code which
r6049r6050
285194       there are several blocks of code like this, all appear to end with a normal rts instruction
286195       tho...
287196       */
288   for (x=0xc42/2;x<0xc9a/2;x++)
197   for (x = 0xc42 / 2; x < 0xc9a / 2; x++)
289198   {
290      src[x]^=0x0107; //? seems conditional..
199      src[x] ^= 0x0107; //? seems conditional..
291200
292201      src[x] = BITSWAP16(src[x],
293                        15, 13,14, 12,
294                                11, 10, 9, 0,
295                                8,6, 5,4,
296                                3,2, 1, 7
297                        ); // probably wrong
202                                15,13,14,12,
203                                11,10,9, 0,
204                                8, 6, 5, 4,
205                                3, 2, 1, 7 ); // probably wrong
298206
299      src[x]^=0x0001; // wrong..
300
207      src[x] ^= 0x0001; // wrong..
301208   }
302209
303210/* Uncommented until actively worked on
304211    {
305212        FILE*FP;
306213
307        FP=fopen("hshavoc.dump","wb");
214        FP = fopen("hshavoc.dump", "wb");
308215
309        fwrite(src, rom_size/2, 2, FP);
216        fwrite(src, rom_size / 2, 2, FP);
310217        fclose(FP);
311218    }
312219*/
313220
221   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x200000, 0x201fff, 0, 0, SMH_NOP);
314222
315   DRIVER_INIT_CALL(genesis);
223   DRIVER_INIT_CALL(megadriv);
316224
317225}
318226
319227
320228
321GAME( 1993, hshavoc,   0,        hshavoc, hshavoc, hshavoc, ROT0, "Data East",                  "High Seas Havoc",GAME_NOT_WORKING )
322//GAME( 1993, hshavoc2,  hshavoc,  hshavoc, hshavoc, genesis, ROT0, "Data East",                  "High Seas Havoc (Genesis ROM)",GAME_NOT_WORKING )
229GAME( 1993, hshavoc,   0,        md_bootleg, hshavoc, hshavoc, ROT0, "Data East",                  "High Seas Havoc",GAME_NOT_WORKING )
230//GAME( 1993, hshavoc2,  hshavoc,  md_bootleg, hshavoc, genesis, ROT0, "Data East",                  "High Seas Havoc (Genesis ROM)",GAME_NOT_WORKING )
src/mame/drivers/attckufo.c
r6049r6050
77
88TODO:
99 - correct I/O chip emulation
10 - dips
1110 - is game speed ok? a bit slow sometimes
1211
1312--
r6049r6050
8988
9089static INPUT_PORTS_START( attckufo )
9190   PORT_START("DSW")
92   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
91   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
9392   PORT_DIPSETTING(    0x00, "3" )
9493   PORT_DIPSETTING(    0x01, "4" )
9594   PORT_DIPSETTING(    0x02, "5" )
9695   PORT_DIPSETTING(    0x03, "6" )
97   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
98   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
99   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
100   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
101   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
102   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
103   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
104   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
106   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
107   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
108   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
109   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
110   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
111   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
96   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Bonus_Life ) )
97   PORT_DIPSETTING(    0x04, "1000" )
98   PORT_DIPSETTING(    0x00, "1500" )
99   PORT_DIPUNUSED( 0x08, IP_ACTIVE_LOW )
100   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
101   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
102   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
112103   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
113104
114105   PORT_START("INPUT")
115106   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
116107   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
117   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
108   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(1)
118109   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(1)
119110   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
120   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
111   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_PLAYER(2)
121112   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_PLAYER(2)
122113   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
123114INPUT_PORTS_END
r6049r6050
161152
162153   ROM_REGION( 0x400, "user1", 0 )
163154   ROM_COPY( "maincpu", 0x02000, 0x00000, 0x400)
164
165155ROM_END
166156
167GAME( 1980, attckufo,  0,     attckufo, attckufo, 0, ROT270, "Ryoto Electric Co.", "Attack Ufo", 0)
168
157GAME( 1980, attckufo, 0,        attckufo, attckufo, 0, ROT270, "Ryoto Electric Co.", "Attack Ufo", 0)
src/mame/drivers/stv.c
r6049r6050
35583558   ROM_LOAD16_WORD_SWAP( "mpr21973.5",    0x1000000, 0x0400000, CRC(b0f23f14) SHA1(4e7076c29fd57bb3ef9af50a6104e39ecda94e06) )// good
35593559ROM_END
35603560
3561ROM_START( danchiq )
3562   STV_BIOS
3563
3564   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
3565   ROM_LOAD16_WORD_SWAP( "ic22",    0x0200000, 0x0200000, CRC(e216bfc8) SHA1(7a08fa32281e272dbf5e7daea50a1800cc225c1b) )//ic 7
3566   ROM_LOAD16_WORD_SWAP( "ic24",    0x0400000, 0x0200000, CRC(b95aa5ac) SHA1(2766c5414643034a0f6d746050557516bd3753df) )//ic 2
3567   ROM_LOAD16_WORD_SWAP( "ic26",    0x0600000, 0x0200000, CRC(df6ebd48) SHA1(fcccafbee1b8b952b07ed0e7e86219eed9cf4a93) )
3568   ROM_LOAD16_WORD_SWAP( "ic28",    0x0800000, 0x0200000, CRC(cf6a2b76) SHA1(1f7522d446d57b78d099bae553133d5e7e54ff70) )//ic 3
3569   ROM_LOAD16_WORD_SWAP( "ic30",    0x0a00000, 0x0200000, CRC(0b6a9901) SHA1(b4c335199d3e49a9ae5d474b10130abc4718cdf9) )
3570   ROM_LOAD16_WORD_SWAP( "ic32",    0x0c00000, 0x0200000, CRC(0b4604f5) SHA1(547cba4a80baf126e87f87529aa933587643d359) )//ic 4
3571   ROM_LOAD16_WORD_SWAP( "ic34",    0x0e00000, 0x0200000, CRC(616e20fa) SHA1(45c175e79b5701db9726d157ff92eee368f4bbf9) )
3572   ROM_LOAD16_WORD_SWAP( "ic36",    0x1000000, 0x0200000, CRC(43474e08) SHA1(30b3ede287d5de93c6e0219bfd0a5d7ed5b6a958) )//ic 5
3573   ROM_LOAD16_WORD_SWAP( "ic23",    0x1200000, 0x0200000, CRC(d080eb71) SHA1(9c39b887697c8872f0cb655cff24282ad3b90e9b) )
3574   ROM_LOAD16_WORD_SWAP( "ic25",    0x1400000, 0x0200000, CRC(9a4109e5) SHA1(ba59caac5f5a80fc52c507d8a47f322a380aa9a1) )//(Untested)
3575ROM_END
3576
35613577ROM_START( mausuke )
35623578   STV_BIOS
35633579
r6049r6050
38073823GAME( 1998, cottonbm,  stvbios, stv, stv,        cottonbm,     ROT0,   "Success",                   "Cotton Boomerang (JUET 980709 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
38083824GAME( 1995, critcrsh,  stvbios, stv, critcrsh,   stv,         ROT0,   "Sega",                       "Critter Crusher (EA 951204 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
38093825GAME( 1999, danchih,   stvbios, stv, stvmp,      danchih,      ROT0,   "Altron (Tecmo license)",        "Danchi de Hanafuda (J 990607 V1.400)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
3826GAME( 2000, danchiq,   stvbios, stv, stv,      danchih,      ROT0,   "Altron",                    "Danchi de Quiz Okusan Yontaku Desuyo! (J 001128 V1.200)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
38103827GAME( 1996, diehard,   stvbios, stv, stv,        diehard,      ROT0,   "Sega",                      "Die Hard Arcade (UET 960515 V1.000)", GAME_IMPERFECT_SOUND  )
38113828GAME( 1996, dnmtdeka,  diehard, stv, stv,       dnmtdeka,     ROT0,   "Sega",                      "Dynamite Deka (J 960515 V1.000)", GAME_IMPERFECT_SOUND  )
38123829GAME( 1995, ejihon,    stvbios, stv, stv,        stv,          ROT0,   "Sega",                      "Ejihon Tantei Jimusyo (J 950613 V1.000)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/megatech.c
r6049r6050
9292#include "rendlay.h"
9393
9494#include "segamsys.h"
95#include "genesis.h"
9695#include "megadriv.h"
9796
97static struct _mtech_bios mtech_bios;
98
9899/* Megatech BIOS specific */
99static UINT32 bios_port_ctrl;
100100static UINT8* megatech_banked_ram;
101static int current_game_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
102UINT32 bios_ctrl_inputs;
103101
104102#define MASTER_CLOCK      53693100
105103
r6049r6050
108106   PORT_INCLUDE(megadriv)
109107
110108   PORT_START("BIOS_IN0") // port 6
111    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Select") PORT_CODE(KEYCODE_0)
112    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
113    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
114    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
115    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
116    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
117    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
118    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
119    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
120    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
121    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
122    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
123    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
124    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
125    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
126    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
127    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
128    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
129    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Select") PORT_CODE(KEYCODE_0)
110   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
111   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
112   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
113   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
114   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
115   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
116   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
117   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
118   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
119   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
120   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
121   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
122   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
123   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
124   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
125   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
126   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
127   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
130128   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
131129
132130   PORT_START("BIOS_IN1") // port 6
r6049r6050
141139
142140   PORT_START("BIOS_DSW0")
143141   PORT_DIPNAME( 0x02, 0x02, "Coin slot 3" )
144   PORT_DIPSETTING (   0x00, "Inhibit" )
145   PORT_DIPSETTING (   0x02, "Accept" )
142   PORT_DIPSETTING(    0x00, "Inhibit" )
143   PORT_DIPSETTING(    0x02, "Accept" )
146144   PORT_DIPNAME( 0x01, 0x01, "Coin slot 4" )
147   PORT_DIPSETTING (   0x00, "Inhibit" )
148   PORT_DIPSETTING (   0x01, "Accept" )
145   PORT_DIPSETTING(    0x00, "Inhibit" )
146   PORT_DIPSETTING(    0x01, "Accept" )
149147   PORT_DIPNAME( 0x1c, 0x1c, "Coin slot 3/4 value" )
150148   PORT_DIPSETTING(    0x1c, DEF_STR( 1C_1C ) )
151149   PORT_DIPSETTING(    0x18, DEF_STR( 1C_2C ) )
r6049r6050
203201
204202
205203   PORT_START("BIOS_J1")
206    PORT_DIPNAME( 0x0001, 0x0001, "5" )
207    PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
208    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
209    PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
210    PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
211    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
212    PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
213    PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
214    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
215    PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
216    PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
217    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
218    PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
219    PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
220    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
221    PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
222    PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
223    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
224    PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
225    PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
226    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
227    PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
228    PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
229    PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
204   PORT_DIPNAME( 0x0001, 0x0001, "5" )
205   PORT_DIPSETTING(      0x0001, DEF_STR( Off ) )
206   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
207   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
208   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
209   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
210   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
211   PORT_DIPSETTING(      0x0004, DEF_STR( Off ) )
212   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
213   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
214   PORT_DIPSETTING(      0x0008, DEF_STR( Off ) )
215   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
216   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
217   PORT_DIPSETTING(      0x0010, DEF_STR( Off ) )
218   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
219   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
220   PORT_DIPSETTING(      0x0020, DEF_STR( Off ) )
221   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
222   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
223   PORT_DIPSETTING(      0x0040, DEF_STR( Off ) )
224   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
225   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
226   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
227   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
230228
231229INPUT_PORTS_END
232230
233231/* MEGATECH specific */
234232
235static UINT8 mt_cart_select_reg;
236
237233static READ8_HANDLER( megatech_instr_r )
238234{
239   UINT8* instr = memory_region(space->machine, "mtbios")+0x8000;
235   UINT8* instr = memory_region(space->machine, "mtbios") + 0x8000;
240236
241   return instr[offset/2];
237   return instr[offset / 2];
242238//  else
243239//      return 0xff;
244240}
245241
246242static READ8_HANDLER( megatech_cart_select_r )
247243{
248   return (mt_cart_select_reg);
244   return mtech_bios.mt_cart_select_reg;
249245}
250246
251247#ifdef UNUSED_FUNCTION
r6049r6050
298294      if (bios_region[0x8000]==2)
299295      {
300296         printf("SMS cart!!, CPU not running\n");
301         current_game_is_sms = 1;
297         mtech_bios.current_game_is_sms = 1;
302298         megatech_set_genz80_as_sms_standard_map(machine, "genesis_snd_z80", MAPPER_STANDARD);
303299         cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_HALT, CLEAR_LINE);
304300         cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, CLEAR_LINE);
r6049r6050
308304      else if (bios_region[0x8000]==1)
309305      {
310306         printf("Genesis Cart, CPU0 running\n");
311         current_game_is_sms = 0;
307         mtech_bios.current_game_is_sms = 0;
312308         megatech_set_megadrive_z80_as_megadrive_z80(machine, "genesis_snd_z80");
313309         cputag_set_input_line(machine, "maincpu", INPUT_LINE_RESET, CLEAR_LINE);
314310         cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
r6049r6050
326322   //  cputag_set_input_line(machine, "genesis_snd_z80", INPUT_LINE_RESET, ASSERT_LINE);
327323
328324      /* no cart.. */
329      memset(memory_region(machine, "mtbios")+0x8000, 0x00, 0x8000);
325      memset(memory_region(machine, "mtbios") + 0x8000, 0x00, 0x8000);
330326      memset(memory_region(machine, "maincpu"), 0x00, 0x300000);
331327   }
332328
r6049r6050
342338
343339//  printf("megatech_instr_w %02x\n",data);
344340
345   mt_cart_select_reg = data;
341   mtech_bios.mt_cart_select_reg = data;
346342
347343
348   megatech_select_game(space->machine, mt_cart_select_reg);
344   megatech_select_game(space->machine, mtech_bios.mt_cart_select_reg);
349345
350346/*
351    if (mt_cart_select_reg==2)
347    if (mtech_bios.mtech_bios.mt_cart_select_reg == 2)
352348    {
353349        printf("game 2 selected\n");
354        memcpy(memory_region(space->machine, "mtbios")+0x8000, memory_region(space->machine, "inst0"), 0x8000);
350        memcpy(memory_region(space->machine, "mtbios") + 0x8000, memory_region(space->machine, "inst0"), 0x8000);
355351    }
356//  else if (mt_cart_select_reg==0)
352//  else if (mtech_bios.mt_cart_select_reg == 0)
357353//  {
358354//      printf("game 0 selected\n");
359//      memcpy(memory_region(space->machine, "mtbios")+0x8000, memory_region(space->machine, "inst2"), 0x8000);
355//      memcpy(memory_region(space->machine, "mtbios") + 0x8000, memory_region(space->machine, "inst2"), 0x8000);
360356//  }
361    else if (mt_cart_select_reg==6)
357    else if (mtech_bios.mt_cart_select_reg == 6)
362358    {
363359        printf("game 6 selected\n");
364        memcpy(memory_region(space->machine, "mtbios")+0x8000, memory_region(space->machine, "user6"), 0x8000);
360        memcpy(memory_region(space->machine, "mtbios") + 0x8000, memory_region(space->machine, "user6"), 0x8000);
365361    }
366362    else
367363    {
368        memset(memory_region(space->machine, "mtbios")+0x8000, 0x00, 0x8000);
364        memset(memory_region(space->machine, "mtbios" )+ 0x8000, 0x00, 0x8000);
369365    }
370366*/
371367
r6049r6050
378374   if(offset == 0)
379375      return 0;
380376   if(offset == 2)
381      return bios_ctrl[offset] & 0xfe;
377      return mtech_bios.bios_ctrl[offset] & 0xfe;
382378
383   return bios_ctrl[offset];
379   return mtech_bios.bios_ctrl[offset];
384380}
385381
386382static WRITE8_HANDLER( bios_ctrl_w )
387383{
388384   if(offset == 1)
389385   {
390      bios_ctrl_inputs = data & 0x04;  // Genesis/SMS input ports disable bit
386      mtech_bios.bios_ctrl_inputs = data & 0x04;  // Genesis/SMS input ports disable bit
391387   }
392   bios_ctrl[offset] = data;
388   mtech_bios.bios_ctrl[offset] = data;
393389}
394390
395391
396static int mt_bank_bank_pos = 0;
397static int mt_bank_partial = 0;
398static int mt_bank_addr = 0;
399
400392/* this sets 0x300000 which may indicate that the 68k can see the instruction rom
401393   there, this limiting the max game rom capacity to 3meg. */
402394static WRITE8_HANDLER (mt_z80_bank_w)
403395{
404   mt_bank_partial |= (data & 0x01)<<23; // add new bit to partial address
405   mt_bank_bank_pos++;
396   mtech_bios.mt_bank_partial |= (data & 0x01) << 23; // add new bit to partial address
397   mtech_bios.mt_bank_bank_pos++;
406398
407   if (mt_bank_bank_pos<9)
399   if (mtech_bios.mt_bank_bank_pos < 9)
408400   {
409      mt_bank_partial >>= 1;
401      mtech_bios.mt_bank_partial >>= 1;
410402   }
411403   else
412404   {
413      mt_bank_bank_pos = 0;
414      mt_bank_addr = mt_bank_partial;
415      mt_bank_partial = 0;
416      printf("MT z80 bank set to %08x\n",mt_bank_addr);
405      mtech_bios.mt_bank_bank_pos = 0;
406      mtech_bios.mt_bank_addr = mtech_bios.mt_bank_partial;
407      mtech_bios.mt_bank_partial = 0;
408      printf("MT z80 bank set to %08x\n", mtech_bios.mt_bank_addr);
417409
418410   }
419411}
420412
421413static READ8_HANDLER( megatech_banked_ram_r )
422414{
423   return megatech_banked_ram[offset + 0x1000 * (mt_cart_select_reg&0x7) ];
415   return megatech_banked_ram[offset + 0x1000 * (mtech_bios.mt_cart_select_reg & 0x07)];
424416}
425417
426418static WRITE8_HANDLER( megatech_banked_ram_w )
427419{
428   megatech_banked_ram[offset + 0x1000 * (mt_cart_select_reg&0x7) ] = data;
420   megatech_banked_ram[offset + 0x1000 * (mtech_bios.mt_cart_select_reg & 0x07)] = data;
429421}
430422
431423
r6049r6050
450442
451443static WRITE8_HANDLER (megatech_bios_port_ctrl_w)
452444{
453   bios_port_ctrl = data;
445   mtech_bios.bios_port_ctrl = data;
454446}
455447
456448static READ8_HANDLER (megatech_bios_joypad_r)
457449{
458   return megatech_bios_port_cc_dc_r(space->machine,offset,bios_port_ctrl);
450   return megatech_bios_port_cc_dc_r(space->machine, offset, mtech_bios.bios_port_ctrl);
459451}
460452
461453
462454
463455static WRITE8_HANDLER (megatech_bios_port_7f_w)
464456{
465//  popmessage("CPU #3: I/O port 0x7F write, data %02x",data);
457//  popmessage("CPU #3: I/O port 0x7F write, data %02x", data);
466458}
467459
468460
r6049r6050
501493   if (screen == megadriv_screen)
502494   {
503495      /* if we're running an sms game then use the SMS update.. maybe this should be moved to the megadrive emulation core as compatibility mode is a feature of the chip */
504      if (!current_game_is_sms) VIDEO_UPDATE_CALL(megadriv);
496      if (!mtech_bios.current_game_is_sms) VIDEO_UPDATE_CALL(megadriv);
505497      else VIDEO_UPDATE_CALL(megatech_md_sms);
506498   }
507499   else if (screen == menu_screen) VIDEO_UPDATE_CALL(megatech_bios);
r6049r6050
510502
511503static VIDEO_EOF(mtnew)
512504{
513   if (!current_game_is_sms) VIDEO_EOF_CALL(megadriv);
505   if (!mtech_bios.current_game_is_sms) VIDEO_EOF_CALL(megadriv);
514506   else VIDEO_EOF_CALL(megatech_md_sms);
515507   VIDEO_EOF_CALL(megatech_bios);
516508}
517509
518510static MACHINE_RESET(mtnew)
519511{
512   mtech_bios.mt_bank_bank_pos = 0;
513   mtech_bios.mt_bank_partial = 0;
514   mtech_bios.mt_bank_addr = 0;
515
520516   MACHINE_RESET_CALL(megadriv);
521517   MACHINE_RESET_CALL(megatech_bios);
522518   MACHINE_RESET_CALL(megatech_md_sms);
src/mame/drivers/galdrvr.c
r6049r6050
549549INPUT_PORTS_END
550550
551551
552static INPUT_PORTS_START( pacmanbl )
552static INPUT_PORTS_START( articms )
553553   PORT_START("IN0")
554554   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
555555   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
556   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
557   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
558   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
559   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
560   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
561   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
556   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
557   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
558   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
559   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
560   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_COCKTAIL
561   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
562562
563563   PORT_START("IN1")
564564   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
565565   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
566   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
567   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
568   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
569   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
566   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_COCKTAIL
567   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
568   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
569   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_COCKTAIL
570570   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
571571   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
572572   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
r6049r6050
575575   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
576576
577577   PORT_START("IN2")
578   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
579   PORT_DIPSETTING(    0x00, "15000" )
580   PORT_DIPSETTING(    0x01, "20000" )
578   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) /* Likely Bonus Life */
579   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
580   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
581581   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
582582   PORT_DIPSETTING(    0x00, DEF_STR( Easy ) )
583583   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
r6049r6050
587587   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
588588   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
589589   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
590   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
591   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
592   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
593   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
594   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
595   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
596   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
597   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
598   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
599   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
600   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
601   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
602INPUT_PORTS_END
603
604
605static INPUT_PORTS_START( pacmanbl )
606   PORT_INCLUDE(articms)
607
608   PORT_MODIFY("IN0")
609   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
610   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
611   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
612   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
613   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
615
616   PORT_MODIFY("IN1")
617   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
618   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
619   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
620   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
621
622   PORT_MODIFY("IN2")
623   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
624   PORT_DIPSETTING(    0x00, "15000" )
625   PORT_DIPSETTING(    0x01, "20000" )
590626   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
591627INPUT_PORTS_END
592628
593629
630static INPUT_PORTS_START( phoenxp2 )
631   PORT_INCLUDE(articms)
632INPUT_PORTS_END
633
634
635static INPUT_PORTS_START( atlantib )
636   PORT_INCLUDE(articms)
637
638   PORT_MODIFY("IN1")
639   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coin_A ) ) /* These are backwards compared to the other sets??? */
640   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
641   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
642
643   PORT_MODIFY("IN2")
644   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) ) /* These are backwards compared to the other sets??? */
645   PORT_DIPSETTING(    0x04, "3" )
646   PORT_DIPSETTING(    0x00, "5" )
647   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) ) /* These are backwards compared to the other sets??? */
648   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
649   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
650INPUT_PORTS_END
651
652
594653static INPUT_PORTS_START( devilfsg )
595654   PORT_INCLUDE(pacmanbl)
596655
r6049r6050
11991258
12001259   PORT_MODIFY("IN1")
12011260   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(kingball_noise_r, NULL)   /* NOISE line */
1261   PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
1262   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
1263   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1264   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
1265   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
12021266
12031267   PORT_MODIFY("IN2")
12041268   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
r6049r6050
27682832   ROM_LOAD( "omega1k.bin",  0x0800, 0x0800, CRC(36de42c6) SHA1(6fd93d439e3b8eab62049f925d9e8f8deeda2ae3) )
27692833
27702834   ROM_REGION( 0x0020, "proms", 0 )
2771   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, NO_DUMP )   /* missing */
2835   ROM_LOAD( "mmi6331-1j.86",   0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
27722836ROM_END
27732837
27742838
r6049r6050
30873151   ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
30883152ROM_END
30893153
3090
3091ROM_START( streakng )
3092   ROM_REGION( 0x10000, "maincpu", 0 )
3093   ROM_LOAD( "sk1",          0x0000, 0x1000, CRC(c8866ccb) SHA1(1fc8bc643ecbfa86a50448d79b299f5a3dd586c5) )
3094   ROM_LOAD( "sk2",          0x1000, 0x1000, CRC(7caea29b) SHA1(5b3946ee914b1637db9046abf92d66ceaeb4fc5f) )
3095   ROM_LOAD( "sk3",          0x2000, 0x1000, CRC(7b4bfa76) SHA1(9223bec0c1cc39bc84670869b2a4fab0d0167c6e) )
3096   ROM_LOAD( "sk4",          0x3000, 0x1000, CRC(056fc921) SHA1(de8525571e5a82ddf74dd57b1a6c5bc9f2d2c0fe) )
3097
3098   ROM_REGION( 0x1000, "gfx1", 0 )
3099   ROM_LOAD( "sk5",          0x0000, 0x1000, CRC(d27f1e0c) SHA1(c3b4ae55a93516b034a16c9f943b360b24c933d6) )
3100
3101   ROM_REGION( 0x1000, "gfx2", 0 )
3102   ROM_LOAD( "sk6",          0x0000, 0x1000, CRC(a7089588) SHA1(e76242b043b1d8f060f669da3ddeee3d10122cdb) )
3103
3104   ROM_REGION( 0x0020, "proms", 0 )
3105   ROM_LOAD( "sk.bpr",       0x0000, 0x0020, CRC(bce79607) SHA1(49d60fde149240bcd025f721b0fbbbdbc549a42f) )
3106ROM_END
3107
3108ROM_START( pacmanbl ) /* Galaxian bootleg hardware known as Artic Multi-System */
3109   ROM_REGION( 0x10000, "maincpu", 0 )
3110   ROM_LOAD( "blpac1b",      0x0000, 0x0800, CRC(6718df42) SHA1(ee15c3f583d381fba4878f824f83d04479a0cee5) )
3111   ROM_LOAD( "blpac2b",      0x0800, 0x0800, CRC(33be3648) SHA1(50175889cf37fe8a81c931e009b55d10f8d0444a) )
3112   ROM_LOAD( "blpac3b",      0x1000, 0x0800, CRC(f98c0ceb) SHA1(4faf8b2fb3f109d1196a9ea256328485074a31b9) )
3113   ROM_LOAD( "blpac4b",      0x1800, 0x0800, CRC(a9cd0082) SHA1(f44ff1ad15d5ee3096f8f44f9c605f32ae2737d9) )
3114   ROM_LOAD( "blpac5b",      0x2000, 0x0800, CRC(6d475afc) SHA1(4fe6bde352c7dd9572fefaae4b59640b4f4eb8ba) )
3115   ROM_LOAD( "blpac6b",      0x2800, 0x0800, CRC(cbe863d3) SHA1(97a2ffa6ab33e6061c664dcd1ee57c86a456782f) )
3116   ROM_LOAD( "blpac7b",      0x3000, 0x0800, CRC(7daef758) SHA1(4dc8ec0ea8fc04d5bffc1c1335407729309c17f0) )
3117
3118   /* note from f205v: on the PCB I have, 10b and 11b have been joined into one single 2732 EPROM labeled "pmc31"
3119    The same goes for 9b and 12b, joined into one single 2732 EPROM labeled "pmc42" */
3120   ROM_REGION( 0x1000, "gfx1", 0 )
3121   ROM_LOAD( "blpac12b",     0x0000, 0x0800, CRC(b2ed320b) SHA1(680a6fdcb65cc2d88d10bc85e0b2628f43375c5c) )
3122   ROM_LOAD( "blpac11b",     0x0800, 0x0800, CRC(ab88b2c4) SHA1(d0c829ea8021eae81a2b82d36c35ad8258b115e0) )
3123
3124   ROM_REGION( 0x1000, "gfx2", 0 )
3125   ROM_LOAD( "blpac10b",     0x0000, 0x0800, CRC(44a45b72) SHA1(8abd0684a01d6c23ef5cf5f0765458f982316acf) )
3126   ROM_LOAD( "blpac9b",      0x0800, 0x0800, CRC(fa84659f) SHA1(20c212723f9062f052539190dfe3fc41577543eb) )
3127
3128   ROM_REGION( 0x0020, "proms", 0 )
3129   ROM_LOAD( "blpaccp",      0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* same as pisces */
3130ROM_END
3131
3132/* content is the same as the above bootleg, but arranged differently in the roms */
3133ROM_START( pacmanbla )
3134   ROM_REGION( 0x10000, "maincpu", 0 )
3135   ROM_LOAD( "rom1.bin",      0x0000, 0x0800, CRC(75e4f967) SHA1(8bdb5ab2b3f978c578f1498b64bb16d2cb292ef2) )
3136   ROM_CONTINUE(0x2000,0x800)
3137   ROM_LOAD( "rom2.bin",      0x0800, 0x0800, CRC(5b2e4293) SHA1(bb925491e315d2e6bb9e756bdf664d173f83cd58) )
3138   ROM_CONTINUE(0x2800,0x800)
3139   ROM_LOAD( "rom3.bin",      0x1000, 0x0800, CRC(c06e30a4) SHA1(00d8d114bd4e0b689e75e312c93f6c7b8492426e) )
3140   ROM_CONTINUE(0x3000,0x800)
3141   ROM_LOAD( "rom4.bin",      0x1800, 0x0800, CRC(592b4ba8) SHA1(52a559344f70cd8a3a87de71de2bae57c885641a) )
3142   ROM_CONTINUE(0x3800,0x800)
3143
3144   ROM_REGION( 0x2000, "tempgfx", 0 )
3145   ROM_LOAD( "rom5.bin",      0x0000, 0x1000, CRC(f2d8c01e) SHA1(d4a5789476fa7859bb936df10590775e97e87578) )
3146   ROM_LOAD( "rom6.bin",      0x1000, 0x1000, CRC(346a1720) SHA1(e152c9161f4e8ef53153b9c4a8ecef9fdbbe2463) )
3147
3148   ROM_REGION( 0x1000, "gfx1", 0 )
3149   ROM_COPY( "tempgfx", 0x0800, 0x0000, 0x0800 )
3150   ROM_COPY( "tempgfx", 0x1800, 0x0800, 0x0800 )
3151
3152   ROM_REGION( 0x1000, "gfx2", 0 )
3153   ROM_COPY( "tempgfx", 0x0000, 0x0000, 0x0800 )
3154   ROM_COPY( "tempgfx", 0x1000, 0x0800, 0x0800 )
3155
3156   ROM_REGION( 0x0020, "proms", 0 )
3157   ROM_LOAD( "blpaccp",      0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* same as pisces */
3158ROM_END
3159
31603154ROM_START( devilfsg )
31613155   ROM_REGION( 0x10000, "maincpu", 0 )
31623156   ROM_LOAD( "dfish1.7f",    0x2000, 0x0800, CRC(2ab19698) SHA1(8450981d3cf3fa8abf2fb5487aa98b03a4cf03a1) )
r6049r6050
32583252ROM_END
32593253
32603254
3255/*************************************
3256 *
3257 *  ROM definitions
3258 *  Artic Multi-System (Galaxian bootleg hardware)
3259 *  About 20 games were available on this system, some unique!
3260 *
3261 *************************************/
32613262
3263ROM_START( streakng )
3264   ROM_REGION( 0x10000, "maincpu", 0 )
3265   ROM_LOAD( "sk1",          0x0000, 0x1000, CRC(c8866ccb) SHA1(1fc8bc643ecbfa86a50448d79b299f5a3dd586c5) )
3266   ROM_LOAD( "sk2",          0x1000, 0x1000, CRC(7caea29b) SHA1(5b3946ee914b1637db9046abf92d66ceaeb4fc5f) )
3267   ROM_LOAD( "sk3",          0x2000, 0x1000, CRC(7b4bfa76) SHA1(9223bec0c1cc39bc84670869b2a4fab0d0167c6e) )
3268   ROM_LOAD( "sk4",          0x3000, 0x1000, CRC(056fc921) SHA1(de8525571e5a82ddf74dd57b1a6c5bc9f2d2c0fe) )
3269
3270   ROM_REGION( 0x1000, "gfx1", 0 )
3271   ROM_LOAD( "sk5",          0x0000, 0x1000, CRC(d27f1e0c) SHA1(c3b4ae55a93516b034a16c9f943b360b24c933d6) )
3272
3273   ROM_REGION( 0x1000, "gfx2", 0 )
3274   ROM_LOAD( "sk6",          0x0000, 0x1000, CRC(a7089588) SHA1(e76242b043b1d8f060f669da3ddeee3d10122cdb) )
3275
3276   ROM_REGION( 0x0020, "proms", 0 )
3277   ROM_LOAD( "sk.bpr",       0x0000, 0x0020, CRC(bce79607) SHA1(49d60fde149240bcd025f721b0fbbbdbc549a42f) )
3278ROM_END
3279
3280ROM_START( pacmanbl ) /* Artic Multi-System */
3281   ROM_REGION( 0x10000, "maincpu", 0 )
3282   ROM_LOAD( "1",  0x0000, 0x0800, CRC(6718df42) SHA1(ee15c3f583d381fba4878f824f83d04479a0cee5) )
3283   ROM_LOAD( "2",  0x0800, 0x0800, CRC(33be3648) SHA1(50175889cf37fe8a81c931e009b55d10f8d0444a) )
3284   ROM_LOAD( "3",  0x1000, 0x0800, CRC(f98c0ceb) SHA1(4faf8b2fb3f109d1196a9ea256328485074a31b9) )
3285   ROM_LOAD( "4",  0x1800, 0x0800, CRC(a9cd0082) SHA1(f44ff1ad15d5ee3096f8f44f9c605f32ae2737d9) )
3286   ROM_LOAD( "5",  0x2000, 0x0800, CRC(6d475afc) SHA1(4fe6bde352c7dd9572fefaae4b59640b4f4eb8ba) )
3287   ROM_LOAD( "6",  0x2800, 0x0800, CRC(cbe863d3) SHA1(97a2ffa6ab33e6061c664dcd1ee57c86a456782f) )
3288   ROM_LOAD( "7",  0x3000, 0x0800, CRC(7daef758) SHA1(4dc8ec0ea8fc04d5bffc1c1335407729309c17f0) )
3289   /*              0x3800, 0x0800 not populated */
3290
3291   /* note from f205v: on the PCB I have, 10b and 11b have been joined into one single 2732 EPROM labeled "pmc31"
3292    The same goes for 9b and 12b, joined into one single 2732 EPROM labeled "pmc42" */
3293   ROM_REGION( 0x1000, "gfx1", 0 )
3294   ROM_LOAD( "12",  0x0000, 0x0800, CRC(b2ed320b) SHA1(680a6fdcb65cc2d88d10bc85e0b2628f43375c5c) )
3295   ROM_LOAD( "11",  0x0800, 0x0800, CRC(ab88b2c4) SHA1(d0c829ea8021eae81a2b82d36c35ad8258b115e0) )
3296
3297   ROM_REGION( 0x1000, "gfx2", 0 )
3298   ROM_LOAD( "10",  0x0000, 0x0800, CRC(44a45b72) SHA1(8abd0684a01d6c23ef5cf5f0765458f982316acf) )
3299   ROM_LOAD( "9",   0x0800, 0x0800, CRC(fa84659f) SHA1(20c212723f9062f052539190dfe3fc41577543eb) )
3300
3301   ROM_REGION( 0x0020, "proms", 0 )
3302   ROM_LOAD( "sn74s288n.6l", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* same as pisces */
3303ROM_END
3304
3305ROM_START( pacmanbla ) /* content is the same as the above bootleg, but arranged differently in the roms */
3306   ROM_REGION( 0x10000, "maincpu", 0 )
3307   ROM_LOAD( "rom1.bin",      0x0000, 0x0800, CRC(75e4f967) SHA1(8bdb5ab2b3f978c578f1498b64bb16d2cb292ef2) )
3308   ROM_CONTINUE(0x2000,0x800)
3309   ROM_LOAD( "rom2.bin",      0x0800, 0x0800, CRC(5b2e4293) SHA1(bb925491e315d2e6bb9e756bdf664d173f83cd58) )
3310   ROM_CONTINUE(0x2800,0x800)
3311   ROM_LOAD( "rom3.bin",      0x1000, 0x0800, CRC(c06e30a4) SHA1(00d8d114bd4e0b689e75e312c93f6c7b8492426e) )
3312   ROM_CONTINUE(0x3000,0x800)
3313   ROM_LOAD( "rom4.bin",      0x1800, 0x0800, CRC(592b4ba8) SHA1(52a559344f70cd8a3a87de71de2bae57c885641a) )
3314   ROM_CONTINUE(0x3800,0x800)
3315
3316   ROM_REGION( 0x2000, "tempgfx", 0 )
3317   ROM_LOAD( "rom5.bin",      0x0000, 0x1000, CRC(f2d8c01e) SHA1(d4a5789476fa7859bb936df10590775e97e87578) )
3318   ROM_LOAD( "rom6.bin",      0x1000, 0x1000, CRC(346a1720) SHA1(e152c9161f4e8ef53153b9c4a8ecef9fdbbe2463) )
3319
3320   ROM_REGION( 0x1000, "gfx1", 0 )
3321   ROM_COPY( "tempgfx", 0x0800, 0x0000, 0x0800 )
3322   ROM_COPY( "tempgfx", 0x1800, 0x0800, 0x0800 )
3323
3324   ROM_REGION( 0x1000, "gfx2", 0 )
3325   ROM_COPY( "tempgfx", 0x0000, 0x0000, 0x0800 )
3326   ROM_COPY( "tempgfx", 0x1000, 0x0800, 0x0800 )
3327
3328   ROM_REGION( 0x0020, "proms", 0 )
3329   ROM_LOAD( "sn74s288n.6l", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) ) /* same as pisces */
3330ROM_END
3331
3332ROM_START( phoenxp2 ) /* Artic Multi-System */
3333   /* Large birds never appeared 'whole' even when they were displayed correctly on real hardware, this may be a rom error, or something else. */
3334   ROM_REGION( 0x10000, "maincpu", 0 )
3335   ROM_LOAD( "1",  0x0000, 0x0800, CRC(f6dcfd51) SHA1(8475726dbbf0dd13581f457a5379956424dc2862) )
3336   ROM_LOAD( "2",  0x0800, 0x0800, CRC(de951936) SHA1(657d2c595a5864d8c9a51926ab7bfa0a7068e2b2) )
3337   ROM_LOAD( "3",  0x1000, 0x0800, CRC(7a3af2da) SHA1(49e9ad7115e71839d1d027552d08c7831a617b4a) )
3338   ROM_LOAD( "4",  0x1800, 0x0800, CRC(c820ad32) SHA1(b5286d49f6578dfeffdf429e7d52321f4813e03c) )
3339   ROM_LOAD( "5",  0x2000, 0x0800, CRC(08e83233) SHA1(44159e0f3fb717b726b6b5c77da32391c1cdd04d) )
3340   ROM_LOAD( "6",  0x2800, 0x0800, CRC(f31fb9d6) SHA1(bdfb5427869940ed6b8e2667a6c1f410a9a41b87) )
3341   ROM_LOAD( "7",  0x3000, 0x0800, CRC(d3a480c1) SHA1(d1e4fe83b49f918285009f09df38c6555a686823) )
3342   ROM_LOAD( "8",  0x3800, 0x0800, CRC(edf9779e) SHA1(c1e7307c59f15bebac3e29b41135fe9f18fc9a06) )
3343
3344   ROM_REGION( 0x1000, "gfx1", 0 )
3345   ROM_LOAD( "10",  0x0000, 0x0800, CRC(9b570016) SHA1(44fd2b1caeecdc5200d63c35636f0a605943d30c) )
3346   ROM_LOAD( "9",   0x0800, 0x0800, CRC(1a657b1f) SHA1(42149dafdde7d9104f0bddda2223bfc211d0154a) )
3347
3348   ROM_REGION( 0x1000, "gfx2", 0 )
3349   ROM_LOAD( "12",  0x0000, 0x0800, BAD_DUMP CRC(73956244) SHA1(e464b587b5ed636816cc9688593f5b6005cb5216) ) /* possible bad_dump... seems to be missing graphics */
3350   ROM_LOAD( "11",  0x0800, 0x0800, CRC(7a2b48e5) SHA1(f559799c685dd2cb9de06a356bee95b7d6ffadfc) )
3351
3352   ROM_REGION( 0x0020, "proms", 0 )
3353   ROM_LOAD( "sn74s288n.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) ) /* same as 'Omega' */
3354ROM_END
3355
3356ROM_START( atlantisb ) /* Artic Multi-System */
3357   ROM_REGION( 0x10000, "maincpu", 0 )
3358   ROM_LOAD( "1",  0x0000, 0x0800, CRC(2b612351) SHA1(cfd244946190c062146716c0417c35be216943e4) ) /* aka "subfury" */
3359   ROM_LOAD( "2",  0x0800, 0x0800, CRC(b1c970e9) SHA1(1e12a1d34453b01ff5ef4d9530a90f476fc34631) )
3360   /*              0x1000, 0x0800 not populated */
3361   ROM_LOAD( "3",  0x1800, 0x0800, CRC(63c3783e) SHA1(e3a7a8bb2c108d3e1e1403017c72963afcd23813) )
3362   ROM_LOAD( "4",  0x2000, 0x0800, CRC(45f7cf34) SHA1(d1e0e0be6dec377b684625bdfdc5a3a8af847492) )
3363   ROM_LOAD( "5",  0x2800, 0x0800, CRC(f335b96b) SHA1(17daa6d9bc916081f3c6cbdfe5b4960177dc7c9b) )
3364   ROM_LOAD( "6",  0x3000, 0x0800, CRC(a50bf8d5) SHA1(5bca98e1c0838d27ec66bf4b906877977b212b6d) )
3365   /*              0x3800, 0x0800 not populated */
3366
3367   ROM_REGION( 0x1000, "gfx1", 0 )
3368   ROM_LOAD( "8",  0x0000, 0x0800, CRC(55cd5acd) SHA1(b3e2ce71d4e48255d44cd451ee015a7234a108c8) )
3369   ROM_LOAD( "7",  0x0800, 0x0800, CRC(72e773b8) SHA1(6ce178df3bd6a4177c68761572a13a56d222c48f) )
3370
3371   ROM_REGION( 0x1000, "gfx2", 0 )
3372   /* 0x000, 0x0800 not populated */
3373   /* 0x000, 0x0800 not populated */
3374
3375   ROM_REGION( 0x0020, "proms", 0 )
3376   ROM_LOAD( "sn74s288n.6l", 0x0000, 0x0020, CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3377ROM_END
3378
3379
32623380/*************************************
32633381 *
32643382 *  ROM definitions
r6049r6050
40324150
40334151ROM_START( froggers1 )
40344152   ROM_REGION( 0x10000, "maincpu", 0 )
4035   ROM_LOAD( "frogger.26",   0x0000, 0x1000, CRC(597696d6) SHA1(e7e021776cad00f095a1ebbef407b7c0a8f5d835) )
4153   ROM_LOAD( "frogger.26",   0x0000, 0x1000, CRC(597696d6) SHA1(e7e021776cad00f095a1ebbef407b7c0a8f5d835) ) /* We need the correct Sega "EPR" labels for these 3 */
40364154   ROM_LOAD( "frogger.27",   0x1000, 0x1000, CRC(b6e6fcc3) SHA1(5e8692f2b0c7f4b3642b3ee6670e1c3b20029cdc) )
40374155   ROM_LOAD( "frogger.34",   0x2000, 0x1000, CRC(ed866bab) SHA1(24e1bbde44eb5480b7a0570fa0dc1de388cb95ba) )
40384156
40394157   ROM_REGION( 0x10000, "audiocpu", 0 )
4040   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
4041   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
4042   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
4158   ROM_LOAD( "epr-608.ic32",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
4159   ROM_LOAD( "epr-609.ic33",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
4160   ROM_LOAD( "epr-610.ic34",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
40434161
40444162   ROM_REGION( 0x1000, "gfx1", 0 )
4045   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
4046   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
4163   ROM_LOAD( "epr-607.ic101",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
4164   ROM_LOAD( "epr-606.ic102",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
40474165
40484166   ROM_REGION( 0x0020, "proms", 0 )
40494167   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
r6049r6050
40514169
40524170ROM_START( froggers2 )
40534171   ROM_REGION( 0x10000, "maincpu", 0 )
4054   ROM_LOAD( "frogger.ic5",  0x0000, 0x1000, CRC(efab0c79) SHA1(68c99b6cdcb9396bb473739a62ffc009b4bf57d5) )
4055   ROM_LOAD( "frogger.ic6",  0x1000, 0x1000, CRC(aeca9c13) SHA1(cdf560adbd7f2813e86e378da7781cccf7928a44) )
4056   ROM_LOAD( "frogger.ic7",  0x2000, 0x1000, CRC(dd251066) SHA1(4612e1fe1ab7182a277140b1a1976cc17e0746a5) )
4057   ROM_LOAD( "frogger.ic8",  0x3000, 0x1000, CRC(bf293a02) SHA1(be94e9f5caa74c3de6fd95bd20928f4a9c514227) )
4172   ROM_LOAD( "epr-1012.ic5",  0x0000, 0x1000, CRC(efab0c79) SHA1(68c99b6cdcb9396bb473739a62ffc009b4bf57d5) )
4173   ROM_LOAD( "epr-1013.ic6",  0x1000, 0x1000, CRC(aeca9c13) SHA1(cdf560adbd7f2813e86e378da7781cccf7928a44) )
4174   ROM_LOAD( "epr-1014.ic7",  0x2000, 0x1000, CRC(dd251066) SHA1(4612e1fe1ab7182a277140b1a1976cc17e0746a5) )
4175   ROM_LOAD( "epr-1018.ic8",  0x3000, 0x1000, CRC(bf293a02) SHA1(be94e9f5caa74c3de6fd95bd20928f4a9c514227) )
40584176
40594177   ROM_REGION( 0x10000, "audiocpu", 0 )
4060   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
4061   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
4062   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
4178   ROM_LOAD( "epr-608.ic32",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
4179   ROM_LOAD( "epr-609.ic33",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
4180   ROM_LOAD( "epr-610.ic34",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
40634181
40644182   ROM_REGION( 0x1000, "gfx1", 0 )
4065   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
4066   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
4183   ROM_LOAD( "epr-607.ic101",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
4184   ROM_LOAD( "epr-606.ic102",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
40674185
40684186   ROM_REGION( 0x0020, "proms", 0 )
40694187   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
r6049r6050
40814199   ROM_LOAD( "epr-1035.43",  0x1000, 0x0800, CRC(14e74148) SHA1(0023394e971f191c41ff20b47835f1dafb924d15) )
40824200
40834201   ROM_REGION( 0x1000, "gfx1", 0 )
4084   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
4202   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) ) /* We need the correct Sega "EPR" label for this one */
40854203   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
40864204
40874205   ROM_REGION( 0x0020, "proms", 0 )
r6049r6050
51535271/* similar to pisces, but with different video banking characteristics */
51545272GAME( 1981, batman2,  phoenix,  galaxian, batman2,  batman2,  ROT270, "bootleg", "Batman Part 2", GAME_SUPPORTS_SAVE )
51555273
5156/* separate tile/sprite ROMs */
5274/* Artic Multi-System games - separate tile/sprite ROMs */
51575275GAME( 1981, streakng, 0,        pacmanbl, streakng, galaxian, ROT90,  "Shoei", "Streaking", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
51585276GAME( 1981, pacmanbl, puckman,  pacmanbl, pacmanbl, pacmanbl, ROT270, "bootleg", "Pac-Man (Galaxian hardware, set 1)", GAME_SUPPORTS_SAVE )
51595277GAME( 1981, pacmanbla,puckman,  pacmanbl, pacmanbl, pacmanbl, ROT270, "bootleg", "Pac-Man (Galaxian hardware, set 2)", GAME_SUPPORTS_SAVE )
5278GAME( 1981, phoenxp2, 0,        pacmanbl, phoenxp2, galaxian, ROT270, "bootleg", "Phoenix Part 2", GAME_SUPPORTS_SAVE )
5279GAME( 1981, atlantisb,atlantis, galaxian, atlantib, galaxian, ROT270, "bootleg", "Battle of Atlantis (bootleg)", GAME_SUPPORTS_SAVE ) // I don't know if this should have a starfield...
51605280
51615281/* separate tile/sprite ROMs, plus INT instead of NMI */
51625282GAME( 1984, devilfsg, devilfsh, pacmanbl, devilfsg, devilfsg, ROT270, "Vision / Artic", "Devil Fish (Galaxian hardware, bootleg?)", GAME_SUPPORTS_SAVE )
src/mame/drivers/taito_h.c
r6049r6050
1212
1313Supported games :
1414==================
15 Syvalion          (C) 1988 Taito
16 Record Breaker    (C) 1988 Taito
17 Dynamite League   (C) 1990 Taito
15 Syvalion                           (C) 1988 Taito
16 Record Breaker / Go For The Gold   (C) 1988 Taito
17 Dynamite League                    (C) 1990 Taito
1818
1919
2020System specs :
r6049r6050
6767    (see code at 0x002af8). Another write to this address is done at 0x002a96.
6868
6969
702) 'recordbr'
702) 'recordbr' and 'gogold'
7171
7272  - Region stored at 0x07fffe.w
73  - Title stored at 0x07ff9a.w :
74      * 0x0000 : "Go For The Gold"
75      * 0x0001 : "Recordbreaker"
7376  - Sets :
74      * 'recordbr' : region = 0x0003
77      * 'recordbr' : region = 0x0003 and title = 0x0001
78      * 'gogold'   : region = 0x0001 and title = 0x0000
7579  - Coinage relies on the region (code at 0x00144a) :
76      * 0x0001 (Japan), 0x0002 (US), 0x0005 (US, Romstar licence) use TAITO_COINAGE_JAPAN_OLD
80      * 0x0001 (Japan), 0x0002 (US), 0x0005 (World, Romstar licence) and
81        0x0006 (US, Romstar licence) use TAITO_COINAGE_JAPAN_OLD
7782      * 0x0003 (World), 0x0004 (licenced to xxx) and
7883        0x0007 (licenced to PHOENIX ELECTRONICS CO.) use TAITO_COINAGE_WORLD
79  - Notice screen only if region = 0x0001
84  - Notice screen only if region = 0x0000 or region = 0x0001
8085
86  - Debug Mode (from Shimapong)
87    1. Hold Service Switch at boot (key "9")
88    2. Input the following sequence at the "Service Switch Error" message screen:
89    1P Start, 1P Start, 1P Start, Service Switch, 1P Start
8190
91
82923) 'dleague'
8393
8494  - Region stored at 0x05fffe.w
r6049r6050
122132Recordbr: missing hand of opponent when he ends in swimming
123133race and you're still on the blocks. Bug?
124134
125Recordbr: loads of unmapped IOC reads and writes.
135Recordbr: loads of unmapped IOC reads and writes. Need to map Player 3 & 4 controls.
126136
137what is the rom loaded into region user1? (see go gold / dynamite league)
138some kind of zoom table?
139
127140****************************************************************************/
128141
129142
r6049r6050
414427   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )                 /* IPT_BUTTON4 (PL2) in service mode */
415428INPUT_PORTS_END
416429
430
431static INPUT_PORTS_START( gogold )
432   PORT_INCLUDE(recordbr)
433
434   PORT_MODIFY("DSWA")
435   TAITO_COINAGE_JAPAN_OLD
436INPUT_PORTS_END
437
417438static INPUT_PORTS_START( dleague )
418439   /* 0x200000 -> 0x100526.b ($526,A5) */
419440   PORT_START("DSWA")
r6049r6050
503524
504525static GFXDECODE_START( dleague )
505526   GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0,     32 )
506   GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*16, 16    )   // seems to be bogus...?
507527GFXDECODE_END
508528
509529
r6049r6050
688708
689709ROM_START( recordbr )
690710   ROM_REGION( 0x80000, "maincpu", 0 )      /* main cpu */
691   ROM_LOAD16_BYTE( "b56-17.rom", 0x00000, 0x20000, CRC(3e0a9c35) SHA1(900a741b2abbbbe883b9d78162a88b4397af1a56) )
692   ROM_LOAD16_BYTE( "b56-16.rom", 0x00001, 0x20000, CRC(b447f12c) SHA1(58ee30337836f260c7fbda728dac93f06d861ec4) )
693   ROM_LOAD16_BYTE( "b56-15.rom", 0x40000, 0x20000, CRC(b346e282) SHA1(f6b4a2e9093a33d19c2eaf3ef9801179f39a83a3) )
694   ROM_LOAD16_BYTE( "b56-21.rom", 0x40001, 0x20000, CRC(e5f63790) SHA1(b81db7690a989146c438609d9633ddcb1fd219dd) )
711   ROM_LOAD16_BYTE( "b56-17.bin", 0x00000, 0x20000, CRC(3e0a9c35) SHA1(900a741b2abbbbe883b9d78162a88b4397af1a56) )
712   ROM_LOAD16_BYTE( "b56-16.bin", 0x00001, 0x20000, CRC(b447f12c) SHA1(58ee30337836f260c7fbda728dac93f06d861ec4) )
713   ROM_LOAD16_BYTE( "b56-15.bin", 0x40000, 0x20000, CRC(b346e282) SHA1(f6b4a2e9093a33d19c2eaf3ef9801179f39a83a3) )
714   ROM_LOAD16_BYTE( "b56-21.bin", 0x40001, 0x20000, CRC(e5f63790) SHA1(b81db7690a989146c438609d9633ddcb1fd219dd) )
695715
696716   ROM_REGION( 0x1c000, "audiocpu", 0 )      /* sound cpu */
697   ROM_LOAD( "b56-19.rom", 0x00000, 0x04000, CRC(c68085ee) SHA1(78634216a622a08c20dae0422283c4a7ed360546) )
717   ROM_LOAD( "b56-19.bin", 0x00000, 0x04000, CRC(c68085ee) SHA1(78634216a622a08c20dae0422283c4a7ed360546) )
698718   ROM_CONTINUE(           0x10000, 0x0c000 )
699719
700720   ROM_REGION( 0x400000, "gfx1", 0 )
701   ROM_LOAD16_BYTE( "b56-04",     0x000000, 0x20000, CRC(f7afdff0) SHA1(8f8ea0e8da20913426ff3b58d7bb63bd352d3fb4) )
702   ROM_LOAD16_BYTE( "b56-08",     0x000001, 0x20000, CRC(c9f0d38a) SHA1(aa22f1a06e00f90c546eebcd8b42da3e3c7d0781) )
703   ROM_LOAD16_BYTE( "b56-03",     0x100000, 0x20000, CRC(4045fd44) SHA1(a84be9eedba7aed30d4f2841016784f8024d9443) )
704   ROM_LOAD16_BYTE( "b56-07",     0x100001, 0x20000, CRC(0c76e4c8) SHA1(e50d1bd6e8ec967ba03bd14097a9bd560aa2decc) )
705   ROM_LOAD16_BYTE( "b56-02",     0x200000, 0x20000, CRC(68c604ec) SHA1(75b26bfa53efa63b9c7a026f4226213364550cad) )
706   ROM_LOAD16_BYTE( "b56-06",     0x200001, 0x20000, CRC(5fbcd302) SHA1(22e7d835643945d501edc693dbe4efc8d4d074a7) )
707   ROM_LOAD16_BYTE( "b56-01.rom", 0x300000, 0x20000, CRC(766b7260) SHA1(f7d7176af614f06e8c66e890e4d194ffb6f7af73) )
708   ROM_LOAD16_BYTE( "b56-05.rom", 0x300001, 0x20000, CRC(ed390378) SHA1(0275e5ead206028bfcff7ecbe11c7ab961e648ea) )
721   ROM_LOAD16_BYTE( "b56-04.bin", 0x000000, 0x20000, CRC(f7afdff0) SHA1(8f8ea0e8da20913426ff3b58d7bb63bd352d3fb4) )
722   ROM_LOAD16_BYTE( "b56-08.bin", 0x000001, 0x20000, CRC(c9f0d38a) SHA1(aa22f1a06e00f90c546eebcd8b42da3e3c7d0781) )
723   ROM_LOAD16_BYTE( "b56-03.bin", 0x100000, 0x20000, CRC(4045fd44) SHA1(a84be9eedba7aed30d4f2841016784f8024d9443) )
724   ROM_LOAD16_BYTE( "b56-07.bin", 0x100001, 0x20000, CRC(0c76e4c8) SHA1(e50d1bd6e8ec967ba03bd14097a9bd560aa2decc) )
725   ROM_LOAD16_BYTE( "b56-02.bin", 0x200000, 0x20000, CRC(68c604ec) SHA1(75b26bfa53efa63b9c7a026f4226213364550cad) )
726   ROM_LOAD16_BYTE( "b56-06.bin", 0x200001, 0x20000, CRC(5fbcd302) SHA1(22e7d835643945d501edc693dbe4efc8d4d074a7) )
727   ROM_LOAD16_BYTE( "b56-01.bin", 0x300000, 0x20000, CRC(766b7260) SHA1(f7d7176af614f06e8c66e890e4d194ffb6f7af73) )
728   ROM_LOAD16_BYTE( "b56-05.bin", 0x300001, 0x20000, CRC(ed390378) SHA1(0275e5ead206028bfcff7ecbe11c7ab961e648ea) )
709729
710730   ROM_REGION( 0x80000, "ym.deltat", 0 )   /* samples */
711731   ROM_LOAD( "b56-09.bin", 0x00000, 0x80000, CRC(7fd9ee68) SHA1(edc4455b3f6a6f30f418d03c6e53af875542a325) )
712732
713733   ROM_REGION( 0x80000, "ym", 0 )   /* samples */
714734   ROM_LOAD( "b56-10.bin", 0x00000, 0x80000, CRC(de1bce59) SHA1(aa3aea30d6f53e60d9a0d4ec767e1b261d5efc8a) )
735
736   ROM_REGION( 0x02000, "user1", 0 ) /* zoom table / mixing? */
737   ROM_LOAD( "b56-18.bin", 0x00000, 0x02000, CRC(c88f0bbe) SHA1(18c87c744fbeca35d13033e50f62e5383eb4ec2c) )
715738ROM_END
716739
740ROM_START( gogold )
741   ROM_REGION( 0x80000, "maincpu", 0 )      /* main cpu */
742   ROM_LOAD16_BYTE( "b56-17.bin", 0x00000, 0x20000, CRC(3e0a9c35) SHA1(900a741b2abbbbe883b9d78162a88b4397af1a56) )
743   ROM_LOAD16_BYTE( "b56-16.bin", 0x00001, 0x20000, CRC(b447f12c) SHA1(58ee30337836f260c7fbda728dac93f06d861ec4) )
744   ROM_LOAD16_BYTE( "b56-15.bin", 0x40000, 0x20000, CRC(b346e282) SHA1(f6b4a2e9093a33d19c2eaf3ef9801179f39a83a3) )
745   ROM_LOAD16_BYTE( "b56-14.bin", 0x40001, 0x20000, CRC(b6c195b9) SHA1(80541d9a686fdc1850d764d8e00ba03526e7174c) )
746
747   ROM_REGION( 0x1c000, "audiocpu", 0 )      /* sound cpu */
748   ROM_LOAD( "b56-19.bin", 0x00000, 0x04000, CRC(c68085ee) SHA1(78634216a622a08c20dae0422283c4a7ed360546) )
749   ROM_CONTINUE(           0x10000, 0x0c000 )
750
751   ROM_REGION( 0x400000, "gfx1", 0 )
752   ROM_LOAD16_BYTE( "b56-04.bin", 0x000000, 0x20000, CRC(f7afdff0) SHA1(8f8ea0e8da20913426ff3b58d7bb63bd352d3fb4) )
753   ROM_LOAD16_BYTE( "b56-08.bin", 0x000001, 0x20000, CRC(c9f0d38a) SHA1(aa22f1a06e00f90c546eebcd8b42da3e3c7d0781) )
754   ROM_LOAD16_BYTE( "b56-03.bin", 0x100000, 0x20000, CRC(4045fd44) SHA1(a84be9eedba7aed30d4f2841016784f8024d9443) )
755   ROM_LOAD16_BYTE( "b56-07.bin", 0x100001, 0x20000, CRC(0c76e4c8) SHA1(e50d1bd6e8ec967ba03bd14097a9bd560aa2decc) )
756   ROM_LOAD16_BYTE( "b56-02.bin", 0x200000, 0x20000, CRC(68c604ec) SHA1(75b26bfa53efa63b9c7a026f4226213364550cad) )
757   ROM_LOAD16_BYTE( "b56-06.bin", 0x200001, 0x20000, CRC(5fbcd302) SHA1(22e7d835643945d501edc693dbe4efc8d4d074a7) )
758   ROM_LOAD16_BYTE( "b56-01.bin", 0x300000, 0x20000, CRC(766b7260) SHA1(f7d7176af614f06e8c66e890e4d194ffb6f7af73) )
759   ROM_LOAD16_BYTE( "b56-05.bin", 0x300001, 0x20000, CRC(ed390378) SHA1(0275e5ead206028bfcff7ecbe11c7ab961e648ea) )
760
761   ROM_REGION( 0x80000, "ym.deltat", 0 )   /* samples */
762   ROM_LOAD( "b56-09.bin", 0x00000, 0x80000, CRC(7fd9ee68) SHA1(edc4455b3f6a6f30f418d03c6e53af875542a325) )
763
764   ROM_REGION( 0x80000, "ym", 0 )   /* samples */
765   ROM_LOAD( "b56-10.bin", 0x00000, 0x80000, CRC(de1bce59) SHA1(aa3aea30d6f53e60d9a0d4ec767e1b261d5efc8a) )
766
767   ROM_REGION( 0x02000, "user1", 0 ) /* zoom table / mixing? */
768   ROM_LOAD( "b56-18.bin", 0x00000, 0x02000, CRC(c88f0bbe) SHA1(18c87c744fbeca35d13033e50f62e5383eb4ec2c) )
769ROM_END
770
717771ROM_START( dleague )
718772   ROM_REGION( 0x60000, "maincpu", 0 )
719773   ROM_LOAD16_BYTE( "c02-19a.33", 0x00000, 0x20000, CRC(7e904e45) SHA1(04ac470c973753e71fba3998099a88ab0e6fcbab) )
r6049r6050
739793   ROM_LOAD16_BYTE( "c02-09.9",  0x380000, 0x20000, CRC(a614d234) SHA1(dc68a6a8cf89ab82edc571853249643aa304d37f) )
740794   ROM_LOAD16_BYTE( "c02-13.20", 0x380001, 0x20000, CRC(8eb3194d) SHA1(98290f77a03826cdf7c8238dd35da1f9349d5cf5) )
741795
742   ROM_REGION( 0x02000, "gfx2", 0 )
796   ROM_REGION( 0x02000, "user1", 0 ) /* zoom table / mixing? */
743797   ROM_LOAD( "c02-18.22", 0x00000, 0x02000, CRC(c88f0bbe) SHA1(18c87c744fbeca35d13033e50f62e5383eb4ec2c) )
744798
745799   ROM_REGION( 0x80000, "ym", 0 )   /* samples */
r6049r6050
750804/*  ( YEAR  NAME      PARENT    MACHINE   INPUT     INIT     MONITOR  COMPANY  FULLNAME */
751805GAME( 1988, syvalion, 0,        syvalion, syvalion, 0,       ROT0,    "Taito Corporation", "Syvalion (Japan)", 0 )
752806GAME( 1988, recordbr, 0,        recordbr, recordbr, 0,       ROT0,    "Taito Corporation Japan", "Recordbreaker (World)", 0 )
807GAME( 1988, gogold,   recordbr, recordbr, gogold,   0,       ROT0,    "Taito Corporation", "Go For The Gold (Japan)", 0 )
753808GAME( 1990, dleague,  0,        dleague,  dleague,  0,       ROT0,    "Taito Corporation", "Dynamite League (Japan)", 0 )
src/mame/drivers/topshoot.c
r6049r6050
1
21/*
32
43Sun Mixing board, looks like a hacked up Genesis clone.
r6049r6050
139138#include "sound/sn76496.h"
140139#include "sound/2612intf.h"
141140
142#include "genesis.h"
141#include "megadriv.h"
143142
144
145143static INPUT_PORTS_START( topshoot ) /* Top Shooter Input Ports */
146144   PORT_START("IN0")   /* 16bit */
147145   PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) )
r6049r6050
194192   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
195193INPUT_PORTS_END
196194
197static ADDRESS_MAP_START( topshoot_map, ADDRESS_SPACE_PROGRAM, 16 )
198   AM_RANGE(0x000000, 0x0fffff) AM_ROM               /* Cartridge Program Rom */
199//  AM_RANGE(0x200000, 0x20007f) AM_RAM
200   AM_RANGE(0x200000, 0x2023ff) AM_RAM // tested
201   AM_RANGE(0x400004, 0x400005) AM_READ_PORT("IN0")      // ??
202   AM_RANGE(0xa10000, 0xa1001f) AM_WRITE(genesis_io_w) AM_BASE(&genesis_io_ram)            /* Genesis Input */
203   AM_RANGE(0xa11000, 0xa11203) AM_WRITE(genesis_ctrl_w)
204   AM_RANGE(0xa10000, 0xa1001f) AM_READ_PORT("IN0")
205   AM_RANGE(0xa11100, 0xa11101) AM_READ_PORT("IN0")      // ??
206   AM_RANGE(0xa00000, 0xa0ffff) AM_READWRITE(genesis_68k_to_z80_r, genesis_68k_to_z80_w)
207   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(genesis_vdp_r, genesis_vdp_w)            /* VDP Access */
208   AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(3)
209   AM_RANGE(0xfe0000, 0xfeffff) AM_RAMBANK(4)
210   AM_RANGE(0xff0000, 0xffffff) AM_RAM AM_BASE(&genesis_68k_ram)/* Main Ram */
211ADDRESS_MAP_END
212195
213static ADDRESS_MAP_START( genesis_z80_map, ADDRESS_SPACE_PROGRAM, 8 )
214   AM_RANGE(0x0000, 0x1fff) AM_RAMBANK(1) AM_BASE(&genesis_z80_ram)
215    AM_RANGE(0x2000, 0x3fff) AM_RAMBANK(2) /* mirror */
216   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(genesis_z80_r, genesis_z80_w)
217   AM_RANGE(0x8000, 0xffff) AM_READ(genesis_z80_bank_r) //AM_WRITE(genesis_z80_bank_w)
218ADDRESS_MAP_END
219
220
221static MACHINE_DRIVER_START( genesis_base )
222   /*basic machine hardware */
223   MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK / 7)
224   MDRV_CPU_VBLANK_INT("screen", genesis_vblank_interrupt)
225
226   MDRV_CPU_ADD("genesis_snd_z80", Z80, MASTER_CLOCK / 15)
227   MDRV_CPU_PROGRAM_MAP(genesis_z80_map)
228   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) /* from vdp at scanline 0xe0 */
229
230   MDRV_QUANTUM_TIME(HZ(6000))
231
232   MDRV_MACHINE_START(genesis)
233   MDRV_MACHINE_RESET(genesis)
234
235   /* video hardware */
236   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
237
238   MDRV_SCREEN_ADD("screen", RASTER)
239   MDRV_SCREEN_REFRESH_RATE(60)
240   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
241   MDRV_SCREEN_SIZE(342,262)
242   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223)
243
244   MDRV_PALETTE_LENGTH(64)
245
246   MDRV_VIDEO_START(genesis)
247   MDRV_VIDEO_UPDATE(genesis)
248
249   /* sound hardware */
250   MDRV_SPEAKER_STANDARD_MONO("mono")
251
252   MDRV_SOUND_ADD("ym", YM3438, MASTER_CLOCK/7)
253   MDRV_SOUND_ROUTE(0, "mono", 0.50)
254   MDRV_SOUND_ROUTE(1, "mono", 0.50)
255MACHINE_DRIVER_END
256
257
258static MACHINE_DRIVER_START( topshoot )
259   /* basic machine hardware */
260   MDRV_IMPORT_FROM( genesis_base )
261   MDRV_CPU_MODIFY("maincpu")
262   MDRV_CPU_PROGRAM_MAP(topshoot_map)
263
264   /* video hardware */
265   MDRV_VIDEO_START(genesis)
266   MDRV_SCREEN_MODIFY("screen")
267   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223)
268
269   /* sound hardware */
270   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/15)
271   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
272MACHINE_DRIVER_END
273
274196ROM_START( topshoot ) /* Top Shooter (c)1995 Sun Mixing */
275197   ROM_REGION( 0x200000, "maincpu", 0 )
276198   ROM_LOAD16_BYTE( "tc574000ad_u11_2.bin", 0x000000, 0x080000, CRC(b235c4d9) SHA1(fbb308a5f6e769f3277824cb6a3b50c308969ac2) )
277199   ROM_LOAD16_BYTE( "tc574000ad_u12_1.bin", 0x000001, 0x080000, CRC(e826f6ad) SHA1(23ec8bb608f954d3b915f061e7076c0c63b8259e) )
278200ROM_END
279201
280static READ16_HANDLER( vdp_fake_r )
281{
282   return mame_rand(space->machine);
283}
284
285202static DRIVER_INIT(topshoot)
286203{
287   /* hack -- fix vdp emulation instead */
288   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xC00004, 0xC00005, 0, 0, vdp_fake_r);
204   /* set up preliminary input ports (not working yet!) */
205   memory_install_read_port_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x400004, 0x400005, 0, 0, "IN0");   //correct?
206   memory_install_read_port_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa11100, 0xa11101, 0, 0, "IN0");   //correct?
289207
290   memory_set_bankptr(machine, 3, memory_region(machine, "maincpu") );
291   memory_set_bankptr(machine, 4, genesis_68k_ram );
208   DRIVER_INIT_CALL(megadriv);
292209}
293210
294211
295212/* Sun Mixing Hardware, very close to actual Genesis */
296GAME( 1995, topshoot,  0,        topshoot, topshoot, topshoot, ROT0, "Sun Mixing",                  "Top Shooter",GAME_NOT_WORKING )
213GAME( 1995, topshoot,  0,        md_bootleg, topshoot, topshoot, ROT0, "Sun Mixing",                  "Top Shooter",GAME_NOT_WORKING )
src/mame/drivers/megaplay.c
r6049r6050
5454#include "sound/sn76496.h"
5555
5656#include "deprecat.h"
57#include "genesis.h"
5857#include "megadriv.h"
5958#include "segamsys.h"
6059
6160#define MASTER_CLOCK      53693100
6261
63/* Megaplay BIOS specific */
64#define MP_ROM  0x10
65#define MP_GAME 0
6662
67static UINT32 bios_bank; // ROM bank selection
68static UINT16 game_banksel;  // Game bank selection
69static UINT32 bios_mode = MP_ROM;  // determines whether ROM banks or Game data
70                           // is to read from 0x8000-0xffff
71static UINT32 mp_bios_bank_addr;
63struct _mplay_bios mplay_bios;
64static UINT16 *genesis_io_ram;
7265
73static UINT32 bios_width;  // determines the way the game info ROM is read
74UINT8 bios_ctrl[6];
75static UINT8 bios_6600;
76UINT8 bios_6204;
77static UINT8 bios_6403;
78static UINT8 bios_6404;
7966static UINT8* ic3_ram;
8067
8168static UINT8* ic37_ram;
r6049r6050
132119}
133120#endif
134121
135static UINT32 readpos = 1;  // serial bank selection position (9-bit)
136
137122static INPUT_PORTS_START ( megaplay )
138   PORT_START("P1_1")   /* Player 1 Controls - part 1 */
139   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
140   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
141   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
142   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
143   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON2 )
144   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON3 )
145   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNUSED )
146   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNUSED )
123   PORT_INCLUDE( md_common )
147124
148   PORT_START("P1_2")   /* Player 1 Controls - part 2 */
149   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNUSED )
150   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNUSED )
151   PORT_BIT(  0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
152   PORT_BIT(  0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
153   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
154   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_START1 )
155   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNUSED )
156   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNUSED )
157
158   PORT_START("P2_1")   /* Player 2 Controls - part 1 */
159   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
160   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
161   PORT_BIT(  0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
162   PORT_BIT(  0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT  ) PORT_PLAYER(2)
163   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
164   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
165   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNUSED )
166   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNUSED )
167
168   PORT_START("P2_2")   /* Player 2 Controls - part 2 */
169   PORT_BIT(  0x01, IP_ACTIVE_LOW, IPT_UNUSED )
170   PORT_BIT(  0x02, IP_ACTIVE_LOW, IPT_UNUSED )
171   PORT_BIT(  0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
172   PORT_BIT(  0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
173   PORT_BIT(  0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
174   PORT_BIT(  0x20, IP_ACTIVE_LOW, IPT_START2 )
175   PORT_BIT(  0x40, IP_ACTIVE_LOW, IPT_UNUSED )
176   PORT_BIT(  0x80, IP_ACTIVE_LOW, IPT_UNUSED )
177
178125   PORT_START("TEST")
179126   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Select") PORT_CODE(KEYCODE_0)
180    PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 1") PORT_CODE(KEYCODE_W)
181    PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 2") PORT_CODE(KEYCODE_E)
182    PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 3") PORT_CODE(KEYCODE_R)
183    PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 4") PORT_CODE(KEYCODE_T)
184    PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 5") PORT_CODE(KEYCODE_Y)
127   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 1") PORT_CODE(KEYCODE_W)
128   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 2") PORT_CODE(KEYCODE_E)
129   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 3") PORT_CODE(KEYCODE_R)
130   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 4") PORT_CODE(KEYCODE_T)
131   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 5") PORT_CODE(KEYCODE_Y)
185132   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_NAME("0x6400 bit 6") PORT_CODE(KEYCODE_U)
186133   PORT_SERVICE_NO_TOGGLE( 0x80, IP_ACTIVE_LOW )
187134
188135   PORT_START("COIN")
189136    PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
190137   PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
191    PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
192    PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
193    PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
194    PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
195    PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
196    PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
138   PORT_BIT ( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
139   PORT_BIT ( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
140   PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
141   PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
142   PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
143   PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
197144
198145/* Caused 01081:
199146 *  PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_START1 )
r6049r6050
202149
203150   PORT_START("DSW0")
204151   PORT_DIPNAME( 0x0f, 0x0f, "Coin slot 1" ) PORT_DIPLOCATION("SW1:1,2,3,4")
205    PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) )
206    PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) )
207    PORT_DIPSETTING( 0x09, DEF_STR( 2C_1C ) )
208    PORT_DIPSETTING( 0x05, "2 coins/1 credit - 5 coins/3 credits - 6 coins/4 credits" )
209    PORT_DIPSETTING( 0x04, "2 coins/1 credit - 4 coins/3 credits" )
210    PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) )
211    PORT_DIPSETTING( 0x06, DEF_STR( 2C_3C ) )
212    PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
213    PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
214    PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
215    PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
216    PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
217    PORT_DIPSETTING( 0x03, "1 coin/1 credit - 5 coins/6 credits" )
218    PORT_DIPSETTING( 0x02, "1 coin/1 credit - 4 coins/5 credits" )
219    PORT_DIPSETTING( 0x01, "1 coin/1 credit - 2 coins/3 credits" )
220    PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
152   PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) )
153   PORT_DIPSETTING( 0x08, DEF_STR( 3C_1C ) )
154   PORT_DIPSETTING( 0x09, DEF_STR( 2C_1C ) )
155   PORT_DIPSETTING( 0x05, "2 coins/1 credit - 5 coins/3 credits - 6 coins/4 credits" )
156   PORT_DIPSETTING( 0x04, "2 coins/1 credit - 4 coins/3 credits" )
157   PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) )
158   PORT_DIPSETTING( 0x06, DEF_STR( 2C_3C ) )
159   PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
160   PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
161   PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
162   PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
163   PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
164   PORT_DIPSETTING( 0x03, "1 coin/1 credit - 5 coins/6 credits" )
165   PORT_DIPSETTING( 0x02, "1 coin/1 credit - 4 coins/5 credits" )
166   PORT_DIPSETTING( 0x01, "1 coin/1 credit - 2 coins/3 credits" )
167   PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
221168
222169   PORT_DIPNAME( 0xf0, 0xf0, "Coin slot 2" ) PORT_DIPLOCATION("SW2:1,2,3,4")
223    PORT_DIPSETTING( 0x70, DEF_STR( 4C_1C ) )
224    PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) )
225    PORT_DIPSETTING( 0x90, DEF_STR( 2C_1C ) )
226    PORT_DIPSETTING( 0x50, "2 coins/1 credit - 5 coins/3 credits - 6 coins/4 credits" )
227    PORT_DIPSETTING( 0x40, "2 coins/1 credit - 4 coins/3 credits" )
228    PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) )
229    PORT_DIPSETTING( 0x60, DEF_STR( 2C_3C ) )
230    PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) )
231    PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) )
232    PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
233    PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
234    PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) )
235    PORT_DIPSETTING( 0x30, "1 coin/1 credit - 5 coins/6 credits" )
236    PORT_DIPSETTING( 0x20, "1 coin/1 credit - 4 coins/5 credits" )
237    PORT_DIPSETTING( 0x10, "1 coin/1 credit - 2 coins/3 credits" )
238    PORT_DIPSETTING( 0x00, " 1 coin/1 credit" )
170   PORT_DIPSETTING( 0x70, DEF_STR( 4C_1C ) )
171   PORT_DIPSETTING( 0x80, DEF_STR( 3C_1C ) )
172   PORT_DIPSETTING( 0x90, DEF_STR( 2C_1C ) )
173   PORT_DIPSETTING( 0x50, "2 coins/1 credit - 5 coins/3 credits - 6 coins/4 credits" )
174   PORT_DIPSETTING( 0x40, "2 coins/1 credit - 4 coins/3 credits" )
175   PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ) )
176   PORT_DIPSETTING( 0x60, DEF_STR( 2C_3C ) )
177   PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ) )
178   PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ) )
179   PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ) )
180   PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ) )
181   PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ) )
182   PORT_DIPSETTING( 0x30, "1 coin/1 credit - 5 coins/6 credits" )
183   PORT_DIPSETTING( 0x20, "1 coin/1 credit - 4 coins/5 credits" )
184   PORT_DIPSETTING( 0x10, "1 coin/1 credit - 2 coins/3 credits" )
185   PORT_DIPSETTING( 0x00, " 1 coin/1 credit" )
239186
240187   PORT_START("DSW1")   /* DSW C  (per game settings) */
241188   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1")
242    PORT_DIPSETTING( 0x01, DEF_STR( Off )  )
243    PORT_DIPSETTING( 0x00, DEF_STR( On ) )
189   PORT_DIPSETTING( 0x01, DEF_STR( Off )  )
190   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
244191   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2")
245    PORT_DIPSETTING( 0x02, DEF_STR( Off )  )
246    PORT_DIPSETTING( 0x00, DEF_STR( On ) )
192   PORT_DIPSETTING( 0x02, DEF_STR( Off )  )
193   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
247194   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:3")
248    PORT_DIPSETTING( 0x04, DEF_STR( Off )  )
249    PORT_DIPSETTING( 0x00, DEF_STR( On ) )
195   PORT_DIPSETTING( 0x04, DEF_STR( Off )  )
196   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
250197   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4")
251    PORT_DIPSETTING( 0x08, DEF_STR( Off )  )
252    PORT_DIPSETTING( 0x00, DEF_STR( On ) )
198   PORT_DIPSETTING( 0x08, DEF_STR( Off )  )
199   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
253200INPUT_PORTS_END
254201
255202static INPUT_PORTS_START ( mp_sonic )
r6049r6050
257204
258205   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
259206   PORT_DIPNAME( 0x03, 0x01, "Initial Players" ) PORT_DIPLOCATION("SW3:1,2")
260    PORT_DIPSETTING( 0x00, "4" )
261    PORT_DIPSETTING( 0x01, "3" )
262    PORT_DIPSETTING( 0x02, "2" )
263    PORT_DIPSETTING( 0x03, "1" )
207   PORT_DIPSETTING( 0x00, "4" )
208   PORT_DIPSETTING( 0x01, "3" )
209   PORT_DIPSETTING( 0x02, "2" )
210   PORT_DIPSETTING( 0x03, "1" )
264211   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
265    PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
266    PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
267    PORT_DIPSETTING( 0x08, DEF_STR( Easy ) )
268    PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) )
212   PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
213   PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
214   PORT_DIPSETTING( 0x08, DEF_STR( Easy ) )
215   PORT_DIPSETTING( 0x0c, DEF_STR( Normal ) )
269216    // Who knows...
270217//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 4") PORT_CODE(KEYCODE_G)
271218//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 5") PORT_CODE(KEYCODE_H)
r6049r6050
278225
279226   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
280227   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW3:1")
281    PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
282    PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
228   PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
229   PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
283230   PORT_DIPNAME( 0x02, 0x00, "Life" ) PORT_DIPLOCATION("SW3:2")
284    PORT_DIPSETTING( 0x02, "1" )
285    PORT_DIPSETTING( 0x00, "2" )
231   PORT_DIPSETTING( 0x02, "1" )
232   PORT_DIPSETTING( 0x00, "2" )
286233   PORT_DIPNAME( 0x04, 0x04, "Initial Players" ) PORT_DIPLOCATION("SW3:3")
287    PORT_DIPSETTING( 0x00, "1" )
288    PORT_DIPSETTING( 0x04, "2" )
234   PORT_DIPSETTING( 0x00, "1" )
235   PORT_DIPSETTING( 0x04, "2" )
289236   PORT_DIPNAME( 0x08, 0x00, "Timer" ) PORT_DIPLOCATION("SW3:4")
290    PORT_DIPSETTING( 0x08, DEF_STR( Off )  )
291    PORT_DIPSETTING( 0x00, DEF_STR( On ) )
237   PORT_DIPSETTING( 0x08, DEF_STR( Off )  )
238   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
292239    // Who knows...
293240//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 4") PORT_CODE(KEYCODE_G)
294241//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 5") PORT_CODE(KEYCODE_H)
r6049r6050
302249
303250   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
304251   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Language ) ) PORT_DIPLOCATION("SW3:1")
305    PORT_DIPSETTING( 0x01, DEF_STR( English ) )
306    PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) )
252   PORT_DIPSETTING( 0x01, DEF_STR( English ) )
253   PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) )
307254   PORT_DIPNAME( 0x02, 0x02, "2P Mode Games" ) PORT_DIPLOCATION("SW3:2")
308    PORT_DIPSETTING( 0x02, "1" )
309    PORT_DIPSETTING( 0x00, "3" )
255   PORT_DIPSETTING( 0x02, "1" )
256   PORT_DIPSETTING( 0x00, "3" )
310257   PORT_DIPNAME( 0x0c, 0x0c, "Speed / Difficulty" ) PORT_DIPLOCATION("SW3:3,4")
311    PORT_DIPSETTING( 0x08, "Slow"  )
312    PORT_DIPSETTING( 0x0c, "Middle"  )
313    PORT_DIPSETTING( 0x04, "Fast"  )
314    PORT_DIPSETTING( 0x00, "Max"  )
258   PORT_DIPSETTING( 0x08, "Slow"  )
259   PORT_DIPSETTING( 0x0c, "Middle"  )
260   PORT_DIPSETTING( 0x04, "Fast"  )
261   PORT_DIPSETTING( 0x00, "Max"  )
315262    // Who knows...
316263//  PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 4") PORT_CODE(KEYCODE_G)
317264//  PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_NAME("0x6201 bit 5") PORT_CODE(KEYCODE_H)
r6049r6050
325272
326273   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
327274   PORT_DIPNAME( 0x01, 0x01, "Time" ) PORT_DIPLOCATION("SW3:1")
328    PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
329    PORT_DIPSETTING( 0x00, "Short" )
275   PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
276   PORT_DIPSETTING( 0x00, "Short" )
330277   PORT_DIPNAME( 0x0e, 0x08, "Level" ) PORT_DIPLOCATION("SW3:2,3,4")
331    PORT_DIPSETTING( 0x00, "0" )
332    PORT_DIPSETTING( 0x02, "0" )
333    PORT_DIPSETTING( 0x04, "5" )
334    PORT_DIPSETTING( 0x06, "4" )
335    PORT_DIPSETTING( 0x08, "3" )
336    PORT_DIPSETTING( 0x0a, "2" )
337    PORT_DIPSETTING( 0x0c, "1" )
338    PORT_DIPSETTING( 0x0e, "0" )
278   PORT_DIPSETTING( 0x00, "0" )
279   PORT_DIPSETTING( 0x02, "0" )
280   PORT_DIPSETTING( 0x04, "5" )
281   PORT_DIPSETTING( 0x06, "4" )
282   PORT_DIPSETTING( 0x08, "3" )
283   PORT_DIPSETTING( 0x0a, "2" )
284   PORT_DIPSETTING( 0x0c, "1" )
285   PORT_DIPSETTING( 0x0e, "0" )
339286INPUT_PORTS_END
340287
341288static INPUT_PORTS_START ( mp_sor2 )
r6049r6050
343290
344291   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
345292   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW3:1,2")
346    PORT_DIPSETTING( 0x00, "4" )
347    PORT_DIPSETTING( 0x01, "3" )
348    PORT_DIPSETTING( 0x02, "2" )
349    PORT_DIPSETTING( 0x03, "1" )
293   PORT_DIPSETTING( 0x00, "4" )
294   PORT_DIPSETTING( 0x01, "3" )
295   PORT_DIPSETTING( 0x02, "2" )
296   PORT_DIPSETTING( 0x03, "1" )
350297   PORT_DIPNAME( 0xc, 0x0c, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
351    PORT_DIPSETTING( 0x00, DEF_STR ( Hardest ) )
352    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
353    PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
354    PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
298   PORT_DIPSETTING( 0x00, DEF_STR ( Hardest ) )
299   PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
300   PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
301   PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
355302INPUT_PORTS_END
356303
357304static INPUT_PORTS_START ( mp_bio )
r6049r6050
359306
360307   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
361308   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW3:1,2")
362    PORT_DIPSETTING( 0x00, "5" )
363    PORT_DIPSETTING( 0x01, "4" )
364    PORT_DIPSETTING( 0x02, "2" )
365    PORT_DIPSETTING( 0x03, "3" )
309   PORT_DIPSETTING( 0x00, "5" )
310   PORT_DIPSETTING( 0x01, "4" )
311   PORT_DIPSETTING( 0x02, "2" )
312   PORT_DIPSETTING( 0x03, "3" )
366313   PORT_DIPNAME( 0xc, 0x0c, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
367    PORT_DIPSETTING( 0x00, DEF_STR ( Hardest ) )
368    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
369    PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
370    PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
314   PORT_DIPSETTING( 0x00, DEF_STR ( Hardest ) )
315   PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
316   PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
317   PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
371318INPUT_PORTS_END
372319
373320static INPUT_PORTS_START ( mp_gslam )
r6049r6050
375322
376323   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
377324   PORT_DIPNAME( 0x07, 0x04, DEF_STR ( Game_Time ) ) PORT_DIPLOCATION("SW3:1,2,3")
378    PORT_DIPSETTING( 0x00, "5:00" )
379    PORT_DIPSETTING( 0x01, "4:30" )
380    PORT_DIPSETTING( 0x02, "4:00" )
381    PORT_DIPSETTING( 0x03, "3:30" )
382    PORT_DIPSETTING( 0x04, "3:00" )
383    PORT_DIPSETTING( 0x05, "2:30" )
384    PORT_DIPSETTING( 0x06, "2:00" )
385    PORT_DIPSETTING( 0x07, "1:30" )
325   PORT_DIPSETTING( 0x00, "5:00" )
326   PORT_DIPSETTING( 0x01, "4:30" )
327   PORT_DIPSETTING( 0x02, "4:00" )
328   PORT_DIPSETTING( 0x03, "3:30" )
329   PORT_DIPSETTING( 0x04, "3:00" )
330   PORT_DIPSETTING( 0x05, "2:30" )
331   PORT_DIPSETTING( 0x06, "2:00" )
332   PORT_DIPSETTING( 0x07, "1:30" )
386333   PORT_DIPNAME( 0x08, 0x08, "2P-Play Continue" ) PORT_DIPLOCATION("SW3:4")
387    PORT_DIPSETTING( 0x00, "1 Credit" )
388    PORT_DIPSETTING( 0x08, "2 Credits" )
334   PORT_DIPSETTING( 0x00, "1 Credit" )
335   PORT_DIPSETTING( 0x08, "2 Credits" )
389336INPUT_PORTS_END
390337
391338static INPUT_PORTS_START ( mp_mazin )
r6049r6050
393340
394341   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
395342   PORT_DIPNAME( 0x01, 0x01, "Initial Player" ) PORT_DIPLOCATION("SW3:1")
396    PORT_DIPSETTING( 0x01, "2" )
397    PORT_DIPSETTING( 0x00, "1" )
343   PORT_DIPSETTING( 0x01, "2" )
344   PORT_DIPSETTING( 0x00, "1" )
398345   PORT_DIPNAME( 0x02, 0x02, "Initial Player" ) PORT_DIPLOCATION("SW3:2")
399    PORT_DIPSETTING( 0x02, "1" )
400    PORT_DIPSETTING( 0x00, "4" )
346   PORT_DIPSETTING( 0x02, "1" )
347   PORT_DIPSETTING( 0x00, "4" )
401348   PORT_DIPNAME( 0x04, 0x04, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3")
402    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
403    PORT_DIPSETTING( 0x00, DEF_STR ( Normal ) )
349   PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
350   PORT_DIPSETTING( 0x00, DEF_STR ( Normal ) )
404351   PORT_DIPNAME( 0x08, 0x08, "Title" ) PORT_DIPLOCATION("SW3:4")
405    PORT_DIPSETTING( 0x08, "EUROPE" )
406    PORT_DIPSETTING( 0x00, "U.S.A" )
352   PORT_DIPSETTING( 0x08, "EUROPE" )
353   PORT_DIPSETTING( 0x00, "U.S.A" )
407354INPUT_PORTS_END
408355
409356static INPUT_PORTS_START ( mp_soni2 )
r6049r6050
411358
412359   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
413360   PORT_DIPNAME( 0x03, 0x01, "Initial Players (Normal mode)" ) PORT_DIPLOCATION("SW3:1,2")
414    PORT_DIPSETTING( 0x00, "4" )
415    PORT_DIPSETTING( 0x01, "3" )
416    PORT_DIPSETTING( 0x02, "2" )
417    PORT_DIPSETTING( 0x03, "1" )
361   PORT_DIPSETTING( 0x00, "4" )
362   PORT_DIPSETTING( 0x01, "3" )
363   PORT_DIPSETTING( 0x02, "2" )
364   PORT_DIPSETTING( 0x03, "1" )
418365   PORT_DIPNAME( 0x0c, 0x0c, "Initial Players (Dual mode)" ) PORT_DIPLOCATION("SW3:3,4")
419    PORT_DIPSETTING( 0x00, "4" )
420    PORT_DIPSETTING( 0x04, "2" )
421    PORT_DIPSETTING( 0x08, "1" )
422    PORT_DIPSETTING( 0x0c, "3" )
366   PORT_DIPSETTING( 0x00, "4" )
367   PORT_DIPSETTING( 0x04, "2" )
368   PORT_DIPSETTING( 0x08, "1" )
369   PORT_DIPSETTING( 0x0c, "3" )
423370INPUT_PORTS_END
424371
425372static INPUT_PORTS_START ( mp_shnb3 )
r6049r6050
427374
428375   PORT_MODIFY("DSW1")   /* DSW C  (per game settings) */
429376   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW3:1,2")
430    PORT_DIPSETTING( 0x00, "4" )
431    PORT_DIPSETTING( 0x01, "3" )
432    PORT_DIPSETTING( 0x02, "2" )
433    PORT_DIPSETTING( 0x03, "1" )
377   PORT_DIPSETTING( 0x00, "4" )
378   PORT_DIPSETTING( 0x01, "3" )
379   PORT_DIPSETTING( 0x02, "2" )
380   PORT_DIPSETTING( 0x03, "1" )
434381   PORT_DIPNAME( 0xc, 0x0c, DEF_STR ( Difficulty ) ) PORT_DIPLOCATION("SW3:3,4")
435    PORT_DIPSETTING( 0x00, "Expert" )
436    PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
437    PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
438    PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
382   PORT_DIPSETTING( 0x00, "Expert" )
383   PORT_DIPSETTING( 0x04, DEF_STR ( Hard ) )
384   PORT_DIPSETTING( 0x08, DEF_STR ( Easy ) )
385   PORT_DIPSETTING( 0x0c, DEF_STR ( Normal ) )
439386INPUT_PORTS_END
440387
441388/*MEGAPLAY specific*/
442389
443390static READ8_HANDLER( megaplay_bios_banksel_r )
444391{
445   return bios_bank;
392   return mplay_bios.bios_bank;
446393}
447394
448395static WRITE8_HANDLER( megaplay_bios_banksel_w )
r6049r6050
452399    It should be possible to multiplex different game ROMs at
453400    0x000000-0x3fffff based on these bits.
454401*/
455   bios_bank = data;
456   bios_mode = MP_ROM;
402   mplay_bios.bios_bank = data;
403   mplay_bios.bios_mode = MP_ROM;
457404//  logerror("BIOS: ROM bank %i selected [0x%02x]\n",bios_bank >> 6, data);
458405}
459406
460407static READ8_HANDLER( megaplay_bios_gamesel_r )
461408{
462   return bios_6403;
409   return mplay_bios.bios_6403;
463410}
464411
465412static WRITE8_HANDLER( megaplay_bios_gamesel_w )
466413{
467   bios_6403 = data;
414   mplay_bios.bios_6403 = data;
468415
469416//  logerror("BIOS: 0x6403 write: 0x%02x\n",data);
470   bios_mode = data & 0x10;
417   mplay_bios.bios_mode = data & 0x10;
471418}
472419
473
474/* Old code, todo, update the new code instead */
475
476static READ16_HANDLER ( OLD_megaplay_genesis_io_r )
420static WRITE16_HANDLER( megaplay_io_write )
477421{
478   /* 8-bit only, data is mirrored in both halves */
479
480   UINT8 return_value = 0;
481
482   switch (offset)
483   {
484      case 0:
485      /* Charles MacDonald ( http://cgfm2.emuviews.com/ )
486            D7 : Console is 1= Export (USA, Europe, etc.) 0= Domestic (Japan)
487            D6 : Video type is 1= PAL, 0= NTSC
488            D5 : Sega CD unit is 1= not present, 0= connected.
489            D4 : Unused (always returns zero)
490            D3 : Bit 3 of version number
491            D2 : Bit 2 of version number
492            D1 : Bit 1 of version number
493            D0 : Bit 0 of version number
494        */
495         return_value = 0x80; /* ? megatech is usa? */
496         break;
497
498      case 1: /* port A data (joypad 1) */
499
500         if (genesis_io_ram[offset] & 0x40)
501            return_value = input_port_read(space->machine, "P1_1") & (genesis_io_ram[4]^0xff);
502         else
503         {
504            return_value = input_port_read(space->machine, "P1_2") & (genesis_io_ram[4]^0xff);
505            return_value |= input_port_read(space->machine, "P1_1") & 0x03;
506         }
507         return_value = (genesis_io_ram[offset] & 0x80) | return_value;
508//          logerror ("reading joypad 1 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
509         break;
510
511      case 2: /* port B data (joypad 2) */
512
513         if (genesis_io_ram[offset] & 0x40)
514            return_value = input_port_read(space->machine, "P2_1") & (genesis_io_ram[5]^0xff);
515         else
516         {
517            return_value = input_port_read(space->machine, "P2_2") & (genesis_io_ram[5]^0xff);
518            return_value |= input_port_read(space->machine, "P2_1") & 0x03;
519         }
520         return_value = (genesis_io_ram[offset] & 0x80) | return_value;
521//          logerror ("reading joypad 2 , type %02x %02x\n",genesis_io_ram[offset] & 0xb0, return_value &0x7f);
522         break;
523
524//      case 3: /* port C data */
525//          return_value = bios_6402 << 3;
526//          break;
527
528   default:
529         return_value = genesis_io_ram[offset];
530
531   }
532   return return_value | return_value << 8;
422   if (offset == 0x03)
423      megadrive_io_data_regs[2] = (data & megadrive_io_ctrl_regs[2]) | (megadrive_io_data_regs[2] & ~megadrive_io_ctrl_regs[2]);
424   else
425      megadriv_68k_io_write(space, offset & 0x1f, data, 0xffff);
533426}
534427
535static WRITE16_HANDLER ( OLD_megaplay_genesis_io_w )
428static READ16_HANDLER( megaplay_io_read )
536429{
537//  logerror ("write io offset :%02x data %04x PC: 0x%06x\n",offset,data,cpu_get_previouspc(space->cpu));
538
539   switch (offset)
540   {
541      case 0x00:
542      /*??*/
543      break;
544
545      case 0x01:/* port A data */
546      genesis_io_ram[offset] = (data & (genesis_io_ram[0x04])) | (genesis_io_ram[offset] & ~(genesis_io_ram[0x04]));
547      break;
548
549      case 0x02: /* port B data */
550      genesis_io_ram[offset] = (data & (genesis_io_ram[0x05])) | (genesis_io_ram[offset] & ~(genesis_io_ram[0x05]));
551      break;
552
553      case 0x03: /* port C data */
554      genesis_io_ram[offset] = (data & (genesis_io_ram[0x06])) | (genesis_io_ram[offset] & ~(genesis_io_ram[0x06]));
555      bios_6204 = data & 0x07;
556      break;
557
558      case 0x04: /* port A control */
559      genesis_io_ram[offset] = data;
560      break;
561
562      case 0x05: /* port B control */
563      genesis_io_ram[offset] = data;
564      break;
565
566      case 0x06: /* port C control */
567      genesis_io_ram[offset] = data;
568      break;
569
570      case 0x07: /* port A TxData */
571      genesis_io_ram[offset] = data;
572      break;
573
574      default:
575      genesis_io_ram[offset] = data;
576   }
430   if (offset == 0x03)
431      return megadrive_io_data_regs[2];
432   else
433      return megadriv_68k_io_read(space, offset & 0x1f, 0xffff);
577434}
578435
579436static READ8_HANDLER( bank_r )
r6049r6050
581438   UINT32 fulladdress;
582439   UINT8* bank = memory_region(space->machine, "mtbios");
583440
584   fulladdress = mp_bios_bank_addr + offset;
441   fulladdress = mplay_bios.mp_bios_bank_addr + offset;
585442
586443
587444   if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM Addresses
588445   {
589      if(bios_mode & MP_ROM)
446      if (mplay_bios.bios_mode & MP_ROM)
590447      {
591         int sel = (bios_bank >> 6) & 0x03;
448         int sel = (mplay_bios.bios_bank >> 6) & 0x03;
592449
593         if(sel == 0)
450         if (sel == 0)
594451            return 0xff;
595452         else
596            return bank[0x10000 + (sel-1)*0x8000 + offset];
453            return bank[0x10000 + (sel - 1) * 0x8000 + offset];
597454      }
598      else if(bios_width & 0x08)
455      else if (mplay_bios.bios_width & 0x08)
599456      {
600457         if(offset >= 0x2000)
601458            return ic36_ram[offset - 0x2000];
602459         else
603            return ic37_ram[(0x2000 * (bios_bank & 0x03)) + offset];
460            return ic37_ram[(0x2000 * (mplay_bios.bios_bank & 0x03)) + offset];
604461      }
605462      else
606463      {
607         return memory_region(space->machine, "maincpu")[fulladdress^1];
464         return memory_region(space->machine, "maincpu")[fulladdress ^ 1];
608465      }
609466   }
610   else if(fulladdress>=0xa10000 && fulladdress<=0xa1001f) // IO Acess
467   else if (fulladdress >= 0xa10000 && fulladdress <= 0xa1001f) // IO Acess
611468   {
612      return OLD_megaplay_genesis_io_r(space, (offset & 0x1f) / 2, 0xffff);
469      return megaplay_io_read(space, (offset & 0x1f) / 2, 0xffff);
613470   }
614471   else
615472   {
616      printf("bank_r fulladdress %08x\n",fulladdress);
473      printf("bank_r fulladdress %08x\n", fulladdress);
617474      return 0x00;
618475   }
619476
620477}
621478
622static WRITE8_HANDLER ( bank_w )
479static WRITE8_HANDLER( bank_w )
623480{
624481   UINT32 fulladdress;
625   fulladdress = mp_bios_bank_addr + offset;
482   fulladdress = mplay_bios.mp_bios_bank_addr + offset;
626483
627484   if ((fulladdress >= 0x000000) && (fulladdress <= 0x3fffff)) // ROM / Megaplay Custom Addresses
628485   {
629      if(offset <= 0x1fff && (bios_width & 0x08))
486      if (offset <= 0x1fff && (mplay_bios.bios_width & 0x08))
630487      {
631         ic37_ram[(0x2000 * (bios_bank & 0x03)) + offset] = data;
488         ic37_ram[(0x2000 * (mplay_bios.bios_bank & 0x03)) + offset] = data;
632489      }
633490
634      if(offset >= 0x2000 && (bios_width & 0x08))
491      if(offset >= 0x2000 && (mplay_bios.bios_width & 0x08))
635492      {
636493   //      ic36_ram[offset] = data;
637494         ic36_ram[offset - 0x2000] = data;
638495      }
639496   }
640   else if(fulladdress>=0xa10000 && fulladdress<=0xa1001f) // IO Access
497   else if (fulladdress >= 0xa10000 && fulladdress <=0xa1001f) // IO Access
641498   {
642      OLD_megaplay_genesis_io_w(space, (offset & 0x1f) / 2, data, 0xffff);
499      megaplay_io_write(space, (offset & 0x1f) / 2, data, 0xffff);
643500   }
644501   else
645502   {
646      printf("bank_w fulladdress %08x\n",fulladdress);
503      printf("bank_w fulladdress %08x\n", fulladdress);
647504   }
648505}
649506
650507
508/* Megaplay BIOS handles regs[2] at start in a different way compared to megadrive */
509/* other io data/ctrl regs are dealt with exactly like in the console              */
510
651511static READ8_HANDLER( megaplay_bios_6402_r )
652512{
653   return genesis_io_ram[3];// & 0xfe;
654//  return bios_6402;// & 0xfe;
513   return megadrive_io_data_regs[2];// & 0xfe;
655514}
656515
657516static WRITE8_HANDLER( megaplay_bios_6402_w )
658517{
659   genesis_io_ram[3] = (genesis_io_ram[3] & 0x07) | ((data & 0x70) >> 1);
660//  bios_6402 = (data >> 4) & 0x07;
661//  logerror("BIOS: 0x6402 write: 0x%02x\n",data);
518   megadrive_io_data_regs[2] = (megadrive_io_data_regs[2] & 0x07) | ((data & 0x70) >> 1);
519//  logerror("BIOS: 0x6402 write: 0x%02x\n", data);
662520}
663521
664static READ8_HANDLER( megaplay_bios_6404_r )
522static READ8_HANDLER( megaplay_bios_6204_r )
665523{
666//  logerror("BIOS: 0x6404 read: returned 0x%02x\n",bios_6404 | (bios_6403 & 0x10) >> 4);
667   return (bios_6404 & 0xfe) | ((bios_6403 & 0x10) >> 4);
668//  return bios_6404 | (bios_6403 & 0x10) >> 4;
524   return (megadrive_io_data_regs[2]);
525//  return (mplay_bios.bios_width & 0xf8) + (mplay_bios.bios_6204 & 0x07);
669526}
670527
671static WRITE8_HANDLER( megaplay_bios_6404_w )
528static WRITE8_HANDLER( megaplay_bios_width_w )
672529{
673   if(((bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c))
674      cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
675   bios_6404 = data;
676
677//  logerror("BIOS: 0x6404 write: 0x%02x\n",data);
530   mplay_bios.bios_width = data;
531   megadrive_io_data_regs[2] = (megadrive_io_data_regs[2] & 0x07) | ((data & 0xf8));
532//  logerror("BIOS: 0x6204 - Width write: %02x\n", data);
678533}
679534
680static READ8_HANDLER( megaplay_bios_6204_r )
535static READ8_HANDLER( megaplay_bios_6404_r )
681536{
682   return (genesis_io_ram[3]);
683//  return (bios_width & 0xf8) + (bios_6204 & 0x07);
537//  logerror("BIOS: 0x6404 read: returned 0x%02x\n",bios_6404 | (bios_6403 & 0x10) >> 4);
538   return (mplay_bios.bios_6404 & 0xfe) | ((mplay_bios.bios_6403 & 0x10) >> 4);
539//  return mplay_bios.bios_6404 | (mplay_bios.bios_6403 & 0x10) >> 4;
684540}
685541
686static WRITE8_HANDLER( megaplay_bios_width_w )
542static WRITE8_HANDLER( megaplay_bios_6404_w )
687543{
688   bios_width = data;
689   genesis_io_ram[3] = (genesis_io_ram[3] & 0x07) | ((data & 0xf8));
544   if(((mplay_bios.bios_6404 & 0x0c) == 0x00) && ((data & 0x0c) == 0x0c))
545      cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
546   mplay_bios.bios_6404 = data;
690547
691//  logerror("BIOS: 0x6204 - Width write: %02x\n",data);
548//  logerror("BIOS: 0x6404 write: 0x%02x\n", data);
692549}
693550
694551static READ8_HANDLER( megaplay_bios_6600_r )
r6049r6050
697554    0x6600 appears to be used to check for extra slots being used.
698555    Enter the following line in place of the return statement in this
699556    function to make the BIOS check all 4 slots (3 and 4 will be "not used")
700        return (bios_6600 & 0xfe) | (bios_bank & 0x01);
557        return (mplay_bios.bios_6600 & 0xfe) | (mplay_bios.bios_bank & 0x01);
701558*/
702   return bios_6600;// & 0xfe;
559   return mplay_bios.bios_6600;// & 0xfe;
703560}
704561
705562static WRITE8_HANDLER( megaplay_bios_6600_w )
706563{
707   bios_6600 = data;
564   mplay_bios.bios_6600 = data;
708565//  logerror("BIOS: 0x6600 write: 0x%02x\n",data);
709566}
710567
711568static WRITE8_HANDLER( megaplay_game_w )
712569{
713   if(readpos == 1)
714      game_banksel = 0;
715   game_banksel |= (1 << (readpos-1)) * (data & 0x01);
570   if (mplay_bios.readpos == 1)
571      mplay_bios.game_banksel = 0;
572   mplay_bios.game_banksel |= (1 << (mplay_bios.readpos - 1)) * (data & 0x01);
716573
717   readpos++;
718   if(readpos > 9)
574   mplay_bios.readpos++;
575
576   if (mplay_bios.readpos > 9)
719577   {
720      bios_mode = MP_GAME;
721      readpos = 1;
722//      popmessage("Game bank selected: 0x%03x",game_banksel);
723      logerror("BIOS [0x%04x]: 68K address space bank selected: 0x%03x\n",cpu_get_previouspc(space->cpu),game_banksel);
578      mplay_bios.bios_mode = MP_GAME;
579      mplay_bios.readpos = 1;
580//      popmessage("Game bank selected: 0x%03x", mplay_bios.game_banksel);
581      logerror("BIOS [0x%04x]: 68K address space bank selected: 0x%03x\n", cpu_get_previouspc(space->cpu), mplay_bios.game_banksel);
724582   }
725583
726   mp_bios_bank_addr = ( ( mp_bios_bank_addr >> 1 ) | ( data << 23 ) ) & 0xff8000;
727
728
584   mplay_bios.mp_bios_bank_addr = ((mplay_bios.mp_bios_bank_addr >> 1) | (data << 23)) & 0xff8000;
729585}
730586
731587static ADDRESS_MAP_START( megaplay_bios_map, ADDRESS_SPACE_PROGRAM, 8 )
r6049r6050
754610void segae_vdp_ctrl_w ( UINT8 chip, UINT8 data );
755611void segae_vdp_data_w ( running_machine *machine, UINT8 chip, UINT8 data );
756612
757#if 0
758static READ8_HANDLER (megaplay_bios_port_be_bf_r)
759{
760   UINT8 temp = 0;
761
762   switch (offset)
763   {
764      case 0: /* port 0xbe, VDP 1 DATA Read */
765         temp = segae_vdp_data_r(0); break ;
766      case 1: /* port 0xbf, VDP 1 CTRL Read */
767         temp = segae_vdp_ctrl_r(0); break ;
768   }
769   return temp;
770}
771
772static WRITE8_HANDLER (megaplay_bios_port_be_bf_w)
773{
774   switch (offset)
775   {
776      case 0: /* port 0xbe, VDP 1 DATA Write */
777         segae_vdp_data_w(space->machine, 0, data); break;
778      case 1: /* port 0xbf, VDP 1 CTRL Write */
779         segae_vdp_ctrl_w(0, data); break;
780   }
781}
782#endif
783
784613static ADDRESS_MAP_START( megaplay_bios_io_map, ADDRESS_SPACE_IO, 8 )
785614   ADDRESS_MAP_GLOBAL_MASK(0xff)
786615   AM_RANGE(0x7f, 0x7f) AM_DEVWRITE("sn2", sn76496_w)   /* SN76489 */
r6049r6050
811640//extern VIDEO_EOF(megadriv);
812641static MACHINE_RESET( mpnew )
813642{
814   mp_bios_bank_addr = 0;
643   mplay_bios.bios_mode = MP_ROM;
644   mplay_bios.mp_bios_bank_addr = 0;
645   mplay_bios.readpos = 1;
815646   MACHINE_RESET_CALL(megadriv);
816647   MACHINE_RESET_CALL(megatech_bios);
817648}
r6049r6050
1005836ROM_END
1006837
1007838
1008static void megplay_stat(running_machine *machine)
839static void mplay_start(running_machine *machine)
1009840{
1010841   UINT8 *src = memory_region(machine, "mtbios");
1011842   UINT8 *instruction_rom = memory_region(machine, "user1");
r6049r6050
1013844   int offs;
1014845
1015846
1016   memmove(src+0x10000,src+0x8000,0x18000); // move bios..
847   memmove(src + 0x10000, src + 0x8000, 0x18000); // move bios..
1017848
1018849   /* copy game instruction rom to main map.. maybe this should just be accessed
1019850      through a handler instead?.. */
1020   for (offs=0;offs<0x8000;offs++)
851   for (offs = 0; offs < 0x8000; offs++)
1021852   {
1022853      UINT8 dat;
1023854
1024      dat=instruction_rom[offs];
855      dat = instruction_rom[offs];
1025856
1026      game_rom[0x300000+offs*2] = dat;
1027      game_rom[0x300001+offs*2] = dat;
857      game_rom[0x300000 + offs * 2] = dat;
858      game_rom[0x300001 + offs * 2] = dat;
1028859
1029860   }
1030861}
1031862
1032863static READ16_HANDLER( megadriv_68k_read_z80_extra_ram )
1033864{
1034   return ic36_ram[(offset<<1)^1] | (ic36_ram[(offset<<1)]<<8);
865   return ic36_ram[(offset << 1) ^ 1] | (ic36_ram[(offset << 1)] << 8);
1035866}
1036867
1037868static WRITE16_HANDLER( megadriv_68k_write_z80_extra_ram )
1038869{
1039870   if (!ACCESSING_BITS_0_7) // byte (MSB) access
1040871   {
1041      ic36_ram[(offset<<1)] = (data & 0xff00) >> 8;
872      ic36_ram[(offset << 1)] = (data & 0xff00) >> 8;
1042873   }
1043874   else if (!ACCESSING_BITS_8_15)
1044875   {
1045      ic36_ram[(offset<<1)^1] = (data & 0x00ff);
876      ic36_ram[(offset << 1) ^ 1] = (data & 0x00ff);
1046877   }
1047878   else // for WORD access only the MSB is used, LSB is ignored
1048879   {
1049      ic36_ram[(offset<<1)] = (data & 0xff00) >> 8;
880      ic36_ram[(offset << 1)] = (data & 0xff00) >> 8;
1050881   }
1051882}
1052883
r6049r6050
1054885static DRIVER_INIT (megaplay)
1055886{
1056887   /* to support the old code.. */
1057   ic36_ram = auto_alloc_array(machine, UINT16, 0x10000/2);
888   ic36_ram = auto_alloc_array(machine, UINT16, 0x10000 / 2);
1058889   ic37_ram = auto_alloc_array(machine, UINT8, 0x10000);
1059   genesis_io_ram = auto_alloc_array(machine, UINT16, 0x20/2);
890   genesis_io_ram = auto_alloc_array(machine, UINT16, 0x20 / 2);
1060891
1061   DRIVER_INIT_CALL(megadrij);
1062   megplay_stat(machine);
892   DRIVER_INIT_CALL(mpnew);
1063893
894   mplay_start(machine);
895
1064896   /* for now ... */
1065   memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa10000, 0xa1001f, 0, 0, OLD_megaplay_genesis_io_r, OLD_megaplay_genesis_io_w);
897   memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa10000, 0xa1001f, 0, 0, megaplay_io_read, megaplay_io_write);
1066898
1067899   /* megaplay has ram shared with the bios cpu here */
1068900   memory_install_readwrite8_handler(cputag_get_address_space(machine, "genesis_snd_z80", ADDRESS_SPACE_PROGRAM), 0x2000, 0x3fff, 0, 0, (read8_space_func)SMH_BANK(7), (write8_space_func)SMH_BANK(7));
r6049r6050
1103935didn't have original Sega part numbers it's probably a converted TWC cart
1104936*/
1105937
1106/* -- */ GAME( 1993, megaplay, 0, mpnew, megaplay, megaplay, ROT0, "Sega",                  "Mega Play BIOS", GAME_IS_BIOS_ROOT )
938/* -- */ GAME( 1993, megaplay, 0,        mpnew, megaplay, megaplay, ROT0, "Sega",                  "Mega Play BIOS", GAME_IS_BIOS_ROOT )
1107939/* 01 */ GAME( 1993, mp_sonic, megaplay, mpnew, mp_sonic, megaplay, ROT0, "Sega",                  "Sonic The Hedgehog (Mega Play)" , 0 )
1108940/* 02 */ GAME( 1993, mp_gaxe2, megaplay, mpnew, mp_gaxe2, megaplay, ROT0, "Sega",                  "Golden Axe II (Mega Play)" , 0 )
1109941/* 03 */ GAME( 1993, mp_gslam, megaplay, mpnew, mp_gslam, megaplay, ROT0, "Sega",                  "Grand Slam (Mega Play)",0  )
1110/* 04 */ GAME( 1993, mp_twc,   megaplay, mpnew, mp_twc,    megaplay, ROT0, "Sega",                  "Tecmo World Cup (Mega Play)" , 0 )
1111/* 05 */ GAME( 1993, mp_sor2,  megaplay, mpnew, mp_sor2,    megaplay, ROT0, "Sega",                  "Streets of Rage II (Mega Play)" , 0 )
942/* 04 */ GAME( 1993, mp_twc,   megaplay, mpnew, mp_twc,   megaplay, ROT0, "Sega",                  "Tecmo World Cup (Mega Play)" , 0 )
943/* 05 */ GAME( 1993, mp_sor2,  megaplay, mpnew, mp_sor2,  megaplay, ROT0, "Sega",                  "Streets of Rage II (Mega Play)" , 0 )
1112944/* 06 */ GAME( 1993, mp_bio,   megaplay, mpnew, mp_bio,   megaplay, ROT0, "Sega",                  "Bio-hazard Battle (Mega Play)" , 0 )
1113945/* 07 */ GAME( 1993, mp_soni2, megaplay, mpnew, mp_soni2, megaplay, ROT0, "Sega",                  "Sonic The Hedgehog 2 (Mega Play)" , 0 )
1114946/* 08 */
r6049r6050
1126958the numbering prior to 'Streets of Rage 2'
1127959
1128960*/
1129
src/mame/drivers/multigam.c
r6049r6050
435435
436436   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x8000, 0xffff, 0, 0, multigam3_mmc3_rom_switch_w );
437437
438   memory_set_bankptr(machine, 1, multigmc_mmc3_6000_ram);
438   memory_set_bankptr(machine, 10, multigmc_mmc3_6000_ram);
439439
440440   multigam3_mmc3_banks[0] = 0x1e;
441441   multigam3_mmc3_banks[1] = 0x1f;
r6049r6050
450450{
451451   if (multigam_game_gfx_bank & 0x80)
452452   {
453      set_videorom_bank(space->machine, 0, 8, (multigam_game_gfx_bank & 0xfc)  + (data & 0x3), 8);
453      set_videorom_bank(space->machine, 0, 8, (multigam_game_gfx_bank & 0x3c)  + (data & 0x3), 8);
454454   }
455455   else
456456   {
r6049r6050
458458   }
459459};
460460
461static WRITE8_HANDLER(multigm3_switch_gfx_rom)
462{
463   set_videorom_bank(space->machine, 0, 8, data & 0x3f, 8);
464   set_mirroring(data & 0x40 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
465   multigam_game_gfx_bank = data;
466};
467
461468static WRITE8_HANDLER(multigm3_switch_prg_rom)
462469{
463470   /* switch PRG rom */
r6049r6050
472479   else
473480   {
474481      memory_install_write8_handler(space, 0x8000, 0xffff, 0, 0, multigm3_mapper2_w );
475      memory_set_bankptr(space->machine, 1, memory_region(space->machine, "maincpu") + 0x6000);
482      memory_set_bankptr(space->machine, 10, memory_region(space->machine, "maincpu") + 0x6000);
476483   }
477484
478485   if (data & 0x80)
r6049r6050
507514   AM_RANGE(0x4017, 0x4017) AM_READ(multigam_IN1_r) AM_DEVWRITE("nes", psg_4017_w)      /* IN1 - input port 2 / PSG second control register */
508515   AM_RANGE(0x5001, 0x5001) AM_WRITE(multigm3_switch_prg_rom)
509516   AM_RANGE(0x5002, 0x5002) AM_WRITENOP
510   AM_RANGE(0x5003, 0x5003) AM_WRITE(multigam_switch_gfx_rom)
517   AM_RANGE(0x5003, 0x5003) AM_WRITE(multigm3_switch_gfx_rom)
511518   AM_RANGE(0x5000, 0x5ffe) AM_ROM
512519   AM_RANGE(0x5fff, 0x5fff) AM_READ_PORT("IN0")
513   AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(1)
520   AM_RANGE(0x6000, 0x7fff) AM_RAMBANK(10)
514521   AM_RANGE(0x6fff, 0x6fff) AM_WRITENOP /* 0x00 in attract mode, 0xff during play */
515522   AM_RANGE(0x8000, 0xffff) AM_ROM AM_WRITE(multigm3_mapper2_w)
516523ADDRESS_MAP_END
src/mame/drivers/bingor.c
r6049r6050
1/* Bingo Roll */
1/****************************************************
22
3  Bingo Roll / Bell Star
4
5
6*****************************************************
7
8
9  PCB Layout (Bell Star V3):
10
11                        ___________________________________________
12   ____________________| | | | | | | | | | | | | | | | | | | | | | |____________________
13  |                                  22x2 edge connector                                |
14  |                     ___________   ___________   ___________                         |
15  |                    |  9CANH1M  | |  9CANH1M  | |  9CANH1M  |                        |
16  |                    | ULN2003AN | | ULN2003AN | | ULN2003AN |                        |
17  |                    |___________| |___________| |___________|                        |
18  |                                                                                     |
19  |       _______       ______________________________                                  |
20  |      |JM04AB |     |                              |                                 |
21  |      |LM/386N|     |      P8256AH  L6140860       |                                 |
22  |      |_______|     |                              |                                 |
23  |                    |         Intel 1975           |                                 |
24  |                    |______________________________|                                 |
25  |                                                                                     |
26  |         ____________    ___________     ____________    ____________                |
27  |        |  9BARTCK   |  | YMZ284-D  |   | 898-3-R10K |  | 898-3-R10K |               |
28  |        | SN74HCTD0N |  | 9814QAAA  |   |            |  |            |               |
29  |        |____________|  |___________|   |____________|  |____________|               |
30  |                                                                                     |
31  | _____   _______________                                                             |
32  ||     | |               |                _____________   _____________               |
33  ||     | | MHS E         |               |   86AEY4K   | |   86AEY4K   |              |
34  ||     | | S-82716-4     |               | SN74HCT540N | | SN74HCT540N |              |
35  || (1) | | 8944          |               |_____________| |_____________|              |
36  ||     | |               |                _____________   _____________    _________  |
37  ||     | |               |               |   83C931K   | |   83C931K   |  | 88A59LM | |
38  ||     | |               |               | SN74HCT573N | | SN74HCT573N |  | LM339N  | |
39  ||     | |               |               |_____________| |_____________|  |_________| |
40  ||_____| |_______________|                                                            |
41  |                                                                                     |
42  |         _______________                 ________________    ________________        |
43  |        |               |               |  Bell Star V3  |  |  Bell Star V3  |       |
44  |        | N800186-12    |               |  V.3.6.02 L    |  |  V.3.6.02 H    |       |
45  |        | 9941GPA BR    |               |  TMS27C256-10  |  |  TMS27C256-10  |       |
46  |        | 8944          |               |________________|  |________________|       |
47  |        | AMD           |                ________________    ________________        |
48  |        | INTEL '78 '82 |               |  B.S. Grafik   |  |  B.S. Grafik   |       |
49  |        |               |               |  11.10.02 L    |  |  11.10.02 H    |       |
50  |        |               |               |   M27C256B     |  |   M27C256B     |       |
51  |        |_______________|               |________________|  |________________|       |
52  |                                                                                     |
53  |                                         ________________    ________________        |
54  |           _____________                |    HY62256B    |  |   HY62256B     |       |
55  |          |   83C931K   |               |     LP-70      |  |    LP-70       |       |
56  |          | SN74HCT573N |               |  9846B KOREA   |  |   9846B KOREA  |       |
57  |          |_____________|               |________________|  |________________|       |
58  |                                                                                     |
59  |         _____________________                                                       |
60  |        |      74HCT540N      |        __________   ________   __________   _______  |
61  |        | C5944ME / Hnn9931 D |       |  86A4CY  | |74HCT08N| | 06F6L9K  | |ADM690 | |
62  |        |_____________________|       |SN74HCT02N| |D0945PS | |SN74HCT32N| |AN/9927| |
63  |                                      |__________| |________| |__________| |_______| |
64  |                                                                                     |
65  |            ______________             __________    ________________                |
66  |           |  PIC 16C54C  |           |          |  |                |               |
67  |           |    04/P      |           |  24C04A  |  | 3.6 V. BATTERY |               |
68  |           |______________|           |__________|  |________________|               |
69  |                                                                                     |
70  |_____________________________________________________________________________________|
71
72
73  (1) Siemens HYB5141758J-60 (Germany).
74
75  - 1x Xtal 16 MHz.
76  - 1x Xtal ?? MHz.
77
78
79  Etched in copper:
80
81  "VIP-3 PALOMA ELEKTRONIK"
82  "gruber electronic gmbh"
83  "KMG-Layout 007051"
84  "Rev 1.0"
85  "0103 VIP 3"
86
87
88*****************************************************
89
90  Pinout:
91
92  ROLLING JOKER+ / BELL STAR+
93
94  +--------------------+----------------------+
95  |        Solder      |       Component      |
96  +----------------+---+----+-----------------+
97  |           GND  | A |  1 |  GND            |
98  |           GND  | B |  2 |  GND            |
99  |           GND  | C |  3 |  GND            |
100  |       +5 Volt  | D |  4 |  +5 Volt        |
101  |      +12 Volt  | E |  5 |  +12 Volt       |
102  |    Lamp Hold1  | F |  6 |  Lamp Start     |
103  |    Lamp Hold2  | H |  7 |  Lamp Hold5     |
104  |    Lamp Clear  | J |  8 |  Lamp Hold4     |
105  |        Coin 1  | K |  9 |  Lamp Hold3     |
106  |    Counter In  | L | 10 |  Remote         |
107  |   Counter Out  | M | 11 |  Button Hold1   |
108  |Counter Remote  | N | 12 |  Button Clear   |
109  |  Button Hold5  | P | 13 |  Button Start   |
110  |  Owner Bookk.  | R | 14 |  Rental Bookk.  |
111  |  Button Hold2  | S | 15 |  Button Hold4   |
112  |        Coin 2  | T | 16 |  Button Hold3   |
113  |            nc  | U | 17 |  Hopper Count   |
114  |            nc  | V | 18 |  Hopper Drive   |
115  |   Video Green  | W | 19 |  Video Red      |
116  |    Video Sync  | X | 20 |  Video Blue     |
117  |  Speaker 1(+)  | Y | 21 |  Video Ground   |
118  |  Credit Clear  | Z | 22 |  Speaker 1(-)   |
119  +----------------+---+----+-----------------+
120
121****************************************************/
122
123
3124#include "driver.h"
4125#include "cpu/i86/i86.h"
5126#include "cpu/pic16c5x/pic16c5x.h"
r6049r6050
266387   ROM_LOAD( "bingor4_24c04a.bin", 0x000000, 0x200,  CRC(38cf70a9) SHA1(ba9a1640200963e2d58d761edc13a24fa5ef44c2) )
267388ROM_END
268389
269GAME( 199?, bingor1,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bellstar? (set 1)",     GAME_NOT_WORKING | GAME_NO_SOUND )
270GAME( 199?, bingor2,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bellstar? (set 2)",     GAME_NOT_WORKING | GAME_NO_SOUND )
271GAME( 199?, bingor3,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bellstar? (set 3)",     GAME_NOT_WORKING | GAME_NO_SOUND )
272GAME( 199?, bingor4,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bellstar? (set 4)",     GAME_NOT_WORKING | GAME_NO_SOUND )
390/*
391
392  BellStar V3
393  Same as bingor3, but with different program ROMs
394
395*/
396
397ROM_START( bingor5 )   /* BellStar V3 */
398   ROM_REGION( 0x20000, "boot_prg", ROMREGION_ERASE00 ) /* i186 code */
399   ROM_LOAD16_BYTE( "bellstar_v3_v.3.6.02_l.bin", 0x010000, 0x08000, CRC(56b84a5d) SHA1(1bda4fb972b4f0f0575089b545bf15dfea859948) )
400   ROM_LOAD16_BYTE( "bellstar_v3_v.3.6.02_h.bin", 0x010001, 0x08000, CRC(d6945bb8) SHA1(b620f1b547be03c4609bff8d06111d0ea425bae8) )
401
402   ROM_REGION( 0x20000, "gfx", ROMREGION_ERASE00 ) /* blitter data? */
403   ROM_LOAD16_BYTE( "b.s.grafik_11.10.02_l.bin", 0x000000, 0x08000, CRC(a8b22477) SHA1(92d638f0f188a43f14487989cf42195311fb2c35) ) //half size?
404   ROM_LOAD16_BYTE( "b.s.grafik_11.10.02_h.bin", 0x000001, 0x08000, CRC(969d201c) SHA1(7705ceb383ef122538ebf8046041d1c24ec9b9a4) )
405
406   ROM_REGION( 0x20000, "pic", 0 ) /* protection? */
407   ROM_LOAD( "pic16c54c.bin", 0x000, 0x400, CRC(5a507be6) SHA1(f4fbfb7e7516eecab32d96b3a34ad88395edac9e) )
408
409   ROM_REGION( 0x20000, "eeprom", 0 ) /* eeprom */
410   ROM_LOAD( "bingor5_24c04a.bin", 0x000000, 0x200,  CRC(fcff2d26) SHA1(aec1ddd38149404741a057c74bf84bfb4a8e4aa1) )
411ROM_END
412
413
414
415GAME( 2002, bingor1,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bell Star? (set 1)",     GAME_NOT_WORKING | GAME_NO_SOUND )
416GAME( 2002, bingor2,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bell Star? (set 2)",     GAME_NOT_WORKING | GAME_NO_SOUND )
417GAME( 2002, bingor3,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bell Star? (set 3)",     GAME_NOT_WORKING | GAME_NO_SOUND )
418GAME( 2002, bingor4,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bell Star? (set 4)",     GAME_NOT_WORKING | GAME_NO_SOUND )
419GAME( 2002, bingor5,    0,      bingor,   bingor,   0,       ROT0,  "<unknown>", "Bingo Roll / Bell Star V3? (set 5)",  GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/backfire.c
r6049r6050
227227static READ32_HANDLER(backfire_eeprom_r)
228228{
229229   /* some kind of screen indicator?  checked by backfira set before it will boot */
230   int backfire_screen = mame_rand(space->machine)&1;
231   return ((eeprom_read_bit()<<24) | input_port_read(space->machine, "IN0")
232         | ((input_port_read(space->machine, "IN2") & ~0x40) <<16)
233         | ((input_port_read(space->machine, "IN3") &  0x40) <<16)) ^  (backfire_screen << 26) ;
230   int backfire_screen = mame_rand(space->machine) & 1;
231   return ((eeprom_read_bit() << 24) | input_port_read(space->machine, "IN0")
232         | ((input_port_read(space->machine, "IN2") & 0xbf) << 16)
233         | ((input_port_read(space->machine, "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
234234}
235235
236236static READ32_HANDLER(backfire_control2_r)
237237{
238//  logerror("%08x:Read eprom %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
239   return (eeprom_read_bit()<<24) | input_port_read(space->machine, "IN1") | (input_port_read(space->machine, "IN1")<<16);
238//  logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
239   return (eeprom_read_bit() << 24) | input_port_read(space->machine, "IN1") | (input_port_read(space->machine, "IN1") << 16);
240240}
241241
242242#ifdef UNUSED_FUNCTION
243243static READ32_HANDLER(backfire_control3_r)
244244{
245//  logerror("%08x:Read eprom %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
246   return (eeprom_read_bit()<<24) | input_port_read(space->machine, "IN2") | (input_port_read(space->machine, "IN2")<<16);
245//  logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
246   return (eeprom_read_bit() << 24) | input_port_read(space->machine, "IN2") | (input_port_read(space->machine, "IN2") << 16);
247247}
248248#endif
249249
src/mame/drivers/multfish.c
r6049r6050
1/* 'Multifish' hardware
1/*
22
3  four ALTERA chips - they are probably video processors
4  main CPU is z80 for sure, ROM is placed near it
5  there are banked ROMs 8kb each, consisted of several banks
3   Igrosoft gambling hardware
4
5   +--+ +-----+ +-----------------------------------+
6+--+  +-+PRINT+-+                                   |
7|            +--------------+                       |
8|            |     Z80B     |                       |
9|      VOL   +----+---------+                       |
10+-+ +-----------+ | PRG ROM |                       |
11  | |  KC89C72  | +---------+                       |
12+-+ +-----------+ | M48T35Y |  24MHz                -+
13|                 +---------+                ADM690 V|
14|                |---Connector------------------|   G|
15|E                                                  A|
16|d                                                  -+
17|g                                                  |
18|e                                                  |
19|                                                   |
20|C                                                  |
21|o                                                  |
22|n                                                  |
23|n                                                  |
24|e                                                  |
25|c                           Connector              |
26|t               |---Connector------------------|   |
27|o           +------+ +------+ +------+ +------+    |
28|r           |ALTERA| |ALTERA| |ALTERA| |ALTERA| R  |
29|            | EPM  | | EPM  | | EPM  | | EPM  | A  |
30|            | 3032 | | 3032 | | 3032 | | 3032 | M  |
31|            +------+ +------+ +------+ +------+    |
32+-+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ |
33  | |   | |   | |   | |   | |   | |   | |   | |   | |
34+-+ | 8 | | 7 | | 6 | | 5 | | 4 | | 3 | | 2 | | 1 | |
35|   |   | |   | |   | |   | |   | |   | |   | |   | |
36|   |   | |   | |   | |   | |   | |   | |   | |   | |
37|   +---+ +---+ +---+ +---+ +---+ +---+ +---+ +---+ |
38+---------------------------------------------------+
39
40"Head" sub board:
41+------------------------------+
42||--Connector-----------------||
43|            61256AK-15        |
44|                              |
45|          +---------+         |
46|          | ALTERA  |         |
47|          |   MAX   |         |
48|          | EPM3256 |         |
49|          |         |         |
50|          +---------+         |
51|                              |
52|           Connector          |
53||--Connector-----------------||
54+------------------------------+
55
56  CPU: Z80
57Video: ALTERA EPM3032ALC44-10 (x4) + ALTERA MAX EPM3256AOC208-10 (on the HEAD sub board)
58Sound: File KC98C72 (compatible to YM2149 / AY3-9810)
59  OSC: 24MHz
60  RAM: UMC UM61256AK-15 (x2 on mainboard, one on the HEAD)
61NVRAM: Timekeeper M48T35-70PC1
62Other: ADM ADM690AN (Microprocessor Supervisory Circuit AKA Watchdog timer)
63       VGA connector for video output
64
65Edge Connector is 36 count dual (IE: both sides) JAMMA-like connection (standard 8-liner??)
66
667  RAM has E000 address
7  the sound is PSG - AY3-8910 analog (http://pt.wikipedia.org/wiki/KC89C72)
8  z80 CPU is complete with indexed registers
9  video - VGA
1068
1169  To Init the games
1270
r6049r6050
3088  Todo:
3189  -------------------------------------------------------------------------
3290  Hook up Lamps
33  Emulate the RTC (real time clock)
3491
3592
3693  NOTE:
r6049r6050
4198  but not the CRC32 hash. These sets are excluded using the 'ALL_REVISIONS'
4299  "#if" statements but listed in the driver below.
43100
101Banking addresses are likely controlled via a GAL/PAL and was added at some
102point to try and prevent rom swaps and conversions. Many of the hacked sets
103below are simply made to the banking address to run on other boards.
104
105  Bank addresses
106  ---------------------
107  Island 2           E1
108  Gnome              E5
109  Sweet Life 2       E8
110  Fruit Coctail 2    EA
111  Multi Fish         F8
112  Crazy Monkey       F9
113  Fruit Coctail      F9
114  Garage             F9
115  Resident           F9
116  Lucky Hunter       F9
117  Rock Climber       F9
118  Roll Fruit         F9
119  Pirate             FA
120  Sweet Life         FA
121  Island             FB
122  Keks               FC
123  Pirate 2           FD
124
44125*/
45126
46127#define ALL_REVISIONS 0
r6049r6050
88169         0);
89170}
90171
91
92172static VIDEO_START(multfish)
93173{
94174   multfish_vid = auto_alloc_array(machine, UINT8, multfish_VIDRAM_SIZE);
r6049r6050
107187   tilemap_set_scroll_cols(multfish_reel_tilemap, 64);
108188}
109189
110
111
112
113
114190static VIDEO_UPDATE(multfish)
115191{
116192   int i;
r6049r6050
209285   otherrambk = data & 0xf0;
210286}
211287
212
213288static READ8_HANDLER( ray_r )
214289{
215290   // the games read the raster beam position as part of the hardware checks..
r6049r6050
238313   multfish_hopper_motor = data & 0x10; //0x10 Hopper Motor (33B)
239314}
240315
316INLINE UINT8 make_bcd(UINT8 data)
317{
318   return ((data / 10) << 4) | (data % 10);
319}
241320
321static READ8_HANDLER(multfish_rtc_r)
322{
323   mame_system_time systime;
324
325   mame_get_current_datetime(space->machine, &systime);
326   switch (offset)
327   {
328      case 0:
329         return 0;
330      case 1:
331         return make_bcd(systime.local_time.second);
332      case 2:
333         return make_bcd(systime.local_time.minute);
334      case 3:
335         return make_bcd(systime.local_time.hour);
336      case 4:
337         return make_bcd(systime.local_time.weekday);
338      case 5:
339         return make_bcd(systime.local_time.mday);
340      case 6:
341         return make_bcd(systime.local_time.month+1);
342      case 7:
343                        return make_bcd(systime.local_time.year % 100);
344      default:
345         return 0;
346   }
347}
348
349static WRITE8_HANDLER(multfish_rtc_w)
350{
351
352}
353
354
242355static ADDRESS_MAP_START( multfish_map, ADDRESS_SPACE_PROGRAM, 8 )
243356   AM_RANGE(0x0000, 0x7fff) AM_READWRITE(SMH_ROM, multfish_vid_w)
244357   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(SMH_BANK(1), SMH_ROM )
245   AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
358   AM_RANGE(0xc000, 0xdff7) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
359   AM_RANGE(0xdff8, 0xdfff) AM_READWRITE(multfish_rtc_r, multfish_rtc_w)
246360   AM_RANGE(0xe000, 0xffff) AM_READWRITE(bankedram_r, bankedram_w)
247361ADDRESS_MAP_END
248362
r6049r6050
405519   //popmessage("multfish_f3_w %02x",data);
406520}
407521
408
409522static WRITE8_HANDLER( multfish_f4_w )
410523{
411524   //popmessage("multfish_f4_w %02x",data); // display enable?
r6049r6050
438551
439552   AM_RANGE(0x90, 0x90) AM_READ(ray_r)
440553
441   AM_RANGE(0xe1, 0xe1)  AM_WRITE(multfish_bank_w)
442   AM_RANGE(0xe5, 0xe5)  AM_WRITE(multfish_bank_w)
443   AM_RANGE(0xe8, 0xe8)  AM_WRITE(multfish_bank_w) // mirror banking for some games
444   AM_RANGE(0xea, 0xea)  AM_WRITE(multfish_bank_w) // mirror banking for some games
554   AM_RANGE(0xd0, 0xd0)  AM_WRITE(multfish_bank_w) // rollfr_3a banking
555   AM_RANGE(0xe1, 0xe1)  AM_WRITE(multfish_bank_w) // Island 2 banking
556   AM_RANGE(0xe5, 0xe5)  AM_WRITE(multfish_bank_w) // Gnome banking
557   AM_RANGE(0xe8, 0xe8)  AM_WRITE(multfish_bank_w) // Sweet Life 2 banking
558   AM_RANGE(0xea, 0xea)  AM_WRITE(multfish_bank_w) // Fruit Cocktail 2 banking
445559
446560   AM_RANGE(0xf1, 0xf1)  AM_WRITE(multfish_rambank_w)
447561   AM_RANGE(0xf3, 0xf3)  AM_WRITE(multfish_f3_w) // from 00->01 at startup, irq enable maybe?
r6049r6050
452566ADDRESS_MAP_END
453567
454568
455
456
457569static const gfx_layout tiles16x16_layout =
458570{
459571   16,16,
r6049r6050
473585};
474586
475587
476
477588static GFXDECODE_START( multfish )
478589   GFXDECODE_ENTRY( "gfx", 0, tiles16x16_layout, 0, 16 )
479590GFXDECODE_END
r6049r6050
525636MACHINE_DRIVER_END
526637
527638
528
529639/*********************************************************
530640   Multifish
531641**********************************************************/
r6049r6050
577687   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
578688ROM_END
579689
580ROM_START( mfish_3a ) // 021124
690ROM_START( mfish_3a ) // 021124 bank F9
581691   ROM_REGION( 0x40000, "maincpu", 0 )
582692   ROM_LOAD( "mf021124a.rom", 0x00000, 0x40000, CRC(31344b4e) SHA1(33c7f30b55d22c087a02e840456d475177df8bf1) ) /* Not officially listed on Igrosoft's web site hash page */
583693
r6049r6050
697807   ROM_LOAD( "7", 0x280000, 0x80000, CRC(9afdc2d3) SHA1(b112fd2005354c9f97d77030bdb6f99d7b5c8050) )
698808   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
699809ROM_END
810#endif
700811
701812ROM_START( mfish_11 ) // 031124
702813   ROM_REGION( 0x40000, "maincpu", 0 )
703   ROM_LOAD( "mf031124.rom", 0x00000, 0x40000, MD5(9cd800719c6e4a2267e3c140467238d3) SHA1(c0d1b541c4b076bbc810ad637acb4a2663a919ba) )
814   ROM_LOAD( "mf031124.rom", 0x00000, 0x40000, CRC(1d60d37a) SHA1(c0d1b541c4b076bbc810ad637acb4a2663a919ba) )
704815
705816   ROM_REGION( 0x400000, "gfx", 0 )
706817   ROM_LOAD( "1", 0x000000, 0x80000, CRC(2f2a7367) SHA1(ce7ee9ca4f374ec61edc3b89d4752f0edb64a910) )
r6049r6050
712823   ROM_LOAD( "7", 0x280000, 0x80000, CRC(9afdc2d3) SHA1(b112fd2005354c9f97d77030bdb6f99d7b5c8050) )
713824   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
714825ROM_END
715#endif
716826
717827ROM_START( mfish_12 ) // 040308
718828   ROM_REGION( 0x40000, "maincpu", 0 )
r6049r6050
729839   ROM_LOAD( "8", 0x380000, 0x80000, CRC(29f1a326) SHA1(5e268411cab888c0727aaf8ae7d0b435d2efd189) )
730840ROM_END
731841
732ROM_START( mfish_12a ) // 040308
842ROM_START( mfish_12a ) // 040308 bank F9
733843   ROM_REGION( 0x40000, "maincpu", 0 )
734844   ROM_LOAD( "mf040308a.rom", 0x00000, 0x40000, CRC(44537648) SHA1(7bce6085778ff0b21c052ae91703de3b78b8eed0) ) /* Not officially listed on Igrosoft's web site hash page */
735845
r6049r6050
876986   ROM_LOAD( "8",  0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
877987ROM_END
878988
879ROM_START( crzmon_7a ) // 031110
989ROM_START( crzmon_7a ) // 031110 backdoor
880990   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
881991   ROM_LOAD( "cm031110a.rom", 0x00000, 0x40000, CRC(80666246) SHA1(e15a210b11ba769ca4fd637c962932417555dc0e) ) /* Not officially listed on Igrosoft's web site hash page */
882992
r6049r6050
8911001   ROM_LOAD( "8",  0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
8921002ROM_END
8931003
894ROM_START( crzmon_7b ) // 031110
1004ROM_START( crzmon_7b ) // 031110 backdoor
8951005   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
8961006   ROM_LOAD( "cm031110b.rom", 0x00000, 0x40000, CRC(bb6f4f85) SHA1(a2f44632f857392eb422412b55a19decae4c8620) ) /* Not officially listed on Igrosoft's web site hash page */
8971007
r6049r6050
9211031   ROM_LOAD( "8",  0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
9221032ROM_END
9231033
924ROM_START( crzmon_8a ) // 050120
1034ROM_START( crzmon_8a ) // 050120 backdoor
9251035   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
9261036   ROM_LOAD( "cm050120a.rom", 0x00000, 0x40000, CRC(e20a6997) SHA1(50e0f0f354dd6db2be64d42e36b4043915c4276b) ) /* Not officially listed on Igrosoft's web site hash page */
9271037
r6049r6050
9361046   ROM_LOAD( "8",  0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
9371047ROM_END
9381048
1049ROM_START( crzmon_8b ) // 050120 changed version text to 070315
1050   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1051   ROM_LOAD( "cm050120b.rom", 0x00000, 0x40000, CRC(9350d184) SHA1(ccb79bb6c5e9025d64fe07c02334c43d75ee3334) ) /* Not officially listed on Igrosoft's web site hash page */
1052
1053   ROM_REGION( 0x400000, "gfx", 0 )
1054   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(683f2be3) SHA1(6fdba4ec07752bf049787a11638895352e9d5f10) )
1055   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(e21ce6a4) SHA1(942ffe323ddbcaaad887cb5bc9f356550926083b) )
1056   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(c3d0e3d5) SHA1(5b0cb436c6b0bac1213c1df56702fa7f16856106) )
1057   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(f79df52c) SHA1(b99fa9f61849b62668bf9edff1c80212a9108b15) )
1058   ROM_LOAD( "5",  0x080000, 0x80000, CRC(9d4d2a94) SHA1(c714e110de628b343dfc7fff23befaa1276056a9) )
1059   ROM_LOAD( "6",  0x180000, 0x80000, CRC(a15f0fee) SHA1(3f06d5a1a41e1335bcc7586a5ea95b9b734155c0) )
1060   ROM_LOAD( "7",  0x280000, 0x80000, CRC(715a2528) SHA1(6c4c72592568ecbaa9518fb7271d2714dd22dbbb) )
1061   ROM_LOAD( "8",  0x380000, 0x80000, CRC(6fdb6fd5) SHA1(f40916112365de258956ec033aff79aae1f58690) )
1062ROM_END
1063
9391064/*********************************************************
9401065   Fruit Cocktail
9411066
r6049r6050
10361161   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
10371162ROM_END
10381163
1039ROM_START( fcockt_6a ) // 040216
1164ROM_START( fcockt_6a ) // 040216 bank F8
10401165   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
10411166   ROM_LOAD( "fc040216a.rom", 0x00000, 0x40000, CRC(58e7a0c6) SHA1(8022f92af05e9ff6999ff936bad6048d6c264086) ) /* Not officially listed on Igrosoft's web site hash page */
10421167
r6049r6050
10511176   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
10521177ROM_END
10531178
1054ROM_START( fcockt_6b ) // 040216
1179ROM_START( fcockt_6b ) // 040216 backdoor
10551180   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
10561181   ROM_LOAD( "fc040216b.rom", 0x00000, 0x40000, CRC(0f6bcf03) SHA1(6c8765f836f1d899aec3be9c842d5064fd70a435) ) /* Not officially listed on Igrosoft's web site hash page */
10571182
r6049r6050
10811206   ROM_LOAD( "8b", 0x380000, 0x80000, CRC(d282e42e) SHA1(eac9c3eaef39b1805f863ade5da47d6274d20a55) )
10821207ROM_END
10831208
1084ROM_START( fcockt_7a ) // 050118
1209ROM_START( fcockt_7a ) // 050118 backdoor
10851210   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
10861211   ROM_LOAD( "fc050118a.rom", 0x00000, 0x40000, CRC(eb2bd908) SHA1(b8e9ef469767fb9e95ff181876ffeaee4b7b9361) ) /* Not officially listed on Igrosoft's web site hash page */
10871212
r6049r6050
11811306   ROM_LOAD( "8",  0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
11821307ROM_END
11831308
1184ROM_START( lhaunt_4a ) // 031111
1309ROM_START( lhaunt_4a ) // 031111 backdoor
11851310   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
11861311   ROM_LOAD( "lh031111a.rom", 0x00000, 0x40000, CRC(83d487c9) SHA1(5b88745d06acba542e2d0660298c9058f2bdfa3f) ) /* Not officially listed on Igrosoft's web site hash page */
11871312
r6049r6050
12111336   ROM_LOAD( "8",  0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
12121337ROM_END
12131338
1214ROM_START( lhaunt_5a ) // 040216
1339ROM_START( lhaunt_5a ) // 040216 backdoor
12151340   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
12161341   ROM_LOAD( "lh040216a.rom", 0x00000, 0x40000, CRC(2a6c7ff9) SHA1(4a0137c7df5003e8fd843d5489d416d15f001f46) ) /* Not officially listed on Igrosoft's web site hash page */
12171342
r6049r6050
12411366   ROM_LOAD( "8",  0x380000, 0x80000, CRC(1bdf6252) SHA1(7b5ae82a95a744b236e109024d47b526dccf9c14) )
12421367ROM_END
12431368
1244ROM_START( lhaunt_6a ) // 040825
1369ROM_START( lhaunt_6a ) // 040825 backdoor
12451370   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
12461371   ROM_LOAD( "lh040825a.rom", 0x00000, 0x40000, CRC(18ba5704) SHA1(3c77ed129db0e5181217167b76292f8e4ee78728) ) /* Not officially listed on Igrosoft's web site hash page */
12471372
r6049r6050
13261451   ROM_LOAD( "8",  0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
13271452ROM_END
13281453
1329ROM_START( garage_4a ) // 040219.
1454ROM_START( garage_4a ) // 040219 backdoor
13301455   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
13311456   ROM_LOAD( "gg040219a.rom", 0x00000, 0x40000, CRC(e16b213a) SHA1(af0d78116d985efe5f09eb86eb67df2535765527) ) /* Not officially listed on Igrosoft's web site hash page */
13321457
r6049r6050
13411466   ROM_LOAD( "8",  0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
13421467ROM_END
13431468
1344ROM_START( garage_5 ) // 050311.
1469ROM_START( garage_4b ) // 040219 changed version text to 070329
13451470   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1471   ROM_LOAD( "gg040219b.rom", 0x00000, 0x40000, CRC(b8ebf3b6) SHA1(14c5263571123d251125723b32861bef578de67b) ) /* Not officially listed on Igrosoft's web site hash page */
1472
1473   ROM_REGION( 0x400000, "gfx", 0 )
1474   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(57acd4bc) SHA1(8796f463787c359cce6ac09c1b6895f871bbb7c9) )
1475   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(6d591fa3) SHA1(ddbdf87e0e88dc848b963fbfcb6e14d7b3b9efdc) )
1476   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(6a15eeda) SHA1(ac35a20893b0518a159207401f6b7f58e3de45fa) )
1477   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(38f2cd3c) SHA1(5a4463ac352e4e340c6aaa61102841541e9f4c48) )
1478   ROM_LOAD( "5",  0x080000, 0x80000, CRC(5bf85bc5) SHA1(ff9d2b9cbcd2af6f5fda972e387820d830c196a9) )
1479   ROM_LOAD( "6",  0x180000, 0x80000, CRC(e5082b26) SHA1(6547409d39dd51498ce8e3f82ff813a8ac3c6522) )
1480   ROM_LOAD( "7",  0x280000, 0x80000, CRC(dfa2ceb1) SHA1(ec7de8a8f6e7785a563df973841cc1f1603f79fc) )
1481   ROM_LOAD( "8",  0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
1482ROM_END
1483
1484ROM_START( garage_5 ) // 050311
1485   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
13461486   ROM_LOAD( "gg050311.rom", 0x00000, 0x40000, CRC(405aee88) SHA1(356a8c309434ae4ad6b6fab97aeaece8aa60a730) )
13471487
13481488   ROM_REGION( 0x400000, "gfx", 0 )
r6049r6050
13561496   ROM_LOAD( "8",  0x380000, 0x80000, CRC(90c5416b) SHA1(583bfb517bc2e30d7b7903aa19fc3b4b5188d7d2) )
13571497ROM_END
13581498
1359ROM_START( garage_5a ) // 050311.
1499ROM_START( garage_5a ) // 050311 backdoor
13601500   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
13611501   ROM_LOAD( "gg050311a.rom", 0x00000, 0x40000, CRC(874a2c27) SHA1(9bf586314f375c2c6f7d79557cc777ac3559cb64) ) /* Not officially listed on Igrosoft's web site hash page */
13621502
r6049r6050
14901630   ROM_LOAD( "8", 0x380000, 0x80000, CRC(75954355) SHA1(e6ef2b70d859b61e8e3d1751de8558b8778e502d) )
14911631ROM_END
14921632
1633ROM_START( sweetlb ) // 041220 bank F9, changed version text to 070412
1634   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1635   ROM_LOAD( "sl041220b.rom", 0x00000, 0x40000, CRC(53f1a0e1) SHA1(a00a8e8d95bd2be27313c1421d40120ee79ff29d) ) /* Not officially listed on Igrosoft's web site hash page */
1636
1637   ROM_REGION( 0x400000, "gfx", 0 )
1638   ROM_LOAD( "1", 0x000000, 0x80000, CRC(a096c786) SHA1(81f6b083cb089e9412a8506889196354c670d945) )
1639   ROM_LOAD( "2", 0x100000, 0x80000, CRC(c5e1e22c) SHA1(973ad27681a0f3beee7084b1b85fc9deb79d638e) )
1640   ROM_LOAD( "3", 0x200000, 0x80000, CRC(af335323) SHA1(b8afdce231a8ec0f313cc47e00a27f05461bbbc4) )
1641   ROM_LOAD( "4", 0x300000, 0x80000, CRC(a35c7503) SHA1(78f7a868660bbaa066e8e9e341db52018aaf3af1) )
1642   ROM_LOAD( "5", 0x080000, 0x80000, CRC(e2d6b632) SHA1(65d05e55671b8c335cae2dfbf6a6f5bd8cc90e2c) )
1643   ROM_LOAD( "6", 0x180000, 0x80000, CRC(d34e0905) SHA1(cc4afe64fb9052a31f759be41ff07a727e0a9093) )
1644   ROM_LOAD( "7", 0x280000, 0x80000, CRC(978b67bb) SHA1(87357d5832588f00272bd76df736c06c599f3853) )
1645   ROM_LOAD( "8", 0x380000, 0x80000, CRC(75954355) SHA1(e6ef2b70d859b61e8e3d1751de8558b8778e502d) )
1646ROM_END
1647
14931648/*********************************************************
14941649   Resident
14951650
r6049r6050
16741829ROM_END
16751830#endif
16761831
1677ROM_START( pirate_1 ) // 060210
1832ROM_START( pirate_2 ) // 060210
16781833   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
16791834   ROM_LOAD( "pr060210.rom", 0x00000, 0x40000, CRC(5684d67d) SHA1(4cbd103bcd071df26830d56760ef477b9a652857) )
16801835
r6049r6050
16891844   ROM_LOAD( "8", 0x380000, 0x80000, CRC(cc2edac2) SHA1(24bacd9e092a83945a8def3a254ec66758d71ff5) )
16901845ROM_END
16911846
1847ROM_START( pirate_3 ) // 060803
1848   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1849   ROM_LOAD( "pr060803.rom", 0x00000, 0x40000, CRC(1de68707) SHA1(99dd3c5186ed8ba6c17e9f5479df93173da527e0) )
1850
1851   ROM_REGION( 0x400000, "gfx", 0 )
1852   ROM_LOAD( "1", 0x000000, 0x80000, CRC(d2199619) SHA1(8c67ef7d0e305ae0783302ba9a1cb56cdcf4bc09) )
1853   ROM_LOAD( "2", 0x100000, 0x80000, CRC(ce5c6548) SHA1(ef1cd6ae36cc1abcf010762dc89a255cd817d016) )
1854   ROM_LOAD( "3", 0x200000, 0x80000, CRC(d6a8338d) SHA1(6a0e41309dc909decf8bd49cf13cbeca95f0314a) )
1855   ROM_LOAD( "4", 0x300000, 0x80000, CRC(590b8cf6) SHA1(b2778f6e1b7bcf7f33ced43f999eff983e5a6af4) )
1856   ROM_LOAD( "5", 0x080000, 0x80000, CRC(bf9f1267) SHA1(b0947bd7d31301ffbe80cbaf1e96c3476f6f9ca3) )
1857   ROM_LOAD( "6", 0x180000, 0x80000, CRC(b0cdf7eb) SHA1(cf6bd20fb40cf0d87eeb6f1502fb73d9760c9140) )
1858   ROM_LOAD( "7", 0x280000, 0x80000, CRC(6c4a9510) SHA1(e10bf8475ff7c73ba90b904b9214b285a5b2669f) )
1859   ROM_LOAD( "8", 0x380000, 0x80000, CRC(cc2edac2) SHA1(24bacd9e092a83945a8def3a254ec66758d71ff5) )
1860ROM_END
1861
1862
16921863/*********************************************************
1864   Pirate 2
1865**********************************************************/
1866
1867ROM_START( pirate2 ) // 061005
1868   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1869   ROM_LOAD( "pr2_061005.rom", 0x00000, 0x40000, CRC(4ad0a29a) SHA1(72950da5f201a393a4761a8696cfc210725df23f) )
1870
1871   ROM_REGION( 0x400000, "gfx", 0 )
1872   ROM_LOAD( "1", 0x000000, 0x80000, CRC(106e7cba) SHA1(289a3ae38b895c83600c920bee0c2dd46e941eac) )
1873   ROM_LOAD( "2", 0x100000, 0x80000, CRC(076a290f) SHA1(2f9bb74e081262e535c8ed9a31589d6a919f5d15) )
1874   ROM_LOAD( "3", 0x200000, 0x80000, CRC(13a91fe7) SHA1(6e127b3827a9271ad19986714747be9367125f62) )
1875   ROM_LOAD( "4", 0x300000, 0x80000, CRC(5ac8c531) SHA1(1da91b9a71a9a8681577342660bfa85e5bbc99bc) )
1876   ROM_LOAD( "5", 0x080000, 0x80000, CRC(98012c74) SHA1(2a5b466353eef3a5cfc9f98eceb7523b00d0204a) )
1877   ROM_LOAD( "6", 0x180000, 0x80000, CRC(366e1465) SHA1(440230d5306c4b424f27839b7fb9c8a5bb922dcc) )
1878   ROM_LOAD( "7", 0x280000, 0x80000, CRC(21fb963e) SHA1(e3f7fb13f326699e34aebcc3ee07016f7cfe6e46) )
1879   ROM_LOAD( "8", 0x380000, 0x80000, CRC(40c59448) SHA1(774af0f376864ec5948904df338bc7493eaed392) )
1880ROM_END
1881
1882ROM_START( pirate2a ) // 061005 bank F9
1883   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1884   ROM_LOAD( "pr2_061005a.rom", 0x00000, 0x40000, CRC(2271eb23) SHA1(6a3e01b59df08a23e5f53ee9b9e473b9f5f5e3b6) ) /* Not officially listed on Igrosoft's web site hash page */
1885
1886   ROM_REGION( 0x400000, "gfx", 0 )
1887   ROM_LOAD( "1", 0x000000, 0x80000, CRC(106e7cba) SHA1(289a3ae38b895c83600c920bee0c2dd46e941eac) )
1888   ROM_LOAD( "2", 0x100000, 0x80000, CRC(076a290f) SHA1(2f9bb74e081262e535c8ed9a31589d6a919f5d15) )
1889   ROM_LOAD( "3", 0x200000, 0x80000, CRC(13a91fe7) SHA1(6e127b3827a9271ad19986714747be9367125f62) )
1890   ROM_LOAD( "4", 0x300000, 0x80000, CRC(5ac8c531) SHA1(1da91b9a71a9a8681577342660bfa85e5bbc99bc) )
1891   ROM_LOAD( "5", 0x080000, 0x80000, CRC(98012c74) SHA1(2a5b466353eef3a5cfc9f98eceb7523b00d0204a) )
1892   ROM_LOAD( "6", 0x180000, 0x80000, CRC(366e1465) SHA1(440230d5306c4b424f27839b7fb9c8a5bb922dcc) )
1893   ROM_LOAD( "7", 0x280000, 0x80000, CRC(21fb963e) SHA1(e3f7fb13f326699e34aebcc3ee07016f7cfe6e46) )
1894   ROM_LOAD( "8", 0x380000, 0x80000, CRC(40c59448) SHA1(774af0f376864ec5948904df338bc7493eaed392) )
1895ROM_END
1896
1897ROM_START( pirate2b ) // 061005 bank F9, skip raster beam position check
1898   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1899   ROM_LOAD( "pr2_061005b.rom", 0x00000, 0x40000, CRC(379f890e) SHA1(0fd05c1bf08fd3e6694f18ffe2ea9741cf465617) ) /* Not officially listed on Igrosoft's web site hash page */
1900
1901   ROM_REGION( 0x400000, "gfx", 0 )
1902   ROM_LOAD( "1", 0x000000, 0x80000, CRC(106e7cba) SHA1(289a3ae38b895c83600c920bee0c2dd46e941eac) )
1903   ROM_LOAD( "2", 0x100000, 0x80000, CRC(076a290f) SHA1(2f9bb74e081262e535c8ed9a31589d6a919f5d15) )
1904   ROM_LOAD( "3", 0x200000, 0x80000, CRC(13a91fe7) SHA1(6e127b3827a9271ad19986714747be9367125f62) )
1905   ROM_LOAD( "4", 0x300000, 0x80000, CRC(5ac8c531) SHA1(1da91b9a71a9a8681577342660bfa85e5bbc99bc) )
1906   ROM_LOAD( "5", 0x080000, 0x80000, CRC(98012c74) SHA1(2a5b466353eef3a5cfc9f98eceb7523b00d0204a) )
1907   ROM_LOAD( "6", 0x180000, 0x80000, CRC(366e1465) SHA1(440230d5306c4b424f27839b7fb9c8a5bb922dcc) )
1908   ROM_LOAD( "7", 0x280000, 0x80000, CRC(21fb963e) SHA1(e3f7fb13f326699e34aebcc3ee07016f7cfe6e46) )
1909   ROM_LOAD( "8", 0x380000, 0x80000, CRC(40c59448) SHA1(774af0f376864ec5948904df338bc7493eaed392) )
1910ROM_END
1911
1912ROM_START( pirate2c ) // 061005 bank F9, changed version text to 070126
1913   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1914   ROM_LOAD( "pr2_061005c.rom", 0x00000, 0x40000, CRC(7c4339df) SHA1(80e2f97629bc963f044c1697c65777a3fd038edc) ) /* Not officially listed on Igrosoft's web site hash page */
1915
1916   ROM_REGION( 0x400000, "gfx", 0 )
1917   ROM_LOAD( "1", 0x000000, 0x80000, CRC(106e7cba) SHA1(289a3ae38b895c83600c920bee0c2dd46e941eac) )
1918   ROM_LOAD( "2", 0x100000, 0x80000, CRC(076a290f) SHA1(2f9bb74e081262e535c8ed9a31589d6a919f5d15) )
1919   ROM_LOAD( "3", 0x200000, 0x80000, CRC(13a91fe7) SHA1(6e127b3827a9271ad19986714747be9367125f62) )
1920   ROM_LOAD( "4", 0x300000, 0x80000, CRC(5ac8c531) SHA1(1da91b9a71a9a8681577342660bfa85e5bbc99bc) )
1921   ROM_LOAD( "5", 0x080000, 0x80000, CRC(98012c74) SHA1(2a5b466353eef3a5cfc9f98eceb7523b00d0204a) )
1922   ROM_LOAD( "6", 0x180000, 0x80000, CRC(366e1465) SHA1(440230d5306c4b424f27839b7fb9c8a5bb922dcc) )
1923   ROM_LOAD( "7", 0x280000, 0x80000, CRC(21fb963e) SHA1(e3f7fb13f326699e34aebcc3ee07016f7cfe6e46) )
1924   ROM_LOAD( "8", 0x380000, 0x80000, CRC(40c59448) SHA1(774af0f376864ec5948904df338bc7493eaed392) )
1925ROM_END
1926
1927ROM_START( pirate2d ) // 061005 bank F9, changed version text to 070126
1928   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1929   ROM_LOAD( "pr2_061005d.rom", 0x00000, 0x40000, CRC(16620bb2) SHA1(bf3a26b06595e51fa37f2f8099a12e906a6ca439) ) /* Not officially listed on Igrosoft's web site hash page */
1930
1931   ROM_REGION( 0x400000, "gfx", 0 )
1932   ROM_LOAD( "1", 0x000000, 0x80000, CRC(106e7cba) SHA1(289a3ae38b895c83600c920bee0c2dd46e941eac) )
1933   ROM_LOAD( "2", 0x100000, 0x80000, CRC(076a290f) SHA1(2f9bb74e081262e535c8ed9a31589d6a919f5d15) )
1934   ROM_LOAD( "3", 0x200000, 0x80000, CRC(13a91fe7) SHA1(6e127b3827a9271ad19986714747be9367125f62) )
1935   ROM_LOAD( "4", 0x300000, 0x80000, CRC(5ac8c531) SHA1(1da91b9a71a9a8681577342660bfa85e5bbc99bc) )
1936   ROM_LOAD( "5", 0x080000, 0x80000, CRC(98012c74) SHA1(2a5b466353eef3a5cfc9f98eceb7523b00d0204a) )
1937   ROM_LOAD( "6", 0x180000, 0x80000, CRC(366e1465) SHA1(440230d5306c4b424f27839b7fb9c8a5bb922dcc) )
1938   ROM_LOAD( "7", 0x280000, 0x80000, CRC(21fb963e) SHA1(e3f7fb13f326699e34aebcc3ee07016f7cfe6e46) )
1939   ROM_LOAD( "8", 0x380000, 0x80000, CRC(40c59448) SHA1(774af0f376864ec5948904df338bc7493eaed392) )
1940ROM_END
1941
1942ROM_START( pirate2e ) // 061005 bank F9, changed version text to 070126, skip some start tests
1943   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
1944   ROM_LOAD( "pr2_061005e.rom", 0x00000, 0x40000, CRC(f36edf02) SHA1(25ff61eb80b54298037b4a90d7fc93e8530e0815) ) /* Not officially listed on Igrosoft's web site hash page */
1945
1946   ROM_REGION( 0x400000, "gfx", 0 )
1947   ROM_LOAD( "1", 0x000000, 0x80000, CRC(106e7cba) SHA1(289a3ae38b895c83600c920bee0c2dd46e941eac) )
1948   ROM_LOAD( "2", 0x100000, 0x80000, CRC(076a290f) SHA1(2f9bb74e081262e535c8ed9a31589d6a919f5d15) )
1949   ROM_LOAD( "3", 0x200000, 0x80000, CRC(13a91fe7) SHA1(6e127b3827a9271ad19986714747be9367125f62) )
1950   ROM_LOAD( "4", 0x300000, 0x80000, CRC(5ac8c531) SHA1(1da91b9a71a9a8681577342660bfa85e5bbc99bc) )
1951   ROM_LOAD( "5", 0x080000, 0x80000, CRC(98012c74) SHA1(2a5b466353eef3a5cfc9f98eceb7523b00d0204a) )
1952   ROM_LOAD( "6", 0x180000, 0x80000, CRC(366e1465) SHA1(440230d5306c4b424f27839b7fb9c8a5bb922dcc) )
1953   ROM_LOAD( "7", 0x280000, 0x80000, CRC(21fb963e) SHA1(e3f7fb13f326699e34aebcc3ee07016f7cfe6e46) )
1954   ROM_LOAD( "8", 0x380000, 0x80000, CRC(40c59448) SHA1(774af0f376864ec5948904df338bc7493eaed392) )
1955ROM_END
1956
1957/*********************************************************
16931958   Keks
16941959
16951960    Roms 1-4 were changed after the 070119 update.
r6049r6050
17021967   ROM_LOAD( "ks060328.rom", 0x00000, 0x40000, CRC(bcf77f77) SHA1(26b09994907c41be957a0b7442cfb1807b27d7be) )
17031968
17041969   ROM_REGION( 0x400000, "gfx", 0 )
1705   ROM_LOAD( "1", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1706   ROM_LOAD( "2", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1707   ROM_LOAD( "3", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1708   ROM_LOAD( "4", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1709   ROM_LOAD( "5", 0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1710   ROM_LOAD( "6", 0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1711   ROM_LOAD( "7", 0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1712   ROM_LOAD( "8", 0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
1970   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1971   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1972   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1973   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1974   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1975   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1976   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1977   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
17131978ROM_END
17141979
1715ROM_START( keksa ) // 060328
1980ROM_START( keksa ) // 060328 bank F9
17161981   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
17171982   ROM_LOAD( "ks060328a.rom", 0x00000, 0x40000, CRC(7b387386) SHA1(d6bfc3b0d1f74723902d96dbcb69865cb5274cd0) ) /* Not officially listed on Igrosoft's web site hash page */
17181983
17191984   ROM_REGION( 0x400000, "gfx", 0 )
1720   ROM_LOAD( "1", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1721   ROM_LOAD( "2", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1722   ROM_LOAD( "3", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1723   ROM_LOAD( "4", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1724   ROM_LOAD( "5", 0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1725   ROM_LOAD( "6", 0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1726   ROM_LOAD( "7", 0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1727   ROM_LOAD( "8", 0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
1985   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1986   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1987   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1988   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1989   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1990   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1991   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1992   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
17281993ROM_END
17291994
1730ROM_START( keksb ) // 060328
1995ROM_START( keksb ) // 060328 backdoor
17311996   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
17321997   ROM_LOAD( "ks060328b.rom", 0x00000, 0x40000, CRC(661c7ee9) SHA1(f07902c4a3ba5fce5bc7fe666d90deb852e40b4c) ) /* Not officially listed on Igrosoft's web site hash page */
17331998
17341999   ROM_REGION( 0x400000, "gfx", 0 )
1735   ROM_LOAD( "1", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1736   ROM_LOAD( "2", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1737   ROM_LOAD( "3", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1738   ROM_LOAD( "4", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1739   ROM_LOAD( "5", 0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1740   ROM_LOAD( "6", 0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1741   ROM_LOAD( "7", 0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1742   ROM_LOAD( "8", 0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
2000   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
2001   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
2002   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
2003   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
2004   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
2005   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
2006   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
2007   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
17432008ROM_END
17442009
2010ROM_START( keksc ) // 060328 bank F9, changed version text to 070119
2011   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
2012   ROM_LOAD( "ks060328c.rom", 0x00000, 0x40000, CRC(fc70d26e) SHA1(0430ad20b797412967c2e82779eb7f0e9170f77c) ) /* Not officially listed on Igrosoft's web site hash page */
2013
2014   ROM_REGION( 0x400000, "gfx", 0 )
2015   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
2016   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
2017   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
2018   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
2019   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
2020   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
2021   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
2022   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
2023ROM_END
2024
17452025ROM_START( keks_2 ) // 060403
17462026   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
17472027   ROM_LOAD( "ks060403.rom", 0x00000, 0x40000, CRC(7abb9392) SHA1(f7a0ba5bcc7566f706e911486fa9cf3e62b86b8b) )
17482028
17492029   ROM_REGION( 0x400000, "gfx", 0 )
1750   ROM_LOAD( "1", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1751   ROM_LOAD( "2", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1752   ROM_LOAD( "3", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1753   ROM_LOAD( "4", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1754   ROM_LOAD( "5", 0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1755   ROM_LOAD( "6", 0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1756   ROM_LOAD( "7", 0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1757   ROM_LOAD( "8", 0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
2030   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
2031   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
2032   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
2033   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
2034   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
2035   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
2036   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
2037   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
17582038ROM_END
17592039
1760ROM_START( keks_2a ) // 060403
2040ROM_START( keks_2a ) // 060403 bank F9
17612041   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
17622042   ROM_LOAD( "ks060403a.rom", 0x00000, 0x40000, CRC(bd749f63) SHA1(dc3ba624b186370896d3ecf5968a82a17aa019d0) ) /* Not officially listed on Igrosoft's web site hash page */
17632043
17642044   ROM_REGION( 0x400000, "gfx", 0 )
1765   ROM_LOAD( "1", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
1766   ROM_LOAD( "2", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
1767   ROM_LOAD( "3", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
1768   ROM_LOAD( "4", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
1769   ROM_LOAD( "5", 0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
1770   ROM_LOAD( "6", 0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
1771   ROM_LOAD( "7", 0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
1772   ROM_LOAD( "8", 0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
2045   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
2046   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
2047   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
2048   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
2049   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
2050   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
2051   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
2052   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
17732053ROM_END
17742054
2055ROM_START( keks_2b ) // 060403 bank F9, changed version text to 070119
2056   ROM_REGION( 0x40000, "maincpu", 0 ) // z80 code, banked
2057   ROM_LOAD( "ks060403b.rom", 0x00000, 0x40000, CRC(d089de90) SHA1(9208f411cd97fef89b52019f9655e7d006f91303) ) /* Not officially listed on Igrosoft's web site hash page */
2058
2059   ROM_REGION( 0x400000, "gfx", 0 )
2060   ROM_LOAD( "1a", 0x000000, 0x80000, CRC(f4c20f66) SHA1(bed42ef01dfaa9d5d6ebb703e44ce7c11b8a373c) )
2061   ROM_LOAD( "2a", 0x100000, 0x80000, CRC(b7ec3fac) SHA1(c3c62690487a6056415c46888bde8254efca836f) )
2062   ROM_LOAD( "3a", 0x200000, 0x80000, CRC(5b6e8568) SHA1(003297e9cd080d91fe6751286eabd3a2f37ceb76) )
2063   ROM_LOAD( "4a", 0x300000, 0x80000, CRC(9dc32736) SHA1(7b2091ae802431d1c959b859a58e0076d32abef0) )
2064   ROM_LOAD( "5",  0x080000, 0x80000, CRC(c5b09267) SHA1(7fd0988e63752fdbb31fde60b4726cfd63149622) )
2065   ROM_LOAD( "6",  0x180000, 0x80000, CRC(583da5fd) SHA1(645228db20cdaacb53bfc68731fd1a66a6a8cf56) )
2066   ROM_LOAD( "7",  0x280000, 0x80000, CRC(311c166a) SHA1(5f0ad8d755a6141964d818b98b3f156cbda8fb0d) )
2067   ROM_LOAD( "8",  0x380000, 0x80000, CRC(f69b0831) SHA1(75392349ef02a39cf883206938e2c615445065fc) )
2068ROM_END
2069
17752070/*
17762071
17772072Note:
17782073
17792074   Only the first set of a given revision is listed in Igrosoft's official hashes list.
17802075
1781   It is not known if the alternate sets are hacks or were intended for different regions.
1782   It looks like the difference are in the payout percentage / odds
2076   The sets which differs from the originals by 5-6 bytes are bootlegs that simply change
2077     the banking address. Usually to convert a Crazy Monkey PCB which use the address "F9".
2078     Software exists to automatic modify any program rom's banking address for any PCB.
2079     This has resulted in dozens of different bootleg versions floating around the net.
17832080
2081   Some sets simply changed the version text to show a newer version.  This was likely done
2082     so the opperator appears to be running a version that meets the standards of the changed
2083     gambling law (see below).
2084
2085   Sets marked as "backdoor" are identical to originals, but have added code.  This code is
2086     activated by a secret sequence of actions that leads to a guaranteed win, or dramatically
2087     increases odds for winning. These backdoor version were commonly used by administrators
2088     or PCB sellers to steal money from the slots owners.
2089   Software does exist to automatically add the backdoor code and allows for custom key
2090     sequences.  As a result of this, there is also software to dectect the backdoor code
2091     in program roms.
2092
17842093Most games had a revision in early 2007 to meet the standards of the "Government gambling control"
17852094   law of The Russian Federation No 244-03 of Dec 29, 2006
17862095
1787From Igrosoft's web site about version types (IE: some version have "M" in them):
2096   From Igrosoft's web site about version types (IE: some version have "M" in them):
17882097
17892098   * Two software versions are shown, one of them corresponds to Russian legislation,
17902099     the other one (with the letter m) is for the countries without such restrictions.
r6049r6050
17932102
17942103GAME( 2002, mfish_3,     0,        multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021124, set 1)",  0 )
17952104GAME( 2002, mfish_3a,    mfish_3,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021124, set 2)",  0 )
1796GAME( 2002, mfish_12,    mfish_3,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 1)",  0 )
1797GAME( 2002, mfish_12a,   mfish_3,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, set 2)",  0 )
2105GAME( 2002, mfish_11,    mfish_3,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031124)",  0 ) /* World */
2106GAME( 2002, mfish_12,    mfish_3,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308)",  0 ) /* World */
2107GAME( 2002, mfish_12a,   mfish_3,  multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040308, banking address hack)",  0 ) // bank F9
17982108#if ALL_REVISIONS
1799GAME( 2002, mfish,       0,        multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021120)",  0 )
1800GAME( 2002, mfish_2,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021121)",  0 )
1801GAME( 2002, mfish_4,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021219)",  0 )
1802GAME( 2002, mfish_5,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021227)",  0 )
1803GAME( 2002, mfish_6,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030124)",  0 )
1804GAME( 2002, mfish_7,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030511)",  0 )
1805GAME( 2002, mfish_8,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030522)",  0 )
1806GAME( 2002, mfish_9,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031026)",  0 )
1807GAME( 2002, mfish_10,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031117)",  0 )
1808GAME( 2002, mfish_11,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031124)",  0 )
1809GAME( 2002, mfish_13,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040316)",  0 )
2109GAME( 2002, mfish,       0,        multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021120)",  0 ) /* World */
2110GAME( 2002, mfish_2,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021121)",  0 ) /* World */
2111GAME( 2002, mfish_4,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021219)",  0 ) /* World */
2112GAME( 2002, mfish_5,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (021227)",  0 ) /* World */
2113GAME( 2002, mfish_6,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030124)",  0 ) /* World */
2114GAME( 2002, mfish_7,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030511)",  0 ) /* World */
2115GAME( 2002, mfish_8,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (030522)",  0 ) /* World */
2116GAME( 2002, mfish_9,     mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031026)",  0 ) /* World */
2117GAME( 2002, mfish_10,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (031117)",  0 ) /* World */
2118GAME( 2002, mfish_13,    mfish,    multfish, multfish,  0, ROT0, "Igro", "Multi Fish (040316)",  0 ) /* World */
18102119#endif
18112120
1812GAME( 2003, crzmon_7,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110, set 1)",  0 )
1813GAME( 2003, crzmon_7a,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110, set 2)",  0 )
1814GAME( 2003, crzmon_7b,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110, set 3)",  0 )
1815GAME( 2003, crzmon_8,    crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (050120, set 1)",  0 )
1816GAME( 2003, crzmon_8a,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (050120, set 2)",  0 )
2121GAME( 2003, crzmon_7,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110)",  0 ) /* World */
2122GAME( 2003, crzmon_7a,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110, backdoor set 1)",  0 ) // backdoor
2123GAME( 2003, crzmon_7b,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031110, backdoor set 2)",  0 ) // backdoor
2124GAME( 2003, crzmon_8,    crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (050120)",  0 ) /* World */
2125GAME( 2003, crzmon_8a,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (050120, backdoor)",  0 ) // backdoor
2126GAME( 2003, crzmon_8b,   crzmon_7, multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (050120, changed version text)",  0 ) // changed version text to 070315
18172127#if ALL_REVISIONS
1818GAME( 2003, crzmon,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030217)",  0 )
1819GAME( 2003, crzmon_2,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030225)",  0 )
1820GAME( 2003, crzmon_3,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030227)",  0 )
1821GAME( 2003, crzmon_4,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030404)",  0 )
1822GAME( 2003, crzmon_5,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030421)",  0 )
1823GAME( 2003, crzmon_6,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031016)",  0 )
2128GAME( 2003, crzmon,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030217)",  0 ) /* World */
2129GAME( 2003, crzmon_2,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030225)",  0 ) /* World */
2130GAME( 2003, crzmon_3,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030227)",  0 ) /* World */
2131GAME( 2003, crzmon_4,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030404)",  0 ) /* World */
2132GAME( 2003, crzmon_5,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (030421)",  0 ) /* World */
2133GAME( 2003, crzmon_6,    crzmon,   multfish, multfish,  0, ROT0, "Igrosoft", "Crazy Monkey (031016)",  0 ) /* World */
18242134#endif
18252135
1826GAME( 2003, fcockt_6,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216, set 1)",  0 )
1827GAME( 2003, fcockt_6a,   fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216, set 2)",  0 )
1828GAME( 2003, fcockt_6b,   fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216, set 3)",  0 )
1829GAME( 2003, fcockt_7,    fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (050118, set 1)",  0 )
1830GAME( 2003, fcockt_7a,   fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (050118, set 2)",  0 )
1831GAME( 2003, fcockt_8,    fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (060111)",  0 )
2136GAME( 2003, fcockt_6,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216)",  0 ) /* World */
2137GAME( 2003, fcockt_6a,   fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216, banking address hack)",  0 ) // bank F8
2138GAME( 2003, fcockt_6b,   fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (040216, backdoor)",  0 ) // backdoor
2139GAME( 2003, fcockt_7,    fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (050118)",  0 ) /* World */
2140GAME( 2003, fcockt_7a,   fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (050118, backdoor)",  0 ) // backdoor
2141GAME( 2003, fcockt_8,    fcockt_6, multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (060111)",  0 ) /* World */
18322142#if ALL_REVISIONS
1833GAME( 2003, fcockt,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030505)",  0 )
1834GAME( 2003, fcockt_2,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030512)",  0 )
1835GAME( 2003, fcockt_3,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030623)",  0 )
1836GAME( 2003, fcockt_4,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (031028)",  0 )
1837GAME( 2003, fcockt_5,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (031111)",  0 )
2143GAME( 2003, fcockt,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030505)",  0 ) /* World */
2144GAME( 2003, fcockt_2,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030512)",  0 ) /* World */
2145GAME( 2003, fcockt_3,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (030623)",  0 ) /* World */
2146GAME( 2003, fcockt_4,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (031028)",  0 ) /* World */
2147GAME( 2003, fcockt_5,    fcockt,   multfish, multfish,  0, ROT0, "Igrosoft", "Fruit Cocktail (031111)",  0 ) /* World */
18382148#endif
18392149
1840GAME( 2003, lhaunt_4,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031111, set 1)",  0 )
1841GAME( 2003, lhaunt_4a,   lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031111, set 2)",  0 )
1842GAME( 2003, lhaunt_5,    lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040216. set 1)",  0 )
1843GAME( 2003, lhaunt_5a,   lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040216, set 2)",  0 )
1844GAME( 2003, lhaunt_6,    lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040825, set 1)",  0 )
1845GAME( 2003, lhaunt_6a,   lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040825, set 2)",  0 )
2150GAME( 2003, lhaunt_4,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031111)",  0 ) /* World */
2151GAME( 2003, lhaunt_4a,   lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031111, backdoor)",  0 ) // backdoor
2152GAME( 2003, lhaunt_5,    lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040216)",  0 ) /* World */
2153GAME( 2003, lhaunt_5a,   lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040216, backdoor)",  0 ) // backdoor
2154GAME( 2003, lhaunt_6,    lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040825)",  0 ) /* World */
2155GAME( 2003, lhaunt_6a,   lhaunt_4, multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (040825, backdoor)",  0 ) // backdoor
18462156#if ALL_REVISIONS
1847GAME( 2003, lhaunt,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (030707)",  0 )
1848GAME( 2003, lhaunt_2,    lhaunt,   multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (030804)",  0 )
1849GAME( 2003, lhaunt_3,    lhaunt,   multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (031027)",  0 )
2157GAME( 2003, lhaunt,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (030707)",  0 ) /* World */
2158GAME( 2003, lhaunt_2,    lhaunt,   multfish, multfish,  0, ROT0, "Igrosoft", "Lucky Haunter (030804)",  0 ) /* World */
18502159#endif
18512160
18522161#if ALL_REVISIONS
1853GAME( 2003, rollfr,      0,        multfish, rollfr,    0, ROT0, "Igrosoft", "Roll Fruit (030821)",  0 )
2162GAME( 2003, rollfr,      0,        multfish, rollfr,    0, ROT0, "Igrosoft", "Roll Fruit (030821)",  0 ) /* World */
18542163#endif
1855GAME( 2003, rollfr_2,    0,        multfish, rollfr,    0, ROT0, "Igrosoft", "Roll Fruit (040318)",  0 )
2164GAME( 2003, rollfr_2,    0,        multfish, rollfr,    0, ROT0, "Igrosoft", "Roll Fruit (040318)",  0 ) /* World */
18562165
1857GAME( 2004, garage_4,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219, set 1)",  0 )
1858GAME( 2004, garage_4a,   garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219, set 2)",  0 )
1859GAME( 2004, garage_5,    garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (050311, set 1)",  0 )
1860GAME( 2004, garage_5a,   garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (050311, set 2)",  0 )
2166GAME( 2004, garage_4,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219)",  0 ) /* World */
2167GAME( 2004, garage_4a,   garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219, backdoor)",  0 ) // backdoor
2168GAME( 2004, garage_4b,   garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040219, changed version text)",  0 ) // changed version text to 070329
2169GAME( 2004, garage_5,    garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (050311)",  0 ) /* World */
2170GAME( 2004, garage_5a,   garage_4, multfish, multfish,  0, ROT0, "Igrosoft", "Garage (050311, backdoor)",  0 ) // backdoor
18612171#if ALL_REVISIONS
1862GAME( 2004, garage,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040122)",  0 )
1863GAME( 2004, garage_2,    garage,   multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040123)",  0 )
1864GAME( 2004, garage_3,    garage,   multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040216)",  0 )
2172GAME( 2004, garage,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040122)",  0 ) /* World */
2173GAME( 2004, garage_2,    garage,   multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040123)",  0 ) /* World */
2174GAME( 2004, garage_3,    garage,   multfish, multfish,  0, ROT0, "Igrosoft", "Garage (040216)",  0 ) /* World */
18652175#endif
18662176
1867GAME( 2004, rclimb_3,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827, set 1)", 0 )
1868GAME( 2004, rclimb_3a,   rclimb_3, multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827, set 2)", 0 )
1869GAME( 2004, rclimb_3b,   rclimb_3, multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827, set 3)", 0 ) // new service menu
2177GAME( 2004, rclimb_3,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827)", 0 ) /* World */
2178GAME( 2004, rclimb_3a,   rclimb_3, multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827, backdoor)", 0 ) // backdoor
2179GAME( 2004, rclimb_3b,   rclimb_3, multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040827, new service menu)", 0 ) // new service menu
18702180#if ALL_REVISIONS
1871GAME( 2004, rclimb,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040815)", 0 )
1872GAME( 2004, rclimb_2,    rclimb,   multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040823)", 0 )
2181GAME( 2004, rclimb,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040815)", 0 ) /* World */
2182GAME( 2004, rclimb_2,    rclimb,   multfish, multfish,  0, ROT0, "Igrosoft", "Rock Climber (040823)", 0 ) /* World */
18732183#endif
18742184
1875GAME( 2004, sweetl,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Sweet Life (041220, set 1)",  0 )
1876GAME( 2004, sweetla,     sweetl,   multfish, multfish,  0, ROT0, "Igrosoft", "Sweet Life (041220, set 2)",  0 )
2185GAME( 2004, sweetl,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Sweet Life (041220)",  0 )
2186GAME( 2004, sweetla,     sweetl,   multfish, multfish,  0, ROT0, "Igrosoft", "Sweet Life (041220, backdoor)",  0 ) // backdoor
2187GAME( 2004, sweetlb,     sweetl,   multfish, multfish,  0, ROT0, "Igrosoft", "Sweet Life (041220, banking address hack, changed version text)",  0 ) // bank F9, changed version text to 070412
18772188
18782189#if ALL_REVISIONS
1879GAME( 2004, resdnt,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040415)",  0 )
2190GAME( 2004, resdnt,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040415)",  0 ) /* World */
18802191#endif
1881GAME( 2004, resdnt_2,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040513, set 1)",  0 )
1882GAME( 2004, resdnt_2a,   resdnt_2, multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040513, set 2)",  0 )
2192GAME( 2004, resdnt_2,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040513)",  0 ) /* World */
2193GAME( 2004, resdnt_2a,   resdnt_2, multfish, multfish,  0, ROT0, "Igrosoft", "Resident (040513, backdoor)",  0 ) // backdoor
18832194
1884GAME( 2005, island,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Island (050713, set 1)",  0 )
1885GAME( 2005, islanda,     island,   multfish, multfish,  0, ROT0, "Igrosoft", "Island (050713, set 2)",  0 )
2195GAME( 2005, island,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Island (050713)",  0 ) /* World */
2196GAME( 2005, islanda,     island,   multfish, multfish,  0, ROT0, "Igrosoft", "Island (050713, backdoor)",  0 ) // backdoor
18862197
1887GAME( 2005, pirate_1,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Pirate (060210)",  0 )
2198GAME( 2005, pirate_2,    0,        multfish, multfish,  0, ROT0, "Igrosoft", "Pirate (060210)",  0 ) /* World */
2199GAME( 2005, pirate_3,    pirate_2, multfish, multfish,  0, ROT0, "Igrosoft", "Pirate (060803)",  0 ) /* World */
18882200#if ALL_REVISIONS
1889GAME( 2005, pirate,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Pirate (051229)",  0 )
1890GAME( 2005, pirate_2,    pirate,   multfish, multfish,  0, ROT0, "Igrosoft", "Pirate (060803)",  0 )
2201GAME( 2005, pirate,      0,        multfish, multfish,  0, ROT0, "Igrosoft", "Pirate (051229)",  0 ) /* World */
18912202#endif
18922203
1893GAME( 2006, island2,     0,        multfish, multfish,  0, ROT0, "Igrosoft", "Island 2 (060529, set 1)",  0 )
1894GAME( 2006, island2a,    island2,  multfish, multfish,  0, ROT0, "Igrosoft", "Island 2 (060529, set 2)",  0 )
2204GAME( 2006, pirate2,     0,        multfish, multfish,  0, ROT0, "Igrosoft", "Pirate 2 (061005)",  0 ) /* World */
2205GAME( 2006, pirate2a,    pirate2,  multfish, multfish,  0, ROT0, "Igrosoft", "Pirate 2 (061005, banking address hack set 1)",  0 ) // bank F9
2206GAME( 2006, pirate2b,    pirate2,  multfish, multfish,  0, ROT0, "Igrosoft", "Pirate 2 (061005, banking address hack set 2)",  0 ) // bank F9, skip raster beam position check
2207GAME( 2006, pirate2c,    pirate2,  multfish, multfish,  0, ROT0, "Igrosoft", "Pirate 2 (061005, banking address hack, changed version text set 1)",  0 ) // bank F9, changed version text to 070126
2208GAME( 2006, pirate2d,    pirate2,  multfish, multfish,  0, ROT0, "Igrosoft", "Pirate 2 (061005, banking address hack, changed version text set 2)",  0 ) // bank F9, changed version text to 070126
2209GAME( 2006, pirate2e,    pirate2,  multfish, multfish,  0, ROT0, "Igrosoft", "Pirate 2 (061005, banking address hack, changed version text set 3)",  0 ) // bank F9, changed version text to 070126, skip some start tests
18952210
1896GAME( 2006, keks,        0,        multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328, set 1)",  0 )
1897GAME( 2006, keksa,       keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328, set 2)",  0 )
1898GAME( 2006, keksb,       keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328, set 3)",  0 )
1899GAME( 2006, keks_2,      keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060403. set 1)",  0 )
1900GAME( 2006, keks_2a,     keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060403, set 2)",  0 )
2211GAME( 2006, island2,     0,        multfish, multfish,  0, ROT0, "Igrosoft", "Island 2 (060529)",  0 ) /* World */
2212GAME( 2006, island2a,    island2,  multfish, multfish,  0, ROT0, "Igrosoft", "Island 2 (060529, banking address hack)",  0 ) // bank F9 (not standard, game does not work)
2213
2214GAME( 2006, keks,        0,        multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328)",  0 ) /* World */
2215GAME( 2006, keksa,       keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328, banking address hack)",  0 ) // bank F9
2216GAME( 2006, keksb,       keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328, backdoor)",  0 ) // backdoor
2217GAME( 2006, keksc,       keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060328, banking address hack, changed version text)",  0 ) // bank F9, changed version text to 070119
2218GAME( 2006, keks_2,      keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060403)",  0 ) /* World */
2219GAME( 2006, keks_2a,     keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060403, banking address hack)",  0 ) // bank F9
2220GAME( 2006, keks_2b,     keks,     multfish, multfish,  0, ROT0, "Igrosoft", "Keks (060403, banking address hack, changed version text)",  0 ) // bank F9, changed version text to 070119
src/mame/drivers/megadriv.c
r6049r6050
7878
7979#define MEGADRIV_VDP_VRAM(address) megadrive_vdp_vram[(address)&0x7fff]
8080
81/* the same on all systems? */
82#define MASTER_CLOCK_NTSC 53693175
83#define MASTER_CLOCK_PAL  53203424
84
85#define SEGACD_CLOCK      12500000
86
8781#define HAZE_MD 0 // to make appear / disappear the Region DipSwitch
8882
8983/* timing details */
r6049r6050
13901384   return retvalue;
13911385}
13921386
1393static READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
1387READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
13941388{
13951389   //mame_printf_debug("megadriv_68k_YM2612_read %02x %04x\n",offset,mem_mask);
13961390   if ( (genz80.z80_has_bus==0) && (genz80.z80_is_reset==0) )
r6049r6050
14081402
14091403
14101404
1411static WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write)
1405WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write)
14121406{
14131407   //mame_printf_debug("megadriv_68k_YM2612_write %02x %04x %04x\n",offset,data,mem_mask);
14141408   if ( (genz80.z80_has_bus==0) && (genz80.z80_is_reset==0) )
r6049r6050
14841478
14851479*/
14861480
1487static INPUT_PORTS_START( md_common )
1481INPUT_PORTS_START( md_common )
14881482   PORT_START("PAD1")      /* Joypad 1 (3 button + start) NOT READ DIRECTLY */
14891483   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
14901484   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
r6049r6050
18021796}
18031797
18041798
1805static READ16_HANDLER( megadriv_68k_io_read )
1799READ16_HANDLER( megadriv_68k_io_read )
18061800{
18071801   UINT8 retdata;
18081802
r6049r6050
19201914}
19211915
19221916
1923
1924static WRITE16_HANDLER( megadriv_68k_io_write )
1917WRITE16_HANDLER( megadriv_68k_io_write )
19251918{
19261919//  mame_printf_debug("IO Write #%02x data %04x mem_mask %04x\n",offset,data,mem_mask);
19271920
r6049r6050
19701963
19711964
19721965static ADDRESS_MAP_START( megadriv_map, ADDRESS_SPACE_PROGRAM, 16 )
1973   AM_RANGE(0x000000 , 0x3fffff) AM_ROM
1966   AM_RANGE(0x000000, 0x3fffff) AM_ROM
19741967   /*      (0x000000 - 0x3fffff) == GAME ROM (4Meg Max, Some games have special banking too) */
19751968
1976   AM_RANGE(0xa00000 , 0xa01fff) AM_READWRITE(megadriv_68k_read_z80_ram,megadriv_68k_write_z80_ram)
1977   AM_RANGE(0xa02000 , 0xa03fff) AM_WRITE(megadriv_68k_write_z80_ram)
1978   AM_RANGE(0xa04000 , 0xa04003) AM_DEVREADWRITE8("ym", megadriv_68k_YM2612_read,megadriv_68k_YM2612_write, 0xffff)
1969   AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(megadriv_68k_read_z80_ram,megadriv_68k_write_z80_ram)
1970   AM_RANGE(0xa02000, 0xa03fff) AM_WRITE(megadriv_68k_write_z80_ram)
1971   AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8("ym", megadriv_68k_YM2612_read,megadriv_68k_YM2612_write, 0xffff)
19791972
1980   AM_RANGE(0xa06000 , 0xa06001) AM_WRITE(megadriv_68k_z80_bank_write)
1973   AM_RANGE(0xa06000, 0xa06001) AM_WRITE(megadriv_68k_z80_bank_write)
19811974
1982   AM_RANGE(0xa10000 , 0xa1001f) AM_READWRITE(megadriv_68k_io_read,megadriv_68k_io_write)
1975   AM_RANGE(0xa10000, 0xa1001f) AM_READWRITE(megadriv_68k_io_read,megadriv_68k_io_write)
19831976
1984   AM_RANGE(0xa11100 , 0xa11101) AM_READWRITE(megadriv_68k_check_z80_bus,megadriv_68k_req_z80_bus)
1985   AM_RANGE(0xa11200 , 0xa11201) AM_WRITE(megadriv_68k_req_z80_reset)
1977   AM_RANGE(0xa11100, 0xa11101) AM_READWRITE(megadriv_68k_check_z80_bus,megadriv_68k_req_z80_bus)
1978   AM_RANGE(0xa11200, 0xa11201) AM_WRITE(megadriv_68k_req_z80_reset)
19861979
19871980   /* these are fake - remove allocs in VIDEO_START to use these to view ram instead */
1988//  AM_RANGE(0xb00000 , 0xb0ffff) AM_RAM AM_BASE(&megadrive_vdp_vram)
1989//  AM_RANGE(0xb10000 , 0xb1007f) AM_RAM AM_BASE(&megadrive_vdp_vsram)
1990//  AM_RANGE(0xb10100 , 0xb1017f) AM_RAM AM_BASE(&megadrive_vdp_cram)
1981//  AM_RANGE(0xb00000, 0xb0ffff) AM_RAM AM_BASE(&megadrive_vdp_vram)
1982//  AM_RANGE(0xb10000, 0xb1007f) AM_RAM AM_BASE(&megadrive_vdp_vsram)
1983//  AM_RANGE(0xb10100, 0xb1017f) AM_RAM AM_BASE(&megadrive_vdp_cram)
19911984
1992   AM_RANGE(0xc00000 , 0xc0001f) AM_READWRITE(megadriv_vdp_r,megadriv_vdp_w)
1993   AM_RANGE(0xd00000 , 0xd0001f) AM_READWRITE(megadriv_vdp_r,megadriv_vdp_w) // the earth defend
1985   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(megadriv_vdp_r,megadriv_vdp_w)
1986   AM_RANGE(0xd00000, 0xd0001f) AM_READWRITE(megadriv_vdp_r,megadriv_vdp_w) // the earth defend
19941987
1995   AM_RANGE(0xe00000 , 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000) AM_BASE(&megadrive_ram)
1996//  AM_RANGE(0xff0000 , 0xffffff) AM_READ(SMH_RAM)
1988   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000) AM_BASE(&megadrive_ram)
1989//  AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM)
19971990   /*       0xe00000 - 0xffffff) == MAIN RAM (64kb, Mirrored, most games use ff0000 - ffffff) */
19981991ADDRESS_MAP_END
19991992
r6049r6050
23092302}
23102303
23112304static ADDRESS_MAP_START( megadriv_z80_map, ADDRESS_SPACE_PROGRAM, 8 )
2312   AM_RANGE(0x0000 , 0x1fff) AM_RAMBANK(1) AM_MIRROR(0x2000) // RAM can be accessed by the 68k
2313   AM_RANGE(0x4000 , 0x4003) AM_DEVREADWRITE("ym", ym2612_r,ym2612_w)
2305   AM_RANGE(0x0000, 0x1fff) AM_RAMBANK(1) AM_MIRROR(0x2000) // RAM can be accessed by the 68k
2306   AM_RANGE(0x4000, 0x4003) AM_DEVREADWRITE("ym", ym2612_r,ym2612_w)
23142307
2315   AM_RANGE(0x6000 , 0x6000) AM_WRITE(megadriv_z80_z80_bank_w)
2316   AM_RANGE(0x6001 , 0x6001) AM_WRITE(megadriv_z80_z80_bank_w) // wacky races uses this address
2308   AM_RANGE(0x6000, 0x6000) AM_WRITE(megadriv_z80_z80_bank_w)
2309   AM_RANGE(0x6001, 0x6001) AM_WRITE(megadriv_z80_z80_bank_w) // wacky races uses this address
23172310
2318   AM_RANGE(0x6100 , 0x7eff) AM_READ(megadriv_z80_unmapped_read)
2311   AM_RANGE(0x6100, 0x7eff) AM_READ(megadriv_z80_unmapped_read)
23192312
2320   AM_RANGE(0x7f00 , 0x7fff) AM_READWRITE(megadriv_z80_vdp_read,megadriv_z80_vdp_write)
2313   AM_RANGE(0x7f00, 0x7fff) AM_READWRITE(megadriv_z80_vdp_read,megadriv_z80_vdp_write)
23212314
2322   AM_RANGE(0x8000 , 0xffff) AM_READWRITE(z80_read_68k_banked_data,z80_write_68k_banked_data) // The Z80 can read the 68k address space this way
2315   AM_RANGE(0x8000, 0xffff) AM_READWRITE(z80_read_68k_banked_data,z80_write_68k_banked_data) // The Z80 can read the 68k address space this way
23232316ADDRESS_MAP_END
23242317
23252318static ADDRESS_MAP_START( megadriv_z80_io_map, ADDRESS_SPACE_IO, 8 )
23262319   ADDRESS_MAP_GLOBAL_MASK(0xff)
2327   AM_RANGE(0x0000 , 0xff) AM_NOP
2320   AM_RANGE(0x0000, 0xff) AM_NOP
23282321ADDRESS_MAP_END
23292322
2323
2324/************************************ Megadrive Bootlegs *************************************/
2325
2326// smaller ROM region because some bootlegs check for RAM there
2327static ADDRESS_MAP_START( md_bootleg_map, ADDRESS_SPACE_PROGRAM, 16 )
2328   AM_RANGE(0x000000, 0x0fffff) AM_ROM   /* Cartridge Program Rom */
2329   AM_RANGE(0x200000, 0x2023ff) AM_RAM // tested
2330
2331   AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE(megadriv_68k_read_z80_ram, megadriv_68k_write_z80_ram)
2332   AM_RANGE(0xa02000, 0xa03fff) AM_WRITE(megadriv_68k_write_z80_ram)
2333   AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8("ym", megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
2334   AM_RANGE(0xa06000, 0xa06001) AM_WRITE(megadriv_68k_z80_bank_write)
2335
2336   AM_RANGE(0xa10000, 0xa1001f) AM_READWRITE(megadriv_68k_io_read, megadriv_68k_io_write)
2337   AM_RANGE(0xa11100, 0xa11101) AM_READWRITE(megadriv_68k_check_z80_bus, megadriv_68k_req_z80_bus)
2338   AM_RANGE(0xa11200, 0xa11201) AM_WRITE(megadriv_68k_req_z80_reset)
2339
2340   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(megadriv_vdp_r, megadriv_vdp_w)
2341   AM_RANGE(0xd00000, 0xd0001f) AM_READWRITE(megadriv_vdp_r, megadriv_vdp_w) // the earth defend
2342
2343   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000) AM_BASE(&megadrive_ram)
2344ADDRESS_MAP_END
2345
2346MACHINE_DRIVER_START( md_bootleg )
2347   MDRV_IMPORT_FROM(megadriv)
2348
2349   MDRV_CPU_MODIFY("maincpu")
2350   MDRV_CPU_PROGRAM_MAP(md_bootleg_map)
2351MACHINE_DRIVER_END
2352
2353
23302354/****************************************** 32X related ******************************************/
23312355
23322356/**********************************************************************************************/
r6049r6050
33333357ADDRESS_MAP_END
33343358
33353359static ADDRESS_MAP_START( segacd_map, ADDRESS_SPACE_PROGRAM, 16 )
3336   AM_RANGE(0x0000000 , 0x0003fff) AM_RAM
3360   AM_RANGE(0x0000000, 0x0003fff) AM_RAM
33373361ADDRESS_MAP_END
33383362
33393363
r6049r6050
36353659}
36363660
36373661static ADDRESS_MAP_START( svp_ssp_map, ADDRESS_SPACE_PROGRAM, 16 )
3638   AM_RANGE(0x0000 , 0x03ff) AM_ROMBANK(3)
3639   AM_RANGE(0x0400 , 0xffff) AM_ROMBANK(4)
3662   AM_RANGE(0x0000, 0x03ff) AM_ROMBANK(3)
3663   AM_RANGE(0x0400, 0xffff) AM_ROMBANK(4)
36403664ADDRESS_MAP_END
36413665
36423666static ADDRESS_MAP_START( svp_ext_map, ADDRESS_SPACE_IO, 16 )
36433667   ADDRESS_MAP_GLOBAL_MASK(0xf)
3644   AM_RANGE(0*2 , 0*2+1) AM_READWRITE(read_PM0, write_PM0)
3645   AM_RANGE(1*2 , 1*2+1) AM_READWRITE(read_PM1, write_PM1)
3646   AM_RANGE(2*2 , 2*2+1) AM_READWRITE(read_PM2, write_PM2)
3647   AM_RANGE(3*2 , 3*2+1) AM_READWRITE(read_XST, write_XST)
3648   AM_RANGE(4*2 , 4*2+1) AM_READWRITE(read_PM4, write_PM4)
3649   AM_RANGE(6*2 , 6*2+1) AM_READWRITE(read_PMC, write_PMC)
3650   AM_RANGE(7*2 , 7*2+1) AM_READWRITE(read_AL, write_AL)
3668   AM_RANGE(0*2, 0*2+1) AM_READWRITE(read_PM0, write_PM0)
3669   AM_RANGE(1*2, 1*2+1) AM_READWRITE(read_PM1, write_PM1)
3670   AM_RANGE(2*2, 2*2+1) AM_READWRITE(read_PM2, write_PM2)
3671   AM_RANGE(3*2, 3*2+1) AM_READWRITE(read_XST, write_XST)
3672   AM_RANGE(4*2, 4*2+1) AM_READWRITE(read_PM4, write_PM4)
3673   AM_RANGE(6*2, 6*2+1) AM_READWRITE(read_PMC, write_PMC)
3674   AM_RANGE(7*2, 7*2+1) AM_READWRITE(read_AL, write_AL)
36513675ADDRESS_MAP_END
36523676
36533677
r6049r6050
63446368   hazemdchoice_megadriv_framerate = 50;
63456369}
63466370
6371DRIVER_INIT( mpnew )
6372{
6373   DRIVER_INIT_CALL(megadrij);
6374   megadrive_io_read_data_port_ptr   = megadrive_io_read_data_port_3button;
6375   megadrive_io_write_data_port_ptr = megadrive_io_write_data_port_3button;
6376}
63476377
63486378/* used by megatech */
63496379static READ8_HANDLER( z80_unmapped_port_r )
r6049r6050
65906620GAME( 1994, segacd,      0,        genesis_scd,        megadriv,    megadriv,ROT0,   "Sega", "Sega-CD Model 2 BIOS V2.11 (U)", GAME_NOT_WORKING )
65916621GAME( 1994, 32x_scd,     0,        genesis_32x_scd,    megadriv,    _32x,    ROT0,   "Sega", "Sega-CD Model 2 BIOS V2.11 (U) (with 32X)", GAME_NOT_WORKING )
65926622GAME( 1994, g_virr,      0,        megdsvp,            megadriv,   megadriv, ROT0,   "Sega", "Virtua Racing (U) [!]", 0 )
6593GAME( 1994, g_virrj ,    g_virr,   megdsvp,            megadriv,   megadrij, ROT0,   "Sega", "Virtua Racing (J) [!]", 0 )
6594GAME( 1994, g_virre ,    g_virr,   megdsvppal,         megadriv,   megadrie, ROT0,   "Sega", "Virtua Racing (E) [!]", 0 )
6623GAME( 1994, g_virrj,     g_virr,   megdsvp,            megadriv,   megadrij, ROT0,   "Sega", "Virtua Racing (J) [!]", 0 )
6624GAME( 1994, g_virre,     g_virr,   megdsvppal,         megadriv,   megadrie, ROT0,   "Sega", "Virtua Racing (E) [!]", 0 )
65956625GAME( 1994, g_virrea,    g_virr,   megdsvppal,         megadriv,   megadrie, ROT0,   "Sega", "Virtua Racing (E) [a1]", 0 )
65966626#endif
65976627
src/mame/drivers/megadriv.h
r6049r6050
1#define MASTER_CLOCK_NTSC 53693175
2#define MASTER_CLOCK_PAL  53203424
3#define SEGACD_CLOCK      12500000
4
5
16extern DRIVER_INIT( megadriv_c2 );
27extern DRIVER_INIT( megadrie );
38extern DRIVER_INIT( megadriv );
r6049r6050
38extern DRIVER_INIT( megadrij );
49extern DRIVER_INIT( _32x );
10extern DRIVER_INIT( mpnew );
511
6INPUT_PORTS_EXTERN(megadriv);
7INPUT_PORTS_EXTERN(aladbl);
8INPUT_PORTS_EXTERN(megadri6);
9INPUT_PORTS_EXTERN(ssf2ghw);
10INPUT_PORTS_EXTERN(megdsvp);
12INPUT_PORTS_EXTERN( md_common );
13INPUT_PORTS_EXTERN( megadriv );
14INPUT_PORTS_EXTERN( aladbl );
15INPUT_PORTS_EXTERN( megadri6 );
16INPUT_PORTS_EXTERN( ssf2ghw );
17INPUT_PORTS_EXTERN( megdsvp );
1118
1219MACHINE_DRIVER_EXTERN( megdsvppal );
13MACHINE_DRIVER_EXTERN(megadriv);
14MACHINE_DRIVER_EXTERN(megadpal);
15MACHINE_DRIVER_EXTERN(megdsvp);
20MACHINE_DRIVER_EXTERN( megadriv );
21MACHINE_DRIVER_EXTERN( megadpal );
22MACHINE_DRIVER_EXTERN( megdsvp );
1623MACHINE_DRIVER_EXTERN( genesis_32x );
1724MACHINE_DRIVER_EXTERN( genesis_32x_pal );
1825MACHINE_DRIVER_EXTERN( genesis_scd );
1926MACHINE_DRIVER_EXTERN( genesis_32x_scd );
27MACHINE_DRIVER_EXTERN( md_bootleg );   // for topshoot.c & hshavoc.c
2028
2129extern UINT16* megadriv_backupram;
r6049r6050
2735
2836void megatech_set_megadrive_z80_as_megadrive_z80(running_machine *machine, const char* tag);
2937
30extern READ8_HANDLER (megatech_sms_ioport_dc_r);
31extern READ8_HANDLER (megatech_sms_ioport_dd_r);
38extern READ8_HANDLER( megatech_sms_ioport_dc_r );
39extern READ8_HANDLER( megatech_sms_ioport_dd_r );
3240
3341extern READ16_HANDLER( megadriv_vdp_r );
3442extern WRITE16_HANDLER( megadriv_vdp_w );
3543
36MACHINE_RESET( megadriv );
37VIDEO_START( megadriv );
38VIDEO_UPDATE( megadriv );
39VIDEO_EOF( megadriv );
44/* These handlers are needed by megaplay.c */
45extern READ16_HANDLER( megadriv_68k_io_read );
46extern WRITE16_HANDLER( megadriv_68k_io_write );
4047
41/* Needed to create external input handlers (see e.g. MESS) */
48/* These handlers are needed by puckpkmn.c for his memory map */
49extern READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read);
50extern WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write);
4251
52/* These are needed to create external input handlers (see e.g. MESS) */
53/* Regs are also used by Megaplay! */
4354extern UINT8 (*megadrive_io_read_data_port_ptr)(running_machine *machine, int offset);
4455extern void (*megadrive_io_write_data_port_ptr)(running_machine *machine, int offset, UINT16 data);
4556extern UINT8 megadrive_io_data_regs[3];
4657extern UINT8 megadrive_io_ctrl_regs[3];
4758
59MACHINE_RESET( megadriv );
60VIDEO_START( megadriv );
61VIDEO_UPDATE( megadriv );
62VIDEO_EOF( megadriv );
63
64
4865extern UINT16* megadrive_vdp_palette_lookup;
4966extern UINT16* megadrive_vdp_palette_lookup_sprite; // for C2
5067extern UINT16* megadrive_vdp_palette_lookup_shadow;
r6049r6050
5673extern int genvdp_use_cram;
5774extern int genesis_always_irq6;
5875extern int genesis_other_hacks;
76
77
78/* Megaplay - Megatech specific */
79/* It might be possible to move the following structs in the drivers */
80
81#define MP_ROM  0x10
82#define MP_GAME 0
83
84struct _mplay_bios   /* once all the regs are saved in this structure, it would be better to reorganize it a bit... */
85{
86   UINT32 bios_mode;  // determines whether ROM banks or Game data
87                           // is to read from 0x8000-0xffff
88
89   UINT32 bios_bank; // ROM bank selection
90   UINT16 game_banksel;  // Game bank selection
91   UINT32 readpos;  // serial bank selection position (9-bit)
92   UINT32 mp_bios_bank_addr;
93
94   UINT32 bios_width;  // determines the way the game info ROM is read
95   UINT8 bios_ctrl[6];
96   UINT8 bios_6600;
97   UINT8 bios_6403;
98   UINT8 bios_6404;
99};
100
101extern struct _mplay_bios mplay_bios;   // defined in megaplay.c
102
103struct _mtech_bios   /* once all the regs are saved in this structure, it would be better to reorganize it a bit... */
104{
105   UINT8 mt_cart_select_reg;
106   UINT32 bios_port_ctrl;
107   int current_game_is_sms; // is the current game SMS based (running on genesis z80, in VDP compatibility mode)
108   UINT32 bios_ctrl_inputs;
109   UINT8 bios_ctrl[6];
110
111   int mt_bank_bank_pos;
112   int mt_bank_partial;
113   int mt_bank_addr;
114};
src/mame/drivers/galaxian.c
r6049r6050
17091709   /* belongs here.                                   */
17101710
17111711   /* Input impedance of a M51516L is typically 30k (datasheet) */
1712   DISCRETE_CRFILTER(NODE_40,1,NODE_30,RES_K(30),CAP_U(0.15))
1712   DISCRETE_CRFILTER(NODE_40,NODE_30,RES_K(30),CAP_U(0.15))
17131713
17141714   DISCRETE_OUTPUT(NODE_40, 10.0 )
17151715
src/mame/drivers/model3.c
r6049r6050
42904290   ROM_LOAD64_WORD_SWAP( "epr21216c.19", 0x000002, 0x200000, CRC(867d3a0f) SHA1(15ba12099eaa2cfd1d6cd985805df69c48441fb2) )
42914291   ROM_LOAD64_WORD_SWAP( "epr21217c.20", 0x000000, 0x200000, CRC(ea8c30ce) SHA1(e076e32ba9134c63c7a5fb826eba4735774e3ab3) )
42924292
4293   /* IC1-8 should be 64MBit */
4294
42954293   // CROM0
4296   ROM_LOAD64_WORD_SWAP( "mpr21134.1",   0x800006, 0x400000, BAD_DUMP CRC(7bfe21a4) SHA1(accbb4272da313f4bd2b897f3f395f5523e7a3f4) )
4297   ROM_LOAD64_WORD_SWAP( "mpr21135.2",   0x800004, 0x400000, BAD_DUMP CRC(972f4b4f) SHA1(fa6b9d1ef3a213cedbe42705de015f6ae8c216b6) )
4298   ROM_LOAD64_WORD_SWAP( "mpr21136.3",   0x800002, 0x400000, BAD_DUMP CRC(5d563fba) SHA1(1f157b25e70438f1cfc04bbe8c83afa0e3858c2a) )
4299   ROM_LOAD64_WORD_SWAP( "mpr21137.4",   0x800000, 0x400000, BAD_DUMP CRC(707e5921) SHA1(a38ac947860d0cf7ad40b641135f1fb203e3df67) )
4294   ROM_LOAD64_WORD_SWAP( "mpr21134.1",   0x800006, 0x800000, CRC(65399935) SHA1(ae9f6a462009e6e47f59bc6aa344ae691d0eebc9) )
4295   ROM_LOAD64_WORD_SWAP( "mpr21135.2",   0x800004, 0x800000, CRC(f3fa7c50) SHA1(5ad8bd436fa3523b79ff342d896ad05e305ab385) )
4296   ROM_LOAD64_WORD_SWAP( "mpr21136.3",   0x800002, 0x800000, CRC(b730fe50) SHA1(abafcd5bec9aa7d8b550749aa6c2a48723238386) )
4297   ROM_LOAD64_WORD_SWAP( "mpr21137.4",   0x800000, 0x800000, CRC(3572d417) SHA1(cef3f4b6834276a07124359dced8aae902c1eb50) )
43004298
43014299   // CROM1
4302   ROM_LOAD64_WORD_SWAP( "mpr21138.5",  0x2800006, 0x400000, BAD_DUMP CRC(48619c98) SHA1(34e0d10ea6c6a9dca3e1440e248ab0ec7bad0d8e) )
4303   ROM_LOAD64_WORD_SWAP( "mpr21139.6",  0x2800004, 0x400000, BAD_DUMP CRC(0425ba5d) SHA1(a2f347268279182e1be08a600d862adc49f3f3b4) )
4304   ROM_LOAD64_WORD_SWAP( "mpr21140.7",  0x2800002, 0x400000, BAD_DUMP CRC(df574950) SHA1(816f3c60f0cbcda3278e4acf99176af93e7c9b4b) )
4305   ROM_LOAD64_WORD_SWAP( "mpr21141.8",  0x2800000, 0x400000, BAD_DUMP CRC(d6a51bf1) SHA1(cb3196a7f9b378c755d4b29b01a97612d7d7a8d5) )
4300   ROM_LOAD64_WORD_SWAP( "mpr21138.5",  0x2800006, 0x800000, CRC(a9a2de2c) SHA1(102532458bdf600f32e9e45a57c51ed5a9c4f33a) )
4301   ROM_LOAD64_WORD_SWAP( "mpr21139.6",  0x2800004, 0x800000, CRC(06d441f5) SHA1(9e5a843143a3373c61bfda975a24b449b0a2c749) )
4302   ROM_LOAD64_WORD_SWAP( "mpr21140.7",  0x2800002, 0x800000, CRC(1390746d) SHA1(618d80e714e9a47489674a8624e389bdfa09923a) )
4303   ROM_LOAD64_WORD_SWAP( "mpr21141.8",  0x2800000, 0x800000, CRC(1d0763cb) SHA1(4cc6b8b218399ed7ca0ee1b677896f120ae0aeac) )
43064304
43074305   // CROM2
43084306   ROM_LOAD64_WORD_SWAP( "mpr21142.9",   0x4800006, 0x400000, CRC(da35cd51) SHA1(6b89c79a4e207d4bb3fe36e918f41d09915facaa) )
src/mame/drivers/ironhors.c
r6049r6050
310310
311311   DISCRETE_MIXER3(NODE_30, 1, NODE_21, NODE_22, NODE_23, &ironhors_mixer_desc)
312312
313   DISCRETE_RCFILTER(NODE_31,1,NODE_04, RES_K(1), CAP_N(33) )
313   DISCRETE_RCFILTER(NODE_31,NODE_04, RES_K(1), CAP_N(33) )
314314   DISCRETE_MIXER2(NODE_33, 1, NODE_30, NODE_31, &ironhors_mixer_desc_final)
315315
316316   DISCRETE_OUTPUT(NODE_33, 5.0 )
src/mame/drivers/puckpkmn.c
r6049r6050
4848#include "sound/sn76496.h"
4949#include "sound/2612intf.h"
5050
51#include "genesis.h"
51#include "megadriv.h"
5252
53#define MASTER_CLOCK      53693100
5453
55static UINT16* main_ram;
56
5754/* Puckman Pockimon Input Ports */
58
5955static INPUT_PORTS_START( puckpkmn )
6056   PORT_START("P2")   /* $700011.b */
6157   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r6049r6050
131127
132128
133129static ADDRESS_MAP_START( puckpkmn_map, ADDRESS_SPACE_PROGRAM, 16 )
134   AM_RANGE(0x000000, 0x1fffff) AM_ROM                                       /* Main 68k Program Roms */
130   AM_RANGE(0x000000, 0x1fffff) AM_ROM                        /* Main 68k Program Roms */
135131   AM_RANGE(0x700010, 0x700011) AM_READ_PORT("P2")
136132   AM_RANGE(0x700012, 0x700013) AM_READ_PORT("P1")
137133   AM_RANGE(0x700014, 0x700015) AM_READ_PORT("UNK")
138134   AM_RANGE(0x700016, 0x700017) AM_READ_PORT("DSW1")
139135   AM_RANGE(0x700018, 0x700019) AM_READ_PORT("DSW2")
140   AM_RANGE(0x700022, 0x700023) AM_DEVREADWRITE8("oki", okim6295_r,okim6295_w, 0x00ff)   /* M6295 Sound Chip Status Register/Writes */
141   AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8("ym", ym3438_r,ym3438_w, 0xffff)      /* Ym3438 Sound Chip Status Register */
142   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(genesis_vdp_r,genesis_vdp_w)            /* VDP Access */
143   AM_RANGE(0xe00000, 0xe1ffff) AM_ROMBANK(1)                                 /* VDP sees the roms here */
144   AM_RANGE(0xfe0000, 0xfeffff) AM_RAMBANK(2)                                 /* VDP sees the ram here */
145   AM_RANGE(0xff0000, 0xffffff) AM_RAM AM_BASE(&main_ram)                        /* Main Ram */
136   AM_RANGE(0x700022, 0x700023) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
137   AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8("ym", megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
138   AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE(megadriv_vdp_r, megadriv_vdp_w)
139   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000) AM_BASE(&megadrive_ram)
146140
147141   /* Unknown reads/writes: */
148   AM_RANGE(0xa00000, 0xa00551) AM_WRITENOP                                 /* ? */
142   AM_RANGE(0xa00000, 0xa00551) AM_WRITENOP                     /* ? */
149143//  AM_RANGE(0xa10000, 0xa10001) AM_READNOP                                             /* ? once */
150   AM_RANGE(0xa10002, 0xa10005) AM_NOP                                       /* ? alternative way of reading inputs ? */
151   AM_RANGE(0xa11100, 0xa11101) AM_NOP                                       /* ? */
144   AM_RANGE(0xa10002, 0xa10005) AM_NOP                        /* ? alternative way of reading inputs ? */
145   AM_RANGE(0xa11100, 0xa11101) AM_NOP                        /* ? */
152146//  AM_RANGE(0xa10008, 0xa1000d) AM_WRITENOP                                            /* ? once */
153147//  AM_RANGE(0xa14000, 0xa14003) AM_WRITENOP                                            /* ? once */
154   AM_RANGE(0xa11200, 0xa11201) AM_WRITENOP                                 /* ? */
148   AM_RANGE(0xa11200, 0xa11201) AM_WRITENOP                     /* ? */
155149ADDRESS_MAP_END
156150
157151
158static const ym3438_interface ym3438_intf =
159{
160   genesis_irq2_interrupt      /* IRQ handler */
161};
162
163152static MACHINE_DRIVER_START( puckpkmn )
153   MDRV_IMPORT_FROM( megadriv )
164154
165   /* basic machine hardware */
166   MDRV_CPU_ADD("maincpu",M68000, MASTER_CLOCK/7)       /*???*/
155   MDRV_CPU_MODIFY("maincpu")
167156   MDRV_CPU_PROGRAM_MAP(puckpkmn_map)
168   MDRV_CPU_VBLANK_INT("screen", genesis_vblank_interrupt)
169157
170   MDRV_MACHINE_START(genesis)
171   MDRV_MACHINE_RESET(genesis)
158   MDRV_DEVICE_REMOVE("genesis_snd_z80")
172159
173   /* video hardware */
174   MDRV_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS)
175
176   MDRV_SCREEN_ADD("screen", RASTER)
177   MDRV_SCREEN_REFRESH_RATE(60)
178   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
179   MDRV_SCREEN_SIZE(342,262)
180   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 223)
181   MDRV_PALETTE_LENGTH(64)
182
183   MDRV_VIDEO_START(genesis)
184   MDRV_VIDEO_UPDATE(genesis)
185
186   /* sound hardware */
187   MDRV_SPEAKER_STANDARD_MONO("mono")
188
189   MDRV_SOUND_ADD("ym", YM3438, MASTER_CLOCK/7)
190   MDRV_SOUND_CONFIG(ym3438_intf)
191   MDRV_SOUND_ROUTE(0, "mono", 0.50)
192   MDRV_SOUND_ROUTE(1, "mono", 0.50)
193
194   MDRV_SOUND_ADD("sn", SN76496, MASTER_CLOCK/15)
195   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
196
197   /* sound hardware */
198160   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
199161   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
200   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
162   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.25)
163   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker",0.25)
201164MACHINE_DRIVER_END
202165
203166/* Genie's Hardware (contains no real sega parts) */
r6049r6050
283246   for (i = 0; i < len; i++)
284247      rom[i] = BITSWAP8(rom[i],1,4,2,0,7,5,3,6);
285248
286   memory_set_bankptr(machine, 1, memory_region(machine, "maincpu") );   // VDP reads the roms from here
287   memory_set_bankptr(machine, 2, main_ram );                  // VDP reads the ram from here
249   DRIVER_INIT_CALL(megadriv);
288250}
289251
290252ROM_START( puckpkmn ) /* Puckman Pockimon  (c)2000 Genie */
src/mame/drivers/arkanoid.c
r6049r6050
236236      * You are told be to able to select your starting level from level 1 to level 32
237237        (ingame bug - check code at 0x3425)
238238
2392a) 'arkangc2'
2392b) 'arkangc2'
240240
241241  - "(c)  Game Corporation 1986".
242242  - Displays the "Arkanoid" title but routine to display "BLOCK" with bricks exists.
r6049r6050
265265        (ingame bug - check unused code at 0x2f00 instead of standard text)
266266        But you can still press the buttons and test the paddle and the Dip Switches.
267267
2682c) 'arkblock'
2682c) 'block2'
269269
270  - "       S.  P.  A.  CO.    ".
271  - Displays "BLOCK II" with "bricks".
272  - Colored bricks have been replaced with aliens (ripped from "Space Invaders" ?)
273  - No standard hardware test and no "NOTICE" screen.
274  - Specific hardware test which reads back at 0xf000 values written to 0xd018
275    (check code at 0x035e); the game enters a loop until good values are returned.
276  - No reads from 0xf002.
277  - Reads bit 1 from 0xd008.
278  - "Continue" Dip Switch has been replaced by sort of "Debug" Dip Switch as in 'arkangc';
279    however, this has no effect due to newly patched code at 0x06e9 !
280  - You can select your starting level (between 1 and 30)
281    but they aren't displayed like in the original Japanese set we have ('arknoidj').
282  - Levels 1, 2, 3, 4, 6, 7, 11, 14, 30, 31 and 32 differ from original Japanese version;
283    level 1 starts at a different offset (0x90a8 instead of 0xbf15).
284  - Complerely different initials on high-scores table, but scores and rounds
285    are the same as in the original Japanese set we have ('arknoidj').
286  - There seems to be code to edit levels (check code at 0x8082), but the routines
287    don't seem to be called anymore.
288  - Known bugs :
289      * The paddle isn't centered when starting a new life and / or level;
290        it doesn't "backup" the paddle position when a life is lost as well
291        (I can't tell at the moment if it's an ingame bug or not)
292        So the paddle can sometimes appear in the left wall !
293      * The "test mode" display is completely corrupted
294        (ingame bug - check unused code at 0x2f00 instead of standard text)
295        But you can still press the buttons and test the paddle and the Dip Switches.
296
2972d) 'arkblock'
298
270299  - Same as 'arkangc', the only difference is that it displays "BLOCK" with bricks
271300    instead of displaying the "Arkanoid" title :
272301
273      Z:\MAME\dasm>diff arkangc.asm arkbloc2.asm
302      Z:\MAME\dasm>diff arkangc.asm arkblock.asm
274303      8421,8422c8421,8424
275304      < 32EF: 21 80 03      ld   hl,$0380
276305      < 32F2: CD D1 20      call $20D1
r6049r6050
280309      > 32F3: C9            ret
281310      > 32F4: 14            inc  d
282311
2832d) 'arkbloc2'
3122e) 'arkbloc2'
284313
285314  - "(c)  Game Corporation 1986".
286315  - Displays "BLOCK" with bricks.
r6049r6050
301330      * You are told be to able to select your starting level from level 1 to level 32
302331        (ingame bug - check code at 0x3425)
303332
3042e) 'arkgcbl'
3332f) 'arkgcbl'
305334
306335  - "1986    ARKANOID    1986".
307336  - Displays the "Arkanoid" title but routine to display "BLOCK" with bricks exists.
r6049r6050
326355      * Sound in "Demo Mode" if 1 coin is inserted (ingame bug - check code at 0x0283)
327356      * Red square on upper middle left "led" when it is supposed to be yellow (ingame bug)
328357
3292f) 'paddle2'
3582g) 'paddle2'
330359
331360  - Different title, year, and inside texts but routine to display "BLOCK" with bricks exists.
332361  - No hardware test and no "NOTICE" screen.
r6049r6050
432461      * 'arkmcubl'
433462    This way, even if emulation isn't perfect, people can try them and report bugs.
434463
464
465Stephh's log (2009.10.07) :
466
467  - Added set :
468      * 'block2'
469
435470***************************************************************************
436471
437472Stephh's notes on 'tetrsark' (based on the game Z80 code and some tests) :
r6049r6050
611646
612647   PORT_MODIFY("SYSTEM")
613648   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL )      /* Some bootlegs need it to be 1 */
614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
649   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )      /* Some bootlegs need it to be 0 */
615650INPUT_PORTS_END
616651
617652static INPUT_PORTS_START( arkangc )
r6049r6050
632667   PORT_DIPSETTING(    0x00, DEF_STR ( Normal ) )      /* 0xc462 = 0x06 - Level 2 same as level 30 */
633668INPUT_PORTS_END
634669
670static INPUT_PORTS_START( block2 )
671   PORT_INCLUDE( arkatayt )
672
673   PORT_MODIFY("DSW")
674   PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "SW1:8" )        /* Speed at 0xc462 (code at 0x06fc) : always = 0x06 */
675INPUT_PORTS_END
676
635677static INPUT_PORTS_START( arkgcbl )
636678   PORT_INCLUDE( arkatayt )
637679
r6049r6050
9811023   ROM_LOAD( "a75-09.bpr",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
9821024ROM_END
9831025
1026ROM_START( block2 )
1027   ROM_REGION( 0x18000, "maincpu", 0 )
1028   ROM_LOAD( "1.bin",         0x00000, 0x8000, CRC(2b026cae) SHA1(73d1d5d3e6d65fbe378ce85ff501610573ae5e95) )
1029   ROM_LOAD( "2.bin",         0x08000, 0x8000, CRC(e3843fea) SHA1(8c654dcf78d9e4f4c6a7a7d384fdf622536234c1) )
1030
1031   ROM_REGION( 0x8000, "unknown", 0 )   /* is it more data or something else like sound or palette ? not Z80 code nor levels anyway */
1032   ROM_LOAD( "3.bin",         0x00000, 0x8000, CRC(e336c219) SHA1(e1dce37727e7084a83e73f15a138312ab6224061) )
1033
1034   ROM_REGION( 0x18000, "gfx1", 0 )
1035   ROM_LOAD( "4.bin",   0x00000, 0x8000, CRC(6d2c6123) SHA1(26f32099d363ab2c8505722513638b827e49a8fc) )
1036   ROM_LOAD( "5.bin",   0x08000, 0x8000, CRC(09a1f9d9) SHA1(c7e21aba6efb51c5501aa1428f6d9a817cb86555) )
1037   ROM_LOAD( "6.bin",   0x10000, 0x8000, CRC(dfb9f7e2) SHA1(8d938ee6f8dcac0a564d5fa7cd5da34e0db07c71) )
1038
1039   // no proms were present in this set.. assumed to be the same
1040   ROM_REGION( 0x0600, "proms", 0 )
1041   ROM_LOAD( "a75-07.bpr",    0x0000, 0x0200, CRC(0af8b289) SHA1(6bc589e8a609b4cf450aebedc8ce02d5d45c970f) )   /* red component */
1042   ROM_LOAD( "a75-08.bpr",    0x0200, 0x0200, CRC(abb002fb) SHA1(c14f56b8ef103600862e7930709d293b0aa97a73) )   /* green component */
1043   ROM_LOAD( "a75-09.bpr",    0x0400, 0x0200, CRC(a7c6c277) SHA1(adaa003dcd981576ea1cc5f697d709b2d6b2ea29) )   /* blue component */
1044ROM_END
1045
9841046ROM_START( arkblock )
9851047   ROM_REGION( 0x10000, "maincpu", 0 )
9861048   ROM_LOAD( "ark-6.bin",    0x0000, 0x8000, CRC(0be015de) SHA1(f4209085b59d2c96a62ac9657c7bf097da55362b) )
r6049r6050
11251187
11261188static void arkanoid_bootleg_init( running_machine *machine )
11271189{
1190   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf000, 0xf000, 0, 0, arkanoid_bootleg_f000_r );
11281191   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
11291192   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
11301193   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
r6049r6050
11421205   arkanoid_bootleg_init(machine);
11431206}
11441207
1208static DRIVER_INIT( block2 )
1209{
1210   // the graphics on this bootleg have the data scrambled
1211   int tile;
1212   UINT8* srcgfx = memory_region(machine,"gfx1");
1213   UINT8* buffer = alloc_array_or_die(UINT8, 0x18000);
1214
1215   for (tile=0;tile<0x3000;tile++)
1216   {
1217      int srctile;
1218
1219      // combine these into a single swap..
1220      srctile = BITSWAP16(tile,15,14,13,12,
1221                   11,10,9,8,
1222                   7,5,6,3,
1223                    1,2,4,0);
1224
1225      srctile = BITSWAP16(srctile,15,14,13,12,
1226                   11,9,10,5,
1227                7,6,8,4,
1228                    3,2,1,0);
1229
1230      srctile = srctile^0xd4;
1231
1232      memcpy(&buffer[tile*8], &srcgfx[srctile*8], 8);
1233   }
1234
1235   memcpy(srcgfx,buffer,0x18000);
1236
1237   arkanoid_bootleg_id = BLOCK2;
1238   arkanoid_bootleg_init(machine);
1239}
1240
11451241static DRIVER_INIT( arkblock )
11461242{
11471243   arkanoid_bootleg_id = ARKBLOCK;
r6049r6050
11831279
11841280/* Game Drivers */
11851281
1186GAME( 1986, arkanoid,  0,        arkanoid, arkanoid, 0,        ROT90, "Taito Corporation Japan", "Arkanoid (World)", GAME_SUPPORTS_SAVE )
1187GAME( 1986, arkanoidu, arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Arkanoid (US)", GAME_SUPPORTS_SAVE )
1188GAME( 1986, arkanoiduo,arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Arkanoid (US, older)", GAME_SUPPORTS_SAVE )
1189GAME( 1986, arkanoidj, arkanoid, arkanoid, arknoidj, 0,        ROT90, "Taito Corporation", "Arkanoid (Japan)", GAME_SUPPORTS_SAVE )
1190GAME( 1986, arkmcubl, arkanoid, arkanoid, arknoidj, 0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU)", GAME_SUPPORTS_SAVE )
1191GAME( 1986, ark1ball, arkanoid, arkanoid, ark1ball, 0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU, harder)", GAME_SUPPORTS_SAVE )
1192GAME( 1986, arkangc,  arkanoid, bootleg,  arkangc,  arkangc,  ROT90, "bootleg", "Arkanoid (Game Corporation bootleg, set 1)", GAME_SUPPORTS_SAVE )
1193GAME( 1986, arkangc2, arkanoid, bootleg,  arkangc2, arkangc2, ROT90, "bootleg", "Arkanoid (Game Corporation bootleg, set 2)", GAME_SUPPORTS_SAVE )
1194GAME( 1986, arkblock, arkanoid, bootleg,  arkangc,  arkblock, ROT90, "bootleg", "Block (Game Corporation bootleg, set 1)", GAME_SUPPORTS_SAVE )
1195GAME( 1986, arkbloc2, arkanoid, bootleg,  arkangc,  arkbloc2, ROT90, "bootleg", "Block (Game Corporation bootleg, set 2)", GAME_SUPPORTS_SAVE )
1196GAME( 1986, arkgcbl,  arkanoid, bootleg,  arkgcbl,  arkgcbl,  ROT90, "bootleg", "Arkanoid (bootleg on Block hardware)", GAME_SUPPORTS_SAVE )
1197GAME( 1988, paddle2,  arkanoid, bootleg,  paddle2,  paddle2,  ROT90, "bootleg", "Paddle 2 (bootleg on Block hardware)", GAME_SUPPORTS_SAVE )
1198GAME( 1986, arkatayt, arkanoid, bootleg,  arkatayt, 0,        ROT90, "bootleg", "Arkanoid (Tayto bootleg)", GAME_SUPPORTS_SAVE )
1199GAME( 1986, arktayt2, arkanoid, bootleg,  arktayt2, 0,        ROT90, "bootleg", "Arkanoid (Tayto bootleg, harder)", GAME_SUPPORTS_SAVE )
1200GAME( 1987, arkatour, arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Tournament Arkanoid (US)", GAME_SUPPORTS_SAVE )
1201GAME( 19??, tetrsark, 0,        bootleg,  tetrsark, tetrsark, ROT0,  "D.R. Korea", "Tetris (D.R. Korea)", GAME_SUPPORTS_SAVE )
1282GAME( 1986, arkanoid,   0,        arkanoid, arkanoid, 0,        ROT90, "Taito Corporation Japan", "Arkanoid (World)", GAME_SUPPORTS_SAVE )
1283GAME( 1986, arkanoidu,  arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Arkanoid (US)", GAME_SUPPORTS_SAVE )
1284GAME( 1986, arkanoiduo, arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Arkanoid (US, older)", GAME_SUPPORTS_SAVE )
1285GAME( 1986, arkanoidj,  arkanoid, arkanoid, arknoidj, 0,        ROT90, "Taito Corporation", "Arkanoid (Japan)", GAME_SUPPORTS_SAVE )
1286GAME( 1986, arkmcubl,   arkanoid, arkanoid, arknoidj, 0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU)", GAME_SUPPORTS_SAVE )
1287GAME( 1986, ark1ball,   arkanoid, arkanoid, ark1ball, 0,        ROT90, "bootleg", "Arkanoid (bootleg with MCU, harder)", GAME_SUPPORTS_SAVE )
1288GAME( 1986, arkangc,    arkanoid, bootleg,  arkangc,  arkangc,  ROT90, "bootleg", "Arkanoid (Game Corporation bootleg, set 1)", GAME_SUPPORTS_SAVE )
1289GAME( 1986, arkangc2,   arkanoid, bootleg,  arkangc2, arkangc2, ROT90, "bootleg", "Arkanoid (Game Corporation bootleg, set 2)", GAME_SUPPORTS_SAVE )
1290GAME( 1986, block2,     arkanoid, bootleg,  block2,   block2,   ROT90, "bootleg", "Block 2 (S.P.A. CO. bootleg)", GAME_SUPPORTS_SAVE )
1291GAME( 1986, arkblock,   arkanoid, bootleg,  arkangc,  arkblock, ROT90, "bootleg", "Block (Game Corporation bootleg, set 1)", GAME_SUPPORTS_SAVE )
1292GAME( 1986, arkbloc2,   arkanoid, bootleg,  arkangc,  arkbloc2, ROT90, "bootleg", "Block (Game Corporation bootleg, set 2)", GAME_SUPPORTS_SAVE )
1293GAME( 1986, arkgcbl,    arkanoid, bootleg,  arkgcbl,  arkgcbl,  ROT90, "bootleg", "Arkanoid (bootleg on Block hardware)", GAME_SUPPORTS_SAVE )
1294GAME( 1988, paddle2,    arkanoid, bootleg,  paddle2,  paddle2,  ROT90, "bootleg", "Paddle 2 (bootleg on Block hardware)", GAME_SUPPORTS_SAVE )
1295GAME( 1986, arkatayt,   arkanoid, bootleg,  arkatayt, 0,        ROT90, "bootleg", "Arkanoid (Tayto bootleg)", GAME_SUPPORTS_SAVE )
1296GAME( 1986, arktayt2,   arkanoid, bootleg,  arktayt2, 0,        ROT90, "bootleg", "Arkanoid (Tayto bootleg, harder)", GAME_SUPPORTS_SAVE )
1297GAME( 1987, arkatour,   arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Tournament Arkanoid (US)", GAME_SUPPORTS_SAVE )
1298GAME( 19??, tetrsark,   0,        bootleg,  tetrsark, tetrsark, ROT0,  "D.R. Korea", "Tetris (D.R. Korea)", GAME_SUPPORTS_SAVE )
src/osd/osdmini/miniwork.c
r6049r6050
22//
33//  miniwork.c - Minimal core work item functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#include "osdcore.h"
r6049r6050
69101//  osd_work_item_queue
70102//============================================================
71103
72osd_work_item *osd_work_item_queue(osd_work_queue *queue, osd_work_callback callback, void *param, UINT32 flags)
104osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_callback callback, INT32 numitems, void *parambase, INT32 paramstep, UINT32 flags)
73105{
74106   osd_work_item *item;
107   int itemnum;
75108
76109   // allocate memory to hold the result
77110   item = malloc(sizeof(*item));
78111   if (item == NULL)
79112      return NULL;
80113
81   // execute the call directly
82   item->result = (*callback)(param, 0);
114   // loop over all requested items
115   for (itemnum = 0; itemnum < numitems; itemnum++)
116   {
117      // execute the call directly
118      item->result = (*callback)(parambase, 0);
119
120      // advance the param
121      parambase = (UINT8 *)parambase + paramstep;
122   }
123
124   // free the item if requested
125   if (flags & WORK_ITEM_FLAG_AUTO_RELEASE)
126   {
127      free(item);
128      item = NULL;
129   }
83130   return item;
84131}
85132
src/osd/osdmini/minimain.c
r0r6050
1//============================================================
2//
3//  minimain.c - Main function for mini OSD
4//
5//============================================================
6//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
40//============================================================
41
42#include "osdepend.h"
43#include "render.h"
44#include "clifront.h"
45#include "mame.h"
46
47
48//============================================================
49//  CONSTANTS
50//============================================================
51
52// we fake a keyboard with the following keys
53enum
54{
55   KEY_ESCAPE,
56   KEY_P1_START,
57   KEY_BUTTON_1,
58   KEY_BUTTON_2,
59   KEY_BUTTON_3,
60   KEY_JOYSTICK_U,
61   KEY_JOYSTICK_D,
62   KEY_JOYSTICK_L,
63   KEY_JOYSTICK_R,
64   KEY_TOTAL
65};
66
67
68//============================================================
69//  GLOBALS
70//============================================================
71
72// a single rendering target
73static render_target *our_target;
74
75// a single input device
76static input_device *keyboard_device;
77
78// the state of each key
79static UINT8 keyboard_state[KEY_TOTAL];
80
81
82//============================================================
83//  FUNCTION PROTOTYPES
84//============================================================
85
86static INT32 keyboard_get_state(void *device_internal, void *item_internal);
87
88
89//============================================================
90//  main
91//============================================================
92
93int main(int argc, char *argv[])
94{
95   // cli_execute does the heavy lifting; if we have osd-specific options, we
96   // would pass them as the third parameter here
97   return cli_execute(argc, argv, NULL);
98}
99
100
101//============================================================
102//  osd_init
103//============================================================
104
105void osd_init(running_machine *machine)
106{
107   // initialize the video system by allocating a rendering target
108   our_target = render_target_alloc(machine, NULL, 0);
109   if (our_target == NULL)
110      fatalerror("Error creating render target");
111
112   // nothing yet to do to initialize sound, since we don't have any
113   // sound updates are handled by osd_update_audio_stream() below
114
115   // initialize the input system by adding devices
116   // let's pretend like we have a keyboard device
117   keyboard_device = input_device_add(machine, DEVICE_CLASS_KEYBOARD, "Keyboard", NULL);
118   if (keyboard_device == NULL)
119      fatalerror("Error creating keyboard device");
120
121   // our faux keyboard only has a couple of keys (corresponding to the
122   // common defaults)
123   input_device_item_add(keyboard_device, "Esc", &keyboard_state[KEY_ESCAPE], ITEM_ID_ESC, keyboard_get_state);
124   input_device_item_add(keyboard_device, "P1", &keyboard_state[KEY_P1_START], ITEM_ID_1, keyboard_get_state);
125   input_device_item_add(keyboard_device, "B1", &keyboard_state[KEY_BUTTON_1], ITEM_ID_LCONTROL, keyboard_get_state);
126   input_device_item_add(keyboard_device, "B2", &keyboard_state[KEY_BUTTON_2], ITEM_ID_LALT, keyboard_get_state);
127   input_device_item_add(keyboard_device, "B3", &keyboard_state[KEY_BUTTON_3], ITEM_ID_SPACE, keyboard_get_state);
128   input_device_item_add(keyboard_device, "JoyU", &keyboard_state[KEY_JOYSTICK_U], ITEM_ID_UP, keyboard_get_state);
129   input_device_item_add(keyboard_device, "JoyD", &keyboard_state[KEY_JOYSTICK_D], ITEM_ID_DOWN, keyboard_get_state);
130   input_device_item_add(keyboard_device, "JoyL", &keyboard_state[KEY_JOYSTICK_L], ITEM_ID_LEFT, keyboard_get_state);
131   input_device_item_add(keyboard_device, "JoyR", &keyboard_state[KEY_JOYSTICK_R], ITEM_ID_RIGHT, keyboard_get_state);
132
133   // hook up the debugger log
134//  add_logerror_callback(machine, output_oslog);
135}
136
137
138//============================================================
139//  osd_wait_for_debugger
140//============================================================
141
142void osd_wait_for_debugger(const device_config *device, int firststop)
143{
144   // we don't have a debugger, so we just return here
145}
146
147
148//============================================================
149//  osd_update
150//============================================================
151
152void osd_update(running_machine *machine, int skip_redraw)
153{
154   const render_primitive_list *primlist;
155   int minwidth, minheight;
156
157   // get the minimum width/height for the current layout
158   render_target_get_minimum_size(our_target, &minwidth, &minheight);
159
160   // make that the size of our target
161   render_target_set_bounds(our_target, minwidth, minheight, 0);
162
163   // get the list of primitives for the target at the current size
164   primlist = render_target_get_primitives(our_target);
165
166   // lock them, and then render them
167   osd_lock_acquire(primlist->lock);
168   // do the drawing here
169   osd_lock_release(primlist->lock);
170
171   // after 5 seconds, exit
172   if (attotime_compare(timer_get_time(machine), attotime_make(5, 0)) > 0)
173      mame_schedule_exit(machine);
174}
175
176
177//============================================================
178//  osd_update_audio_stream
179//============================================================
180
181void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame)
182{
183   // if we had actual sound output, we would copy the
184   // interleaved stereo samples to our sound stream
185}
186
187
188//============================================================
189//  osd_set_mastervolume
190//============================================================
191
192void osd_set_mastervolume(int attenuation)
193{
194   // if we had actual sound output, we would adjust the global
195   // volume in response to this function
196}
197
198
199//============================================================
200//  osd_customize_input_type_list
201//============================================================
202
203void osd_customize_input_type_list(input_type_desc *typelist)
204{
205   // This function is called on startup, before reading the
206   // configuration from disk. Scan the list, and change the
207   // default control mappings you want. It is quite possible
208   // you won't need to change a thing.
209}
210
211
212//============================================================
213//  keyboard_get_state
214//============================================================
215
216static INT32 keyboard_get_state(void *device_internal, void *item_internal)
217{
218   // this function is called by the input system to get the current key
219   // state; it is specified as a callback when adding items to input
220   // devices
221   UINT8 *keystate = (UINT8 *)item_internal;
222   return *keystate;
223}
src/osd/osdmini/minimisc.c
r6049r6050
22//
33//  minimisc.c - Minimal core miscellaneous functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#include "osdcore.h"
src/osd/osdmini/osdmini.mak
r6049r6050
44#
55#   Minimal OSD makefile
66#
7#   Copyright Nicola Salmoria and the MAME Team.
8#   Visit http://mamedev.org for licensing and usage restrictions.
7###########################################################################
98#
9#   Copyright Aaron Giles
10#   All rights reserved.
11#
12#   Redistribution and use in source and binary forms, with or without
13#   modification, are permitted provided that the following conditions are
14#   met:
15#
16#       * Redistributions of source code must retain the above copyright
17#         notice, this list of conditions and the following disclaimer.
18#       * Redistributions in binary form must reproduce the above copyright
19#         notice, this list of conditions and the following disclaimer in
20#         the documentation and/or other materials provided with the
21#         distribution.
22#       * Neither the name 'MAME' nor the names of its contributors may be
23#         used to endorse or promote products derived from this software
24#         without specific prior written permission.
25#
26#   THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27#   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28#   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29#   DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30#   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31#   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32#   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33#   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34#   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35#   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36#   POSSIBILITY OF SUCH DAMAGE.
37#
1038###########################################################################
1139
1240
1341#-------------------------------------------------
42# object and source roots
43#-------------------------------------------------
44
45MINISRC = $(SRC)/osd/$(OSD)
46MINIOBJ = $(OBJ)/osd/$(OSD)
47
48OBJDIRS += $(MINIOBJ)
49
50
51
52#-------------------------------------------------
1453# OSD core library
1554#-------------------------------------------------
1655
1756OSDCOREOBJS = \
18   $(OBJ)/$(MAMEOS)/minidir.o \
19   $(OBJ)/$(MAMEOS)/minifile.o \
20   $(OBJ)/$(MAMEOS)/minimisc.o \
21   $(OBJ)/$(MAMEOS)/minisync.o \
22   $(OBJ)/$(MAMEOS)/minitime.o \
23   $(OBJ)/$(MAMEOS)/miniwork.o \
57   $(MINIOBJ)/minidir.o \
58   $(MINIOBJ)/minifile.o \
59   $(MINIOBJ)/minimisc.o \
60   $(MINIOBJ)/minisync.o \
61   $(MINIOBJ)/minitime.o \
62   $(MINIOBJ)/miniwork.o \
63
64
65
66#-------------------------------------------------
67# OSD mini library
68#-------------------------------------------------
69
70OSDOBJS = \
71   $(MINIOBJ)/minimain.o
72
73
74
75#-------------------------------------------------
76# rules for building the libaries
77#-------------------------------------------------
78
79$(LIBOCORE): $(OSDCOREOBJS)
80
81$(LIBOSD): $(OSDOBJS)
src/osd/osdmini/minisync.c
r6049r6050
22//
33//  minisync.c - Minimal core synchronization functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#include "osdcore.h"
src/osd/osdmini/minidir.c
r6049r6050
1/***************************************************************************
1//============================================================
2//
3//  minidir.c - Minimal core directory access functions
4//
5//============================================================
6//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
40//============================================================
241
3    minidir.c - Minimal core directory access functions
4
5    Copyright Nicola Salmoria and the MAME Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8***************************************************************************/
9
1042#include "osdcore.h"
1143
1244
r6049r6050
4375   // since there are no standard C library routines for walking directories,
4476   // we do nothing
4577}
78
79
80//============================================================
81//  osd_is_absolute_path
82//============================================================
83
84int osd_is_absolute_path(const char *path)
85{
86   // assume no for everything
87   return FALSE;
88}
src/osd/osdmini/minitime.c
r6049r6050
22//
33//  minitime.c - Minimal core timing functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#include "osdepend.h"
r6049r6050
3466
3567
3668//============================================================
37//  get_profile_ticks
38//============================================================
39
40osd_ticks_t get_profile_ticks(void)
41{
42   // on x86 platforms, we should return the value of RDTSC here
43   // generically, we fall back to clock(), which hopefully is
44   // fast
45   return clock();
46}
47
48
49//============================================================
5069//  osd_sleep
5170//============================================================
5271
src/osd/osdmini/minifile.c
r6049r6050
22//
33//  minifile.c - Minimal core file access functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#include "osdcore.h"
r6049r6050
5082
5183
5284//============================================================
85//  osd_close
86//============================================================
87
88file_error osd_close(osd_file *file)
89{
90   // close the file handle
91   fclose((FILE *)file);
92   return FILERR_NONE;
93}
94
95
96//============================================================
5397//  osd_read
5498//============================================================
5599
r6049r6050
90134
91135
92136//============================================================
93//  osd_close
137//  osd_rmfile
94138//============================================================
95139
96file_error osd_close(osd_file *file)
140file_error osd_rmfile(const char *filename)
97141{
98   // close the file handle
99   fclose((FILE *)file);
100   return FILERR_NONE;
142   return remove(filename) ? FILERR_FAILURE : FILERR_NONE;
101143}
102144
103145
src/osd/osdcore.h
r6049r6050
44
55    Core OS-dependent code interface.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    The prototypes in this file describe the interfaces that the MAME core
r6049r6050
352380-----------------------------------------------------------------------------*/
353381osd_ticks_t osd_ticks(void);
354382
383
355384/*-----------------------------------------------------------------------------
356385    osd_ticks_per_second: return the number of ticks per second
357386
r6049r6050
366395-----------------------------------------------------------------------------*/
367396osd_ticks_t osd_ticks_per_second(void);
368397
398
369399/*-----------------------------------------------------------------------------
370400    osd_sleep: sleep for the specified time interval
371401
src/osd/osdcomm.h
r6049r6050
55    Common definitions shared by the OSD layer. This includes the most
66    fundamental integral types as well as compiler-specific tweaks.
77
8    Copyright Nicola Salmoria and the MAME Team.
9    Visit http://mamedev.org for licensing and usage restrictions.
8****************************************************************************
109
10    Copyright Aaron Giles
11    All rights reserved.
12
13    Redistribution and use in source and binary forms, with or without
14    modification, are permitted provided that the following conditions are
15    met:
16
17        * Redistributions of source code must retain the above copyright
18          notice, this list of conditions and the following disclaimer.
19        * Redistributions in binary form must reproduce the above copyright
20          notice, this list of conditions and the following disclaimer in
21          the documentation and/or other materials provided with the
22          distribution.
23        * Neither the name 'MAME' nor the names of its contributors may be
24          used to endorse or promote products derived from this software
25          without specific prior written permission.
26
27    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
28    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
35    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
36    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37    POSSIBILITY OF SUCH DAMAGE.
38
1139***************************************************************************/
1240
1341#pragma once
r6049r6050
5078#define ATTR_CONST            __attribute__((const))
5179#define ATTR_FORCE_INLINE      __attribute__((always_inline))
5280#define ATTR_NONNULL(...)      __attribute__((nonnull(__VA_ARGS__)))
53#define UNEXPECTED(exp)         __builtin_expect((exp), 0)
81#define UNEXPECTED(exp)         __builtin_expect(!!(exp), 0)
82#define EXPECTED(exp)         __builtin_expect(!!(exp), 1)
5483#define RESTRICT            __restrict__
5584#define SETJMP_GNUC_PROTECT()   (void)__builtin_return_address(1)
5685#ifndef TYPES_COMPATIBLE
r6049r6050
6695#define ATTR_FORCE_INLINE
6796#define ATTR_NONNULL(...)
6897#define UNEXPECTED(exp)         (exp)
98#define EXPECTED(exp)         (exp)
6999#define RESTRICT
70100#define SETJMP_GNUC_PROTECT()   do {} while (0)
71101#ifndef TYPES_COMPATIBLE
r6049r6050
158188#define S64(val) val
159189#endif
160190
191
192/* Concatenate/extract 32-bit halves of 64-bit values */
193#define CONCAT_64(hi,lo)   (((UINT64)(hi) << 32) | (UINT32)(lo))
194#define EXTRACT_64HI(val)   ((UINT32)((val) >> 32))
195#define EXTRACT_64LO(val)   ((UINT32)(val))
196
197
161198/* MINGW has adopted the MSVC formatting for 64-bit ints as of gcc 4.4 */
162199#if (defined(__MINGW32__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))) || defined(_MSVC_VER)
163200#define I64FMT   "I64"
src/osd/osdepend.h
r6049r6050
44
55    OS-dependent code interface.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    The prototypes in this file describe the interfaces that the MAME core
src/osd/windows/strconv.c
r6049r6050
11//============================================================
22//
3//  strconv.h - Win32 string conversion
3//  strconv.c - Win32 string conversion
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/output.c
r6049r6050
22//
33//  output.c - Win32 implementation of MAME output routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/d3dintf.h
r6049r6050
11//============================================================
22//
3//  drawd3di.h - Direct3D 8/9 interface abstractions
3//  d3dintf.h - Direct3D 8/9 interface abstractions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
10#ifndef __WIN_DRAWD3DI__
11#define __WIN_DRAWD3DI__
42#ifndef __WIN_D3DINTF__
43#define __WIN_D3DINTF__
1244
1345
1446//============================================================
src/osd/windows/winutil.h
r6049r6050
22//
33//  winutil.h - Win32 OSD core utility functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WINUTIL__
src/osd/windows/strconv.h
r6049r6050
22//
33//  strconv.h - Win32 string conversion
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WIN_STRCONV__
src/osd/windows/output.h
r6049r6050
22//
33//  output.h - Win32 implementation of MAME output routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WINDOWS_OUTPUT_H__
src/osd/windows/wintime.c
r6049r6050
22//
33//  wintime.c - Win32 OSD core timing functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/drawnone.c
r6049r6050
22//
33//  drawnone.c - stub "nothing" drawer
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/windows.mak
r6049r6050
44#
55#   Windows-specific makefile
66#
7#   Copyright Nicola Salmoria and the MAME Team.
8#   Visit http://mamedev.org for licensing and usage restrictions.
7###########################################################################
98#
9#   Copyright Aaron Giles
10#   All rights reserved.
11#
12#   Redistribution and use in source and binary forms, with or without
13#   modification, are permitted provided that the following conditions are
14#   met:
15#
16#       * Redistributions of source code must retain the above copyright
17#         notice, this list of conditions and the following disclaimer.
18#       * Redistributions in binary form must reproduce the above copyright
19#         notice, this list of conditions and the following disclaimer in
20#         the documentation and/or other materials provided with the
21#         distribution.
22#       * Neither the name 'MAME' nor the names of its contributors may be
23#         used to endorse or promote products derived from this software
24#         without specific prior written permission.
25#
26#   THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27#   IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28#   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29#   DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30#   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31#   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32#   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33#   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34#   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35#   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36#   POSSIBILITY OF SUCH DAMAGE.
37#
1038###########################################################################
1139
1240
src/osd/windows/winprefix.h
r6049r6050
22//
33//  winprefix.h - Win32 prefix file, included by ALL files
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#define _WIN32_WINNT 0x0501
src/osd/windows/drawgdi.c
r6049r6050
22//
33//  drawgdi.c - Win32 GDI drawing
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/d3d8intf.c
r6049r6050
22//
33//  d3d8intf.c - Direct3D 8.1 abstraction layer
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/d3d9intf.c
r6049r6050
22//
33//  d3d9intf.c - Direct3D 9 abstraction layer
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/sound.c
r6049r6050
22//
33//  sound.c - Win32 implementation of MAME sound routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/winsync.c
r6049r6050
22//
33//  winsync.c - Win32 OSD core synchronization functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
r6049r6050
169201{
170202   return InterlockedExchangeAdd((LONG *) ptr, delta) + delta;
171203}
172
src/osd/windows/eivc.h
r6049r6050
44//
55//  Inline implementations for MSVC compiler.
66//
7//  Copyright Nicola Salmoria and the MAME Team.
8//  Visit http://mamedev.org for licensing and usage restrictions.
7//============================================================
98//
9//  Copyright Aaron Giles
10//  All rights reserved.
11//
12//  Redistribution and use in source and binary forms, with or
13//  without modification, are permitted provided that the
14//  following conditions are met:
15//
16//    * Redistributions of source code must retain the above
17//      copyright notice, this list of conditions and the
18//      following disclaimer.
19//    * Redistributions in binary form must reproduce the
20//      above copyright notice, this list of conditions and
21//      the following disclaimer in the documentation and/or
22//      other materials provided with the distribution.
23//    * Neither the name 'MAME' nor the names of its
24//      contributors may be used to endorse or promote
25//      products derived from this software without specific
26//      prior written permission.
27//
28//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
29//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
32//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
33//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
37//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
40//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41//
1042//============================================================
1143
1244#ifndef __EIVC__
src/osd/windows/vconv.c
r6049r6050
22//
33//  vconv.c - VC++ parameter conversion code
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#define WIN32_LEAN_AND_MEAN
src/osd/windows/windir.c
r6049r6050
1/***************************************************************************
1//============================================================
2//
3//  windir.c - Win32 OSD core directory access functions
4//
5//============================================================
6//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
40//============================================================
241
3    windir.c - Win32 OSD core directory access functions
4
5    Copyright Nicola Salmoria and the MAME Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8***************************************************************************/
9
1042// standard windows headers
1143#define WIN32_LEAN_AND_MEAN
1244#include <windows.h>
src/osd/windows/winfile.c
r6049r6050
22//
33//  winfile.c - Win32 OSD core file access functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/sound.h
r6049r6050
22//
33//  sound.h - Win32 implementation of MAME sound routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WIN_SOUND__
src/osd/windows/input.c
r6049r6050
22//
33//  input.c - Win32 implementation of MAME input routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// For testing purposes: force DirectInput
src/osd/windows/winwork.c
r6049r6050
22//
33//  winwork.c - Win32 OSD core work item functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/eivcx86.h
r6049r6050
44//
55//  x86 inline implementations for MSVC compiler.
66//
7//  Copyright Nicola Salmoria and the MAME Team.
8//  Visit http://mamedev.org for licensing and usage restrictions.
7//============================================================
98//
9//  Copyright Aaron Giles
10//  All rights reserved.
11//
12//  Redistribution and use in source and binary forms, with or
13//  without modification, are permitted provided that the
14//  following conditions are met:
15//
16//    * Redistributions of source code must retain the above
17//      copyright notice, this list of conditions and the
18//      following disclaimer.
19//    * Redistributions in binary form must reproduce the
20//      above copyright notice, this list of conditions and
21//      the following disclaimer in the documentation and/or
22//      other materials provided with the distribution.
23//    * Neither the name 'MAME' nor the names of its
24//      contributors may be used to endorse or promote
25//      products derived from this software without specific
26//      prior written permission.
27//
28//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
29//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
32//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
33//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
37//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
40//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41//
1042//============================================================
1143
1244#ifndef __EIVCX86__
src/osd/windows/mame.rc
r6049r6050
1//============================================================
12//
23//   mame.rc - Minimal resource file for Win32 MAME
34//
4//  Copyright Nicola Salmoria and the MAME Team.
5//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
66//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//     * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//     * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
40//============================================================
741
842#define NOWINRES
943#include "windows.h"
src/osd/windows/winmain.c
r6049r6050
22//
33//  winmain.c - Win32 main program
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/ledutil.c
r6049r6050
33//  ledutil.c - Win32 example code that tracks changing
44//  outputs and updates the keyboard LEDs in response
55//
6//  Copyright Nicola Salmoria and the MAME Team.
7//  Visit http://mamedev.org for licensing and usage restrictions.
6//============================================================
87//
8//  Copyright Aaron Giles
9//  All rights reserved.
10//
11//  Redistribution and use in source and binary forms, with or
12//  without modification, are permitted provided that the
13//  following conditions are met:
14//
15//    * Redistributions of source code must retain the above
16//      copyright notice, this list of conditions and the
17//      following disclaimer.
18//    * Redistributions in binary form must reproduce the
19//      above copyright notice, this list of conditions and
20//      the following disclaimer in the documentation and/or
21//      other materials provided with the distribution.
22//    * Neither the name 'MAME' nor the names of its
23//      contributors may be used to endorse or promote
24//      products derived from this software without specific
25//      prior written permission.
26//
27//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
28//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
30//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
31//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
32//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
35//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
36//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
39//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40//
941//============================================================
1042//
1143//  This is sample code. To use it as a starting point, you
src/osd/windows/winutf8.c
r6049r6050
22//
33//  winutf8.c - Win32 OSD core utility functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/input.h
r6049r6050
22//
33//  input.h - Win32 implementation of MAME input routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __INPUT_H
src/osd/windows/debugwin.c
r6049r6050
22//
33//  debugwin.c - Win32 debug window handling
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/drawdd.c
r6049r6050
22//
33//  drawdd.c - Win32 DirectDraw implementation
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/video.c
r6049r6050
22//
33//  video.c - Win32 video handling
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/window.c
r6049r6050
22//
33//  window.c - Win32 window handling
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#define LOG_THREADS         0
src/osd/windows/winmain.h
r6049r6050
22//
33//  winmain.h - Win32 main program and core headers
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042
src/osd/windows/winalloc.c
r6049r6050
22//
33//  winalloc.c - Win32 memory allocation routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/debugwin.h
r6049r6050
22//
33//  debugwin.h - Win32 debug window handling
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WIN_DEBUGWIN__
src/osd/windows/winmisc.c
r6049r6050
22//
33//  winmisc.c - Win32 OSD core miscellaneous functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/osd/windows/winutf8.h
r6049r6050
22//
33//  winutf8.h - Win32 UTF-8 wrappers
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WINUTF8__
src/osd/windows/video.h
r6049r6050
22//
33//  video.h - Win32 implementation of MAME video routines
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WIN_VIDEO__
src/osd/windows/window.h
r6049r6050
22//
33//  window.h - Win32 window handling
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042#ifndef __WIN_WINDOW__
src/osd/windows/osinline.h
r6049r6050
44//
55//  Inline implementations for non-GCC Win32 compilers
66//
7//  Copyright Nicola Salmoria and the MAME Team.
8//  Visit http://mamedev.org for licensing and usage restrictions.
7//============================================================
98//
9//  Copyright Aaron Giles
10//  All rights reserved.
11//
12//  Redistribution and use in source and binary forms, with or
13//  without modification, are permitted provided that the
14//  following conditions are met:
15//
16//    * Redistributions of source code must retain the above
17//      copyright notice, this list of conditions and the
18//      following disclaimer.
19//    * Redistributions in binary form must reproduce the
20//      above copyright notice, this list of conditions and
21//      the following disclaimer in the documentation and/or
22//      other materials provided with the distribution.
23//    * Neither the name 'MAME' nor the names of its
24//      contributors may be used to endorse or promote
25//      products derived from this software without specific
26//      prior written permission.
27//
28//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
29//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
32//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
33//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
37//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
40//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41//
1042//============================================================
1143
1244#ifndef __OSINLINE__
src/osd/windows/drawd3d.c
r6049r6050
22//
33//  drawd3d.c - Win32 Direct3D implementation
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// Useful info:
src/osd/windows/winutil.c
r6049r6050
22//
33//  winutil.c - Win32 OSD core utility functions
44//
5//  Copyright Nicola Salmoria and the MAME Team.
6//  Visit http://mamedev.org for licensing and usage restrictions.
5//============================================================
76//
7//  Copyright Aaron Giles
8//  All rights reserved.
9//
10//  Redistribution and use in source and binary forms, with or
11//  without modification, are permitted provided that the
12//  following conditions are met:
13//
14//    * Redistributions of source code must retain the above
15//      copyright notice, this list of conditions and the
16//      following disclaimer.
17//    * Redistributions in binary form must reproduce the
18//      above copyright notice, this list of conditions and
19//      the following disclaimer in the documentation and/or
20//      other materials provided with the distribution.
21//    * Neither the name 'MAME' nor the names of its
22//      contributors may be used to endorse or promote
23//      products derived from this software without specific
24//      prior written permission.
25//
26//  THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27//  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29//  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30//  EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31//  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32//  DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33//  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34//  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35//  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36//  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37//  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38//  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39//
840//============================================================
941
1042// standard windows headers
src/emu/debug/debugcpu.c
r6049r6050
369369
370370int debug_cpu_translate(const address_space *space, int intention, offs_t *address)
371371{
372   cpu_debug_data *info = cpu_get_debug_data(space->cpu);
373   if (info->translate != NULL)
374      return (*info->translate)(space->cpu, space->spacenum, intention, address);
375   else
376      return TRUE;
372   if (space->cpu != NULL && space->cpu->type == CPU)
373   {
374      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
375      if (info->translate != NULL)
376         return (*info->translate)(space->cpu, space->spacenum, intention, address);
377   }
378   return TRUE;
377379}
378380
379381
r6049r6050
13341336
13351337UINT8 debug_read_byte(const address_space *space, offs_t address, int apply_translation)
13361338{
1339   cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
13371340   debugcpu_private *global = space->machine->debugcpu_data;
1338   cpu_debug_data *info = cpu_get_debug_data(space->cpu);
13391341   UINT64 custom;
13401342   UINT8 result;
13411343
r6049r6050
13501352      result = 0xff;
13511353
13521354   /* if there is a custom read handler, and it returns TRUE, use that value */
1353   else if (info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 1, &custom))
1355   else if (info != NULL && info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 1, &custom))
13541356      result = custom;
13551357
13561358   /* otherwise, call the byte reading function for the translated address */
r6049r6050
13921394   /* otherwise, this proceeds like the byte case */
13931395   else
13941396   {
1395      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1397      cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
13961398      UINT64 custom;
13971399
13981400      /* all accesses from this point on are for the debugger */
r6049r6050
14031405         result = 0xffff;
14041406
14051407      /* if there is a custom read handler, and it returns TRUE, use that value */
1406      else if (info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 2, &custom))
1408      else if (info != NULL && info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 2, &custom))
14071409         result = custom;
14081410
14091411      /* otherwise, call the byte reading function for the translated address */
r6049r6050
14471449   /* otherwise, this proceeds like the byte case */
14481450   else
14491451   {
1450      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1452      cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
14511453      UINT64 custom;
14521454
14531455      /* all accesses from this point on are for the debugger */
r6049r6050
14581460         result = 0xffffffff;
14591461
14601462      /* if there is a custom read handler, and it returns TRUE, use that value */
1461      else if (info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 4, &custom))
1463      else if (info != NULL && info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 4, &custom))
14621464         result = custom;
14631465
14641466      /* otherwise, call the byte reading function for the translated address */
r6049r6050
15021504   /* otherwise, this proceeds like the byte case */
15031505   else
15041506   {
1505      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1507      cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
15061508      UINT64 custom;
15071509
15081510      /* all accesses from this point on are for the debugger */
r6049r6050
15131515         result = ~(UINT64)0;
15141516
15151517      /* if there is a custom read handler, and it returns TRUE, use that value */
1516      else if (info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 8, &custom))
1518      else if (info != NULL && info->read != NULL && (*info->read)(space->cpu, space->spacenum, address, 8, &custom))
15171519         result = custom;
15181520
15191521      /* otherwise, call the byte reading function for the translated address */
r6049r6050
15541556
15551557void debug_write_byte(const address_space *space, offs_t address, UINT8 data, int apply_translation)
15561558{
1559   cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
15571560   debugcpu_private *global = space->machine->debugcpu_data;
1558   cpu_debug_data *info = cpu_get_debug_data(space->cpu);
15591561
15601562   /* mask against the logical byte mask */
15611563   address &= space->logbytemask;
r6049r6050
15681570      ;
15691571
15701572   /* if there is a custom write handler, and it returns TRUE, use that */
1571   else if (info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 1, data))
1573   else if (info != NULL && info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 1, data))
15721574      ;
15731575
15741576   /* otherwise, call the byte reading function for the translated address */
r6049r6050
16111613   /* otherwise, this proceeds like the byte case */
16121614   else
16131615   {
1614      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1616      cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
16151617
16161618      /* all accesses from this point on are for the debugger */
16171619      memory_set_debugger_access(space, global->debugger_access = TRUE);
r6049r6050
16211623         ;
16221624
16231625      /* if there is a custom write handler, and it returns TRUE, use that */
1624      else if (info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 2, data))
1626      else if (info != NULL && info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 2, data))
16251627         ;
16261628
16271629      /* otherwise, call the byte reading function for the translated address */
r6049r6050
16651667   /* otherwise, this proceeds like the byte case */
16661668   else
16671669   {
1668      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1670      cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
16691671
16701672      /* all accesses from this point on are for the debugger */
16711673      memory_set_debugger_access(space, global->debugger_access = TRUE);
r6049r6050
16751677         ;
16761678
16771679      /* if there is a custom write handler, and it returns TRUE, use that */
1678      else if (info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 4, data))
1680      else if (info != NULL && info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 4, data))
16791681         ;
16801682
16811683      /* otherwise, call the byte reading function for the translated address */
r6049r6050
17191721   /* otherwise, this proceeds like the byte case */
17201722   else
17211723   {
1722      cpu_debug_data *info = cpu_get_debug_data(space->cpu);
1724      cpu_debug_data *info = (space->cpu->type == CPU) ? cpu_get_debug_data(space->cpu) : NULL;
17231725
17241726      /* all accesses from this point on are for the debugger */
17251727      memory_set_debugger_access(space, global->debugger_access = TRUE);
r6049r6050
17291731         ;
17301732
17311733      /* if there is a custom write handler, and it returns TRUE, use that */
1732      else if (info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 8, data))
1734      else if (info != NULL && info->write != NULL && (*info->write)(space->cpu, space->spacenum, address, 8, data))
17331735         ;
17341736
17351737      /* otherwise, call the byte reading function for the translated address */
src/emu/debug/debugvw.c
r6049r6050
23922392   astring *tempstring = astring_alloc();
23932393   memory_subview_item *head = NULL;
23942394   memory_subview_item **tailptr = &head;
2395   const device_config *cpu;
2395   const device_config *device;
23962396   int spacenum;
23972397   const char *rgntag;
23982398   int curindex = 0;
23992399   int itemnum;
24002400
2401   /* first add all the CPUs' address spaces */
2402   for (cpu = machine->firstcpu; cpu != NULL; cpu = cpu_next(cpu))
2401   /* first add all the device's address spaces */
2402   for (device = machine->config->devicelist; device != NULL; device = device->next)
24032403      for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
24042404      {
2405         const address_space *space = cpu_get_address_space(cpu, spacenum);
2405         const address_space *space = memory_find_address_space(device, spacenum);
24062406         if (space != NULL)
24072407         {
24082408            memory_subview_item *subview;
24092409
24102410            /* determine the string and allocate a subview large enough */
2411            astring_printf(tempstring, "CPU '%s' (%s) %s memory", cpu->tag, cpu_get_name(cpu), space->name);
2411            if (device->type == CPU)
2412               astring_printf(tempstring, "CPU '%s' (%s) %s memory", device->tag, device_get_name(device), space->name);
2413            else
2414               astring_printf(tempstring, "%s '%s' space #%d memory", device_get_name(device), device->tag, spacenum);
24122415            subview = (memory_subview_item *)auto_alloc_array_clear(machine, UINT8, sizeof(*subview) + astring_len(tempstring));
24132416
24142417            /* populate the subview */
r6049r6050
28862889   int recompute = view->recompute;
28872890
28882891   /* handle expression changes */
2889   if (debug_view_expression_changed_value(view, &memdata->expression, (space != NULL) ? space->cpu : NULL))
2892   if (debug_view_expression_changed_value(view, &memdata->expression, (space != NULL && space->cpu != NULL && space->cpu->type == CPU) ? space->cpu : NULL))
28902893   {
28912894      recompute = TRUE;
28922895      view->topleft.y = (memdata->expression.result - memdata->byte_offset) / memdata->bytes_per_row;
src/emu/debug/textbuf.h
r6049r6050
1212#ifndef __TEXTBUF_H__
1313#define __TEXTBUF_H__
1414
15#include "osd_cpu.h"
1615
17
1816/***************************************************************************
1917    TYPE DEFINITIONS
2018***************************************************************************/
src/emu/cpu/m68000/m68kmmu.h
r6049r6050
88*/
99
1010/*
11   pmmu_translate_addr: perform 68851/68030-style PMMU address translation
11    pmmu_translate_addr: perform 68851/68030-style PMMU address translation
1212*/
1313INLINE UINT32 pmmu_translate_addr(m68ki_cpu_core *m68k, UINT32 addr_in)
1414{
15   UINT32 addr_out, tbl_entry, tbl_entry2, tamode, tbmode;
15   UINT32 addr_out, tbl_entry = 0, tbl_entry2, tamode = 0, tbmode = 0;
1616   UINT32 root_aptr, root_limit, tofs, is, abits, bbits, cbits;
1717   UINT32 resolved, tptr, shift;
1818
r6049r6050
3737   bbits = (m68k->mmu_tc>>8)&0xf;
3838   cbits = (m68k->mmu_tc>>4)&0xf;
3939
40//   logerror("PMMU: tcr %08x limit %08x aptr %08x is %x abits %d bbits %d cbits %d\n", m68k->mmu_tc, root_limit, root_aptr, is, abits, bbits, cbits);
40//  logerror("PMMU: tcr %08x limit %08x aptr %08x is %x abits %d bbits %d cbits %d\n", m68k->mmu_tc, root_limit, root_aptr, is, abits, bbits, cbits);
4141
4242   // get table A offset
4343   tofs = (addr_in<<is)>>(32-abits);
44   
45   // find out what format table A is   
44
45   // find out what format table A is
4646   switch (root_limit & 3)
4747   {
4848      case 0:   // invalid, should cause MMU exception
r6049r6050
5252
5353      case 2:   // valid 4 byte descriptors
5454         tofs *= 4;
55//         logerror("PMMU: reading table A entry at %08x\n", tofs + (root_aptr & 0xfffffffc));
55//          logerror("PMMU: reading table A entry at %08x\n", tofs + (root_aptr & 0xfffffffc));
5656         tbl_entry = memory_read_dword_32be(m68k->program, tofs + (root_aptr & 0xfffffffc));
5757         tamode = tbl_entry & 3;
58//         logerror("PMMU: addr %08x entry %08x mode %x tofs %x\n", addr_in, tbl_entry, tamode, tofs);
58//          logerror("PMMU: addr %08x entry %08x mode %x tofs %x\n", addr_in, tbl_entry, tamode, tofs);
5959         break;
6060
6161      case 3: // valid 8 byte descriptors
6262         tofs *= 8;
63//         logerror("PMMU: reading table A entries at %08x\n", tofs + (root_aptr & 0xfffffffc));
63//          logerror("PMMU: reading table A entries at %08x\n", tofs + (root_aptr & 0xfffffffc));
6464         tbl_entry2 = memory_read_dword_32be(m68k->program, tofs + (root_aptr & 0xfffffffc));
6565         tbl_entry = memory_read_dword_32be(m68k->program, tofs + (root_aptr & 0xfffffffc)+4);
6666         tamode = tbl_entry2 & 3;
67//         logerror("PMMU: addr %08x entry %08x entry2 %08x mode %x tofs %x\n", addr_in, tbl_entry, tbl_entry2, tamode, tofs);
67//          logerror("PMMU: addr %08x entry %08x entry2 %08x mode %x tofs %x\n", addr_in, tbl_entry, tbl_entry2, tamode, tofs);
6868         break;
6969   }
7070
r6049r6050
7878      case 0: // invalid, should cause MMU exception
7979         fatalerror("680x0 PMMU: Unhandled Table A mode %d (addr_in %08x)\n", tamode, addr_in);
8080         break;
81     
81
8282      case 2: // 4-byte table B descriptor
8383         tofs *= 4;
84//         logerror("PMMU: reading table B entry at %08x\n", tofs + tptr);
84//          logerror("PMMU: reading table B entry at %08x\n", tofs + tptr);
8585         tbl_entry = memory_read_dword_32be(m68k->program, tofs + tptr);
8686         tbmode = tbl_entry & 3;
87//         logerror("PMMU: addr %08x entry %08x mode %x tofs %x\n", addr_in, tbl_entry, tbmode, tofs);
87//          logerror("PMMU: addr %08x entry %08x mode %x tofs %x\n", addr_in, tbl_entry, tbmode, tofs);
8888         break;
8989
9090      case 3: // 8-byte table B descriptor
9191         tofs *= 8;
92//         logerror("PMMU: reading table B entries at %08x\n", tofs + tptr);
92//          logerror("PMMU: reading table B entries at %08x\n", tofs + tptr);
9393         tbl_entry2 = memory_read_dword_32be(m68k->program, tofs + tptr);
9494         tbl_entry = memory_read_dword_32be(m68k->program, tofs + tptr + 4);
9595         tbmode = tbl_entry2 & 3;
96//         logerror("PMMU: addr %08x entry %08x entry2 %08x mode %x tofs %x\n", addr_in, tbl_entry, tbl_entry2, tbmode, tofs);
96//          logerror("PMMU: addr %08x entry %08x entry2 %08x mode %x tofs %x\n", addr_in, tbl_entry, tbl_entry2, tbmode, tofs);
9797         break;
9898
9999      case 1:   // early termination descriptor
r6049r6050
126126      }
127127   }
128128
129//   if ((addr_in < 0x40000000) || (addr_in > 0x4fffffff)) printf("PMMU: [%08x] => [%08x]\n", addr_in, addr_out);
129//  if ((addr_in < 0x40000000) || (addr_in > 0x4fffffff)) printf("PMMU: [%08x] => [%08x]\n", addr_in, addr_out);
130130
131131   return addr_out;
132132}
r6049r6050
144144tblA @ 043ffcc0:
145145
146146043ffcc0 0001fc0a 043ffcb0  =>  00000019 04000019
147043ffcc8 7ffffc18 00000000     
148043ffcd0 7ffffc18 00000000     
149043ffcd8 7ffffc18 00000000     
150043ffce0 7ffffc18 00000000     
151043ffce8 7ffffc18 00000000     
152043ffcf0 7ffffc18 00000000     
153043ffcf8 7ffffc18 00000000     
147043ffcc8 7ffffc18 00000000
148043ffcd0 7ffffc18 00000000
149043ffcd8 7ffffc18 00000000
150043ffce0 7ffffc18 00000000
151043ffce8 7ffffc18 00000000
152043ffcf0 7ffffc18 00000000
153043ffcf8 7ffffc18 00000000
154154043ffd00 7ffffc19 40000000
155155043ffd08 7ffffc19 48000000
156156043ffd10 7ffffc59 50000000
src/emu/cpu/m68000/m68k_in.c
r6049r6050
80148014   {
80158015      modes = m68ki_read_imm_16(m68k);
80168016      ea = M68KMAKE_GET_EA_AY_32;
8017     
8017
80188018      if ((modes & 0xfde0) == 0x2000)   // PLOAD
80198019      {
80208020         logerror("680x0: unhandled PLOAD\n");
src/emu/cpu/m68000/m68kcpu.c
r6049r6050
10871087static UINT8 read_byte_32_mmu(const address_space *space, offs_t address)
10881088{
10891089   m68ki_cpu_core *m68k = get_safe_token(space->cpu);
1090   
1090
10911091   if (m68k->pmmu_enabled)
10921092   {
10931093      address = pmmu_translate_addr(m68k, address);
r6049r6050
10991099static void write_byte_32_mmu(const address_space *space, offs_t address, UINT8 data)
11001100{
11011101   m68ki_cpu_core *m68k = get_safe_token(space->cpu);
1102   
1102
11031103   if (m68k->pmmu_enabled)
11041104   {
11051105      address = pmmu_translate_addr(m68k, address);
r6049r6050
11111111static UINT16 read_immediate_16_mmu(const address_space *space, offs_t address)
11121112{
11131113   m68ki_cpu_core *m68k = get_safe_token(space->cpu);
1114   
1114
11151115   if (m68k->pmmu_enabled)
11161116   {
11171117      address = pmmu_translate_addr(m68k, address);
src/emu/cpu/tms34010/34010ops.c
r6049r6050
516516      else                                    \
517517      {                                       \
518518         INT32 *rd2 = &R##REG(tms,DSTREG(op)+1);               \
519         INT64 dividend  = COMBINE_64_32_32(*rd1, *rd2); \
520         INT64 quotient  = DIV_64_64_32(dividend, *rs);    \
521         INT32 remainder = MOD_32_64_32(dividend, *rs);    \
519         INT64 dividend = ((UINT64)*rd1 << 32) | (UINT32)*rd2; \
520         INT64 quotient = dividend / *rs;            \
521         INT32 remainder = dividend % *rs;            \
522522         UINT32 signbits = (INT32)quotient >> 31;       \
523         if (HI32_32_64(quotient) != signbits)         \
523         if (EXTRACT_64HI(quotient) != signbits)         \
524524         {                                    \
525525            SET_V_LOG(tms, 1);                        \
526526         }                                    \
r6049r6050
564564      else                                    \
565565      {                                       \
566566         INT32 *rd2 = &R##REG(tms,DSTREG(op)+1);               \
567         UINT64 dividend  = COMBINE_U64_U32_U32(*rd1, *rd2);   \
568         UINT64 quotient  = DIV_U64_U64_U32(dividend, *rs);   \
569         UINT32 remainder = MOD_U32_U64_U32(dividend, *rs);    \
570         if (HI32_U32_U64(quotient) != 0)            \
567         UINT64 dividend  = ((UINT64)*rd1 << 32) | (UINT32)*rd2;   \
568         UINT64 quotient  = dividend / (UINT32)*rs;      \
569         UINT32 remainder = dividend % (UINT32)*rs;       \
570         if (EXTRACT_64HI(quotient) != 0)            \
571571         {                                    \
572572            SET_V_LOG(tms, 1);                        \
573573         }                                    \
r6049r6050
730730                                                \
731731   SEXTEND(m1, FW(tms,1));                                 \
732732   CLR_NZ(tms);                                          \
733   product = MUL_64_32_32(m1, *rd1);                     \
733   product = mul_32x32(m1, *rd1);                     \
734734   SET_Z_LOG(tms, product == 0);                           \
735735   SET_N_BIT(tms, product >> 32, 31);                        \
736736                                                \
737   *rd1             = HI32_32_64(product);                  \
738   R##REG(tms,DSTREG(op)|1) = LO32_32_64(product);                  \
737   *rd1             = EXTRACT_64HI(product);                  \
738   R##REG(tms,DSTREG(op)|1) = EXTRACT_64LO(product);                  \
739739                                                \
740740   COUNT_CYCLES(tms,20);                                 \
741741}
r6049r6050
750750                                                \
751751   ZEXTEND(m1, FW(tms,1));                                 \
752752   CLR_Z(tms);                                          \
753   product = MUL_U64_U32_U32(m1, *rd1);                  \
753   product = mulu_32x32(m1, *rd1);                  \
754754   SET_Z_LOG(tms, product == 0);                           \
755755                                                \
756   *rd1             = HI32_32_64(product);                  \
757   R##REG(tms,DSTREG(op)|1) = LO32_32_64(product);                  \
756   *rd1             = EXTRACT_64HI(product);                  \
757   R##REG(tms,DSTREG(op)|1) = EXTRACT_64LO(product);                  \
758758                                                \
759759   COUNT_CYCLES(tms,21);                                 \
760760}
src/emu/cpu/tms34010/tms34010.c
r6049r6050
88***************************************************************************/
99
1010#include "debugger.h"
11#include "osd_cpu.h"
1211#include "tms34010.h"
1312
1413
src/emu/cpu/tms57002/tms57002.h
r6049r6050
44#define __TMS57002_H__
55
66#include "cpuintrf.h"
7#include "osd_cpu.h"
87#include "driver.h"
98
109enum {
src/emu/cpu/minx/minx.h
r6049r6050
55
66
77#include "cpuintrf.h"
8#include "osd_cpu.h"
98#include "driver.h"
109
1110enum
src/emu/cpu/e132xs/e132xs.c
r6049r6050
215215#include "cpuexec.h"
216216#include "eminline.h"
217217#include "e132xs.h"
218#include "osd_cpu.h"
219218
220219#ifdef MAME_DEBUG
221220#define DEBUG_PRINTF(x) do { mame_printf_debug x; } while (0)
r6049r6050
17931792      SET_DREG(SREG);
17941793      SET_DREGF(SREGF);
17951794
1796      tmp = COMBINE_U64_U32_U32(SREG, SREGF);
1795      tmp = CONCAT_64(SREG, SREGF);
17971796      SET_Z( tmp == 0 ? 1 : 0 );
17981797      SET_N( SIGN_BIT(SREG) );
17991798
r6049r6050
18171816      {
18181817         UINT64 dividend;
18191818
1820         dividend = COMBINE_U64_U32_U32(DREG, DREGF);
1819         dividend = CONCAT_64(DREG, DREGF);
18211820
18221821         if( SREG == 0 )
18231822         {
r6049r6050
18661865      {
18671866         INT64 dividend;
18681867
1869         dividend = (INT64) COMBINE_64_32_32(DREG, DREGF);
1868         dividend = (INT64) CONCAT_64(DREG, DREGF);
18701869
18711870         if( SREG == 0 || (DREG & 0x80000000) )
18721871         {
r6049r6050
25352534   high_order = DREG;
25362535   low_order  = DREGF;
25372536
2538   val = COMBINE_U64_U32_U32(high_order, low_order);
2537   val = CONCAT_64(high_order, low_order);
25392538
25402539   if( N_VALUE )
25412540      SET_C((val >> (N_VALUE - 1)) & 1);
r6049r6050
25442543
25452544   val >>= N_VALUE;
25462545
2547   high_order = HI32_32_64(val);
2548   low_order  = LO32_32_64(val);
2546   high_order = EXTRACT_64HI(val);
2547   low_order  = EXTRACT_64LO(val);
25492548
25502549   SET_DREG(high_order);
25512550   SET_DREGF(low_order);
r6049r6050
25712570      high_order = DREG;
25722571      low_order  = DREGF;
25732572
2574      val = COMBINE_U64_U32_U32(high_order, low_order);
2573      val = CONCAT_64(high_order, low_order);
25752574
25762575      if( n )
25772576         SET_C((val >> (n - 1)) & 1);
r6049r6050
25802579
25812580      val >>= n;
25822581
2583      high_order = HI32_32_64(val);
2584      low_order  = LO32_32_64(val);
2582      high_order = EXTRACT_64HI(val);
2583      low_order  = EXTRACT_64LO(val);
25852584
25862585      SET_DREG(high_order);
25872586      SET_DREGF(low_order);
r6049r6050
26242623   high_order = DREG;
26252624   low_order  = DREGF;
26262625
2627   val = COMBINE_64_32_32(high_order, low_order);
2626   val = CONCAT_64(high_order, low_order);
26282627
26292628   if( N_VALUE )
26302629      SET_C((val >> (N_VALUE - 1)) & 1);
r6049r6050
26732672      high_order = DREG;
26742673      low_order  = DREGF;
26752674
2676      val = COMBINE_64_32_32(high_order, low_order);
2675      val = CONCAT_64(high_order, low_order);
26772676
26782677      if( n )
26792678         SET_C((val >> (n - 1)) & 1);
r6049r6050
27452744   high_order = DREG;
27462745   low_order  = DREGF;
27472746
2748   val  = COMBINE_U64_U32_U32(high_order, low_order);
2747   val  = CONCAT_64(high_order, low_order);
27492748   SET_C( (N_VALUE)?(((val<<(N_VALUE-1))&U64(0x8000000000000000))?1:0):0);
27502749   mask = ((((UINT64)1) << (32 - N_VALUE)) - 1) ^ 0xffffffff;
27512750   tmp  = high_order << N_VALUE;
r6049r6050
27582757
27592758   val <<= N_VALUE;
27602759
2761   high_order = HI32_32_64(val);
2762   low_order  = LO32_32_64(val);
2760   high_order = EXTRACT_64HI(val);
2761   low_order  = EXTRACT_64LO(val);
27632762
27642763   SET_DREG(high_order);
27652764   SET_DREGF(low_order);
r6049r6050
27892788
27902789      mask = ((((UINT64)1) << (32 - n)) - 1) ^ 0xffffffff;
27912790
2792      val = COMBINE_U64_U32_U32(high_order, low_order);
2791      val = CONCAT_64(high_order, low_order);
27932792      SET_C( (n)?(((val<<(n-1))&U64(0x8000000000000000))?1:0):0);
27942793      tmp = high_order << n;
27952794
r6049r6050
28012800
28022801      val <<= n;
28032802
2804      high_order = HI32_32_64(val);
2805      low_order  = LO32_32_64(val);
2803      high_order = EXTRACT_64HI(val);
2804      low_order  = EXTRACT_64LO(val);
28062805
28072806      SET_DREG(high_order);
28082807      SET_DREGF(low_order);
r6049r6050
40554054      {
40564055         INT64 result;
40574056
4058         result = (INT64)COMBINE_64_32_32(GET_G_REG(14), GET_G_REG(15)) + (INT64)((INT64)(INT32)(vals) * (INT64)(INT32)(vald));
4057         result = (INT64)CONCAT_64(GET_G_REG(14), GET_G_REG(15)) + (INT64)((INT64)(INT32)(vals) * (INT64)(INT32)(vald));
40594058
40604059         vals = result >> 32;
40614060         vald = result & 0xffffffff;
r6049r6050
40794078      {
40804079         INT64 result;
40814080
4082         result = (INT64)COMBINE_64_32_32(GET_G_REG(14), GET_G_REG(15)) - (INT64)((INT64)(INT32)(vals) * (INT64)(INT32)(vald));
4081         result = (INT64)CONCAT_64(GET_G_REG(14), GET_G_REG(15)) - (INT64)((INT64)(INT32)(vals) * (INT64)(INT32)(vald));
40834082
40844083         vals = result >> 32;
40854084         vald = result & 0xffffffff;
r6049r6050
41034102      {
41044103         INT64 result;
41054104
4106         result = (INT64)COMBINE_64_32_32(GET_G_REG(14), GET_G_REG(15)) + (INT64)((INT64)(INT32)((vald & 0xffff0000) >> 16) * (INT64)(INT32)((vals & 0xffff0000) >> 16)) + ((INT64)(INT32)(vald & 0xffff) * (INT64)(INT32)(vals & 0xffff));
4105         result = (INT64)CONCAT_64(GET_G_REG(14), GET_G_REG(15)) + (INT64)((INT64)(INT32)((vald & 0xffff0000) >> 16) * (INT64)(INT32)((vals & 0xffff0000) >> 16)) + ((INT64)(INT32)(vald & 0xffff) * (INT64)(INT32)(vals & 0xffff));
41074106
41084107         vals = result >> 32;
41094108         vald = result & 0xffffffff;
src/emu/cpu/z8000/z8000.c
r6049r6050
4545
4646#include "debugger.h"
4747#include "z8000.h"
48#include "osd_cpu.h"
4948
5049#define VERBOSE 0
5150
src/emu/cpu/z8000/z8000ops.c
r6049r6050
53005300static void ZB1_dddd_0111(z8000_state *cpustate)
53015301{
53025302   GET_DST(OP0,NIB2);
5303   cpustate->RQ(dst) = COMBINE_U64_U32_U32((cpustate->RQ(dst) & S32) ?
5304      0xfffffffful : 0, LO32_U32_U64(cpustate->RQ(dst)));
5303   cpustate->RQ(dst) = CONCAT_64((cpustate->RQ(dst) & S32) ?
5304      0xfffffffful : 0, EXTRACT_64LO(cpustate->RQ(dst)));
53055305}
53065306
53075307/******************************************
src/emu/cpu/mips/psx.c
r6049r6050
6464 */
6565
6666#include "debugger.h"
67#include "osd_cpu.h"
6867#include "psx.h"
6968
7069#define LOG_BIOSCALL ( 0 )
r6049r6050
11461145   {
11471146   case MULTIPLIER_OPERATION_MULT:
11481147      {
1149         INT64 result = MUL_64_32_32( (INT32)psxcpu->multiplier_operand1, (INT32)psxcpu->multiplier_operand2 );
1150         psxcpu->lo = LO32_32_64( result );
1151         psxcpu->hi = HI32_32_64( result );
1148         INT64 result = mul_32x32( (INT32)psxcpu->multiplier_operand1, (INT32)psxcpu->multiplier_operand2 );
1149         psxcpu->lo = EXTRACT_64LO( result );
1150         psxcpu->hi = EXTRACT_64HI( result );
11521151      }
11531152      break;
11541153
11551154   case MULTIPLIER_OPERATION_MULTU:
11561155      {
1157         UINT64 result = MUL_U64_U32_U32( psxcpu->multiplier_operand1, psxcpu->multiplier_operand2 );
1158         psxcpu->lo = LO32_U32_U64( result );
1159         psxcpu->hi = HI32_U32_U64( result );
1156         UINT64 result = mulu_32x32( psxcpu->multiplier_operand1, psxcpu->multiplier_operand2 );
1157         psxcpu->lo = EXTRACT_64LO( result );
1158         psxcpu->hi = EXTRACT_64HI( result );
11601159      }
11611160      break;
11621161
src/emu/cpu/tms32025/tms32025.c
r6049r6050
147147   UINT16   STR0, STR1;
148148   UINT8   IFR;
149149   UINT8   RPTC;
150   PAIR   ACC;      /* PAIR defined in os/osd_cpu.h */
150   PAIR   ACC;
151151   PAIR   Preg;
152152   UINT16   Treg;
153153   UINT16   AR[8];
src/emu/streams.c
r6049r6050
222222
223223   /* reset globals */
224224   strdata->stream_tailptr = &strdata->stream_head;
225   strdata->update_attoseconds = STREAMS_UPDATE_FREQUENCY.attoseconds;
225   strdata->update_attoseconds = STREAMS_UPDATE_ATTOTIME.attoseconds;
226226
227227   /* set the global pointer */
228228   machine->streams_data = strdata;
src/emu/streams.h
r6049r6050
1919    CONSTANTS
2020***************************************************************************/
2121
22#define STREAMS_UPDATE_FREQUENCY   ATTOTIME_IN_HZ(50)
22#define STREAMS_UPDATE_FREQUENCY   (50)
23#define STREAMS_UPDATE_ATTOTIME      ATTOTIME_IN_HZ(STREAMS_UPDATE_FREQUENCY)
2324
2425
2526
src/emu/mame.c
r6049r6050
13091309   /* if we have a valid game driver, parse game-specific INI files */
13101310   if (driver != NULL)
13111311   {
1312#ifndef MESS
13131312      const game_driver *parent = driver_get_clone(driver);
13141313      const game_driver *gparent = (parent != NULL) ? driver_get_clone(parent) : NULL;
13151314      const device_config *device;
r6049r6050
13501349         parse_ini_file(options, gparent->name, OPTION_PRIORITY_GPARENT_INI);
13511350      if (parent != NULL)
13521351         parse_ini_file(options, parent->name, OPTION_PRIORITY_PARENT_INI);
1353#endif
13541352      parse_ini_file(options, driver->name, OPTION_PRIORITY_DRIVER_INI);
13551353   }
13561354}
src/emu/sound/disc_sys.c
r6049r6050
3636 *
3737 *************************************/
3838
39static void task_check(discrete_task *task, const discrete_task *dest_task)
39static void task_check(discrete_task *task, discrete_task *dest_task)
4040{
4141   int inputnum;
4242   const linked_list_entry *node_entry;
r6049r6050
7676                     if (task->numbuffered >= DISCRETE_MAX_TASK_OUTPUTS)
7777                        fatalerror("dso_task_start - Number of maximum buffered nodes exceeded");
7878
79                     task->node_buf[task->numbuffered] = auto_alloc_array(task_node->info->device->machine, double, 2048);
79                     task->node_buf[task->numbuffered] = auto_alloc_array(task_node->info->device->machine, double,
80                           ((task_node->info->sample_rate + STREAMS_UPDATE_FREQUENCY) / STREAMS_UPDATE_FREQUENCY));
8081                     task->source[task->numbuffered] = (double *) dest_node->input[inputnum];
8182                     task->nodes[task->numbuffered] = discrete_find_node(task_node->info, inputnode);
8283                     i = task->numbuffered;
r6049r6050
8788                  /* register into source list */
8889                  source = auto_alloc(dest_node->info->device->machine, discrete_source_node);
8990                  linked_list_add(dest_node->info,
90                        (linked_list_entry **) (FPTR) &dest_task->source_list,
91                        &dest_task->source_list,
9192                        source);
9293                  source->task = task;
9394                  source->output_node = i;
r6049r6050
137138   const linked_list_entry *entry;
138139
139140   /* update source node buffer */
140   for (entry = task->source_list; entry != 0; entry = entry->next)
141   for (entry = task->source_list; entry != NULL; entry = entry->next)
141142   {
142143      discrete_source_node *sn = (discrete_source_node *) entry->ptr;
143144      sn->buffer = *sn->ptr++;
src/emu/sound/disc_inp.c
r6049r6050
3434struct dss_input_context
3535{
3636   stream_sample_t *ptr;         /* current in ptr for stream */
37   UINT8      data;            /* data written */
3837   double       gain;            /* node gain */
3938   double      offset;            /* node offset */
39   UINT8      data;            /* data written */
4040   UINT8      is_stream;
4141   UINT8      is_buffered;
4242   UINT32      stream_in_number;
r6049r6050
155155   INT32  rawportval = input_port_read_direct(context->port);
156156
157157   /* only recompute if the value changed from last time */
158   if (rawportval != context->lastpval)
158   if (UNEXPECTED(rawportval != context->lastpval))
159159   {
160160      double portval   = (double)(rawportval - context->pmin) * context->pscale;
161161      double scaledval = portval * context->scale + context->min;
r6049r6050
288288   /* the context pointer is set to point to the current input stream data in discrete_stream_update */
289289   struct dss_input_context *context = (struct dss_input_context *)node->context;
290290
291   if (context->ptr)
291   if (EXPECTED(context->ptr))
292292   {
293293      node->output[0] = (*context->ptr) * context->gain + context->offset;
294294      context->ptr++;
r6049r6050
302302   struct dss_input_context *context = (struct dss_input_context *)node->context;
303303
304304   context->ptr = NULL;
305   //context->data = 0;
305   context->data = 0;
306306}
307307
308308static DISCRETE_START(dss_input_stream)
src/emu/sound/disc_mth.c
r6049r6050
175175   double   exponent_d[2];   /* Discharge exponents based on function F3 */
176176   double   exponent2[2];   /* Discharge/charge exponents based on function F4 */
177177   double   exponent3[2];   /* Discharge/charge exponents based on function F5 */
178   double   exponent4;      /* Discharge/charge exponents for c4 */
178179   double   v_cap1;         /* charge on cap c1 */
179180   double   v_cap2;         /* charge on cap c2 */
180181   double   v_cap3;         /* charge on cap c3 */
182   double   v_cap4;         /* charge on cap c4 */
181183   double   r67;         /* = r6 + r7 (for easy use later) */
184   UINT8   has_c4;
185   UINT8   has_r4;
182186};
183187
184188
r6049r6050
10871091   double   v_ref = info->vRef;
10881092   double   rI = info->rI;
10891093
1090   if (DST_MIXER__ENABLE)
1094   if (EXPECTED(DST_MIXER__ENABLE))
10911095   {
10921096      r_total = context->r_total;
10931097
1094      if (context->r_node_bit_flag != 0)
1098      if (UNEXPECTED(context->r_node_bit_flag != 0))
10951099      {
10961100         /* loop and do any high pass filtering for connected caps */
10971101         /* but first see if there is an r_node for the current path */
r6049r6050
11571161         bit_mask = bit_mask << 1;
11581162         }
11591163      }
1160      else if (c_bit_flag != 0)
1164      else if (UNEXPECTED(c_bit_flag != 0))
11611165      {
11621166         /* no r_nodes, so just do high pass filtering */
11631167         for (bit = 0; bit < context->size; bit++)
r6049r6050
11761180      else
11771181      {
11781182         /* no r_nodes or c_nodes, mixing only */
1179         if (type == DISC_MIXER_IS_OP_AMP)
1183         if (UNEXPECTED(type == DISC_MIXER_IS_OP_AMP))
11801184         {
11811185            for (bit = 0; bit < context->size; bit++)
11821186               i += ( v_ref - DST_MIXER__IN(bit) ) / info->r[bit];
r6049r6050
11881192         }
11891193      }
11901194
1191      if (type == DISC_MIXER_IS_OP_AMP_WITH_RI)
1195      if (UNEXPECTED(type == DISC_MIXER_IS_OP_AMP_WITH_RI))
11921196         i += v_ref / rI;
11931197
11941198      r_total = 1.0 / r_total;
r6049r6050
11971201         * If op-amp then summing formula is used. */
11981202      v = i * ((type == DISC_MIXER_IS_OP_AMP) ? info->rF : r_total);
11991203
1200      if (type == DISC_MIXER_IS_OP_AMP_WITH_RI)
1204      if (UNEXPECTED(type == DISC_MIXER_IS_OP_AMP_WITH_RI))
12011205         v = v_ref + (context->gain * (v_ref - v));
12021206
12031207      /* Do the low pass filtering for cF */
1204      if (info->cF != 0)
1208      if (EXPECTED(info->cF != 0))
12051209      {
1206         if (r_node_bit_flag != 0)
1210         if (UNEXPECTED(r_node_bit_flag != 0))
12071211         {
12081212            /* Re-calculate exponent if resistor nodes are used */
12091213            context->exponent_c_f =  RC_CHARGE_EXP(r_total * info->cF);
r6049r6050
12131217      }
12141218
12151219      /* Do the high pass filtering for cAmp */
1216      if (info->cAmp != 0)
1220      if (EXPECTED(info->cAmp != 0))
12171221      {
12181222         context->v_cap_amp += (v - context->v_cap_amp) * context->exponent_c_amp;
12191223         v -= context->v_cap_amp;
r6049r6050
14041408   /* If the state is triggered we will need to countdown later */
14051409   int do_count = context->state;
14061410
1407   if (DST_ONESHOT__RESET)
1411   if (UNEXPECTED(DST_ONESHOT__RESET))
14081412   {
14091413      /* Hold in Reset */
14101414      node->output[0] = 0;
r6049r6050
14131417   else
14141418   {
14151419      /* are we at an edge? */
1416      if (trigger != context->last_trig)
1420      if (UNEXPECTED(trigger != context->last_trig))
14171421      {
14181422         /* There has been a trigger edge */
14191423         context->last_trig = trigger;
r6049r6050
14411445         }
14421446      }
14431447
1444      if (do_count)
1448      if (UNEXPECTED(do_count))
14451449      {
14461450         context->countdown -= node->info->sample_time;
14471451         if(context->countdown <= 0.0)
r6049r6050
20232027      i_pos += context->v_cap3 / info->r11;
20242028   }
20252029
2026
20272030   /* Calculate output current. */
20282031   i_out = i_pos - i_neg;
20292032   if (i_out < 0) i_out = 0;
2033
20302034   /* Convert to voltage for final output. */
2031   node->output[0] = i_out * info->r4;
2035   if (context->has_c4)
2036   {
2037      if (context->has_r4)
2038      {
2039         /* voltage across r4 charging cap */
2040         i_out *= info->r4;
2041         /* exponential charge */
2042         context->v_cap4 += (i_out - context->v_cap4) * context->exponent4;
2043      }
2044      else
2045      /* linear charge */
2046         context->v_cap4 += i_out / context->exponent4;
2047      if (context->v_cap4 < 0)
2048         context->v_cap4 = 0;
2049      node->output[0] = context->v_cap4;
2050   }
2051   else
2052      node->output[0] = i_out * info->r4;
2053
2054
2055
20322056   /* Clip the output if needed. */
20332057   if (node->output[0] > context->v_out_max) node->output[0] = context->v_out_max;
20342058}
r6049r6050
20632087   context->v_trig2      = (info->v2 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r8, info->r9);
20642088   context->exponent2[0] = RC_CHARGE_EXP(info->r9 * info->c2);
20652089   context->exponent2[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r8, info->r9) * info->c2);
2066   context->v_cap3  = 0;
2067   context->v_trig3 = (info->v3 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r10, info->r11);
2090   context->v_cap3       = 0;
2091   context->v_trig3      = (info->v3 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r10, info->r11);
20682092   context->exponent3[0] = RC_CHARGE_EXP(info->r11 * info->c3);
20692093   context->exponent3[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r10, info->r11) * info->c3);
2094   context->v_cap4       = 0;
2095   if (info->r4 != 0) context->has_r4 = 1;
2096   if (info->c4 != 0) context->has_c4 = 1;
2097   if (context->has_r4 && context->has_c4)
2098      context->exponent4    = RC_CHARGE_EXP(info->r4 * info->c4);
20702099
20712100   DISCRETE_STEP_CALL(dst_tvca_op_amp);
20722101}
src/emu/sound/discrete.c
r6049r6050
4040#include "discrete.h"
4141#include "eminline.h"
4242
43
4443/*************************************
4544 *
46 *  Debugging
45 *  Performance
4746 *
4847 *************************************/
4948
50#define DISCRETE_DEBUGLOG         (0)
49/*
50 * Normally, the discrete core processes 960 samples per update.
51 * With the various buffers involved, this on a Core2 is not as
52 * performant as processing 240 samples 4 times.
53 * The setting most probably depends on CPU and which modules are
54 * run and how many tasks are defined.
55 *
56 * Values < 32 exhibit poor performance (too much overhead) while
57 * Values > 500 have a slightly worse performace (too much cache misses?).
58 */
5159
60#define MAX_SAMPLES_PER_TASK_SLICE   (240)
5261
5362/*************************************
5463 *
55 *  Profiling Nodes
64 *  Debugging
5665 *
5766 *************************************/
5867
59#define DISCRETE_PROFILING         (0)
68#define DISCRETE_DEBUGLOG         (0)
6069
70
6171/*************************************
6272 *
63 *  Structures
73 *  Profiling Nodes
6474 *
6575 *************************************/
6676
67typedef struct _task_info task_info;
68struct _task_info
69{
70   discrete_task *task;
71   int samples;
72};
77#define DISCRETE_PROFILING         (0)
7378
74
7579/*************************************
7680 *
7781 *  Prototypes
r6049r6050
8084
8185static void init_nodes(discrete_info *info, const linked_list_entry *block_list, const device_config *device);
8286static void find_input_nodes(const discrete_info *info);
83static node_description *discrete_find_node(const discrete_info *info, const int node);
87static node_description *discrete_find_node(const discrete_info *info, int node);
8488static DEVICE_RESET( discrete );
8589static STREAM_UPDATE( discrete_stream_update );
8690static STREAM_UPDATE( buffer_stream_update );
8791
92static int profiling = DISCRETE_PROFILING;
8893
8994/*************************************
9095 *
r6049r6050
313318{
314319   const linked_list_entry *entry;
315320
316   if (DISCRETE_PROFILING)
321   if (EXPECTED(!profiling))
317322   {
318      osd_ticks_t last = get_profile_ticks();
319
320323      for (entry = list; entry != NULL; entry = entry->next)
321324      {
322325         node_description *node = (node_description *) entry->ptr;
323326
324         node->run_time -= last;
325         (*node->module->step)(node);
326         last = get_profile_ticks();
327         node->run_time += last;
327         /* Now step the node */
328         (*node->step)(node);
328329      }
329330   }
330331   else
331332   {
333      osd_ticks_t last = get_profile_ticks();
334
332335      for (entry = list; entry != NULL; entry = entry->next)
333336      {
334337         node_description *node = (node_description *) entry->ptr;
335338
336         /* Now step the node */
337         (*node->module->step)(node);
339         node->run_time -= last;
340         (*node->step)(node);
341         last = get_profile_ticks();
342         node->run_time += last;
338343      }
339344   }
340345}
r6049r6050
599604
600605   osd_work_queue_free(info->queue);
601606
602   if (DISCRETE_PROFILING)
607   if (profiling)
603608   {
604609      display_profiling(info);
605610   }
r6049r6050
648653         (*node->module->reset)(node);
649654
650655      /* otherwise, just step it */
651      else if (node->module->step)
652         (*node->module->step)(node);
656      else if (node->step)
657         (*node->step)(node);
653658   }
654659}
655660
r6049r6050
661666
662667static void *task_callback(void *param, int threadid)
663668{
664   const task_info *ti = (task_info *) param;
669   const linked_list_entry *list = (linked_list_entry *) param;
665670   const linked_list_entry *entry;
666   discrete_task *task = ti->task;
667   int samples, i;
671   int samples;
668672
669   /* set up task buffers */
670   for (i = 0; i < task->numbuffered; i++)
671      task->ptr[i] = task->node_buf[i];
672
673   /* initialize sources */
674   for (entry = task->source_list; entry != 0; entry = entry->next)
673   do
675674   {
676      discrete_source_node *sn = (discrete_source_node *) entry->ptr;
677      sn->ptr = sn->task->node_buf[sn->output_node];
678   }
675      for (entry = list; entry != 0; entry = entry->next)
676      {
677         discrete_task       *task = (discrete_task *) entry->ptr;
678         INT32            prev_id;
679679
680   samples = ti->samples;
681   while (samples-- > 0)
682   {
683      /* step */
684      step_nodes_in_list(task->list);
685   }
680         /* try to lock */
681         prev_id = compare_exchange32(&task->threadid, -1, threadid);
682         if (prev_id == -1 && task->threadid == threadid)
683         {
684            linked_list_entry   *src_entry;
686685
687   free(param);
686            samples = MIN(task->samples, MAX_SAMPLES_PER_TASK_SLICE);
687
688            /* check dependencies */
689            for (src_entry = task->source_list; src_entry != NULL; src_entry = src_entry->next)
690            {
691               discrete_source_node *sn = (discrete_source_node *) src_entry->ptr;
692               int avail;
693
694               avail = sn->task->ptr[sn->output_node] - sn->ptr;
695               if (avail < samples)
696                  samples = avail;
697            }
698
699            task->samples -= samples;
700            while (samples > 0)
701            {
702               /* step */
703               step_nodes_in_list(task->list);
704               samples--;
705            }
706            if (task->samples == 0)
707            {
708               return NULL;
709            }
710            task->threadid = -1;
711         }
712      }
713   } while (1);
714
688715   return NULL;
689716}
690717
r6049r6050
706733{
707734   discrete_info *info = (discrete_info *)param;
708735   const linked_list_entry *entry;
709   int outputnum, task_group;
736   int outputnum;
737   //, task_group;
710738
711739   if (samples == 0)
712740      return;
r6049r6050
724752      context->ptr = (stream_sample_t *) inputs[context->stream_in_number];
725753   }
726754
727   for (task_group = 0; task_group < DISCRETE_MAX_TASK_GROUPS; task_group++)
755   /* Setup tasks */
756   for (entry = info->task_list; entry != 0; entry = entry->next)
728757   {
729      /* Queue tasks */
730      for (entry = info->task_list; entry != 0; entry = entry->next)
731      {
732         discrete_task *task = (discrete_task *) entry->ptr;
758      discrete_task       *task = (discrete_task *) entry->ptr;
759      linked_list_entry   *src_entry;
760      int               i;
733761
734         if (task->task_group == task_group)
735         {
736            task_info *ti = (task_info *)malloc(sizeof(task_info));
762      task->samples = samples;
763      task->threadid = -1;
737764
738            /* Fire task */
739            ti->task = task;
740            ti->samples = samples;
741            osd_work_item_queue(info->queue, task_callback, (void *) ti, WORK_ITEM_FLAG_AUTO_RELEASE);
742         }
765      /* set up task buffers */
766      for (i = 0; i < task->numbuffered; i++)
767         task->ptr[i] = task->node_buf[i];
768
769      /* initialize sources */
770      for (src_entry = task->source_list; src_entry != 0; src_entry = src_entry->next)
771      {
772         discrete_source_node *sn = (discrete_source_node *) src_entry->ptr;
773         sn->ptr = sn->task->node_buf[sn->output_node];
743774      }
744      /* and wait for them */
745      osd_work_queue_wait(info->queue, osd_ticks_per_second()*10);
746775   }
747776
748   if (DISCRETE_PROFILING)
777   for (entry = info->task_list; entry != 0; entry = entry->next)
749778   {
779      /* Fire a work item for each task */
780      osd_work_item_queue(info->queue, task_callback, (void *) info->task_list, WORK_ITEM_FLAG_AUTO_RELEASE);
781   }
782   osd_work_queue_wait(info->queue, osd_ticks_per_second()*10);
783
784   if (profiling)
785   {
750786      info->total_samples += samples;
751787      info->total_stream_updates++;
752788   }
r6049r6050
822858         node->custom = custom->custom;
823859      }
824860
861      /* copy initial / default step function */
862      node->step = node->module->step;
863
825864      /* allocate memory if necessary */
826865      if (node->module->contextsize)
827866         node->context = auto_alloc_array_clear(device->machine, UINT8, node->module->contextsize);
r6049r6050
895934
896935      /* our running order just follows the order specified */
897936      /* does the node step ? */
898      if (node->module->step != NULL)
937      if (node->step != NULL)
899938      {
900939         /* do we belong to a task? */
901940         if (task_node_list_ptr == NULL)
r6049r6050
939978 *
940979 *************************************/
941980
981/* attempt to group all static node parameters together.
982 * Has a negative impact on performance - but it should
983 * reduce memory bandwidth - this is weird. */
984
985#if 0
986static double dbuf[10240] = { 0.0, 1.0 };
987static int dbufptr = 2;
988
989static double *getDoublePtr(double val)
990{
991   int i;
992   for (i=0; i<dbufptr; i+=1)
993   {
994      if (dbuf[i] == val)
995      {
996         return &dbuf[i];
997      }
998   }
999   dbuf[dbufptr] = val;
1000   dbufptr+=1;
1001   return &dbuf[dbufptr-1];
1002}
1003#endif
1004
9421005static void find_input_nodes(const discrete_info *info)
9431006{
9441007   const linked_list_entry *entry;
r6049r6050
9791042            }
9801043            else
9811044            {
982               node->input[inputnum] = &(block->initial[inputnum]);
1045               node->input[inputnum] = &(node->block->initial[inputnum]);
1046               //node->input[inputnum] = getDoublePtr(node->block->initial[inputnum]);
9831047            }
9841048         }
9851049      }
src/emu/sound/discrete.h
r6049r6050
285285 * DISCRETE_FILTER1(NODE,ENAB,INP0,FREQ,TYPE)
286286 * DISCRETE_FILTER2(NODE,ENAB,INP0,FREQ,DAMP,TYPE)
287287 *
288 * DISCRETE_CRFILTER(NODE,ENAB,IN0,RVAL,CVAL)
289 * DISCRETE_CRFILTER_VREF(NODE,ENAB,IN0,RVAL,CVAL,VREF)
288 * DISCRETE_CRFILTER(NODE,IN0,RVAL,CVAL)
289 * DISCRETE_CRFILTER_VREF(NODE,IN0,RVAL,CVAL,VREF)
290290 * DISCRETE_OP_AMP_FILTER(NODE,ENAB,INP0,INP1,TYPE,INFO)
291291 * DISCRETE_RCDISC(NODE,ENAB,IN0,RVAL,CVAL)
292292 * DISCRETE_RCDISC2(NODE,SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL)
r6049r6050
295295 * DISCRETE_RCDISC5(NODE,ENAB,IN0,RVAL,CVAL)
296296 * DISCRETE_RCINTEGRATE(NODE,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE)
297297 * DISCRETE_RCDISC_MODULATED(NODE,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP)
298 * DISCRETE_RCFILTER(NODE,ENAB,IN0,RVAL,CVAL)
299 * DISCRETE_RCFILTER_VREF(NODE,ENAB,IN0,RVAL,CVAL,VREF)
298 * DISCRETE_RCFILTER(NODE,IN0,RVAL,CVAL)
299 * DISCRETE_RCFILTER_VREF(NODE,IN0,RVAL,CVAL,VREF)
300300 *
301301 * DISCRETE_555_ASTABLE(NODE,RESET,R1,R2,C,OPTIONS)
302302 * DISCRETE_555_ASTABLE_CV(NODE,RESET,R1,R2,C,CTRLV,OPTIONS)
r6049r6050
21152115 *                              input 1 node or static value,
21162116 *                              address of discrete_op_amp_tvca_info structure)
21172117 *
2118 *     discrete_op_amp_tvca_info = { r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, c1, c2, c3, v1, v2, v3, vP, f0, f1, f2, f3, f4, f5}
2118 *     discrete_op_amp_tvca_info = { r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, c1, c2, c3, c4, v1, v2, v3, vP, f0, f1, f2, f3, f4, f5}
21192119 *
21202120 * Note: Set all unused components to 0.
21212121 *       Set all unused functions to DISC_OP_AMP_TRIGGER_FUNCTION_NONE
r6049r6050
21252125 *       vP is the op-amp B+.
21262126 *
21272127 *             r2a
2128 *   IN0 >----ZZZZ-----.               r1
2129 *           .----.    |     vP >------ZZZZ---.
2130 *           | F0 |----+                      |
2131 *           '----'    |                r2b   |    r4
2132 *             r3a     '---------------ZZZZ---+---ZZZZ--.
2128 *   IN0 >----ZZZZ-----.               r1         c4
2129 *           .----.    |     vP >------ZZZZ---+---||----.
2130 *           | F0 |----+                      |         |
2131 *           '----'    |                r2b   |    r4   |
2132 *             r3a     '---------------ZZZZ---+---ZZZZ--+
21332133 *   IN1 >----ZZZZ---.                        |         |
21342134 *           .----.  |                  r3b   |  |\     |
21352135 *           | F1 |--+-----------------ZZZZ---+  | \    |
r6049r6050
22232223 *
22242224 *                        .------------.
22252225 *                        |            |
2226 *    ENAB       -0------}| CR FILTER  |
2226 *                        | CR FILTER  |
22272227 *                        |            |
2228 *    INPUT1     -1------}| --| |-+--  |
2228 *    INPUT1     -0------}| --| |-+--  |
22292229 *                        |   C   |    |----}   Netlist node
2230 *    RVAL       -2------}|       Z    |
2230 *    RVAL       -1------}|       Z    |
22312231 *                        |       Z R  |
2232 *    CVAL       -3------}|       |    |
2232 *    CVAL       -2------}|       |    |
22332233 *                        |      vRef  |
22342234 *                        '------------'
22352235 *
22362236 *  Declaration syntax
22372237 *
22382238 *     DISCRETE_CRFILTER(name of node,
2239 *                       enable
22402239 *                       input node (or value)
2241 *                       resistor value in OHMS
2242 *                       capacitor value in FARADS)
2240 *                       resistor node or static value in OHMS
2241 *                       capacitor node or static value in FARADS)
22432242 *
22442243 *     DISCRETE_CRFILTER_VREF(name of node,
2245 *                            enable
22462244 *                            input node (or value)
22472245 *                            resistor value in OHMS
22482246 *                            capacitor value in FARADS,
2249 *                            vRef static value)
2247 *                            vRef node or static value)
22502248 *
22512249 *  Example config line
22522250 *
2253 *     DISCRETE_CRFILTER(NODE_11,1,NODE_10,100,CAP_U(1))
2251 *     DISCRETE_CRFILTER(NODE_11,NODE_10,100,CAP_U(1))
22542252 *
2255 *  Defines an always enabled CR filter with a 100R & 1uF network
2253 *  Defines a CR filter with a 100R & 1uF network
22562254 *  the input is fed from NODE_10.
22572255 *
22582256 *  This can be also thought of as a high pass filter with a 3dB cutoff
r6049r6050
24782476 ***********************************************************************
24792477 *
24802478 * DISCRETE_RCDISC - Simple single pole RC discharge network
2479 * DISCRETE_RCFILTER_VREF - Same but refrenced to vRef not 0V
24812480 *
24822481 *                        .------------.
24832482 *                        |            |
2484 *    ENAB       -0------>| RC         |
2483 *                        | RC         |
24852484 *                        |            |
2486 *    INPUT1     -1------>| -ZZZZ-+--  |
2485 *    INPUT1     -0------>| -ZZZZ-+--  |
24872486 *                        |   R   |    |---->   Netlist node
2488 *    RVAL       -2------>|      ---   |
2487 *    RVAL       -1------>|      ---   |
24892488 *                        |      ---C  |
2490 *    CVAL       -3------>|       |    |
2491 *                        |            |
2489 *    CVAL       -2------>|       |    |
2490 *                        |      vref  |
24922491 *                        '------------'
24932492 *
24942493 *  Declaration syntax
24952494 *
24962495 *     DISCRETE_RCFILTER(name of node,
2497 *                       enable,
24982496 *                       input node (or value),
24992497 *                       resistor value in OHMS,
25002498 *                       capacitor value in FARADS)
25012499 *
2500 *     DISCRETE_RCFILTER_VREF(name of node,
2501 *                            input node (or value)
2502 *                            resistor value in OHMS
2503 *                            capacitor value in FARADS,
2504 *                            vRef node or static value)
2505 *
25022506 *  Example config line
25032507 *
2504 *     DISCRETE_RCDISC(NODE_11,NODE_10,10,100,CAP_U(1))
2508 *     DISCRETE_RCDISC(NODE_11,10,100,CAP_U(1))
25052509 *
2506 *  When enabled by NODE_10, C discharges from 10v as indicated by RC
2507 *  of 100R & 1uF.
2510 *  C discharges from 10v as indicated by RC of 100R & 1uF.
25082511 *
25092512 ***********************************************************************
25102513 *
r6049r6050
34093412#define RC_DISCHARGE_EXP_DT(rc, dt)            (exp(-(dt) / (rc)))
34103413#define RC_DISCHARGE_NEG_EXP_DT(rc, dt)         (exp((dt) / (rc)))
34113414
3415#define FREQ_OF_555(_r1, _r2, _c)   (1.49 / ((_r1 + 2 * _r2) * _c))
3416
34123417/*************************************
34133418 *
34143419 *  Interface & Naming
r6049r6050
34473452#define DISCRETE_MAX_INPUTS               10
34483453#define DISCRETE_MAX_OUTPUTS             8
34493454#define DISCRETE_MAX_TASK_OUTPUTS         8
3450#define DISCRETE_MAX_TASK_GROUPS         8
3455#define DISCRETE_MAX_TASK_GROUPS         10
34513456
34523457
34533458/*************************************
r6049r6050
37153720
37163721struct _node_description
37173722{
3723   /* this declaration order seems to be optimal */
37183724   double            output[DISCRETE_MAX_OUTPUTS];      /* The node's last output value */
37193725
3726   DISCRETE_FUNC((*step));                           /* Called to execute one time delta of output update */
3727   void *            context;                     /* Contextual information specific to this node type */
3728
3729   const double *      input[DISCRETE_MAX_INPUTS];         /* Addresses of Input values */
37203730   int               active_inputs;                  /* Number of active inputs on this node type */
37213731   int               input_is_node;                  /* Bit Flags.  1 in bit location means input_is_node */
3722   const double *      input[DISCRETE_MAX_INPUTS];         /* Addresses of Input values */
37233732
3724   void *            context;                     /* Contextual information specific to this node type */
37253733   const void *      custom;                        /* Custom function specific initialisation data */
37263734
37273735   const discrete_module *module;                     /* Node's module info */
3736   const discrete_info *info;                        /* Points to the parent */
37283737   const discrete_sound_block *block;                  /* Points to the node's setup block. */
3729   const discrete_info *info;                        /* Points to the parent */
37303738
37313739   osd_ticks_t         run_time;
37323740};
r6049r6050
37453753typedef struct _linked_list_entry   linked_list_entry;
37463754struct _linked_list_entry
37473755{
3756   linked_list_entry    *next;
37483757   const void          *ptr;
3749   linked_list_entry    *next;
37503758};
37513759
37523760typedef struct _discrete_task discrete_task;
r6049r6050
37543762{
37553763   const linked_list_entry *list;
37563764
3757   int               task_group;
3758   int             numbuffered;
3759   double             *ptr[DISCRETE_MAX_TASK_OUTPUTS];
3760   double             *node_buf[DISCRETE_MAX_TASK_OUTPUTS];
3761   node_description   *nodes[DISCRETE_MAX_TASK_OUTPUTS];
3762   double             *source[DISCRETE_MAX_TASK_OUTPUTS];
3765   volatile INT32         threadid;
3766   volatile int         samples;
37633767
37643768   /* list of source nodes */
3765   linked_list_entry   *source_list;      /* discrete_source_node */
3769   linked_list_entry      *source_list;      /* discrete_source_node */
3770
3771   int                  task_group;
3772   int                numbuffered;
3773   double               *ptr[DISCRETE_MAX_TASK_OUTPUTS];
3774   const double          *source[DISCRETE_MAX_TASK_OUTPUTS];
3775
3776   double               *node_buf[DISCRETE_MAX_TASK_OUTPUTS];
3777   const node_description   *nodes[DISCRETE_MAX_TASK_OUTPUTS];
37663778};
37673779
37683780typedef struct _discrete_source_node discrete_source_node;
37693781struct _discrete_source_node
37703782{
37713783   const discrete_task   *task;
3784   const double      *ptr;
37723785   int               output_node;
37733786   double            buffer;
3774   double            *ptr;
37753787};
37763788
37773789struct _discrete_info
r6049r6050
39803992   double   c1;
39813993   double   c2;
39823994   double   c3;
3995   double   c4;
39833996   double   v1;
39843997   double   v2;
39853998   double   v3;
r6049r6050
44364449#define DISCRETE_FILTER2(NODE,ENAB,INP0,FREQ,DAMP,TYPE)                 { NODE, DST_FILTER2     , 5, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,FREQ,DAMP,TYPE }, NULL, "DISCRETE_FILTER2" },
44374450/* Component specific */
44384451#define DISCRETE_SALLEN_KEY_FILTER(NODE,ENAB,INP0,TYPE,INFO)            { NODE, DST_SALLEN_KEY  , 3, { ENAB,INP0,NODE_NC }, { ENAB,INP0,TYPE }, INFO, "DISCRETE_SALLEN_KEY_FILTER" },
4439#define DISCRETE_CRFILTER(NODE,ENAB,INP0,RVAL,CVAL)                     { NODE, DST_CRFILTER    , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_CRFILTER" },
4440#define DISCRETE_CRFILTER_VREF(NODE,ENAB,INP0,RVAL,CVAL,VREF)           { NODE, DST_CRFILTER    , 5, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL,VREF }, NULL, "DISCRETE_CRFILTER_VREF" },
4452#define DISCRETE_CRFILTER(NODE,INP0,RVAL,CVAL)                          { NODE, DST_CRFILTER    , 4, { INP0,RVAL,CVAL }, { INP0,RVAL,CVAL }, NULL, "DISCRETE_CRFILTER" },
4453#define DISCRETE_CRFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF)                { NODE, DST_CRFILTER    , 5, { INP0,RVAL,CVAL,VREF }, { INP0,RVAL,CVAL,VREF }, NULL, "DISCRETE_CRFILTER_VREF" },
44414454#define DISCRETE_OP_AMP_FILTER(NODE,ENAB,INP0,INP1,TYPE,INFO)           { NODE, DST_OP_AMP_FILT , 4, { ENAB,INP0,INP1,NODE_NC }, { ENAB,INP0,INP1,TYPE }, INFO, "DISCRETE_OP_AMP_FILTER" },
44424455#define DISCRETE_RCDISC(NODE,ENAB,INP0,RVAL,CVAL)                       { NODE, DST_RCDISC      , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCDISC" },
44434456#define DISCRETE_RCDISC2(NODE,SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL)        { NODE, DST_RCDISC2     , 6, { SWITCH,INP0,NODE_NC,INP1,NODE_NC,NODE_NC }, { SWITCH,INP0,RVAL0,INP1,RVAL1,CVAL }, NULL, "DISCRETE_RCDISC2" },
r6049r6050
44454458#define DISCRETE_RCDISC4(NODE,ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE) { NODE, DST_RCDISC4     , 8, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL0,RVAL1,RVAL2,CVAL,VP,TYPE }, NULL, "DISCRETE_RCDISC4" },
44464459#define DISCRETE_RCDISC5(NODE,ENAB,INP0,RVAL,CVAL)                      { NODE, DST_RCDISC5     , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCDISC5" },
44474460#define DISCRETE_RCDISC_MODULATED(NODE,INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP)   { NODE, DST_RCDISC_MOD, 8, { INP0,INP1,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { INP0,INP1,RVAL0,RVAL1,RVAL2,RVAL3,CVAL,VP }, NULL, "DISCRETE_RCDISC_MODULATED" },
4448#define DISCRETE_RCFILTER(NODE,ENAB,INP0,RVAL,CVAL)                     { NODE, DST_RCFILTER    , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCFILTER" },
4461#define DISCRETE_RCFILTER(NODE,INP0,RVAL,CVAL)                          { NODE, DST_RCFILTER    , 3, { INP0,RVAL,CVAL }, { INP0,RVAL,CVAL }, NULL, "DISCRETE_RCFILTER" },
4462#define DISCRETE_RCFILTER_VREF(NODE,INP0,RVAL,CVAL,VREF)                { NODE, DST_RCFILTER    , 4, { INP0,RVAL,CVAL,VREF }, { INP0,RVAL,CVAL,VREF }, NULL, "DISCRETE_RCFILTER_VREF" },
44494463#define DISCRETE_RCFILTER_SW(NODE,ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4) { NODE, DST_RCFILTER_SW, 8, { ENAB,INP0,SW,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,SW,RVAL,CVAL1,CVAL2,CVAL3,CVAL4 }, NULL, "DISCRETE_RCFILTER_SW" },
4450#define DISCRETE_RCFILTER_VREF(NODE,ENAB,INP0,RVAL,CVAL,VREF)           { NODE, DST_RCFILTER    , 5, { ENAB,INP0,NODE_NC,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL,VREF }, NULL, "DISCRETE_RCFILTER_VREF" },
44514464#define DISCRETE_RCINTEGRATE(NODE,INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE)  { NODE, DST_RCINTEGRATE , 7, { INP0,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC,NODE_NC }, { INP0,RVAL0,RVAL1,RVAL2,CVAL,vP,TYPE }, NULL, "DISCRETE_RCINTEGRATE" },
44524465/* For testing - seem to be buggered.  Use versions not ending in N. */
44534466#define DISCRETE_RCDISCN(NODE,ENAB,INP0,RVAL,CVAL)                      { NODE, DST_RCDISCN     , 4, { ENAB,INP0,NODE_NC,NODE_NC }, { ENAB,INP0,RVAL,CVAL }, NULL, "DISCRETE_RCDISCN" },
src/emu/sound/disc_dev.c
r6049r6050
172172   double   v_cap   = context->cap_voltage;   /* Current voltage on capacitor, before dt */
173173   double   v_cap_next = 0;               /* Voltage on capacitor, after dt */
174174   double   v_charge, exponent = 0;
175   int      update_exponent = 0;
175   UINT8   flip_flop = context->flip_flop;
176   UINT8   update_exponent = 0;
176177
177178   /* put commonly used stuff in local variables for speed */
178179   double   threshold = context->threshold;
r6049r6050
199200      /* Since the thresholds may have changed we need to update the FF */
200201      if (v_cap >= threshold)
201202      {
202         context->flip_flop = 0;
203         flip_flop = 0;
203204         count_f++;
204205      }
205206      else
206207      if (v_cap <= trigger)
207208      {
208         context->flip_flop = 1;
209         flip_flop = 1;
209210         count_r++;
210211      }
211212   }
r6049r6050
245246     */
246247   if (DSD_555_ASTBL__C == 0)
247248   {
248      context->flip_flop = 1;
249      flip_flop = 1;
249250      /* The voltage goes high because the cap circuit is open. */
250251      v_cap_next = v_charge;
251252      v_cap      = v_charge;
r6049r6050
269270      /* Keep looping until all toggling in time sample is used up. */
270271      do
271272      {
272         if (context->flip_flop)
273         if (flip_flop)
273274         {
274275            if (DSD_555_ASTBL__R1 == 0)
275276            {
r6049r6050
298299                  /* calculate the overshoot time */
299300                  dt     = context->t_rc_charge  * log(1.0 / (1.0 - ((v_cap_next - threshold) / (v_charge - v_cap))));
300301                  x_time = dt;
301                  v_cap  = threshold;
302                  context->flip_flop = 0;
302                  v_cap_next  = threshold;
303                  flip_flop = 0;
303304                  count_f++;
304305                  update_exponent = 1;
305306               }
r6049r6050
330331               if (v_cap_next < trigger)
331332                  dt = context->t_rc_discharge  * log(1.0 / (1.0 - ((trigger - v_cap_next) / v_cap)));
332333               x_time = dt;
333               v_cap  = trigger;
334               context->flip_flop = 1;
334               v_cap_next  = trigger;
335               flip_flop = 1;
335336               count_r++;
336337               update_exponent = 1;
337338            }
338339         }
340         v_cap = v_cap_next;
339341      } while(dt);
340342
341      context->cap_voltage = v_cap_next;
343      context->cap_voltage = v_cap;
342344   }
343345
344346   /* Convert last switch time to a ratio */
r6049r6050
347349   switch (context->output_type)
348350   {
349351      case DISC_555_OUT_SQW:
350         node->output[0] = context->flip_flop * context->v_out_high + context->ac_shift;
352         if (count_f + count_r >= 2)
353            /* force at least 1 toggle */
354            node->output[0] = context->flip_flop ? 0 : context->v_out_high;
355         else
356            node->output[0] = flip_flop * context->v_out_high;
357         node->output[0] += context->ac_shift;
351358         break;
352359      case DISC_555_OUT_CAP:
353         node->output[0] = v_cap_next;
360         node->output[0] = v_cap;
354361         /* Fake it to AC if needed */
355362         if (context->output_is_ac)
356363            node->output[0] -= threshold * 3.0 /4.0;
357364         break;
358365      case DISC_555_OUT_ENERGY:
359366         if (x_time == 0) x_time = 1.0;
360         node->output[0]  = context->v_out_high * (context->flip_flop ? x_time : (1.0 - x_time));
367         node->output[0]  = context->v_out_high * (flip_flop ? x_time : (1.0 - x_time));
361368         node->output[0] += context->ac_shift;
362369         break;
363370      case DISC_555_OUT_LOGIC_X:
364         node->output[0] = context->flip_flop + x_time;
371         node->output[0] = flip_flop + x_time;
365372         break;
366373      case DISC_555_OUT_COUNT_F_X:
367374         node->output[0] = count_f ? count_f + x_time : count_f;
r6049r6050
376383         node->output[0] = count_r;
377384         break;
378385   }
386   context->flip_flop = flip_flop;
379387}
380388
381389static DISCRETE_RESET(dsd_555_astbl)
r6049r6050
679687   double   v_vcharge_limit;   /* vIn and the junction voltage limit the max charging voltage from i */
680688   double   r_temp;            /* play thing */
681689   double   exponent;
682   int      update_exponent, update_t_rc;
690   UINT8   update_exponent, update_t_rc;
691   UINT8   flip_flop = context->flip_flop;
683692
684693
685   if (DSD_555_CC__RESET)
694   if (UNEXPECTED(DSD_555_CC__RESET))
686695   {
687696      /* We are in RESET */
688697      node->output[0]      = 0;
r6049r6050
752761      if (context->type <= 1)
753762      {
754763         /* Standard constant current charge */
755         if (context->flip_flop)
764         if (flip_flop)
756765         {
757766            if (i == 0)
758767            {
r6049r6050
788797                  /* calculate the overshoot time */
789798                  dt     = DSD_555_CC__C * (v_cap_next - context->threshold) / i;
790799                  x_time = dt;
791                  v_cap  = context->threshold;
792                  context->flip_flop = 0;
800                  v_cap_next = context->threshold;
801                  flip_flop = 0;
793802                  count_f++;
794803                  update_exponent = 1;
795804               }
r6049r6050
827836            {
828837               dt     = t_rc  * log(1.0 / (1.0 - ((context->trigger - v_cap_next) / v_cap)));
829838               x_time = dt;
830               v_cap  = context->trigger;
831               context->flip_flop = 1;
839               v_cap_next  = context->trigger;
840               flip_flop = 1;
832841               count_r++;
833842               update_exponent = 1;
834843            }
r6049r6050
836845         else   /* Immediate discharge. No change in dt. */
837846         {
838847            x_time = dt;
839            v_cap  = context->trigger;
840            context->flip_flop = 1;
848            v_cap_next = context->trigger;
849            flip_flop = 1;
841850            count_r++;
842851         }
843852      }
844853      else
845854      {
846855         /* The constant current gets changed to a voltage due to a load resistor. */
847         if (context->flip_flop)
856         if (flip_flop)
848857         {
849858            if ((i == 0) && (DSD_555_CC__RBIAS == 0))
850859            {
r6049r6050
890899                  /* calculate the overshoot time */
891900                  dt     = t_rc  * log(1.0 / (1.0 - ((v_cap_next - context->threshold) / (v - v_cap))));
892901                  x_time = dt;
893                  v_cap  = context->threshold;
894                  context->flip_flop = 0;
902                  v_cap_next = context->threshold;
903                  flip_flop = 0;
895904                  count_f++;
896905                  update_exponent = 1;
897906               }
r6049r6050
918927               /* calculate the overshoot time */
919928               dt     = t_rc  * log(1.0 / (1.0 - ((context->trigger - v_cap_next) / v_cap)));
920929               x_time = dt;
921               v_cap  = context->trigger;
922               context->flip_flop = 1;
930               v_cap_next = context->trigger;
931               flip_flop = 1;
923932               count_r++;
924933               update_exponent = 1;
925934            }
r6049r6050
927936         else   /* Immediate discharge. No change in dt. */
928937         {
929938            x_time = dt;
930            v_cap  = context->trigger;
931            context->flip_flop = 1;
939            v_cap_next = context->trigger;
940            flip_flop = 1;
932941            count_r++;
933942         }
934943      }
944      v_cap = v_cap_next;
935945   } while(dt);
936946
937   context->cap_voltage = v_cap_next;
947   context->cap_voltage = v_cap;
938948
939949   /* Convert last switch time to a ratio */
940950   x_time = x_time / node->info->sample_time;
r6049r6050
942952   switch (context->output_type)
943953   {
944954      case DISC_555_OUT_SQW:
945         if (count_r && (~context->type & 0x01))
946         {
947            /* There has been an immediate discharge, so keep low for 1 sample. */
948            node->output[0] = 0;
949         }
955         if (count_f + count_r >= 2)
956            /* force at least 1 toggle */
957            node->output[0] = context->flip_flop ? 0 : context->v_out_high;
950958         else
951            node->output[0] = context->flip_flop * context->v_out_high;
959            node->output[0] = flip_flop * context->v_out_high;
952960         /* Fake it to AC if needed */
953961         node->output[0] += context->ac_shift;
954962         break;
955963      case DISC_555_OUT_CAP:
956         node->output[0] = v_cap_next + context->ac_shift;
964         node->output[0] = v_cap + context->ac_shift;
957965         break;
958966      case DISC_555_OUT_ENERGY:
959967         if (x_time == 0) x_time = 1.0;
960         node->output[0]  = context->v_out_high * (context->flip_flop ? x_time : (1.0 - x_time));
968         node->output[0]  = context->v_out_high * (flip_flop ? x_time : (1.0 - x_time));
961969         node->output[0] += context->ac_shift;
962970         break;
963971      case DISC_555_OUT_LOGIC_X:
964         node->output[0] = context->flip_flop + x_time;
972         node->output[0] = flip_flop + x_time;
965973         break;
966974      case DISC_555_OUT_COUNT_F_X:
967975         node->output[0] = count_f ? count_f + x_time : count_f;
r6049r6050
976984         node->output[0] = count_r;
977985         break;
978986   }
987   context->flip_flop = flip_flop;
979988}
980989
981990static DISCRETE_RESET(dsd_555_cc)
r6049r6050
17141723
17151724   sample_t = node->info->sample_time;   /* Change in time */
17161725   //dt  = LS624_T(DSD_LS624__C, DSD_LS624__VRNG, DSD_LS624__VMOD) / 2.0;
1717   if (DSD_LS624__VMOD > 0.001)
1726   if (EXPECTED(DSD_LS624__VMOD > 0.001))
17181727      dt = 0.5 / LS624_F(DSD_LS624__VMOD);
17191728   else
17201729      /* close enough to 0, so we can speed things up by no longer call pow() */
17211730      dt = context->dt_vmod_at_0;
17221731   t   = context->remain;
17231732   en += (double) context->state * t;
1724   while (t + dt <= sample_t)
1733   while (EXPECTED(t + dt <= sample_t))
17251734   {
17261735      en += (double) context->state * dt;
17271736      context->state = (1 - context->state);
r6049r6050
17411750         break;
17421751      case DISC_LS624_OUT_LOGIC:
17431752         /* filter out randomness */
1744         if (cntf + cntr > 1)
1753         if (UNEXPECTED(cntf + cntr > 1))
17451754            node->output[0] = 1;
17461755         else
17471756            node->output[0] = context->state;
src/emu/sound/disc_wav.c
r6049r6050
199199      max = DSS_COUNTER__MAX;
200200
201201   ds_clock = DSS_COUNTER__CLOCK;
202   if (context->clock_type == DISC_CLK_IS_FREQ)
202   if (UNEXPECTED(context->clock_type == DISC_CLK_IS_FREQ))
203203   {
204204      /* We need to keep clocking the internal clock even if disabled. */
205205      cycles = (context->t_left + node->info->sample_time) * ds_clock;
r6049r6050
215215
216216
217217   /* If reset enabled then set output to the reset value.  No x_time in reset. */
218   if (DSS_COUNTER__RESET)
218   if (UNEXPECTED(DSS_COUNTER__RESET))
219219   {
220220      context->count = DSS_COUNTER__INIT;
221221      node->output[0] = context->count;
r6049r6050
226226     * Only count if module is enabled.
227227     * This has the effect of holding the output at it's current value.
228228     */
229   if (DSS_COUNTER__ENABLE)
229   if (EXPECTED(DSS_COUNTER__ENABLE))
230230   {
231231      last_count = context->count;
232232
r6049r6050
260260
261261      node->output[0] = context->is_7492 ? disc_7492_count[context->count] : context->count;
262262
263      if (context->count != last_count)
263      if (EXPECTED(context->count != last_count))
264264      {
265265         /* the x_time is only output if the output changed. */
266266         switch (context->out_type)
r6049r6050
759759   UINT8 force_charge = 0;
760760   UINT8 enable = DSS_OP_AMP_OSC__ENABLE;
761761   UINT8 update_exponent = 0;
762   UINT8 flip_flop = context->flip_flop;
762763   int count_f = 0;
763764   int count_r = 0;
764765
r6049r6050
837838         /* we need to mix any bias and all modulation voltages together. */
838839         charge[0] = context->i_fixed;
839840         v = DSS_OP_AMP_OSC__VMOD1 - OP_AMP_NORTON_VBE;
841         if (v < 0) v = 0;
840842         charge[0] += v / info->r1;
841843         if (info->r6 != 0)
842844         {
r6049r6050
859861   {
860862      if (context->is_linear_charge)
861863      {
862         if ((context->flip_flop ^ context->flip_flop_xor) || force_charge)
864         if ((flip_flop ^ context->flip_flop_xor) || force_charge)
863865         {
864866            /* Charging */
865867            /* iC=C*dv/dt  works out to dv=iC*dt/C */
r6049r6050
869871            /* has it charged past upper limit? */
870872            if (v_cap_next > context->threshold_high)
871873            {
872               context->flip_flop = context->flip_flop_xor;
873               if (context->flip_flop)
874               flip_flop = context->flip_flop_xor;
875               if (flip_flop)
874876                  count_r++;
875877               else
876878                  count_f++;
r6049r6050
885887                  /* calculate the overshoot time */
886888                  dt = info->c * (v_cap_next - context->threshold_high) / charge[1];
887889                  x_time = dt;
888                  v_cap = context->threshold_high;
890                  v_cap_next = context->threshold_high;
889891               }
890892            }
891893         }
r6049r6050
898900            /* has it discharged past lower limit? */
899901            if (v_cap_next < context->threshold_low)
900902            {
901               context->flip_flop = !context->flip_flop_xor;
902               if (context->flip_flop)
903               flip_flop = !context->flip_flop_xor;
904               if (flip_flop)
903905                  count_r++;
904906               else
905907                  count_f++;
906908               /* calculate the overshoot time */
907909               dt = info->c * (context->threshold_low - v_cap_next) / charge[0];
908910               x_time = dt;
909               v_cap = context->threshold_low;
911               v_cap_next = context->threshold_low;
910912            }
911913         }
912914      }
r6049r6050
917919         else
918920            exponent = context->charge_exp;
919921
920         if (context->flip_flop)
922         if (flip_flop)
921923         {
922924            /* Charging */
923925            v_cap_next = v_cap + ((context->v_out_high - v_cap) * exponent);
r6049r6050
929931               dt = context->charge_rc  * log(1.0 / (1.0 - ((v_cap_next - context->threshold_high) / (context->v_out_high - v_cap))));
930932               x_time = dt;
931933               v_cap_next = 0;
932               v_cap      = context->threshold_high;
933               context->flip_flop = 0;
934               v_cap_next = context->threshold_high;
935               flip_flop = 0;
934936               count_f++;
935937               update_exponent = 1;
936938            }
r6049r6050
946948            {
947949               dt = context->charge_rc * log(1.0 / (1.0 - ((context->threshold_low - v_cap_next) / v_cap)));
948950               x_time = dt;
949               v_cap  = context->threshold_low;
950               context->flip_flop = 1;
951               v_cap_next = context->threshold_low;
952               flip_flop = 1;
951953               count_r++;
952954               update_exponent = 1;
953955            }
954956         }
955957      }
956      context->v_cap = v_cap_next;
958      v_cap = v_cap_next;
957959   } while(dt);
960   context->v_cap = v_cap;
958961
959962   x_time = dt / node->info->sample_time;
960963
961964   switch (context->output_type)
962965   {
963966      case DISC_OP_AMP_OSCILLATOR_OUT_CAP:
964         node->output[0] = v_cap_next;
967         node->output[0] = v_cap;
965968         break;
966969      case DISC_OP_AMP_OSCILLATOR_OUT_ENERGY:
967970         if (x_time == 0) x_time = 1.0;
968         node->output[0]  = context->v_out_high * (context->flip_flop ? x_time : (1.0 - x_time));
971         node->output[0]  = context->v_out_high * (flip_flop ? x_time : (1.0 - x_time));
969972         break;
970973      case DISC_OP_AMP_OSCILLATOR_OUT_SQW:
971         node->output[0] = context->flip_flop * context->v_out_high ;
974         if (count_f + count_r >= 2)
975            /* force at least 1 toggle */
976            node->output[0] = context->flip_flop ? 0 : context->v_out_high;
977         else
978            node->output[0] = flip_flop * context->v_out_high;
972979         break;
973980      case DISC_OP_AMP_OSCILLATOR_OUT_COUNT_F_X:
974981         node->output[0] = count_f ? count_f + x_time : count_f;
r6049r6050
980987         node->output[0] = context->flip_flop + x_time;
981988         break;
982989   }
990   context->flip_flop = flip_flop;
983991}
984992
985993static DISCRETE_RESET(dss_op_amp_osc)
src/emu/sound/disc_flt.c
r6049r6050
9696
9797struct dst_rcfilter_context
9898{
99   double   vCap;
100   double   rc;
99101   double   exponent;
100   double   vCap;
102   UINT8   has_rc_nodes;
101103};
102104
103105struct dst_rcfilter_sw_context
r6049r6050
137139 * input[4]    - Voltage reference. Usually 0V.
138140 *
139141 ************************************************************************/
140#define DST_CRFILTER__ENABLE   DISCRETE_INPUT(0)
141#define DST_CRFILTER__IN      DISCRETE_INPUT(1)
142#define DST_CRFILTER__R         DISCRETE_INPUT(2)
143#define DST_CRFILTER__C         DISCRETE_INPUT(3)
144#define DST_CRFILTER__VREF      DISCRETE_INPUT(4)
142#define DST_CRFILTER__IN      DISCRETE_INPUT(0)
143#define DST_CRFILTER__R         DISCRETE_INPUT(1)
144#define DST_CRFILTER__C         DISCRETE_INPUT(2)
145#define DST_CRFILTER__VREF      DISCRETE_INPUT(3)
145146
146147static DISCRETE_STEP(dst_crfilter)
147148{
148149   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
149150
150   if(DST_CRFILTER__ENABLE)
151   if (UNEXPECTED(context->has_rc_nodes))
151152   {
152      node->output[0] = DST_CRFILTER__IN - context->vCap;
153      context->vCap += ((DST_CRFILTER__IN - DST_CRFILTER__VREF) - context->vCap) * context->exponent;
153      double rc = DST_CRFILTER__R * DST_CRFILTER__C;
154      if (rc != context->rc)
155      {
156         context->rc = rc;
157         context->exponent = RC_CHARGE_EXP(rc);
158      }
154159   }
155   else
156   {
157      node->output[0] = 0;
158   }
160
161   node->output[0] = DST_CRFILTER__IN - context->vCap;
162   //context->vCap += ((DST_CRFILTER__IN - context->vRef) - context->vCap) * context->exponent;
163   context->vCap += (node->output[0] - DST_CRFILTER__VREF) * context->exponent;
159164}
160165
161166static DISCRETE_RESET(dst_crfilter)
162167{
163168   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
164169
165   context->exponent = RC_CHARGE_EXP(DST_CRFILTER__R * DST_CRFILTER__C);
166   context->vCap   = 0;
170   context->has_rc_nodes = node->input_is_node & 0x6;
171   context->rc = DST_CRFILTER__R * DST_CRFILTER__C;
172   context->exponent = RC_CHARGE_EXP(context->rc);
173   context->vCap = 0;
167174   node->output[0] = DST_CRFILTER__IN;
168175}
169176
r6049r6050
503510         context->exponentC2 = RC_CHARGE_EXP(context->rTotal * info->c2);
504511         break;
505512      case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON:
506         context->rTotal = 1.0 / (1.0 / info->r1 + 1.0 / info->r2);
513         if (info->r2 == 0)
514            context->rTotal = info->r1;
515         else
516            context->rTotal = RES_2_PARALLEL(info->r1, info->r2);
507517      case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M:
508518      {
509519         double fc = 1.0 / (2 * M_PI * sqrt(context->rTotal * info->rF * info->c1 * info->c2));
r6049r6050
10141024 * input[4]    - Voltage reference. Usually 0V.
10151025 *
10161026 ************************************************************************/
1017#define DST_RCFILTER__ENABLE      DISCRETE_INPUT(0)
1018#define DST_RCFILTER__VIN      DISCRETE_INPUT(1)
1019#define DST_RCFILTER__R         DISCRETE_INPUT(2)
1020#define DST_RCFILTER__C         DISCRETE_INPUT(3)
1021#define DST_RCFILTER__VREF      DISCRETE_INPUT(4)
1027#define DST_RCFILTER__VIN      DISCRETE_INPUT(0)
1028#define DST_RCFILTER__R         DISCRETE_INPUT(1)
1029#define DST_RCFILTER__C         DISCRETE_INPUT(2)
1030#define DST_RCFILTER__VREF      DISCRETE_INPUT(3)
10221031
10231032static DISCRETE_STEP(dst_rcfilter)
10241033{
10251034   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
10261035
1036   if (UNEXPECTED(context->has_rc_nodes))
1037   {
1038      double rc = DST_RCFILTER__R * DST_RCFILTER__C;
1039      if (rc != context->rc)
1040      {
1041         context->rc = rc;
1042         context->exponent = RC_CHARGE_EXP(rc);
1043      }
1044   }
1045
10271046   /************************************************************************/
10281047   /* Next Value = PREV + (INPUT_VALUE - PREV)*(1-(EXP(-TIMEDELTA/RC)))    */
10291048   /************************************************************************/
10301049
1031   if(DST_RCFILTER__ENABLE)
1032   {
1033      context->vCap += ((DST_RCFILTER__VIN - DST_RCFILTER__VREF - context->vCap) * context->exponent);
1034      node->output[0] = context->vCap + DST_RCFILTER__VREF;
1035   }
1036   else
1037   {
1038      node->output[0] = 0;
1039   }
1050   context->vCap += ((DST_RCFILTER__VIN - node->output[0]) * context->exponent);
1051   node->output[0] = context->vCap + DST_RCFILTER__VREF;
10401052}
10411053
1054static DISCRETE_STEP(dst_rcfilter_fast)
1055{
1056   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
1057   node->output[0] += ((DST_RCFILTER__VIN - node->output[0]) * context->exponent);
1058}
1059
10421060static DISCRETE_RESET(dst_rcfilter)
10431061{
10441062   struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context;
10451063
1046   context->exponent = RC_CHARGE_EXP(DST_RCFILTER__R * DST_RCFILTER__C);
1064   context->has_rc_nodes = node->input_is_node & 0x6;
1065   context->rc = DST_RCFILTER__R * DST_RCFILTER__C;
1066   context->exponent = RC_CHARGE_EXP(context->rc);
10471067   context->vCap   = 0;
10481068   node->output[0] = 0;
1069   if (!context->has_rc_nodes && DST_RCFILTER__VREF == 0)
1070      node->step = DISCRETE_STEP_NAME(dst_rcfilter_fast);
10491071}
10501072
10511073/************************************************************************
src/emu/sound.c
r6049r6050
209209
210210   /* allocate a global timer for sound timing */
211211   global->update_timer = timer_alloc(machine, sound_update, NULL);
212   timer_adjust_periodic(global->update_timer, STREAMS_UPDATE_FREQUENCY, 0, STREAMS_UPDATE_FREQUENCY);
212   timer_adjust_periodic(global->update_timer, STREAMS_UPDATE_ATTOTIME, 0, STREAMS_UPDATE_ATTOTIME);
213213
214214   /* finally, do all the routing */
215215   VPRINTF(("route_sound\n"));
src/lib/util/palette.c
r6049r6050
44
55    Palette handling functions.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038******************************************************************************/
1139
1240#include "palette.h"
src/lib/util/harddisk.h
r6049r6050
44
55    Generic MAME hard disk implementation, with differencing files
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/chd.c
r6049r6050
44
55    MAME Compressed Hunks of Data file format
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "chd.h"
src/lib/util/options.h
r6049r6050
44
55    Core options code code
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#ifndef __OPTIONS_H__
src/lib/util/palette.h
r6049r6050
44
55    Core palette routines.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/chd.h
r6049r6050
44
55    MAME Compressed Hunks of Data file format
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/cdrom.c
r6049r6050
44
55    Generic MAME CD-ROM utilties - build IDE and SCSI CD-ROMs on top of this
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    IMPORTANT:
src/lib/util/aviio.c
r6049r6050
44
55    AVI movie format parsing helpers.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "aviio.h"
src/lib/util/cdrom.h
r6049r6050
44
55    Generic MAME cd-rom implementation
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/vbiparse.c
r6049r6050
44
55    Parse Philips codes and other data from VBI lines.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "osdcore.h"
src/lib/util/aviio.h
r6049r6050
44
55    AVI movie format parsing helpers.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#ifndef __AVIIO_H__
src/lib/util/vbiparse.h
r6049r6050
44
55    Parse Philips codes and other data from VBI lines.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/corestr.c
r6049r6050
44
55    Core string functions used throughout MAME.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************/
1139
1240#include "corestr.h"
src/lib/util/png.c
r6049r6050
44
55    PNG reading functions.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
1011
11*********************************************************************/
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
1215
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
38***************************************************************************/
39
1340#include <math.h>
1441#include <zlib.h>
1542#include "png.h"
src/lib/util/unicode.c
r6049r6050
44
55    Unicode related functions
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
10*********************************************************************/
9    Copyright Aaron Giles
10    All rights reserved.
1111
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
38***************************************************************************/
39
1240#include "unicode.h"
1341
1442
src/lib/util/corestr.h
r6049r6050
44
55    Core string functions used throughout MAME.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/coreutil.c
r6049r6050
44
55    Miscellaneous utility code
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
10****************************************************************************/
9    Copyright Aaron Giles
10    All rights reserved.
1111
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
38***************************************************************************/
39
1240#include "coreutil.h"
1341
1442
src/lib/util/png.h
r6049r6050
44
55    PNG file management.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/unicode.h
r6049r6050
1111    functions that convert UTF-8 and UTF-16 char clusters to and from
1212    singular 32-bit Unicode chars.
1313
14    Copyright Nicola Salmoria and the MAME Team.
15    Visit http://mamedev.org for licensing and usage restrictions.
14****************************************************************************
1615
17*********************************************************************/
16    Copyright Aaron Giles
17    All rights reserved.
1818
19    Redistribution and use in source and binary forms, with or without
20    modification, are permitted provided that the following conditions are
21    met:
22
23        * Redistributions of source code must retain the above copyright
24          notice, this list of conditions and the following disclaimer.
25        * Redistributions in binary form must reproduce the above copyright
26          notice, this list of conditions and the following disclaimer in
27          the documentation and/or other materials provided with the
28          distribution.
29        * Neither the name 'MAME' nor the names of its contributors may be
30          used to endorse or promote products derived from this software
31          without specific prior written permission.
32
33    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
34    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
37    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
39    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
41    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
42    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43    POSSIBILITY OF SUCH DAMAGE.
44
45***************************************************************************/
46
1947#pragma once
2048
2149#ifndef UNICODE_H
src/lib/util/coreutil.h
r6049r6050
44
55    Miscellaneous utility code
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/jedparse.c
r6049r6050
44
55    Parser for .JED files into raw fusemaps.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    Binary file format:
src/lib/util/xmlfile.c
r6049r6050
44
55    XML file parsing code.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "xmlfile.h"
src/lib/util/jedparse.h
r6049r6050
44
55    Parser for .JED files into raw fusemaps.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#ifndef __JEDPARSE_H__
src/lib/util/xmlfile.h
r6049r6050
44
55    XML file parsing code.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/unzip.c
r6049r6050
44
55    Functions to manipulate data within ZIP files.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "osdcore.h"
src/lib/util/astring.c
r6049r6050
44
55    Allocated string manipulation functions.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************/
1139
1240#include "astring.h"
src/lib/util/pool.c
r6049r6050
44
55    Resource pool code
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include <stdarg.h>
src/lib/util/unzip.h
r6049r6050
44
55    ZIP file management.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/astring.h
r6049r6050
44
55    Allocated string manipulation functions.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/bitmap.c
r6049r6050
44
55    Core bitmap routines.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "bitmap.h"
src/lib/util/pool.h
r6049r6050
44
55    Abstract object pool management
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#ifndef __POOL_H__
src/lib/util/bitmap.h
r6049r6050
44
55    Core bitmap routines.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/lib/util/huffman.c
r6049r6050
44
55    Video compression and decompression helpers.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    Maximum codelength is officially (alphabetsize - 1). This would be 255 bits
src/lib/util/avcomp.c
r6049r6050
44
55    Audio/video compression and decompression helpers.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038****************************************************************************
1139
1240    Each frame is compressed as a unit. The raw data is of the form:
src/lib/util/corefile.c
r6049r6050
44
55    File access functions.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "corefile.h"
src/lib/util/huffman.h
r6049r6050
44
55    Huffman compression routines.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#ifndef __HUFFMAN_H__
src/lib/util/harddisk.c
r6049r6050
44
55    Generic MAME hard disk implementation, with differencing files
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include "harddisk.h"
src/lib/util/avcomp.h
r6049r6050
44
55    Audio/video compression and decompression helpers.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#ifndef __AVCOMP_H__
src/lib/util/options.c
r6049r6050
44
55    Core options code code
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#include <stdarg.h>
src/lib/util/corefile.h
r6049r6050
44
55    Core file I/O interface functions and definitions.
66
7    Copyright Nicola Salmoria and the MAME Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
7****************************************************************************
98
9    Copyright Aaron Giles
10    All rights reserved.
11
12    Redistribution and use in source and binary forms, with or without
13    modification, are permitted provided that the following conditions are
14    met:
15
16        * Redistributions of source code must retain the above copyright
17          notice, this list of conditions and the following disclaimer.
18        * Redistributions in binary form must reproduce the above copyright
19          notice, this list of conditions and the following disclaimer in
20          the documentation and/or other materials provided with the
21          distribution.
22        * Neither the name 'MAME' nor the names of its contributors may be
23          used to endorse or promote products derived from this software
24          without specific prior written permission.
25
26    THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
27    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29    DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
30    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
35    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36    POSSIBILITY OF SUCH DAMAGE.
37
1038***************************************************************************/
1139
1240#pragma once
src/mess/drivers/osi.c
r6049r6050
203203   DISCRETE_INPUT_DATA(NODE_01)
204204
205205   DISCRETE_DAC_R1(NODE_02, NODE_01, DEFAULT_TTL_V_LOGIC_1, &osi600_dac)
206   DISCRETE_CRFILTER(NODE_03, 1, NODE_02, 1.0/(1.0/RES_K(1)+1.0/180+1.0/180+1.0/180+1.0/180), CAP_U(0.1))
206   DISCRETE_CRFILTER(NODE_03, NODE_02, 1.0/(1.0/RES_K(1)+1.0/180+1.0/180+1.0/180+1.0/180), CAP_U(0.1))
207207   DISCRETE_OUTPUT(NODE_03, 100)
208208   DISCRETE_GAIN(NODE_04, NODE_03, 32767.0/5)
209209   DISCRETE_OUTPUT(NODE_04, 100)
docs/messnew.txt
r6049r6050
77- P8000 (not working) [Matt Knoth, Fabio Priuli]
88
99
10
1011Systems Promoted from GAME_NOT_WORKING:
1112---------------------------------------
1213- Atari 800XL [Mariusz Wojcieszek]
r6049r6050
1617- Nokia MikroMikko 1 M6 [Curt Coder, Kara Trace]
1718
1819
20
1921Skeleton drivers:
2022-----------------
2123- Cosmicos
r6049r6050
7476
7577Source Changes:
7678----------------
77- The core is based on MAME 0.134u2.  This incorporates all features of the
79- The core is based on MAME 0.134u3.  This incorporates all features of the
7880  update to this core.  [MAME team]
7981
8082- Moved implementation to device.  [Miodrag Milanovic]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team