| Previous | 15994 Revisions | Next |
| r5614 Monday 7th September, 2009 at 02:41:24 UTC by Nathan Woods |
|---|
| Updated to MAME 0.133u5 core |
| [docs] | messnew.txt |
| [src/emu] | cheat.c cheat.h cpuintrf.h crsshair.c eigccppc.h eigccx86.h eminline.h fileio.c fileio.h inptport.c inptport.h inpttype.h input.c input.h inputseq.c inputseq.h mame.c mame.h profiler.c sound.c sound.h ui.c uigfx.c uiinput.c uimenu.c validity.c |
| [src/emu/cpu] | cpu.mak |
| [src/emu/cpu/i386] | i386op16.c i386op32.c i386ops.c i386priv.h |
| [src/emu/cpu/m37710] | m37710op.h |
| [src/emu/cpu/mc68hc11] | hc11dasm.c mc68hc11.c mc68hc11.h |
| [src/emu/cpu/mips] | mips3com.c mips3dsm.c |
| [src/emu/cpu/pic16c5x] | pic16c5x.c |
| [src/emu/cpu/sharc] | sharcops.c |
| [src/emu/cpu/tms34010] | 34010gfx.c |
| [src/emu/cpu/tms57002] | tms57002.c |
| [src/emu/cpu/z8] | z8.c z8.h z8dasm.c z8ops.c |
| [src/emu/debug] | debugcmd.c debugcpu.c debugcpu.h debughlp.c |
| [src/emu/machine] | 6526cia.c 68681.c |
| [src/emu/sound] | ay8910.c disc_dev.c disc_flt.c disc_inp.c disc_mth.c disc_sys.c* disc_wav.c discrete.c discrete.h k054539.c sn76477.c sound.mak |
| [src/emu/video] | poly.c v9938.c voodoo.c |
| [src/mame] | mame.mak mamedriv.c |
| [src/mame/audio] | 8080bw.c astrof.c bzone.c cinemat.c circus.c dkong.c galaxian.c mw8080bw.c scramble.c segag80r.c turbo.c |
| [src/mame/drivers] | adp.c astinvad.c bingoc.c bishjan.c blackt96.c btime.c buggychl.c bzone.c calomega.c cb2001.c chihiro.c circusc.c cmmb.c crbaloon.c darius.c darkhors.c ddenlovr.c djmain.c dunhuang.c firebeat.c funworld.c gaiden.c galaxi.c galaxian.c galaxold.c getrivia.c ghosteo.c goldnpkr.c gottlieb.c hshavoc.c hvyunit.c igs009.c igs017.c igs_blit.c igspoker.c ilpag.c itgambl2.c itgambl3.c jackie.c kaneko16.c kchamp.c kickgoal.c lastfght.c littlerb.c m10.c magicard.c maxaflex.c mazerbla.c meritm.c midas.c midtunit.c midyunit.c namcos10.c naomi.c ninjaw.c nmk16.c norautp.c playmark.c pntnpuzl.c pokechmp.c polepos.c psikyo.c quizpun2.c raiden2.c scobra.c segahang.c segaorun.c segaxbd.c segaybd.c seta.c speedbal.c spoker.c srmp6.c system1.c thepit.c tmaster.c trvmadns.c tutankhm.c uapce.c warriorb.c wheelfir.c |
| [src/mame/includes] | bzone.h dc.h deco16ic.h midyunit.h nmk16.h |
| [src/mame/layout] | connect4.lay |
| [src/mame/machine] | archimds.c atarigen.c dc.c harddriv.c kaneko16.c midyunit.c naomibd.c seicop.c |
| [src/mame/video] | amiga.c amigaaga.c argus.c bking.c blmbycar.c btoads.c cave.c cischeat.c cps1.c dc.c dday.c deco16ic.c deco_mlc.c decocass.c dynax.c esd16.c espial.c fitfight.c funybubl.c fuukifg2.c fuukifg3.c gaelco3d.c gaiden.c galastrm.c galpani2.c gcpinbal.c ginganin.c gticlub.c gunbustr.c holeland.c hyprduel.c itech32.c jaguar.c konamigx.c konamiic.c lordgun.c mcatadv.c metro.c midtunit.c midvunit.c midyunit.c midzeus.c midzeus2.c model1.c model2.c model3.c ms32.c namcos2.c namcos22.c nmk16.c nycaptor.c paradise.c pitnrun.c pokechmp.c powerins.c psikyo.c psikyosh.c psx.c realbrk.c rollerg.c segas18.c segas32.c seta.c slapfght.c slapshot.c ssv.c st0016.c stvvdp1.c stvvdp2.c suna16.c suna8.c superchs.c taito_h.c taitoair.c taitoic.c taitojc.c tmnt.c toaplan1.c toaplan2.c topspeed.c tsamurai.c twin16.c twincobr.c undrfire.c unico.c wgp.c yunsung8.c |
| [src/mess] | inputx.c uimess.c |
| [src/mess/drivers] | palm.c |
| [src/mess/machine] | coco.c dgn_beta.c mac.c |
| [src/mess/osd/windows] | dialog.c |
| [src/osd] | osdcore.h |
| [src/osd/osdmini] | minitime.c |
| [src/osd/windows] | eivcx86.h input.c wintime.c winwork.c |
| [src/osd/winui] | mui_opts.c |
| [src/tools] | unidasm.c |
| r5613 | r5614 | |
|---|---|---|
| 1482 | 1482 | |
| 1483 | 1483 | /* bit 2 controls the global mute */ |
| 1484 | 1484 | if ((data & 4) != (last_portb_write & 4)) |
| 1485 | sound_global_enable(!(data & 4)); | |
| 1485 | sound_global_enable(device->machine, !(data & 4)); | |
| 1486 | 1486 | |
| 1487 | 1487 | /* remember the last value written */ |
| 1488 | 1488 | last_portb_write = data; |
| r5613 | r5614 | |
|---|---|---|
| 270 | 270 | |
| 271 | 271 | /* Group Background and pitch */ |
| 272 | 272 | DISCRETE_TASK_START() |
| 273 | ||
| 273 | ||
| 274 | 274 | /************************************************/ |
| 275 | 275 | /* Background */ |
| 276 | 276 | /************************************************/ |
| 277 | ||
| 277 | ||
| 278 | 278 | DISCRETE_DAC_R1(NODE_100, 1, GAL_INP_BG_DAC, TTL_OUT, &galaxian_bck_dac) |
| 279 | 279 | DISCRETE_555_CC(NODE_105, 1, NODE_100, GAL_R21, GAL_C15, 0, 0, 0, &galaxian_bck_vco) |
| 280 | 280 | // Next is mult/add opamp circuit |
| r5613 | r5614 | |
| 285 | 285 | DISCRETE_555_ASTABLE_CV(NODE_115, GAL_INP_FS1, GAL_R22, GAL_R23, GAL_C17, NODE_111, &galaxian_555_vco_desc) |
| 286 | 286 | DISCRETE_555_ASTABLE_CV(NODE_116, GAL_INP_FS2, GAL_R25, GAL_R26, GAL_C18, NODE_111, &galaxian_555_vco_desc) |
| 287 | 287 | DISCRETE_555_ASTABLE_CV(NODE_117, GAL_INP_FS3, GAL_R28, GAL_R29, GAL_C19, NODE_111, &galaxian_555_vco_desc) |
| 288 | ||
| 288 | ||
| 289 | 289 | DISCRETE_MIXER3(NODE_120, 1, NODE_115, NODE_116, NODE_117, &galaxian_bck_mixer_desc) |
| 290 | ||
| 290 | ||
| 291 | 291 | /************************************************/ |
| 292 | 292 | /* PITCH */ |
| 293 | 293 | /************************************************/ |
| 294 | ||
| 294 | ||
| 295 | 295 | /* two cascaded LS164 which are reset to pitch latch value, |
| 296 | * thus generating SOUND_CLOCK / (256 - pitch_clock) signal | |
| 297 | * | |
| 298 | * One possibility to implement this is | |
| 299 | * DISCRETE_TRANSFORM3(NODE_130, SOUND_CLOCK, 256, GAL_INP_PITCH, "012-/") | |
| 300 | * DISCRETE_COUNTER(NODE_132, 1, 0, NODE_130, 15, DISC_COUNT_UP, 0, DISC_CLK_IS_FREQ) | |
| 301 | * but there is a native choice: | |
| 302 | */ | |
| 296 | * thus generating SOUND_CLOCK / (256 - pitch_clock) signal | |
| 297 | * | |
| 298 | * One possibility to implement this is | |
| 299 | * DISCRETE_TRANSFORM3(NODE_130, SOUND_CLOCK, 256, GAL_INP_PITCH, "012-/") | |
| 300 | * DISCRETE_COUNTER(NODE_132, 1, 0, NODE_130, 15, DISC_COUNT_UP, 0, DISC_CLK_IS_FREQ) | |
| 301 | * but there is a native choice: | |
| 302 | */ | |
| 303 | 303 | DISCRETE_NOTE(NODE_132, 1, SOUND_CLOCK, GAL_INP_PITCH, 255, 15, DISC_CLK_IS_FREQ) |
| 304 | ||
| 304 | ||
| 305 | 305 | /* from the 74393 (counter 2 above) only QA, QC, QD are used. |
| 306 | * We decode three here and use SUB_NODE(133,x) below to access. | |
| 307 | */ | |
| 306 | * We decode three here and use SUB_NODE(133,x) below to access. | |
| 307 | */ | |
| 308 | 308 | DISCRETE_BITS_DECODE(NODE_133, NODE_132, 0, 3, TTL_OUT) /* QA-QD 74393 */ |
| 309 | 309 | |
| 310 | 310 | /* End of this task */ |
| 311 | DISCRETE_TASK_END5(NODE_120, NODE_SUB(133,0),NODE_SUB(133,1),NODE_SUB(133,2),NODE_SUB(133,3)) | |
| 312 | ||
| 311 | DISCRETE_TASK_END() | |
| 312 | ||
| 313 | 313 | /* Group Hit and Fire */ |
| 314 | 314 | |
| 315 | 315 | DISCRETE_TASK_START() |
| r5613 | r5614 | |
| 320 | 320 | |
| 321 | 321 | /* NOISE */ |
| 322 | 322 | /* since only a sample of the LFSR is latched @V2 we let the lfsr |
| 323 | * run at a lower speed | |
| 324 | */ | |
| 323 | * run at a lower speed | |
| 324 | */ | |
| 325 | 325 | DISCRETE_LFSR_NOISE(NODE_150, 1, 1, RNG_RATE/100, 1.0, 0, 0.5, &galaxian_lfsr) |
| 326 | 326 | DISCRETE_SQUAREWFIX(NODE_151,1,60*264/2,1.0,50,0.5,0) /* 2V signal */ |
| 327 | 327 | DISCRETE_LOGIC_DFLIPFLOP(NODE_152,1,1,1,NODE_151,NODE_150) |
| 328 | 328 | |
| 329 | ||
| 329 | ||
| 330 | 330 | /* Not 100% correct - switching causes high impedance input for node_157 |
| 331 | ||
| 331 | * this is not emulated */ | |
| 332 | 332 | DISCRETE_RCDISC5(NODE_155, NODE_152, GAL_INP_HIT, (GAL_R35 + GAL_R36), GAL_C21) |
| 333 | 333 | DISCRETE_OP_AMP_FILTER(NODE_157, 1, NODE_155, 0, DISC_OP_AMP_FILTER_IS_BAND_PASS_1M, &galaxian_bandpass_desc) |
| 334 | ||
| 334 | ||
| 335 | 335 | /************************************************/ |
| 336 | 336 | /* FIRE */ |
| 337 | 337 | /************************************************/ |
| 338 | ||
| 338 | ||
| 339 | 339 | DISCRETE_LOGIC_INVERT(NODE_170, 1, GAL_INP_FIRE) |
| 340 | 340 | DISCRETE_MULTIPLY(NODE_171, 1, TTL_OUT, GAL_INP_FIRE) |
| 341 | 341 | DISCRETE_MULTIPLY(NODE_172, 1, TTL_OUT, NODE_170) // inverted |
| r5613 | r5614 | |
| 348 | 348 | //DISCRETE_MULTIPLY(NODE_176, 1, 1.0/GAL_R48, NODE_173) |
| 349 | 349 | //DISCRETE_ADDER2(NODE_177, 1, NODE_175, NODE_176) |
| 350 | 350 | DISCRETE_MULTIPLY(NODE_178, 1, RES_2_PARALLEL(GAL_R46, GAL_R48), NODE_177) |
| 351 | ||
| 351 | ||
| 352 | 352 | DISCRETE_555_ASTABLE_CV(NODE_181, 1, GAL_R44, GAL_R45, GAL_C27, NODE_178, &galaxian_555_fire_vco_desc) |
| 353 | ||
| 353 | ||
| 354 | 354 | /* 555 toggles discharge on rc discharge module */ |
| 355 | 355 | DISCRETE_RCDISC5(NODE_182, NODE_181, NODE_171, (GAL_R41), GAL_C25) |
| 356 | 356 | |
| 357 | 357 | /* End of task */ |
| 358 | DISCRETE_TASK_END | |
| 358 | DISCRETE_TASK_END | |
| 359 | 359 | |
| 360 | 360 | /************************************************/ |
| 361 | 361 | /* FINAL MIX */ |
| r5613 | r5614 | |
|---|---|---|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | /* Bit 7 enables amplifier (0 = on) */ |
| 281 | sound_global_enable(~data & 0x80); | |
| 281 | sound_global_enable(space->machine, ~data & 0x80); | |
| 282 | 282 | } |
| r5613 | r5614 | |
|---|---|---|
| 413 | 413 | sample_set_volume(samples, 11, (data & 0x40) ? 0 : 1.0); |
| 414 | 414 | |
| 415 | 415 | /* /GAME START */ |
| 416 | sound_global_enable(!(data & 0x80)); | |
| 416 | sound_global_enable(device->machine, !(data & 0x80)); | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
| r5613 | r5614 | |
| 568 | 568 | if ((diff & 0x40) && !(data & 0x40) && sample_playing(samples, 5)) sample_stop(samples, 5); |
| 569 | 569 | |
| 570 | 570 | /* GAME ON */ |
| 571 | sound_global_enable(data & 0x80); | |
| 571 | sound_global_enable(device->machine, data & 0x80); | |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 |
| r5613 | r5614 | |
|---|---|---|
| 106 | 106 | /* D6 - don't know. Probably something to do with the explosion sounds */ |
| 107 | 107 | |
| 108 | 108 | /* D7 - sound enable bit */ |
| 109 | sound_global_enable(data & 0x80); | |
| 109 | sound_global_enable(space->machine, data & 0x80); | |
| 110 | 110 | |
| 111 | 111 | port_1_last = data; |
| 112 | 112 | } |
| r5613 | r5614 | |
| 237 | 237 | /* D6 - explosion */ |
| 238 | 238 | |
| 239 | 239 | /* D7 - sound enable bit */ |
| 240 | sound_global_enable(data & 0x80); | |
| 240 | sound_global_enable(space->machine, data & 0x80); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 |
| r5613 | r5614 | |
|---|---|---|
| 22 | 22 | #include "streams.h" |
| 23 | 23 | #include "bzone.h" |
| 24 | 24 | |
| 25 | #if !BZONE_DISCRETE | |
| 26 | #define OUTPUT_RATE (6000*4) | |
| 27 | ||
| 28 | ||
| 29 | /* Statics */ | |
| 30 | static INT16 *discharge = NULL; | |
| 31 | #define EXP(charge,n) (charge ? 0x7fff - discharge[0x7fff-n] : discharge[n]) | |
| 32 | ||
| 33 | static sound_stream *channel; | |
| 34 | static int latch; | |
| 35 | static int poly_counter; | |
| 36 | static int poly_shift; | |
| 37 | ||
| 38 | static int explosion_clock; | |
| 39 | static int explosion_out; | |
| 40 | static int explosion_amp; | |
| 41 | static int explosion_amp_counter; | |
| 42 | ||
| 43 | static int shell_clock; | |
| 44 | static int shell_out; | |
| 45 | static int shell_amp; | |
| 46 | static int shell_amp_counter; | |
| 47 | ||
| 48 | static int motor_counter; | |
| 49 | static int motor_counter_a; | |
| 50 | static int motor_counter_b; | |
| 51 | static int motor_rate; | |
| 52 | static int motor_rate_new; | |
| 53 | static int motor_rate_counter; | |
| 54 | static int motor_amp; | |
| 55 | static int motor_amp_new; | |
| 56 | static int motor_amp_step; | |
| 57 | static int motor_amp_counter; | |
| 58 | ||
| 59 | WRITE8_HANDLER( bzone_sounds_w ) | |
| 60 | { | |
| 61 | if( data == latch ) | |
| 62 | return; | |
| 63 | ||
| 64 | stream_update(channel); | |
| 65 | latch = data; | |
| 66 | ||
| 67 | sound_global_enable(latch & 0x20); | |
| 68 | } | |
| 69 | ||
| 70 | static STREAM_UPDATE( bzone_sound_update ) | |
| 71 | { | |
| 72 | stream_sample_t *buffer = outputs[0]; | |
| 73 | while( samples-- ) | |
| 74 | { | |
| 75 | static int last_val = 0; | |
| 76 | int sum = 0; | |
| 77 | ||
| 78 | /* polynome shifter H5 and H4 (LS164) clocked with 6kHz */ | |
| 79 | poly_counter -= 6000; | |
| 80 | while( poly_counter <= 0 ) | |
| 81 | { | |
| 82 | int clock; | |
| 83 | ||
| 84 | poly_counter += OUTPUT_RATE; | |
| 85 | if( ((poly_shift & 0x0008) == 0) == ((poly_shift & 0x4000) == 0) ) | |
| 86 | poly_shift = (poly_shift << 1) | 1; | |
| 87 | else | |
| 88 | poly_shift <<= 1; | |
| 89 | ||
| 90 | /* NAND gate J4 */ | |
| 91 | clock = ((poly_shift & 0x7000) == 0x7000) ? 0 : 1; | |
| 92 | ||
| 93 | /* raising edge on pin 3 of J5 (LS74)? */ | |
| 94 | if( clock && !explosion_clock ) | |
| 95 | explosion_out ^= 1; | |
| 96 | ||
| 97 | /* save explo clock level */ | |
| 98 | explosion_clock = clock; | |
| 99 | ||
| 100 | /* input 11 of J5 (LS74) */ | |
| 101 | clock = (poly_shift >> 15) & 1; | |
| 102 | ||
| 103 | /* raising edge on pin 11 of J5 (LS74)? */ | |
| 104 | if( clock && !shell_clock ) | |
| 105 | shell_out ^= 1; | |
| 106 | ||
| 107 | /* save shell clock level */ | |
| 108 | shell_clock = clock; | |
| 109 | } | |
| 110 | ||
| 111 | /* explosion enable: charge C14 */ | |
| 112 | if( latch & 0x01 ) | |
| 113 | explosion_amp = 32767; | |
| 114 | ||
| 115 | /* explosion output? */ | |
| 116 | if( explosion_out ) | |
| 117 | { | |
| 118 | if( explosion_amp > 0 ) | |
| 119 | { | |
| 120 | /* | |
| 121 | * discharge C14 through R17 + R16 | |
| 122 | * time constant is 10e-6 * 23000 = 0.23 seconds | |
| 123 | * (samples were decaying much slower: 1/4th rate? ) | |
| 124 | */ | |
| 125 | explosion_amp_counter -= (int)(32767 / (0.23*4)); | |
| 126 | if( explosion_amp_counter < 0 ) | |
| 127 | { | |
| 128 | int n = (-explosion_amp_counter / OUTPUT_RATE) + 1; | |
| 129 | explosion_amp_counter += n * OUTPUT_RATE; | |
| 130 | if( (explosion_amp -= n) < 0 ) | |
| 131 | explosion_amp = 0; | |
| 132 | } | |
| 133 | } | |
| 134 | /* | |
| 135 | * I don't know the amplification of the op-amp | |
| 136 | * and feedback, so the loud/soft values are arbitrary | |
| 137 | */ | |
| 138 | if( latch & 0x02 ) /* explosion loud ? */ | |
| 139 | sum += EXP(0,explosion_amp)/3; | |
| 140 | else | |
| 141 | sum += EXP(0,explosion_amp)/4; | |
| 142 | } | |
| 143 | ||
| 144 | /* shell enable: charge C9 */ | |
| 145 | if( latch & 0x04 ) | |
| 146 | shell_amp = 32767; | |
| 147 | ||
| 148 | /* shell output? */ | |
| 149 | if( shell_out ) | |
| 150 | { | |
| 151 | if( shell_amp > 0 ) | |
| 152 | { | |
| 153 | /* | |
| 154 | * discharge C9 through R14 + R15 | |
| 155 | * time constant is 4.7e-6 * 23000 = 0.1081 seconds | |
| 156 | * (samples were decaying much slower: 1/4th rate? ) | |
| 157 | */ | |
| 158 | shell_amp_counter -= (int)(32767 / (0.1081*4)); | |
| 159 | if( shell_amp_counter < 0 ) | |
| 160 | { | |
| 161 | int n = (-shell_amp_counter / OUTPUT_RATE) + 1; | |
| 162 | shell_amp_counter += n * OUTPUT_RATE; | |
| 163 | if( (shell_amp -= n) < 0 ) | |
| 164 | shell_amp = 0; | |
| 165 | } | |
| 166 | } | |
| 167 | /* | |
| 168 | * I don't know the amplification of the op-amp | |
| 169 | * and feedback, so the loud/soft values are arbitrary | |
| 170 | */ | |
| 171 | if( latch & 0x08 ) /* shell loud ? */ | |
| 172 | sum += EXP(0,shell_amp)/3; | |
| 173 | else | |
| 174 | sum += EXP(0,shell_amp)/4; | |
| 175 | } | |
| 176 | ||
| 177 | if( latch & 0x80 ) | |
| 178 | { | |
| 179 | /* NE5555 timer | |
| 180 | * C = 0.018u, Ra = 100k, Rb = 125k | |
| 181 | * charge time = 0.693 * (Ra + Rb) * C = 3870us | |
| 182 | * discharge time = 0.693 * Rb * C = 1559.25us | |
| 183 | * freq approx. 184 Hz | |
| 184 | * I have no idea what frequencies are coming from the NE555 | |
| 185 | * with "MOTOR REV EN" being high or low. I took 240Hz as | |
| 186 | * higher rate and sweep up or down to the new rate in 0.25s | |
| 187 | */ | |
| 188 | motor_rate_new = (latch & 0x10) ? 240 : 184; | |
| 189 | if( motor_rate != motor_rate_new ) | |
| 190 | { | |
| 191 | /* sweep rate to new rate */ | |
| 192 | motor_rate_counter -= (int)((240 - 184) / 0.25); | |
| 193 | while( motor_rate_counter <= 0 ) | |
| 194 | { | |
| 195 | motor_rate_counter += OUTPUT_RATE; | |
| 196 | motor_rate += (motor_rate < motor_rate_new) ? +1 : -1; | |
| 197 | } | |
| 198 | } | |
| 199 | motor_counter -= motor_rate; | |
| 200 | while( motor_counter <= 0 ) | |
| 201 | { | |
| 202 | double r0, r1; | |
| 203 | ||
| 204 | motor_counter += OUTPUT_RATE; | |
| 205 | ||
| 206 | r0 = 1.0/1e12; | |
| 207 | r1 = 1.0/1e12; | |
| 208 | ||
| 209 | if( ++motor_counter_a == 16 ) | |
| 210 | motor_counter_a = 6; | |
| 211 | if( ++motor_counter_b == 16 ) | |
| 212 | motor_counter_b = 4; | |
| 213 | ||
| 214 | if( motor_counter_a & 8 ) /* bit 3 */ | |
| 215 | r1 += 1.0/33000; | |
| 216 | else | |
| 217 | r0 += 1.0/33000; | |
| 218 | if( motor_counter_a == 15 ) /* ripple carry */ | |
| 219 | r1 += 1.0/33000; | |
| 220 | else | |
| 221 | r0 += 1.0/33000; | |
| 222 | ||
| 223 | if( motor_counter_b & 8 ) /* bit 3 */ | |
| 224 | r1 += 1.0/33000; | |
| 225 | else | |
| 226 | r0 += 1.0/33000; | |
| 227 | if( motor_counter_b == 15 ) /* ripple carry */ | |
| 228 | r1 += 1.0/33000; | |
| 229 | else | |
| 230 | r0 += 1.0/33000; | |
| 231 | ||
| 232 | /* new voltage at C29 */ | |
| 233 | r0 = 1.0/r0; | |
| 234 | r1 = 1.0/r1; | |
| 235 | motor_amp_new = (int)(32767 * r0 / (r0 + r1)); | |
| 236 | ||
| 237 | /* charge/discharge C29 (0.47uF) */ | |
| 238 | if( motor_amp_new > motor_amp ) | |
| 239 | motor_amp_step = (int)((motor_amp_new - motor_amp) / (r1*0.47e-6)); | |
| 240 | else | |
| 241 | motor_amp_step = (int)((motor_amp - motor_amp_new) / (r0*0.47e-6)); | |
| 242 | } | |
| 243 | if( motor_amp != motor_amp_new ) | |
| 244 | { | |
| 245 | motor_amp_counter -= motor_amp_step; | |
| 246 | if( motor_amp_counter < 0 ) | |
| 247 | { | |
| 248 | int n = (-motor_amp_counter / OUTPUT_RATE) + 1; | |
| 249 | motor_amp_counter += n * OUTPUT_RATE; | |
| 250 | if( motor_amp > motor_amp_new ) | |
| 251 | { | |
| 252 | motor_amp -= n; | |
| 253 | if( motor_amp < motor_amp_new ) | |
| 254 | motor_amp = motor_amp_new; | |
| 255 | } | |
| 256 | else | |
| 257 | { | |
| 258 | motor_amp += n; | |
| 259 | if( motor_amp > motor_amp_new ) | |
| 260 | motor_amp = motor_amp_new; | |
| 261 | } | |
| 262 | } | |
| 263 | } | |
| 264 | sum += EXP((motor_amp<motor_amp_new),motor_amp)/3; | |
| 265 | } | |
| 266 | ||
| 267 | *buffer++ = (sum + last_val) / 2; | |
| 268 | ||
| 269 | /* crude 75% low pass filter */ | |
| 270 | last_val = (sum + last_val * 3) / 4; | |
| 271 | } | |
| 272 | } | |
| 273 | ||
| 274 | static DEVICE_START( bzone_sound ) | |
| 275 | { | |
| 276 | int i; | |
| 277 | ||
| 278 | discharge = auto_alloc_array(device->machine, INT16, 32768); | |
| 279 | for( i = 0; i < 0x8000; i++ ) | |
| 280 | discharge[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096)); | |
| 281 | ||
| 282 | channel = stream_create(device, 0, 1, OUTPUT_RATE, 0, bzone_sound_update); | |
| 283 | } | |
| 284 | ||
| 285 | ||
| 286 | DEVICE_GET_INFO( bzone_sound ) | |
| 287 | { | |
| 288 | switch (state) | |
| 289 | { | |
| 290 | /* --- the following bits of info are returned as pointers to data or functions --- */ | |
| 291 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(bzone_sound); break; | |
| 292 | ||
| 293 | /* --- the following bits of info are returned as NULL-terminated strings --- */ | |
| 294 | case DEVINFO_STR_NAME: strcpy(info->s, "Battlezone Engine"); break; | |
| 295 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 296 | } | |
| 297 | } | |
| 298 | ||
| 299 | #else | |
| 300 | ||
| 301 | 25 | #include "sound/discrete.h" |
| 302 | 26 | #include "sound/pokey.h" |
| 303 | 27 | |
| r5613 | r5614 | |
| 567 | 291 | discrete_sound_w(device, BZ_INPUT, data); |
| 568 | 292 | |
| 569 | 293 | output_set_value("startled", (data >> 6) & 1); |
| 570 | sound_global_enable(data & 0x20); | |
| 294 | sound_global_enable(device->machine, data & 0x20); | |
| 571 | 295 | } |
| 572 | 296 | |
| 573 | 297 | |
| r5613 | r5614 | |
| 584 | 308 | |
| 585 | 309 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 586 | 310 | MACHINE_DRIVER_END |
| 587 | ||
| 588 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 335 | 335 | context->r_total[0] = RES_2_PARALLEL(context->r_in[0] + DKONG_CUSTOM_R4, NE555_CV_R); |
| 336 | 336 | context->r_total[1] = RES_2_PARALLEL((context->r_in[1] + DKONG_CUSTOM_R4), NE555_CV_R); |
| 337 | 337 | /* precalculate charging exponents */ |
| 338 | context->exp[0] = RC_CHARGE_EXP(context->r_total[0] * DKONG_CUSTOM_C); | |
| 339 | context->exp[1] = RC_CHARGE_EXP(context->r_total[1] * DKONG_CUSTOM_C); | |
| 338 | context->exp[0] = RC_CHARGE_EXP(node, context->r_total[0] * DKONG_CUSTOM_C); | |
| 339 | context->exp[1] = RC_CHARGE_EXP(node, context->r_total[1] * DKONG_CUSTOM_C); | |
| 340 | 340 | |
| 341 | 341 | node->output[0] = 0; |
| 342 | 342 | } |
| r5613 | r5614 | |
| 348 | 348 | }; |
| 349 | 349 | #endif |
| 350 | 350 | |
| 351 | ||
| 352 | static DISCRETE_SOUND_START(dkong2b_dac) | |
| 353 | DISCRETE_INPUT_DATA(DS_DAC) | |
| 354 | DISCRETE_OUTPUT(DS_DAC, 1) | |
| 355 | DISCRETE_SOUND_END | |
| 356 | ||
| 357 | 351 | static DISCRETE_SOUND_START(dkong2b) |
| 358 | 352 | |
| 359 | 353 | /************************************************/ |
| r5613 | r5614 | |
| 390 | 384 | |
| 391 | 385 | DISCRETE_RCINTEGRATE(NODE_22,NODE_20,DK_R5, RES_2_PARALLEL(DK_R4+DK_R3,DK_R6),0,DK_C19,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 392 | 386 | DISCRETE_MULTIPLY(DS_OUT_SOUND0,1,NODE_22,DK_R3/R_SERIES(DK_R3,DK_R4)) |
| 393 | DISCRETE_TASK_END( | |
| 387 | DISCRETE_TASK_END( | |
| 394 | 388 | |
| 395 | 389 | /************************************************/ |
| 396 | 390 | /* Jump */ |
| r5613 | r5614 | |
| 424 | 418 | |
| 425 | 419 | DISCRETE_RCINTEGRATE(NODE_39,NODE_38,DK_R27, RES_2_PARALLEL(DK_R28,DK_R26+DK_R25),0,DK_C16,DK_SUP_V,DISC_RC_INTEGRATE_TYPE1) |
| 426 | 420 | DISCRETE_MULTIPLY(DS_OUT_SOUND1,1,NODE_39,DK_R25/(DK_R26+DK_R25)) |
| 427 | DISCRETE_TASK_END( | |
| 421 | DISCRETE_TASK_END( | |
| 428 | 422 | |
| 429 | 423 | /************************************************/ |
| 430 | 424 | /* Walk */ |
| r5613 | r5614 | |
| 450 | 444 | /* Filter and divide - omitted C22 */ |
| 451 | 445 | DISCRETE_CRFILTER(NODE_61, 1, NODE_60, DK_R15+DK_R16, DK_C23) |
| 452 | 446 | DISCRETE_MULTIPLY(DS_OUT_SOUND2, 1, NODE_61, DK_R15/(DK_R15+DK_R16)) |
| 453 | DISCRETE_TASK_END( | |
| 447 | DISCRETE_TASK_END( | |
| 454 | 448 | |
| 455 | 449 | /************************************************/ |
| 456 | 450 | /* DAC */ |
| 457 | 451 | /************************************************/ |
| 458 | 452 | |
| 459 | 453 | DISCRETE_TASK_START() |
| 460 | DISCRETE_INPUTX_STREAM(DS_DAC, 0, 1.0, 0) | |
| 454 | /* Buffer DAC first to input stream 0 */ | |
| 455 | DISCRETE_INPUT_BUFFER(DS_DAC, 0) | |
| 456 | //DISCRETE_INPUT_DATA(DS_DAC) | |
| 461 | 457 | /* Signal decay circuit Q7, R20, C32 */ |
| 462 | 458 | DISCRETE_RCDISC(NODE_70, DS_DISCHARGE_INV, 1, DK_R20, DK_C32) |
| 463 | 459 | DISCRETE_TRANSFORM4(NODE_71, DS_DAC, DK_SUP_V/256.0, NODE_70, DS_DISCHARGE_INV, "01*3!2+*") |
| r5613 | r5614 | |
| 478 | 474 | #else |
| 479 | 475 | DISCRETE_MULTIPLY(DS_OUT_DAC, 1, NODE_73, DS_ADJ_DAC) |
| 480 | 476 | #endif |
| 481 | DISCRETE_TASK_END( | |
| 477 | DISCRETE_TASK_END( | |
| 482 | 478 | |
| 483 | 479 | /************************************************/ |
| 484 | 480 | /* Amplifier */ |
| r5613 | r5614 | |
| 497 | 493 | DISCRETE_OUTPUT(NODE_288, 32767.0/5.0 * 10) |
| 498 | 494 | #else |
| 499 | 495 | DISCRETE_OUTPUT(NODE_296, 32767.0/5.0 * 3.41) |
| 496 | /* Test */ | |
| 497 | //DISCRETE_CSVLOG2(NODE_296, NODE_288) | |
| 498 | //DISCRETE_WAVELOG1(NODE_296, 32767.0/5.0 * 3.41) | |
| 500 | 499 | #endif |
| 501 | 500 | |
| 502 | 501 | DISCRETE_SOUND_END |
| r5613 | r5614 | |
| 639 | 638 | DISCRETE_INPUT_NOT(DS_DISCHARGE_INV) |
| 640 | 639 | |
| 641 | 640 | /* Must be in task if tasks added */ |
| 642 | DISCRETE_INPUT | |
| 641 | DISCRETE_INPUT | |
| 643 | 642 | //DISCRETE_INPUT_DATA(DS_DAC) |
| 644 | 643 | |
| 645 | 644 | /* Mixing - DAC */ |
| r5613 | r5614 | |
| 1171 | 1170 | AM_WRITE(dkong_voice_w) |
| 1172 | 1171 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_DEVREAD("ls175.3d", dkong_tune_r) |
| 1173 | 1172 | AM_WRITE(dkong_voice_w) |
| 1174 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("disc | |
| 1173 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("discrete", dkong_p1_w) /* only write to dac */ | |
| 1175 | 1174 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_READWRITE("virtual_p2") |
| 1176 | 1175 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_LATCH8_READBIT("ls259.6h", 5) |
| 1177 | 1176 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_LATCH8_READBIT("ls259.6h", 4) |
| r5613 | r5614 | |
| 1187 | 1186 | |
| 1188 | 1187 | static ADDRESS_MAP_START( radarsc1_sound_io_map, ADDRESS_SPACE_IO, 8 ) |
| 1189 | 1188 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_DEVREAD("ls175.3d", latch8_r) |
| 1190 | AM_RANGE(0x00, 0xff) AM_DEVWRITE("disc | |
| 1189 | AM_RANGE(0x00, 0xff) AM_DEVWRITE("discrete", dkong_p1_w) /* DAC here */ | |
| 1191 | 1190 | AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_LATCH8_READ("virtual_p1") |
| 1192 | 1191 | AM_DEVWRITE("tms", M58817_command_w) |
| 1193 | 1192 | AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_LATCH8_WRITE("virtual_p2") |
| r5613 | r5614 | |
| 1262 | 1261 | MDRV_CPU_IO_MAP(dkong_sound_io_map) |
| 1263 | 1262 | |
| 1264 | 1263 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1265 | ||
| 1266 | MDRV_SOUND_ADD("discdac", DISCRETE, 0) | |
| 1267 | MDRV_SOUND_CONFIG_DISCRETE(dkong2b_dac) | |
| 1268 | MDRV_SOUND_ROUTE_EX(0, "discrete", 1.0, 0) | |
| 1269 | ||
| 1270 | 1264 | MDRV_SOUND_ADD("discrete", DISCRETE, 0) |
| 1271 | 1265 | MDRV_SOUND_CONFIG_DISCRETE(dkong2b) |
| 1272 | 1266 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| r5613 | r5614 | |
|---|---|---|
| 274 | 274 | if ((data & 0x10) && sample_playing(samples, 4)) sample_stop(samples, 4); |
| 275 | 275 | |
| 276 | 276 | /* MUTE */ |
| 277 | sound_global_enable(!(data & 0x20)); | |
| 277 | sound_global_enable(space->machine, !(data & 0x20)); | |
| 278 | 278 | |
| 279 | 279 | /* REFILL: channel 5 */ |
| 280 | 280 | if (!(data & 0x40) && !sample_playing(samples, 5)) sample_start(samples, 5, 9, FALSE); |
| r5613 | r5614 | |
|---|---|---|
| 84 | 84 | TTL7474_update(device->machine, 2); |
| 85 | 85 | |
| 86 | 86 | /* bit 4 is sound disable */ |
| 87 | sound_global_enable(~data & 0x10); | |
| 87 | sound_global_enable(device->machine, ~data & 0x10); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w ) |
| r5613 | r5614 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | c8080bw_screen_red_w(data & 0x04); |
| 54 | 54 | |
| 55 | sound_global_enable(data & 0x20); | |
| 55 | sound_global_enable(space->machine, data & 0x20); | |
| 56 | 56 | |
| 57 | 57 | port_1_last_extra = data; |
| 58 | 58 | |
| r5613 | r5614 | |
| 145 | 145 | if (rising_bits & 0x08) sample_start(samples, 1, 0, 0); /* Alien Hit */ |
| 146 | 146 | if (rising_bits & 0x10) sample_start(samples, 2, 5, 0); /* Bonus Ship (not confirmed) */ |
| 147 | 147 | |
| 148 | sound_global_enable(data & 0x20); | |
| 148 | sound_global_enable(space->machine, data & 0x20); | |
| 149 | 149 | |
| 150 | 150 | c8080bw_screen_red_w(data & 0x04); |
| 151 | 151 | |
| r5613 | r5614 | |
| 204 | 204 | if (rising_bits & 0x08) sample_start(samples, 1, 7, 0); /* Hit a Bomb */ |
| 205 | 205 | if (rising_bits & 0x10) sample_start(samples, 3, 8, 0); /* Bonus Base at 1500 points */ |
| 206 | 206 | |
| 207 | sound_global_enable(data & 0x20); | |
| 207 | sound_global_enable(space->machine, data & 0x20); | |
| 208 | 208 | |
| 209 | 209 | c8080bw_screen_red_w(data & 0x04); |
| 210 | 210 | |
| r5613 | r5614 | |
| 281 | 281 | if (rising_bits & 0x04) sample_start(samples, 2, 3, 0); /* Move */ |
| 282 | 282 | if (rising_bits & 0x08) sample_start(samples, 3, 2, 0); /* Hit */ |
| 283 | 283 | |
| 284 | sound_global_enable(data & 0x20); | |
| 284 | sound_global_enable(space->machine, data & 0x20); | |
| 285 | 285 | |
| 286 | 286 | c8080bw_screen_red_w(data & 0x01); |
| 287 | 287 | |
| r5613 | r5614 | |
| 876 | 876 | |
| 877 | 877 | const device_config *discrete = devtag_get_device(space->machine, "discrete"); |
| 878 | 878 | |
| 879 | printf( "schaser_sh_port_2_w: %02x\n", data ); | |
| 879 | //printf( "schaser_sh_port_2_w: %02x\n", data ); | |
| 880 | 880 | |
| 881 | 881 | discrete_sound_w(discrete, SCHASER_MUSIC_BIT, data & 0x01); |
| 882 | 882 | |
| 883 | 883 | discrete_sound_w(discrete, SCHASER_SND_EN, data & 0x02); |
| 884 | sound_global_enable(data & 0x02); | |
| 884 | sound_global_enable(space->machine, data & 0x02); | |
| 885 | 885 | |
| 886 | 886 | coin_lockout_global_w(data & 0x04); |
| 887 | 887 | |
| r5613 | r5614 | |
| 1090 | 1090 | |
| 1091 | 1091 | speaker_level_w(speaker, (data & 0x01) ? 1 : 0); /* End-of-Level */ |
| 1092 | 1092 | |
| 1093 | sound_global_enable(data & 0x10); | |
| 1093 | sound_global_enable(space->machine, data & 0x10); | |
| 1094 | 1094 | |
| 1095 | 1095 | c8080bw_flip_screen_w(space, data & 0x20); |
| 1096 | 1096 | } |
| r5613 | r5614 | |
| 1112 | 1112 | if (rising_bits & 0x08) sample_start(samples, 1, 2, 0); /* Man dead */ |
| 1113 | 1113 | if (rising_bits & 0x10) sample_start(samples, 5, 8, 0); /* Bonus Man? */ |
| 1114 | 1114 | |
| 1115 | sound_global_enable(data & 0x20); | |
| 1115 | sound_global_enable(space->machine, data & 0x20); | |
| 1116 | 1116 | |
| 1117 | 1117 | port_1_last_extra = data; |
| 1118 | 1118 | } |
| r5613 | r5614 | |
|---|---|---|
| 1058 | 1058 | |
| 1059 | 1059 | coin_counter_w(0, (data >> 2) & 0x01); |
| 1060 | 1060 | |
| 1061 | sound_global_enable((data >> 3) & 0x01); | |
| 1061 | sound_global_enable(device->machine, (data >> 3) & 0x01); | |
| 1062 | 1062 | |
| 1063 | 1063 | discrete_sound_w(device, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03); |
| 1064 | 1064 | discrete_sound_w(device, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03); |
| r5613 | r5614 | |
| 1653 | 1653 | |
| 1654 | 1654 | coin_counter_w(0, (data >> 2) & 0x01); |
| 1655 | 1655 | |
| 1656 | sound_global_enable((data >> 3) & 0x01); | |
| 1656 | sound_global_enable(space->machine, (data >> 3) & 0x01); | |
| 1657 | 1657 | |
| 1658 | 1658 | /* if (data & 0x10) enable RIGHT MISSILE sound (goes to right speaker) */ |
| 1659 | 1659 | if (rising_bits & 0x10) sample_start(samples1, 0, 0, 0); |
| r5613 | r5614 | |
| 1749 | 1749 | |
| 1750 | 1750 | coin_counter_w(0, (data >> 2) & 0x01); |
| 1751 | 1751 | |
| 1752 | sound_global_enable((data >> 3) & 0x01); | |
| 1752 | sound_global_enable(space->machine, (data >> 3) & 0x01); | |
| 1753 | 1753 | |
| 1754 | 1754 | /* if (data & 0x10) enable LEFT PLAYER SHOT sound (goes to left speaker) */ |
| 1755 | 1755 | if (rising_bits & 0x10) sample_start(samples0, 0, 0, 0); |
| r5613 | r5614 | |
| 2052 | 2052 | |
| 2053 | 2053 | discrete_sound_w(device, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01); |
| 2054 | 2054 | |
| 2055 | sound_global_enable((data >> 3) & 0x01); | |
| 2055 | sound_global_enable(device->machine, (data >> 3) & 0x01); | |
| 2056 | 2056 | |
| 2057 | 2057 | discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01); |
| 2058 | 2058 | |
| r5613 | r5614 | |
| 2109 | 2109 | |
| 2110 | 2110 | /* if (data & 0x02) enable SHUFFLE ROLLOVER sound */ |
| 2111 | 2111 | |
| 2112 | sound_global_enable((data >> 2) & 0x01); | |
| 2112 | sound_global_enable(space->machine, (data >> 2) & 0x01); | |
| 2113 | 2113 | |
| 2114 | 2114 | /* set SHUFFLE ROLLING sound((data >> 3) & 0x07) 0, if not rolling, |
| 2115 | 2115 | faster rolling = higher number */ |
| r5613 | r5614 | |
| 2198 | 2198 | |
| 2199 | 2199 | coin_counter_w(0, (data >> 2) & 0x01); |
| 2200 | 2200 | |
| 2201 | sound_global_enable((data >> 3) & 0x01); | |
| 2201 | sound_global_enable(space->machine, (data >> 3) & 0x01); | |
| 2202 | 2202 | |
| 2203 | 2203 | /* if (data & 0x10) enable LEFT SHOOT sound */ |
| 2204 | 2204 | |
| r5613 | r5614 | |
| 2742 | 2742 | |
| 2743 | 2743 | WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w ) |
| 2744 | 2744 | { |
| 2745 | sound_global_enable((data >> 0) & 0x01); | |
| 2745 | sound_global_enable(device->machine, (data >> 0) & 0x01); | |
| 2746 | 2746 | |
| 2747 | 2747 | /* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL', |
| 2748 | 2748 | but it is never set by the software */ |
| r5613 | r5614 | |
| 2830 | 2830 | |
| 2831 | 2831 | /* if (data & 0x02) enable ENEMY SHOT sound */ |
| 2832 | 2832 | |
| 2833 | sound_global_enable((data >> 2) & 0x01); | |
| 2833 | sound_global_enable(space->machine, (data >> 2) & 0x01); | |
| 2834 | 2834 | |
| 2835 | 2835 | coin_counter_w(0, (data >> 3) & 0x01); |
| 2836 | 2836 | |
| r5613 | r5614 | |
| 2956 | 2956 | |
| 2957 | 2957 | coin_counter_w(0, (data >> 1) & 0x01); |
| 2958 | 2958 | |
| 2959 | sound_global_enable((data >> 2) & 0x01); | |
| 2959 | sound_global_enable(device->machine, (data >> 2) & 0x01); | |
| 2960 | 2960 | |
| 2961 | 2961 | discrete_sound_w(device, BOWLER_FOWL_EN, (data >> 3) & 0x01); |
| 2962 | 2962 | |
| r5613 | r5614 | |
| 3693 | 3693 | discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08); |
| 3694 | 3694 | discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10); |
| 3695 | 3695 | |
| 3696 | sound_global_enable(data & 0x20); | |
| 3696 | sound_global_enable(device->machine, data & 0x20); | |
| 3697 | 3697 | |
| 3698 | 3698 | /* D6 and D7 are not connected */ |
| 3699 | 3699 | } |
| r5613 | r5614 | |
| 4075 | 4075 | discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08); |
| 4076 | 4076 | discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10); |
| 4077 | 4077 | |
| 4078 | sound_global_enable(data & 0x20); | |
| 4078 | sound_global_enable(device->machine, data & 0x20); | |
| 4079 | 4079 | |
| 4080 | 4080 | /* D6 and D7 are not connected */ |
| 4081 | 4081 | } |
| r5613 | r5614 | |
|---|---|---|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| 466 | /************************************* | |
| 467 | * | |
| 468 | * MK Turbo Ninja protection | |
| 469 | * | |
| 470 | *************************************/ | |
| 471 | ||
| 472 | static READ16_HANDLER( mkturbo_prot_r ) | |
| 473 | { | |
| 474 | /* the security GAL overlays a counter of some sort at 0xfffff400 in ROM space. | |
| 475 | * A startup protection check expects to read back two different values in succession */ | |
| 476 | return mame_rand(space->machine); | |
| 477 | } | |
| 478 | ||
| 479 | DRIVER_INIT( mkyturbo ) | |
| 480 | { | |
| 481 | /* protection */ | |
| 482 | memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xfffff400, 0xfffff40f, 0, 0, mkturbo_prot_r); | |
| 483 | ||
| 484 | DRIVER_INIT_CALL(mkyunit); | |
| 485 | } | |
| 486 | ||
| 466 | 487 | /********************** Terminator 2 **********************/ |
| 467 | 488 | |
| 468 | 489 | static void term2_init_common(running_machine *machine, write16_space_func hack_w) |
| r5613 | r5614 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | #endif |
| 114 | 114 | |
| 115 | static UINT8 dc_controller_id[0x70] = | |
| 116 | { | |
| 117 | 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 118 | 0xff, 0x00, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x63, 0x61, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, | |
| 119 | 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, | |
| 120 | 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x42, 0x79, 0x20, 0x6f, 0x72, 0x20, 0x55, | |
| 121 | 0x6e, 0x64, 0x65, 0x72, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x46, 0x72, 0x6f, | |
| 122 | 0x6d, 0x20, 0x53, 0x45, 0x47, 0x41, 0x20, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x50, 0x52, 0x49, 0x53, | |
| 123 | 0x45, 0x53, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0xae, 0x01, 0xf4, 0x01 | |
| 124 | }; | |
| 125 | ||
| 126 | static UINT8 dc_controller_version[0x50] = | |
| 127 | { | |
| 128 | 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x31, 0x30, 0x2c, 0x31, 0x39, | |
| 129 | 0x39, 0x38, 0x2f, 0x30, 0x39, 0x2f, 0x32, 0x38, 0x2c, 0x33, 0x31, 0x35, 0x2d, 0x36, 0x32, 0x31, | |
| 130 | 0x31, 0x2d, 0x41, 0x42, 0x20, 0x20, 0x20, 0x2c, 0x41, 0x6e, 0x61, 0x6c, 0x6f, 0x67, 0x20, 0x4d, | |
| 131 | 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x20, 0x3a, 0x20, 0x54, 0x68, 0x65, 0x20, 0x34, 0x74, 0x68, 0x20, | |
| 132 | 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x35, 0x2f, 0x38, 0x20, 0x20, 0x2b, 0x44, 0x46 | |
| 133 | }; | |
| 134 | ||
| 115 | 135 | // selected Maple registers |
| 116 | 136 | enum |
| 117 | 137 | { |
| r5613 | r5614 | |
| 517 | 537 | #endif |
| 518 | 538 | } |
| 519 | 539 | |
| 520 | READ64_HANDLER( dc_maple_r ) | |
| 540 | // Naomi/Naomi2 implementation with Maple/JVS bridging | |
| 541 | READ64_HANDLER( naomi_maple_r ) | |
| 521 | 542 | { |
| 522 | 543 | int reg; |
| 523 | 544 | UINT64 shift; |
| r5613 | r5614 | |
| 530 | 551 | return (UINT64)maple_regs[reg] << shift; |
| 531 | 552 | } |
| 532 | 553 | |
| 533 | WRITE64_HANDLER( | |
| 554 | WRITE64_HANDLER( naomi_maple_w ) | |
| 534 | 555 | { |
| 535 | 556 | int reg; |
| 536 | 557 | UINT64 shift; |
| r5613 | r5614 | |
| 542 | 563 | static int jvs_command = 0,jvs_address = 0; |
| 543 | 564 | int chk; |
| 544 | 565 | int a; |
| 545 | int off,len; | |
| 566 | int off,len,func; | |
| 546 | 567 | |
| 547 | 568 | reg = decode_reg32_64(space->machine, offset, mem_mask, &shift); |
| 548 | 569 | dat = (UINT32)(data >> shift); |
| r5613 | r5614 | |
| 563 | 584 | { |
| 564 | 585 | maple_regs[reg] = 1; |
| 565 | 586 | dat=maple_regs[SB_MDSTAR]; |
| 566 | //printf("Maple DMA: %08x %08x %08x %08x\n",maple_regs[SB_MDSTAR],maple_regs[SB_MDTSEL],maple_regs[SB_MDEN],maple_regs[SB_MDST]); | |
| 567 | //printf(" %08x %08x %08x %08x\n",maple_regs[SB_MSYS],maple_regs[SB_MST],maple_regs[SB_MSHTCL],maple_regs[SB_MMSEL]); | |
| 587 | // printf("Maple DMA: %08x %08x %08x %08x\n",maple_regs[SB_MDSTAR],maple_regs[SB_MDTSEL],maple_regs[SB_MDEN],maple_regs[SB_MDST]); | |
| 588 | // printf(" %08x %08x %08x %08x\n",maple_regs[SB_MSYS],maple_regs[SB_MST],maple_regs[SB_MSHTCL],maple_regs[SB_MMSEL]); | |
| 568 | 589 | while (1) // do transfers |
| 569 | 590 | { |
| 570 | 591 | ddtdata.source=dat; // source address |
| r5613 | r5614 | |
| 587 | 608 | command=buff[2] & 255; |
| 588 | 609 | dap=(buff[2] >> 8) & 255; |
| 589 | 610 | sap=(buff[2] >> 16) & 255; |
| 611 | func = buff[3]; | |
| 590 | 612 | //buff[0]=0; |
| 591 | 613 | //if(buff[1] == 0x700) |
| 592 | 614 | // printf("%08x %08x",buff[0],buff[2]); |
| r5613 | r5614 | |
| 602 | 624 | case 3: |
| 603 | 625 | ddtdata.length=1; |
| 604 | 626 | #if DEBUG_MAPLE |
| 605 | printf("MAPLE: transfer command %x port %x\n", command, port); | |
| 627 | printf("MAPLE: transfer command %x port %x length %x\n", command, port, length); | |
| 606 | 628 | #endif |
| 607 | 629 | break; |
| 630 | ||
| 608 | 631 | case 0x80: // get data and compute checksum |
| 609 | 632 | ddtdata.length=length; |
| 610 | 633 | ddtdata.direction=0; |
| r5613 | r5614 | |
| 842 | 865 | |
| 843 | 866 | if (endflag) |
| 844 | 867 | { |
| 845 | #if ENABLE_MAPLE_IRQ | |
| 868 | #if 1 //ENABLE_MAPLE_IRQ | |
| 846 | 869 | /*TODO: this fixes moeru but breaks other games, understand why.*/ |
| 847 | 870 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_MAPLE; |
| 848 | 871 | dc_update_interrupt_status(space->machine); |
| r5613 | r5614 | |
| 867 | 890 | } |
| 868 | 891 | } |
| 869 | 892 | |
| 893 | // implementation for Dreamcast and Atomiswave supports only standard Sega Dreamcast Maple commands and peripherals | |
| 894 | READ64_HANDLER( dc_maple_r ) | |
| 895 | { | |
| 896 | int reg; | |
| 897 | UINT64 shift; | |
| 898 | ||
| 899 | reg = decode_reg32_64(space->machine, offset, mem_mask, &shift); | |
| 900 | ||
| 901 | #if DEBUG_MAPLE_REGS | |
| 902 | mame_printf_verbose("MAPLE: Unmapped read %08x\n", 0x5f6c00+reg*4); | |
| 903 | #endif | |
| 904 | return (UINT64)maple_regs[reg] << shift; | |
| 905 | } | |
| 906 | ||
| 907 | WRITE64_HANDLER( dc_maple_w ) | |
| 908 | { | |
| 909 | int reg, func; | |
| 910 | UINT64 shift; | |
| 911 | UINT32 old,dat; | |
| 912 | struct sh4_ddt_dma ddtdata; | |
| 913 | UINT32 buff[512]; | |
| 914 | UINT32 endflag,port,pattern,length,command,dap,sap,destination; | |
| 915 | ||
| 916 | reg = decode_reg32_64(space->machine, offset, mem_mask, &shift); | |
| 917 | dat = (UINT32)(data >> shift); | |
| 918 | old = maple_regs[reg]; | |
| 919 | ||
| 920 | #if DEBUG_MAPLE_REGS | |
| 921 | mame_printf_verbose("MAPLE: [%08x=%x] write %" I64FMT "x to %x (reg %x: %s), mask %" I64FMT "x\n", 0x5f6c00+reg*4, dat, data >> shift, offset, reg, maple_names[reg], mem_mask); | |
| 922 | #endif | |
| 923 | ||
| 924 | maple_regs[reg] = dat; // 5f6c00+reg*4=dat | |
| 925 | switch (reg) | |
| 926 | { | |
| 927 | case SB_MDST: | |
| 928 | maple_regs[reg] = old; | |
| 929 | if (!(old & 1) && (dat & 1) && maple_regs[SB_MDEN] & 1) // 0 -> 1 | |
| 930 | { | |
| 931 | if (!(maple_regs[SB_MDTSEL] & 1)) | |
| 932 | { | |
| 933 | maple_regs[reg] = 1; | |
| 934 | dat=maple_regs[SB_MDSTAR]; | |
| 935 | // printf("Maple DMA: %08x %08x %08x %08x\n",maple_regs[SB_MDSTAR],maple_regs[SB_MDTSEL],maple_regs[SB_MDEN],maple_regs[SB_MDST]); | |
| 936 | // printf(" %08x %08x %08x %08x\n",maple_regs[SB_MSYS],maple_regs[SB_MST],maple_regs[SB_MSHTCL],maple_regs[SB_MMSEL]); | |
| 937 | while (1) // do transfers | |
| 938 | { | |
| 939 | ddtdata.source=dat; // source address | |
| 940 | ddtdata.length=3; // words to transfer | |
| 941 | ddtdata.size=4; // bytes per word | |
| 942 | ddtdata.buffer=buff; // destination buffer | |
| 943 | ddtdata.direction=0; // 0 source to buffer, 1 buffer to source | |
| 944 | ddtdata.channel= -1; // not used | |
| 945 | ddtdata.mode= -1; // copy from/to buffer | |
| 946 | sh4_dma_ddt(cputag_get_cpu(space->machine, "maincpu"), &ddtdata); | |
| 947 | ||
| 948 | maple_regs[reg] = 0; | |
| 949 | endflag=buff[0] & 0x80000000; | |
| 950 | port=(buff[0] >> 16) & 3; | |
| 951 | pattern=(buff[0] >> 8) & 7; | |
| 952 | length=buff[0] & 255; | |
| 953 | //if(length == 0) | |
| 954 | // length = 0x100; | |
| 955 | destination=buff[1]; | |
| 956 | command=buff[2] & 255; | |
| 957 | dap=(buff[2] >> 8) & 255; | |
| 958 | sap=(buff[2] >> 16) & 255; | |
| 959 | func = buff[3]; | |
| 960 | //buff[0]=0; | |
| 961 | //if(buff[1] == 0x700) | |
| 962 | // printf("%08x %08x",buff[0],buff[2]); | |
| 963 | ddtdata.size=4; | |
| 964 | ||
| 965 | if (pattern == 0) | |
| 966 | { | |
| 967 | char pL[8], pH[8]; | |
| 968 | ||
| 969 | if (port > 0) | |
| 970 | buff[0]=0xffffffff; | |
| 971 | switch (command) | |
| 972 | { | |
| 973 | case 1: // AW/DC MAPLE_CMD_INFO | |
| 974 | ddtdata.length = sizeof(dc_controller_id)/4; | |
| 975 | ||
| 976 | buff[0] = 5; // MAPLE_RESP_INFO | |
| 977 | memcpy(&buff[1], dc_controller_id, sizeof(dc_controller_id)); | |
| 978 | break; | |
| 979 | ||
| 980 | case 2: // AW/DC MAPLE_CMD_EXT_INFO | |
| 981 | ddtdata.length = sizeof(dc_controller_id)+sizeof(dc_controller_version)/4; | |
| 982 | ||
| 983 | buff[0] = 6; // MAPLE_RESP_EXT_INFO | |
| 984 | memcpy(&buff[1], dc_controller_id, sizeof(dc_controller_id)); | |
| 985 | memcpy(&buff[1+(0x70/4)], dc_controller_version, sizeof(dc_controller_version)); | |
| 986 | break; | |
| 987 | ||
| 988 | case 3: // AW/DC MAPLE_CMD_RESET | |
| 989 | ddtdata.length=1; | |
| 990 | #if DEBUG_MAPLE | |
| 991 | printf("MAPLE: transfer command %x port %x length %x\n", command, port, length); | |
| 992 | #endif | |
| 993 | break; | |
| 994 | ||
| 995 | case 9: // AW/DC MAPLE_CMD_GET_COND | |
| 996 | buff[0] = 8; // MAPLE_RESP_DATA | |
| 997 | ||
| 998 | sprintf(pL, "P%dL", port+1); | |
| 999 | sprintf(pH, "P%dH", port+1); | |
| 1000 | ||
| 1001 | buff[1] = func; | |
| 1002 | buff[2] = input_port_read(space->machine, pH)<<8 | input_port_read(space->machine, pL) | 0xffff0000; | |
| 1003 | buff[3] = 0xffffffff; | |
| 1004 | ddtdata.length=(8/4)+1; | |
| 1005 | break; | |
| 1006 | default: | |
| 1007 | #if DEBUG_MAPLE | |
| 1008 | printf("MAPLE: unknown transfer command %x port %x\n", command, port); | |
| 1009 | #endif | |
| 1010 | ddtdata.length=0; | |
| 1011 | endflag = 1; /*TODO: check this */ | |
| 1012 | //buff[0]=0xffffffff; | |
| 1013 | break; | |
| 1014 | } | |
| 1015 | } | |
| 1016 | ddtdata.destination=destination; | |
| 1017 | ddtdata.buffer=buff; | |
| 1018 | ddtdata.direction=1; | |
| 1019 | sh4_dma_ddt(cputag_get_cpu(space->machine, "maincpu"),&ddtdata); | |
| 1020 | ||
| 1021 | if (endflag) | |
| 1022 | { | |
| 1023 | #if ENABLE_MAPLE_IRQ | |
| 1024 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_MAPLE; | |
| 1025 | dc_update_interrupt_status(space->machine); | |
| 1026 | #endif | |
| 1027 | break; | |
| 1028 | } | |
| 1029 | // skip fixed packet header | |
| 1030 | dat += 8; | |
| 1031 | // skip transfer data | |
| 1032 | dat += (length + 1) * 4; | |
| 1033 | } // do transfers | |
| 1034 | maple_regs[reg] = 0; | |
| 1035 | } | |
| 1036 | else | |
| 1037 | { | |
| 1038 | #if DEBUG_MAPLE | |
| 1039 | printf("MAPLE: hardware trigger not supported yet\n"); | |
| 1040 | #endif | |
| 1041 | } | |
| 1042 | } | |
| 1043 | break; | |
| 1044 | } | |
| 1045 | } | |
| 1046 | ||
| 870 | 1047 | INPUT_CHANGED( dc_coin_slots_callback ) |
| 871 | 1048 | { |
| 872 | 1049 | UINT32 *counter = (UINT32 *)param; |
| r5613 | r5614 | |
| 950 | 1127 | mame_printf_verbose("G1CTRL: unsupported transfer\n"); |
| 951 | 1128 | return; |
| 952 | 1129 | } |
| 953 | // printf("ROM board DMA to %x (PC %x)\n", g1bus_regs[SB_GDSTAR], cpu_get_pc(space->cpu)); | |
| 1130 | // printf("ROM board DMA to %x len %x (PC %x)\n", g1bus_regs[SB_GDSTAR], g1bus_regs[SB_GDLEN], cpu_get_pc(space->cpu)); | |
| 954 | 1131 | ROM = (UINT8 *)devtag_get_info_ptr(space->machine, "rom_board", DEVINFO_PTR_MEMORY); |
| 955 | 1132 | dmaoffset = (UINT32)devtag_get_info_int(space->machine, "rom_board", DEVINFO_INT_DMAOFFSET); |
| 956 | 1133 | ddtdata.destination=g1bus_regs[SB_GDSTAR]; // destination address |
| r5613 | r5614 | |
|---|---|---|
| 1074 | 1074 | |
| 1075 | 1075 | /* use this for debugging the video controller values */ |
| 1076 | 1076 | #if 0 |
| 1077 | if (input_code_pressed(KEYCODE_8)) | |
| 1077 | if (input_code_pressed(machine, KEYCODE_8)) | |
| 1078 | 1078 | { |
| 1079 | 1079 | static FILE *out; |
| 1080 | 1080 | if (!out) out = fopen("scroll.log", "w"); |
| r5613 | r5614 | |
|---|---|---|
| 182 | 182 | #define NAOMIBD_FLAG_SPECIAL_MODE (4) // used to access protection registers |
| 183 | 183 | #define NAOMIBD_FLAG_ADDRESS_SHUFFLE (2) // 0 to let protection chip en/decrypt, 1 for normal |
| 184 | 184 | |
| 185 | #define NAOMIBD_PRINTF_PROTECTION (0) // 1 to printf protection access details | |
| 186 | ||
| 185 | 187 | /************************************* |
| 186 | 188 | * |
| 187 | 189 | * Prototypes |
| r5613 | r5614 | |
| 225 | 227 | |
| 226 | 228 | UINT32 *prot_translate; |
| 227 | 229 | int prot_reverse_bytes; |
| 230 | #if NAOMIBD_PRINTF_PROTECTION | |
| 231 | int prot_pio_count; | |
| 232 | #endif | |
| 228 | 233 | }; |
| 229 | 234 | |
| 230 | 235 | // maps protection offsets to real addresses |
| r5613 | r5614 | |
| 254 | 259 | 0xad8c, 0, 0xf0000, 0x923d, 0, 0x100000, 0x4a65, 0, 0x110000, 0x9958, 0, 0x120000, 0x8216, 0, 0x130000, |
| 255 | 260 | 0xaa91, 0, 0x140000, 0xd007, 0, 0x150000, 0xead, 0, 0x160000, 0x492, 0, 0x170000, |
| 256 | 261 | 0xffffffff, 0xffffffff, 0xffffffff } }, |
| 262 | { "pjustic", 0, { 0x923d, 0, 0, 0x3e41, 0, 0x10000, 0xb7af, 0, 0x20000, | |
| 263 | 0x9651, 0, 0x30000, 0xad8c, 0, 0x40000, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 264 | { "hmgeo", 0, { 0x6cc8, 0, 0x000000, 0x7b92, 0, 0x010000, 0x69bc, 0, 0x020000, | |
| 265 | 0x6d16, 0, 0x030000, 0x6134, 0, 0x040000, 0x1340, 0, 0x050000, | |
| 266 | 0x7716, 0, 0x060000, 0x2e1a, 0, 0x070000, 0x3030, 0, 0x080000, | |
| 267 | 0x0870, 0, 0x090000, 0x2856, 0, 0x0a0000, 0x4224, 0, 0x0b0000, | |
| 268 | 0x6df0, 0, 0x0c0000, 0x0dd8, 0, 0x0d0000, 0x576c, 0, 0x0e0000, | |
| 269 | 0x0534, 0, 0x0f0000, 0x0904, 0, 0x100000, 0x2f14, 0, 0x110000, | |
| 270 | 0x1792, 0, 0x120000, 0x6866, 0, 0x130000, 0x06fa, 0, 0x140000, | |
| 271 | 0x2842, 0, 0x150000, 0x7cc8, 0, 0x160000, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 272 | { "wwfroyal",0, { 0xaaaa, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 273 | { "gwing2", 0, { -1, 0x85ddc0, 0, 0xd567, 0, 0x10000, 0xe329, 0, 0x30000, 0xc112, 0, 0x50000, | |
| 274 | 0xabcd, 0, 0x70000, 0xef01, 0, 0x90000, 0x1234, 0, 0xb0000, 0x5678, 0, 0xd0000, | |
| 275 | 0x5555, 0, 0xf0000, 0x6666, 0, 0x110000, 0xa901, 0, 0x130000, 0xa802, 0, 0x150000, | |
| 276 | 0x3232, 0, 0x170000, 0x8989, 0, 0x190000, 0x6655, 0, 0x1a0000, | |
| 277 | 0x3944, 0, 0x1c0000, 0x655a, 0, 0x1d0000, 0xf513, 0, 0x1e0000, | |
| 278 | 0xb957, 0, 0, 0x37ca, 0, 0, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 279 | /* { "pstone2", 0, { 0x4a65, 0, 0x000000, 0x0ead, 0, 0x010000, 0x0492, 0, 0x020000, 0x414a, 0, 0x030000, | |
| 280 | 0xad8c, 0, 0x040000, 0x923d, 0, 0x050000, 0x4a65, 0, 0x060000, 0x9958, 0, 0x070000, | |
| 281 | 0x8216, 0, 0x080000, 0xaa91, 0, 0x090000, 0xd007, 0, 0x0a0000, 0x71ee, 0, 0x0b0000, | |
| 282 | 0x3e41, 0, 0x0c0000, 0xb7af, 0, 0x0d0000, 0x9651, 0, 0x0e0000, 0x0492, 0, 0x0f0000, | |
| 283 | 0x414a, 0, 0x100000, 0xaf99, 0, 0x110000, 0x5182, 0, 0x120000, 0x08aa, 0, 0x130000, | |
| 284 | 0x69d0, 0, 0x140000, 0x9d71, 0, 0x150000, 0xd319, 0, 0x160000, 0xcc09, 0, 0x170000, | |
| 285 | 0x5ec4, 0, 0x180000, 0x7103, 0, 0x190000, 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 286 | */ | |
| 287 | { "toyfight", 0,{ 0x0615, 0, 0x0000, 0x1999, 0, 0x1000, 0x7510, 0, 0x2000, 0x5736, 0, 0x3000, | |
| 288 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 289 | { "ggx", 0,{ -1, 0x200000, 0x100000, -1, 0x210004, 0x110000, -1, 0x220008, 0x120000, -1, 0x228000, 0x130000, | |
| 290 | 0x3af9, 0, 0x000000, 0x2288, 0, 0x010000, 0xe5e6, 0, 0x020000, 0xebb0, 0, 0x030000, | |
| 291 | 0x0228, 0, 0x040000, 0x872c, 0, 0x050000, 0xbba0, 0, 0x060000, 0x772f, 0, 0x070000, | |
| 292 | 0x2924, 0, 0x080000, 0x3222, 0, 0x090000, 0x7954, 0, 0x0a0000, 0x5acd, 0, 0x0b0000, | |
| 293 | 0xdd19, 0, 0x0c0000, 0x2428, 0, 0x0d0000, 0x3329, 0, 0x0e0000, 0x2142, 0, 0x0f0000, | |
| 294 | 0xffffffff, 0xffffffff, 0xffffffff } }, | |
| 257 | 295 | }; |
| 258 | 296 | |
| 259 | 297 | /*************************************************************************** |
| r5613 | r5614 | |
| 378 | 416 | |
| 379 | 417 | if (v->prot_translate == NULL) |
| 380 | 418 | { |
| 381 | logerror("naomibd: reading protection data, but none was supplied\n"); | |
| 419 | #if NAOMIBD_PRINTF_PROTECTION | |
| 420 | v->prot_pio_count += 2; | |
| 421 | printf("naomibd: reading protection data, but none was supplied (now %x bytes)\n", v->prot_pio_count); | |
| 422 | #endif | |
| 382 | 423 | return 0; |
| 383 | 424 | } |
| 384 | 425 | |
| 426 | #if NAOMIBD_PRINTF_PROTECTION | |
| 427 | v->prot_pio_count += 2; | |
| 428 | printf("naomibd: PIO read count %x\n", v->prot_pio_count); | |
| 429 | #endif | |
| 430 | ||
| 385 | 431 | if (v->prot_reverse_bytes) |
| 386 | 432 | { |
| 387 | 433 | ret = (UINT64)(prot[byte_offset+1] | (prot[byte_offset]<<8)); |
| r5613 | r5614 | |
| 393 | 439 | |
| 394 | 440 | v->prot_offset++; |
| 395 | 441 | } |
| 442 | #if NAOMIBD_PRINTF_PROTECTION | |
| 396 | 443 | else |
| 397 | 444 | { |
| 398 | | |
| 445 | p | |
| 399 | 446 | } |
| 447 | #endif | |
| 400 | 448 | } |
| 401 | 449 | else |
| 402 | 450 | { |
| r5613 | r5614 | |
| 564 | 612 | v->rom_offset &= 0xffff0000; |
| 565 | 613 | v->rom_offset |= ((data >> 32) & 0xffff); |
| 566 | 614 | } |
| 615 | ||
| 616 | #if NAOMIBD_PRINTF_PROTECTION | |
| 617 | printf("PIO: offset to %x\n", v->rom_offset); | |
| 618 | #endif | |
| 567 | 619 | } |
| 568 | 620 | break; |
| 569 | 621 | case 1: |
| r5613 | r5614 | |
| 593 | 645 | case 0x1fffc: // decryption key |
| 594 | 646 | v->prot_key = data; |
| 595 | 647 | |
| 596 | // printf("Protection: set up read @ %x, key %x (PIO %x DMA %x) [%s]\n", v->prot_offset, v->prot_key, v->rom_offset, v->dma_offset, cpuexec_describe_context(device->machine)); | |
| 648 | #if NAOMIBD_PRINTF_PROTECTION | |
| 649 | printf("Protection: set up read @ %x, key %x (PIO %x DMA %x) [%s]\n", v->prot_offset*2, v->prot_key, v->rom_offset, v->dma_offset, cpuexec_describe_context(device->machine)); | |
| 597 | 650 | |
| 651 | v->prot_pio_count = 0; | |
| 652 | #endif | |
| 653 | ||
| 598 | 654 | // translate address if necessary |
| 599 | 655 | if (v->prot_translate != NULL) |
| 600 | 656 | { |
| r5613 | r5614 | |
| 606 | 662 | { |
| 607 | 663 | if (v->prot_translate[i] == v->prot_key) |
| 608 | 664 | { |
| 609 | mame_printf_verbose("Protection: got key %x, translated to %x\n", v->prot_key, v->prot_translate[i+2]); | |
| 665 | #if NAOMIBD_PRINTF_PROTECTION | |
| 666 | printf("Protection: got key %x, translated to %x\n", v->prot_key, v->prot_translate[i+2]); | |
| 667 | #endif | |
| 610 | 668 | v->prot_offset = v->prot_translate[i+2]/2; |
| 611 | 669 | break; |
| 612 | 670 | } |
| r5613 | r5614 | |
| 619 | 677 | { |
| 620 | 678 | if (v->prot_translate[i+1] == (v->prot_offset*2)) |
| 621 | 679 | { |
| 622 | mame_printf_verbose("Protection: got offset %x, translated to %x\n", v->prot_offset, v->prot_translate[i+2]); | |
| 680 | #if NAOMIBD_PRINTF_PROTECTION | |
| 681 | printf("Protection: got offset %x, translated to %x\n", v->prot_offset, v->prot_translate[i+2]); | |
| 682 | #endif | |
| 623 | 683 | v->prot_offset = v->prot_translate[i+2]/2; |
| 624 | 684 | break; |
| 625 | 685 | } |
| r5613 | r5614 | |
| 630 | 690 | } |
| 631 | 691 | } |
| 632 | 692 | } |
| 693 | #if NAOMIBD_PRINTF_PROTECTION | |
| 633 | 694 | else |
| 634 | 695 | { |
| 635 | | |
| 696 | p | |
| 636 | 697 | } |
| 698 | #endif | |
| 637 | 699 | break; |
| 638 | 700 | |
| 639 | 701 | default: |
| 640 | mame_printf_verbose("naomibd: unknown protection write %x @ %x\n", (UINT32)data, offset); | |
| 702 | #if NAOMIBD_PRINTF_PROTECTION | |
| 703 | printf("naomibd: unknown protection write %x @ %x\n", (UINT32)data, offset); | |
| 704 | #endif | |
| 641 | 705 | break; |
| 642 | 706 | } |
| 643 | 707 | } |
| r5613 | r5614 | |
| 908 | 972 | |
| 909 | 973 | /* find the protection address translation for this game */ |
| 910 | 974 | v->prot_translate = (UINT32 *)0; |
| 975 | #if NAOMIBD_PRINTF_PROTECTION | |
| 976 | v->prot_pio_count = 0; | |
| 977 | #endif | |
| 911 | 978 | for (i=0; i<ARRAY_LENGTH(naomibd_translate_tbl); i++) |
| 912 | 979 | { |
| 913 | 980 | if (!strcmp(device->machine->gamedrv->name, naomibd_translate_tbl[i].name)) |
| r5613 | r5614 | |
| 1030 | 1097 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(naomibd_config); break; |
| 1031 | 1098 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 1032 | 1099 | case DEVINFO_INT_DMAOFFSET: |
| 1033 | // printf("DMA source %x, flags %x\n", get_safe_token(device)->dma_offset, get_safe_token(device)->dma_offset_flags); | |
| 1100 | #if NAOMIBD_PRINTF_PROTECTION | |
| 1101 | printf("DMA source %08x, flags %x\n", get_safe_token(device)->dma_offset, get_safe_token(device)->dma_offset_flags); | |
| 1102 | #endif | |
| 1034 | 1103 | |
| 1035 | 1104 | // if the flag is cleared that lets the protection chip go, |
| 1036 | // we need to handle this specially. | |
| 1037 | if (!(get_safe_token(device)->dma_offset_flags & NAOMIBD_FLAG_ADDRESS_SHUFFLE)) | |
| 1105 | // we need to handle this specially. but not on DIMM boards. | |
| 1106 | if (!(get_safe_token(device)->dma_offset_flags & NAOMIBD_FLAG_ADDRESS_SHUFFLE) && (get_safe_token(device)->type == ROM_BOARD)) | |
| 1038 | 1107 | { |
| 1039 | 1108 | if (!strcmp(device->machine->gamedrv->name, "qmegamis")) |
| 1040 | 1109 | { |
| r5613 | r5614 | |
| 1089 | 1158 | } |
| 1090 | 1159 | break; |
| 1091 | 1160 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Naomi/Atomiswave plug-in board"); break; |
| 1092 | case DEVINFO_STR_VERSION: strcpy(info->s, "1. | |
| 1161 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.1"); break; | |
| 1093 | 1162 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 1094 | 1163 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; |
| 1095 | 1164 | } |
| r5613 | r5614 | |
|---|---|---|
| 202 | 202 | } |
| 203 | 203 | else |
| 204 | 204 | { |
| 205 | | |
| 205 | logerror | |
| 206 | 206 | } |
| 207 | 207 | } |
| 208 | 208 | |
| r5613 | r5614 | |
| 232 | 232 | } |
| 233 | 233 | else |
| 234 | 234 | { |
| 235 | | |
| 235 | logerror | |
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | } |
| r5613 | r5614 | |
|---|---|---|
| 379 | 379 | UINT16 new_wheel = input_port_read(space->machine, "12BADC0") << 4; |
| 380 | 380 | |
| 381 | 381 | /* hack to display the wheel position */ |
| 382 | if (input_code_pressed(KEYCODE_LSHIFT)) | |
| 382 | if (input_code_pressed(space->machine, KEYCODE_LSHIFT)) | |
| 383 | 383 | popmessage("%04X", new_wheel); |
| 384 | 384 | |
| 385 | 385 | /* if we crossed the center line, latch the edge bit */ |
| r5613 | r5614 | |
| 888 | 888 | |
| 889 | 889 | static TIMER_CALLBACK( deferred_adsp_bank_switch ) |
| 890 | 890 | { |
| 891 | if (LOG_COMMANDS && m68k_adsp_buffer_bank != param && input_code_pressed(KEYCODE_L)) | |
| 891 | if (LOG_COMMANDS && m68k_adsp_buffer_bank != param && input_code_pressed(machine, KEYCODE_L)) | |
| 892 | 892 | { |
| 893 | 893 | static FILE *commands; |
| 894 | 894 | if (!commands) commands = fopen("commands.log", "w"); |
| r5613 | r5614 | |
|---|---|---|
| 37 | 37 | - see notes about this "calculator" implementation in drivers\galpanic.c |
| 38 | 38 | - bonkadv only uses Random Number, XY Overlap Collision bit and register '0x02' |
| 39 | 39 | */ |
| 40 | READ16_HANDLER(shogwarr_calc_r); | |
| 41 | WRITE16_HANDLER(shogwarr_calc_w); | |
| 40 | 42 | |
| 41 | ||
| 42 | 43 | static struct { |
| 43 | 44 | UINT16 x1p, y1p, x1s, y1s; |
| 44 | 45 | UINT16 x2p, y2p, x2s, y2s; |
| r5613 | r5614 | |
| 123 | 124 | |
| 124 | 125 | WRITE16_HANDLER(bloodwar_calc_w) |
| 125 | 126 | { |
| 127 | ||
| 128 | int isbrap = ( !strcmp(space->machine->gamedrv->name,"brapboysj") || !strcmp(space->machine->gamedrv->name,"brapboys")); | |
| 129 | ||
| 130 | /* our implementation is incomplete, b.rap boys requires some modifications */ | |
| 131 | if (isbrap) | |
| 132 | { | |
| 133 | shogwarr_calc_w(space,offset,data,mem_mask); | |
| 134 | return; | |
| 135 | } | |
| 136 | ||
| 126 | 137 | switch (offset) |
| 127 | 138 | { |
| 128 | 139 | // p is position, s is size |
| r5613 | r5614 | |
| 188 | 199 | UINT16 data = 0; |
| 189 | 200 | INT16 x_coll, y_coll; |
| 190 | 201 | |
| 202 | /* our implementation is incomplete, b.rap boys requires some modifications */ | |
| 203 | int isbrap = ( !strcmp(space->machine->gamedrv->name,"brapboysj") || !strcmp(space->machine->gamedrv->name,"brapboys")); | |
| 204 | ||
| 205 | if (isbrap) | |
| 206 | { | |
| 207 | return shogwarr_calc_r(space,offset,mem_mask); | |
| 208 | } | |
| 209 | ||
| 191 | 210 | x_coll = calc_compute_x(); |
| 192 | 211 | y_coll = calc_compute_y(); |
| 193 | 212 | |
| r5613 | r5614 | |
| 592 | 611 | - this is usually '3', but if it's larger than 3 it enables an 'inline encryption' mode, whereby the decryption table is stored in the |
| 593 | 612 | - right before the length register |
| 594 | 613 | |
| 595 | OFFSET 1 - a 'mode' register of some sort, usually 0,1,2 or 3 for used data, shogun also called a 'blank' command (length 0) with mode 8 | |
| 614 | OFFSET 1 - a 'mode' register of some sort, usually 0,1,2 or 3 for used data, shogun also called a 'blank' command (length 0) with mode 8 and mode 6 | |
| 615 | - seems to cause eeprom access and reset write addresses | |
| 596 | 616 | |
| 597 | 617 | OFFSET 2 - unknown, might be some kind of 'step' register |
| 618 | - 4 bits are 'shift' used in the decryption | |
| 619 | - the other 4 bits probably control if the odd/even bytes are inverted, and if an alt shift is applied every other byte | |
| 598 | 620 | |
| 599 | OFFSET 3 - decryption key - specifies which decryption table to use (ignored for inline tables, see offset 0) | |
| 621 | OFFSET 3 - decryption key - specifies which decryption table to use (ignored for inline tables, see offset 0), key 00 is blank | |
| 600 | 622 | |
| 601 | 623 | (inline decryption table goes here if specified) |
| 602 | 624 | |
| r5613 | r5614 | |
| 611 | 633 | |
| 612 | 634 | */ |
| 613 | 635 | |
| 614 | /* | |
| 615 | 636 | |
| 616 | ||
| 617 | Status | |
| 618 | ||
| 619 | Blocks marked ** are decrypted and verified | |
| 620 | .. means I have the data to study | |
| 621 | ||
| 622 | (Shogun Warriors) | |
| 623 | ||
| 624 | Block 10 Found Base 0060 - Mode? 01 Unknown 14 Key 00 Length 0532 | |
| 625 | Block 11 Found Base 0598 - Mode? 01 Unknown 48 Key 00 Length 03f4 | |
| 626 | ||
| 627 | ** Block 19 Found Base 09bc - Mode? 03 Unknown 01 Key 01 Length 00da | |
| 628 | ||
| 629 | Block 30 Found Base 0b20 - Mode? 02 Unknown 01 Key 10 Length 022a | |
| 630 | Block 31 Found Base 0d50 - Mode? 02 Unknown 03 Key 11 Length 0246 | |
| 631 | Block 32 Found Base 0f9c - Mode? 02 Unknown 01 Key 12 Length 0226 | |
| 632 | Block 33 Found Base 11c8 - Mode? 02 Unknown 02 Key 13 Length 0216 | |
| 633 | Block 34 Found Base 13e4 - Mode? 02 Unknown 02 Key 14 Length 0226 | |
| 634 | Block 35 Found Base 1610 - Mode? 02 Unknown 03 Key 15 Length 024a | |
| 635 | Block 36 Found Base 1860 - Mode? 02 Unknown 03 Key 16 Length 0222 | |
| 636 | Block 37 Found Base 1a88 - Mode? 02 Unknown 02 Key 17 Length 0216 | |
| 637 | Block 38 Found Base 1ca4 - Mode? 02 Unknown 02 Key 18 Length 0222 | |
| 638 | Block 39 Found Base 1ecc - Mode? 02 Unknown 01 Key 19 Length 0206 | |
| 639 | Block 3a Found Base 20d8 - Mode? 02 Unknown 01 Key 1a Length 0202 | |
| 640 | Block 3b Found Base 22e0 - Mode? 02 Unknown 02 Key 1b Length 021e | |
| 641 | ||
| 642 | ** Block 40 Found Base 251c - Inline Encryption (size 22) - Mode? 01 Unknown 03 Key (unused?) 62 Length 1008 | |
| 643 | ** Block 41 Found Base 354c - Mode? 01 Unknown 7c Key 00 Length 1008 | |
| 644 | ||
| 645 | ** Block 58 Found Base 45de - Mode? 01 Unknown 02 Key 15 Length 1d4e | |
| 646 | ||
| 647 | Block 60 Found Base 635c - Mode? 02 Unknown 3f Key b0 Length 00e6 | |
| 648 | Block 61 Found Base 6448 - Mode? 02 Unknown 3f Key 31 Length 00e6 | |
| 649 | Block 62 Found Base 6534 - Mode? 02 Unknown 3f Key 32 Length 00e6 | |
| 650 | Block 63 Found Base 6620 - Inline Encryption (size 33) - Mode? 02 Unknown 3f Key (unused?) 73 Length 00e6 | |
| 651 | Block 64 Found Base 673f - Mode? 02 Unknown 3f Key 34 Length 00e6 | |
| 652 | Block 65 Found Base 682b - Inline Encryption (size 35) - Mode? 02 Unknown 3f Key (unused?) 75 Length 00e6 | |
| 653 | Block 66 Found Base 694c - Mode? 02 Unknown 3f Key 36 Length 00e6 | |
| 654 | Block 67 Found Base 6a38 - Mode? 02 Unknown 3f Key b7 Length 00e6 | |
| 655 | Block 68 Found Base 6b24 - Mode? 02 Unknown 3f Key 38 Length 00e6 | |
| 656 | Block 69 Found Base 6c10 - Inline Encryption (size 39) - Mode? 02 Unknown 3f Key (unused?) 79 Length 00e6 | |
| 657 | Block 6a Found Base 6d35 - Mode? 02 Unknown 3f Key 3a Length 00e6 | |
| 658 | Block 6b Found Base 6e21 - Mode? 02 Unknown 3f Key bb Length 00e6 | |
| 659 | ||
| 660 | ** Block 80 Found Base 6f85 - Mode? 00 Unknown 3f Key 01 Length 02b0 | |
| 661 | ||
| 662 | ||
| 663 | (BRap Boys Special) | |
| 664 | ||
| 665 | ** Block 10 Found Base 0060 - Mode? 01 Unknown 02 Key 04 Length 00d0 | |
| 666 | ** Block 11 Found Base 0136 - Inline Encryption (size 13) - Mode? 00 Unknown 3f Key (unused?) 53 Length 00fe | |
| 667 | ** Block 12 Found Base 024d - Mode? 02 Unknown 38 Key 00 Length 0050 | just a shift | |
| 668 | ** Block 13 Found Base 02a3 - Mode? 02 Unknown 6f Key bc Length 09e0 | shift 2 places - (test mode code / data!) | |
| 669 | ** Block 14 Found Base 0c89 - Mode? 03 Unknown 01 Key 31 Length 1880 | just a table | |
| 670 | ** Block 15 Found Base 250f - Mode? 02 Unknown 3f Key 24 Length 03b8 | shift 3 places + table, contains GAME OVER, CONTINUE | |
| 671 | ** Block 16 Found Base 28cd - Mode? 01 Unknown 03 Key 80 Length 018a | |
| 672 | ** Block 17 Found Base 2a5d - Mode? 01 Unknown 1f Key 15 Length 018a | |
| 673 | ** Block 18 Found Base 2bed - Mode? 01 Unknown 44 Key 00 Length 0184 | 4 place shift | |
| 674 | ** Block 19 Found Base 2d77 - Mode? 01 Unknown 03 Key 19 Length 0184 | just a table | |
| 675 | ** Block 1a Found Base 2f01 - Inline Encryption (size 21) - Mode? 02 Unknown 3f Key (unused?) 61 Length 0a24 | |
| 676 | ** Block 1b Found Base 394c - Mode? 01 Unknown 5f Key 22 Length 0e02 | |
| 677 | ** Block 1c Found Base 4754 - Mode? 01 Unknown 1f Key 3f Length 0e02 | |
| 678 | ** Block 1d Found Base 555c - Mode? 01 Unknown 03 Key bf Length 0e02 | |
| 679 | ** Block 1e Found Base 6364 - Mode? 01 Unknown 01 Key 24 Length 0e02 | |
| 680 | ** Block 1f Found Base 716c - Mode? 02 Unknown 1f Key 39 Length 02ac | 1 place shift + table | |
| 681 | ** Block 20 Found Base 741e - Mode? 03 Unknown 03 Key af Length 01a4 | |
| 682 | ** Block 21 Found Base 75c8 - Inline Encryption (size 3d) - Mode? 03 Unknown 2f Key (unused?) 7d Length 01fa | |
| 683 | ** Block 22 Found Base 7805 - Mode? 03 Unknown 1f Key 17 Length 010c | 1 place shift + table | |
| 684 | ** Block 23 Found Base 7917 - Mode? 03 Unknown 03 Key 89 Length 018c | just a table | |
| 685 | ** Block 24 Found Base 7aa9 - Inline Encryption (size 03) - Mode? 03 Unknown 5f Key (unused?) 43 Length 0214 | |
| 686 | ** Block 25 Found Base 7cc6 - Inline Encryption (size 1d) - Mode? 03 Unknown 02 Key (unused?) 5d Length 0178 | |
| 687 | ** Block 26 Found Base 7e61 - Mode? 03 Unknown 03 Key 05 Length 04e2 | |
| 688 | ** Block 27 Found Base 8349 - Mode? 03 Unknown 3f Key a7 Length 00fa | |
| 689 | ** Block 28 Found Base 8449 - Inline Encryption (size 23) - Mode? 03 Unknown 1f Key (unused?) 63 Length 015a | |
| 690 | ** Block 29 Found Base 85cc - Mode? 03 Unknown 03 Key 15 Length 00d6 | |
| 691 | ** Block 2a Found Base 86a8 - Mode? 03 Unknown 3f Key a1 Length 00aa | |
| 692 | ** Block 2b Found Base 8758 - Mode? 03 Unknown 2f Key 04 Length 01a2 | |
| 693 | ** Block 2c Found Base 8900 - Mode? 03 Unknown 2f Key 04 Length 04cc | |
| 694 | ** Block 2d Found Base 8dd2 - Mode? 03 Unknown 03 Key 15 Length 0486 | |
| 695 | ||
| 696 | ||
| 697 | */ | |
| 698 | ||
| 699 | 637 | UINT16 calc3_mcu_crc; |
| 700 | 638 | |
| 701 | 639 | /* decryption tables */ |
| 702 | 640 | |
| 703 | /* table 0x00 = not encrypted? (but can still be bitswapped) */ | |
| 704 | static UINT8 calc3_key00[64] = { | |
| 705 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 706 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 707 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 708 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 709 | }; | |
| 641 | /* this should probably be derived from the final block at the end of the MCU rom somehow ... | |
| 642 | (see 'finalblock' debug output when verbose = 1) | |
| 643 | for now just putting it in a bit table, only used keys are filled in as nothing else was | |
| 644 | extracted when getting the tables, unknown values are filled in as -1 | |
| 710 | 645 | |
| 711 | /* ok */ | |
| 712 | static UINT8 calc3_key01[64] = { | |
| 713 | 0xce,0xab,0xa1,0xaa,0x20,0x20,0xcb,0x57,0x5b,0x65,0xd6,0x65,0x5e,0x92,0x6c,0x0a, | |
| 714 | 0xf8,0xea,0xb6,0xfd,0x76,0x35,0x47,0xaf,0xed,0xe0,0xcc,0x4d,0x4c,0xd6,0x74,0x78, | |
| 715 | 0x20,0x1c,0x1f,0xc1,0x25,0x2e,0x49,0xe7,0x90,0x1b,0xb4,0xcf,0x1e,0x61,0xd7,0x46, | |
| 716 | 0xda,0x89,0x08,0x77,0xb1,0x81,0x6b,0x2d,0xb6,0xbc,0x99,0xc9,0x35,0x0a,0x0f,0x01 | |
| 717 | }; | |
| 646 | key 0 means no decryption, this could be done in logic rather than expecting the first | |
| 647 | part of the table to be 0 | |
| 648 | */ | |
| 718 | 649 | |
| 719 | ||
| 720 | /* ok - brapboys initial transfer */ | |
| 721 | static UINT8 calc3_key04[64] = { | |
| 722 | 0xff,0x4a,0x62,0xa3,0xf4,0xb4,0x8c,0x2d,0x84,0xbd,0x87,0x3a,0x9e,0xe9,0xd7,0x12, | |
| 723 | 0xff,0x50,0x40,0x39,0xa6,0x47,0xd9,0x38,0x89,0x3c,0x62,0xa0,0x86,0xe2,0xd7,0x4d, | |
| 724 | 0x9c,0x8e,0x45,0xe8,0x5b,0xe1,0xdd,0xaf,0x99,0xa8,0x47,0x79,0x67,0x00,0x38,0xf4, | |
| 725 | 0x43,0xbe,0x47,0x32,0x8f,0x0e,0xfd,0x64,0x42,0x59,0x2b,0xe5,0xde,0x6d,0x80,0x7a, | |
| 650 | static INT16 calc3_keydata[0x40*0x100] = { | |
| 651 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 652 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 653 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 654 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, | |
| 655 | 0xce,0x55,0xa1,0x56,0x20,0xe0,0xcb,0xa9,0x5b,0x9b,0xd6,0x9b,0x5e,0x6e,0x6c,0xf6, | |
| 656 | 0xf8,0x16,0xb6,0x03,0x76,0xcb,0x47,0x51,0xed,0x20,0xcc,0xb3,0x4c,0x2a,0x74,0x88, | |
| 657 | 0x20,0xe4,0x1f,0x3f,0x25,0xd2,0x49,0x19,0x90,0xe5,0xb4,0x31,0x1e,0x9f,0xd7,0xba, | |
| 658 | 0xda,0x77,0x08,0x89,0xb1,0x7f,0x6b,0xd3,0xb6,0x44,0x99,0x37,0x35,0xf6,0x0f,0xff, | |
| 659 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 660 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 661 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 662 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 663 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 664 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 665 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 666 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 667 | 0x01,0x4a,0x9e,0xa3,0x0c,0xb4,0x74,0x2d,0x7c,0xbd,0x79,0x3a,0x62,0xe9,0x29,0x12, | |
| 668 | 0x01,0x50,0xc0,0x39,0x5a,0x47,0x27,0x38,0x77,0x3c,0x9e,0xa0,0x7a,0xe2,0x29,0x4d, | |
| 669 | 0x64,0x8e,0xbb,0xe8,0xa5,0xe1,0x23,0xaf,0x67,0xa8,0xb9,0x79,0x99,0x00,0xc8,0xf4, | |
| 670 | 0xbd,0xbe,0xb9,0x32,0x71,0x0e,0x03,0x64,0xbe,0x59,0xd5,0xe5,0x22,0x6d,0x80,0x7a, | |
| 671 | 0x5e,0xd8,0xa6,0xd7,0x00,0x94,0x23,0x66,0xaf,0xea,0xbe,0x45,0x38,0x90,0x8e,0x8d, | |
| 672 | 0x5b,0x14,0x2c,0xda,0x55,0x7e,0x9d,0x08,0x2d,0x31,0xfd,0x3a,0xbe,0x13,0xeb,0x21, | |
| 673 | 0x87,0xee,0xb7,0x7b,0x34,0x15,0x4d,0xd9,0xeb,0x4a,0xde,0xa6,0x57,0xdf,0x53,0x65, | |
| 674 | 0x75,0x1c,0x72,0x3a,0x20,0xe1,0xcd,0xac,0x5d,0x8c,0x6d,0xa9,0x66,0x1d,0x41,0xca, | |
| 675 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 676 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 677 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 678 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 679 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 680 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 681 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 682 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 683 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 684 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 685 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 686 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 687 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 688 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 689 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 690 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 691 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 692 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 693 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 694 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 695 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 696 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 697 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 698 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 699 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 700 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 701 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 702 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 703 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 704 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 705 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 706 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 707 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 708 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 709 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 710 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 711 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 712 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 713 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 714 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 715 | 0xca,0x23,0x9e,0x00,0x37,0x72,0x61,0x0d,0x71,0x99,0x02,0xb1,0x5b,0x8f,0x50,0x22, | |
| 716 | 0x06,0xdb,0xd6,0xd5,0x44,0x42,0xcd,0x44,0xf0,0xa2,0xc4,0xef,0xfa,0x1e,0x11,0xa1, | |
| 717 | 0x34,0x7b,0xf6,0xf4,0xdf,0xca,0x92,0x17,0xf3,0x48,0x8d,0xcf,0x30,0x82,0x81,0xbc, | |
| 718 | 0xe8,0xbd,0x29,0xde,0x89,0x94,0x4b,0x57,0xed,0xe3,0x66,0x73,0x60,0xe4,0x1b,0xe5, | |
| 719 | 0x75,0x98,0x5b,0x53,0x88,0x69,0x54,0x16,0x11,0x0d,0x1c,0x3b,0xae,0xad,0x1a,0xcd, | |
| 720 | 0xed,0x47,0x37,0x56,0xdd,0x51,0xc8,0xa3,0x52,0x9f,0x38,0xc8,0xfb,0x86,0x78,0x64, | |
| 721 | 0x25,0x42,0x27,0x26,0x4b,0x95,0x80,0x90,0x64,0xb1,0x07,0xfb,0xeb,0x58,0xf2,0xdc, | |
| 722 | 0xad,0x42,0x57,0x45,0x56,0xbf,0x19,0xaf,0xb9,0x9d,0x93,0xf6,0xe1,0x4c,0x01,0xa5, | |
| 723 | 0xdb,0x40,0xb2,0x74,0x40,0x97,0xee,0x0f,0x84,0xfc,0xa7,0x19,0x01,0xcb,0xe1,0x71, | |
| 724 | 0xc1,0x75,0xe2,0xb4,0x0d,0x26,0x19,0x03,0xb9,0xa6,0xce,0x06,0x2c,0x7d,0x8d,0x30, | |
| 725 | 0x31,0x5b,0x52,0x45,0x7f,0xb7,0x75,0x1a,0x09,0xb5,0x53,0x9c,0x06,0x4d,0xc0,0x14, | |
| 726 | 0xbf,0xaa,0x2f,0xa9,0x1a,0xd0,0x9d,0x27,0xe9,0x82,0x41,0xff,0xf2,0x63,0xf5,0x8e, | |
| 727 | 0xbd,0x5b,0x62,0xa2,0x20,0x3c,0xed,0x3a,0x8b,0xa6,0x64,0x8d,0x13,0x27,0x67,0x4e, | |
| 728 | 0x40,0xa7,0x96,0x2f,0x95,0x04,0x7f,0xa4,0xe3,0xf9,0x45,0xe9,0x4c,0x44,0x10,0x46, | |
| 729 | 0x19,0x08,0x38,0x91,0x3b,0x70,0x2f,0xf5,0xa2,0x95,0x31,0xf3,0x40,0xa2,0xad,0xa6, | |
| 730 | 0xdb,0x35,0x70,0x4b,0x96,0x09,0x97,0x00,0x3d,0xd2,0x32,0xcc,0x52,0x69,0xb7,0xe0, | |
| 731 | 0xdb,0x29,0x2c,0x1d,0xe8,0x99,0x12,0xd6,0xe6,0x4b,0x12,0xd6,0xa6,0x04,0x6a,0xa5, | |
| 732 | 0x2a,0x1c,0x15,0x07,0x35,0x28,0xbc,0xc6,0x90,0xd7,0x5e,0xb1,0x1d,0x1a,0xc1,0xe5, | |
| 733 | 0x9c,0x88,0x96,0x4b,0x3f,0x00,0x6f,0x62,0xef,0x90,0x60,0x3f,0x5b,0x95,0x77,0xd1, | |
| 734 | 0xc4,0x24,0xdc,0x6a,0x8a,0xa9,0xc6,0x7b,0x74,0xce,0x24,0x9f,0xc3,0x9f,0x06,0xdc, | |
| 735 | 0xf4,0xeb,0xd0,0x25,0x58,0xed,0x1d,0x23,0x54,0x2b,0x73,0x34,0x78,0x9f,0xab,0xb5, | |
| 736 | 0x41,0x15,0x1d,0x7c,0xac,0xd4,0x8e,0xa9,0x82,0x80,0xd9,0x9f,0x5d,0x3f,0x5f,0x4d, | |
| 737 | 0x7c,0x1b,0x2f,0xb2,0x4b,0xa7,0xf4,0xa0,0xaf,0xe6,0xa2,0xc0,0x15,0x68,0xde,0xd6, | |
| 738 | 0x38,0xb6,0x31,0x46,0xb5,0xf0,0xeb,0xd7,0x50,0xb5,0xd7,0xb8,0x03,0x43,0xa4,0xc0, | |
| 739 | 0xca,0xe0,0x0d,0xfa,0x2f,0x78,0xcd,0x61,0x97,0x87,0x45,0xe8,0x4a,0x39,0xe9,0xbe, | |
| 740 | 0x43,0xd0,0x6f,0xcf,0xbc,0x47,0xb6,0x8e,0x77,0x35,0x76,0xf2,0xcc,0xf3,0xab,0xbe, | |
| 741 | 0x77,0x01,0xc1,0x06,0x1e,0xa6,0x80,0xef,0xa3,0xd7,0xb5,0xb6,0x2e,0x5a,0xa4,0xf4, | |
| 742 | 0xf8,0x2b,0x30,0x20,0xd8,0x1f,0xc6,0x55,0x8f,0xc7,0x0d,0x55,0xd2,0x97,0x4f,0xce, | |
| 743 | 0x1b,0x48,0xa4,0xdd,0x2e,0x7a,0xe3,0xd1,0x6d,0x9e,0x49,0x31,0xdb,0x13,0xe6,0x00, | |
| 744 | 0xf1,0x8f,0xcb,0x3f,0x23,0xc1,0xf3,0xb4,0x30,0x35,0xf4,0xea,0x2c,0x77,0x65,0x79, | |
| 745 | 0x4e,0x7b,0x0e,0x87,0x79,0x3c,0xd1,0x8f,0x8b,0xa4,0x5a,0x61,0x68,0xac,0x87,0x6b, | |
| 746 | 0xc4,0xc4,0x98,0x36,0xb3,0x75,0x16,0x33,0xf2,0x45,0x84,0xb8,0xf2,0xdb,0xc7,0x46, | |
| 747 | 0xa8,0x63,0x55,0x0d,0x15,0x34,0x1f,0xb2,0x96,0xb0,0x3f,0x4f,0xec,0x6c,0x60,0xbb, | |
| 748 | 0x0b,0x91,0xf0,0x0d,0xa2,0x83,0x07,0x5b,0x6c,0xc0,0x14,0xc7,0x3b,0x0a,0x4d,0xbd, | |
| 749 | 0xc0,0xc8,0xd3,0x76,0x1c,0xaa,0xa8,0xc1,0x27,0x8c,0x50,0x02,0x81,0x9d,0x48,0x7b, | |
| 750 | 0x5c,0xc0,0x2a,0xca,0x06,0x32,0x9d,0xb3,0x38,0x6d,0xfd,0x20,0x21,0x4d,0xce,0x66, | |
| 751 | 0x30,0x72,0xe0,0xca,0xa4,0xe5,0x41,0x44,0xd4,0xfe,0xe6,0x82,0x3e,0x85,0x18,0x30, | |
| 752 | 0x50,0x17,0x9f,0x77,0xf8,0xcb,0xb0,0xc4,0xed,0x16,0x96,0xca,0xba,0xec,0x22,0xca, | |
| 753 | 0x8f,0x28,0xd3,0x12,0xc6,0x2e,0xc4,0xc3,0x36,0xcf,0x59,0xd8,0x3a,0x6c,0xa7,0x64, | |
| 754 | 0x7f,0x5f,0xa6,0x1b,0x90,0x96,0x19,0x14,0x22,0x81,0x38,0xcd,0x20,0x2f,0x22,0x70, | |
| 755 | 0x74,0xb4,0x04,0x55,0x9a,0xcd,0x09,0xc7,0xe5,0xc7,0xff,0x0b,0x8e,0x9c,0xce,0x9e, | |
| 756 | 0x81,0x5f,0x98,0xbf,0xe7,0xdb,0xaf,0x2d,0x71,0x77,0x3a,0x32,0x69,0x5d,0xa5,0xe0, | |
| 757 | 0x79,0xdc,0xcc,0x9b,0x38,0x0a,0xe6,0xd7,0x79,0xad,0x33,0x23,0x53,0x5c,0x64,0x67, | |
| 758 | 0xee,0xe1,0xcc,0x6a,0x13,0xe2,0x4a,0x97,0x71,0xc0,0xf4,0x00,0xae,0xc0,0x84,0xa3, | |
| 759 | 0x34,0x69,0x83,0xec,0xb8,0x2c,0x36,0x7c,0x8a,0x4b,0x4a,0x29,0x9f,0xf3,0x41,0x46, | |
| 760 | 0x5e,0xab,0x9b,0x24,0x2d,0xf2,0xc4,0xd8,0xb9,0x24,0xbf,0x3f,0x08,0x9e,0x96,0x40, | |
| 761 | 0x3f,0x22,0x7f,0x51,0x32,0x7d,0xcf,0x3d,0xb0,0x67,0x9f,0x24,0x8b,0xaa,0x3e,0xc3, | |
| 762 | 0x69,0x87,0x5c,0xf5,0x4d,0x55,0xf2,0x7a,0xe2,0x6b,0xf3,0xf8,0x8d,0x40,0xb4,0x3f, | |
| 763 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 764 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 765 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 766 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 767 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 768 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 769 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 770 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 771 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 772 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 773 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 774 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 775 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 776 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 777 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 778 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 779 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 780 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 781 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 782 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 783 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 784 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 785 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 786 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 787 | 0xfe,0xf7,0xc7,0x85,0xe4,0xd3,0x93,0xd0,0x36,0x61,0xc8,0x4d,0x0c,0x3e,0x2a,0x1c, | |
| 788 | 0x32,0x1a,0xbf,0x1a,0xb0,0x60,0xb5,0xa8,0x1a,0x19,0x16,0xaf,0x96,0x0d,0x2d,0xe0, | |
| 789 | 0xb1,0x2c,0xb6,0x41,0xe1,0x2d,0xc8,0xe5,0xd9,0x75,0x82,0xfa,0x90,0x3a,0x77,0x09, | |
| 790 | 0x0e,0xe8,0xda,0x7a,0xfb,0xc4,0x68,0x57,0xe8,0xcf,0x18,0x51,0x5b,0xed,0x83,0x08, | |
| 791 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 792 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 793 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 794 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 795 | 0x75,0x49,0x7a,0xd6,0x84,0xbd,0x70,0xbe,0x10,0x19,0x6c,0xb2,0xa9,0x5f,0x6b,0x78, | |
| 796 | 0x14,0x29,0x2a,0x15,0xd0,0x4a,0x10,0x93,0x69,0xb2,0xdf,0x02,0x7f,0x92,0x19,0xbd, | |
| 797 | 0x95,0xc1,0x32,0xee,0x99,0x5e,0x7a,0x55,0x37,0xb7,0xc8,0x45,0xdc,0x6a,0xe6,0xef, | |
| 798 | 0x8b,0xca,0xbe,0xe2,0x63,0x85,0x49,0xd3,0xeb,0x83,0x32,0x9a,0x23,0x11,0x4c,0x7e, | |
| 799 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 800 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 801 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 802 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 803 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 804 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 805 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 806 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 807 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 808 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 809 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 810 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 811 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 812 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 813 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 814 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 815 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 816 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 817 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 818 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 819 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 820 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 821 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 822 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 823 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 824 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 825 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 826 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 827 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 828 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 829 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 830 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 831 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 832 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 833 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 834 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 835 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 836 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 837 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 838 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 839 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 840 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 841 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 842 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 843 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 844 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 845 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 846 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 847 | 0x02,0xdf,0x0f,0x0e,0x98,0x3a,0xa7,0xaf,0xbd,0xb0,0xe6,0x3a,0x8d,0xeb,0xb4,0x3b, | |
| 848 | 0x18,0x67,0x78,0xbb,0xeb,0x1c,0x09,0x06,0x5c,0x5c,0x51,0xb1,0x98,0xfe,0xc0,0xdc, | |
| 849 | 0x6d,0xbc,0x77,0xb5,0xd7,0xda,0x2f,0x3d,0x4c,0x08,0xee,0x4f,0xc7,0x8a,0x68,0xde, | |
| 850 | 0x94,0x96,0x35,0x7e,0xe0,0xfe,0xb7,0x26,0xff,0x0e,0xc7,0x34,0x7b,0xb8,0x25,0xb1, | |
| 851 | 0xe0,0xee,0x9d,0xd7,0x49,0x50,0xf9,0xd0,0xa8,0x07,0xa9,0xc1,0xd8,0xf1,0x33,0x07, | |
| 852 | 0x63,0xfe,0x5b,0xc0,0x13,0xda,0x12,0x8e,0x3a,0xcc,0x1e,0x97,0xc1,0xdd,0x8d,0xd1, | |
| 853 | 0xf2,0x3e,0xda,0x7c,0x04,0xe4,0xdc,0xef,0x69,0x75,0x72,0x98,0xd9,0x67,0xee,0x3f, | |
| 854 | 0x1d,0x66,0x44,0x8a,0x9c,0xf7,0xf2,0xc6,0xa7,0x5c,0xae,0xe4,0x83,0xb7,0xd1,0xc2, | |
| 855 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 856 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 857 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 858 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 859 | 0xd0,0xa8,0x87,0xcf,0xe1,0x22,0x8d,0xe7,0xfa,0x26,0x85,0xce,0x6d,0xfa,0x2c,0x8b, | |
| 860 | 0xbd,0x75,0xfe,0x64,0x2b,0xab,0x25,0xa1,0x02,0xcc,0x1f,0x93,0xa2,0x4a,0x31,0xd5, | |
| 861 | 0x4d,0x3a,0x8e,0xd2,0xb3,0xfd,0x46,0x87,0x3f,0x1f,0xef,0x8a,0x1e,0x7f,0x15,0x4c, | |
| 862 | 0x13,0xb1,0x61,0x9b,0xfc,0xa0,0x8b,0x6b,0x22,0x78,0x00,0xd5,0x44,0xc3,0x52,0x60, | |
| 863 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 864 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 865 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 866 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 867 | 0xaf,0x2e,0xd9,0xfd,0x18,0xd1,0xb8,0xc2,0x9b,0x33,0x28,0x30,0x01,0xff,0x1c,0xf4, | |
| 868 | 0xc6,0xf9,0xc9,0x7c,0xa2,0x9a,0x8f,0xb9,0xd9,0xfa,0xa7,0x24,0x42,0xf3,0x8b,0xff, | |
| 869 | 0x18,0x84,0x29,0xdd,0x82,0x73,0xc7,0x64,0xe3,0x37,0xb3,0x52,0xe2,0x14,0xb2,0xbe, | |
| 870 | 0x37,0x88,0x25,0xa0,0x3b,0xe6,0xfb,0x94,0x2d,0x41,0x59,0xdb,0x44,0x8b,0x0b,0xa3, | |
| 871 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 872 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 873 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 874 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 875 | 0x7c,0x82,0x91,0x60,0xee,0x5d,0x7a,0x63,0x8a,0x2c,0x91,0xe7,0x94,0x02,0x02,0x42, | |
| 876 | 0x7d,0x8a,0xba,0x09,0x78,0xa6,0x50,0xd6,0xbe,0x55,0xb5,0x49,0xa1,0xda,0x9d,0x4d, | |
| 877 | 0x51,0x1b,0xab,0x9d,0x70,0x47,0x5f,0x86,0x57,0xbb,0xbf,0xee,0x24,0x27,0xc6,0x95, | |
| 878 | 0x8b,0xec,0x90,0x9b,0x58,0xc9,0x42,0x43,0xc6,0xb7,0xba,0xf6,0x82,0x11,0xfa,0x8b, | |
| 879 | 0x7d,0xf8,0x54,0xc5,0x74,0xf6,0x54,0x1d,0x40,0xe1,0x71,0xc2,0xdd,0x03,0x72,0xdf, | |
| 880 | 0x3b,0x77,0xa1,0x1c,0xc7,0xd6,0xb1,0x67,0xb7,0x13,0x6f,0xf4,0x18,0xa4,0x2a,0x82, | |
| 881 | 0x98,0xe3,0xe3,0xe1,0x12,0xb3,0x33,0xb1,0xde,0x66,0xff,0x6c,0xd5,0xde,0xdd,0xa6, | |
| 882 | 0x26,0xf3,0x44,0x94,0xdb,0x15,0x76,0xcc,0x28,0x33,0x2d,0x4b,0x79,0xdb,0x06,0xbc, | |
| 883 | 0x39,0xa2,0xb0,0xf7,0x63,0xc6,0xd4,0xc9,0xc9,0x12,0xc2,0xf3,0x26,0x02,0xe0,0x75, | |
| 884 | 0xe4,0x28,0xd2,0x0c,0xad,0xce,0x68,0xf9,0xb3,0xdd,0x4b,0x04,0xbe,0xfd,0x65,0xc1, | |
| 885 | 0xfa,0xfe,0x14,0x12,0x7d,0x77,0x0e,0xed,0x99,0xad,0x11,0x5f,0xe6,0xb6,0x52,0xd1, | |
| 886 | 0x0d,0xde,0xa2,0x8a,0x55,0x49,0x60,0x76,0xee,0xda,0x21,0x26,0x00,0x54,0x20,0x17, | |
| 887 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 888 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 889 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 890 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 891 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 892 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 893 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 894 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 895 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 896 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 897 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 898 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 899 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 900 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 901 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 902 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 903 | 0x27,0xb4,0xc1,0xba,0x5f,0xd4,0x47,0x04,0x1f,0xfe,0x42,0xa5,0xce,0xb5,0x23,0xbe, | |
| 904 | 0x42,0xcc,0x59,0x71,0x51,0x13,0x41,0xa4,0x18,0x35,0xcf,0x02,0x0d,0xe1,0xfb,0x43, | |
| 905 | 0xc5,0x28,0xed,0xae,0x84,0x27,0xe8,0xdc,0x89,0xe5,0xf6,0xbe,0x16,0x7e,0x57,0xe1, | |
| 906 | 0x41,0x82,0xa9,0xf1,0x7c,0x98,0xd7,0x7c,0xe5,0x67,0xc2,0xf9,0x4d,0xb6,0xb0,0x09, | |
| 907 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 908 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 909 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 910 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 911 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 912 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 913 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 914 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 915 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 916 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 917 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 918 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 919 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 920 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 921 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 922 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 923 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 924 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 925 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 926 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 927 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 928 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 929 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 930 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 931 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 932 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 933 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 934 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 935 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 936 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 937 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 938 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 939 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 940 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 941 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 942 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 943 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 944 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 945 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 946 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 947 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 948 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 949 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 950 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 951 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 952 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 953 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 954 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 955 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 956 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 957 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 958 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 959 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 960 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 961 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 962 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 963 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 964 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 965 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 966 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 967 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 968 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 969 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 970 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 971 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 972 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 973 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 974 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 975 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 976 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 977 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 978 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 979 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 980 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 981 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 982 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 983 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 984 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 985 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 986 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 987 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 988 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 989 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 990 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 991 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 992 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 993 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 994 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 995 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 996 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 997 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 998 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 999 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1000 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1001 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1002 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1003 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1004 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1005 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1006 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1007 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1008 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1009 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1010 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1011 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1012 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1013 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1014 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1015 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1016 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1017 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1018 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1019 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1020 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1021 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1022 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1023 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1024 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1025 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1026 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1027 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1028 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1029 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1030 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1031 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1032 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1033 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1034 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1035 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1036 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1037 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1038 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1039 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1040 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1041 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1042 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1043 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1044 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1045 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1046 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1047 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1048 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1049 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1050 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1051 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1052 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1053 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1054 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1055 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1056 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1057 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1058 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1059 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1060 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1061 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1062 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1063 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1064 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1065 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1066 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1067 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1068 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1069 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1070 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1071 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1072 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1073 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1074 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1075 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1076 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1077 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1078 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1079 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1080 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1081 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1082 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1083 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1084 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1085 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1086 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1087 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1088 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1089 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1090 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1091 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1092 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1093 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1094 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1095 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1096 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1097 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1098 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1099 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1100 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1101 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1102 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1103 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1104 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1105 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1106 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1107 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1108 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1109 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1110 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1111 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1112 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1113 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1114 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1115 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1116 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1117 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1118 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1119 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1120 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1121 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1122 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1123 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1124 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1125 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1126 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1127 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1128 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1129 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1130 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1131 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1132 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1133 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1134 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1135 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1136 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1137 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1138 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1139 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1140 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1141 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1142 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1143 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1144 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1145 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1146 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1147 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1148 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1149 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1150 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1151 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1152 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1153 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1154 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1155 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1156 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1157 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1158 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1159 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1160 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1161 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1162 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1163 | 0x33,0x8e,0x6f,0x22,0xac,0x01,0x9f,0x7a,0xc7,0xca,0x23,0xc4,0xa4,0x9c,0x07,0xf8, | |
| 1164 | 0x98,0xc1,0x17,0x4a,0xb2,0xbc,0xcc,0xf4,0x0e,0x2e,0xf6,0x35,0xdd,0xf6,0x29,0x9a, | |
| 1165 | 0x2f,0x9c,0xe8,0x7c,0x86,0xf0,0x93,0xca,0x1a,0xee,0x10,0x08,0xec,0xe5,0x3a,0x98, | |
| 1166 | 0x8c,0xd8,0x0d,0x39,0xaa,0x25,0x8d,0xcd,0x5d,0x64,0x7a,0x5f,0x35,0x92,0xb5,0x64, | |
| 1167 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1168 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1169 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1170 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1171 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1172 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1173 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1174 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1175 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1176 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1177 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1178 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1179 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1180 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1181 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1182 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1183 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1184 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1185 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1186 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1187 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1188 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1189 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1190 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1191 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1192 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1193 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1194 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1195 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1196 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1197 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1198 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1199 | 0xdd,0xa9,0x15,0x18,0x9d,0x01,0x24,0x9c,0xed,0x7a,0xeb,0x42,0x8b,0x9e,0xf3,0x72, | |
| 1200 | 0x26,0xc9,0x45,0x18,0xea,0xd2,0x54,0x5f,0xcf,0xed,0xac,0xbc,0xa1,0xd0,0x5f,0x2f, | |
| 1201 | 0xce,0x15,0x2a,0xc6,0xf1,0xe0,0x69,0x62,0x22,0xc1,0xc0,0xbd,0xfa,0xdc,0x85,0xac, | |
| 1202 | 0x67,0x47,0xee,0xa2,0x35,0xb3,0xff,0x76,0x57,0x4f,0x30,0x66,0xf8,0xe9,0xe0,0x5b, | |
| 1203 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1204 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1205 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1206 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1207 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1208 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1209 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1210 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1211 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1212 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1213 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1214 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1215 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1216 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1217 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1218 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1219 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1220 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1221 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1222 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1223 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1224 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1225 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1226 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1227 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1228 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1229 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1230 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1231 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1232 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1233 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1234 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1235 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1236 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1237 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1238 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1239 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1240 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1241 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1242 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1243 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1244 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1245 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1246 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1247 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1248 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1249 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1250 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1251 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1252 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1253 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1254 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1255 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1256 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1257 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1258 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1259 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1260 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1261 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1262 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1263 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1264 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1265 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1266 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1267 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1268 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1269 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1270 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1271 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1272 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1273 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1274 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1275 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1276 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1277 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1278 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1279 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1280 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1281 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1282 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1283 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1284 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1285 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1286 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1287 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1288 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1289 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1290 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1291 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1292 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1293 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1294 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1295 | 0x0f,0x35,0xa3,0x7c,0xf1,0x75,0xea,0x27,0x36,0x4d,0x4b,0x1a,0x3b,0x24,0xef,0x9d, | |
| 1296 | 0x4e,0x39,0x7e,0x7b,0x3d,0x42,0x0d,0xc2,0x9f,0x53,0xc7,0xc4,0xdf,0x02,0x5d,0x61, | |
| 1297 | 0x0c,0xc9,0x2d,0x89,0x63,0xab,0x34,0xfc,0x97,0x1b,0xb5,0x54,0xe6,0x19,0xa5,0x46, | |
| 1298 | 0xdc,0x9e,0xdc,0x25,0xe4,0x3a,0xfc,0xa7,0x93,0xfc,0x1f,0xec,0xb3,0x92,0x43,0xbc, | |
| 1299 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1300 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1301 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1302 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1303 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1304 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1305 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1306 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1307 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1308 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1309 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1310 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1311 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1312 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1313 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1314 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1315 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1316 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1317 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1318 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1319 | 0x5d,0xdd,0xd4,0xbe,0xc0,0xff,0xe1,0x1b,0x3a,0xd6,0x61,0xc8,0x90,0x02,0x23,0x08, | |
| 1320 | 0xfa,0x7a,0xfa,0x1d,0xab,0x2b,0xa0,0x0b,0x24,0xe1,0x6b,0x9e,0x38,0x6b,0xb2,0xae, | |
| 1321 | 0xdd,0xfa,0xfc,0xa2,0xb8,0xcb,0xed,0x33,0x66,0x06,0xef,0x72,0x8b,0xe5,0xa3,0x0d, | |
| 1322 | 0x9b,0x18,0x05,0xce,0x6a,0x69,0x61,0x64,0x74,0x9c,0xf9,0x66,0xec,0x99,0x72,0x95, | |
| 1323 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1324 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1325 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1326 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1327 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1328 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1329 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1330 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1331 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1332 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1333 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1334 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1335 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1336 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1337 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1338 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1339 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1340 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1341 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1342 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1343 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1344 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1345 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1346 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1347 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1348 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1349 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1350 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1351 | 0x2c,0xf3,0x0d,0x50,0x30,0x77,0xc2,0x25,0x91,0x83,0x5f,0xac,0xf4,0x56,0x96,0xc8, | |
| 1352 | 0x70,0x86,0x16,0x5a,0x1b,0xa1,0x7d,0x08,0x53,0x15,0xfd,0x3c,0xcb,0x4d,0xd0,0x70, | |
| 1353 | 0x5c,0x1d,0x5c,0xaa,0x87,0x60,0x24,0x42,0xcc,0xe0,0x75,0xeb,0xae,0x75,0xcc,0xf1, | |
| 1354 | 0x81,0x71,0x09,0xc0,0xf8,0x3c,0x55,0xa6,0x71,0x3c,0xd2,0xda,0xfe,0xf8,0x07,0xbc, | |
| 1355 | 0x33,0x7c,0x08,0x5e,0xb1,0xff,0x68,0x44,0x75,0xc3,0xdf,0x68,0xdf,0x3d,0xba,0x81, | |
| 1356 | 0x84,0x76,0x06,0x85,0xb4,0xb1,0x7a,0x6d,0xc9,0x4e,0x27,0x38,0x35,0xee,0xe1,0x32, | |
| 1357 | 0x48,0xd8,0x6b,0x76,0xc4,0x9b,0x65,0xb2,0x22,0xf5,0xf6,0x2a,0xa1,0xf4,0x37,0x00, | |
| 1358 | 0x12,0x5b,0x65,0xb2,0x65,0x47,0xc5,0xe4,0xf2,0x13,0x55,0x60,0x87,0x78,0x37,0x5b, | |
| 1359 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1360 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1361 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1362 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1363 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1364 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1365 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1366 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1367 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1368 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1369 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1370 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1371 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1372 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1373 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1374 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1375 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1376 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1377 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1378 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1379 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1380 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1381 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1382 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1383 | 0xeb,0xd8,0xb6,0x33,0x90,0xbf,0x13,0x7f,0xd8,0x00,0xce,0xe0,0x48,0x79,0x78,0xd7, | |
| 1384 | 0xd7,0x62,0xa3,0xe7,0x7b,0xe8,0xc9,0x54,0x71,0x18,0xff,0x2b,0x4f,0xff,0x5e,0x82, | |
| 1385 | 0xca,0x10,0x2c,0x01,0x47,0xc5,0xcc,0xa2,0x22,0x89,0x6b,0xb4,0xc1,0xd6,0x66,0x26, | |
| 1386 | 0x56,0x9b,0x7c,0x02,0x77,0xe0,0xb8,0x38,0x5f,0xac,0x1b,0x9d,0x00,0x27,0x0c,0x33, | |
| 1387 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1388 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1389 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1390 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1391 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1392 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1393 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1394 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1395 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1396 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1397 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1398 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1399 | 0x65,0x19,0xf5,0x62,0x7a,0x92,0xc5,0x4a,0x55,0xcc,0x2f,0xf8,0x6c,0x79,0x34,0x3d, | |
| 1400 | 0xa4,0x9e,0xd3,0xec,0xe4,0x3a,0xf9,0x99,0x5a,0x28,0x2a,0xa0,0x8a,0x46,0xef,0x69, | |
| 1401 | 0x1b,0xd7,0xfd,0xeb,0x60,0x26,0x2a,0x6f,0xa7,0x6c,0x0f,0x97,0x44,0xf4,0x7d,0x9e, | |
| 1402 | 0x5b,0x7d,0xa0,0xe1,0x70,0xe0,0xf3,0x9f,0xb0,0xf3,0xea,0xfd,0xfc,0xac,0x58,0x4d, | |
| 1403 | 0xb8,0x8a,0xa5,0x8f,0x58,0x30,0xb0,0x38,0xa6,0x53,0x84,0x33,0xd4,0xd7,0xbd,0x26, | |
| 1404 | 0x45,0x35,0xb7,0xf6,0x1a,0x20,0x7b,0x8d,0x7e,0x68,0x69,0xdb,0xb1,0x1e,0xa5,0x1a, | |
| 1405 | 0xd5,0xf9,0x42,0x57,0x7a,0xf8,0x30,0x2e,0xea,0x49,0xe5,0xd5,0x34,0x6a,0xcd,0x5b, | |
| 1406 | 0xfa,0x8e,0x71,0x32,0xfa,0x42,0x69,0xec,0x5d,0x50,0x02,0x42,0xc2,0xe4,0xae,0x5a, | |
| 1407 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1408 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1409 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1410 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1411 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1412 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1413 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1414 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1415 | 0x9a,0x8e,0xcf,0x66,0xe0,0xd8,0xd4,0x2a,0x0f,0x4d,0xad,0x64,0x8c,0x6d,0xcb,0x37, | |
| 1416 | 0x2e,0x0e,0x9f,0xc4,0xca,0xff,0x85,0xf1,0x7f,0xec,0x71,0x69,0xc2,0x81,0x5c,0xe4, | |
| 1417 | 0x28,0xd2,0x6b,0xa9,0xf6,0xfb,0xe4,0x51,0x68,0x03,0xd0,0xcd,0xc3,0x07,0x6f,0xab, | |
| 1418 | 0x1c,0x94,0x5f,0x94,0xe6,0x54,0x8b,0x1a,0x3c,0xed,0xd4,0xb0,0xf3,0x26,0x81,0xfa, | |
| 1419 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1420 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1421 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1422 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1423 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1424 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1425 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1426 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1427 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1428 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1429 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1430 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1431 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1432 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1433 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1434 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1435 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1436 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1437 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1438 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1439 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1440 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1441 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1442 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1443 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1444 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1445 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1446 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1447 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1448 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1449 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1450 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1451 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1452 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1453 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1454 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1455 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1456 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1457 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1458 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1459 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1460 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1461 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1462 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1463 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1464 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1465 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1466 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1467 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1468 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1469 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1470 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1471 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1472 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1473 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1474 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1475 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1476 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1477 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1478 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1479 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1480 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1481 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1482 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1483 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1484 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1485 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1486 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1487 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1488 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1489 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1490 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1491 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1492 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1493 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1494 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1495 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1496 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1497 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1498 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1499 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1500 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1501 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1502 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1503 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1504 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1505 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1506 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1507 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1508 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1509 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1510 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1511 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1512 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1513 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1514 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1515 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1516 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1517 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1518 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1519 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1520 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1521 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1522 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1523 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1524 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1525 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1526 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1527 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1528 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1529 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1530 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1531 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1532 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1533 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1534 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1535 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1536 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1537 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1538 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1539 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1540 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1541 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1542 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1543 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1544 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1545 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1546 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1547 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1548 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1549 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1550 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1551 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1552 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1553 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1554 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1555 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1556 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1557 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1558 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1559 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1560 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1561 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1562 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1563 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1564 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1565 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1566 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1567 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1568 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1569 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1570 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1571 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1572 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1573 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1574 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1575 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1576 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1577 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1578 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1579 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1580 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1581 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1582 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1583 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1584 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1585 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1586 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1587 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1588 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1589 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1590 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1591 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1592 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1593 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1594 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1595 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1596 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1597 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1598 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1599 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1600 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1601 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1602 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1603 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1604 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1605 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1606 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1607 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1608 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1609 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1610 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1611 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1612 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1613 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1614 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1615 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1616 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1617 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1618 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1619 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1620 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1621 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1622 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1623 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1624 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1625 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1626 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1627 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1628 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1629 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1630 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1631 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1632 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1633 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1634 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1635 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1636 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1637 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1638 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1639 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1640 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1641 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1642 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1643 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1644 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1645 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1646 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1647 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1648 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1649 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1650 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1651 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1652 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1653 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1654 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1655 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1656 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1657 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1658 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1659 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1660 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1661 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1662 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1663 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1664 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1665 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1666 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1667 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1668 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1669 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1670 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1671 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1672 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1673 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 1674 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | |
| 726 | 1675 | }; |
| 727 | 1676 | |
| 728 | static UINT8 calc3_key05[64] = { | |
| 729 | 0x5e,0xd8,0xa6,0xd7,0x00,0x94,0x23,0x66,0xaf,0xea,0xbe,0x45,0x38,0x90,0x8e,0x8d, | |
| 730 | 0x5b,0x14,0x2c,0xda,0x55,0x7e,0x9d,0x08,0x2d,0x31,0xfd,0x3a,0xbe,0x13,0xeb,0x21, | |
| 731 | 0x87,0xee,0xb7,0x7b,0x34,0x15,0x4d,0xd9,0xeb,0x4a,0xde,0xa6,0x57,0xdf,0x53,0x65, | |
| 732 | 0x75,0x1c,0x72,0x3a,0x20,0xe1,0xcd,0xac,0x5d,0x8c,0x6d,0xa9,0x66,0x1d,0x41,0xca, | |
| 733 | }; | |
| 734 | ||
| 735 | /* ok - shogwarr */ | |
| 736 | static UINT8 calc3_key15[64] = { | |
| 737 | 0x0C,0xEB,0x30,0x25,0xA8,0xED,0xE3,0x23,0xAC,0x2B,0x8D,0x34,0x88,0x9F,0x55,0xB5, | |
| 738 | 0xBF,0x15,0xE3,0x7C,0x54,0xD4,0x72,0xA9,0x7E,0x80,0x27,0x9F,0xA3,0x3F,0xA1,0x4D, | |
| 739 | 0x84,0x1B,0xD1,0xB2,0xB5,0xA7,0x0C,0xA0,0x51,0xE6,0x5E,0xC0,0xEB,0x68,0x22,0xD6, | |
| 740 | 0xC8,0xB6,0xCF,0x46,0x4B,0xF0,0x15,0xD7,0xB0,0xB5,0x29,0xB8,0xFD,0x43,0x5C,0xC0 | |
| 741 | }; | |
| 742 | ||
| 743 | static UINT8 calc3_key17[64] = { | |
| 744 | 0x1b,0x48,0xa4,0xdd,0x2e,0x7a,0xe3,0xd1,0x6d,0x9e,0x49,0x31,0xdb,0x13,0xe6,0x00, | |
| 745 | 0xf1,0x8f,0xcb,0x3f,0x23,0xc1,0xf3,0xb4,0x30,0x35,0xf4,0xea,0x2c,0x77,0x65,0x79, | |
| 746 | 0x4e,0x7b,0x0e,0x87,0x79,0x3c,0xd1,0x8f,0x8b,0xa4,0x5a,0x61,0x68,0xac,0x87,0x6b, | |
| 747 | 0xc4,0xc4,0x98,0x36,0xb3,0x75,0x16,0x33,0xf2,0x45,0x84,0xb8,0xf2,0xdb,0xc7,0x46, | |
| 748 | }; | |
| 749 | ||
| 750 | static UINT8 calc3_key19[64] = { | |
| 751 | 0x30,0x72,0xe0,0xca,0xa4,0xe5,0x41,0x44,0xd4,0xfe,0xe6,0x82,0x3e,0x85,0x18,0x30, | |
| 752 | 0x50,0x17,0x9f,0x77,0xf8,0xcb,0xb0,0xc4,0xed,0x16,0x96,0xca,0xba,0xec,0x22,0xca, | |
| 753 | 0x8f,0x28,0xd3,0x12,0xc6,0x2e,0xc4,0xc3,0x36,0xcf,0x59,0xd8,0x3a,0x6c,0xa7,0x64, | |
| 754 | 0x7f,0x5f,0xa6,0x1b,0x90,0x96,0x19,0x14,0x22,0x81,0x38,0xcd,0x20,0x2f,0x22,0x70, | |
| 755 | }; | |
| 756 | ||
| 757 | static UINT8 calc3_key22[64] = { | |
| 758 | 0xfe,0xf7,0xc7,0x85,0xe4,0xd3,0x93,0xd0,0x36,0x61,0xc8,0x4d,0x0c,0x3e,0x2a,0x1c, | |
| 759 | 0x32,0x1a,0xbf,0x1a,0xb0,0x60,0xb5,0xa8,0x1a,0x19,0x16,0xaf,0x96,0x0d,0x2d,0xe0, | |
| 760 | 0xb1,0x2c,0xb6,0x41,0xe1,0x2d,0xc8,0xe5,0xd9,0x75,0x82,0xfa,0x90,0x3a,0x77,0x09, | |
| 761 | 0x0e,0xe8,0xda,0x7a,0xfb,0xc4,0x68,0x57,0xe8,0xcf,0x18,0x51,0x5b,0xed,0x83,0x08, | |
| 762 | }; | |
| 763 | ||
| 764 | static UINT8 calc3_key24[64] = { | |
| 765 | 0x75,0x49,0x7a,0xd6,0x84,0xbd,0x70,0xbe,0x10,0x19,0x6c,0xb2,0xa9,0x5f,0x6b,0x78, | |
| 766 | 0x14,0x29,0x2a,0x15,0xd0,0x4a,0x10,0x93,0x69,0xb2,0xdf,0x02,0x7f,0x92,0x19,0xbd, | |
| 767 | 0x95,0xc1,0x32,0xee,0x99,0x5e,0x7a,0x55,0x37,0xb7,0xc8,0x45,0xdc,0x6a,0xe6,0xef, | |
| 768 | 0x8b,0xca,0xbe,0xe2,0x63,0x85,0x49,0xd3,0xeb,0x83,0x32,0x9a,0x23,0x11,0x4c,0x7e, | |
| 769 | }; | |
| 770 | ||
| 771 | static UINT8 calc3_key31[64] = { | |
| 772 | 0x02,0x21,0x0f,0xf2,0x98,0xc6,0xa7,0x51,0xbd,0x50,0xe6,0xc6,0x8d,0x15,0xb4,0xc5, | |
| 773 | 0x18,0x99,0x78,0x45,0xeb,0xe4,0x09,0xfa,0x5c,0xa4,0x51,0x4f,0x98,0x02,0xc0,0x24, | |
| 774 | 0x6d,0x44,0x77,0x4b,0xd7,0x26,0x2f,0xc3,0x4c,0xf8,0xee,0xb1,0xc7,0x76,0x68,0x22, | |
| 775 | 0x94,0x6a,0x35,0x82,0xe0,0x02,0xb7,0xda,0xff,0xf2,0xc7,0xcc,0x7b,0x48,0x25,0x4f, | |
| 776 | }; | |
| 777 | ||
| 778 | static UINT8 calc3_key39[64] = { | |
| 779 | 0x7d,0xf8,0x54,0xc5,0x74,0xf6,0x54,0x1d,0x40,0xe1,0x71,0xc2,0xdd,0x03,0x72,0xdf, | |
| 780 | 0x3b,0x77,0xa1,0x1c,0xc7,0xd6,0xb1,0x67,0xb7,0x13,0x6f,0xf4,0x18,0xa4,0x2a,0x82, | |
| 781 | 0x98,0xe3,0xe3,0xe1,0x12,0xb3,0x33,0xb1,0xde,0x66,0xff,0x6c,0xd5,0xde,0xdd,0xa6, | |
| 782 | 0x26,0xf3,0x44,0x94,0xdb,0x15,0x76,0xcc,0x28,0x33,0x2d,0x4b,0x79,0xdb,0x06,0xbc | |
| 783 | }; | |
| 784 | ||
| 785 | static UINT8 calc3_key3f[64] = { | |
| 786 | 0x27,0xb4,0xc1,0xba,0x5f,0xd4,0x47,0x04,0x1f,0xfe,0x42,0xa5,0xce,0xb5,0x23,0xbe, | |
| 787 | 0x42,0xcc,0x59,0x71,0x51,0x13,0x41,0xa4,0x18,0x35,0xcf,0x02,0x0d,0xe1,0xfb,0x43, | |
| 788 | 0xc5,0x28,0xed,0xae,0x84,0x27,0xe8,0xdc,0x89,0xe5,0xf6,0xbe,0x16,0x7e,0x57,0xe1, | |
| 789 | 0x41,0x82,0xa9,0xf1,0x7c,0x98,0xd7,0x7c,0xe5,0x67,0xc2,0xf9,0x4d,0xb6,0xb0,0x09, | |
| 790 | }; | |
| 791 | ||
| 792 | static UINT8 calc3_key80[64] = { | |
| 793 | 0x33,0x8e,0x6f,0x22,0xac,0x01,0x9f,0x7a,0xc7,0xca,0x23,0xc4,0xa4,0x9c,0x07,0xf8, | |
| 794 | 0x98,0xc1,0x17,0x4a,0xb2,0xbc,0xcc,0xf4,0x0e,0x2e,0xf6,0x35,0xdd,0xf6,0x29,0x9a, | |
| 795 | 0x2f,0x9c,0xe8,0x7c,0x86,0xf0,0x93,0xca,0x1a,0xee,0x10,0x08,0xec,0xe5,0x3a,0x98, | |
| 796 | 0x8c,0xd8,0x0d,0x39,0xaa,0x25,0x8d,0xcd,0x5d,0x64,0x7a,0x5f,0x35,0x92,0xb5,0x64, | |
| 797 | }; | |
| 798 | ||
| 799 | static UINT8 calc3_key89[64] = { | |
| 800 | 0xdd,0xa9,0x15,0x18,0x9d,0x01,0x24,0x9c,0xed,0x7a,0xeb,0x42,0x8b,0x9e,0xf3,0x72, | |
| 801 | 0x26,0xc9,0x45,0x18,0xea,0xd2,0x54,0x5f,0xcf,0xed,0xac,0xbc,0xa1,0xd0,0x5f,0x2f, | |
| 802 | 0xce,0x15,0x2a,0xc6,0xf1,0xe0,0x69,0x62,0x22,0xc1,0xc0,0xbd,0xfa,0xdc,0x85,0xac, | |
| 803 | 0x67,0x47,0xee,0xa2,0x35,0xb3,0xff,0x76,0x57,0x4f,0x30,0x66,0xf8,0xe9,0xe0,0x5b, | |
| 804 | }; | |
| 805 | ||
| 806 | static UINT8 calc3_keya1[64] = { | |
| 807 | 0x0f,0x35,0xa3,0x7c,0xf1,0x75,0xea,0x27,0x36,0x4d,0x4b,0x1a,0x3b,0x24,0xef,0x9d, | |
| 808 | 0x4e,0x39,0x7e,0x7b,0x3d,0x42,0x0d,0xc2,0x9f,0x53,0xc7,0xc4,0xdf,0x02,0x5d,0x61, | |
| 809 | 0x0c,0xc9,0x2d,0x89,0x63,0xab,0x34,0xfc,0x97,0x1b,0xb5,0x54,0xe6,0x19,0xa5,0x46, | |
| 810 | 0xdc,0x9e,0xdc,0x25,0xe4,0x3a,0xfc,0xa7,0x93,0xfc,0x1f,0xec,0xb3,0x92,0x43,0xbc, | |
| 811 | }; | |
| 812 | ||
| 813 | static UINT8 calc3_keya7[64] = { | |
| 814 | 0x5d,0xdd,0xd4,0xbe,0xc0,0xff,0xe1,0x1b,0x3a,0xd6,0x61,0xc8,0x90,0x02,0x23,0x08, | |
| 815 | 0xfa,0x7a,0xfa,0x1d,0xab,0x2b,0xa0,0x0b,0x24,0xe1,0x6b,0x9e,0x38,0x6b,0xb2,0xae, | |
| 816 | 0xdd,0xfa,0xfc,0xa2,0xb8,0xcb,0xed,0x33,0x66,0x06,0xef,0x72,0x8b,0xe5,0xa3,0x0d, | |
| 817 | 0x9b,0x18,0x05,0xce,0x6a,0x69,0x61,0x64,0x74,0x9c,0xf9,0x66,0xec,0x99,0x72,0x95, | |
| 818 | }; | |
| 819 | ||
| 820 | static UINT8 calc3_keyaf[64] = { | |
| 821 | 0x2c,0xf3,0x0d,0x50,0x30,0x77,0xc2,0x25,0x91,0x83,0x5f,0xac,0xf4,0x56,0x96,0xc8, | |
| 822 | 0x70,0x86,0x16,0x5a,0x1b,0xa1,0x7d,0x08,0x53,0x15,0xfd,0x3c,0xcb,0x4d,0xd0,0x70, | |
| 823 | 0x5c,0x1d,0x5c,0xaa,0x87,0x60,0x24,0x42,0xcc,0xe0,0x75,0xeb,0xae,0x75,0xcc,0xf1, | |
| 824 | 0x81,0x71,0x09,0xc0,0xf8,0x3c,0x55,0xa6,0x71,0x3c,0xd2,0xda,0xfe,0xf8,0x07,0xbc, | |
| 825 | }; | |
| 826 | ||
| 827 | static UINT8 calc3_keybc[64] = { | |
| 828 | 0xb8,0x8a,0xa5,0x8f,0x58,0x30,0xb0,0x38,0xa6,0x53,0x84,0x33,0xd4,0xd7,0xbd,0x26, | |
| 829 | 0x45,0x35,0xb7,0xf6,0x1a,0x20,0x7b,0x8d,0x7e,0x68,0x69,0xdb,0xb1,0x1e,0xa5,0x1a, | |
| 830 | 0xd5,0xf9,0x42,0x57,0x7a,0xf8,0x30,0x2e,0xea,0x49,0xe5,0xd5,0x34,0x6a,0xcd,0x5b, | |
| 831 | 0xfa,0x8e,0x71,0x32,0xfa,0x42,0x69,0xec,0x5d,0x50,0x02,0x42,0xc2,0xe4,0xae,0x5a, | |
| 832 | }; | |
| 833 | ||
| 834 | static UINT8 calc3_keybf[64] = { | |
| 835 | 0x9a,0x8e,0xcf,0x66,0xe0,0xd8,0xd4,0x2a,0x0f,0x4d,0xad,0x64,0x8c,0x6d,0xcb,0x37, | |
| 836 | 0x2e,0x0e,0x9f,0xc4,0xca,0xff,0x85,0xf1,0x7f,0xec,0x71,0x69,0xc2,0x81,0x5c,0xe4, | |
| 837 | 0x28,0xd2,0x6b,0xa9,0xf6,0xfb,0xe4,0x51,0x68,0x03,0xd0,0xcd,0xc3,0x07,0x6f,0xab, | |
| 838 | 0x1c,0x94,0x5f,0x94,0xe6,0x54,0x8b,0x1a,0x3c,0xed,0xd4,0xb0,0xf3,0x26,0x81,0xfa, | |
| 839 | }; | |
| 840 | ||
| 841 | 1677 | // global so we can use them in the filename when we save out the data (debug..) |
| 842 | 1678 | static UINT8 calc3_decryption_key_byte; |
| 843 | static UINT8 calc3_ | |
| 1679 | static UINT8 calc3_alternateswaps; | |
| 844 | 1680 | static UINT8 calc3_shift; |
| 1681 | static UINT8 calc3_subtracttype; | |
| 845 | 1682 | static UINT8 calc3_mode; |
| 846 | 1683 | static UINT8 calc3_blocksize_offset; |
| 847 | 1684 | static UINT16 calc3_dataend; |
| r5613 | r5614 | |
| 875 | 1712 | // endian safe? you're having a laugh |
| 876 | 1713 | int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset) |
| 877 | 1714 | { |
| 1715 | ||
| 1716 | ||
| 1717 | ||
| 1718 | ||
| 878 | 1719 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 879 | 1720 | UINT8* rom = memory_region(machine,"cpu1"); |
| 880 | 1721 | UINT8 numregions; |
| r5613 | r5614 | |
| 882 | 1723 | int local_counter=0; |
| 883 | 1724 | int x; |
| 884 | 1725 | int offset = 0; |
| 885 | int isbrap = ( !strcmp(machine->gamedrv->name,"brapboysj") || !strcmp(machine->gamedrv->name,"brapboys")); | |
| 886 | 1726 | |
| 887 | 1727 | numregions = rom[offset+0]; |
| 888 | 1728 | |
| r5613 | r5614 | |
| 910 | 1750 | calc3_database = offset; |
| 911 | 1751 | calc3_blocksize_offset = rom[offset+0]; // location of the 'block length' |
| 912 | 1752 | calc3_mode = rom[offset+1]; |
| 913 | calc3_unknown = rom[offset+2]; | |
| 914 | calc3_shift = (calc3_unknown &0xf0)>>4; | |
| 915 | calc3_unknown &= 0x0f; | |
| 1753 | calc3_alternateswaps = rom[offset+2]; | |
| 1754 | calc3_shift = (calc3_alternateswaps &0xf0)>>4; | |
| 1755 | calc3_subtracttype = (calc3_alternateswaps &0x03); | |
| 1756 | calc3_alternateswaps &= 0x0c; | |
| 1757 | calc3_alternateswaps >>=2; | |
| 1758 | ||
| 916 | 1759 | calc3_decryption_key_byte = rom[offset+3]; |
| 917 | 1760 | |
| 918 | 1761 | |
| r5613 | r5614 | |
| 931 | 1774 | #if CALC3_VERBOSE_OUTPUT |
| 932 | 1775 | if (inline_table_size) |
| 933 | 1776 | { |
| 934 | printf("Block %02x Found Base %04x - Inline Encryption (size %02x) - Mode? %02x Shift %01x | |
| 1777 | printf("Block %02x Found Base %04x - Inline Encryption (size %02x) - Mode? %02x Shift %01x Subtract Type %01x AltSwaps %01x Key (unused?) %02x Length %04x\n", tabnum, calc3_database, inline_table_size, calc3_shift, calc3_mode, calc3_subtracttype, calc3_alternateswaps, calc3_decryption_key_byte, length); | |
| 935 | 1778 | } |
| 936 | 1779 | else |
| 937 | 1780 | { |
| 938 | printf("Block %02x Found Base %04x - Mode? %02x Shift %01x | |
| 1781 | printf("Block %02x Found Base %04x - Mode? %02x Shift %01x Subtract Type %01x AltSwaps %01x Key %02x Length %04x\n", tabnum, calc3_database, calc3_mode, calc3_shift, calc3_subtracttype, calc3_alternateswaps, calc3_decryption_key_byte, length); | |
| 939 | 1782 | } |
| 940 | 1783 | #endif |
| 941 | 1784 | // copy + decrypt the table to the specified memory area |
| r5613 | r5614 | |
| 960 | 1803 | |
| 961 | 1804 | if (calc3_mode==0x06) |
| 962 | 1805 | { |
| 963 | calc3_writeaddress_current = 0x202000; | |
| 1806 | calc3_writeaddress_current = 0x202000; // this is reasoanble for brapboys, not sure about shogun, needs emulating properly! | |
| 1807 | //calc3_writeaddress_current = 0x20c000; | |
| 964 | 1808 | } |
| 965 | 1809 | else if (calc3_mode==0x07) |
| 966 | 1810 | { |
| r5613 | r5614 | |
| 1003 | 1847 | for (i=0;i<length;i++) |
| 1004 | 1848 | { |
| 1005 | 1849 | UINT8 dat=0; |
| 1006 | int extrasign = -1; | |
| 1007 | 1850 | |
| 1008 | 1851 | |
| 1009 | if ( | |
| 1010 | (tabnum==0x11 && isbrap) || | |
| 1011 | (tabnum==0x1a && isbrap) || | |
| 1012 | (tabnum==0x21 && isbrap) || | |
| 1013 | (tabnum==0x24 && isbrap) || | |
| 1014 | (tabnum==0x28 && isbrap) | |
| 1015 | /*(tabnum==0x40 && !isbrap)*/ | |
| 1016 | ) | |
| 1017 | extrasign = 0; | |
| 1852 | /* special case for Shogun Warriors table 0x40 */ | |
| 1853 | if (calc3_subtracttype==3 && calc3_alternateswaps ==0) | |
| 1854 | { | |
| 1855 | UINT8 inlinet = rom[inline_table_base + (i%inline_table_size)]; | |
| 1856 | dat = rom[offset+i]; | |
| 1018 | 1857 | |
| 1019 | if ((tabnum==0x25 && isbrap)) | |
| 1020 | extrasign = 1; | |
| 1858 | dat -= inlinet; | |
| 1021 | 1859 | |
| 1022 | ||
| 1023 | ||
| 1024 | if (extrasign !=-1) | |
| 1860 | if (((i%inline_table_size)&1)==0) | |
| 1861 | { | |
| 1862 | dat -= extra[(i%inline_table_size)>>1]; | |
| 1863 | } | |
| 1864 | } | |
| 1865 | else | |
| 1025 | 1866 | { |
| 1026 | 1867 | if ( ((i / inline_table_size)&1)==0) |
| 1027 | 1868 | { |
| r5613 | r5614 | |
| 1038 | 1879 | UINT8 inlinet = rom[inline_table_base + (i%inline_table_size)]; |
| 1039 | 1880 | dat = rom[offset+i]; |
| 1040 | 1881 | |
| 1041 | if ( | |
| 1882 | if (calc3_subtracttype!= | |
| 1042 | 1883 | { |
| 1043 | 1884 | dat -= inlinet; |
| 1044 | 1885 | dat -= extra[(i%inline_table_size)>>1]; |
| r5613 | r5614 | |
| 1065 | 1906 | { |
| 1066 | 1907 | dat = rom[offset+i]; |
| 1067 | 1908 | |
| 1068 | if ( | |
| 1909 | if (calc3_subtracttype!= | |
| 1069 | 1910 | { |
| 1070 | 1911 | dat -= extra2[(i%inline_table_size)>>1]; |
| 1071 | 1912 | } |
| r5613 | r5614 | |
| 1077 | 1918 | } |
| 1078 | 1919 | } |
| 1079 | 1920 | } |
| 1080 | // the above rule doesn't work for this case... hmm .. | |
| 1081 | else if (tabnum==0x40 && !isbrap) // fjbuster / shogun warriors japanese character select (what enables this extra?) | |
| 1082 | { | |
| 1083 | UINT8 inlinet = rom[inline_table_base + (i%inline_table_size)]; | |
| 1084 | dat = rom[offset+i]; | |
| 1085 | //printf("%02x, ",inlinet); | |
| 1086 | dat -= inlinet; | |
| 1087 | 1921 | |
| 1088 | // note the original, table is an odd number of words, so we can't just check if i is odd / even because the additional overlay | |
| 1089 | // is relative to the start of the original table, and has a size of 0x11 (17) bytes which loop. | |
| 1090 | if (((i%inline_table_size)&1)==0) | |
| 1091 | { | |
| 1092 | dat -= extra[(i%inline_table_size)>>1]; | |
| 1093 | } | |
| 1094 | } | |
| 1095 | else | |
| 1096 | { | |
| 1097 | if (i==1) | |
| 1098 | printf("unhandled inline case\n"); | |
| 1099 | ||
| 1100 | } | |
| 1101 | ||
| 1102 | 1922 | if(local_counter>1) |
| 1103 | 1923 | { |
| 1104 | 1924 | if (space) |
| r5613 | r5614 | |
| 1120 | 1940 | } |
| 1121 | 1941 | else |
| 1122 | 1942 | { |
| 1123 | | |
| 1943 | | |
| 1124 | 1944 | |
| 1125 | // 0x00 seems to have no 'encryption' | |
| 1126 | if (calc3_decryption_key_byte == 0x00) key = calc3_key00; | |
| 1945 | if (key[0] == -1) | |
| 1946 | { | |
| 1947 | fatalerror("attempting to use invalid decryption data\n"); | |
| 1948 | } | |
| 1127 | 1949 | |
| 1128 | // each key seems to relate directly to a 0x40 byte decryption table, only these ones handled so far | |
| 1129 | if (calc3_decryption_key_byte == 0x01) key = calc3_key01; | |
| 1130 | if (calc3_decryption_key_byte == 0x04) key = calc3_key04; | |
| 1131 | if (calc3_decryption_key_byte == 0x05) key = calc3_key05; | |
| 1132 | if (calc3_decryption_key_byte == 0x15) key = calc3_key15; | |
| 1133 | if (calc3_decryption_key_byte == 0x17) key = calc3_key17; | |
| 1134 | if (calc3_decryption_key_byte == 0x19) key = calc3_key19; | |
| 1135 | if (calc3_decryption_key_byte == 0x22) key = calc3_key22; | |
| 1136 | if (calc3_decryption_key_byte == 0x24) key = calc3_key24; | |
| 1137 | if (calc3_decryption_key_byte == 0x31) key = calc3_key31; | |
| 1138 | if (calc3_decryption_key_byte == 0x39) key = calc3_key39; | |
| 1139 | if (calc3_decryption_key_byte == 0x3f) key = calc3_key3f; | |
| 1140 | if (calc3_decryption_key_byte == 0x80) key = calc3_key80; | |
| 1141 | if (calc3_decryption_key_byte == 0x89) key = calc3_key89; | |
| 1142 | if (calc3_decryption_key_byte == 0xa1) key = calc3_keya1; | |
| 1143 | if (calc3_decryption_key_byte == 0xa7) key = calc3_keya7; | |
| 1144 | if (calc3_decryption_key_byte == 0xaf) key = calc3_keyaf; | |
| 1145 | if (calc3_decryption_key_byte == 0xbc) key = calc3_keybc; | |
| 1146 | if (calc3_decryption_key_byte == 0xbf) key = calc3_keybf; | |
| 1147 | ||
| 1148 | 1950 | for (i=0;i<length;i++) |
| 1149 | 1951 | { |
| 1150 | ||
| 1151 | ||
| 1152 | 1952 | UINT8 dat = rom[offset+i]; |
| 1953 | UINT8 keydat = (UINT8)key[i&0x3f]; | |
| 1153 | 1954 | |
| 1154 | if ((tabnum==0x10 && isbrap) || | |
| 1155 | (tabnum==0x13 && isbrap) || | |
| 1156 | (tabnum==0x14 && isbrap) || | |
| 1157 | (tabnum==0x15 && isbrap) || | |
| 1158 | (tabnum==0x16 && isbrap) || | |
| 1159 | (tabnum==0x18 && isbrap) || | |
| 1160 | (tabnum==0x19 && isbrap) || | |
| 1161 | (tabnum==0x1b && isbrap) || | |
| 1162 | (tabnum==0x1c && isbrap) || | |
| 1163 | (tabnum==0x1d && isbrap) || | |
| 1164 | (tabnum==0x1f && isbrap) || | |
| 1165 | (tabnum==0x20 && isbrap) || | |
| 1166 | (tabnum==0x22 && isbrap) || | |
| 1167 | (tabnum==0x23 && isbrap) || | |
| 1168 | (tabnum==0x26 && isbrap) || | |
| 1169 | (tabnum==0x27 && isbrap) || | |
| 1170 | (tabnum==0x2a && isbrap) || | |
| 1171 | (tabnum==0x41 && !isbrap)) | |
| 1172 | 1955 | { |
| 1173 | dat -= key[i&0x3f]; | |
| 1956 | if (calc3_subtracttype==0) | |
| 1957 | { | |
| 1958 | //dat = dat; | |
| 1959 | } | |
| 1960 | else if (calc3_subtracttype==1) | |
| 1961 | { | |
| 1962 | if ((i&1)==1) dat += keydat; | |
| 1963 | else dat -= keydat; | |
| 1964 | } | |
| 1965 | else if (calc3_subtracttype==2) | |
| 1966 | { | |
| 1967 | if ((i&1)==0) dat += keydat; | |
| 1968 | else dat -= keydat; | |
| 1969 | } | |
| 1970 | else if (calc3_subtracttype==3) | |
| 1971 | { | |
| 1972 | dat -= keydat; | |
| 1973 | } | |
| 1174 | 1974 | |
| 1175 | if ((i&1)==0) dat = shift_bits(dat, 8-calc3_shift); | |
| 1176 | else dat = shift_bits(dat, calc3_shift); | |
| 1177 | ||
| 1975 | if (calc3_alternateswaps == 0) | |
| 1976 | { | |
| 1977 | if ((i&1)==0) dat = shift_bits(dat, 8-calc3_shift); | |
| 1978 | else dat = shift_bits(dat, calc3_shift); | |
| 1979 | } | |
| 1980 | else if (calc3_alternateswaps==1) | |
| 1981 | { | |
| 1982 | dat = shift_bits(dat, 8-calc3_shift); | |
| 1983 | } | |
| 1984 | else if (calc3_alternateswaps==2) | |
| 1985 | { | |
| 1986 | dat = shift_bits(dat, calc3_shift); | |
| 1987 | } | |
| 1988 | else if (calc3_alternateswaps==3) | |
| 1989 | { | |
| 1990 | // same as 0 | |
| 1991 | if ((i&1)==0) dat = shift_bits(dat, 8-calc3_shift); | |
| 1992 | else dat = shift_bits(dat, calc3_shift); | |
| 1993 | } | |
| 1178 | 1994 | } |
| 1179 | else if ((tabnum==0x17 && isbrap) || | |
| 1180 | (tabnum==0x29 && isbrap) || | |
| 1181 | (tabnum==0x2b && isbrap) || | |
| 1182 | (tabnum==0x2c && isbrap) || | |
| 1183 | (tabnum==0x2d && isbrap)) | |
| 1184 | { | |
| 1185 | if ((i&1)==0) dat += key[i&0x3f]; | |
| 1186 | else dat -= key[i&0x3f]; | |
| 1187 | 1995 | |
| 1188 | if ((i&1)==0) dat = shift_bits(dat, 8-calc3_shift); | |
| 1189 | else dat = shift_bits(dat, calc3_shift); | |
| 1190 | } | |
| 1191 | else if ((tabnum==0x1e && isbrap) || | |
| 1192 | (tabnum==0x80 && !isbrap)) | |
| 1193 | { | |
| 1194 | // note we've already seen this table, but like many others, it's + instead of - on some bytes.. | |
| 1195 | if ((i&1)==1) dat += key[i&0x3f]; | |
| 1196 | else dat -= key[i&0x3f]; | |
| 1197 | ||
| 1198 | if ((i&1)==0) dat = shift_bits(dat, 8-calc3_shift); | |
| 1199 | else dat = shift_bits(dat, calc3_shift); | |
| 1200 | } | |
| 1201 | else if (tabnum==0x12 && isbrap) | |
| 1202 | { | |
| 1203 | // this one doesn't alternate the shifts... 'unknown' is 8 | |
| 1204 | dat = BITSWAP8(dat, 4,3,2,1,0,7,6,5); | |
| 1205 | } | |
| 1206 | else | |
| 1207 | { | |
| 1208 | if (i==1) printf("unhandled non-inline case!\n"); | |
| 1209 | // plain table case | |
| 1210 | dat -= key[i&0x3f]; | |
| 1211 | } | |
| 1212 | ||
| 1213 | 1996 | if(local_counter>1) |
| 1214 | 1997 | { |
| 1215 | 1998 | if (space) |
| r5613 | r5614 | |
| 1277 | 2060 | { |
| 1278 | 2061 | sprintf(filename,"data_%s_table_%04x k%02x m%02x u%02x length %04x", |
| 1279 | 2062 | machine->gamedrv->name, |
| 1280 | x, calc3_decryption_key_byte, calc3_mode, calc3_ | |
| 2063 | x, calc3_decryption_key_byte, calc3_mode, calc3_alternateswaps, length); | |
| 1281 | 2064 | } |
| 1282 | 2065 | else |
| 1283 | 2066 | { |
| 1284 | 2067 | sprintf(filename,"data_%s_table_%04x k%02x (use indirect size %02x) m%02x u%02x length %04x", |
| 1285 | 2068 | machine->gamedrv->name, |
| 1286 | x, calc3_decryption_key_byte, calc3_blocksize_offset-3, calc3_mode, calc3_ | |
| 2069 | x, calc3_decryption_key_byte, calc3_blocksize_offset-3, calc3_mode, calc3_alternateswaps, length); | |
| 1287 | 2070 | } |
| 1288 | 2071 | |
| 1289 | 2072 | fp=fopen(filename, "w+b"); |
| r5613 | r5614 | |
| 1431 | 2214 | printf("writing back address %08x to %08x %08x\n", calc3_writeaddress_current, commandaddr,write); |
| 1432 | 2215 | #endif |
| 1433 | 2216 | |
| 1434 | | |
| 2217 | | |
| 1435 | 2218 | memory_write_byte(space,write+0x200001, data_header[1]); |
| 1436 | 2219 | |
| 1437 | 2220 | write=commandaddr+(char)commandunk; |
| 1438 | 2221 | memory_write_word(space,write+0x200000, (calc3_writeaddress_current>>16)&0xffff); |
| 1439 | 2222 | memory_write_word(space,write+0x200002, (calc3_writeaddress_current&0xffff)); |
| 1440 | ||
| 2223 | ||
| 1441 | 2224 | calc3_writeaddress_current += ((length+3)&(~1)); |
| 1442 | 2225 | } |
| 1443 | 2226 |
| r5613 | r5614 | |
|---|---|---|
| 86 | 86 | copd2_table_3[copd2_offs/8] = cop_43a; |
| 87 | 87 | copd2_table_4[copd2_offs/8] = cop_43c; |
| 88 | 88 | |
| 89 | { | |
| 90 | FILE *fp; | |
| 91 | char filename[256]; | |
| 92 | sprintf(filename,"copdat_%s.table2", machine->gamedrv->name); | |
| 93 | fp=fopen(filename, "w+b"); | |
| 94 | if (fp) | |
| 95 | { | |
| 96 | fwrite(copd2_table_2, 0x200/8, 1, fp); | |
| 97 | fclose(fp); | |
| 98 | } | |
| 99 | } | |
| 100 | { | |
| 101 | FILE *fp; | |
| 102 | char filename[256]; | |
| 103 | sprintf(filename,"copdat_%s.table3", machine->gamedrv->name); | |
| 104 | fp=fopen(filename, "w+b"); | |
| 105 | if (fp) | |
| 106 | { | |
| 107 | fwrite(copd2_table_3, 0x200/8, 1, fp); | |
| 108 | fclose(fp); | |
| 109 | } | |
| 110 | } | |
| 111 | { | |
| 112 | FILE *fp; | |
| 113 | char filename[256]; | |
| 114 | sprintf(filename,"copdat_%s.table4", machine->gamedrv->name); | |
| 115 | fp=fopen(filename, "w+b"); | |
| 116 | if (fp) | |
| 117 | { | |
| 118 | fwrite(copd2_table_4, 0x200/8, 1, fp); | |
| 119 | fclose(fp); | |
| 120 | } | |
| 121 | } | |
| 89 | /* Uncommented until actively worked on | |
| 90 | { | |
| 91 | FILE *fp; | |
| 92 | char filename[256]; | |
| 93 | sprintf(filename,"copdat_%s.table2", machine->gamedrv->name); | |
| 94 | fp=fopen(filename, "w+b"); | |
| 95 | if (fp) | |
| 96 | { | |
| 97 | fwrite(copd2_table_2, 0x200/8, 1, fp); | |
| 98 | fclose(fp); | |
| 99 | } | |
| 100 | } | |
| 101 | { | |
| 102 | FILE *fp; | |
| 103 | char filename[256]; | |
| 104 | sprintf(filename,"copdat_%s.table3", machine->gamedrv->name); | |
| 105 | fp=fopen(filename, "w+b"); | |
| 106 | if (fp) | |
| 107 | { | |
| 108 | fwrite(copd2_table_3, 0x200/8, 1, fp); | |
| 109 | fclose(fp); | |
| 110 | } | |
| 111 | } | |
| 112 | { | |
| 113 | FILE *fp; | |
| 114 | char filename[256]; | |
| 115 | sprintf(filename,"copdat_%s.table4", machine->gamedrv->name); | |
| 116 | fp=fopen(filename, "w+b"); | |
| 117 | if (fp) | |
| 118 | { | |
| 119 | fwrite(copd2_table_4, 0x200/8, 1, fp); | |
| 120 | fclose(fp); | |
| 121 | } | |
| 122 | } | |
| 123 | */ | |
| 122 | 124 | |
| 123 | 125 | } |
| 124 | 126 | |
| r5613 | r5614 | |
| 127 | 129 | copd2_table[copd2_offs] = data; |
| 128 | 130 | logerror("mcu_data %04x\n", data); |
| 129 | 131 | |
| 130 | { | |
| 131 | FILE *fp; | |
| 132 | char filename[256]; | |
| 133 | sprintf(filename,"copdat_%s.data", machine->gamedrv->name); | |
| 134 | fp=fopen(filename, "w+b"); | |
| 135 | if (fp) | |
| 136 | { | |
| 137 | fwrite(copd2_table, 0x200, 1, fp); | |
| 138 | fclose(fp); | |
| 139 | } | |
| 140 | } | |
| 132 | /* Uncommented until actively worked on | |
| 133 | { | |
| 134 | FILE *fp; | |
| 135 | char filename[256]; | |
| 136 | sprintf(filename,"copdat_%s.data", machine->gamedrv->name); | |
| 137 | fp=fopen(filename, "w+b"); | |
| 138 | if (fp) | |
| 139 | { | |
| 140 | fwrite(copd2_table, 0x200, 1, fp); | |
| 141 | fclose(fp); | |
| 142 | } | |
| 143 | } | |
| 144 | */ | |
| 141 | 145 | } |
| 142 | 146 | |
| 143 | 147 | |
| r5613 | r5614 | |
| 1267 | 1271 | *********************************************************************/ |
| 1268 | 1272 | |
| 1269 | 1273 | case (0x180/2): { return xy_check; } /*hit protection*/ |
| 1270 | case (0x182/2): { if(input_code_pressed(KEYCODE_X)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1271 | case (0x184/2): { if(input_code_pressed(KEYCODE_C)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1274 | case (0x182/2): { if(input_code_pressed(space->machine, KEYCODE_X)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1275 | case (0x184/2): { if(input_code_pressed(space->machine, KEYCODE_C)) { return 0; } else { return 3; } } /*---- ---- ---- --xx used bits*/ | |
| 1272 | 1276 | |
| 1273 | 1277 | case (0x1b0/2): return (0xffff); /* bit 15 is branched on a few times in the $1938 area */ |
| 1274 | 1278 | case (0x1b4/2): return (0xffff); /* read at $1932 and stored in ram before +0x5b0 bit 15 tested */ |
| r5613 | r5614 | |
|---|---|---|
| 286 | 286 | DRIVER( suprheli ) /* bootleg */ |
| 287 | 287 | DRIVER( stratgyx ) /* GX306 (c) 1981 Konami */ |
| 288 | 288 | DRIVER( stratgys ) /* GX306 (c) 1981 Stern */ |
| 289 | DRIVER( strongx ) /* bootleg */ | |
| 289 | 290 | DRIVER( armorcar ) /* (c) 1981 Stern */ |
| 290 | 291 | DRIVER( armorcar2 ) /* (c) 1981 Stern */ |
| 291 | 292 | DRIVER( moonwar ) /* (c) 1981 Stern */ |
| r5613 | r5614 | |
| 3107 | 3108 | |
| 3108 | 3109 | /* Namco System 10 */ |
| 3109 | 3110 | DRIVER( mrdrilr2 ) /* 2000.07 Mr Driller 2 (DR21 Ver.A) */ |
| 3111 | DRIVER( mrdrlr2a ) /* 2000.?? Mr Driller 2 (DR22 Ver.A) */ | |
| 3110 | 3112 | /* 2000.12 Gunbarina */ |
| 3111 | 3113 | /* 2001.02 Photo Battole */ |
| 3112 | 3114 | /* 2001.02 Taiko no Tatsujin */ |
| r5613 | r5614 | |
| 4337 | 4339 | DRIVER( naomi2 ) |
| 4338 | 4340 | |
| 4339 | 4341 | DRIVER( hod2bios ) /* 1998.11 The House of the Dead 2 */ |
| 4342 | DRIVER( hotd2 ) /* 1998.11 The House of the Dead 2 */ | |
| 4340 | 4343 | DRIVER( dybbnao ) /* 1998.12 Dynamite Baseball NAOMI */ |
| 4344 | DRIVER( smlg99 ) /* 1999.?? Super Major League '99 */ | |
| 4341 | 4345 | DRIVER( pstone ) /* 1999.02 Power Stone */ |
| 4342 | 4346 | /* 1999.02 Crazy Taxi */ |
| 4343 | 4347 | DRIVER( zombrvn ) /* 1999.02 Zombie Revenge */ |
| r5613 | r5614 | |
| 4414 | 4418 | /* 2001.06 Crackin' DJ Part2 */ |
| 4415 | 4419 | DRIVER( wsbbgd ) /* 2001.06 Super Major League */ |
| 4416 | 4420 | DRIVER( spkrbtl ) /* 2001.07 Spikers Battle */ |
| 4417 | | |
| 4421 | DRIVER( gunsur2 ) /* 2001.07 Gun Survivor 2: Bio Hazard Code Veronica */ | |
| 4418 | 4422 | /* 2001.07 Dokidoki Idol Star Seeker */ |
| 4419 | 4423 | DRIVER( cvs2gd ) /* 2001.08 Capcom vs. SNK 2 */ |
| 4420 | 4424 | DRIVER( gundmxgd ) /* 2001.09 Kidou Senshi Gundam Renpou vs. Zeon DX */ |
| r5613 | r5614 | |
| 4508 | 4512 | /* 2001.06 Club Kart */ |
| 4509 | 4513 | DRIVER( beachspi ) /* 2001.07 Beach Spikers */ |
| 4510 | 4514 | /* 2001.08 Wave Runner GP */ |
| 4511 | DRIVER( vf4 ) /* 2001.08.02 Virtua Fighter 4 */ | |
| 4515 | DRIVER( vf4cart ) /* 2001.08.02 Virtua Fighter 4 (cartridge) */ | |
| 4516 | DRIVER( vf4 ) /* 2001.08.02 Virtua Fighter 4 (GD-ROM) */ | |
| 4512 | 4517 | DRIVER( vf4b ) /* 2001.08.20 Virtua Fighter 4 ver.B */ |
| 4513 | 4518 | DRIVER( vf4c ) /* 2002.01.31 Virtua Fighter 4 ver.C */ |
| 4514 | 4519 | /* 2002.02 The King of Route 66 */ |
| 4515 | 4520 | DRIVER( initd ) /* 2002.03 Initial D Arcade Stage */ |
| 4516 | 4521 | DRIVER( initdexp ) /* 200?.?? Initial D Export Version */ |
| 4522 | DRIVER( clubkrte ) /* 2002.?? Club Kart: European Session */ | |
| 4517 | 4523 | /* 2002.06 WCCF SERIE A 2001-2002 */ |
| 4518 | 4524 | /* 2002.07 Soul Surfer */ |
| 4519 | 4525 | DRIVER( vf4evoa ) /* 2002.08 Virtua Fighter 4 Evolution */ |
| r5613 | r5614 | |
| 4546 | 4552 | DRIVER( sprtshot ) /* 2002.12 Sports Shooting USA */ |
| 4547 | 4553 | /* 2003.03 Guilty Gear X ver.1.5 */ |
| 4548 | 4554 | DRIVER( demofist ) /* 2003.06 Demolish Fist */ |
| 4549 | /* 2003.08 Dolphin Blue */ | |
| 4550 | /* 2003.12 Guilty Gear Isuka */ | |
| 4555 | DRIVER( dolphin ) /* 2003.08 Dolphin Blue */ | |
| 4556 | DRIVER( ggisuka ) /* 2003.12 Guilty Gear Isuka */ | |
| 4551 | 4557 | /* 2003.12 Sangoku Senki Shichisei Tensei (IGS) */ |
| 4552 | | |
| 4558 | DRIVER( rumblef ) /* 2004.03 The Rumble Fish */ | |
| 4553 | 4559 | DRIVER( rangrmsn ) /* 2004.03 Ranger Mission */ |
| 4554 | 4560 | /* 2004.06 Salary Man Kintarou Net Select */ |
| 4555 | | |
| 4561 | DRIVER( kofnw ) /* 2004.07 The King of Fighters Neo Wave */ | |
| 4556 | 4562 | DRIVER( xtrmhunt ) /* 2004.09 Extreme Hunting */ |
| 4557 | 4563 | /* 2004.09 Dirty Pig Skin Football */ |
| 4558 | 4564 | /* 2004.09 Faster than Speed */ |
| 4565 | DRIVER( kov7sprt ) /* 2004.?? Knights of Valour - The Seven Sprits */ | |
| 4559 | 4566 | /* 2005.03 Net Select Keiba Victory Furlong */ |
| 4560 | 4567 | /* 2005.03 The Rumble Fish 2 */ |
| 4561 | | |
| 4568 | DRIVER( ngbc ) /* 2005.07 NeoGeo Battle Colloseum */ | |
| 4562 | 4569 | /* 2005.09 Samurai Spirits Tenkaichi Kenkakuden */ |
| 4563 | 4570 | /* 2005.10 The King of Fighters XI */ |
| 4564 | 4571 | DRIVER( fotns ) /* 2005.12 Hokuto no Ken */ |
| r5613 | r5614 | |
| 4779 | 4786 | DRIVER( kchamp ) /* (c) 1984 Data East USA (US) */ |
| 4780 | 4787 | DRIVER( karatedo ) /* (c) 1984 Data East Corporation (Japan) */ |
| 4781 | 4788 | DRIVER( kchampvs ) /* (c) 1984 Data East USA (US) */ |
| 4789 | DRIVER( kchampvs2 ) /* (c) 1984 Data East USA (US) */ | |
| 4782 | 4790 | DRIVER( karatevs ) /* (c) 1984 Data East Corporation (Japan) */ |
| 4783 | 4791 | DRIVER( compgolf ) /* (c) 1985 Data East Corporation (Japan) */ |
| 4784 | 4792 | DRIVER( compgolfo ) /* (c) 1985 Data East Corporation (Japan) */ |
| r5613 | r5614 | |
| 5078 | 5086 | DRIVER( gaiden ) /* 6215 - (c) 1988 Tecmo (US) */ |
| 5079 | 5087 | DRIVER( ryukendn ) /* 6215 - (c) 1989 Tecmo (Japan) */ |
| 5080 | 5088 | DRIVER( ryukendna ) /* 6215 - (c) 1989 Tecmo (Japan) */ |
| 5089 | DRIVER( mastninj ) /* bootleg */ | |
| 5081 | 5090 | DRIVER( wildfang ) /* (c) 1989 Tecmo */ |
| 5082 | 5091 | DRIVER( tknight ) /* (c) 1989 Tecmo */ |
| 5083 | 5092 | DRIVER( stratof ) /* (c) 1991 Tecmo */ |
| r5613 | r5614 | |
| 6713 | 6722 | /* Williams/Midway TMS games */ |
| 6714 | 6723 | DRIVER( narc ) /* (c) 1988 Williams */ |
| 6715 | 6724 | DRIVER( narc3 ) /* (c) 1988 Williams */ |
| 6725 | DRIVER( narc2 ) /* (c) 1988 Williams */ | |
| 6716 | 6726 | DRIVER( trog ) /* (c) 1990 Midway */ |
| 6717 | 6727 | DRIVER( trog4 ) /* (c) 1990 Midway */ |
| 6718 | 6728 | DRIVER( trog3 ) /* (c) 1990 Midway */ |
| r5613 | r5614 | |
| 6734 | 6744 | DRIVER( strkforc ) /* (c) 1991 Midway */ |
| 6735 | 6745 | DRIVER( mk ) /* (c) 1992 Midway */ |
| 6736 | 6746 | DRIVER( mkr4 ) /* (c) 1992 Midway */ |
| 6737 | DRIVER( mkturbo ) /* bootleg */ | |
| 6747 | DRIVER( mktturbo ) /* hack */ | |
| 6748 | DRIVER( mkyturbo ) /* hack */ | |
| 6738 | 6749 | DRIVER( mkprot8 ) /* (c) 1992 Midway */ |
| 6739 | 6750 | DRIVER( mkprot9 ) /* (c) 1992 Midway */ |
| 6740 | 6751 | DRIVER( mkla1 ) /* (c) 1992 Midway */ |
| r5613 | r5614 | |
| 7519 | 7530 | DRIVER( kiwame ) /* (c) 1994 Athena */ |
| 7520 | 7531 | DRIVER( krzybowl ) /* (c) 1994 American Sammy */ |
| 7521 | 7532 | DRIVER( orbs ) /* (c) 1994 American Sammy */ |
| 7533 | DRIVER( keroppi ) /* (c) 1993 Sammy */ | |
| 7522 | 7534 | DRIVER( extdwnhl ) /* (c) 1995 Sammy Japan */ |
| 7523 | 7535 | DRIVER( gundhara ) /* (c) 1995 Banpresto */ |
| 7524 | 7536 | DRIVER( sokonuke ) /* (c) 1995 Sammy Industries */ |
| r5613 | r5614 | |
| 8950 | 8962 | DRIVER( witchcdb ) /* 1991, Unknown */ |
| 8951 | 8963 | DRIVER( witchcdc ) /* 1991, Unknown */ |
| 8952 | 8964 | DRIVER( witchcdd ) /* 1991, Unknown */ |
| 8965 | DRIVER( witchcde ) /* 1994, Unknown */ | |
| 8966 | DRIVER( witchcdf ) /* (c) 1991 PlayMan */ | |
| 8953 | 8967 | DRIVER( sloco93 ) /* 1993, Unknown */ |
| 8954 | 8968 | DRIVER( sloco93a ) /* 1993, Unknown */ |
| 8955 | 8969 | DRIVER( maverik ) /* 198?, Unknown */ |
| r5613 | r5614 | |
| 8979 | 8993 | DRIVER( bsuerteu ) /* 1991, Unknown */ |
| 8980 | 8994 | |
| 8981 | 8995 | /* Cal Omega */ |
| 8996 | DRIVER( comg074 ) /* (c) 1981 Cal Omega Inc. */ | |
| 8982 | 8997 | DRIVER( comg076 ) /* (c) 1981 Cal Omega Inc. */ |
| 8983 | 8998 | DRIVER( comg079 ) /* (c) 1981 Cal Omega Inc. */ |
| 8984 | 8999 | DRIVER( comg080 ) /* (c) 1981 Cal Omega Inc. */ |
| r5613 | r5614 | |
|---|---|---|
| 28 | 28 | WRITE16_HANDLER( mustang_scroll_w ); |
| 29 | 29 | WRITE16_HANDLER( bioshipbg_scroll_w ); |
| 30 | 30 | WRITE16_HANDLER( vandyke_scroll_w ); |
| 31 | WRITE16_HANDLER( vandykeb_scroll_w ); | |
| 31 | 32 | WRITE16_HANDLER( manybloc_scroll_w ); |
| 32 | 33 | |
| 33 | 34 | VIDEO_START( macross ); |
| r5613 | r5614 | |
|---|---|---|
| 26 | 26 | DRIVER_INIT( shimpact ); |
| 27 | 27 | DRIVER_INIT( strkforc ); |
| 28 | 28 | DRIVER_INIT( mkyunit ); |
| 29 | DRIVER_INIT( mkyturbo ); | |
| 29 | 30 | DRIVER_INIT( mkyawdim ); |
| 30 | 31 | DRIVER_INIT( term2 ); |
| 31 | 32 | DRIVER_INIT( term2la2 ); |
| r5613 | r5614 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | *************************************************************************/ |
| 6 | 6 | |
| 7 | #define BZONE_DISCRETE (1) | |
| 8 | ||
| 9 | 7 | #define BZONE_MASTER_CLOCK (XTAL_12_096MHz) |
| 10 | 8 | #define BZONE_CLOCK_3KHZ (MASTER_CLOCK / 4096) |
| 11 | 9 | |
| r5613 | r5614 | |
| 16 | 14 | |
| 17 | 15 | /*----------- defined in audio/bzone.c -----------*/ |
| 18 | 16 | |
| 19 | #if BZONE_DISCRETE | |
| 20 | 17 | |
| 21 | 18 | WRITE8_DEVICE_HANDLER( bzone_sounds_w ); |
| 22 | 19 | |
| 23 | 20 | MACHINE_DRIVER_EXTERN( bzone_audio ); |
| 24 | #else | |
| 25 | WRITE8_HANDLER( bzone_sounds_w ); | |
| 26 | 21 | |
| 27 | DEVICE_GET_INFO( bzone_sound ); | |
| 28 | #define SOUND_BZONE DEVICE_GET_INFO_NAME(bzone_sound) | |
| 29 | #endif | |
| 30 | ||
| 31 | 22 | /*----------- defined in audio/redbaron.c -----------*/ |
| 32 | 23 | |
| 33 | 24 | WRITE8_HANDLER( redbaron_sounds_w ); |
| r5613 | r5614 | |
|---|---|---|
| 57 | 57 | |
| 58 | 58 | READ16_HANDLER( deco16_71_r ); |
| 59 | 59 | |
| 60 | void deco16_print_debug_info(bitmap_t *bitmap); | |
| 60 | void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap); |
| r5613 | r5614 | |
|---|---|---|
| 13 | 13 | WRITE64_HANDLER( dc_sysctrl_w ); |
| 14 | 14 | READ64_HANDLER( dc_maple_r ); |
| 15 | 15 | WRITE64_HANDLER( dc_maple_w ); |
| 16 | READ64_HANDLER( naomi_maple_r ); | |
| 17 | WRITE64_HANDLER( naomi_maple_w ); | |
| 16 | 18 | READ64_HANDLER( dc_gdrom_r ); |
| 17 | 19 | WRITE64_HANDLER( dc_gdrom_w ); |
| 18 | 20 | READ64_HANDLER( dc_g1_ctrl_r ); |
| r5613 | r5614 | |
|---|---|---|
| 115 | 115 | CPUS += TMS0980 |
| 116 | 116 | CPUS += I4004 |
| 117 | 117 | CPUS += SUPERFX |
| 118 | CPUS += Z8 | |
| 118 | 119 | |
| 119 | 120 | |
| 120 | 121 | #------------------------------------------------- |
| r5613 | r5614 | |
|---|---|---|
| 199 | 199 | x - no bg/sprite pri. |
| 200 | 200 | */ |
| 201 | 201 | |
| 202 | #define mKEY_MASK(x,y) if (input_code_pressed_once(x)){nycaptor_mask|=y;tilemap_mark_all_tiles_dirty( bg_tilemap );} | |
| 202 | #define mKEY_MASK(x,y) if (input_code_pressed_once(machine, x)){nycaptor_mask|=y;tilemap_mark_all_tiles_dirty( bg_tilemap );} | |
| 203 | 203 | |
| 204 | static void nycaptor_setmask( | |
| 204 | static void nycaptor_setmask(running_machine *machine) | |
| 205 | 205 | { |
| 206 | 206 | mKEY_MASK(KEYCODE_Q,1); /* bg */ |
| 207 | 207 | mKEY_MASK(KEYCODE_W,2); |
| r5613 | r5614 | |
| 217 | 217 | mKEY_MASK(KEYCODE_J,0x400); |
| 218 | 218 | mKEY_MASK(KEYCODE_K,0x800); |
| 219 | 219 | |
| 220 | if (input_code_pressed_once(KEYCODE_Z)){nycaptor_mask=0;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* disable */ | |
| 221 | if (input_code_pressed_once(KEYCODE_X)){nycaptor_mask|=0x1000;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* no layers */ | |
| 220 | if (input_code_pressed_once(machine, KEYCODE_Z)){nycaptor_mask=0;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* disable */ | |
| 221 | if (input_code_pressed_once(machine, KEYCODE_X)){nycaptor_mask|=0x1000;tilemap_mark_all_tiles_dirty( bg_tilemap );} /* no layers */ | |
| 222 | 222 | } |
| 223 | 223 | #endif |
| 224 | 224 | |
| 225 | 225 | VIDEO_UPDATE( nycaptor ) |
| 226 | 226 | { |
| 227 | 227 | #if NYCAPTOR_DEBUG |
| 228 | nycaptor_setmask(); | |
| 228 | nycaptor_setmask(screen->machine); | |
| 229 | 229 | if(nycaptor_mask&0x1000) |
| 230 | 230 | { |
| 231 | 231 | tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_LAYER1|3,0); |
| r5613 | r5614 | |
|---|---|---|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | #ifdef UNUSED_FUNCTION |
| 35 | static void blitRaster(bitmap_t *bitmap, int rasterMode) | |
| 35 | static void blitRaster(running_machine *machine, bitmap_t *bitmap, int rasterMode) | |
| 36 | 36 | { |
| 37 | 37 | int x,y; |
| 38 | 38 | for (y=0; y<256; y++) //todo |
| r5613 | r5614 | |
| 41 | 41 | UINT32* dst=BITMAP_ADDR32(bitmap, y, 0); |
| 42 | 42 | UINT32 xptr=(mlc_raster_table[0][y]<<13); |
| 43 | 43 | |
| 44 | if (input_code_pressed(KEYCODE_X)) | |
| 44 | if (input_code_pressed(machine, KEYCODE_X)) | |
| 45 | 45 | xptr=0; |
| 46 | 46 | |
| 47 | 47 | for (x=0; x<320; x++) |
| r5613 | r5614 | |
| 49 | 49 | if (src[x]) |
| 50 | 50 | dst[x]=src[(xptr>>16)&0x1ff]; |
| 51 | 51 | |
| 52 | //if (input_code_pressed(KEYCODE_X)) | |
| 52 | //if (input_code_pressed(machine, KEYCODE_X)) | |
| 53 | 53 | // xptr+=0x10000; |
| 54 | 54 | //else if(rasterHackTest[0][y]<0) |
| 55 | 55 | xptr+=0x10000 - ((mlc_raster_table[2][y]&0x3ff)<<5); |
| r5613 | r5614 | |
| 499 | 499 | |
| 500 | 500 | // if (lastRasterMode!=0 && rasterDirty) |
| 501 | 501 | // { |
| 502 | // blitRaster(bitmap, rasterMode); | |
| 502 | // blitRaster(machine, bitmap, rasterMode); | |
| 503 | 503 | // bitmap_fill(temp_bitmap,cliprect,0); |
| 504 | 504 | // rasterDirty=0; |
| 505 | 505 | // } |
| r5613 | r5614 | |
|---|---|---|
| 455 | 455 | |
| 456 | 456 | if (LOG_DMA) |
| 457 | 457 | { |
| 458 | if (input_code_pressed(KEYCODE_L)) | |
| 458 | if (input_code_pressed(space->machine, KEYCODE_L)) | |
| 459 | 459 | { |
| 460 | 460 | logerror("----\n"); |
| 461 | 461 | logerror("DMA command %04X: (xflip=%d yflip=%d)\n", |
| r5613 | r5614 | |
|---|---|---|
| 1997 | 1997 | int framebufer_changed = 0; |
| 1998 | 1998 | |
| 1999 | 1999 | // int enable; |
| 2000 | // if (input_code_pressed (KEYCODE_R)) vdp1_sprite_log = 1; | |
| 2001 | // if (input_code_pressed (KEYCODE_T)) vdp1_sprite_log = 0; | |
| 2000 | // if (input_code_pressed (machine, KEYCODE_R)) vdp1_sprite_log = 1; | |
| 2001 | // if (input_code_pressed (machine, KEYCODE_T)) vdp1_sprite_log = 0; | |
| 2002 | 2002 | |
| 2003 | // if (input_code_pressed (KEYCODE_Y)) vdp1_sprite_log = 0; | |
| 2003 | // if (input_code_pressed (machine, KEYCODE_Y)) vdp1_sprite_log = 0; | |
| 2004 | 2004 | // { |
| 2005 | 2005 | // FILE *fp; |
| 2006 | 2006 | // |
| r5613 | r5614 | |
|---|---|---|
| 404 | 404 | |
| 405 | 405 | |
| 406 | 406 | |
| 407 | #ifdef MAME_DEBUG | |
| 408 | static void twincobr_log_vram(void) | |
| 407 | static void twincobr_log_vram(running_machine *machine) | |
| 409 | 408 | { |
| 410 | if ( input_code_pressed(KEYCODE_M) ) | |
| 409 | #ifdef MAME_DEBUG | |
| 410 | if ( input_code_pressed(machine, KEYCODE_M) ) | |
| 411 | 411 | { |
| 412 | 412 | offs_t tile_voffs; |
| 413 | 413 | int tcode[4]; |
| 414 | while (input_code_pressed(KEYCODE_M)) ; | |
| 414 | while (input_code_pressed(machine, KEYCODE_M)) ; | |
| 415 | 415 | logerror("Scrolls BG-X BG-Y FG-X FG-Y TX-X TX-Y\n"); |
| 416 | 416 | logerror("------> %04x %04x %04x %04x %04x %04x\n",bgscrollx,bgscrolly,fgscrollx,fgscrolly,txscrollx,txscrolly); |
| 417 | 417 | for ( tile_voffs = 0; tile_voffs < (twincobr_txvideoram_size/2); tile_voffs++ ) |
| r5613 | r5614 | |
| 439 | 439 | tcode[1] & 0xf000 >> 12, tcode[1] & 0x0fff); |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | } | |
| 443 | 442 | #endif |
| 443 | } | |
| 444 | 444 | |
| 445 | 445 | |
| 446 | 446 | /*************************************************************************** |
| r5613 | r5614 | |
| 486 | 486 | |
| 487 | 487 | VIDEO_UPDATE( toaplan0 ) |
| 488 | 488 | { |
| 489 | #ifdef MAME_DEBUG | |
| 490 | twincobr_log_vram(); | |
| 491 | #endif | |
| 489 | twincobr_log_vram(screen->machine); | |
| 492 | 490 | |
| 493 | 491 | if (wardner_sprite_hack) wardner_sprite_priority_hack(); |
| 494 | 492 |
| r5613 | r5614 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | palette_bank = (data >> 1) & 0x03; |
| 188 | 188 | |
| 189 | sound_global_enable(~data & 0x08); | |
| 189 | sound_global_enable(space->machine, ~data & 0x08); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 |
| r5613 | r5614 | |
|---|---|---|
| 152 | 152 | int layers_ctrl = -1; |
| 153 | 153 | |
| 154 | 154 | #ifdef MAME_DEBUG |
| 155 | if (input_code_pressed(KEYCODE_Z)) | |
| 155 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 156 | 156 | { int msk = 0; |
| 157 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 158 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 159 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 160 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 157 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 158 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 159 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 160 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 161 | 161 | if (msk != 0) layers_ctrl &= msk; } |
| 162 | 162 | #endif |
| 163 | 163 |
| r5613 | r5614 | |
|---|---|---|
| 719 | 719 | |
| 720 | 720 | if (LOG_DMA) |
| 721 | 721 | { |
| 722 | if (input_code_pressed(KEYCODE_L)) | |
| 722 | if (input_code_pressed(space->machine, KEYCODE_L)) | |
| 723 | 723 | { |
| 724 | 724 | logerror("DMA command %04X: (bpp=%d skip=%d xflip=%d yflip=%d preskip=%d postskip=%d)\n", |
| 725 | 725 | command, (command >> 12) & 7, (command >> 7) & 1, (command >> 4) & 1, (command >> 5) & 1, (command >> 8) & 3, (command >> 10) & 3); |
| r5613 | r5614 | |
|---|---|---|
| 352 | 352 | tilemap_set_scrolly( tilemap_1, 0, 0x00); |
| 353 | 353 | |
| 354 | 354 | #ifdef MAME_DEBUG |
| 355 | if (input_code_pressed(KEYCODE_Z)) | |
| 355 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 356 | 356 | { |
| 357 | 357 | int msk = 0; |
| 358 | 358 | |
| 359 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 360 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 361 | // if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 362 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 359 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 360 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 361 | // if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 362 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 363 | 363 | if (msk != 0) layers_ctrl &= msk; |
| 364 | 364 | } |
| 365 | 365 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 2163 | 2163 | |
| 2164 | 2164 | #define mul_fixed32( a, b ) mul_32x32_shift( a, b, 16 ) |
| 2165 | 2165 | |
| 2166 | static void stv_vdp2_fill_rotation_parameter_table( UINT8 rot_parameter ) | |
| 2166 | static void stv_vdp2_fill_rotation_parameter_table( running_machine *machine, UINT8 rot_parameter ) | |
| 2167 | 2167 | { |
| 2168 | 2168 | UINT32 address; |
| 2169 | 2169 | |
| r5613 | r5614 | |
| 2222 | 2222 | /*Attempt to show on screen the rotation table*/ |
| 2223 | 2223 | if(LOG_ROZ == 2) |
| 2224 | 2224 | { |
| 2225 | if(input_code_pressed_once(JOYCODE_Y_UP_SWITCH)) | |
| 2225 | if(input_code_pressed_once(machine, JOYCODE_Y_UP_SWITCH)) | |
| 2226 | 2226 | debug.roz++; |
| 2227 | 2227 | |
| 2228 | if(input_code_pressed_once(JOYCODE_Y_DOWN_SWITCH)) | |
| 2228 | if(input_code_pressed_once(machine, JOYCODE_Y_DOWN_SWITCH)) | |
| 2229 | 2229 | debug.roz--; |
| 2230 | 2230 | |
| 2231 | 2231 | if(debug.roz > 10) |
| r5613 | r5614 | |
| 4752 | 4752 | static void stv_vdp2_draw_rotation_screen(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int iRP) |
| 4753 | 4753 | { |
| 4754 | 4754 | rectangle roz_clip_rect, mycliprect; |
| 4755 | int planesizex = 0, planesizey = 0, planerenderedsizex, planerenderedsizey; | |
| 4755 | int planesizex = 0, planesizey = 0; | |
| 4756 | int planerenderedsizex, planerenderedsizey; | |
| 4756 | 4757 | UINT8 colour_calculation_enabled; |
| 4757 | 4758 | UINT8 window_control; |
| 4758 | 4759 | UINT8 fade_control; |
| r5613 | r5614 | |
| 4800 | 4801 | stv2_current_tilemap.map_count = 16; |
| 4801 | 4802 | } |
| 4802 | 4803 | |
| 4803 | stv_vdp2_fill_rotation_parameter_table(iRP); | |
| 4804 | stv_vdp2_fill_rotation_parameter_table(machine, iRP); | |
| 4804 | 4805 | |
| 4805 | 4806 | if ( iRP == 1 ) |
| 4806 | 4807 | { |
| r5613 | r5614 | |
| 6226 | 6227 | stv_vdp2_draw_back(screen->machine, bitmap,cliprect); |
| 6227 | 6228 | |
| 6228 | 6229 | #if DEBUG_MODE |
| 6229 | if(input_code_pressed_once(KEYCODE_T)) | |
| 6230 | if(input_code_pressed_once(screen->machine, KEYCODE_T)) | |
| 6230 | 6231 | { |
| 6231 | 6232 | debug.l_en^=1; |
| 6232 | 6233 | popmessage("NBG3 %sabled",debug.l_en & 1 ? "en" : "dis"); |
| 6233 | 6234 | } |
| 6234 | if(input_code_pressed_once(KEYCODE_Y)) | |
| 6235 | if(input_code_pressed_once(screen->machine, KEYCODE_Y)) | |
| 6235 | 6236 | { |
| 6236 | 6237 | debug.l_en^=2; |
| 6237 | 6238 | popmessage("NBG2 %sabled",debug.l_en & 2 ? "en" : "dis"); |
| 6238 | 6239 | } |
| 6239 | if(input_code_pressed_once(KEYCODE_U)) | |
| 6240 | if(input_code_pressed_once(screen->machine, KEYCODE_U)) | |
| 6240 | 6241 | { |
| 6241 | 6242 | debug.l_en^=4; |
| 6242 | 6243 | popmessage("NBG1 %sabled",debug.l_en & 4 ? "en" : "dis"); |
| 6243 | 6244 | } |
| 6244 | if(input_code_pressed_once(KEYCODE_I)) | |
| 6245 | if(input_code_pressed_once(screen->machine, KEYCODE_I)) | |
| 6245 | 6246 | { |
| 6246 | 6247 | debug.l_en^=8; |
| 6247 | 6248 | popmessage("NBG0 %sabled",debug.l_en & 8 ? "en" : "dis"); |
| 6248 | 6249 | } |
| 6249 | if(input_code_pressed_once(KEYCODE_K)) | |
| 6250 | if(input_code_pressed_once(screen->machine, KEYCODE_K)) | |
| 6250 | 6251 | { |
| 6251 | 6252 | debug.l_en^=0x10; |
| 6252 | 6253 | popmessage("RBG0 %sabled",debug.l_en & 0x10 ? "en" : "dis"); |
| 6253 | 6254 | } |
| 6254 | if(input_code_pressed_once(KEYCODE_O)) | |
| 6255 | if(input_code_pressed_once(screen->machine, KEYCODE_O)) | |
| 6255 | 6256 | { |
| 6256 | 6257 | debug.l_en^=0x20; |
| 6257 | 6258 | popmessage("SPRITE %sabled",debug.l_en & 0x20 ? "en" : "dis"); |
| r5613 | r5614 | |
| 6294 | 6295 | ,STV_VDP2_N1ZMXI,STV_VDP2_N1ZMXD |
| 6295 | 6296 | ,STV_VDP2_N1ZMYI,STV_VDP2_N1ZMYD);*/ |
| 6296 | 6297 | |
| 6297 | if ( input_code_pressed_once(KEYCODE_W) ) | |
| 6298 | if ( input_code_pressed_once(screen->machine, KEYCODE_W) ) | |
| 6298 | 6299 | { |
| 6299 | 6300 | int tilecode; |
| 6300 | 6301 | |
| r5613 | r5614 | |
| 6338 | 6339 | } |
| 6339 | 6340 | } |
| 6340 | 6341 | |
| 6341 | if ( input_code_pressed_once(KEYCODE_N) ) | |
| 6342 | if ( input_code_pressed_once(screen->machine, KEYCODE_N) ) | |
| 6342 | 6343 | { |
| 6343 | 6344 | FILE *fp; |
| 6344 | 6345 | |
| r5613 | r5614 | |
| 6350 | 6351 | } |
| 6351 | 6352 | } |
| 6352 | 6353 | |
| 6353 | if ( input_code_pressed_once(KEYCODE_M) ) | |
| 6354 | if ( input_code_pressed_once(screen->machine, KEYCODE_M) ) | |
| 6354 | 6355 | { |
| 6355 | 6356 | FILE *fp; |
| 6356 | 6357 |
| r5613 | r5614 | |
|---|---|---|
| 1053 | 1053 | hanamai_priority = BITSWAP8(data, 3,2,1,0, 4,7,5,6); |
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | static int debug_mask( | |
| 1056 | static int debug_mask(running_machine *machine) | |
| 1057 | 1057 | { |
| 1058 | 1058 | #ifdef MAME_DEBUG |
| 1059 | 1059 | int msk = 0; |
| 1060 | if (input_code_pressed(KEYCODE_Z)) | |
| 1060 | if (input_code_pressed(machine, KEYCODE_Z)) | |
| 1061 | 1061 | { |
| 1062 | if (input_code_pressed(KEYCODE_Q)) msk |= 0x01; // layer 0 | |
| 1063 | if (input_code_pressed(KEYCODE_W)) msk |= 0x02; // layer 1 | |
| 1064 | if (input_code_pressed(KEYCODE_E)) msk |= 0x04; // layer 2 | |
| 1065 | if (input_code_pressed(KEYCODE_R)) msk |= 0x08; // layer 3 | |
| 1066 | if (input_code_pressed(KEYCODE_A)) msk |= 0x10; // layer 4 | |
| 1067 | if (input_code_pressed(KEYCODE_S)) msk |= 0x20; // layer 5 | |
| 1068 | if (input_code_pressed(KEYCODE_D)) msk |= 0x40; // layer 6 | |
| 1069 | if (input_code_pressed(KEYCODE_F)) msk |= 0x80; // layer 7 | |
| 1062 | if (input_code_pressed(machine, KEYCODE_Q)) msk |= 0x01; // layer 0 | |
| 1063 | if (input_code_pressed(machine, KEYCODE_W)) msk |= 0x02; // layer 1 | |
| 1064 | if (input_code_pressed(machine, KEYCODE_E)) msk |= 0x04; // layer 2 | |
| 1065 | if (input_code_pressed(machine, KEYCODE_R)) msk |= 0x08; // layer 3 | |
| 1066 | if (input_code_pressed(machine, KEYCODE_A)) msk |= 0x10; // layer 4 | |
| 1067 | if (input_code_pressed(machine, KEYCODE_S)) msk |= 0x20; // layer 5 | |
| 1068 | if (input_code_pressed(machine, KEYCODE_D)) msk |= 0x40; // layer 6 | |
| 1069 | if (input_code_pressed(machine, KEYCODE_F)) msk |= 0x80; // layer 7 | |
| 1070 | 1070 | if (msk != 0) return msk; |
| 1071 | 1071 | } |
| 1072 | 1072 | #endif |
| r5613 | r5614 | |
| 1083 | 1083 | { |
| 1084 | 1084 | #ifdef MAME_DEBUG |
| 1085 | 1085 | static int toggle; |
| 1086 | if (input_code_pressed_once(KEYCODE_T)) toggle = 1-toggle; | |
| 1086 | if (input_code_pressed_once(machine, KEYCODE_T)) toggle = 1-toggle; | |
| 1087 | 1087 | if (toggle) { |
| 1088 | 1088 | UINT8 *RAM = memory_region( machine, "gfx1" ); |
| 1089 | 1089 | size_t size = memory_region_length( machine, "gfx1" ); |
| 1090 | 1090 | static int i = 0, c = 0, r = 0; |
| 1091 | 1091 | |
| 1092 | if (input_code_pressed_once(KEYCODE_I)) c = (c-1) & 0x1f; | |
| 1093 | if (input_code_pressed_once(KEYCODE_O)) c = (c+1) & 0x1f; | |
| 1094 | if (input_code_pressed_once(KEYCODE_R)) { r = (r+1) & 0x7; i = size/8 * r; } | |
| 1095 | if (input_code_pressed(KEYCODE_M) | input_code_pressed_once(KEYCODE_K)) { | |
| 1092 | if (input_code_pressed_once(machine, KEYCODE_I)) c = (c-1) & 0x1f; | |
| 1093 | if (input_code_pressed_once(machine, KEYCODE_O)) c = (c+1) & 0x1f; | |
| 1094 | if (input_code_pressed_once(machine, KEYCODE_R)) { r = (r+1) & 0x7; i = size/8 * r; } | |
| 1095 | if (input_code_pressed(machine, KEYCODE_M) | input_code_pressed_once(machine, KEYCODE_K)) { | |
| 1096 | 1096 | while( i < size && RAM[i] ) i++; while( i < size && !RAM[i] ) i++; } |
| 1097 | if (input_code_pressed(KEYCODE_N) | input_code_pressed_once(KEYCODE_J)) { | |
| 1097 | if (input_code_pressed(machine, KEYCODE_N) | input_code_pressed_once(machine, KEYCODE_J)) { | |
| 1098 | 1098 | if (i >= 2) i-=2; while( i > 0 && RAM[i] ) i--; i++; } |
| 1099 | 1099 | |
| 1100 | 1100 | dynax_blit_palettes = (c & 0xf) * 0x111; |
| r5613 | r5614 | |
| 1124 | 1124 | int lay[4]; |
| 1125 | 1125 | |
| 1126 | 1126 | if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; |
| 1127 | layers_ctrl &= debug_mask(); | |
| 1127 | layers_ctrl &= debug_mask(screen->machine); | |
| 1128 | 1128 | |
| 1129 | 1129 | bitmap_fill(bitmap, cliprect, |
| 1130 | 1130 | (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); |
| r5613 | r5614 | |
| 1158 | 1158 | int pri; |
| 1159 | 1159 | |
| 1160 | 1160 | if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; |
| 1161 | layers_ctrl &= debug_mask(); | |
| 1161 | layers_ctrl &= debug_mask(screen->machine); | |
| 1162 | 1162 | |
| 1163 | 1163 | bitmap_fill(bitmap, cliprect, |
| 1164 | 1164 | (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 0x0f) * 256); |
| r5613 | r5614 | |
| 1191 | 1191 | int layers_ctrl = ~dynax_layer_enable; |
| 1192 | 1192 | |
| 1193 | 1193 | if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; |
| 1194 | layers_ctrl &= debug_mask(); | |
| 1194 | layers_ctrl &= debug_mask(screen->machine); | |
| 1195 | 1195 | |
| 1196 | 1196 | bitmap_fill(bitmap, cliprect, |
| 1197 | 1197 | (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); |
| r5613 | r5614 | |
| 1210 | 1210 | const device_config *bottom_screen = devtag_get_device(screen->machine, "bottom"); |
| 1211 | 1211 | |
| 1212 | 1212 | if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; |
| 1213 | layers_ctrl &= debug_mask(); | |
| 1213 | layers_ctrl &= debug_mask(screen->machine); | |
| 1214 | 1214 | |
| 1215 | 1215 | bitmap_fill(bitmap, cliprect, |
| 1216 | 1216 | (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); |
| r5613 | r5614 | |
| 1239 | 1239 | int layers_ctrl = ~dynax_layer_enable; |
| 1240 | 1240 | |
| 1241 | 1241 | if (debug_viewer(screen->machine,bitmap,cliprect)) return 0; |
| 1242 | layers_ctrl &= debug_mask(); | |
| 1242 | layers_ctrl &= debug_mask(screen->machine); | |
| 1243 | 1243 | |
| 1244 | 1244 | bitmap_fill(bitmap, cliprect, |
| 1245 | 1245 | (dynax_blit_backpen & 0xff) + (dynax_blit_palbank & 1) * 256); |
| r5613 | r5614 | |
|---|---|---|
| 228 | 228 | int layers_ctrl = -1; |
| 229 | 229 | |
| 230 | 230 | #ifdef MAME_DEBUG |
| 231 | if (input_code_pressed(KEYCODE_Z)) | |
| 231 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 232 | 232 | { |
| 233 | 233 | int mask = 0; |
| 234 | if (input_code_pressed(KEYCODE_Q)) mask |= 1; | |
| 235 | if (input_code_pressed(KEYCODE_W)) mask |= 2; | |
| 236 | if (input_code_pressed(KEYCODE_E)) mask |= 4; | |
| 237 | if (input_code_pressed(KEYCODE_R)) mask |= 8; | |
| 238 | if (input_code_pressed(KEYCODE_A)) mask |= 16; | |
| 234 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; | |
| 235 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; | |
| 236 | if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4; | |
| 237 | if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8; | |
| 238 | if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 16; | |
| 239 | 239 | if (mask != 0) layers_ctrl &= mask; |
| 240 | 240 | } |
| 241 | 241 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 405 | 405 | * |
| 406 | 406 | *************************************/ |
| 407 | 407 | |
| 408 | static void logblit(const char *tag) | |
| 408 | static void logblit(running_machine *machine, const char *tag) | |
| 409 | 409 | { |
| 410 | if (!input_code_pressed(KEYCODE_L)) | |
| 410 | if (!input_code_pressed(machine, KEYCODE_L)) | |
| 411 | 411 | return; |
| 412 | 412 | if (is_drivedge && VIDEO_TRANSFER_FLAGS == 0x5490) |
| 413 | 413 | { |
| r5613 | r5614 | |
| 1203 | 1203 | /* command 1: blit raw data */ |
| 1204 | 1204 | case 1: |
| 1205 | 1205 | profiler_mark_start(PROFILER_USER1); |
| 1206 | if (BLIT_LOGGING) logblit("Blit Raw"); | |
| 1206 | if (BLIT_LOGGING) logblit(machine, "Blit Raw"); | |
| 1207 | 1207 | |
| 1208 | 1208 | if (is_drivedge) |
| 1209 | 1209 | { |
| r5613 | r5614 | |
| 1221 | 1221 | /* command 2: blit RLE-compressed data */ |
| 1222 | 1222 | case 2: |
| 1223 | 1223 | profiler_mark_start(PROFILER_USER2); |
| 1224 | if (BLIT_LOGGING) logblit("Blit RLE"); | |
| 1224 | if (BLIT_LOGGING) logblit(machine, "Blit RLE"); | |
| 1225 | 1225 | |
| 1226 | 1226 | if (enable_latch[0]) draw_rle(videoplane[0], color_latch[0]); |
| 1227 | 1227 | if (enable_latch[1]) draw_rle(videoplane[1], color_latch[1]); |
| r5613 | r5614 | |
| 1231 | 1231 | |
| 1232 | 1232 | /* command 3: set up raw data transfer */ |
| 1233 | 1233 | case 3: |
| 1234 | if (BLIT_LOGGING) logblit("Raw Xfer"); | |
| 1234 | if (BLIT_LOGGING) logblit(machine, "Raw Xfer"); | |
| 1235 | 1235 | xfer_xcount = VIDEO_TRANSFER_WIDTH; |
| 1236 | 1236 | xfer_ycount = ADJUSTED_HEIGHT(VIDEO_TRANSFER_HEIGHT); |
| 1237 | 1237 | xfer_xcur = VIDEO_TRANSFER_X & 0xfff; |
| r5613 | r5614 | |
| 1249 | 1249 | /* command 6: perform shift register copy */ |
| 1250 | 1250 | case 6: |
| 1251 | 1251 | profiler_mark_start(PROFILER_USER3); |
| 1252 | if (BLIT_LOGGING) logblit("ShiftReg"); | |
| 1252 | if (BLIT_LOGGING) logblit(machine, "ShiftReg"); | |
| 1253 | 1253 | |
| 1254 | 1254 | if (is_drivedge) |
| 1255 | 1255 | { |
| r5613 | r5614 | |
|---|---|---|
| 116 | 116 | if (vblank > 0) |
| 117 | 117 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 118 | 118 | else { |
| 119 | // if (input_code_pressed(KEYCODE_Q)) | |
| 119 | // if (input_code_pressed(screen->machine, KEYCODE_Q)) | |
| 120 | 120 | // scrollbak = ((fof_a00000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x0038) >> 3); |
| 121 | // else if (input_code_pressed(KEYCODE_W)) | |
| 121 | // else if (input_code_pressed(screen->machine, KEYCODE_W)) | |
| 122 | 122 | // scrollbak = ((fof_a00000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x01c0) >> 6); |
| 123 | // else if (input_code_pressed(KEYCODE_E)) | |
| 123 | // else if (input_code_pressed(screen->machine, KEYCODE_E)) | |
| 124 | 124 | // scrollbak = ((fof_a00000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x01c0) >> 6); |
| 125 | // else if (input_code_pressed(KEYCODE_R)) | |
| 125 | // else if (input_code_pressed(screen->machine, KEYCODE_R)) | |
| 126 | 126 | // scrollbak = ((fof_a00000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x0038) >> 3); |
| 127 | 127 | // else |
| 128 | 128 | scrollbak = ((fof_a00000[0]&0xff00) >> 5); |
| r5613 | r5614 | |
| 132 | 132 | |
| 133 | 133 | draw_sprites(screen->machine,bitmap,cliprect,0); |
| 134 | 134 | |
| 135 | // if (input_code_pressed(KEYCODE_A)) | |
| 135 | // if (input_code_pressed(screen->machine, KEYCODE_A)) | |
| 136 | 136 | // scrollmid = ((fof_900000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x01c0) >> 6); |
| 137 | // else if (input_code_pressed(KEYCODE_S)) | |
| 137 | // else if (input_code_pressed(screen->machine, KEYCODE_S)) | |
| 138 | 138 | // scrollmid = ((fof_900000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x0038) >> 3); |
| 139 | // else if (input_code_pressed(KEYCODE_D)) | |
| 139 | // else if (input_code_pressed(screen->machine, KEYCODE_D)) | |
| 140 | 140 | // scrollmid = ((fof_900000[0]&0xff00) >> 5) - ((fof_700000[0] & 0x0038) >> 3); |
| 141 | // else if (input_code_pressed(KEYCODE_F)) | |
| 141 | // else if (input_code_pressed(screen->machine, KEYCODE_F)) | |
| 142 | 142 | // scrollmid = ((fof_900000[0]&0xff00) >> 5) + ((fof_700000[0] & 0x01c0) >> 6); |
| 143 | 143 | // else |
| 144 | 144 | scrollmid = ((fof_900000[0]&0xff00) >> 5); |
| 145 | 145 | tilemap_set_scrollx(fof_mid_tilemap,0, scrollmid ); |
| 146 | 146 | tilemap_set_scrolly(fof_mid_tilemap,0, fof_900000[0]&0xff); |
| 147 | // if (!input_code_pressed(KEYCODE_F)) | |
| 147 | // if (!input_code_pressed(screen->machine, KEYCODE_F)) | |
| 148 | 148 | tilemap_draw(bitmap,cliprect,fof_mid_tilemap,0,0); |
| 149 | 149 | |
| 150 | 150 | draw_sprites(screen->machine,bitmap,cliprect,1); |
| r5613 | r5614 | |
|---|---|---|
| 370 | 370 | #endif |
| 371 | 371 | |
| 372 | 372 | #ifdef MAME_DEBUG |
| 373 | if (input_code_pressed_once (KEYCODE_X)) | |
| 373 | if (input_code_pressed_once (screen->machine, KEYCODE_X)) | |
| 374 | 374 | { |
| 375 | 375 | dislayer[5] ^= 1; |
| 376 | 376 | popmessage("piv text: %01x",dislayer[5]); |
| 377 | 377 | } |
| 378 | if (input_code_pressed_once (KEYCODE_C)) | |
| 378 | if (input_code_pressed_once (screen->machine, KEYCODE_C)) | |
| 379 | 379 | { |
| 380 | 380 | dislayer[0] ^= 1; |
| 381 | 381 | popmessage("bg0: %01x",dislayer[0]); |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | if (input_code_pressed_once (KEYCODE_V)) | |
| 384 | if (input_code_pressed_once (screen->machine, KEYCODE_V)) | |
| 385 | 385 | { |
| 386 | 386 | dislayer[1] ^= 1; |
| 387 | 387 | popmessage("bg1: %01x",dislayer[1]); |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | if (input_code_pressed_once (KEYCODE_B)) | |
| 390 | if (input_code_pressed_once (screen->machine, KEYCODE_B)) | |
| 391 | 391 | { |
| 392 | 392 | dislayer[2] ^= 1; |
| 393 | 393 | popmessage("bg2: %01x",dislayer[2]); |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | if (input_code_pressed_once (KEYCODE_N)) | |
| 396 | if (input_code_pressed_once (screen->machine, KEYCODE_N)) | |
| 397 | 397 | { |
| 398 | 398 | dislayer[3] ^= 1; |
| 399 | 399 | popmessage("bg3: %01x",dislayer[3]); |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | if (input_code_pressed_once (KEYCODE_M)) | |
| 402 | if (input_code_pressed_once (screen->machine, KEYCODE_M)) | |
| 403 | 403 | { |
| 404 | 404 | dislayer[4] ^= 1; |
| 405 | 405 | popmessage("sprites: %01x",dislayer[4]); |
| r5613 | r5614 | |
| 514 | 514 | #endif |
| 515 | 515 | |
| 516 | 516 | #ifdef MAME_DEBUG |
| 517 | if (input_code_pressed_once (KEYCODE_X)) | |
| 517 | if (input_code_pressed_once (screen->machine, KEYCODE_X)) | |
| 518 | 518 | { |
| 519 | 519 | dislayer[5] ^= 1; |
| 520 | 520 | popmessage("piv text: %01x",dislayer[5]); |
| 521 | 521 | } |
| 522 | if (input_code_pressed_once (KEYCODE_C)) | |
| 522 | if (input_code_pressed_once (screen->machine, KEYCODE_C)) | |
| 523 | 523 | { |
| 524 | 524 | dislayer[0] ^= 1; |
| 525 | 525 | popmessage("bg0: %01x",dislayer[0]); |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | if (input_code_pressed_once (KEYCODE_V)) | |
| 528 | if (input_code_pressed_once (screen->machine, KEYCODE_V)) | |
| 529 | 529 | { |
| 530 | 530 | dislayer[1] ^= 1; |
| 531 | 531 | popmessage("bg1: %01x",dislayer[1]); |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | if (input_code_pressed_once (KEYCODE_B)) | |
| 534 | if (input_code_pressed_once (screen->machine, KEYCODE_B)) | |
| 535 | 535 | { |
| 536 | 536 | dislayer[2] ^= 1; |
| 537 | 537 | popmessage("bg2: %01x",dislayer[2]); |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | if (input_code_pressed_once (KEYCODE_N)) | |
| 540 | if (input_code_pressed_once (screen->machine, KEYCODE_N)) | |
| 541 | 541 | { |
| 542 | 542 | dislayer[3] ^= 1; |
| 543 | 543 | popmessage("bg3: %01x",dislayer[3]); |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | if (input_code_pressed_once (KEYCODE_M)) | |
| 546 | if (input_code_pressed_once (screen->machine, KEYCODE_M)) | |
| 547 | 547 | { |
| 548 | 548 | dislayer[4] ^= 1; |
| 549 | 549 | popmessage("sprites: %01x",dislayer[4]); |
| r5613 | r5614 | |
|---|---|---|
| 962 | 962 | #if GUESS_COPPER_OFFSET |
| 963 | 963 | if (video_screen_get_frame_number(machine->primary_screen) % 64 == 0 && scanline == 0) |
| 964 | 964 | { |
| 965 | if (input_code_pressed(KEYCODE_Q)) | |
| 965 | if (input_code_pressed(machine, KEYCODE_Q)) | |
| 966 | 966 | popmessage("%d", wait_offset -= 1); |
| 967 | if (input_code_pressed(KEYCODE_W)) | |
| 967 | if (input_code_pressed(machine, KEYCODE_W)) | |
| 968 | 968 | popmessage("%d", wait_offset += 1); |
| 969 | 969 | } |
| 970 | 970 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 89 | 89 | static void zeus_register_update(running_machine *machine, offs_t offset); |
| 90 | 90 | static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords); |
| 91 | 91 | static void zeus_draw_model(running_machine *machine, UINT32 texdata, int logit); |
| 92 | static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texdata, int logit); | |
| 92 | static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texdata, int logit); | |
| 93 | 93 | |
| 94 | 94 | static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); |
| 95 | 95 | static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); |
| r5613 | r5614 | |
| 314 | 314 | poly_wait(poly, "VIDEO_UPDATE"); |
| 315 | 315 | |
| 316 | 316 | /* normal update case */ |
| 317 | if (!input_code_pressed(KEYCODE_W)) | |
| 317 | if (!input_code_pressed(screen->machine, KEYCODE_W)) | |
| 318 | 318 | { |
| 319 | 319 | const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0xcc]); |
| 320 | 320 | int xoffs = video_screen_get_visible_area(screen)->min_x; |
| r5613 | r5614 | |
| 333 | 333 | static int width = 256; |
| 334 | 334 | const void *base; |
| 335 | 335 | |
| 336 | if (input_code_pressed(KEYCODE_DOWN)) yoffs += input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 337 | if (input_code_pressed(KEYCODE_UP)) yoffs -= input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 338 | if (input_code_pressed(KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(KEYCODE_LEFT)) ; } | |
| 339 | if (input_code_pressed(KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(KEYCODE_RIGHT)) ; } | |
| 336 | if (input_code_pressed(screen->machine, KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 337 | if (input_code_pressed(screen->machine, KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 338 | if (input_code_pressed(screen->machine, KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(screen->machine, KEYCODE_LEFT)) ; } | |
| 339 | if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(screen->machine, KEYCODE_RIGHT)) ; } | |
| 340 | 340 | |
| 341 | 341 | if (yoffs < 0) yoffs = 0; |
| 342 | 342 | base = waveram0_ptr_from_block_addr(yoffs << 12); |
| r5613 | r5614 | |
| 738 | 738 | |
| 739 | 739 | case 0xcc: |
| 740 | 740 | video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen)); |
| 741 | log_fifo = input_code_pressed(KEYCODE_L); | |
| 741 | log_fifo = input_code_pressed(machine, KEYCODE_L); | |
| 742 | 742 | break; |
| 743 | 743 | |
| 744 | 744 | case 0xe0: |
| r5613 | r5614 | |
| 1032 | 1032 | |
| 1033 | 1033 | case 0x25: /* mk4 */ |
| 1034 | 1034 | case 0x30: /* invasn */ |
| 1035 | zeus_draw_quad(databuffer, texdata, logit); | |
| 1035 | zeus_draw_quad(machine, databuffer, texdata, logit); | |
| 1036 | 1036 | break; |
| 1037 | 1037 | |
| 1038 | 1038 | default: |
| r5613 | r5614 | |
| 1056 | 1056 | * |
| 1057 | 1057 | *************************************/ |
| 1058 | 1058 | |
| 1059 | static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texdata, int logit) | |
| 1059 | static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texdata, int logit) | |
| 1060 | 1060 | { |
| 1061 | 1061 | poly_draw_scanline_func callback; |
| 1062 | 1062 | poly_extra_data *extra; |
| r5613 | r5614 | |
| 1098 | 1098 | { |
| 1099 | 1099 | if (logit) |
| 1100 | 1100 | logerror("quad (culled %08X)\n", rotnormal[2]); |
| 1101 | // if (input_code_pressed(KEYCODE_COMMA)) | |
| 1101 | // if (input_code_pressed(machine, KEYCODE_COMMA)) | |
| 1102 | 1102 | // return; |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| r5613 | r5614 | |
| 1111 | 1111 | val2 = (texdata >> 16) & 0x3ff; |
| 1112 | 1112 | texwshift = (val2 >> 6) & 7; |
| 1113 | 1113 | |
| 1114 | //if (input_code_pressed(KEYCODE_Z) && (val2 & 0x01)) return; | |
| 1115 | //if (input_code_pressed(KEYCODE_X) && (val2 & 0x02)) return; | |
| 1116 | //if (input_code_pressed(KEYCODE_C) && (val2 & 0x04)) return; | |
| 1117 | //if (input_code_pressed(KEYCODE_V) && (val2 & 0x08)) return; | |
| 1118 | //if (input_code_pressed(KEYCODE_B) && (val2 & 0x10)) return; | |
| 1119 | //if (input_code_pressed(KEYCODE_N) && (val2 & 0x20)) return; | |
| 1120 | //if (input_code_pressed(KEYCODE_M) && (val2 & 0x200)) return; | |
| 1114 | //if (input_code_pressed(machine, KEYCODE_Z) && (val2 & 0x01)) return; | |
| 1115 | //if (input_code_pressed(machine, KEYCODE_X) && (val2 & 0x02)) return; | |
| 1116 | //if (input_code_pressed(machine, KEYCODE_C) && (val2 & 0x04)) return; | |
| 1117 | //if (input_code_pressed(machine, KEYCODE_V) && (val2 & 0x08)) return; | |
| 1118 | //if (input_code_pressed(machine, KEYCODE_B) && (val2 & 0x10)) return; | |
| 1119 | //if (input_code_pressed(machine, KEYCODE_N) && (val2 & 0x20)) return; | |
| 1120 | //if (input_code_pressed(machine, KEYCODE_M) && (val2 & 0x200)) return; | |
| 1121 | 1121 | |
| 1122 | 1122 | uscale = (8 >> ((zeusbase[0x04] >> 4) & 3)) * 0.125f * 256.0f; |
| 1123 | 1123 | vscale = (8 >> ((zeusbase[0x04] >> 6) & 3)) * 0.125f * 256.0f; |
| r5613 | r5614 | |
|---|---|---|
| 1152 | 1152 | } |
| 1153 | 1153 | |
| 1154 | 1154 | |
| 1155 | #ifdef MAME_DEBUG | |
| 1156 | static void butasan_log_vram(void) | |
| 1155 | static void butasan_log_vram(running_machine *machine) | |
| 1157 | 1156 | { |
| 1157 | #ifdef MAME_DEBUG | |
| 1158 | 1158 | int offs; |
| 1159 | 1159 | |
| 1160 | if (input_code_pressed(KEYCODE_M)) | |
| 1160 | if (input_code_pressed(machine, KEYCODE_M)) | |
| 1161 | 1161 | { |
| 1162 | 1162 | int i; |
| 1163 | 1163 | logerror("\nSprite RAM\n"); |
| r5613 | r5614 | |
| 1201 | 1201 | } |
| 1202 | 1202 | } |
| 1203 | 1203 | } |
| 1204 | } | |
| 1205 | 1204 | #endif |
| 1205 | } | |
| 1206 | 1206 | |
| 1207 | 1207 | VIDEO_UPDATE( argus ) |
| 1208 | 1208 | { |
| r5613 | r5614 | |
| 1245 | 1245 | butasan_draw_sprites(screen->machine, bitmap, cliprect); |
| 1246 | 1246 | tilemap_draw(bitmap, cliprect, tx_tilemap, 0, 0); |
| 1247 | 1247 | |
| 1248 | #ifdef MAME_DEBUG | |
| 1249 | butasan_log_vram(); | |
| 1250 | #endif | |
| 1248 | butasan_log_vram(screen->machine); | |
| 1251 | 1249 | return 0; |
| 1252 | 1250 | } |
| r5613 | r5614 | |
|---|---|---|
| 86 | 86 | tilemap_set_transparent_pen(text_layer, 0); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | VIDEO_START( mastninj ) | |
| 90 | { | |
| 91 | /* set up tile layers */ | |
| 92 | background = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 32); | |
| 93 | foreground = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 64, 32); | |
| 94 | text_layer = tilemap_create(machine, get_tx_tile_info, tilemap_scan_rows, 8, 8, 32, 32); | |
| 95 | ||
| 96 | // tilemap_set_transparent_pen(background, 15); | |
| 97 | tilemap_set_transparent_pen(foreground, 15); | |
| 98 | tilemap_set_transparent_pen(text_layer, 15); | |
| 99 | ||
| 100 | tilemap_set_scrolldx(background, -248, 248); | |
| 101 | tilemap_set_scrolldx(foreground, -252, 252); | |
| 102 | } | |
| 103 | ||
| 89 | 104 | VIDEO_START( raiga ) |
| 90 | 105 | { |
| 91 | 106 | int width = video_screen_get_width(machine->primary_screen); |
| r5613 | r5614 | |
|---|---|---|
| 1161 | 1161 | #if GUESS_COPPER_OFFSET |
| 1162 | 1162 | if (video_screen_get_frame_number(machine->primary_screen) % 64 == 0 && scanline == 0) |
| 1163 | 1163 | { |
| 1164 | if (input_code_pressed(KEYCODE_Q)) | |
| 1164 | if (input_code_pressed(machine, KEYCODE_Q)) | |
| 1165 | 1165 | popmessage("%d", wait_offset -= 1); |
| 1166 | if (input_code_pressed(KEYCODE_W)) | |
| 1166 | if (input_code_pressed(machine, KEYCODE_W)) | |
| 1167 | 1167 | popmessage("%d", wait_offset += 1); |
| 1168 | 1168 | } |
| 1169 | 1169 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 996 | 996 | if( tick >= 5 ) { |
| 997 | 997 | tick = 0; |
| 998 | 998 | |
| 999 | if( input_code_pressed(KEYCODE_O) ) | |
| 999 | if( input_code_pressed(screen->machine, KEYCODE_O) ) | |
| 1000 | 1000 | debug_tex_page++; |
| 1001 | 1001 | |
| 1002 | if( input_code_pressed(KEYCODE_I) ) | |
| 1002 | if( input_code_pressed(screen->machine, KEYCODE_I) ) | |
| 1003 | 1003 | debug_tex_page--; |
| 1004 | 1004 | |
| 1005 | if (input_code_pressed(KEYCODE_U)) | |
| 1005 | if (input_code_pressed(screen->machine, KEYCODE_U)) | |
| 1006 | 1006 | debug_tex_palette++; |
| 1007 | if (input_code_pressed(KEYCODE_Y)) | |
| 1007 | if (input_code_pressed(screen->machine, KEYCODE_Y)) | |
| 1008 | 1008 | debug_tex_palette--; |
| 1009 | 1009 | |
| 1010 | 1010 | if (debug_tex_page < 0) |
| r5613 | r5614 | |
|---|---|---|
| 420 | 420 | |
| 421 | 421 | static void DebugCheckKeys( running_machine *machine ) |
| 422 | 422 | { |
| 423 | if( input_code_pressed_once( KEYCODE_M ) ) | |
| 423 | if( input_code_pressed_once( machine, KEYCODE_M ) ) | |
| 424 | 424 | m_debug.b_mesh = !m_debug.b_mesh; |
| 425 | 425 | |
| 426 | if( input_code_pressed_once( KEYCODE_V ) ) | |
| 426 | if( input_code_pressed_once( machine, KEYCODE_V ) ) | |
| 427 | 427 | m_debug.b_texture = !m_debug.b_texture; |
| 428 | 428 | |
| 429 | 429 | if( m_debug.b_mesh || m_debug.b_texture ) |
| r5613 | r5614 | |
| 435 | 435 | else |
| 436 | 436 | video_screen_set_visarea(machine->primary_screen, 0, m_n_screenwidth - 1, 0, m_n_screenheight - 1 ); |
| 437 | 437 | |
| 438 | if( input_code_pressed_once( KEYCODE_I ) ) | |
| 438 | if( input_code_pressed_once( machine, KEYCODE_I ) ) | |
| 439 | 439 | { |
| 440 | 440 | if( m_debug.b_texture ) |
| 441 | 441 | { |
| r5613 | r5614 | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | #if 0 |
| 466 | if( input_code_pressed_once( KEYCODE_D ) ) | |
| 466 | if( input_code_pressed_once( machine, KEYCODE_D ) ) | |
| 467 | 467 | { |
| 468 | 468 | FILE *f; |
| 469 | 469 | int n_x; |
| r5613 | r5614 | |
| 473 | 473 | fprintf( f, "%04u,%04u = %04x\n", n_y, n_x, m_p_p_vram[ n_y ][ n_x ] ); |
| 474 | 474 | fclose( f ); |
| 475 | 475 | } |
| 476 | if( input_code_pressed_once( KEYCODE_S ) ) | |
| 476 | if( input_code_pressed_once( machine, KEYCODE_S ) ) | |
| 477 | 477 | { |
| 478 | 478 | FILE *f; |
| 479 | 479 | popmessage( "saving..." ); |
| r5613 | r5614 | |
| 482 | 482 | fwrite( m_p_p_vram[ n_y ], 1024 * 2, 1, f ); |
| 483 | 483 | fclose( f ); |
| 484 | 484 | } |
| 485 | if( input_code_pressed_once( KEYCODE_L ) ) | |
| 485 | if( input_code_pressed_once( machine, KEYCODE_L ) ) | |
| 486 | 486 | { |
| 487 | 487 | FILE *f; |
| 488 | 488 | popmessage( "loading..." ); |
| r5613 | r5614 | |
|---|---|---|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | #if 0 |
| 349 | if (input_code_pressed(KEYCODE_A) && (pri & 8)) color = rand(); | |
| 350 | if (input_code_pressed(KEYCODE_S) && (pri & 4)) color = rand(); | |
| 351 | if (input_code_pressed(KEYCODE_D) && (pri & 2)) color = rand(); | |
| 352 | if (input_code_pressed(KEYCODE_F) && (pri & 1)) color = rand(); | |
| 349 | if (input_code_pressed(machine, KEYCODE_A) && (pri & 8)) color = rand(); | |
| 350 | if (input_code_pressed(machine, KEYCODE_S) && (pri & 4)) color = rand(); | |
| 351 | if (input_code_pressed(machine, KEYCODE_D) && (pri & 2)) color = rand(); | |
| 352 | if (input_code_pressed(machine, KEYCODE_F) && (pri & 1)) color = rand(); | |
| 353 | 353 | #endif |
| 354 | 354 | |
| 355 | 355 | /* TODO: priority handling is completely wrong, but better than nothing */ |
| r5613 | r5614 | |
|---|---|---|
| 1332 | 1332 | static void tgp_scan(void) |
| 1333 | 1333 | { |
| 1334 | 1334 | #if 0 |
| 1335 | if (input_code_pressed_once(KEYCODE_F)) | |
| 1335 | if (input_code_pressed_once(machine, KEYCODE_F)) | |
| 1336 | 1336 | { |
| 1337 | 1337 | FILE *fp; |
| 1338 | 1338 | fp=fopen("tgp-ram.bin", "w+b"); |
| r5613 | r5614 | |
| 1465 | 1465 | double delta; |
| 1466 | 1466 | delta = 1; |
| 1467 | 1467 | |
| 1468 | if(input_code_pressed(KEYCODE_F)) { | |
| 1468 | if(input_code_pressed(screen->machine, KEYCODE_F)) { | |
| 1469 | 1469 | mod = 1; |
| 1470 | 1470 | vxx -= delta; |
| 1471 | 1471 | } |
| 1472 | if(input_code_pressed(KEYCODE_G)) { | |
| 1472 | if(input_code_pressed(screen->machine, KEYCODE_G)) { | |
| 1473 | 1473 | mod = 1; |
| 1474 | 1474 | vxx += delta; |
| 1475 | 1475 | } |
| 1476 | if(input_code_pressed(KEYCODE_H)) { | |
| 1476 | if(input_code_pressed(screen->machine, KEYCODE_H)) { | |
| 1477 | 1477 | mod = 1; |
| 1478 | 1478 | vyy -= delta; |
| 1479 | 1479 | } |
| 1480 | if(input_code_pressed(KEYCODE_J)) { | |
| 1480 | if(input_code_pressed(screen->machine, KEYCODE_J)) { | |
| 1481 | 1481 | mod = 1; |
| 1482 | 1482 | vyy += delta; |
| 1483 | 1483 | } |
| 1484 | if(input_code_pressed(KEYCODE_K)) { | |
| 1484 | if(input_code_pressed(screen->machine, KEYCODE_K)) { | |
| 1485 | 1485 | mod = 1; |
| 1486 | 1486 | vzz -= delta; |
| 1487 | 1487 | } |
| 1488 | if(input_code_pressed(KEYCODE_L)) { | |
| 1488 | if(input_code_pressed(screen->machine, KEYCODE_L)) { | |
| 1489 | 1489 | mod = 1; |
| 1490 | 1490 | vzz += delta; |
| 1491 | 1491 | } |
| 1492 | if(input_code_pressed(KEYCODE_U)) { | |
| 1492 | if(input_code_pressed(screen->machine, KEYCODE_U)) { | |
| 1493 | 1493 | mod = 1; |
| 1494 | 1494 | ayy -= 0.05; |
| 1495 | 1495 | } |
| 1496 | if(input_code_pressed(KEYCODE_I)) { | |
| 1496 | if(input_code_pressed(screen->machine, KEYCODE_I)) { | |
| 1497 | 1497 | mod = 1; |
| 1498 | 1498 | ayy += 0.05; |
| 1499 | 1499 | } |
| r5613 | r5614 | |
|---|---|---|
| 3996 | 3996 | int priority_switch_line = (road_ctrl & 0x00ff) - y_offs; |
| 3997 | 3997 | |
| 3998 | 3998 | #ifdef MAME_DEBUG |
| 3999 | if (input_code_pressed_once (KEYCODE_X)) | |
| 3999 | if (input_code_pressed_once (machine, KEYCODE_X)) | |
| 4000 | 4000 | { |
| 4001 | 4001 | dislayer[0] ^= 1; |
| 4002 | 4002 | popmessage("RoadA body: %01x",dislayer[0]); |
| 4003 | 4003 | } |
| 4004 | 4004 | |
| 4005 | if (input_code_pressed_once (KEYCODE_C)) | |
| 4005 | if (input_code_pressed_once (machine, KEYCODE_C)) | |
| 4006 | 4006 | { |
| 4007 | 4007 | dislayer[1] ^= 1; |
| 4008 | 4008 | popmessage("RoadA l-edge: %01x",dislayer[1]); |
| 4009 | 4009 | } |
| 4010 | 4010 | |
| 4011 | if (input_code_pressed_once (KEYCODE_V)) | |
| 4011 | if (input_code_pressed_once (machine, KEYCODE_V)) | |
| 4012 | 4012 | { |
| 4013 | 4013 | dislayer[2] ^= 1; |
| 4014 | 4014 | popmessage("RoadA r-edge: %01x",dislayer[2]); |
| 4015 | 4015 | } |
| 4016 | 4016 | |
| 4017 | if (input_code_pressed_once (KEYCODE_B)) | |
| 4017 | if (input_code_pressed_once (machine, KEYCODE_B)) | |
| 4018 | 4018 | { |
| 4019 | 4019 | dislayer[3] ^= 1; |
| 4020 | 4020 | popmessage("RoadB body: %01x",dislayer[3]); |
| 4021 | 4021 | } |
| 4022 | 4022 | |
| 4023 | if (input_code_pressed_once (KEYCODE_N)) | |
| 4023 | if (input_code_pressed_once (machine, KEYCODE_N)) | |
| 4024 | 4024 | { |
| 4025 | 4025 | dislayer[4] ^= 1; |
| 4026 | 4026 | popmessage("RoadB l-edge: %01x",dislayer[4]); |
| 4027 | 4027 | } |
| 4028 | if (input_code_pressed_once (KEYCODE_M)) | |
| 4028 | if (input_code_pressed_once (machine, KEYCODE_M)) | |
| 4029 | 4029 | { |
| 4030 | 4030 | dislayer[5] ^= 1; |
| 4031 | 4031 | popmessage("RoadB r-edge: %01x",dislayer[5]); |
| r5613 | r5614 | |
|---|---|---|
| 98 | 98 | static TILE_GET_INFO( get_tile_info ) |
| 99 | 99 | { |
| 100 | 100 | UINT8 code, attr; |
| 101 | if (input_code_pressed(KEYCODE_X)) | |
| 101 | if (input_code_pressed(screen->machine, KEYCODE_X)) | |
| 102 | 102 | { UINT8 *rom = memory_region(machine, REGION_CPU1) + 0x10000 + 0x4000*rombank; |
| 103 | 103 | code = rom[ 2 * tile_index + 0 ]; |
| 104 | 104 | attr = rom[ 2 * tile_index + 1 ]; } |
| r5613 | r5614 | |
| 412 | 412 | |
| 413 | 413 | #ifdef MAME_DEBUG |
| 414 | 414 | #if TILEMAPS |
| 415 | if (input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X)) | |
| 415 | if (input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X)) | |
| 416 | 416 | { |
| 417 | 417 | int max_tiles = memory_region_length(machine, "gfx1") / (0x400 * 0x20); |
| 418 | 418 | |
| 419 | if (input_code_pressed_once(KEYCODE_Q)) { page--; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 420 | if (input_code_pressed_once(KEYCODE_W)) { page++; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 421 | if (input_code_pressed_once(KEYCODE_E)) { tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 422 | if (input_code_pressed_once(KEYCODE_R)) { tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 423 | if (input_code_pressed_once(KEYCODE_A)) { rombank--; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 424 | if (input_code_pressed_once(KEYCODE_S)) { rombank++; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 419 | if (input_code_pressed_once(screen->machine, KEYCODE_Q)) { page--; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 420 | if (input_code_pressed_once(screen->machine, KEYCODE_W)) { page++; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 421 | if (input_code_pressed_once(screen->machine, KEYCODE_E)) { tiles--; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 422 | if (input_code_pressed_once(screen->machine, KEYCODE_R)) { tiles++; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 423 | if (input_code_pressed_once(screen->machine, KEYCODE_A)) { rombank--; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 424 | if (input_code_pressed_once(screen->machine, KEYCODE_S)) { rombank++; tilemap_mark_all_tiles_dirty_all(screen->machine); } | |
| 425 | 425 | |
| 426 | 426 | rombank &= 0xf; |
| 427 | 427 | page &= (suna8_text_dim > 0)?3:7; |
| r5613 | r5614 | |
|---|---|---|
| 2469 | 2469 | int yoffs = 16-cps2_port(CPS2_OBJ_YOFFS); |
| 2470 | 2470 | |
| 2471 | 2471 | #ifdef MAME_DEBUG |
| 2472 | if (input_code_pressed(KEYCODE_Z) && input_code_pressed(KEYCODE_R)) | |
| 2472 | if (input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_R)) | |
| 2473 | 2473 | { |
| 2474 | 2474 | return; |
| 2475 | 2475 | } |
| r5613 | r5614 | |
| 2795 | 2795 | cps2_port(CPS2_OBJ_UK1), |
| 2796 | 2796 | cps2_port(CPS2_OBJ_UK2)); |
| 2797 | 2797 | |
| 2798 | if (0 && input_code_pressed(KEYCODE_Z)) | |
| 2798 | if (0 && input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 2799 | 2799 | popmessage("order: %d (%d) %d (%d) %d (%d) %d (%d)",l0,l0pri,l1,l1pri,l2,l2pri,l3,l3pri); |
| 2800 | 2800 | #endif |
| 2801 | 2801 |
| r5613 | r5614 | |
|---|---|---|
| 456 | 456 | { |
| 457 | 457 | int x, y, ret; |
| 458 | 458 | |
| 459 | if (DISPLAY_TEXTURE && (input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X))) | |
| 459 | if (DISPLAY_TEXTURE && (input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X))) | |
| 460 | 460 | { |
| 461 | 461 | static int xv = 0, yv = 0x1000; |
| 462 | 462 | UINT8 *base = gaelco3d_texture; |
| 463 | 463 | int length = gaelco3d_texture_size; |
| 464 | 464 | |
| 465 | if (input_code_pressed(KEYCODE_X)) | |
| 465 | if (input_code_pressed(screen->machine, KEYCODE_X)) | |
| 466 | 466 | { |
| 467 | 467 | base = gaelco3d_texmask; |
| 468 | 468 | length = gaelco3d_texmask_size; |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | if (input_code_pressed(KEYCODE_LEFT) && xv >= 4) | |
| 471 | if (input_code_pressed(screen->machine, KEYCODE_LEFT) && xv >= 4) | |
| 472 | 472 | xv -= 4; |
| 473 | if (input_code_pressed(KEYCODE_RIGHT) && xv < 4096 - 4) | |
| 473 | if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && xv < 4096 - 4) | |
| 474 | 474 | xv += 4; |
| 475 | 475 | |
| 476 | if (input_code_pressed(KEYCODE_UP) && yv >= 4) | |
| 476 | if (input_code_pressed(screen->machine, KEYCODE_UP) && yv >= 4) | |
| 477 | 477 | yv -= 4; |
| 478 | if (input_code_pressed(KEYCODE_DOWN) && yv < 0x40000) | |
| 478 | if (input_code_pressed(screen->machine, KEYCODE_DOWN) && yv < 0x40000) | |
| 479 | 479 | yv += 4; |
| 480 | 480 | |
| 481 | 481 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| r5613 | r5614 | |
|---|---|---|
| 688 | 688 | flip_screen_set(screen->machine, screenctrl & 1); |
| 689 | 689 | |
| 690 | 690 | #if 0 |
| 691 | if (input_code_pressed(KEYCODE_Z)) | |
| 691 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 692 | 692 | { int msk = 0; |
| 693 | if (input_code_pressed(KEYCODE_Q)) msk |= 0x01; | |
| 694 | if (input_code_pressed(KEYCODE_W)) msk |= 0x02; | |
| 695 | if (input_code_pressed(KEYCODE_E)) msk |= 0x04; | |
| 696 | if (input_code_pressed(KEYCODE_A)) msk |= 0x08; | |
| 693 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 0x01; | |
| 694 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 0x02; | |
| 695 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 0x04; | |
| 696 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 0x08; | |
| 697 | 697 | if (msk != 0) |
| 698 | 698 | { bitmap_fill(bitmap,cliprect,0); |
| 699 | 699 | layers_ctrl &= msk; } |
| r5613 | r5614 | |
|---|---|---|
| 1031 | 1031 | return; |
| 1032 | 1032 | |
| 1033 | 1033 | #if DEBUG |
| 1034 | if (input_code_pressed(KEYCODE_Q)) | |
| 1034 | if (input_code_pressed(machine, KEYCODE_Q)) | |
| 1035 | 1035 | { |
| 1036 | 1036 | UINT32 i; |
| 1037 | 1037 |
| r5613 | r5614 | |
|---|---|---|
| 263 | 263 | int y; |
| 264 | 264 | |
| 265 | 265 | #ifdef MAME_DEBUG |
| 266 | if (input_code_pressed(KEYCODE_Z)) | |
| 266 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 267 | 267 | { |
| 268 | 268 | int msk = 0; |
| 269 | 269 | |
| 270 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 271 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 272 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 273 | if (input_code_pressed(KEYCODE_R)) msk |= 8; | |
| 274 | if (input_code_pressed(KEYCODE_A)) msk |= 16; | |
| 270 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 271 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 272 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 273 | if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= 8; | |
| 274 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 16; | |
| 275 | 275 | if (msk != 0) layers_ctrl &= msk; |
| 276 | 276 | } |
| 277 | 277 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 157 | 157 | { |
| 158 | 158 | flipscreen = data; |
| 159 | 159 | |
| 160 | tilemap_set_flip( | |
| 160 | tilemap_set_flip(bg_tilemap, flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 |
| r5613 | r5614 | |
|---|---|---|
| 738 | 738 | |
| 739 | 739 | |
| 740 | 740 | |
| 741 | #ifdef MAME_DEBUG | |
| 742 | static void toaplan1_log_vram(void) | |
| 741 | static void toaplan1_log_vram(running_machine *machine) | |
| 743 | 742 | { |
| 744 | if ( input_code_pressed(KEYCODE_M) ) | |
| 743 | #ifdef MAME_DEBUG | |
| 744 | if ( input_code_pressed(machine, KEYCODE_M) ) | |
| 745 | 745 | { |
| 746 | 746 | offs_t sprite_voffs; |
| 747 | while (input_code_pressed(KEYCODE_M)) ; | |
| 747 | while (input_code_pressed(machine, KEYCODE_M)) ; | |
| 748 | 748 | if (toaplan1_spritesizeram16) /* FCU controller */ |
| 749 | 749 | { |
| 750 | 750 | int schar,sattr,sxpos,sypos,bschar,bsattr,bsxpos,bsypos; |
| r5613 | r5614 | |
| 789 | 789 | } |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | if ( input_code_pressed(KEYCODE_SLASH) ) | |
| 792 | if ( input_code_pressed(machine, KEYCODE_SLASH) ) | |
| 793 | 793 | { |
| 794 | 794 | UINT16 *size = (UINT16 *)(toaplan1_spritesizeram16); |
| 795 | 795 | UINT16 *bsize = (UINT16 *)(toaplan1_buffered_spritesizeram16); |
| 796 | 796 | offs_t offs; |
| 797 | while (input_code_pressed(KEYCODE_SLASH)) ; | |
| 797 | while (input_code_pressed(machine, KEYCODE_SLASH)) ; | |
| 798 | 798 | if (toaplan1_spritesizeram16) /* FCU controller */ |
| 799 | 799 | { |
| 800 | 800 | logerror("Scrolls PF1-X PF1-Y PF2-X PF2-Y PF3-X PF3-Y PF4-X PF4-Y\n"); |
| r5613 | r5614 | |
| 810 | 810 | } |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | if ( input_code_pressed(KEYCODE_N) ) | |
| 813 | if ( input_code_pressed(machine, KEYCODE_N) ) | |
| 814 | 814 | { |
| 815 | 815 | offs_t tile_voffs; |
| 816 | 816 | int tchar[5], tattr[5]; |
| 817 | while (input_code_pressed(KEYCODE_N)) ; /* BCU controller */ | |
| 817 | while (input_code_pressed(machine, KEYCODE_N)) ; /* BCU controller */ | |
| 818 | 818 | logerror("Scrolls PF1-X PF1-Y PF2-X PF2-Y PF3-X PF3-Y PF4-X PF4-Y\n"); |
| 819 | 819 | logerror("------> #%04x #%04x #%04x #%04x #%04x #%04x #%04x #%04x\n",pf1_scrollx,pf1_scrolly,pf2_scrollx,pf2_scrolly,pf3_scrollx,pf3_scrolly,pf4_scrollx,pf4_scrolly); |
| 820 | 820 | for ( tile_voffs = 0; tile_voffs < (TOAPLAN1_TILEVRAM_SIZE/2); tile_voffs += 2 ) |
| r5613 | r5614 | |
| 834 | 834 | } |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | if ( input_code_pressed(KEYCODE_W) ) | |
| 837 | if ( input_code_pressed(machine, KEYCODE_W) ) | |
| 838 | 838 | { |
| 839 | while (input_code_pressed(KEYCODE_W)) ; | |
| 839 | while (input_code_pressed(machine, KEYCODE_W)) ; | |
| 840 | 840 | logerror("Mark here\n"); |
| 841 | 841 | } |
| 842 | if ( input_code_pressed(KEYCODE_E) ) | |
| 842 | if ( input_code_pressed(machine, KEYCODE_E) ) | |
| 843 | 843 | { |
| 844 | while (input_code_pressed(KEYCODE_E)) ; | |
| 844 | while (input_code_pressed(machine, KEYCODE_E)) ; | |
| 845 | 845 | displog += 1; |
| 846 | 846 | displog &= 1; |
| 847 | 847 | } |
| r5613 | r5614 | |
| 850 | 850 | logerror("Scrolls PF1-X PF1-Y PF2-X PF2-Y PF3-X PF3-Y PF4-X PF4-Y\n"); |
| 851 | 851 | logerror("------> #%04x #%04x #%04x #%04x #%04x #%04x #%04x #%04x\n",pf1_scrollx,pf1_scrolly,pf2_scrollx,pf2_scrolly,pf3_scrollx,pf3_scrolly,pf4_scrollx,pf4_scrolly); |
| 852 | 852 | } |
| 853 | if ( input_code_pressed(KEYCODE_B) ) | |
| 853 | if ( input_code_pressed(machine, KEYCODE_B) ) | |
| 854 | 854 | { |
| 855 | // while (input_code_pressed(KEYCODE_B)) ; | |
| 855 | // while (input_code_pressed(machine, KEYCODE_B)) ; | |
| 856 | 856 | scrollx_offs1 += 0x1; scrollx_offs2 += 0x1; scrollx_offs3 += 0x1; scrollx_offs4 += 0x1; |
| 857 | 857 | logerror("Scrollx_offs now = %08x\n",scrollx_offs4); |
| 858 | 858 | tilemap_set_scrollx(pf1_tilemap,0,(pf1_scrollx >> 7) - (tiles_offsetx - scrollx_offs1)); |
| r5613 | r5614 | |
| 860 | 860 | tilemap_set_scrollx(pf3_tilemap,0,(pf3_scrollx >> 7) - (tiles_offsetx - scrollx_offs3)); |
| 861 | 861 | tilemap_set_scrollx(pf4_tilemap,0,(pf4_scrollx >> 7) - (tiles_offsetx - scrollx_offs4)); |
| 862 | 862 | } |
| 863 | if ( input_code_pressed(KEYCODE_V) ) | |
| 863 | if ( input_code_pressed(machine, KEYCODE_V) ) | |
| 864 | 864 | { |
| 865 | // while (input_code_pressed(KEYCODE_V)) ; | |
| 865 | // while (input_code_pressed(machine, KEYCODE_V)) ; | |
| 866 | 866 | scrollx_offs1 -= 0x1; scrollx_offs2 -= 0x1; scrollx_offs3 -= 0x1; scrollx_offs4 -= 0x1; |
| 867 | 867 | logerror("Scrollx_offs now = %08x\n",scrollx_offs4); |
| 868 | 868 | tilemap_set_scrollx(pf1_tilemap,0,(pf1_scrollx >> 7) - (tiles_offsetx - scrollx_offs1)); |
| r5613 | r5614 | |
| 870 | 870 | tilemap_set_scrollx(pf3_tilemap,0,(pf3_scrollx >> 7) - (tiles_offsetx - scrollx_offs3)); |
| 871 | 871 | tilemap_set_scrollx(pf4_tilemap,0,(pf4_scrollx >> 7) - (tiles_offsetx - scrollx_offs4)); |
| 872 | 872 | } |
| 873 | if ( input_code_pressed(KEYCODE_C) ) | |
| 873 | if ( input_code_pressed(machine, KEYCODE_C) ) | |
| 874 | 874 | { |
| 875 | // while (input_code_pressed(KEYCODE_C)) ; | |
| 875 | // while (input_code_pressed(machine, KEYCODE_C)) ; | |
| 876 | 876 | scrolly_offs += 0x1; |
| 877 | 877 | logerror("Scrolly_offs now = %08x\n",scrolly_offs); |
| 878 | 878 | tilemap_set_scrolly(pf1_tilemap,0,(pf1_scrolly >> 7) - (tiles_offsety - scrolly_offs)); |
| r5613 | r5614 | |
| 880 | 880 | tilemap_set_scrolly(pf3_tilemap,0,(pf3_scrolly >> 7) - (tiles_offsety - scrolly_offs)); |
| 881 | 881 | tilemap_set_scrolly(pf4_tilemap,0,(pf4_scrolly >> 7) - (tiles_offsety - scrolly_offs)); |
| 882 | 882 | } |
| 883 | if ( input_code_pressed(KEYCODE_X) ) | |
| 883 | if ( input_code_pressed(machine, KEYCODE_X) ) | |
| 884 | 884 | { |
| 885 | // while (input_code_pressed(KEYCODE_X)) ; | |
| 885 | // while (input_code_pressed(machine, KEYCODE_X)) ; | |
| 886 | 886 | scrolly_offs -= 0x1; |
| 887 | 887 | logerror("Scrolly_offs now = %08x\n",scrolly_offs); |
| 888 | 888 | tilemap_set_scrolly(pf1_tilemap,0,(pf1_scrolly >> 7) - (tiles_offsety - scrolly_offs)); |
| r5613 | r5614 | |
| 891 | 891 | tilemap_set_scrolly(pf4_tilemap,0,(pf4_scrolly >> 7) - (tiles_offsety - scrolly_offs)); |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | if ( input_code_pressed(KEYCODE_L) ) /* Turn Playfield 4 on/off */ | |
| 894 | if ( input_code_pressed(machine, KEYCODE_L) ) /* Turn Playfield 4 on/off */ | |
| 895 | 895 | { |
| 896 | while (input_code_pressed(KEYCODE_L)) ; | |
| 896 | while (input_code_pressed(machine, KEYCODE_L)) ; | |
| 897 | 897 | display_pf4 += 1; |
| 898 | 898 | display_pf4 &= 1; |
| 899 | 899 | tilemap_set_enable(pf4_tilemap, display_pf4); |
| 900 | 900 | } |
| 901 | if ( input_code_pressed(KEYCODE_K) ) /* Turn Playfield 3 on/off */ | |
| 901 | if ( input_code_pressed(machine, KEYCODE_K) ) /* Turn Playfield 3 on/off */ | |
| 902 | 902 | { |
| 903 | while (input_code_pressed(KEYCODE_K)) ; | |
| 903 | while (input_code_pressed(machine, KEYCODE_K)) ; | |
| 904 | 904 | display_pf3 += 1; |
| 905 | 905 | display_pf3 &= 1; |
| 906 | 906 | tilemap_set_enable(pf3_tilemap, display_pf3); |
| 907 | 907 | } |
| 908 | if ( input_code_pressed(KEYCODE_J) ) /* Turn Playfield 2 on/off */ | |
| 908 | if ( input_code_pressed(machine, KEYCODE_J) ) /* Turn Playfield 2 on/off */ | |
| 909 | 909 | { |
| 910 | while (input_code_pressed(KEYCODE_J)) ; | |
| 910 | while (input_code_pressed(machine, KEYCODE_J)) ; | |
| 911 | 911 | display_pf2 += 1; |
| 912 | 912 | display_pf2 &= 1; |
| 913 | 913 | tilemap_set_enable(pf2_tilemap, display_pf2); |
| 914 | 914 | } |
| 915 | if ( input_code_pressed(KEYCODE_H) ) /* Turn Playfield 1 on/off */ | |
| 915 | if ( input_code_pressed(machine, KEYCODE_H) ) /* Turn Playfield 1 on/off */ | |
| 916 | 916 | { |
| 917 | while (input_code_pressed(KEYCODE_H)) ; | |
| 917 | while (input_code_pressed(machine, KEYCODE_H)) ; | |
| 918 | 918 | display_pf1 += 1; |
| 919 | 919 | display_pf1 &= 1; |
| 920 | 920 | tilemap_set_enable(pf1_tilemap, display_pf1); |
| 921 | 921 | } |
| 922 | } | |
| 923 | 922 | #endif |
| 923 | } | |
| 924 | 924 | |
| 925 | 925 | |
| 926 | 926 | |
| r5613 | r5614 | |
| 1134 | 1134 | { |
| 1135 | 1135 | int priority; |
| 1136 | 1136 | |
| 1137 | #ifdef MAME_DEBUG | |
| 1138 | toaplan1_log_vram(); | |
| 1139 | #endif | |
| 1137 | toaplan1_log_vram(screen->machine); | |
| 1140 | 1138 | |
| 1141 | 1139 | bitmap_fill(bitmap,cliprect,0); |
| 1142 | 1140 | |
| r5613 | r5614 | |
| 1158 | 1156 | { |
| 1159 | 1157 | int priority; |
| 1160 | 1158 | |
| 1161 | #ifdef MAME_DEBUG | |
| 1162 | toaplan1_log_vram(); | |
| 1163 | #endif | |
| 1159 | toaplan1_log_vram(screen->machine); | |
| 1164 | 1160 | |
| 1165 | 1161 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); |
| 1166 | 1162 | bitmap_fill(bitmap,cliprect,0x120); |
| r5613 | r5614 | |
| 1185 | 1181 | { |
| 1186 | 1182 | int priority; |
| 1187 | 1183 | |
| 1188 | #ifdef MAME_DEBUG | |
| 1189 | toaplan1_log_vram(); | |
| 1190 | #endif | |
| 1184 | toaplan1_log_vram(screen->machine); | |
| 1191 | 1185 | |
| 1192 | 1186 | bitmap_fill(screen->machine->priority_bitmap,cliprect,0); |
| 1193 | 1187 | bitmap_fill(bitmap,cliprect,0x120); |
| r5613 | r5614 | |
|---|---|---|
| 173 | 173 | static void blswhstl_sprite_callback(int *code,int *color,int *priority_mask) |
| 174 | 174 | { |
| 175 | 175 | #if 0 |
| 176 | if (input_code_pressed(KEYCODE_Q) && (*color & 0x20)) *color = rand(); | |
| 177 | if (input_code_pressed(KEYCODE_W) && (*color & 0x40)) *color = rand(); | |
| 178 | if (input_code_pressed(KEYCODE_E) && (*color & 0x80)) *color = rand(); | |
| 176 | if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x20)) *color = rand(); | |
| 177 | if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand(); | |
| 178 | if (input_code_pressed(machine, KEYCODE_E) && (*color & 0x80)) *color = rand(); | |
| 179 | 179 | #endif |
| 180 | 180 | int pri = 0x20 | ((*color & 0x60) >> 2); |
| 181 | 181 | if (pri <= layerpri[2]) *priority_mask = 0; |
| r5613 | r5614 | |
|---|---|---|
| 34 | 34 | static int dilatechose[64]; |
| 35 | 35 | static float wbuffer[480][640]; |
| 36 | 36 | static UINT32 debug_dip_status; |
| 37 | static void pvr_accumulationbuffer_to_framebuffer(const address_space *space, int x,int y); | |
| 37 | 38 | |
| 38 | 39 | UINT64 *dc_framebuffer_ram; // '32-bit access area' |
| 39 | 40 | UINT64 *dc_texture_ram; // '64-bit access area' |
| r5613 | r5614 | |
| 46 | 47 | static emu_timer *endofrender_timer_video; |
| 47 | 48 | |
| 48 | 49 | static int scanline; |
| 49 | static bitmap_t *fakeframebuffer_bitmap; | |
| 50 | static void testdrawscreen(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect); | |
| 51 | 50 | |
| 51 | // the real accumulation buffer is a 32x32x8bpp buffer into which tiles get rendered before they get copied to the framebuffer | |
| 52 | // our implementation is not currently tile based, and thus the accumulation buffer is screen sized | |
| 53 | static bitmap_t *fake_accumulationbuffer_bitmap; | |
| 54 | static void render_to_accumulation_buffer(running_machine *machine,bitmap_t *bitmap,const rectangle *cliprect); | |
| 55 | ||
| 52 | 56 | typedef struct texinfo { |
| 53 | 57 | UINT32 address, vqbase; |
| 54 | 58 | int textured, sizex, sizey, sizes, pf, palette, mode, mipmapped, blend_mode, filter_mode, flip_u, flip_v; |
| r5613 | r5614 | |
| 1003 | 1007 | int reg; |
| 1004 | 1008 | UINT64 shift; |
| 1005 | 1009 | UINT32 old,dat; |
| 1006 | #if DEBUG_PVRTA | |
| 1007 | UINT32 sizera,offsetra,v; | |
| 1008 | #endif | |
| 1010 | UINT32 sizera,offsetra; | |
| 1009 | 1011 | int a; |
| 1012 | int sanitycount; | |
| 1010 | 1013 | |
| 1011 | 1014 | reg = decode_reg_64(offset, mem_mask, &shift); |
| 1012 | 1015 | dat = (UINT32)(data >> shift); |
| r5613 | r5614 | |
| 1050 | 1053 | mame_printf_verbose("Start Render Received:\n"); |
| 1051 | 1054 | mame_printf_verbose(" Region Array at %08x\n",pvrta_regs[REGION_BASE]); |
| 1052 | 1055 | mame_printf_verbose(" ISP/TSP Parameters at %08x\n",pvrta_regs[PARAM_BASE]); |
| 1053 | if (pvrta_regs[FPU_PARAM_CFG] & 0x200000) | |
| 1054 | sizera=6; | |
| 1055 | else | |
| 1056 | sizera=5; | |
| 1057 | offsetra=pvrta_regs[REGION_BASE]; | |
| 1058 | for (;;) | |
| 1059 | { | |
| 1060 | v=memory_read_dword(space,0x05000000+offsetra); | |
| 1061 | mame_printf_verbose("Tile X:%d Y:%d\n ", (v >> 2) & 0x3f, (v >> 8) & 0x3f); | |
| 1062 | offsetra = offsetra+4; | |
| 1063 | v=memory_read_dword(space,0x05000000+offsetra); | |
| 1064 | if (!(v & 0x80000000)) | |
| 1065 | mame_printf_verbose("OLP %d ",v & 0xFFFFFC); | |
| 1066 | offsetra = offsetra+4; | |
| 1067 | v=memory_read_dword(space,0x05000000+offsetra); | |
| 1068 | if (!(v & 0x80000000)) | |
| 1069 | mame_printf_verbose("OMVLP %d ",v & 0xFFFFFC); | |
| 1070 | offsetra = offsetra+4; | |
| 1071 | v=memory_read_dword(space,0x05000000+offsetra); | |
| 1072 | if (!(v & 0x80000000)) | |
| 1073 | mame_printf_verbose("TLP %d ",v & 0xFFFFFC); | |
| 1074 | offsetra = offsetra+4; | |
| 1075 | v=memory_read_dword(space,0x05000000+offsetra); | |
| 1076 | if (!(v & 0x80000000)) | |
| 1077 | mame_printf_verbose("TMVLP %d ",v & 0xFFFFFC); | |
| 1078 | if (sizera == 6) | |
| 1079 | { | |
| 1080 | offsetra = offsetra+4; | |
| 1081 | v=memory_read_dword(space,0x05000000+offsetra); | |
| 1082 | if (!(v & 0x80000000)) | |
| 1083 | mame_printf_verbose("PTLP %d ",v & 0xFFFFFC); | |
| 1084 | } | |
| 1085 | mame_printf_verbose("\n"); | |
| 1086 | if (v & 0x80000000) | |
| 1087 | break; | |
| 1088 | } | |
| 1056 | ||
| 1089 | 1057 | #endif |
| 1090 | 1058 | // select buffer to draw using PARAM_BASE |
| 1091 | 1059 | for (a=0;a < NUM_BUFFERS;a++) |
| r5613 | r5614 | |
| 1107 | 1075 | clip.min_y = 0; |
| 1108 | 1076 | clip.max_y = 1023; |
| 1109 | 1077 | |
| 1110 | // we've got a request to draw, so, draw to the fake fraembuffer! | |
| 1111 | testdrawscreen(space->machine,fakeframebuffer_bitmap,&clip); | |
| 1078 | // we've got a request to draw, so, draw to the accumulation buffer! | |
| 1079 | // this should really be done for each tile! | |
| 1080 | render_to_accumulation_buffer(space->machine,fake_accumulationbuffer_bitmap,&clip); | |
| 1112 | 1081 | |
| 1113 | 1082 | timer_adjust_oneshot(endofrender_timer_isp, ATTOTIME_IN_USEC(4000) , 0); // hack, make sure render takes some amount of time |
| 1114 | 1083 | |
| 1084 | /* copy the tiles to the framebuffer (really the rendering should be in this loop too) */ | |
| 1085 | if (pvrta_regs[FPU_PARAM_CFG] & 0x200000) | |
| 1086 | sizera=6; | |
| 1087 | else | |
| 1088 | sizera=5; | |
| 1089 | offsetra=pvrta_regs[REGION_BASE]; | |
| 1090 | ||
| 1091 | //printf("base is %08x\n", offsetra); | |
| 1092 | ||
| 1093 | // sanity | |
| 1094 | sanitycount = 0; | |
| 1095 | for (;;) | |
| 1096 | { | |
| 1097 | UINT32 st[6]; | |
| 1098 | ||
| 1099 | st[0]=memory_read_dword(space,(0x05000000+offsetra)); | |
| 1100 | st[1]=memory_read_dword(space,(0x05000004+offsetra)); // Opaque List Pointer | |
| 1101 | st[2]=memory_read_dword(space,(0x05000008+offsetra)); // Opaque Modifier Volume List Pointer | |
| 1102 | st[3]=memory_read_dword(space,(0x0500000c+offsetra)); // Translucent List Pointer | |
| 1103 | st[4]=memory_read_dword(space,(0x05000010+offsetra)); // Translucent Modifier Volume List Pointer | |
| 1104 | ||
| 1105 | if (sizera == 6) | |
| 1106 | { | |
| 1107 | st[5] = memory_read_dword(space,(0x05000014+offsetra)); // Punch Through List Pointer | |
| 1108 | offsetra+=0x18; | |
| 1109 | } | |
| 1110 | else | |
| 1111 | { | |
| 1112 | st[5] = 0; | |
| 1113 | offsetra+=0x14; | |
| 1114 | } | |
| 1115 | ||
| 1116 | { | |
| 1117 | int x = ((st[0]&0x000000fc)>>2)*32; | |
| 1118 | int y = ((st[0]&0x00003f00)>>8)*32; | |
| 1119 | //printf("tiledata %08x %d %d - %08x %08x %08x %08x %08x\n",st[0],x,y,st[1],st[2],st[3],st[4],st[5]); | |
| 1120 | ||
| 1121 | // should render to the accumulation buffer here using pointers we filled in when processing the data | |
| 1122 | // sent to the TA. HOWEVER, we don't process the TA data and create the real format object lists, so | |
| 1123 | // instead just use these co-ordinates to copy data from our fake full-screnen accumnulation buffer into | |
| 1124 | // the framebuffer | |
| 1125 | ||
| 1126 | pvr_accumulationbuffer_to_framebuffer(space, x,y); | |
| 1127 | } | |
| 1128 | ||
| 1129 | if (st[0] & 0x80000000) | |
| 1130 | break; | |
| 1131 | ||
| 1132 | // prevent infinite loop if asked to process invalid data | |
| 1133 | if(sanitycount>2000) | |
| 1134 | break; | |
| 1135 | } | |
| 1136 | ||
| 1137 | ||
| 1138 | ||
| 1139 | ||
| 1115 | 1140 | break; |
| 1116 | 1141 | } |
| 1117 | 1142 | } |
| r5613 | r5614 | |
| 1854 | 1879 | render_tri_sorted(bitmap, ti, v+i0, v+i1, v+i2); |
| 1855 | 1880 | } |
| 1856 | 1881 | |
| 1857 | static void | |
| 1882 | static void ren | |
| 1858 | 1883 | { |
| 1859 | 1884 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 1860 | 1885 | int cs,rs,ns; |
| r5613 | r5614 | |
| 1875 | 1900 | c=pvrta_regs[ISP_BACKGND_T]; |
| 1876 | 1901 | c=memory_read_dword(space,0x05000000+((c&0xfffff8)>>1)+(3+3)*4); |
| 1877 | 1902 | bitmap_fill(bitmap,cliprect,c); |
| 1878 | #if 0 | |
| 1879 | stride=pvrta_regs[FB_W_LINESTRIDE] << 3; | |
| 1880 | c=pvrta_regs[ISP_BACKGND_T]; | |
| 1881 | a=(c & 0xfffff8) >> 1; | |
| 1882 | cs=(c >> 24) & 7; | |
| 1883 | cs=cs+3; // cs*2+3 | |
| 1884 | c=memory_read_dword(space,0x05000000+a+3*4+(cs-1)*4); | |
| 1885 | dx=(int)u2f(memory_read_dword(space,0x05000000+a+3*4+cs*4+0)); | |
| 1886 | dy=(int)u2f(memory_read_dword(space,0x05000000+a+3*4+2*cs*4+4)); | |
| 1887 | for (y=0;y < dy;y++) | |
| 1888 | { | |
| 1889 | addrp=state_ta.grab[rs].fbwsof1+y*stride; | |
| 1890 | for (x=0;x < dx;x++) | |
| 1891 | { | |
| 1892 | bmpaddr16=((UINT16 *)dc_texture_ram) + (WORD2_XOR_LE(addrp) >> 1); | |
| 1893 | *bmpaddr16=((c & 0xf80000) >> 8) | ((c & 0xfc00) >> 5) | ((c & 0xf8) >> 3); | |
| 1894 | addrp+=2; | |
| 1895 | } | |
| 1896 | } | |
| 1897 | #endif | |
| 1898 | 1903 | |
| 1904 | ||
| 1899 | 1905 | ns=state_ta.grab[rs].strips_size; |
| 1900 | 1906 | if(ns) |
| 1901 | 1907 | memset(wbuffer, 0x00, sizeof(wbuffer)); |
| r5613 | r5614 | |
| 1922 | 1928 | state_ta.grab[rs].busy=0; |
| 1923 | 1929 | } |
| 1924 | 1930 | |
| 1925 | #if 0 | |
| 1926 | static void testdrawscreenframebuffer(bitmap_t *bitmap,const rectangle *cliprect) | |
| 1931 | // copies the accumulation buffer into the framebuffer, converting to the specified format | |
| 1932 | // not accurate, ignores field stuff and just uses SOF1 for now | |
| 1933 | // also ignores scale effects (can scale accumulation buffer to half size with filtering etc.) | |
| 1934 | // also can specify dither etc. | |
| 1935 | // basically, just a crude implementation! | |
| 1936 | ||
| 1937 | /* | |
| 1938 | ||
| 1939 | 0x0 0555 KRGB 16 bit (default) Bit 15 is the value of fb_kval 7. | |
| 1940 | 0x1 565 RGB 16 bit | |
| 1941 | 0x2 4444 ARGB 16 bit | |
| 1942 | 0x3 1555 ARGB 16 bit The alpha value is determined by comparison with the value of fb_alpha_threshold. | |
| 1943 | 0x4 888 RGB 24 bit packed | |
| 1944 | 0x5 0888 KRGB 32 bit K is the value of fk_kval. | |
| 1945 | 0x6 8888 ARGB 32 bit | |
| 1946 | 0x7 Setting prohibited. | |
| 1947 | ||
| 1948 | */ | |
| 1949 | ||
| 1950 | static void pvr_accumulationbuffer_to_framebuffer(const address_space *space, int x,int y) | |
| 1927 | 1951 | { |
| 1952 | // the accumulation buffer is always 8888 | |
| 1953 | // | |
| 1954 | // the standard format for the framebuffer appears to be 565 | |
| 1955 | // yes, this means colour data is lost in the conversion | |
| 1956 | ||
| 1957 | UINT32 wc = pvrta_regs[FB_W_CTRL]; | |
| 1958 | UINT32 stride = pvrta_regs[FB_W_LINESTRIDE]; | |
| 1959 | UINT32 writeoffs = pvrta_regs[FB_W_SOF1]; | |
| 1960 | ||
| 1961 | UINT32* src; | |
| 1962 | ||
| 1963 | ||
| 1964 | UINT8 packmode = wc & 0x7; | |
| 1965 | ||
| 1966 | switch (packmode) | |
| 1967 | { | |
| 1968 | case 0x01: //565 RGB 16 bit | |
| 1969 | { | |
| 1970 | int xcnt,ycnt; | |
| 1971 | for (ycnt=0;ycnt<32;ycnt++) | |
| 1972 | { | |
| 1973 | UINT32 realwriteoffs = 0x05000000 + writeoffs + (y+ycnt) * (stride<<3) + (x*2); | |
| 1974 | src = BITMAP_ADDR32(fake_accumulationbuffer_bitmap, y+ycnt, x); | |
| 1975 | ||
| 1976 | ||
| 1977 | for (xcnt=0;xcnt<32;xcnt++) | |
| 1978 | { | |
| 1979 | // data is 8888 format | |
| 1980 | UINT32 data = src[xcnt]; | |
| 1981 | UINT16 newdat = ((((data & 0x000000f8) >> 3)) << 0) | | |
| 1982 | ((((data & 0x0000fc00) >> 10)) << 5) | | |
| 1983 | ((((data & 0x00f80000) >> 19)) << 11); | |
| 1984 | ||
| 1985 | memory_write_word(space,realwriteoffs+xcnt*2, newdat); | |
| 1986 | } | |
| 1987 | } | |
| 1988 | } | |
| 1989 | break; | |
| 1990 | ||
| 1991 | ||
| 1992 | case 0x00: | |
| 1993 | ||
| 1994 | case 0x02: | |
| 1995 | case 0x03: | |
| 1996 | case 0x04: | |
| 1997 | case 0x05: | |
| 1998 | case 0x06: | |
| 1999 | case 0x07: | |
| 2000 | default: | |
| 2001 | ||
| 2002 | printf("pvr_accumulationbuffer_to_framebuffer buffer to tile at %d,%d - unsupported pack mode %02x\n",x,y,packmode); | |
| 2003 | } | |
| 2004 | ||
| 2005 | ||
| 2006 | } | |
| 2007 | ||
| 2008 | ||
| 2009 | static void pvr_drawframebuffer(bitmap_t *bitmap,const rectangle *cliprect) | |
| 2010 | { | |
| 1928 | 2011 | int x,y,dy,xi; |
| 1929 | 2012 | UINT32 addrp; |
| 1930 | 2013 | UINT32 *fbaddr; |
| r5613 | r5614 | |
| 1934 | 2017 | // only for rgb565 framebuffer |
| 1935 | 2018 | xi=((pvrta_regs[FB_R_SIZE] & 0x3ff)+1) << 1; |
| 1936 | 2019 | dy=((pvrta_regs[FB_R_SIZE] >> 10) & 0x3ff)+1; |
| 2020 | ||
| 2021 | dy*=2; // probably depends on interlace mode, fields etc... | |
| 2022 | ||
| 2023 | ||
| 1937 | 2024 | for (y=0;y < dy;y++) |
| 1938 | 2025 | { |
| 1939 | 2026 | addrp=pvrta_regs[FB_R_SOF1]+y*xi*2; |
| 1940 | 2027 | for (x=0;x < xi;x++) |
| 1941 | 2028 | { |
| 1942 | 2029 | fbaddr=BITMAP_ADDR32(bitmap,y,x); |
| 1943 | c=*(((UINT16 *)dc_texture_ram) + (WORD2_XOR_LE(addrp) >> 1)); | |
| 2030 | c=*(((UINT16 *)dc_framebuffer_ram) + (WORD2_XOR_LE(addrp) >> 1)); | |
| 2031 | ||
| 1944 | 2032 | b = (c & 0x001f) << 3; |
| 1945 | 2033 | g = (c & 0x07e0) >> 3; |
| 1946 | 2034 | r = (c & 0xf800) >> 8; |
| 1947 | *fbaddr = b | (g<<8) | (r<<16); | |
| 2035 | ||
| 2036 | if (y<cliprect->max_y) | |
| 2037 | *fbaddr = b | (g<<8) | (r<<16); | |
| 1948 | 2038 | addrp+=2; |
| 1949 | 2039 | } |
| 1950 | 2040 | } |
| 1951 | 2041 | } |
| 1952 | #endif | |
| 1953 | 2042 | |
| 2043 | ||
| 1954 | 2044 | #if DEBUG_PALRAM |
| 1955 | 2045 | static void debug_paletteram(running_machine *machine) |
| 1956 | 2046 | { |
| r5613 | r5614 | |
| 2130 | 2220 | timer_adjust_oneshot(endofrender_timer_tsp, attotime_never, 0); |
| 2131 | 2221 | timer_adjust_oneshot(endofrender_timer_video, attotime_never, 0); |
| 2132 | 2222 | |
| 2133 | fake | |
| 2223 | fake_ | |
| 2134 | 2224 | |
| 2135 | 2225 | } |
| 2136 | 2226 | |
| r5613 | r5614 | |
| 2150 | 2240 | ******************/ |
| 2151 | 2241 | |
| 2152 | 2242 | // static int useframebuffer=1; |
| 2153 | const rectangle *visarea = video_screen_get_visible_area(screen); | |
| 2154 | int y,x; | |
| 2243 | // const rectangle *visarea = video_screen_get_visible_area(screen); | |
| 2244 | // int y,x; | |
| 2155 | 2245 | //printf("videoupdate\n"); |
| 2156 | 2246 | |
| 2157 | 2247 | #if DEBUG_PALRAM |
| r5613 | r5614 | |
| 2159 | 2249 | #endif |
| 2160 | 2250 | |
| 2161 | 2251 | // copy our fake framebuffer bitmap (where things have been rendered) to the screen |
| 2252 | #if 0 | |
| 2162 | 2253 | for (y = visarea->min_y ; y <= visarea->max_y ; y++) |
| 2163 | 2254 | { |
| 2164 | 2255 | for (x = visarea->min_x ; x <= visarea->max_x ; x++) |
| 2165 | 2256 | { |
| 2166 | UINT32* src = BITMAP_ADDR32(fake | |
| 2257 | UINT32* src = BITMAP_ADDR32(fake_ | |
| 2167 | 2258 | UINT32* dst = BITMAP_ADDR32(bitmap, y, x); |
| 2168 | 2259 | dst[0] = src[0]; |
| 2169 | 2260 | } |
| 2170 | 2261 | } |
| 2262 | #endif | |
| 2171 | 2263 | |
| 2264 | pvr_drawframebuffer(bitmap,cliprect); | |
| 2265 | ||
| 2172 | 2266 | // update this here so we only do string lookup once per frame |
| 2173 | 2267 | debug_dip_status = input_port_read(screen->machine, "MAMEDEBUG"); |
| 2174 | 2268 |
| r5613 | r5614 | |
|---|---|---|
| 214 | 214 | if( tick >= 5 ) { |
| 215 | 215 | tick = 0; |
| 216 | 216 | |
| 217 | if( input_code_pressed(KEYCODE_O) ) | |
| 217 | if( input_code_pressed(screen->machine, KEYCODE_O) ) | |
| 218 | 218 | debug_tex_pal++; |
| 219 | 219 | |
| 220 | if( input_code_pressed(KEYCODE_I) ) | |
| 220 | if( input_code_pressed(screen->machine, KEYCODE_I) ) | |
| 221 | 221 | debug_tex_pal--; |
| 222 | 222 | |
| 223 | 223 | debug_tex_pal &= 0x7f; |
| r5613 | r5614 | |
|---|---|---|
| 216 | 216 | rectangle myclip=*cliprect; |
| 217 | 217 | |
| 218 | 218 | #ifdef MAME_DEBUG |
| 219 | if (input_code_pressed_once(KEYCODE_Q)) | |
| 219 | if (input_code_pressed_once(screen->machine, KEYCODE_Q)) | |
| 220 | 220 | { |
| 221 | 221 | UINT8 *ROM = memory_region(screen->machine, "maincpu"); |
| 222 | 222 | ROM[0x84f6]=0; /* lap 0 - normal */ |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | if (input_code_pressed_once(KEYCODE_W)) | |
| 225 | if (input_code_pressed_once(screen->machine, KEYCODE_W)) | |
| 226 | 226 | { |
| 227 | 227 | UINT8 *ROM = memory_region(screen->machine, "maincpu"); |
| 228 | 228 | ROM[0x84f6]=6; /* lap 6 = spotlight */ |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | if (input_code_pressed_once(KEYCODE_E)) | |
| 231 | if (input_code_pressed_once(screen->machine, KEYCODE_E)) | |
| 232 | 232 | { |
| 233 | 233 | UINT8 *ROM = memory_region(screen->machine, "maincpu"); |
| 234 | 234 | ROM[0x84f6]=2; /* lap 3 (trial 2)= lightnings */ |
| r5613 | r5614 | |
|---|---|---|
| 107 | 107 | static void zeus_pointer_write(UINT8 which, UINT32 value); |
| 108 | 108 | static int zeus_fifo_process(running_machine *machine, const UINT32 *data, int numwords); |
| 109 | 109 | static void zeus_draw_model(running_machine *machine, UINT32 baseaddr, UINT16 count, int logit); |
| 110 | static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit); | |
| 110 | static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texoffs, int logit); | |
| 111 | 111 | static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid); |
| 112 | 112 | |
| 113 | 113 | static void log_fifo_command(const UINT32 *data, int numwords, const char *suffix); |
| r5613 | r5614 | |
| 361 | 361 | |
| 362 | 362 | poly_wait(poly, "VIDEO_UPDATE"); |
| 363 | 363 | |
| 364 | if (input_code_pressed(KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); } | |
| 365 | if (input_code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); } | |
| 364 | if (input_code_pressed(screen->machine, KEYCODE_UP)) { zbase += 1.0f; popmessage("Zbase = %f", zbase); } | |
| 365 | if (input_code_pressed(screen->machine, KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f", zbase); } | |
| 366 | 366 | |
| 367 | 367 | /* normal update case */ |
| 368 | if (!input_code_pressed(KEYCODE_W)) | |
| 368 | if (!input_code_pressed(screen->machine, KEYCODE_W)) | |
| 369 | 369 | { |
| 370 | 370 | const void *base = waveram1_ptr_from_expanded_addr(zeusbase[0x38]); |
| 371 | 371 | int xoffs = video_screen_get_visible_area(screen)->min_x; |
| r5613 | r5614 | |
| 384 | 384 | static int width = 256; |
| 385 | 385 | const UINT64 *base; |
| 386 | 386 | |
| 387 | if (input_code_pressed(KEYCODE_DOWN)) yoffs += input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 388 | if (input_code_pressed(KEYCODE_UP)) yoffs -= input_code_pressed(KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 389 | if (input_code_pressed(KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(KEYCODE_LEFT)) ; } | |
| 390 | if (input_code_pressed(KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(KEYCODE_RIGHT)) ; } | |
| 387 | if (input_code_pressed(screen->machine, KEYCODE_DOWN)) yoffs += input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 388 | if (input_code_pressed(screen->machine, KEYCODE_UP)) yoffs -= input_code_pressed(screen->machine, KEYCODE_LSHIFT) ? 0x40 : 1; | |
| 389 | if (input_code_pressed(screen->machine, KEYCODE_LEFT) && width > 4) { width >>= 1; while (input_code_pressed(screen->machine, KEYCODE_LEFT)) ; } | |
| 390 | if (input_code_pressed(screen->machine, KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(screen->machine, KEYCODE_RIGHT)) ; } | |
| 391 | 391 | |
| 392 | 392 | if (yoffs < 0) yoffs = 0; |
| 393 | 393 | base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16); |
| r5613 | r5614 | |
| 584 | 584 | UINT32 temp = zeusbase[0x38]; |
| 585 | 585 | zeusbase[0x38] = oldval; |
| 586 | 586 | video_screen_update_partial(machine->primary_screen, video_screen_get_vpos(machine->primary_screen)); |
| 587 | log_fifo = input_code_pressed(KEYCODE_L); | |
| 587 | log_fifo = input_code_pressed(machine, KEYCODE_L); | |
| 588 | 588 | zeusbase[0x38] = temp; |
| 589 | 589 | } |
| 590 | 590 | break; |
| r5613 | r5614 | |
| 1010 | 1010 | break; |
| 1011 | 1011 | |
| 1012 | 1012 | case 0x38: /* crusnexo/thegrid */ |
| 1013 | zeus_draw_quad(databuffer, texoffs, logit); | |
| 1013 | zeus_draw_quad(machine, databuffer, texoffs, logit); | |
| 1014 | 1014 | break; |
| 1015 | 1015 | |
| 1016 | 1016 | default: |
| r5613 | r5614 | |
| 1039 | 1039 | * |
| 1040 | 1040 | *************************************/ |
| 1041 | 1041 | |
| 1042 | static void zeus_draw_quad(const UINT32 *databuffer, UINT32 texoffs, int logit) | |
| 1042 | static void zeus_draw_quad(running_machine *machine, const UINT32 *databuffer, UINT32 texoffs, int logit) | |
| 1043 | 1043 | { |
| 1044 | 1044 | poly_draw_scanline_func callback; |
| 1045 | 1045 | poly_extra_data *extra; |
| r5613 | r5614 | |
| 1057 | 1057 | if (logit) |
| 1058 | 1058 | logerror("quad\n"); |
| 1059 | 1059 | |
| 1060 | if (input_code_pressed(KEYCODE_Q) && (texoffs & 0xffff) == 0x119) return; | |
| 1061 | if (input_code_pressed(KEYCODE_E) && (texoffs & 0xffff) == 0x01d) return; | |
| 1062 | if (input_code_pressed(KEYCODE_R) && (texoffs & 0xffff) == 0x11d) return; | |
| 1063 | if (input_code_pressed(KEYCODE_T) && (texoffs & 0xffff) == 0x05d) return; | |
| 1064 | if (input_code_pressed(KEYCODE_Y) && (texoffs & 0xffff) == 0x0dd) return; | |
| 1065 | //if (input_code_pressed(KEYCODE_U) && (texoffs & 0xffff) == 0x119) return; | |
| 1066 | //if (input_code_pressed(KEYCODE_I) && (texoffs & 0xffff) == 0x119) return; | |
| 1067 | //if (input_code_pressed(KEYCODE_O) && (texoffs & 0xffff) == 0x119) return; | |
| 1068 | //if (input_code_pressed(KEYCODE_L) && (texoffs & 0x100)) return; | |
| 1060 | if (input_code_pressed(machine, KEYCODE_Q) && (texoffs & 0xffff) == 0x119) return; | |
| 1061 | if (input_code_pressed(machine, KEYCODE_E) && (texoffs & 0xffff) == 0x01d) return; | |
| 1062 | if (input_code_pressed(machine, KEYCODE_R) && (texoffs & 0xffff) == 0x11d) return; | |
| 1063 | if (input_code_pressed(machine, KEYCODE_T) && (texoffs & 0xffff) == 0x05d) return; | |
| 1064 | if (input_code_pressed(machine, KEYCODE_Y) && (texoffs & 0xffff) == 0x0dd) return; | |
| 1065 | //if (input_code_pressed(machine, KEYCODE_U) && (texoffs & 0xffff) == 0x119) return; | |
| 1066 | //if (input_code_pressed(machine, KEYCODE_I) && (texoffs & 0xffff) == 0x119) return; | |
| 1067 | //if (input_code_pressed(machine, KEYCODE_O) && (texoffs & 0xffff) == 0x119) return; | |
| 1068 | //if (input_code_pressed(machine, KEYCODE_L) && (texoffs & 0x100)) return; | |
| 1069 | 1069 | |
| 1070 | 1070 | callback = render_poly_8bit; |
| 1071 | 1071 |
| r5613 | r5614 | |
|---|---|---|
| 243 | 243 | tilemap_set_scroll_cols(tilemap_1_size3,1); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | VIDEO_START( sngkace ) | |
| 247 | { | |
| 248 | VIDEO_START_CALL( psikyo ); | |
| 246 | 249 | |
| 250 | psikyo_switch_banks(0, 0); // sngkace / samuraia don't use banking | |
| 251 | psikyo_switch_banks(1, 1); // They share "gfx2" to save memory on other boards | |
| 252 | } | |
| 247 | 253 | |
| 254 | ||
| 255 | ||
| 248 | 256 | /*************************************************************************** |
| 249 | 257 | |
| 250 | 258 | Sprites Drawing |
| r5613 | r5614 | |
|---|---|---|
| 343 | 343 | tilemap_set_scrolly(esdtilemap_1, 0, esd16_scroll_1[1]); |
| 344 | 344 | |
| 345 | 345 | #ifdef MAME_DEBUG |
| 346 | if ( input_code_pressed(KEYCODE_Z) ) | |
| 346 | if ( input_code_pressed(screen->machine, KEYCODE_Z) ) | |
| 347 | 347 | { int msk = 0; |
| 348 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 349 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 350 | if (input_code_pressed(KEYCODE_A)) msk |= 4; | |
| 348 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 349 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 350 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4; | |
| 351 | 351 | if (msk != 0) layers_ctrl &= msk; } |
| 352 | 352 | #endif |
| 353 | 353 | |
| r5613 | r5614 | |
| 369 | 369 | |
| 370 | 370 | |
| 371 | 371 | #ifdef MAME_DEBUG |
| 372 | if ( input_code_pressed(KEYCODE_Z) ) | |
| 372 | if ( input_code_pressed(screen->machine, KEYCODE_Z) ) | |
| 373 | 373 | { int msk = 0; |
| 374 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 375 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 376 | if (input_code_pressed(KEYCODE_A)) msk |= 4; | |
| 374 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 375 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 376 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4; | |
| 377 | 377 | if (msk != 0) layers_ctrl &= msk; } |
| 378 | 378 | #endif |
| 379 | 379 | |
| r5613 | r5614 | |
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | #ifdef MAME_DEBUG |
| 434 | if ( input_code_pressed(KEYCODE_Z) ) | |
| 434 | if ( input_code_pressed(screen->machine, KEYCODE_Z) ) | |
| 435 | 435 | { int msk = 0; |
| 436 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 437 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 438 | if (input_code_pressed(KEYCODE_A)) msk |= 4; | |
| 436 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 437 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 438 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 4; | |
| 439 | 439 | if (msk != 0) layers_ctrl &= msk; } |
| 440 | 440 | #endif |
| 441 | 441 |
| r5613 | r5614 | |
|---|---|---|
| 410 | 410 | if( tick >= 5 ) { |
| 411 | 411 | tick = 0; |
| 412 | 412 | |
| 413 | if( input_code_pressed(KEYCODE_Y) ) | |
| 413 | if( input_code_pressed(screen->machine, KEYCODE_Y) ) | |
| 414 | 414 | debug_layer_disable ^= 0x1; |
| 415 | if( input_code_pressed(KEYCODE_U) ) | |
| 415 | if( input_code_pressed(screen->machine, KEYCODE_U) ) | |
| 416 | 416 | debug_layer_disable ^= 0x2; |
| 417 | if( input_code_pressed(KEYCODE_I) ) | |
| 417 | if( input_code_pressed(screen->machine, KEYCODE_I) ) | |
| 418 | 418 | debug_layer_disable ^= 0x4; |
| 419 | if( input_code_pressed(KEYCODE_O) ) | |
| 419 | if( input_code_pressed(screen->machine, KEYCODE_O) ) | |
| 420 | 420 | debug_layer_disable ^= 0x8; |
| 421 | if( input_code_pressed(KEYCODE_T) ) | |
| 421 | if( input_code_pressed(screen->machine, KEYCODE_T) ) | |
| 422 | 422 | debug_layer_disable ^= 0x10; |
| 423 | 423 | } |
| 424 | 424 |
| r5613 | r5614 | |
|---|---|---|
| 594 | 594 | { |
| 595 | 595 | |
| 596 | 596 | #ifdef MAME_DEBUG |
| 597 | if(input_code_pressed_once(KEYCODE_Z)) | |
| 597 | if(input_code_pressed_once(screen->machine, KEYCODE_Z)) | |
| 598 | 598 | { |
| 599 | 599 | int h,j; |
| 600 | 600 | FILE *p=fopen("vram.bin","wb"); |
| r5613 | r5614 | |
|---|---|---|
| 225 | 225 | for (i=0; i<=3; i++) |
| 226 | 226 | { |
| 227 | 227 | #ifdef MAME_DEBUG |
| 228 | if (!input_code_pressed(KEYCODE_Q)) | |
| 228 | if (!input_code_pressed(screen->machine, KEYCODE_Q)) | |
| 229 | 229 | #endif |
| 230 | 230 | mcatadv_draw_tilemap_part(mcatadv_scroll, mcatadv_videoram1, i, mcatadv_tilemap1, bitmap, cliprect); |
| 231 | 231 | |
| 232 | 232 | #ifdef MAME_DEBUG |
| 233 | if (!input_code_pressed(KEYCODE_W)) | |
| 233 | if (!input_code_pressed(screen->machine, KEYCODE_W)) | |
| 234 | 234 | #endif |
| 235 | 235 | mcatadv_draw_tilemap_part(mcatadv_scroll2, mcatadv_videoram2, i, mcatadv_tilemap2, bitmap, cliprect); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | profiler_mark_start(PROFILER_USER1); |
| 239 | 239 | #ifdef MAME_DEBUG |
| 240 | if (!input_code_pressed(KEYCODE_E)) | |
| 240 | if (!input_code_pressed(screen->machine, KEYCODE_E)) | |
| 241 | 241 | #endif |
| 242 | 242 | draw_sprites (screen->machine, bitmap, cliprect); |
| 243 | 243 | profiler_mark_end(); |
| r5613 | r5614 | |
|---|---|---|
| 1029 | 1029 | vid_controllers = 2; |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | if ( input_code_pressed_once(KEYCODE_W) ) | |
| 1032 | if ( input_code_pressed_once(machine, KEYCODE_W) ) | |
| 1033 | 1033 | { |
| 1034 | 1034 | display_tx += 1; |
| 1035 | 1035 | display_tx &= 1; |
| 1036 | 1036 | if (toaplan2_txvideoram16 != 0) |
| 1037 | 1037 | tilemap_set_enable(tx_tilemap, display_tx); |
| 1038 | 1038 | } |
| 1039 | if ( input_code_pressed_once(KEYCODE_L) ) | |
| 1039 | if ( input_code_pressed_once(machine, KEYCODE_L) ) | |
| 1040 | 1040 | { |
| 1041 | 1041 | display_sp[0] += 1; |
| 1042 | 1042 | display_sp[0] &= 1; |
| 1043 | 1043 | } |
| 1044 | if ( input_code_pressed_once(KEYCODE_K) ) | |
| 1044 | if ( input_code_pressed_once(machine, KEYCODE_K) ) | |
| 1045 | 1045 | { |
| 1046 | 1046 | display_top[0] += 1; |
| 1047 | 1047 | display_top[0] &= 1; |
| 1048 | 1048 | tilemap_set_enable(top_tilemap[0], display_top[0]); |
| 1049 | 1049 | } |
| 1050 | if ( input_code_pressed_once(KEYCODE_J) ) | |
| 1050 | if ( input_code_pressed_once(machine, KEYCODE_J) ) | |
| 1051 | 1051 | { |
| 1052 | 1052 | display_fg[0] += 1; |
| 1053 | 1053 | display_fg[0] &= 1; |
| 1054 | 1054 | tilemap_set_enable(fg_tilemap[0], display_fg[0]); |
| 1055 | 1055 | } |
| 1056 | if ( input_code_pressed_once(KEYCODE_H) ) | |
| 1056 | if ( input_code_pressed_once(machine, KEYCODE_H) ) | |
| 1057 | 1057 | { |
| 1058 | 1058 | display_bg[0] += 1; |
| 1059 | 1059 | display_bg[0] &= 1; |
| r5613 | r5614 | |
| 1061 | 1061 | } |
| 1062 | 1062 | if (vid_controllers == 2) |
| 1063 | 1063 | { |
| 1064 | if ( input_code_pressed_once(KEYCODE_O) ) | |
| 1064 | if ( input_code_pressed_once(machine, KEYCODE_O) ) | |
| 1065 | 1065 | { |
| 1066 | 1066 | display_sp[1] += 1; |
| 1067 | 1067 | display_sp[1] &= 1; |
| 1068 | 1068 | } |
| 1069 | if ( input_code_pressed_once(KEYCODE_I) ) | |
| 1069 | if ( input_code_pressed_once(machine, KEYCODE_I) ) | |
| 1070 | 1070 | { |
| 1071 | 1071 | display_top[1] += 1; |
| 1072 | 1072 | display_top[1] &= 1; |
| 1073 | 1073 | tilemap_set_enable(top_tilemap[1], display_top[1]); |
| 1074 | 1074 | } |
| 1075 | if ( input_code_pressed_once(KEYCODE_U) ) | |
| 1075 | if ( input_code_pressed_once(machine, KEYCODE_U) ) | |
| 1076 | 1076 | { |
| 1077 | 1077 | display_fg[1] += 1; |
| 1078 | 1078 | display_fg[1] &= 1; |
| 1079 | 1079 | tilemap_set_enable(fg_tilemap[1], display_fg[1]); |
| 1080 | 1080 | } |
| 1081 | if ( input_code_pressed_once(KEYCODE_Y) ) | |
| 1081 | if ( input_code_pressed_once(machine, KEYCODE_Y) ) | |
| 1082 | 1082 | { |
| 1083 | 1083 | display_bg[1] += 1; |
| 1084 | 1084 | display_bg[1] &= 1; |
| r5613 | r5614 | |
| 1150 | 1150 | |
| 1151 | 1151 | |
| 1152 | 1152 | |
| 1153 | #ifdef MAME_DEBUG | |
| 1154 | static void toaplan2_log_vram(void) | |
| 1153 | static void toaplan2_log_vram(running_machine *machine) | |
| 1155 | 1154 | { |
| 1155 | #ifdef MAME_DEBUG | |
| 1156 | 1156 | offs_t sprite_voffs, tile_voffs; |
| 1157 | 1157 | int vid_controllers = 1; |
| 1158 | 1158 | |
| r5613 | r5614 | |
| 1162 | 1162 | vid_controllers = 2; |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | if ( input_code_pressed_once(KEYCODE_M) ) | |
| 1165 | if ( input_code_pressed_once(machine, KEYCODE_M) ) | |
| 1166 | 1166 | { |
| 1167 | 1167 | UINT16 *source_now0 = (UINT16 *)(spriteram16_now[0]); |
| 1168 | 1168 | UINT16 *source_new0 = (UINT16 *)(spriteram16_new[0]); |
| r5613 | r5614 | |
| 1213 | 1213 | } |
| 1214 | 1214 | } |
| 1215 | 1215 | } |
| 1216 | if ( input_code_pressed_once(KEYCODE_N) ) | |
| 1216 | if ( input_code_pressed_once(machine, KEYCODE_N) ) | |
| 1217 | 1217 | { |
| 1218 | 1218 | int tchar[2], tattr[2]; |
| 1219 | 1219 | logerror("Scrolls BG-X BG-Y FG-X FG-Y TOP-X TOP-Y Sprite-X Sprite-Y\n"); |
| r5613 | r5614 | |
| 1238 | 1238 | } |
| 1239 | 1239 | } |
| 1240 | 1240 | } |
| 1241 | if ( input_code_pressed_once(KEYCODE_B) ) | |
| 1241 | if ( input_code_pressed_once(machine, KEYCODE_B) ) | |
| 1242 | 1242 | { |
| 1243 | 1243 | int tchar[2], tattr[2]; |
| 1244 | 1244 | logerror("Scrolls BG-X BG-Y FG-X FG-Y TOP-X TOP-Y Sprite-X Sprite-Y\n"); |
| r5613 | r5614 | |
| 1263 | 1263 | } |
| 1264 | 1264 | } |
| 1265 | 1265 | } |
| 1266 | if ( input_code_pressed_once(KEYCODE_V) ) | |
| 1266 | if ( input_code_pressed_once(machine, KEYCODE_V) ) | |
| 1267 | 1267 | { |
| 1268 | 1268 | int tchar[2], tattr[2]; |
| 1269 | 1269 | logerror("Scrolls BG-X BG-Y FG-X FG-Y TOP-X TOP-Y Sprite-X Sprite-Y\n"); |
| r5613 | r5614 | |
| 1289 | 1289 | } |
| 1290 | 1290 | } |
| 1291 | 1291 | |
| 1292 | if ( input_code_pressed_once(KEYCODE_C) ) | |
| 1292 | if ( input_code_pressed_once(machine, KEYCODE_C) ) | |
| 1293 | 1293 | logerror("Mark here\n"); |
| 1294 | 1294 | |
| 1295 | if ( input_code_pressed_once(KEYCODE_E) ) | |
| 1295 | if ( input_code_pressed_once(machine, KEYCODE_E) ) | |
| 1296 | 1296 | { |
| 1297 | 1297 | displog += 1; |
| 1298 | 1298 | displog &= 1; |
| r5613 | r5614 | |
| 1306 | 1306 | logerror("---1--> %04x %04x %04x %04x %04x %04x %04x %04x\n", bg_scrollx[1],bg_scrolly[1],fg_scrollx[1],fg_scrolly[1],top_scrollx[1],top_scrolly[1],sprite_scrollx[1], sprite_scrolly[1]); |
| 1307 | 1307 | } |
| 1308 | 1308 | } |
| 1309 | } | |
| 1310 | 1309 | #endif |
| 1310 | } | |
| 1311 | 1311 | |
| 1312 | 1312 | |
| 1313 | 1313 | |
| r5613 | r5614 | |
| 1493 | 1493 | { |
| 1494 | 1494 | int priority; |
| 1495 | 1495 | |
| 1496 | toaplan2_log_vram(screen->machine); | |
| 1496 | 1497 | |
| 1497 | #ifdef MAME_DEBUG | |
| 1498 | toaplan2_log_vram(); | |
| 1499 | #endif | |
| 1500 | ||
| 1501 | 1498 | mark_sprite_priority(0); |
| 1502 | 1499 | mark_tile_priority(0); |
| 1503 | 1500 | |
| r5613 | r5614 | |
| 1518 | 1515 | { |
| 1519 | 1516 | int priority; |
| 1520 | 1517 | |
| 1518 | toaplan2_log_vram(screen->machine); | |
| 1521 | 1519 | |
| 1522 | #ifdef MAME_DEBUG | |
| 1523 | toaplan2_log_vram(); | |
| 1524 | #endif | |
| 1525 | ||
| 1526 | 1520 | mark_sprite_priority(0); |
| 1527 | 1521 | mark_sprite_priority(1); |
| 1528 | 1522 | mark_tile_priority(0); |
| r5613 | r5614 | |
| 1553 | 1547 | { |
| 1554 | 1548 | int priority; |
| 1555 | 1549 | |
| 1550 | toaplan2_log_vram(screen->machine); | |
| 1556 | 1551 | |
| 1557 | #ifdef MAME_DEBUG | |
| 1558 | toaplan2_log_vram(); | |
| 1559 | #endif | |
| 1560 | ||
| 1561 | 1552 | mark_sprite_priority(0); |
| 1562 | 1553 | mark_sprite_priority(1); |
| 1563 | 1554 | mark_tile_priority(0); |
| r5613 | r5614 | |
| 1601 | 1592 | rectangle clip; |
| 1602 | 1593 | const rectangle *visarea = video_screen_get_visible_area(screen); |
| 1603 | 1594 | |
| 1604 | #ifdef MAME_DEBUG | |
| 1605 | toaplan2_log_vram(); | |
| 1606 | #endif | |
| 1595 | toaplan2_log_vram(screen->machine); | |
| 1607 | 1596 | |
| 1608 | 1597 | mark_sprite_priority(0); |
| 1609 | 1598 | mark_tile_priority(0); |
| r5613 | r5614 | |
| 1648 | 1637 | { |
| 1649 | 1638 | int priority; |
| 1650 | 1639 | |
| 1640 | toaplan2_log_vram(screen->machine); | |
| 1651 | 1641 | |
| 1652 | #ifdef MAME_DEBUG | |
| 1653 | toaplan2_log_vram(); | |
| 1654 | #endif | |
| 1655 | ||
| 1656 | 1642 | mark_sprite_priority(0); |
| 1657 | 1643 | mark_tile_priority(0); |
| 1658 | 1644 |
| r5613 | r5614 | |
|---|---|---|
| 493 | 493 | #if 0 |
| 494 | 494 | if (layer[0]==0 && layer[1]==3 && layer[2]==2 && layer[3]==1) |
| 495 | 495 | { |
| 496 | if (!input_code_pressed(KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); | |
| 497 | if (!input_code_pressed(KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,4); | |
| 498 | if (!input_code_pressed(KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); | |
| 499 | if (!input_code_pressed(KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,4); | |
| 496 | if (!input_code_pressed(screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); | |
| 497 | if (!input_code_pressed(screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,4); | |
| 498 | if (!input_code_pressed(screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); | |
| 499 | if (!input_code_pressed(screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,4); | |
| 500 | 500 | } |
| 501 | 501 | else |
| 502 | 502 | { |
| 503 | if (!input_code_pressed(KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); | |
| 504 | if (!input_code_pressed(KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,2); | |
| 505 | if (!input_code_pressed(KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); | |
| 506 | if (!input_code_pressed(KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,8); | |
| 503 | if (!input_code_pressed(screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[0],0,1); | |
| 504 | if (!input_code_pressed(screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[1],0,2); | |
| 505 | if (!input_code_pressed(screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[2],0,4); | |
| 506 | if (!input_code_pressed(screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,tmpbitmaps,&clip,layer[3],0,8); | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | if (layer[0]==3 && layer[1]==0 && layer[2]==1 && layer[3]==2) |
| r5613 | r5614 | |
| 532 | 532 | bitmap_fill(priority_bitmap, cliprect, 0); |
| 533 | 533 | draw_sprites(screen->machine,bitmap,cliprect,primasks,0); |
| 534 | 534 | |
| 535 | if (!input_code_pressed(KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); | |
| 536 | if (!input_code_pressed(KEYCODE_M)) TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0); | |
| 535 | if (!input_code_pressed(screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,0); | |
| 536 | if (!input_code_pressed(screen->machine, KEYCODE_M)) TC0100SCN_tilemap_draw(screen->machine,bitmap,cliprect,0,pivlayer[2],0,0); | |
| 537 | 537 | |
| 538 | 538 | |
| 539 | 539 | #else |
| r5613 | r5614 | |
|---|---|---|
| 524 | 524 | #if BT_DEBUG |
| 525 | 525 | popmessage("screen_control = %02X", screen_control & 0x7f); |
| 526 | 526 | |
| 527 | if (input_code_pressed(KEYCODE_X)) | |
| 527 | if (input_code_pressed(screen->machine, KEYCODE_X)) | |
| 528 | 528 | { |
| 529 | 529 | static int count = 0; |
| 530 | 530 | char name[10]; |
| 531 | 531 | FILE *f; |
| 532 | 532 | int i; |
| 533 | 533 | |
| 534 | while (input_code_pressed(KEYCODE_X)) ; | |
| 534 | while (input_code_pressed(screen->machine, KEYCODE_X)) ; | |
| 535 | 535 | |
| 536 | 536 | sprintf(name, "disp%d.log", count++); |
| 537 | 537 | f = fopen(name, "w"); |
| r5613 | r5614 | |
|---|---|---|
| 872 | 872 | |
| 873 | 873 | /* dimension of a tile after zoom */ |
| 874 | 874 | #ifdef MAME_DEBUG |
| 875 | if ( input_code_pressed(KEYCODE_Z) && input_code_pressed(KEYCODE_M) ) | |
| 875 | if ( input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_M) ) | |
| 876 | 876 | { |
| 877 | 877 | xdim = 16 << 16; |
| 878 | 878 | ydim = 16 << 16; |
| r5613 | r5614 | |
| 938 | 938 | } |
| 939 | 939 | #ifdef MAME_DEBUG |
| 940 | 940 | #if 0 |
| 941 | if (input_code_pressed(KEYCODE_X)) | |
| 941 | if (input_code_pressed(machine, KEYCODE_X)) | |
| 942 | 942 | { /* Display some info on each sprite */ |
| 943 | 943 | sprintf(buf, "%04x",attr); |
| 944 | 944 | ui_draw_text(buf, sx>>16, sy>>16); |
| r5613 | r5614 | |
| 1028 | 1028 | |
| 1029 | 1029 | /* dimension of a tile after zoom */ |
| 1030 | 1030 | #ifdef MAME_DEBUG |
| 1031 | if ( input_code_pressed(KEYCODE_Z) && input_code_pressed(KEYCODE_M) ) | |
| 1031 | if ( input_code_pressed(machine, KEYCODE_Z) && input_code_pressed(machine, KEYCODE_M) ) | |
| 1032 | 1032 | { |
| 1033 | 1033 | xdim = 16 << 16; |
| 1034 | 1034 | ydim = 16 << 16; |
| r5613 | r5614 | |
| 1092 | 1092 | } |
| 1093 | 1093 | #ifdef MAME_DEBUG |
| 1094 | 1094 | #if 0 |
| 1095 | if (input_code_pressed(KEYCODE_X)) | |
| 1095 | if (input_code_pressed(machine, KEYCODE_X)) | |
| 1096 | 1096 | { /* Display some info on each sprite */ |
| 1097 | 1097 | sprintf(buf, "%04x",attr); |
| 1098 | 1098 | ui_draw_text(buf, sx>>16, sy>>16); |
| r5613 | r5614 | |
| 1113 | 1113 | |
| 1114 | 1114 | #define CISCHEAT_LAYERSCTRL \ |
| 1115 | 1115 | debugsprites = 0; \ |
| 1116 | if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) \ | |
| 1116 | if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) \ | |
| 1117 | 1117 | { \ |
| 1118 | 1118 | int msk = 0; \ |
| 1119 | if (input_code_pressed(KEYCODE_Q)) { msk |= 0x01;} \ | |
| 1120 | if (input_code_pressed(KEYCODE_W)) { msk |= 0x02;} \ | |
| 1121 | if (input_code_pressed(KEYCODE_E)) { msk |= 0x04;} \ | |
| 1122 | if (input_code_pressed(KEYCODE_A)) { msk |= 0x08; debugsprites = 1;} \ | |
| 1123 | if (input_code_pressed(KEYCODE_S)) { msk |= 0x08; debugsprites = 2;} \ | |
| 1124 | if (input_code_pressed(KEYCODE_D)) { msk |= 0x08; debugsprites = 3;} \ | |
| 1125 | if (input_code_pressed(KEYCODE_F)) { msk |= 0x08; debugsprites = 4;} \ | |
| 1126 | if (input_code_pressed(KEYCODE_R)) { msk |= 0x10;} \ | |
| 1127 | if (input_code_pressed(KEYCODE_T)) { msk |= 0x20;} \ | |
| 1119 | if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0x01;} \ | |
| 1120 | if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0x02;} \ | |
| 1121 | if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0x04;} \ | |
| 1122 | if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0x08; debugsprites = 1;} \ | |
| 1123 | if (input_code_pressed(screen->machine, KEYCODE_S)) { msk |= 0x08; debugsprites = 2;} \ | |
| 1124 | if (input_code_pressed(screen->machine, KEYCODE_D)) { msk |= 0x08; debugsprites = 3;} \ | |
| 1125 | if (input_code_pressed(screen->machine, KEYCODE_F)) { msk |= 0x08; debugsprites = 4;} \ | |
| 1126 | if (input_code_pressed(screen->machine, KEYCODE_R)) { msk |= 0x10;} \ | |
| 1127 | if (input_code_pressed(screen->machine, KEYCODE_T)) { msk |= 0x20;} \ | |
| 1128 | 1128 | \ |
| 1129 | 1129 | if (msk != 0) megasys1_active_layers &= msk; \ |
| 1130 | 1130 | } \ |
| 1131 | 1131 | \ |
| 1132 | 1132 | { \ |
| 1133 | 1133 | static int show_unknown; \ |
| 1134 | if ( input_code_pressed(KEYCODE_Z) && input_code_pressed_once(KEYCODE_U) ) \ | |
| 1134 | if ( input_code_pressed(screen->machine, KEYCODE_Z) && input_code_pressed_once(screen->machine, KEYCODE_U) ) \ | |
| 1135 | 1135 | show_unknown ^= 1; \ |
| 1136 | 1136 | if (show_unknown) \ |
| 1137 | 1137 | popmessage("0:%04X 2:%04X 4:%04X 6:%04X c:%04X", \ |
| r5613 | r5614 | |
| 1327 | 1327 | |
| 1328 | 1328 | #ifdef MAME_DEBUG |
| 1329 | 1329 | debugsprites = 0; |
| 1330 | if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) | |
| 1330 | if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) | |
| 1331 | 1331 | { |
| 1332 | 1332 | int msk = 0; |
| 1333 | if (input_code_pressed(KEYCODE_Q)) { msk |= 0x1;} | |
| 1334 | if (input_code_pressed(KEYCODE_W)) { msk |= 0x2;} | |
| 1335 | if (input_code_pressed(KEYCODE_E)) { msk |= 0x4;} | |
| 1336 | if (input_code_pressed(KEYCODE_A)) { msk |= 0x8; debugsprites = 1;} | |
| 1337 | if (input_code_pressed(KEYCODE_S)) { msk |= 0x8; debugsprites = 2;} | |
| 1338 | if (input_code_pressed(KEYCODE_D)) { msk |= 0x8; debugsprites = 3;} | |
| 1339 | if (input_code_pressed(KEYCODE_F)) { msk |= 0x8; debugsprites = 4;} | |
| 1333 | if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0x1;} | |
| 1334 | if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0x2;} | |
| 1335 | if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0x4;} | |
| 1336 | if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0x8; debugsprites = 1;} | |
| 1337 | if (input_code_pressed(screen->machine, KEYCODE_S)) { msk |= 0x8; debugsprites = 2;} | |
| 1338 | if (input_code_pressed(screen->machine, KEYCODE_D)) { msk |= 0x8; debugsprites = 3;} | |
| 1339 | if (input_code_pressed(screen->machine, KEYCODE_F)) { msk |= 0x8; debugsprites = 4;} | |
| 1340 | 1340 | |
| 1341 | 1341 | if (msk != 0) megasys1_active_layers &= msk; |
| 1342 | 1342 | #if 1 |
| r5613 | r5614 | |
|---|---|---|
| 2277 | 2277 | ApplyGamma( screen->machine, bitmap ); |
| 2278 | 2278 | |
| 2279 | 2279 | #ifdef MAME_DEBUG |
| 2280 | if( input_code_pressed(KEYCODE_D) ) | |
| 2280 | if( input_code_pressed(screen->machine, KEYCODE_D) ) | |
| 2281 | 2281 | { |
| 2282 | 2282 | FILE *f = fopen( "dump.txt", "wb" ); |
| 2283 | 2283 | if( f ) |
| r5613 | r5614 | |
| 2309 | 2309 | Dump(space, f,0xc00000, 0xc1ffff, "polygonram"); |
| 2310 | 2310 | fclose( f ); |
| 2311 | 2311 | } |
| 2312 | while( input_code_pressed(KEYCODE_D) ){} | |
| 2312 | while( input_code_pressed(screen->machine, KEYCODE_D) ){} | |
| 2313 | 2313 | } |
| 2314 | 2314 | #endif |
| 2315 | 2315 | return 0; |
| r5613 | r5614 | |
| 2327 | 2327 | ApplyGamma( screen->machine, bitmap ); |
| 2328 | 2328 | |
| 2329 | 2329 | #ifdef MAME_DEBUG |
| 2330 | if( input_code_pressed(KEYCODE_D) ) | |
| 2330 | if( input_code_pressed(screen->machine, KEYCODE_D) ) | |
| 2331 | 2331 | { |
| 2332 | 2332 | FILE *f = fopen( "dump.txt", "wb" ); |
| 2333 | 2333 | if( f ) |
| r5613 | r5614 | |
| 2341 | 2341 | // Dump(space, f,0x70000000, 0x7001ffff, "polygonram"); |
| 2342 | 2342 | fclose( f ); |
| 2343 | 2343 | } |
| 2344 | while( input_code_pressed(KEYCODE_D) ){} | |
| 2344 | while( input_code_pressed(screen->machine, KEYCODE_D) ){} | |
| 2345 | 2345 | } |
| 2346 | 2346 | #endif |
| 2347 | 2347 | return 0; |
| r5613 | r5614 | |
|---|---|---|
| 653 | 653 | #endif |
| 654 | 654 | |
| 655 | 655 | #ifdef MAME_DEBUG |
| 656 | if (input_code_pressed_once (KEYCODE_V)) | |
| 656 | if (input_code_pressed_once (screen->machine, KEYCODE_V)) | |
| 657 | 657 | { |
| 658 | 658 | dislayer[0] ^= 1; |
| 659 | 659 | popmessage("piv0: %01x",dislayer[0]); |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | if (input_code_pressed_once (KEYCODE_B)) | |
| 662 | if (input_code_pressed_once (screen->machine, KEYCODE_B)) | |
| 663 | 663 | { |
| 664 | 664 | dislayer[1] ^= 1; |
| 665 | 665 | popmessage("piv1: %01x",dislayer[1]); |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | if (input_code_pressed_once (KEYCODE_N)) | |
| 668 | if (input_code_pressed_once (screen->machine, KEYCODE_N)) | |
| 669 | 669 | { |
| 670 | 670 | dislayer[2] ^= 1; |
| 671 | 671 | popmessage("piv2: %01x",dislayer[2]); |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | if (input_code_pressed_once (KEYCODE_M)) | |
| 674 | if (input_code_pressed_once (screen->machine, KEYCODE_M)) | |
| 675 | 675 | { |
| 676 | 676 | dislayer[3] ^= 1; |
| 677 | 677 | popmessage("TC0100SCN top bg layer: %01x",dislayer[3]); |
| r5613 | r5614 | |
|---|---|---|
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | #ifdef MAME_DEBUG |
| 903 | if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */ | |
| 903 | if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */ | |
| 904 | 904 | { char buf[30]; |
| 905 | 905 | sprintf(buf, "%02X",/*(s2[2] & ~0x3ff)>>8*/mode>>8); |
| 906 | 906 | ui_draw_text(buf, sx, sy); |
| r5613 | r5614 | |
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | 1080 | #ifdef MAME_DEBUG |
| 1081 | if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */ | |
| 1081 | if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */ | |
| 1082 | 1082 | { |
| 1083 | 1083 | char buf[10]; |
| 1084 | 1084 | sprintf(buf, "%X",size); |
| r5613 | r5614 | |
|---|---|---|
| 361 | 361 | bitmap_fill(bitmap, cliprect, 0x41); |
| 362 | 362 | |
| 363 | 363 | #ifdef MAME_DEBUG |
| 364 | if ( !input_code_pressed(KEYCODE_A) ) | |
| 364 | if ( !input_code_pressed(screen->machine, KEYCODE_A) ) | |
| 365 | 365 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,0,0); |
| 366 | if ( !input_code_pressed(KEYCODE_S) ) | |
| 366 | if ( !input_code_pressed(screen->machine, KEYCODE_S) ) | |
| 367 | 367 | draw_sprites(screen->machine,bitmap,cliprect,0); |
| 368 | if ( !input_code_pressed(KEYCODE_D) ) | |
| 368 | if ( !input_code_pressed(screen->machine, KEYCODE_D) ) | |
| 369 | 369 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,1,0,0); |
| 370 | if ( !input_code_pressed(KEYCODE_F) ) | |
| 370 | if ( !input_code_pressed(screen->machine, KEYCODE_F) ) | |
| 371 | 371 | draw_sprites(screen->machine,bitmap,cliprect,1); |
| 372 | 372 | #else |
| 373 | 373 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,0,0); |
| r5613 | r5614 | |
|---|---|---|
| 923 | 923 | |
| 924 | 924 | |
| 925 | 925 | #ifdef MAME_DEBUG |
| 926 | if (input_code_pressed(KEYCODE_Z)) | |
| 926 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 927 | 927 | { |
| 928 | 928 | int msk = 0; |
| 929 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 930 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 931 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 932 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 929 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 930 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 931 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 932 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 933 | 933 | if (msk != 0) |
| 934 | 934 | { bitmap_fill(bitmap,cliprect,0); |
| 935 | 935 | layers_ctrl &= msk; } |
| r5613 | r5614 | |
|---|---|---|
| 378 | 378 | |
| 379 | 379 | WRITE32_HANDLER( midvunit_dma_queue_w ) |
| 380 | 380 | { |
| 381 | if (LOG_DMA && input_code_pressed(KEYCODE_L)) | |
| 381 | if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L)) | |
| 382 | 382 | logerror("%06X:queue(%X) = %08X\n", cpu_get_pc(space->cpu), dma_data_index, data); |
| 383 | 383 | if (dma_data_index < 16) |
| 384 | 384 | dma_data[dma_data_index++] = data; |
| r5613 | r5614 | |
| 396 | 396 | { |
| 397 | 397 | if (offset) |
| 398 | 398 | { |
| 399 | if (LOG_DMA && input_code_pressed(KEYCODE_L)) | |
| 399 | if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L)) | |
| 400 | 400 | logerror("%06X:trigger\n", cpu_get_pc(space->cpu)); |
| 401 | 401 | process_dma_queue(space->machine); |
| 402 | 402 | dma_data_index = 0; |
| r5613 | r5614 | |
| 418 | 418 | if ((page_control ^ data) & 1) |
| 419 | 419 | { |
| 420 | 420 | video_changed = TRUE; |
| 421 | if (LOG_DMA && input_code_pressed(KEYCODE_L)) | |
| 421 | if (LOG_DMA && input_code_pressed(space->machine, KEYCODE_L)) | |
| 422 | 422 | logerror("##########################################################\n"); |
| 423 | 423 | video_screen_update_partial(space->machine->primary_screen, video_screen_get_vpos(space->machine->primary_screen) - 1); |
| 424 | 424 | } |
| r5613 | r5614 | |
|---|---|---|
| 228 | 228 | int layers_ctrl = -1; |
| 229 | 229 | |
| 230 | 230 | #ifdef MAME_DEBUG |
| 231 | if (input_code_pressed(KEYCODE_Z)) | |
| 231 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 232 | 232 | { int msk = 0; |
| 233 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 234 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 233 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 234 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 235 | 235 | if (msk != 0) layers_ctrl &= msk; |
| 236 | 236 | } |
| 237 | 237 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 189 | 189 | int layers_ctrl = (~yunsung8_layers_ctrl) >> 4; |
| 190 | 190 | |
| 191 | 191 | #ifdef MAME_DEBUG |
| 192 | if (input_code_pressed(KEYCODE_Z)) | |
| 192 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 193 | 193 | { |
| 194 | 194 | int msk = 0; |
| 195 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 196 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 195 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 196 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 197 | 197 | if (msk != 0) layers_ctrl &= msk; |
| 198 | 198 | } |
| 199 | 199 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 656 | 656 | if (gpu_regs[PIT0]) |
| 657 | 657 | { |
| 658 | 658 | sample_period = ATTOTIME_IN_NSEC(cpu_get_clock(cputag_get_cpu(machine,"gpu")) / (1+gpu_regs[PIT0]) / (1+gpu_regs[PIT1])); |
| 659 | // | |
| 659 | // timer_set(machine, sample_period, NULL, 0, jaguar_pit); | |
| 660 | 660 | } |
| 661 | 661 | } |
| 662 | 662 | #endif |
| 663 | ||
| 663 | ||
| 664 | 664 | WRITE16_HANDLER( jaguar_tom_regs_w ) |
| 665 | 665 | { |
| 666 | 666 | UINT32 reg_store = gpu_regs[offset]; |
| 667 | // | |
| 667 | // attotime sample_period; | |
| 668 | 668 | if (offset < GPU_REGS) |
| 669 | 669 | { |
| 670 | 670 | COMBINE_DATA(&gpu_regs[offset]); |
| r5613 | r5614 | |
| 825 | 825 | { |
| 826 | 826 | UINT8 r = pen_table[(scanline[x]&0xff)|256]; |
| 827 | 827 | UINT8 g = pen_table[(scanline[x]>>8)|512]; |
| 828 | UINT8 b = pen_table[scanline[x+1]&0xff]; | |
| 828 | UINT8 b = pen_table[scanline[x+1]&0xff]; | |
| 829 | 829 | dest[hdb++] = MAKE_RGB(r, g, b); |
| 830 | 830 | } |
| 831 | 831 | } |
| r5613 | r5614 | |
|---|---|---|
| 23 | 23 | int attr = colorram[tile_index]; |
| 24 | 24 | int tile_number = videoram[tile_index] | ((attr & 0x03) << 8); |
| 25 | 25 | |
| 26 | /*if (input_code_pressed(KEYCODE_Q) && (attr & 0x10)) tile_number = rand(); */ | |
| 27 | /*if (input_code_pressed(KEYCODE_W) && (attr & 0x20)) tile_number = rand(); */ | |
| 28 | /*if (input_code_pressed(KEYCODE_E) && (attr & 0x40)) tile_number = rand(); */ | |
| 29 | /*if (input_code_pressed(KEYCODE_R) && (attr & 0x80)) tile_number = rand(); */ | |
| 26 | /*if (input_code_pressed(machine, KEYCODE_Q) && (attr & 0x10)) tile_number = rand(); */ | |
| 27 | /*if (input_code_pressed(machine, KEYCODE_W) && (attr & 0x20)) tile_number = rand(); */ | |
| 28 | /*if (input_code_pressed(machine, KEYCODE_E) && (attr & 0x40)) tile_number = rand(); */ | |
| 29 | /*if (input_code_pressed(machine, KEYCODE_R) && (attr & 0x80)) tile_number = rand(); */ | |
| 30 | 30 | SET_TILE_INFO( |
| 31 | 31 | 0, |
| 32 | 32 | tile_number, |
| r5613 | r5614 | |
|---|---|---|
| 965 | 965 | |
| 966 | 966 | |
| 967 | 967 | #ifdef MAME_DEBUG |
| 968 | if (input_code_pressed(KEYCODE_Z)) | |
| 968 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 969 | 969 | { int msk = 0; |
| 970 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 971 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 972 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 970 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 971 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 972 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 973 | 973 | if (msk != 0) layers_ctrl &= msk; |
| 974 | 974 | |
| 975 | 975 | if (tilemap_2) popmessage("VR:%04X-%04X-%04X L0:%04X L1:%04X",seta_vregs[0],seta_vregs[1],seta_vregs[2],seta_vctrl_0[4/2],seta_vctrl_2[4/2]); |
| r5613 | r5614 | |
|---|---|---|
| 800 | 800 | |
| 801 | 801 | /*****************************************************************************************/ |
| 802 | 802 | |
| 803 | void deco16_print_debug_info(bitmap_t *bitmap) | |
| 803 | void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap) | |
| 804 | 804 | { |
| 805 | 805 | char buf[64*5]; |
| 806 | 806 | |
| 807 | if (input_code_pressed(KEYCODE_O)) | |
| 807 | if (input_code_pressed(machine, KEYCODE_O)) | |
| 808 | 808 | return; |
| 809 | 809 | |
| 810 | 810 | if (deco16_pf12_control) { |
| r5613 | r5614 | |
|---|---|---|
| 346 | 346 | tilemap_set_scrollx(tilemap_2, 0, *unico_scrollx_2); |
| 347 | 347 | |
| 348 | 348 | #ifdef MAME_DEBUG |
| 349 | if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) | |
| 349 | if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) | |
| 350 | 350 | { |
| 351 | 351 | int msk = 0; |
| 352 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 353 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 354 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 355 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 352 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 353 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 354 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 355 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 356 | 356 | if (msk != 0) layers_ctrl &= msk; |
| 357 | 357 | } |
| 358 | 358 | #endif |
| r5613 | r5614 | |
| 385 | 385 | tilemap_set_scrolly(tilemap_2, 0, unico_scroll32[1] >> 16); |
| 386 | 386 | |
| 387 | 387 | #ifdef MAME_DEBUG |
| 388 | if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) ) | |
| 388 | if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) ) | |
| 389 | 389 | { |
| 390 | 390 | int msk = 0; |
| 391 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 392 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 393 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 394 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 391 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 392 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 393 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 394 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 395 | 395 | if (msk != 0) layers_ctrl &= msk; |
| 396 | 396 | } |
| 397 | 397 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 281 | 281 | #endif |
| 282 | 282 | |
| 283 | 283 | #ifdef MAME_DEBUG |
| 284 | if (input_code_pressed_once (KEYCODE_V)) | |
| 284 | if (input_code_pressed_once (screen->machine, KEYCODE_V)) | |
| 285 | 285 | { |
| 286 | 286 | dislayer[0] ^= 1; |
| 287 | 287 | popmessage("bg0: %01x",dislayer[0]); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | if (input_code_pressed_once (KEYCODE_B)) | |
| 290 | if (input_code_pressed_once (screen->machine, KEYCODE_B)) | |
| 291 | 291 | { |
| 292 | 292 | dislayer[1] ^= 1; |
| 293 | 293 | popmessage("bg1: %01x",dislayer[1]); |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | if (input_code_pressed_once (KEYCODE_N)) | |
| 296 | if (input_code_pressed_once (screen->machine, KEYCODE_N)) | |
| 297 | 297 | { |
| 298 | 298 | dislayer[2] ^= 1; |
| 299 | 299 | popmessage("fg: %01x",dislayer[2]); |
| r5613 | r5614 | |
|---|---|---|
| 502 | 502 | tilemap_set_scrollx(tilemap_1, 0, realbrk_vregs[0x6/2]); |
| 503 | 503 | |
| 504 | 504 | #ifdef MAME_DEBUG |
| 505 | if ( input_code_pressed(KEYCODE_Z) ) | |
| 505 | if ( input_code_pressed(screen->machine, KEYCODE_Z) ) | |
| 506 | 506 | { int msk = 0; |
| 507 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 508 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 509 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 510 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 507 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 508 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 509 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 510 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 511 | 511 | if (msk != 0) layers_ctrl &= msk; } |
| 512 | 512 | #endif |
| 513 | 513 | |
| r5613 | r5614 | |
| 570 | 570 | tilemap_set_scrolly( tilemap_1, 0, bgy1 ); |
| 571 | 571 | |
| 572 | 572 | #ifdef MAME_DEBUG |
| 573 | if ( input_code_pressed(KEYCODE_Z) ) | |
| 573 | if ( input_code_pressed(screen->machine, KEYCODE_Z) ) | |
| 574 | 574 | { int msk = 0; |
| 575 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 576 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 577 | if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 578 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 575 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 576 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 577 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 578 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 579 | 579 | if (msk != 0) layers_ctrl &= msk; } |
| 580 | 580 | #endif |
| 581 | 581 |
| r5613 | r5614 | |
|---|---|---|
| 231 | 231 | sprites as pdrawgfx cannot yet cope with more than 4 layers */ |
| 232 | 232 | |
| 233 | 233 | #ifdef MAME_DEBUG |
| 234 | if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); | |
| 235 | if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); | |
| 236 | if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); | |
| 237 | if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); | |
| 238 | if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); | |
| 239 | if (!input_code_pressed (KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); | |
| 234 | if (!input_code_pressed (screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); | |
| 235 | if (!input_code_pressed (screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); | |
| 236 | if (!input_code_pressed (screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); | |
| 237 | if (!input_code_pressed (screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); | |
| 238 | if (!input_code_pressed (screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); | |
| 239 | if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); | |
| 240 | 240 | #else |
| 241 | 241 | TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); |
| 242 | 242 | TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); |
| r5613 | r5614 | |
|---|---|---|
| 396 | 396 | |
| 397 | 397 | |
| 398 | 398 | |
| 399 | #ifdef MAME_DEBUG | |
| 400 | ||
| 401 | static void taitoh_log_vram(void) | |
| 399 | static void taitoh_log_vram(running_machine *machine) | |
| 402 | 400 | { |
| 401 | #ifdef MAME_DEBUG | |
| 403 | 402 | // null function: the necessary pointers are now internal to taitoic.c |
| 404 | 403 | // Recreate it there if wanted (add prototype to taitoic.h) |
| 404 | #endif | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | #endif | |
| 408 | 407 | |
| 409 | ||
| 410 | 408 | /**************************************************************************/ |
| 411 | 409 | |
| 412 | 410 | VIDEO_UPDATE( syvalion ) |
| 413 | 411 | { |
| 414 | 412 | TC0080VCO_tilemap_update(screen->machine); |
| 415 | 413 | |
| 416 | #ifdef MAME_DEBUG | |
| 417 | taitoh_log_vram(); | |
| 418 | #endif | |
| 414 | taitoh_log_vram(screen->machine); | |
| 419 | 415 | |
| 420 | 416 | bitmap_fill(bitmap, cliprect, 0); |
| 421 | 417 | |
| r5613 | r5614 | |
| 431 | 427 | { |
| 432 | 428 | TC0080VCO_tilemap_update(screen->machine); |
| 433 | 429 | |
| 434 | #ifdef MAME_DEBUG | |
| 435 | taitoh_log_vram(); | |
| 436 | #endif | |
| 430 | taitoh_log_vram(screen->machine); | |
| 437 | 431 | |
| 438 | 432 | bitmap_fill(bitmap, cliprect, 0); |
| 439 | 433 | |
| 440 | 434 | #ifdef MAME_DEBUG |
| 441 | if ( !input_code_pressed(KEYCODE_A) ) | |
| 435 | if ( !input_code_pressed(screen->machine, KEYCODE_A) ) | |
| 442 | 436 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); |
| 443 | if ( !input_code_pressed(KEYCODE_S) ) | |
| 437 | if ( !input_code_pressed(screen->machine, KEYCODE_S) ) | |
| 444 | 438 | recordbr_draw_sprites(screen->machine,bitmap,cliprect,0); |
| 445 | if ( !input_code_pressed(KEYCODE_D) ) | |
| 439 | if ( !input_code_pressed(screen->machine, KEYCODE_D) ) | |
| 446 | 440 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,1,0,0); |
| 447 | if ( !input_code_pressed(KEYCODE_F) ) | |
| 441 | if ( !input_code_pressed(screen->machine, KEYCODE_F) ) | |
| 448 | 442 | recordbr_draw_sprites(screen->machine,bitmap,cliprect,1); |
| 449 | 443 | #else |
| 450 | 444 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); |
| r5613 | r5614 | |
| 462 | 456 | { |
| 463 | 457 | TC0080VCO_tilemap_update(screen->machine); |
| 464 | 458 | |
| 465 | #ifdef MAME_DEBUG | |
| 466 | taitoh_log_vram(); | |
| 467 | #endif | |
| 459 | taitoh_log_vram(screen->machine); | |
| 468 | 460 | |
| 469 | 461 | bitmap_fill(bitmap, cliprect, 0); |
| 470 | 462 | |
| 471 | 463 | #ifdef MAME_DEBUG |
| 472 | if ( !input_code_pressed(KEYCODE_A) ) | |
| 464 | if ( !input_code_pressed(screen->machine, KEYCODE_A) ) | |
| 473 | 465 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); |
| 474 | if ( !input_code_pressed(KEYCODE_S) ) | |
| 466 | if ( !input_code_pressed(screen->machine, KEYCODE_S) ) | |
| 475 | 467 | dleague_draw_sprites(screen->machine,bitmap,cliprect,0); |
| 476 | if ( !input_code_pressed(KEYCODE_D) ) | |
| 468 | if ( !input_code_pressed(screen->machine, KEYCODE_D) ) | |
| 477 | 469 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,1,0,0); |
| 478 | if ( !input_code_pressed(KEYCODE_F) ) | |
| 470 | if ( !input_code_pressed(screen->machine, KEYCODE_F) ) | |
| 479 | 471 | dleague_draw_sprites(screen->machine,bitmap,cliprect,1); |
| 480 | 472 | #else |
| 481 | 473 | TC0080VCO_tilemap_draw(screen->machine,bitmap,cliprect,0,TILEMAP_DRAW_OPAQUE,0); |
| r5613 | r5614 | |
|---|---|---|
| 250 | 250 | layers_ctrl1 = layers_ctrl; |
| 251 | 251 | |
| 252 | 252 | #ifdef MAME_DEBUG |
| 253 | if (input_code_pressed(KEYCODE_Z)) | |
| 253 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 254 | 254 | { |
| 255 | 255 | int msk = 0; |
| 256 | 256 | static int posx,posy; |
| 257 | 257 | |
| 258 | if (input_code_pressed(KEYCODE_Q)) { msk |= 0xfff1;} | |
| 259 | if (input_code_pressed(KEYCODE_W)) { msk |= 0xfff2;} | |
| 260 | if (input_code_pressed(KEYCODE_E)) { msk |= 0xfff4;} | |
| 261 | if (input_code_pressed(KEYCODE_A)) { msk |= 0xfff8;} | |
| 258 | if (input_code_pressed(screen->machine, KEYCODE_Q)) { msk |= 0xfff1;} | |
| 259 | if (input_code_pressed(screen->machine, KEYCODE_W)) { msk |= 0xfff2;} | |
| 260 | if (input_code_pressed(screen->machine, KEYCODE_E)) { msk |= 0xfff4;} | |
| 261 | if (input_code_pressed(screen->machine, KEYCODE_A)) { msk |= 0xfff8;} | |
| 262 | 262 | if (msk != 0) layers_ctrl1 &= msk; |
| 263 | 263 | |
| 264 | 264 | #define SETSCROLL \ |
| r5613 | r5614 | |
| 268 | 268 | tilemap_set_scrolly(fg_tilemap, 0, posy); \ |
| 269 | 269 | popmessage("B>%04X:%04X F>%04X:%04X",posx%(BG_NX*16),posy%(BG_NY*16),posx%(FG_NX*16),posy%(FG_NY*16)); |
| 270 | 270 | |
| 271 | if (input_code_pressed(KEYCODE_L)) { posx +=8; SETSCROLL } | |
| 272 | if (input_code_pressed(KEYCODE_J)) { posx -=8; SETSCROLL } | |
| 273 | if (input_code_pressed(KEYCODE_K)) { posy +=8; SETSCROLL } | |
| 274 | if (input_code_pressed(KEYCODE_I)) { posy -=8; SETSCROLL } | |
| 275 | if (input_code_pressed(KEYCODE_H)) { posx = posy = 0; SETSCROLL } | |
| 271 | if (input_code_pressed(screen->machine, KEYCODE_L)) { posx +=8; SETSCROLL } | |
| 272 | if (input_code_pressed(screen->machine, KEYCODE_J)) { posx -=8; SETSCROLL } | |
| 273 | if (input_code_pressed(screen->machine, KEYCODE_K)) { posy +=8; SETSCROLL } | |
| 274 | if (input_code_pressed(screen->machine, KEYCODE_I)) { posy -=8; SETSCROLL } | |
| 275 | if (input_code_pressed(screen->machine, KEYCODE_H)) { posx = posy = 0; SETSCROLL } | |
| 276 | 276 | |
| 277 | 277 | } |
| 278 | 278 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 520 | 520 | #endif |
| 521 | 521 | |
| 522 | 522 | #ifdef MAME_DEBUG |
| 523 | if (input_code_pressed_once (KEYCODE_Z)) | |
| 523 | if (input_code_pressed_once (screen->machine, KEYCODE_Z)) | |
| 524 | 524 | { |
| 525 | 525 | dislayer[0] ^= 1; |
| 526 | 526 | popmessage("bg0: %01x",dislayer[0]); |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | if (input_code_pressed_once (KEYCODE_X)) | |
| 529 | if (input_code_pressed_once (screen->machine, KEYCODE_X)) | |
| 530 | 530 | { |
| 531 | 531 | dislayer[1] ^= 1; |
| 532 | 532 | popmessage("bg1: %01x",dislayer[1]); |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | if (input_code_pressed_once (KEYCODE_C)) | |
| 535 | if (input_code_pressed_once (screen->machine, KEYCODE_C)) | |
| 536 | 536 | { |
| 537 | 537 | dislayer[2] ^= 1; |
| 538 | 538 | popmessage("bg2: %01x",dislayer[2]); |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | if (input_code_pressed_once (KEYCODE_V)) | |
| 541 | if (input_code_pressed_once (screen->machine, KEYCODE_V)) | |
| 542 | 542 | { |
| 543 | 543 | dislayer[3] ^= 1; |
| 544 | 544 | popmessage("bg3: %01x",dislayer[3]); |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | if (input_code_pressed_once (KEYCODE_B)) | |
| 547 | if (input_code_pressed_once (screen->machine, KEYCODE_B)) | |
| 548 | 548 | { |
| 549 | 549 | dislayer[4] ^= 1; |
| 550 | 550 | popmessage("text: %01x",dislayer[4]); |
| r5613 | r5614 | |
|---|---|---|
| 260 | 260 | { |
| 261 | 261 | #ifdef MAME_DEBUG |
| 262 | 262 | static int k; |
| 263 | if( input_code_pressed( KEYCODE_Q ) ){ | |
| 264 | while( input_code_pressed( KEYCODE_Q ) ){ | |
| 263 | if( input_code_pressed( screen->machine, KEYCODE_Q ) ){ | |
| 264 | while( input_code_pressed( screen->machine, KEYCODE_Q ) ){ | |
| 265 | 265 | k++; |
| 266 | 266 | vsgongf_color = k; |
| 267 | 267 | tilemap_mark_all_tiles_dirty( foreground ); |
| r5613 | r5614 | |
|---|---|---|
| 207 | 207 | { |
| 208 | 208 | COMBINE_DATA(&namcos2_68k_roz_ram[offset]); |
| 209 | 209 | tilemap_mark_tile_dirty(tilemap_roz,offset); |
| 210 | // if( input_code_pressed(KEYCODE_Q) ) | |
| 210 | // if( input_code_pressed(space->machine, KEYCODE_Q) ) | |
| 211 | 211 | // { |
| 212 | 212 | // debugger_break(space->machine); |
| 213 | 213 | // } |
| r5613 | r5614 | |
|---|---|---|
| 1307 | 1307 | K007121_ctrlram[0][0x00],K007121_ctrlram[0][0x01],K007121_ctrlram[0][0x02],K007121_ctrlram[0][0x03],K007121_ctrlram[0][0x04],K007121_ctrlram[0][0x05],K007121_ctrlram[0][0x06],K007121_ctrlram[0][0x07], |
| 1308 | 1308 | K007121_ctrlram[1][0x00],K007121_ctrlram[1][0x01],K007121_ctrlram[1][0x02],K007121_ctrlram[1][0x03],K007121_ctrlram[1][0x04],K007121_ctrlram[1][0x05],K007121_ctrlram[1][0x06],K007121_ctrlram[1][0x07]); |
| 1309 | 1309 | |
| 1310 | if (input_code_pressed(KEYCODE_D)) | |
| 1310 | if (input_code_pressed(gfx->machine, KEYCODE_D)) | |
| 1311 | 1311 | { |
| 1312 | 1312 | FILE *fp; |
| 1313 | 1313 | fp=fopen(chip?"SPRITE1.DMP":"SPRITE0.DMP", "w+b"); |
| r5613 | r5614 | |
| 1646 | 1646 | { |
| 1647 | 1647 | static int current_layer = 0; |
| 1648 | 1648 | |
| 1649 | if (input_code_pressed_once(KEYCODE_Z)) current_layer = !current_layer; | |
| 1649 | if (input_code_pressed_once(machine, KEYCODE_Z)) current_layer = !current_layer; | |
| 1650 | 1650 | tilemap_set_enable(K007342_tilemap[current_layer], 1); |
| 1651 | 1651 | tilemap_set_enable(K007342_tilemap[!current_layer], 0); |
| 1652 | 1652 | |
| r5613 | r5614 | |
| 1855 | 1855 | { |
| 1856 | 1856 | static int current_sprite = 0; |
| 1857 | 1857 | |
| 1858 | if (input_code_pressed_once(KEYCODE_Z)) current_sprite = (current_sprite+1) & ((K007420_SPRITERAM_SIZE/8)-1); | |
| 1859 | if (input_code_pressed_once(KEYCODE_X)) current_sprite = (current_sprite-1) & ((K007420_SPRITERAM_SIZE/8)-1); | |
| 1858 | if (input_code_pressed_once(machine, KEYCODE_Z)) current_sprite = (current_sprite+1) & ((K007420_SPRITERAM_SIZE/8)-1); | |
| 1859 | if (input_code_pressed_once(machine, KEYCODE_X)) current_sprite = (current_sprite-1) & ((K007420_SPRITERAM_SIZE/8)-1); | |
| 1860 | 1860 | |
| 1861 | 1861 | popmessage("%02x:%02x %02x %02x %02x %02x %02x %02x %02x", current_sprite, |
| 1862 | 1862 | K007420_ram[(current_sprite*8)+0], K007420_ram[(current_sprite*8)+1], |
| r5613 | r5614 | |
| 2414 | 2414 | (K052109_scrollctrl & 0xc0) != 0) |
| 2415 | 2415 | popmessage("scrollcontrol = %02x",K052109_scrollctrl); |
| 2416 | 2416 | |
| 2417 | if (input_code_pressed(KEYCODE_F)) | |
| 2417 | if (input_code_pressed(machine, KEYCODE_F)) | |
| 2418 | 2418 | { |
| 2419 | 2419 | FILE *fp; |
| 2420 | 2420 | fp=fopen("TILE.DMP", "w+b"); |
| r5613 | r5614 | |
| 2872 | 2872 | } |
| 2873 | 2873 | } |
| 2874 | 2874 | #if 0 |
| 2875 | if (input_code_pressed(KEYCODE_D)) | |
| 2875 | if (input_code_pressed(machine, KEYCODE_D)) | |
| 2876 | 2876 | { |
| 2877 | 2877 | FILE *fp; |
| 2878 | 2878 | fp=fopen("SPRITE.DMP", "w+b"); |
| r5613 | r5614 | |
| 3440 | 3440 | } |
| 3441 | 3441 | } |
| 3442 | 3442 | #if 0 |
| 3443 | if (input_code_pressed(KEYCODE_D)) | |
| 3443 | if (input_code_pressed(machine, KEYCODE_D)) | |
| 3444 | 3444 | { |
| 3445 | 3445 | FILE *fp; |
| 3446 | 3446 | fp=fopen("SPRITE.DMP", "w+b"); |
| r5613 | r5614 | |
| 3677 | 3677 | } |
| 3678 | 3678 | } |
| 3679 | 3679 | #if 0 |
| 3680 | if (input_code_pressed(KEYCODE_D)) | |
| 3680 | if (input_code_pressed(machine, KEYCODE_D)) | |
| 3681 | 3681 | { |
| 3682 | 3682 | FILE *fp; |
| 3683 | 3683 | fp=fopen("SPRITE.DMP", "w+b"); |
| r5613 | r5614 | |
| 5013 | 5013 | } |
| 5014 | 5014 | |
| 5015 | 5015 | #if 0 |
| 5016 | if (input_code_pressed(KEYCODE_D)) | |
| 5016 | if (input_code_pressed(machine, KEYCODE_D)) | |
| 5017 | 5017 | popmessage("%04x %04x %04x %04x\n%04x %04x %04x %04x\n%04x %04x %04x %04x\n%04x %04x %04x %04x", |
| 5018 | 5018 | ctrl[0x00], |
| 5019 | 5019 | ctrl[0x01], |
| r5613 | r5614 | |
| 7844 | 7844 | if(chip && ++kk == 3) { |
| 7845 | 7845 | int kx=0, kkc = 0; |
| 7846 | 7846 | kk = 0; |
| 7847 | if(input_code_pressed(KEYCODE_Y)) { | |
| 7847 | if(input_code_pressed(machine, KEYCODE_Y)) { | |
| 7848 | 7848 | kx = 1; |
| 7849 | 7849 | kc--; |
| 7850 | 7850 | if(kc<-1) |
| 7851 | 7851 | kc = 511; |
| 7852 | 7852 | } |
| 7853 | if(input_code_pressed(KEYCODE_U)) { | |
| 7853 | if(input_code_pressed(machine, KEYCODE_U)) { | |
| 7854 | 7854 | kx = 1; |
| 7855 | 7855 | kc++; |
| 7856 | 7856 | if(kc==512) |
| 7857 | 7857 | kc = -1; |
| 7858 | 7858 | } |
| 7859 | 7859 | |
| 7860 | if(input_code_pressed(KEYCODE_T)) { | |
| 7860 | if(input_code_pressed(machine, KEYCODE_T)) { | |
| 7861 | 7861 | kkc = 1; |
| 7862 | 7862 | kyy--; |
| 7863 | 7863 | } |
| 7864 | if(input_code_pressed(KEYCODE_V)) { | |
| 7864 | if(input_code_pressed(machine, KEYCODE_V)) { | |
| 7865 | 7865 | kkc = 1; |
| 7866 | 7866 | kyy++; |
| 7867 | 7867 | } |
| 7868 | if(input_code_pressed(KEYCODE_F)) { | |
| 7868 | if(input_code_pressed(machine, KEYCODE_F)) { | |
| 7869 | 7869 | kkc = 1; |
| 7870 | 7870 | kxx--; |
| 7871 | 7871 | } |
| 7872 | if(input_code_pressed(KEYCODE_G)) { | |
| 7872 | if(input_code_pressed(machine, KEYCODE_G)) { | |
| 7873 | 7873 | kkc = 1; |
| 7874 | 7874 | kxx++; |
| 7875 | 7875 | } |
| r5613 | r5614 | |
|---|---|---|
| 230 | 230 | tilemap_set_scrollx( tilemap_1, 0, blmbycar_scroll_1[ 1 ]+5); |
| 231 | 231 | |
| 232 | 232 | #ifdef MAME_DEBUG |
| 233 | if (input_code_pressed(KEYCODE_Z)) | |
| 233 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 234 | 234 | { |
| 235 | 235 | int msk = 0; |
| 236 | 236 | |
| 237 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 238 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 239 | // if (input_code_pressed(KEYCODE_E)) msk |= 4; | |
| 240 | if (input_code_pressed(KEYCODE_A)) msk |= 8; | |
| 237 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 238 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 239 | // if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= 4; | |
| 240 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 8; | |
| 241 | 241 | if (msk != 0) layers_ctrl &= msk; |
| 242 | 242 | } |
| 243 | 243 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 58 | 58 | |
| 59 | 59 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1], |
| 60 | 60 | spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8), |
| 61 | (spriteram[offs+1] & 0x | |
| 61 | (spriteram[offs+1] & 0xf0) >> 4, | |
| 62 | 62 | flipx,flipy, |
| 63 | 63 | sx,sy,0); |
| 64 | 64 | } |
| r5613 | r5614 | |
|---|---|---|
| 125 | 125 | #endif |
| 126 | 126 | |
| 127 | 127 | #ifdef MAME_DEBUG |
| 128 | if (input_code_pressed_once (KEYCODE_V)) | |
| 128 | if (input_code_pressed_once (screen->machine, KEYCODE_V)) | |
| 129 | 129 | { |
| 130 | 130 | dislayer[0] ^= 1; |
| 131 | 131 | popmessage("bg: %01x",dislayer[0]); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | if (input_code_pressed_once (KEYCODE_B)) | |
| 134 | if (input_code_pressed_once (screen->machine, KEYCODE_B)) | |
| 135 | 135 | { |
| 136 | 136 | dislayer[1] ^= 1; |
| 137 | 137 | popmessage("fg: %01x",dislayer[1]); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | if (input_code_pressed_once (KEYCODE_N)) | |
| 140 | if (input_code_pressed_once (screen->machine, KEYCODE_N)) | |
| 141 | 141 | { |
| 142 | 142 | dislayer[2] ^= 1; |
| 143 | 143 | popmessage("bg2: %01x",dislayer[2]); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | if (input_code_pressed_once (KEYCODE_M)) | |
| 146 | if (input_code_pressed_once (screen->machine, KEYCODE_M)) | |
| 147 | 147 | { |
| 148 | 148 | dislayer[3] ^= 1; |
| 149 | 149 | popmessage("fg2: %01x",dislayer[3]); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | if (input_code_pressed_once (KEYCODE_C)) | |
| 152 | if (input_code_pressed_once (screen->machine, KEYCODE_C)) | |
| 153 | 153 | { |
| 154 | 154 | dislayer[4] ^= 1; |
| 155 | 155 | popmessage("sprites: %01x",dislayer[4]); |
| r5613 | r5614 | |
|---|---|---|
| 234 | 234 | sprites as pdrawgfx cannot yet cope with more than 4 layers */ |
| 235 | 235 | |
| 236 | 236 | #ifdef MAME_DEBUG |
| 237 | if (!input_code_pressed (KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); | |
| 238 | if (!input_code_pressed (KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); | |
| 239 | if (!input_code_pressed (KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); | |
| 240 | if (!input_code_pressed (KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); | |
| 241 | if (!input_code_pressed (KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); | |
| 242 | if (!input_code_pressed (KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); | |
| 237 | if (!input_code_pressed (screen->machine, KEYCODE_Z)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); | |
| 238 | if (!input_code_pressed (screen->machine, KEYCODE_X)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); | |
| 239 | if (!input_code_pressed (screen->machine, KEYCODE_C)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[2],0,2); | |
| 240 | if (!input_code_pressed (screen->machine, KEYCODE_V)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[3],0,4); | |
| 241 | if (!input_code_pressed (screen->machine, KEYCODE_B)) TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[4],0,8); | |
| 242 | if (!input_code_pressed (screen->machine, KEYCODE_N)) draw_sprites(screen->machine,bitmap,cliprect,primasks,48,-116); | |
| 243 | 243 | #else |
| 244 | 244 | TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[0],TILEMAP_DRAW_OPAQUE,0); |
| 245 | 245 | TC0480SCP_tilemap_draw(screen->machine,bitmap,cliprect,layer[1],0,1); |
| r5613 | r5614 | |
|---|---|---|
| 297 | 297 | |
| 298 | 298 | /* bit 4 is sound enable */ |
| 299 | 299 | if (!(data & 0x10) && (control & 0x10)) |
| 300 | devtag_reset(space->machine, "ay"); | |
| 300 | devtag_reset(space->machine, "ay1"); | |
| 301 | 301 | |
| 302 | sound_global_enable(data & 0x10); | |
| 302 | sound_global_enable(space->machine, data & 0x10); | |
| 303 | 303 | |
| 304 | 304 | /* bit 6 is search light enable */ |
| 305 | 305 | sl_enable = data & 0x40; |
| r5613 | r5614 | |
|---|---|---|
| 954 | 954 | /* configure the layer */ |
| 955 | 955 | opaque = 0; |
| 956 | 956 | //opaque = (system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1; |
| 957 | //if (input_code_pressed(KEYCODE_Z) && bgnum == 0) opaque = 1; | |
| 958 | //if (input_code_pressed(KEYCODE_X) && bgnum == 1) opaque = 1; | |
| 957 | //if (input_code_pressed(screen->machine, KEYCODE_Z) && bgnum == 0) opaque = 1; | |
| 958 | //if (input_code_pressed(screen->machine, KEYCODE_X) && bgnum == 1) opaque = 1; | |
| 959 | 959 | |
| 960 | 960 | /* determine if we're flipped */ |
| 961 | 961 | flip = ((system32_videoram[0x1ff00/2] >> 9) ^ (system32_videoram[0x1ff00/2] >> bgnum)) & 1; |
| r5613 | r5614 | |
| 1108 | 1108 | /* configure the layer */ |
| 1109 | 1109 | opaque = 0; |
| 1110 | 1110 | //opaque = (system32_videoram[0x1ff8e/2] >> (8 + bgnum)) & 1; |
| 1111 | //if (input_code_pressed(KEYCODE_C) && bgnum == 2) opaque = 1; | |
| 1112 | //if (input_code_pressed(KEYCODE_V) && bgnum == 3) opaque = 1; | |
| 1111 | //if (input_code_pressed(screen->machine, KEYCODE_C) && bgnum == 2) opaque = 1; | |
| 1112 | //if (input_code_pressed(screen->machine, KEYCODE_V) && bgnum == 3) opaque = 1; | |
| 1113 | 1113 | |
| 1114 | 1114 | /* determine if we're flipped */ |
| 1115 | 1115 | flip = ((system32_videoram[0x1ff00/2] >> 9) ^ (system32_videoram[0x1ff00/2] >> bgnum)) & 1; |
| r5613 | r5614 | |
| 2466 | 2466 | |
| 2467 | 2467 | /* debugging */ |
| 2468 | 2468 | #if QWERTY_LAYER_ENABLE |
| 2469 | if (input_code_pressed(KEYCODE_Q)) enablemask = 0x01; | |
| 2470 | if (input_code_pressed(KEYCODE_W)) enablemask = 0x02; | |
| 2471 | if (input_code_pressed(KEYCODE_E)) enablemask = 0x04; | |
| 2472 | if (input_code_pressed(KEYCODE_R)) enablemask = 0x08; | |
| 2473 | if (input_code_pressed(KEYCODE_T)) enablemask = 0x10; | |
| 2474 | if (input_code_pressed(KEYCODE_Y)) enablemask = 0x20; | |
| 2469 | if (input_code_pressed(screen->machine, KEYCODE_Q)) enablemask = 0x01; | |
| 2470 | if (input_code_pressed(screen->machine, KEYCODE_W)) enablemask = 0x02; | |
| 2471 | if (input_code_pressed(screen->machine, KEYCODE_E)) enablemask = 0x04; | |
| 2472 | if (input_code_pressed(screen->machine, KEYCODE_R)) enablemask = 0x08; | |
| 2473 | if (input_code_pressed(screen->machine, KEYCODE_T)) enablemask = 0x10; | |
| 2474 | if (input_code_pressed(screen->machine, KEYCODE_Y)) enablemask = 0x20; | |
| 2475 | 2475 | #endif |
| 2476 | 2476 | |
| 2477 | 2477 | /* do the mixing */ |
| r5613 | r5614 | |
| 2479 | 2479 | mix_all_layers(0, 0, bitmap, cliprect, enablemask); |
| 2480 | 2480 | profiler_mark_end(); |
| 2481 | 2481 | |
| 2482 | if (LOG_SPRITES && input_code_pressed(KEYCODE_L)) | |
| 2482 | if (LOG_SPRITES && input_code_pressed(screen->machine, KEYCODE_L)) | |
| 2483 | 2483 | { |
| 2484 | 2484 | const rectangle *visarea = video_screen_get_visible_area(screen); |
| 2485 | 2485 | FILE *f = fopen("sprite.txt", "w"); |
| r5613 | r5614 | |
| 2557 | 2557 | { |
| 2558 | 2558 | int showclip = -1; |
| 2559 | 2559 | |
| 2560 | // if (input_code_pressed(KEYCODE_V)) | |
| 2560 | // if (input_code_pressed(screen->machine, KEYCODE_V)) | |
| 2561 | 2561 | // showclip = 0; |
| 2562 | // if (input_code_pressed(KEYCODE_B)) | |
| 2562 | // if (input_code_pressed(screen->machine, KEYCODE_B)) | |
| 2563 | 2563 | // showclip = 1; |
| 2564 | // if (input_code_pressed(KEYCODE_N)) | |
| 2564 | // if (input_code_pressed(screen->machine, KEYCODE_N)) | |
| 2565 | 2565 | // showclip = 2; |
| 2566 | // if (input_code_pressed(KEYCODE_M)) | |
| 2566 | // if (input_code_pressed(screen->machine, KEYCODE_M)) | |
| 2567 | 2567 | // showclip = 3; |
| 2568 | 2568 | // if (showclip != -1) |
| 2569 | 2569 | for (showclip = 0; showclip < 4; showclip++) |
| r5613 | r5614 | |
| 2646 | 2646 | |
| 2647 | 2647 | /* debugging */ |
| 2648 | 2648 | #if QWERTY_LAYER_ENABLE |
| 2649 | if (input_code_pressed(KEYCODE_Q)) enablemask = 0x01; | |
| 2650 | if (input_code_pressed(KEYCODE_W)) enablemask = 0x02; | |
| 2651 | if (input_code_pressed(KEYCODE_E)) enablemask = 0x04; | |
| 2652 | if (input_code_pressed(KEYCODE_R)) enablemask = 0x08; | |
| 2653 | if (input_code_pressed(KEYCODE_T)) enablemask = 0x10; | |
| 2654 | if (input_code_pressed(KEYCODE_Y)) enablemask = 0x20; | |
| 2649 | if (input_code_pressed(screen->machine, KEYCODE_Q)) enablemask = 0x01; | |
| 2650 | if (input_code_pressed(screen->machine, KEYCODE_W)) enablemask = 0x02; | |
| 2651 | if (input_code_pressed(screen->machine, KEYCODE_E)) enablemask = 0x04; | |
| 2652 | if (input_code_pressed(screen->machine, KEYCODE_R)) enablemask = 0x08; | |
| 2653 | if (input_code_pressed(screen->machine, KEYCODE_T)) enablemask = 0x10; | |
| 2654 | if (input_code_pressed(screen->machine, KEYCODE_Y)) enablemask = 0x20; | |
| 2655 | 2655 | #endif |
| 2656 | 2656 | |
| 2657 | 2657 | /* do the mixing */ |
| r5613 | r5614 | |
| 2661 | 2661 | |
| 2662 | 2662 | if (PRINTF_MIXER_DATA) |
| 2663 | 2663 | { |
| 2664 | if (!input_code_pressed(KEYCODE_M)) print_mixer_data(0); | |
| 2664 | if (!input_code_pressed(screen->machine, KEYCODE_M)) print_mixer_data(0); | |
| 2665 | 2665 | else print_mixer_data(1); |
| 2666 | 2666 | } |
| 2667 | if (LOG_SPRITES && input_code_pressed(KEYCODE_L)) | |
| 2667 | if (LOG_SPRITES && input_code_pressed(screen->machine, KEYCODE_L)) | |
| 2668 | 2668 | { |
| 2669 | 2669 | const rectangle *visarea = video_screen_get_visible_area(screen); |
| 2670 | 2670 | FILE *f = fopen("sprite.txt", "w"); |
| r5613 | r5614 | |
|---|---|---|
| 132 | 132 | slapfight_palette_bank = offset; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | #ifdef MAME_DEBUG | |
| 136 | static void slapfght_log_vram(void) | |
| 135 | static void slapfght_log_vram(running_machine *machine) | |
| 137 | 136 | { |
| 138 | if ( input_code_pressed_once(KEYCODE_B) ) | |
| 137 | #ifdef MAME_DEBUG | |
| 138 | if ( input_code_pressed_once(machine, KEYCODE_B) ) | |
| 139 | 139 | { |
| 140 | 140 | int i; |
| 141 | 141 | for (i=0; i<0x800; i++) |
| r5613 | r5614 | |
| 143 | 143 | logerror("Offset:%03x TileRAM:%02x AttribRAM:%02x SpriteRAM:%02x\n",i, videoram[i],colorram[i],spriteram[i]); |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | } | |
| 147 | 146 | #endif |
| 147 | } | |
| 148 | 148 | |
| 149 | 149 | /*************************************************************************** |
| 150 | 150 | |
| r5613 | r5614 | |
| 199 | 199 | tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0); |
| 200 | 200 | draw_sprites(screen->machine, bitmap,cliprect,0x80); |
| 201 | 201 | |
| 202 | #ifdef MAME_DEBUG | |
| 203 | slapfght_log_vram(); | |
| 204 | #endif | |
| 202 | slapfght_log_vram(screen->machine); | |
| 205 | 203 | return 0; |
| 206 | 204 | } |
| 207 | 205 | |
| r5613 | r5614 | |
| 245 | 243 | |
| 246 | 244 | tilemap_draw(bitmap,cliprect,fix_tilemap,0,0); |
| 247 | 245 | |
| 248 | #ifdef MAME_DEBUG | |
| 249 | slapfght_log_vram(); | |
| 250 | #endif | |
| 246 | slapfght_log_vram(screen->machine); | |
| 251 | 247 | return 0; |
| 252 | 248 | } |
| r5613 | r5614 | |
|---|---|---|
| 1051 | 1051 | |
| 1052 | 1052 | #if 0 |
| 1053 | 1053 | #ifdef MAME_DEBUG |
| 1054 | if (input_code_pressed(KEYCODE_Z)) /* Display some info on each sprite */ | |
| 1054 | if (input_code_pressed(machine, KEYCODE_Z)) /* Display some info on each sprite */ | |
| 1055 | 1055 | { |
| 1056 | 1056 | char buf[10]; |
| 1057 | 1057 | int x, y; |
| r5613 | r5614 | |
|---|---|---|
| 537 | 537 | #ifdef MAME_DEBUG |
| 538 | 538 | { |
| 539 | 539 | static int showmsg; |
| 540 | if (input_code_pressed_once(KEYCODE_I)) | |
| 540 | if (input_code_pressed_once(screen->machine, KEYCODE_I)) | |
| 541 | 541 | showmsg ^= 1; |
| 542 | 542 | if (showmsg) |
| 543 | 543 | popmessage("mode:$%02x cm:$%02x ccb:$%02x h:$%02x vl:$%02x vr:$%02x ph:$%02x pv:$%02x ch:$%02x cv:$%02x", |
| r5613 | r5614 | |
|---|---|---|
| 493 | 493 | { |
| 494 | 494 | const pen_t *paldata = screen->machine->pens; |
| 495 | 495 | |
| 496 | if ( input_code_pressed(KEYCODE_W) ) | |
| 496 | if ( input_code_pressed(screen->machine, KEYCODE_W) ) | |
| 497 | 497 | { |
| 498 | 498 | int y,x; |
| 499 | 499 |
| r5613 | r5614 | |
|---|---|---|
| 223 | 223 | |
| 224 | 224 | #ifdef MAME_DEBUG |
| 225 | 225 | #if 0 |
| 226 | if (input_code_pressed(KEYCODE_X)) | |
| 226 | if (input_code_pressed(screen->machine, KEYCODE_X)) | |
| 227 | 227 | { /* Display some info on each sprite */ |
| 228 | 228 | char buf[40]; |
| 229 | 229 | sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3); |
| r5613 | r5614 | |
|---|---|---|
| 38 | 38 | enum |
| 39 | 39 | { |
| 40 | 40 | // user-defined priorities |
| 41 | TWIN16_BG_LAYER1 = 0x01, | |
| 41 | TWIN16_BG_LAYER1 = 0x01, | |
| 42 | 42 | TWIN16_SPRITE_PRI_L1 = 0x02, |
| 43 | TWIN16_BG_LAYER2 = 0x04, | |
| 43 | TWIN16_BG_LAYER2 = 0x04, | |
| 44 | 44 | TWIN16_SPRITE_PRI_L2 = 0x08, |
| 45 | 45 | TWIN16_SPRITE_OCCUPIED = 0x10, // sprite on screen pixel |
| 46 | 46 | TWIN16_SPRITE_CAST_SHADOW = 0x20 |
| r5613 | r5614 | |
| 497 | 497 | text_tilemap = tilemap_create(machine, get_text_tile_info, tilemap_scan_rows, 8, 8, 64, 32); |
| 498 | 498 | tilemap_set_transparent_pen(text_tilemap, 0); |
| 499 | 499 | |
| 500 | palette_set_shadow_factor(machine,0.4); // screenshots estimate | |
| 501 | ||
| 500 | 502 | memset(twin16_sprite_buffer,0xff,0x800*sizeof(UINT16)); |
| 501 | 503 | twin16_sprite_busy = 0; |
| 502 | 504 | twin16_sprite_timer = timer_alloc(machine, twin16_sprite_tick, NULL); |
| r5613 | r5614 | |
|---|---|---|
| 1491 | 1491 | #ifdef MAME_DEBUG |
| 1492 | 1492 | { |
| 1493 | 1493 | static int rasflag, old_rasflag; |
| 1494 | if ( input_code_pressed(KEYCODE_Z) || input_code_pressed(KEYCODE_X) || input_code_pressed(KEYCODE_C) || | |
| 1495 | input_code_pressed(KEYCODE_V) || input_code_pressed(KEYCODE_B) ) | |
| 1494 | if ( input_code_pressed(screen->machine, KEYCODE_Z) || input_code_pressed(screen->machine, KEYCODE_X) || input_code_pressed(screen->machine, KEYCODE_C) || | |
| 1495 | input_code_pressed(screen->machine, KEYCODE_V) || input_code_pressed(screen->machine, KEYCODE_B) ) | |
| 1496 | 1496 | { |
| 1497 | 1497 | int msk = 0, val = 0; |
| 1498 | 1498 | |
| 1499 | if (input_code_pressed(KEYCODE_X)) val = 1; // priority 0 only | |
| 1500 | if (input_code_pressed(KEYCODE_C)) val = 2; // "" 1 | |
| 1501 | if (input_code_pressed(KEYCODE_V)) val = 4; // "" 2 | |
| 1502 | if (input_code_pressed(KEYCODE_B)) val = 8; // "" 3 | |
| 1499 | if (input_code_pressed(screen->machine, KEYCODE_X)) val = 1; // priority 0 only | |
| 1500 | if (input_code_pressed(screen->machine, KEYCODE_C)) val = 2; // "" 1 | |
| 1501 | if (input_code_pressed(screen->machine, KEYCODE_V)) val = 4; // "" 2 | |
| 1502 | if (input_code_pressed(screen->machine, KEYCODE_B)) val = 8; // "" 3 | |
| 1503 | 1503 | |
| 1504 | if (input_code_pressed(KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities | |
| 1504 | if (input_code_pressed(screen->machine, KEYCODE_Z)) val = 1|2|4|8; // All of the above priorities | |
| 1505 | 1505 | |
| 1506 | if (input_code_pressed(KEYCODE_Q)) msk |= val << 0; // for layer 0 | |
| 1507 | if (input_code_pressed(KEYCODE_W)) msk |= val << 4; // for layer 1 | |
| 1508 | if (input_code_pressed(KEYCODE_E)) msk |= val << 8; // for layer 2 | |
| 1509 | if (input_code_pressed(KEYCODE_R)) msk |= val << 12; // for layer 3 | |
| 1510 | if (input_code_pressed(KEYCODE_A)) msk |= val << 16; // for sprites | |
| 1506 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= val << 0; // for layer 0 | |
| 1507 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= val << 4; // for layer 1 | |
| 1508 | if (input_code_pressed(screen->machine, KEYCODE_E)) msk |= val << 8; // for layer 2 | |
| 1509 | if (input_code_pressed(screen->machine, KEYCODE_R)) msk |= val << 12; // for layer 3 | |
| 1510 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= val << 16; // for sprites | |
| 1511 | 1511 | if (msk != 0) layers_ctrl &= msk; |
| 1512 | 1512 | |
| 1513 | 1513 | #if 1 |
| r5613 | r5614 | |
|---|---|---|
| 223 | 223 | else { ystart = 0; yend = ynum; yinc = +1; } |
| 224 | 224 | |
| 225 | 225 | #if 0 |
| 226 | if(!( (input_code_pressed(KEYCODE_V) && (((attr >> 6)&3) == 0)) | |
| 227 | || (input_code_pressed(KEYCODE_B) && (((attr >> 6)&3) == 1)) | |
| 228 | || (input_code_pressed(KEYCODE_N) && (((attr >> 6)&3) == 2)) | |
| 229 | || (input_code_pressed(KEYCODE_M) && (((attr >> 6)&3) == 3)) | |
| 226 | if(!( (input_code_pressed(screen->machine, KEYCODE_V) && (((attr >> 6)&3) == 0)) | |
| 227 | || (input_code_pressed(screen->machine, KEYCODE_B) && (((attr >> 6)&3) == 1)) | |
| 228 | || (input_code_pressed(screen->machine, KEYCODE_N) && (((attr >> 6)&3) == 2)) | |
| 229 | || (input_code_pressed(screen->machine, KEYCODE_M) && (((attr >> 6)&3) == 3)) | |
| 230 | 230 | )) |
| 231 | 231 | #endif |
| 232 | 232 | |
| r5613 | r5614 | |
| 255 | 255 | |
| 256 | 256 | #ifdef MAME_DEBUG |
| 257 | 257 | #if 0 |
| 258 | if (input_code_pressed(KEYCODE_X)) | |
| 258 | if (input_code_pressed(screen->machine, KEYCODE_X)) | |
| 259 | 259 | { /* Display some info on each sprite */ |
| 260 | 260 | char buf[40]; |
| 261 | 261 | sprintf(buf, "%Xx%X %X",xnum,ynum,(attr>>6)&3); |
| r5613 | r5614 | |
|---|---|---|
| 15 | 15 | static void sprite_callback(int *code,int *color,int *priority_mask) |
| 16 | 16 | { |
| 17 | 17 | #if 0 |
| 18 | if (input_code_pressed(KEYCODE_Q) && (*color & 0x80)) *color = rand(); | |
| 19 | if (input_code_pressed(KEYCODE_W) && (*color & 0x40)) *color = rand(); | |
| 20 | if (input_code_pressed(KEYCODE_E) && (*color & 0x20)) *color = rand(); | |
| 21 | if (input_code_pressed(KEYCODE_R) && (*color & 0x10)) *color = rand(); | |
| 18 | if (input_code_pressed(machine, KEYCODE_Q) && (*color & 0x80)) *color = rand(); | |
| 19 | if (input_code_pressed(machine, KEYCODE_W) && (*color & 0x40)) *color = rand(); | |
| 20 | if (input_code_pressed(machine, KEYCODE_E) && (*color & 0x20)) *color = rand(); | |
| 21 | if (input_code_pressed(machine, KEYCODE_R) && (*color & 0x10)) *color = rand(); | |
| 22 | 22 | #endif |
| 23 | 23 | *priority_mask = (*color & 0x10) ? 0 : 0x02; |
| 24 | 24 | *color = sprite_colorbase + (*color & 0x0f); |
| r5613 | r5614 | |
|---|---|---|
| 192 | 192 | vdppri = (vdp_mixing & 1) ? (1 << vdplayer) : 0; |
| 193 | 193 | |
| 194 | 194 | #if DEBUG_VDP |
| 195 | if (input_code_pressed(KEYCODE_Q)) vdplayer = 0; | |
| 196 | if (input_code_pressed(KEYCODE_W)) vdplayer = 1; | |
| 197 | if (input_code_pressed(KEYCODE_E)) vdplayer = 2; | |
| 198 | if (input_code_pressed(KEYCODE_R)) vdplayer = 3; | |
| 199 | if (input_code_pressed(KEYCODE_A)) vdppri = 0x00; | |
| 200 | if (input_code_pressed(KEYCODE_S)) vdppri = 0x01; | |
| 201 | if (input_code_pressed(KEYCODE_D)) vdppri = 0x02; | |
| 202 | if (input_code_pressed(KEYCODE_F)) vdppri = 0x04; | |
| 203 | if (input_code_pressed(KEYCODE_G)) vdppri = 0x08; | |
| 195 | if (input_code_pressed(screen->machine, KEYCODE_Q)) vdplayer = 0; | |
| 196 | if (input_code_pressed(screen->machine, KEYCODE_W)) vdplayer = 1; | |
| 197 | if (input_code_pressed(screen->machine, KEYCODE_E)) vdplayer = 2; | |
| 198 | if (input_code_pressed(screen->machine, KEYCODE_R)) vdplayer = 3; | |
| 199 | if (input_code_pressed(screen->machine, KEYCODE_A)) vdppri = 0x00; | |
| 200 | if (input_code_pressed(screen->machine, KEYCODE_S)) vdppri = 0x01; | |
| 201 | if (input_code_pressed(screen->machine, KEYCODE_D)) vdppri = 0x02; | |
| 202 | if (input_code_pressed(screen->machine, KEYCODE_F)) vdppri = 0x04; | |
| 203 | if (input_code_pressed(screen->machine, KEYCODE_G)) vdppri = 0x08; | |
| 204 | 204 | #endif |
| 205 | 205 | |
| 206 | 206 | /* if no drawing is happening, fill with black and get out */ |
| r5613 | r5614 | |
| 241 | 241 | segaic16_sprites_draw(screen, bitmap, cliprect, 0); |
| 242 | 242 | |
| 243 | 243 | #if DEBUG_VDP |
| 244 | if (vdp_enable && input_code_pressed(KEYCODE_V)) | |
| 244 | if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_V)) | |
| 245 | 245 | { |
| 246 | 246 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 247 | 247 | update_system18_vdp(bitmap, cliprect); |
| 248 | 248 | } |
| 249 | if (vdp_enable && input_code_pressed(KEYCODE_B)) | |
| 249 | if (vdp_enable && input_code_pressed(screen->machine, KEYCODE_B)) | |
| 250 | 250 | { |
| 251 | 251 | FILE *f = fopen("vdp.bin", "w"); |
| 252 | 252 | fwrite(tempbitmap->base, 1, tempbitmap->rowpixels * (tempbitmap->bpp / 8) * tempbitmap->height, f); |
| r5613 | r5614 | |
|---|---|---|
| 99 | 99 | |
| 100 | 100 | draw_sprites(screen->machine,bitmap,cliprect); |
| 101 | 101 | |
| 102 | /* | |
| 103 | if ( input_code_pressed_once(KEYCODE_W) ) | |
| 104 | { | |
| 105 | FILE *fp; | |
| 102 | #if 0 | |
| 103 | if ( input_code_pressed_once(screen->machine, KEYCODE_W) ) | |
| 104 | { | |
| 105 | FILE *fp; | |
| 106 | 106 | |
| 107 | fp=fopen("funnybubsprites", "w+b"); | |
| 108 | if (fp) | |
| 109 | { | |
| 110 | fwrite(&funybubl_banked_videoram[0x1000], 0x1000, 1, fp); | |
| 111 | fclose(fp); | |
| 112 | } | |
| 113 | } | |
| 114 | */ | |
| 107 | fp=fopen("funnybubsprites", "w+b"); | |
| 108 | if (fp) | |
| 109 | { | |
| 110 | fwrite(&funybubl_banked_videoram[0x1000], 0x1000, 1, fp); | |
| 111 | fclose(fp); | |
| 112 | } | |
| 113 | } | |
| 114 | #endif | |
| 115 | 115 | return 0; |
| 116 | 116 | } |
| r5613 | r5614 | |
|---|---|---|
| 329 | 329 | tilemap_set_scrolly(bg_tilemap0,0,scroll[2] * 256 + (scroll[3] >> 8)); |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | WRITE16_HANDLER( vandykeb_scroll_w ) | |
| 333 | { | |
| 334 | static UINT16 scroll[8]; | |
| 335 | ||
| 336 | COMBINE_DATA(&scroll[offset]); | |
| 337 | ||
| 338 | tilemap_set_scrollx(bg_tilemap0,0,scroll[6] * 256 + (scroll[5] >> 8)); | |
| 339 | tilemap_set_scrolly(bg_tilemap0,0,scroll[1] * 256 + (scroll[0] >> 8)); | |
| 340 | } | |
| 341 | ||
| 332 | 342 | WRITE16_HANDLER( manybloc_scroll_w ) |
| 333 | 343 | { |
| 334 | 344 | COMBINE_DATA(&gunnail_scrollram[offset]); |
| r5613 | r5614 | |
|---|---|---|
| 6 | 6 | </led7seg> |
| 7 | 7 | </element> |
| 8 | 8 | <element name="play" defstate="0"> |
| 9 | < | |
| 9 | <text string="PLAY" state="1"> | |
| 10 | 10 | <color red="1.0" green="1.0" blue="1.0" /> |
| 11 | </rect> | |
| 12 | <text string="PLAY" state="1"> | |
| 13 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 14 | 11 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 15 | 12 | </text> |
| 16 | 13 | </element> |
| 17 | 14 | <element name="pass" defstate="0"> |
| 18 | < | |
| 15 | <text string="PASS" state="1"> | |
| 19 | 16 | <color red="1.0" green="1.0" blue="1.0" /> |
| 20 | </rect> | |
| 21 | <text string="PASS" state="1"> | |
| 22 | <color red="0.0" green="0.0" blue="0.0" /> | |
| 23 | 17 | <bounds x="0" y="0.1" width="1" height="0.8" /> |
| 24 | 18 | </text> |
| 25 | 19 | </element> |
| r5613 | r5614 | |
| 117 | 111 | </text> |
| 118 | 112 | </element> |
| 119 | 113 | |
| 114 | <element name="20p" defstate="0"> | |
| 115 | <text string="20p" state="0"> | |
| 116 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 117 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 118 | </text> | |
| 119 | <text string="20p" state="1"> | |
| 120 | <color red="1.0" green="1.0" blue="0.0" /> | |
| 121 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 122 | </text> | |
| 123 | </element> | |
| 124 | ||
| 125 | <element name="50p" defstate="0"> | |
| 126 | <text string="50p" state="0"> | |
| 127 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 128 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 129 | </text> | |
| 130 | <text string="50p" state="1"> | |
| 131 | <color red="1.0" green="1.0" blue="0.0" /> | |
| 132 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 133 | </text> | |
| 134 | </element> | |
| 135 | ||
| 136 | <element name="100p" defstate="0"> | |
| 137 | <text string="100p" state="0"> | |
| 138 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 139 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 140 | </text> | |
| 141 | <text string="100p" state="1"> | |
| 142 | <color red="1.0" green="1.0" blue="0.0" /> | |
| 143 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 144 | </text> | |
| 145 | </element> | |
| 146 | ||
| 147 | <element name="200p" defstate="0"> | |
| 148 | <text string="200p" state="0"> | |
| 149 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 150 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 151 | </text> | |
| 152 | <text string="200p" state="1"> | |
| 153 | <color red="1.0" green="1.0" blue="0.0" /> | |
| 154 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 155 | </text> | |
| 156 | </element> | |
| 157 | ||
| 158 | <element name="500p" defstate="0"> | |
| 159 | <text string="500p" state="0"> | |
| 160 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 161 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 162 | </text> | |
| 163 | <text string="500p" state="1"> | |
| 164 | <color red="1.0" green="1.0" blue="0.0" /> | |
| 165 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 166 | </text> | |
| 167 | </element> | |
| 168 | ||
| 169 | <element name="1000p" defstate="0"> | |
| 170 | <text string="1000p" state="0"> | |
| 171 | <color red="1.0" green="1.0" blue="1.0" /> | |
| 172 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 173 | </text> | |
| 174 | <text string="1000p" state="1"> | |
| 175 | <color red="1.0" green="1.0" blue="0.0" /> | |
| 176 | <bounds x="0" y="0.1" width="1" height="0.8" /> | |
| 177 | </text> | |
| 178 | </element> | |
| 179 | ||
| 120 | 180 | <element name="vfd0"> |
| 121 | 181 | <led16segsc> |
| 122 | 182 | <color red="0" green="0.6" blue="1.0" /> |
| r5613 | r5614 | |
| 549 | 609 | <bounds x="56" y="48" width="7" height="7"/> |
| 550 | 610 | </backdrop> |
| 551 | 611 | |
| 612 | <backdrop name="lamp71" element="20p" state="0"> | |
| 613 | <bounds x="64" y="48" width="7" height="7"/> | |
| 614 | </backdrop> | |
| 615 | ||
| 616 | <backdrop name="lamp79" element="50p" state="0"> | |
| 617 | <bounds x="64" y="40" width="7" height="7"/> | |
| 618 | </backdrop> | |
| 619 | ||
| 620 | <backdrop name="lamp87" element="100p" state="0"> | |
| 621 | <bounds x="64" y="32" width="7" height="7"/> | |
| 622 | </backdrop> | |
| 623 | ||
| 624 | <backdrop name="lamp95" element="200p" state="0"> | |
| 625 | <bounds x="64" y="24" width="7" height="7"/> | |
| 626 | </backdrop> | |
| 627 | ||
| 628 | <backdrop name="lamp103" element="500p" state="0"> | |
| 629 | <bounds x="64" y="16" width="7" height="7"/> | |
| 630 | </backdrop> | |
| 631 | ||
| 632 | <backdrop name="lamp111" element="1000p" state="0"> | |
| 633 | <bounds x="64" y="8" width="7" height="7"/> | |
| 634 | </backdrop> | |
| 635 | ||
| 552 | 636 | <backdrop name="lamp119" element="timeout" state="0"> |
| 553 | 637 | <bounds x="30" y="56" width="28" height="14"/> |
| 554 | 638 | </backdrop> |
| r5613 | r5614 | |
| 563 | 647 | <bounds x="30" y="56" width="28" height="14"/> |
| 564 | 648 | </backdrop> |
| 565 | 649 | |
| 566 | <backdrop name="lamp27" element="play" state="0"> | |
| 567 | <bounds x="0" y="72" width="28" height="14"/> | |
| 650 | <backdrop name="lamp122" element="play" state="0"> | |
| 651 | <bounds x="0" y="140" width="28" height="14"/> | |
| 568 | 652 | </backdrop> |
| 569 | <backdrop name="lamp26" element="pass" state="0"> | |
| 570 | <bounds x="20" y="72" width="28" height="14"/> | |
| 653 | <backdrop name="lamp121" element="pass" state="0"> | |
| 654 | <bounds x="40" y="140" width="28" height="14"/> | |
| 571 | 655 | </backdrop> |
| 572 | 656 | <backdrop name="lamp24" element="select" state="0"> |
| 573 | 657 | <bounds x="0" y="90" width="28" height="14"/> |
| r5613 | r5614 | |
|---|---|---|
| 517 | 517 | /*Probably there's a mask somewhere if it REALLY uses irqs at all...irq vectors dynamically changes after some time.*/ |
| 518 | 518 | static INTERRUPT_GEN( magicard_irq ) |
| 519 | 519 | { |
| 520 | if(input_code_pressed(KEYCODE_Z)) //vblank? | |
| 520 | if(input_code_pressed(device->machine, KEYCODE_Z)) //vblank? | |
| 521 | 521 | cpu_set_input_line_and_vector(device, 1, HOLD_LINE,0xe4/4); |
| 522 | if(input_code_pressed(KEYCODE_X)) //uart irq | |
| 522 | if(input_code_pressed(device->machine, KEYCODE_X)) //uart irq | |
| 523 | 523 | cpu_set_input_line_and_vector(device, 1, HOLD_LINE,0xf0/4); |
| 524 | 524 | } |
| 525 | 525 |
| r5613 | r5614 | |
|---|---|---|
| 567 | 567 | D7: Amplifier mute control (1= sounding, 0= muted) |
| 568 | 568 | D6-D0: CN D pin A17-A23 (output level 1= high, 0= low) |
| 569 | 569 | */ |
| 570 | sound_global_enable(data & 0x80); | |
| 570 | sound_global_enable(space->machine, data & 0x80); | |
| 571 | 571 | return; |
| 572 | 572 | } |
| 573 | 573 | |
| r5613 | r5614 | |
| 653 | 653 | coin_counter_w(0, (data >> 4) & 0x01); |
| 654 | 654 | output_set_lamp_value(0, (data >> 5) & 0x01); /* lock on lamp */ |
| 655 | 655 | output_set_lamp_value(1, (data >> 6) & 0x01); /* danger lamp */ |
| 656 | sound_global_enable((data >> 7) & 0x01); | |
| 656 | sound_global_enable(space->machine, (data >> 7) & 0x01); | |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 |
| r5613 | r5614 | |
|---|---|---|
| 72 | 72 | const UINT8 *blit_ram = memory_region(screen->machine,"gfx1"); |
| 73 | 73 | static int test_x = 256,test_y = 256,start_offs; |
| 74 | 74 | |
| 75 | if(input_code_pressed(KEYCODE_Z)) | |
| 75 | if(input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 76 | 76 | test_x++; |
| 77 | 77 | |
| 78 | if(input_code_pressed(KEYCODE_X)) | |
| 78 | if(input_code_pressed(screen->machine, KEYCODE_X)) | |
| 79 | 79 | test_x--; |
| 80 | 80 | |
| 81 | if(input_code_pressed(KEYCODE_A)) | |
| 81 | if(input_code_pressed(screen->machine, KEYCODE_A)) | |
| 82 | 82 | test_y++; |
| 83 | 83 | |
| 84 | if(input_code_pressed(KEYCODE_S)) | |
| 84 | if(input_code_pressed(screen->machine, KEYCODE_S)) | |
| 85 | 85 | test_y--; |
| 86 | 86 | |
| 87 | if(input_code_pressed(KEYCODE_Q)) | |
| 87 | if(input_code_pressed(screen->machine, KEYCODE_Q)) | |
| 88 | 88 | start_offs+=0x200; |
| 89 | 89 | |
| 90 | if(input_code_pressed(KEYCODE_W)) | |
| 90 | if(input_code_pressed(screen->machine, KEYCODE_W)) | |
| 91 | 91 | start_offs-=0x200; |
| 92 | 92 | |
| 93 | if(input_code_pressed(KEYCODE_E)) | |
| 93 | if(input_code_pressed(screen->machine, KEYCODE_E)) | |
| 94 | 94 | start_offs++; |
| 95 | 95 | |
| 96 | if(input_code_pressed(KEYCODE_R)) | |
| 96 | if(input_code_pressed(screen->machine, KEYCODE_R)) | |
| 97 | 97 | start_offs--; |
| 98 | 98 | |
| 99 | 99 | popmessage("%d %d %04x",test_x,test_y,start_offs); |
| r5613 | r5614 | |
|---|---|---|
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | |
| 3 | - NORAUT POKER - | |
| 4 | ------------------ | |
| 3 | - NORAUT POKER SYSTEM - | |
| 4 | ------------------------- | |
| 5 | 5 | |
| 6 | 6 | Driver by Roberto Fresca & Angelo Salese. |
| 7 | 7 | |
| r5613 | r5614 | |
| 160 | 160 | Video Blue 35 10p in Meter |
| 161 | 161 | Video Red 36 Spark Detect (Not on all boards) |
| 162 | 162 | |
| 163 | ||
| 163 | 164 | ******************************************************************************* |
| 164 | 165 | |
| 165 | 166 | Control Panel |
| r5613 | r5614 | |
| 182 | 183 | |
| 183 | 184 | HOLD buttons = red. |
| 184 | 185 | BET, DEAL, HI & LO = yellow. |
| 185 | HALF GAMBLE & CHANGE CARD = orange. | |
| 186 | HALF GAMBLE & CHANGE CARD = orange. | |
| 186 | 187 | |
| 187 | 188 | |
| 188 | 189 | * The alternate one (12 button-lamps) for systems with CANCEL button. |
| 189 | 190 | |
| 190 | 191 | .-------------------------------------------------------------. |
| 191 | | .------. .------. .------. .------. .------. .----------. | | |
| 192 | | .------. .------. .------. .------. .------. .----------. | | |
| 192 | 193 | | | HOLD | | HOLD | | HOLD | | HOLD | | HOLD | | HIGH | | |
| 193 | 194 | | '------' '------' '------' '------' '------' '----------' | |
| 194 | 195 | | .------. .------. .------. .------. .------. .----------. | |
| r5613 | r5614 | |
| 305 | 306 | 7654 3210 |
| 306 | 307 | ---- ---x * HI lamp. |
| 307 | 308 | ---- --x- * LO lamp. |
| 308 | ---- -x-- | |
| 309 | ---- -x-- * HOPPER MOTOR DRIVE | |
| 309 | 310 | ---- x--- * Payout pulse. |
| 310 | 311 | ---x ---- * Coin 2 counter. |
| 311 | 312 | --x- ---- * Coin 1 counter. |
| 312 | -x-- ---- unknown. | |
| 313 | x--- ---- unknown (always activated). | |
| 313 | -x-- ---- + Coin counter related. | |
| 314 | x--- ---- + DEFLECT (always activated). | |
| 314 | 315 | |
| 315 | 316 | |
| 316 | 317 | ----------------------------------------------------------- |
| r5613 | r5614 | |
| 323 | 324 | ---- --x- * BET / CHANGE CARD button. |
| 324 | 325 | ---- -x-- * COIN 1 mech. |
| 325 | 326 | ---- x--- * COIN 2 mech. |
| 326 | ---x ---- * READOUT button. | |
| 327 | ---x ---- * READOUT button (noraut11). | |
| 327 | 328 | --x- ---- * HI button. |
| 328 | 329 | -x-- ---- * LO button. |
| 329 | 330 | x--- ---- * PAYOUT button. |
| r5613 | r5614 | |
| 349 | 350 | 7654 3210 |
| 350 | 351 | ---- ---x * DEAL / DRAW Lamp. |
| 351 | 352 | ---- --x- * BET / COLLECT Lamp. |
| 352 | ---- -x-- unknown (always activated after initalize). | |
| 353 | ---- x--- unknown. | |
| 353 | ---- -x-- + PANEL LIGHTS RESET (always activated after initalize). | |
| 354 | ---- x--- + PANEL LAMPS CLOCK | |
| 354 | 355 | xxxx ---- * Discrete Sound Lines. |
| 355 | 356 | |
| 356 | 357 | |
| r5613 | r5614 | |
| 363 | 364 | xxxx xxxx VRAM DATA. |
| 364 | 365 | |
| 365 | 366 | |
| 366 | PPI-2 (a0h-a3h); PortB | |
| 367 | PPI-2 (a0h-a3h); PortB | |
| 367 | 368 | VRAM Handlers: |
| 368 | 369 | |
| 369 | 370 | 7654 3210 |
| 370 | 371 | xxxx xxxx VRAM ADDRESSING. |
| 371 | 372 | |
| 372 | 373 | |
| 373 | PPI-2 (a0h-a3h); PortC (PortA handshake lines) | |
| 374 | VRAM Handlers: | |
| 374 | PPI-2 (a0h-a3h); PortC IN/OUT. | |
| 375 | PortA handshake lines & PC0-PC2 (noraut11 = OUT; noraut12 = IN): | |
| 375 | 376 | |
| 376 | 377 | 7654 3210 |
| 377 | xxxx xxxx HANDSHAKE LINES. | |
| 378 | ---- ---x * N/C (noraut11). | |
| 379 | ---- --x- * N/C (noraut11). | |
| 380 | ---- -x-- * N/C (noraut11). | |
| 381 | ---- ---x * N/C (noraut12). | |
| 382 | ---- --x- * READOUT SWITCH (noraut12). | |
| 383 | ---- -x-- * LOW LEVEL HOPPER (noraut12). | |
| 384 | xxxx x--- * PortA HANDSHAKE LINES (all systems). | |
| 378 | 385 | |
| 379 | 386 | |
| 380 | 387 | ******************************************************************************* |
| r5613 | r5614 | |
| 384 | 391 | |
| 385 | 392 | |
| 386 | 393 | - norautjp: |
| 387 | ||
| 388 | At the first start-up, the game will give you a very clever | |
| 394 | ||
| 395 | At the first start-up, the game will give you a very clever | |
| 389 | 396 | "FU" screen. Press the following buttons *together* on different times |
| 390 | 397 | to get rid of it (and actually initialize the machine): |
| 391 | 398 | |
| r5613 | r5614 | |
| 408 | 415 | |
| 409 | 416 | 0x60 - 0x63 ; PPI 8255 0 - DIP Switches, lamps & counters. |
| 410 | 417 | 0xA0 - 0xA3 ; PPI 8255 1 - Regular Inputs, sound lines & remaining lamps. |
| 411 | 0xC0 - 0xC3 ; PPI 8255 2 - Video RAM access. | |
| 418 | 0xC0 - 0xC3 ; PPI 8255 2 - Video RAM access & other stuff. | |
| 412 | 419 | |
| 413 | 420 | |
| 414 | 421 | ******************************************************************************* |
| r5613 | r5614 | |
| 485 | 492 | - Updated technical notes. |
| 486 | 493 | |
| 487 | 494 | |
| 495 | [2009-08-30] | |
| 496 | ||
| 497 | - Corrected CPU clock to Xtal/8. | |
| 498 | - Discovered 3 new I/O lines coming from PPI-2, PC0-PC2. They are mixed with the handshake ones. | |
| 499 | - Added the READOUT button to noraut12 games. | |
| 500 | - Splitted the main machine driver to cover 2 different Noraut systems. | |
| 501 | - Added partial support for PPI-2, PC0-PC2 output lines on noraut11 games. | |
| 502 | - Figured out other remaining I/O lines. | |
| 503 | - Added new handlers to simulate the handshake lines. Still need real support through PPI-2. | |
| 504 | - Updated technical notes. | |
| 505 | ||
| 506 | ||
| 507 | [2009-09-03] | |
| 508 | ||
| 509 | - Routed the whole video RAM access through PPI-2. | |
| 510 | (bypassed the handshake lines for now). | |
| 511 | - Merged back the noraut machine drivers after the 3rd PPI connection. | |
| 512 | - Added Low Level Hopper manual input. | |
| 513 | - Added a new machine driver for extended hardware. | |
| 514 | It has 2 jumpers that cut the a14 and a15 addressing lines. | |
| 515 | ||
| 516 | ||
| 488 | 517 | TODO: |
| 489 | 518 | |
| 490 | - Analize the third 8255 at 0xc0-0xc3 (full bidirectional port w/hshk lines) | |
| 491 | - Video RAM (through 3rd PPI?). | |
| 519 | - Analize PPI-2 at 0xc0-0xc3. OBF handshake line (PC7) doesn't seems to work properly. | |
| 492 | 520 | - Find if wide chars are hardcoded or tied to a bit. |
| 493 | 521 | - Discrete sound. |
| 494 | 522 | - Save support. |
| r5613 | r5614 | |
| 498 | 526 | |
| 499 | 527 | |
| 500 | 528 | #define MASTER_CLOCK XTAL_18_432MHz |
| 529 | #define CPU_CLOCK MASTER_CLOCK / 8 /* 2.30275 MHz - Measured: 2.305 MHz */ | |
| 501 | 530 | |
| 502 | 531 | #include "driver.h" |
| 503 | 532 | #include "cpu/z80/z80.h" |
| r5613 | r5614 | |
| 610 | 639 | /* PPI-1 (a0h-a3h); PortC OUT. |
| 611 | 640 | Sound & Lamps: |
| 612 | 641 | |
| 613 | 7654 3210 | |
| 614 | ---- ---x * DEAL / DRAW Lamp. | |
| 615 | ---- --x- * BET / COLLECT Lamp. | |
| 616 | ---- -x-- unknown (always activated after initalize). | |
| 617 | ---- x--- unknown. | |
| 618 | xxxx ---- * Discrete Sound Lines. | |
| 642 | 7654 3210 | |
| 643 | ---- ---x * DEAL / DRAW Lamp. | |
| 644 | ---- --x- * BET / COLLECT Lamp. | |
| 645 | ---- -x-- + PANEL LIGHTS RESET (always activated after initalize). | |
| 646 | ---- x--- + PANEL LAMPS CLOCK | |
| 647 | xxxx ---- * Discrete Sound Lines. | |
| 619 | 648 | */ |
| 620 | 649 | output_set_lamp_value(8, (data >> 0) & 1); /* DEAL / DRAW lamp */ |
| 621 | 650 | output_set_lamp_value(9, (data >> 1) & 1); /* BET / COLLECT lamp */ |
| r5613 | r5614 | |
| 632 | 661 | 7654 3210 |
| 633 | 662 | ---- ---x * HI lamp. |
| 634 | 663 | ---- --x- * LO lamp. |
| 635 | ---- -x-- | |
| 664 | ---- -x-- * HOPPER MOTOR DRIVE | |
| 636 | 665 | ---- x--- * Payout pulse. |
| 637 | 666 | ---x ---- * Coin 2 counter. |
| 638 | 667 | --x- ---- * Coin 1 counter. |
| 639 | -x-- ---- unknown. | |
| 640 | x--- ---- unknown (always activated). | |
| 668 | -x-- ---- + Coin counter related. | |
| 669 | x--- ---- + DEFLECT (always activated). | |
| 641 | 670 | */ |
| 642 | 671 | output_set_lamp_value(10, (data >> 0) & 1); /* HI lamp */ |
| 643 | 672 | output_set_lamp_value(11, (data >> 1) & 1); /* LO lamp */ |
| r5613 | r5614 | |
| 648 | 677 | } |
| 649 | 678 | |
| 650 | 679 | |
| 651 | /* game waits for bit 7 (0x80) to be set.*/ | |
| 652 | static READ8_HANDLER( test_r ) | |
| 680 | /* Game waits for bit 7 (0x80) to be set. | |
| 681 | This should be the /OBF line (PC7) from PPI-2 (handshake). | |
| 682 | PC0-PC2 could be set as input or output. | |
| 683 | */ | |
| 684 | ||
| 685 | static READ8_DEVICE_HANDLER( ppi2_portc_r ) | |
| 653 | 686 | { |
| 654 | return 0xff; | |
| 687 | UINT8 ppi2_pcmix = 0; | |
| 688 | UINT8 hndshk = 0x80; /* simulating the handshake lines (bits 3-7) */ | |
| 689 | ppi2_pcmix = (hndshk | (input_port_read(device->machine, "IN2") & 0x07)); | |
| 690 | // popmessage("portc read: %02x", ppi2_pcmix); | |
| 691 | ||
| 692 | return ppi2_pcmix; | |
| 655 | 693 | } |
| 656 | 694 | |
| 657 | /* game waits for bit 4 (0x10) to be reset.*/ | |
| 658 | static READ8_HANDLER( test2_r ) | |
| 695 | static WRITE8_DEVICE_HANDLER( ppi2_portc_w ) | |
| 659 | 696 | { |
| 660 | return 0x00; | |
| 697 | /* PC0-PC2 don't seems to be connected to any output */ | |
| 698 | // popmessage("portc write: %02x", data); | |
| 661 | 699 | } |
| 662 | 700 | |
| 663 | static | |
| 701 | static | |
| 664 | 702 | { |
| 703 | return np_vram[np_addr]; | |
| 704 | } | |
| 705 | ||
| 706 | static WRITE8_DEVICE_HANDLER( vram_data_w ) | |
| 707 | { | |
| 665 | 708 | np_vram[np_addr] = data & 0xff; |
| 666 | 709 | } |
| 667 | 710 | |
| 668 | static WRITE8_HANDLER( vram_addr_w ) | |
| 711 | static WRITE8_DEVICE_HANDLER( vram_addr_w ) | |
| 669 | 712 | { |
| 670 | 713 | np_addr = data; |
| 671 | 714 | } |
| 672 | 715 | |
| 716 | /* game waits for bit 4 (0x10) to be reset.*/ | |
| 717 | static READ8_HANDLER( test2_r ) | |
| 718 | { | |
| 719 | return 0x00; | |
| 720 | } | |
| 673 | 721 | |
| 722 | ||
| 674 | 723 | /************************* |
| 675 | 724 | * Memory Map Information * |
| 676 | 725 | *************************/ |
| r5613 | r5614 | |
| 684 | 733 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 685 | 734 | AM_RANGE(0x60, 0x63) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) |
| 686 | 735 | AM_RANGE(0xa0, 0xa3) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) |
| 687 | AM_RANGE(0xc0, 0xc0) AM_WRITE(vram_data_w) | |
| 688 | AM_RANGE(0xc1, 0xc1) AM_WRITE(vram_addr_w) | |
| 689 | AM_RANGE(0xc2, 0xc2) AM_READ(test_r) | |
| 690 | // AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w) | |
| 736 | AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w) | |
| 691 | 737 | ADDRESS_MAP_END |
| 692 | 738 | |
| 693 | 739 | /* |
| 694 | 740 | Video RAM R/W: |
| 695 | 741 | |
| 696 | c0 --> W ; data | |
| 742 | c0 --> W ; data | |
| 697 | 743 | c1 --> W ; addressing |
| 698 | c2 --> R ; status? | |
| 699 | c3 --> W ; alternate 00 & 01 (in case of PPI, setting resetting bit 0 of handshaked port) | |
| 744 | c2 --> R ; status | |
| 745 | c3 --> W ; alternate 00 & 01 (control?) | |
| 700 | 746 | |
| 701 | The strange issue is that some sets just configure the PPI to mixed mode2 and mode0 input. | |
| 702 | it means that port A should be bidirectional and port B just as input. (port C as hshk regs). | |
| 703 | So... it doesn't match the addressing through c1. | |
| 704 | 747 | */ |
| 705 | 748 | |
| 749 | static ADDRESS_MAP_START( norautxp_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 750 | AM_RANGE(0x0000, 0xcfff) AM_ROM /* need to be checked */ | |
| 751 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* need to be checked */ | |
| 752 | ADDRESS_MAP_END | |
| 753 | ||
| 754 | static ADDRESS_MAP_START( norautxp_portmap, ADDRESS_SPACE_IO, 8 ) | |
| 755 | ADDRESS_MAP_GLOBAL_MASK(0xff) | |
| 756 | // AM_RANGE(0x60, 0x63) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) | |
| 757 | // AM_RANGE(0xa0, 0xa3) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) | |
| 758 | // AM_RANGE(0xc0, 0xc3) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w) | |
| 759 | ADDRESS_MAP_END | |
| 760 | ||
| 706 | 761 | static ADDRESS_MAP_START( gtipoker_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 707 | 762 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 708 | 763 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) |
| r5613 | r5614 | |
| 712 | 767 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 713 | 768 | AM_RANGE(0x7c, 0x7f) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) |
| 714 | 769 | AM_RANGE(0xbc, 0xbf) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) |
| 715 | AM_RANGE(0xdc, 0xdc) AM_WRITE(vram_data_w) | |
| 716 | AM_RANGE(0xdd, 0xdd) AM_WRITE(vram_addr_w) | |
| 717 | AM_RANGE(0xde, 0xde) AM_READ(test_r) | |
| 718 | // AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w) | |
| 770 | AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w) | |
| 719 | 771 | AM_RANGE(0xef, 0xef) AM_READ(test2_r) |
| 720 | 772 | ADDRESS_MAP_END |
| 721 | 773 | |
| r5613 | r5614 | |
| 725 | 777 | *************************/ |
| 726 | 778 | |
| 727 | 779 | static INPUT_PORTS_START( norautp ) |
| 780 | ||
| 728 | 781 | PORT_START("IN0") |
| 729 | 782 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Draw") |
| 730 | 783 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_NAME("Bet / Collect") |
| 731 | 784 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* Coin A */ |
| 732 | 785 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) /* Coin B */ |
| 733 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_ | |
| 786 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER | |
| 734 | 787 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Hi") |
| 735 | 788 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Lo") |
| 736 | 789 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) |
| r5613 | r5614 | |
| 745 | 798 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) |
| 746 | 799 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) /* Coin C */ |
| 747 | 800 | |
| 801 | PORT_START("IN2") /* Only 3 lines: PPI-2; PC0-PC2 */ | |
| 802 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) PORT_NAME("IN2-1") | |
| 803 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Readout") | |
| 804 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("Low Level Hopper") | |
| 805 | ||
| 806 | ||
| 748 | 807 | PORT_START("DSW1") |
| 749 | 808 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 750 | 809 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| r5613 | r5614 | |
| 773 | 832 | INPUT_PORTS_END |
| 774 | 833 | |
| 775 | 834 | static INPUT_PORTS_START( norautrh ) |
| 835 | ||
| 776 | 836 | PORT_START("IN0") |
| 777 | 837 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Draw") |
| 778 | 838 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_NAME("Bet / Change Card") |
| r5613 | r5614 | |
| 793 | 853 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) |
| 794 | 854 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) /* Coin C for other games */ |
| 795 | 855 | |
| 856 | PORT_START("IN2") /* Only 3 lines: PPI-2; PC0-PC2 */ | |
| 857 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 858 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 859 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 860 | ||
| 861 | ||
| 796 | 862 | PORT_START("DSW1") |
| 797 | 863 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") |
| 798 | 864 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| r5613 | r5614 | |
| 819 | 885 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 820 | 886 | INPUT_PORTS_END |
| 821 | 887 | |
| 822 | static INPUT_PORTS_START( naroutpn ) | |
| 888 | static INPUT_PORTS_START( norautpn ) | |
| 889 | ||
| 823 | 890 | PORT_START("IN0") |
| 824 | 891 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Start") |
| 825 | 892 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_NAME("Bet / Change Card") |
| r5613 | r5614 | |
| 840 | 907 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) |
| 841 | 908 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) |
| 842 | 909 | |
| 910 | PORT_START("IN2") /* Only 3 lines: PPI-2; PC0-PC2 */ | |
| 911 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 912 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 913 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 914 | ||
| 915 | ||
| 843 | 916 | PORT_START("DSW1") |
| 844 | 917 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) |
| 845 | 918 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| r5613 | r5614 | |
| 934 | 1007 | DEVCB_NULL, /* Port B write */ |
| 935 | 1008 | DEVCB_HANDLER(soundlamps_w) /* Port C write */ |
| 936 | 1009 | }, |
| 937 | { /* (c0-c3) Group A Mode 2 (5-handshacked bidirectional port) */ | |
| 938 | DEVCB_NULL, /* Port A read */ | |
| 1010 | { /* (c0-c3) Group A Mode 2 (5-handshacked bidirectional port) | |
| 1011 | Group B Mode 0, output; (see below for lines PC0-PC2) */ | |
| 1012 | DEVCB_HANDLER(vram_data_r), /* Port A read */ | |
| 939 | 1013 | DEVCB_NULL, /* Port B read */ |
| 940 | DEVCB_NULL, /* Port C read (should has test_r tied) */ | |
| 941 | DEVCB_NULL, /* Port A write (should has vram_data_w tied) */ | |
| 942 | DEVCB_NULL, /* Port B write (should has vram_addr_w tied) */ | |
| 943 | DEVCB_NULL /* Port C write */ | |
| 1014 | DEVCB_HANDLER(ppi2_portc_r), /* Port C read */ | |
| 1015 | DEVCB_HANDLER(vram_data_w), /* Port A write (vram_data_w tied) */ | |
| 1016 | DEVCB_HANDLER(vram_addr_w), /* Port B write (vram_addr_w tied) */ | |
| 1017 | DEVCB_HANDLER(ppi2_portc_w) /* Port C write */ | |
| 944 | 1018 | } |
| 1019 | /* PPI-2 is configured as mixed mode2 and mode0 output. | |
| 1020 | It means that port A should be bidirectional and port B just as output. | |
| 1021 | Port C as hshk regs, and P0-P2 as output (noraut11) or input (noraut12). | |
| 1022 | */ | |
| 945 | 1023 | }; |
| 946 | 1024 | |
| 947 | 1025 | |
| r5613 | r5614 | |
| 952 | 1030 | static MACHINE_DRIVER_START( norautp ) |
| 953 | 1031 | |
| 954 | 1032 | /* basic machine hardware */ |
| 955 | MDRV_CPU_ADD("maincpu", Z80, | |
| 1033 | MDRV_CPU_ADD("maincpu", Z80, CPU | |
| 956 | 1034 | MDRV_CPU_PROGRAM_MAP(norautp_map) |
| 957 | 1035 | MDRV_CPU_IO_MAP(norautp_portmap) |
| 958 | 1036 | MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) |
| r5613 | r5614 | |
| 985 | 1063 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 986 | 1064 | MACHINE_DRIVER_END |
| 987 | 1065 | |
| 1066 | static MACHINE_DRIVER_START( norautxp ) | |
| 1067 | MDRV_IMPORT_FROM(norautp) | |
| 1068 | ||
| 1069 | MDRV_CPU_MODIFY("maincpu") | |
| 1070 | MDRV_CPU_PROGRAM_MAP(norautxp_map) | |
| 1071 | MDRV_CPU_IO_MAP(norautxp_portmap) | |
| 1072 | ||
| 1073 | MACHINE_DRIVER_END | |
| 1074 | ||
| 988 | 1075 | static MACHINE_DRIVER_START( gtipoker ) |
| 989 | 1076 | MDRV_IMPORT_FROM(norautp) |
| 990 | 1077 | |
| r5613 | r5614 | |
| 1127 | 1214 | |
| 1128 | 1215 | ROM_START( norautu ) |
| 1129 | 1216 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 1130 | ROM_LOAD( "2563.bin", 0x0000, 0x8000, CRC(6cbe68bd) SHA1(93201baaf03a9bba6c52c64cc26e8e445aa6454e) ) | |
| 1217 | ROM_LOAD( "2563.bin", 0x0000, 0x8000, CRC(6cbe68bd) SHA1(93201baaf03a9bba6c52c64cc26e8e445aa6454e) ) | |
| 1218 | ROM_RELOAD( 0x8000, 0x8000 ) | |
| 1131 | 1219 | |
| 1132 | 1220 | ROM_REGION( 0x1000, "gfx", 0 ) |
| 1133 | 1221 | ROM_LOAD( "club250.bin", 0x0000, 0x1000, CRC(d94be899) SHA1(b7212162324fa2d67383a475052e3b351bb1af5f) ) |
| r5613 | r5614 | |
| 1189 | 1277 | ROM_END |
| 1190 | 1278 | |
| 1191 | 1279 | |
| 1280 | /************************** | |
| 1281 | * Driver Init * | |
| 1282 | **************************/ | |
| 1283 | ||
| 1284 | /* These are to patch the check for OBF handshake line, | |
| 1285 | that seems to be wrong. Otherwise will enter in an infinite loop. | |
| 1286 | ||
| 1287 | 110D: DB C2 in a,($C2) ; read from PPI-2, portC. (OBF should be set, but isn't) | |
| 1288 | 110F: 07 rlca ; rotate left. | |
| 1289 | 1110: 30 FB jr nc,$110D | |
| 1290 | ||
| 1291 | */ | |
| 1292 | static DRIVER_INIT( norautrh ) | |
| 1293 | { | |
| 1294 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 1295 | ROM[0x1110] = 0x00; | |
| 1296 | ROM[0x1111] = 0x00; | |
| 1297 | } | |
| 1298 | ||
| 1299 | static DRIVER_INIT( norautpn ) | |
| 1300 | { | |
| 1301 | UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 1302 | ROM[0x0827] = 0x00; | |
| 1303 | ROM[0x0828] = 0x00; | |
| 1304 | } | |
| 1305 | ||
| 1306 | static DRIVER_INIT( gtipoker ) | |
| 1307 | { | |
| 1308 | // UINT8 *ROM = memory_region(machine, "maincpu"); | |
| 1309 | // ROM[0x0cc6] = 0x00; | |
| 1310 | // ROM[0x0cc7] = 0x00; | |
| 1311 | } | |
| 1312 | ||
| 1313 | ||
| 1192 | 1314 | /************************* |
| 1193 | 1315 | * Game Drivers * |
| 1194 | 1316 | *************************/ |
| 1195 | 1317 | |
| 1196 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ | |
| 1197 | GAMEL( 1988, norautp, 0, norautp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Poker", GAME_NO_SOUND, layout_noraut11 ) | |
| 1198 | GAMEL( 1988, norautjp, norautp, norautp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Joker Poker", GAME_NO_SOUND, layout_noraut11 ) | |
| 1199 | GAMEL( 1988, norautrh, 0, norautp, norautrh, 0, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker", GAME_NO_SOUND, layout_noraut12 ) | |
| 1200 | GAME( 1988, norautu, 0, norautp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Poker (NTX10A)", GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1201 | GAME( 1988, norautv3, 0, norautp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Joker Poker (V3.010a)", GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1202 | GAME( 1983, gtipoker, 0, gtipoker, norautp, 0, ROT0, "GTI Inc", "GTI Poker", GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1318 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ | |
| 1319 | GAMEL( 1988, norautp, 0, norautp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Poker", GAME_NO_SOUND, layout_noraut11 ) | |
| 1320 | GAMEL( 1988, norautjp, norautp, norautp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Joker Poker", GAME_NO_SOUND, layout_noraut11 ) | |
| 1321 | GAMEL( 1988, norautrh, 0, norautp, norautrh, norautrh, ROT0, "Noraut Ltd.", "Noraut Red Hot Joker Poker", GAME_NO_SOUND, layout_noraut12 ) | |
| 1322 | GAME( 1988, norautu, 0, norautxp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Poker (NTX10A)", GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1323 | GAME( 1988, norautv3, 0, norautxp, norautp, 0, ROT0, "Noraut Ltd.", "Noraut Joker Poker (V3.010a)", GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1324 | GAME( 1983, gtipoker, 0, gtipoker, norautpn, gtipoker, ROT0, "GTI Inc", "GTI Poker", GAME_NO_SOUND | GAME_NOT_WORKING ) | |
| 1203 | 1325 | |
| 1204 | 1326 | /*The following has everything uncertain, seems a bootleg/hack and doesn't have any identification strings in program rom. */ |
| 1205 | GAMEL( 198?, norautpn, norautp, norautp, n | |
| 1327 | GAMEL( 198?, norautpn, norautp, norautp, n |
| r5613 | r5614 | |
|---|---|---|
| 82 | 82 | cputag_set_input_line(space->machine, "mcu", M6805_IRQ_LINE, CLEAR_LINE ); |
| 83 | 83 | |
| 84 | 84 | /* AUDMUTE */ |
| 85 | sound_global_enable((data >> 5) & 1); | |
| 85 | sound_global_enable(space->machine, (data >> 5) & 1); | |
| 86 | 86 | |
| 87 | 87 | /* RES600 */ |
| 88 | 88 | if (diff & 0x10) |
| r5613 | r5614 | |
|---|---|---|
| 177 | 177 | int old = irq2_scanline; |
| 178 | 178 | |
| 179 | 179 | /* Q = -10 scanlines, W = -1 scanline, E = +1 scanline, R = +10 scanlines */ |
| 180 | if (input_code_pressed(KEYCODE_Q)) { while (input_code_pressed(KEYCODE_Q)) ; irq2_scanline -= 10; } | |
| 181 | if (input_code_pressed(KEYCODE_W)) { while (input_code_pressed(KEYCODE_W)) ; irq2_scanline -= 1; } | |
| 182 | if (input_code_pressed(KEYCODE_E)) { while (input_code_pressed(KEYCODE_E)) ; irq2_scanline += 1; } | |
| 183 | if (input_code_pressed(KEYCODE_R)) { while (input_code_pressed(KEYCODE_R)) ; irq2_scanline += 10; } | |
| 180 | if (input_code_pressed(machine, KEYCODE_Q)) { while (input_code_pressed(machine, KEYCODE_Q)) ; irq2_scanline -= 10; } | |
| 181 | if (input_code_pressed(machine, KEYCODE_W)) { while (input_code_pressed(machine, KEYCODE_W)) ; irq2_scanline -= 1; } | |
| 182 | if (input_code_pressed(machine, KEYCODE_E)) { while (input_code_pressed(machine, KEYCODE_E)) ; irq2_scanline += 1; } | |
| 183 | if (input_code_pressed(machine, KEYCODE_R)) { while (input_code_pressed(machine, KEYCODE_R)) ; irq2_scanline += 10; } | |
| 184 | 184 | if (old != irq2_scanline) |
| 185 | 185 | popmessage("scanline = %d", irq2_scanline); |
| 186 | 186 | } |
| r5613 | r5614 | |
| 332 | 332 | case 0x0e/2: |
| 333 | 333 | /* D7 = /MUTE */ |
| 334 | 334 | /* D6-D0 = FLT31-25 */ |
| 335 | sound_global_enable(data & 0x80); | |
| 335 | sound_global_enable(space->machine, data & 0x80); | |
| 336 | 336 | break; |
| 337 | 337 | |
| 338 | 338 | /* CNT register */ |
| r5613 | r5614 | |
|---|---|---|
| 1235 | 1235 | ddenlovr_clip_ctrl = 0x0f; |
| 1236 | 1236 | next = blit_draw(screen->machine,base,0); |
| 1237 | 1237 | popmessage("GFX %06x",base); |
| 1238 | if (input_code_pressed(KEYCODE_S)) base = next; | |
| 1239 | if (input_code_pressed_once(KEYCODE_X)) base = next; | |
| 1240 | if (input_code_pressed(KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } | |
| 1241 | if (input_code_pressed(KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } | |
| 1242 | if (input_code_pressed_once(KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } | |
| 1243 | if (input_code_pressed_once(KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } | |
| 1238 | if (input_code_pressed(screen->machine, KEYCODE_S)) base = next; | |
| 1239 | if (input_code_pressed_once(screen->machine, KEYCODE_X)) base = next; | |
| 1240 | if (input_code_pressed(screen->machine, KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } | |
| 1241 | if (input_code_pressed(screen->machine, KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } | |
| 1242 | if (input_code_pressed_once(screen->machine, KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; } | |
| 1243 | if (input_code_pressed_once(screen->machine, KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; } | |
| 1244 | 1244 | #endif |
| 1245 | 1245 | |
| 1246 | 1246 | bitmap_fill(bitmap,cliprect,ddenlovr_bgcolor); |
| 1247 | 1247 | |
| 1248 | 1248 | #ifdef MAME_DEBUG |
| 1249 | if (input_code_pressed(KEYCODE_Z)) | |
| 1249 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 1250 | 1250 | { |
| 1251 | 1251 | int mask,mask2; |
| 1252 | 1252 | |
| 1253 | 1253 | mask = 0; |
| 1254 | 1254 | |
| 1255 | if (input_code_pressed(KEYCODE_Q)) mask |= 1; | |
| 1256 | if (input_code_pressed(KEYCODE_W)) mask |= 2; | |
| 1257 | if (input_code_pressed(KEYCODE_E)) mask |= 4; | |
| 1258 | if (input_code_pressed(KEYCODE_R)) mask |= 8; | |
| 1255 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; | |
| 1256 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; | |
| 1257 | if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4; | |
| 1258 | if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8; | |
| 1259 | 1259 | |
| 1260 | 1260 | mask2 = 0; |
| 1261 | 1261 | |
| 1262 | 1262 | if (extra_layers) |
| 1263 | 1263 | { |
| 1264 | if (input_code_pressed(KEYCODE_A)) mask2 |= 1; | |
| 1265 | if (input_code_pressed(KEYCODE_S)) mask2 |= 2; | |
| 1266 | if (input_code_pressed(KEYCODE_D)) mask2 |= 4; | |
| 1267 | if (input_code_pressed(KEYCODE_F)) mask2 |= 8; | |
| 1264 | if (input_code_pressed(screen->machine, KEYCODE_A)) mask2 |= 1; | |
| 1265 | if (input_code_pressed(screen->machine, KEYCODE_S)) mask2 |= 2; | |
| 1266 | if (input_code_pressed(screen->machine, KEYCODE_D)) mask2 |= 4; | |
| 1267 | if (input_code_pressed(screen->machine, KEYCODE_F)) mask2 |= 8; | |
| 1268 | 1268 | } |
| 1269 | 1269 | |
| 1270 | 1270 | if (mask || mask2) |
| r5613 | r5614 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | [brapboys / shogwarr] |
| 61 | 61 | |
| 62 | - Verify collision protection on real hardware | |
| 62 | - Verify collision protection on real hardware (appears to be a function of the system/memory controller, NOT the MCU) | |
| 63 | - currently B.Rap Boys has it's own special case, it should work with the same code as Blood Warriors / Shogun Warriors (and probably SuperNova) | |
| 63 | 64 | - Figure out how MCU resets writeback address (currently hacked) |
| 64 | 65 | - Find relationship between Key tables and final datablock |
| 65 | 66 | - Clean up debug code file writes etc. (when above are done only!) |
| 66 | 67 | - Interrupt timing? (some sprites flicker) |
| 67 | - Sprite buffering (2 frames?, or related to above) | |
| 68 | - Sprite buffering (1-2 frames?, or related to above) | |
| 68 | 69 | |
| 69 | 70 | Dip locations verified from manual for: |
| 70 | 71 | |
| r5613 | r5614 | |
| 77 | 78 | - gtmr2 |
| 78 | 79 | - shogwarr |
| 79 | 80 | |
| 81 | [general] | |
| 82 | - replace sample bank copying with new ADDRESS MAP system for OKI and do banking like CPUs | |
| 80 | 83 | |
| 81 | ||
| 82 | 84 | ***************************************************************************/ |
| 83 | 85 | |
| 84 | 86 | #include "driver.h" |
| r5613 | r5614 | |
| 840 | 842 | AM_RANGE(0x603000, 0x603fff) AM_RAM AM_BASE(&kaneko16_vscroll_0) |
| 841 | 843 | AM_RANGE(0x800000, 0x80000f) AM_RAM_WRITE(kaneko16_layers_0_regs_w) AM_BASE(&kaneko16_layers_0_regs) // Layers 0 Regs |
| 842 | 844 | AM_RANGE(0x900000, 0x90001f) AM_RAM_WRITE(kaneko16_sprites_regs_w) AM_BASE(&kaneko16_sprites_regs) // Sprites Regs |
| 843 | AM_RANGE(0xa00000, 0xa0007f) AM_READWRITE( | |
| 845 | AM_RANGE(0xa00000, 0xa0007f) AM_READWRITE(bloodwar | |
| 844 | 846 | AM_RANGE(0xa80000, 0xa80001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // Watchdog |
| 845 | 847 | AM_RANGE(0xb80000, 0xb80001) AM_READ_PORT("P1") |
| 846 | 848 | AM_RANGE(0xb80002, 0xb80003) AM_READ_PORT("P2") |
| r5613 | r5614 | |
| 3347 | 3349 | |
| 3348 | 3350 | ***************************************************************************/ |
| 3349 | 3351 | |
| 3352 | ||
| 3353 | // the 'green garbage' on the VS logo shown in the video ( http://www.youtube.com/watch?v=lz4gY9d7uxw ) doesn't happen on the real PCB, | |
| 3354 | // it appears to be an encoding artifact on the videos uploaded by this poster | |
| 3355 | ||
| 3350 | 3356 | ROM_START( shogwarr ) |
| 3351 | 3357 | ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 Code */ |
| 3352 | 3358 | ROM_LOAD16_BYTE( "fb030a.u61", 0x000000, 0x020000, CRC(a04106c6) SHA1(95ab084f2e709be7cec2964cb09bcf5a8d3aacdf) ) |
| r5613 | r5614 | |
| 3355 | 3361 | ROM_REGION( 0x020000, "cpu1", 0 ) /* MCU Code */ |
| 3356 | 3362 | ROM_LOAD( "fb040a.u33", 0x000000, 0x020000, CRC(4b62c4d9) SHA1(35c943dde70438a411714070e42a84366db5ef83) ) |
| 3357 | 3363 | |
| 3358 | ROM_REGION( 0x1000000, "gfx1", | |
| 3364 | ROM_REGION( 0x1000000, "gfx1", ROMREGION_ERASEFF ) /* Sprites | |
| 3359 | 3365 | ROM_LOAD( "fb-020a.u1", 0x000000, 0x100000, CRC(87e55c6d) SHA1(87886c045d7c30b8dee3c8fb0bf8f2cdbc5fd7fb) ) |
| 3360 | 3366 | ROM_LOAD( "fb020b.u2", 0x100000, 0x100000, CRC(276b9d7b) SHA1(7a154f65b4737f2b6ac8effa3352711079f571dc) ) |
| 3361 | 3367 | ROM_LOAD( "fb021a.u3", 0x200000, 0x100000, CRC(7da15d37) SHA1(345cf2242e8210a697294a45197f2b3b974de885) ) |
| 3362 | 3368 | ROM_LOAD( "fb021b.u4", 0x300000, 0x100000, CRC(6a512d7b) SHA1(7fc3002d23262a9a590a283ea9e111e38d889ef2) ) |
| 3363 | ROM_LOAD( "fb022a.u5", 0x400000, 0x080000, CRC(60aa1282) SHA1(4648816016e00df3256226ba5134f6e5bb429909) ) | |
| 3364 | ROM_LOAD( "fb022b.u6", 0x480000, 0x080000, CRC(cd05a5c8) SHA1(9f000cca8d31e19fdc4b38c00c3ed13f71e5541c) ) | |
| 3365 | ROM_LOAD( "fb023.u7", 0x500000, 0x100000, CRC(132794bd) SHA1(bcc73c3183c59a4b66f79d04774773b8a9239501) ) | |
| 3369 | ROM_LOAD( "fb-22a.u5", 0x400000, 0x100000, CRC(9039e5d3) SHA1(222452cd7947f7c99c68e495835cca62e0449b5c) ) | |
| 3370 | ROM_LOAD( "fb-22b.u6", 0x500000, 0x100000, CRC(96ac9e54) SHA1(2b066375963dc57fe2ce89d65f6c0a9d183a838d) ) | |
| 3371 | ROM_LOAD( "fb023.u7", 0x600000, 0x100000, CRC(132794bd) SHA1(bcc73c3183c59a4b66f79d04774773b8a9239501) ) | |
| 3366 | 3372 | |
| 3367 | 3373 | ROM_REGION( 0x400000, "gfx2", 0 ) /* Tiles (scrambled) */ |
| 3368 | 3374 | ROM_LOAD( "fb010.u65", 0x000000, 0x100000, CRC(296ffd92) SHA1(183a28e4594c428deb4726ed22d5166592b94b60) ) // 42 pin mask rom |
| 3369 | 3375 | ROM_LOAD( "fb011.u66", 0x100000, 0x080000, CRC(500a0367) SHA1(6dc5190f81b21f59ee56a3b2332c8d86d6599782) ) // 40 pin mask rom (verified correct) |
| 3370 | 3376 | |
| 3371 | ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */ | |
| 3372 | ROM_LOAD( "fb000e.u42", 0x000000, 0x080000, CRC(969f1465) SHA1(4f56d1ad341b08f4db41b7ab2498740612ff7c3d) ) // 2 x $40000 | |
| 3373 | ROM_LOAD( "fb001e.u43", 0x080000, 0x080000, CRC(f524aaa1) SHA1(006a886f9df2e57c51b61c6cea70a6574fc20304) ) // 2 x $40000 | |
| 3377 | ROM_REGION( 0x300000, "samples", 0 ) | |
| 3378 | ROM_LOAD( "fb001e.u43", 0x000000, 0x080000, CRC(f524aaa1) SHA1(006a886f9df2e57c51b61c6cea70a6574fc20304) ) | |
| 3379 | ROM_LOAD( "fb000e.u42", 0x080000, 0x080000, CRC(969f1465) SHA1(4f56d1ad341b08f4db41b7ab2498740612ff7c3d) ) | |
| 3374 | 3380 | |
| 3375 | ROM_REGION( 0x100000, "oki2", 0 ) /* Samples */ | |
| 3376 | ROM_LOAD( "fb002.u44", 0x000000, 0x080000, CRC(05d7c2a9) SHA1(e34d395985caec10139a22daa179bb185df157d6) ) // 2 x $40000 | |
| 3377 | ROM_LOAD( "fb003.u45", 0x080000, 0x080000, CRC(405722e9) SHA1(92e51093d50f74f650ba137f5fc2910e0f85337e) ) // 2 x $40000 | |
| 3381 | /* Sound data is copied here during driver init */ | |
| 3382 | ROM_REGION( 0x400000*16, "oki1", 0 ) | |
| 3383 | ROM_FILL( 0x00000, 0x400000*16, 0x00 ) | |
| 3384 | ||
| 3385 | ROM_REGION( 0x200000, "oki2", 0 ) | |
| 3386 | ROM_LOAD( "fb-002.u45", 0x000000, 0x100000, CRC(010acc17) SHA1(2dc0897c7778eacf6bce12ff0adbadb307ea6c17) ) | |
| 3387 | ROM_LOAD( "fb-003.u44", 0x100000, 0x100000, CRC(0aea4ac5) SHA1(8f3b30e505b0ba51c140a0a2c071680d4fa05db9) ) | |
| 3378 | 3388 | ROM_END |
| 3379 | 3389 | |
| 3380 | 3390 | /*************************************************************************** |
| r5613 | r5614 | |
| 3414 | 3424 | ROM_REGION( 0x020000, "cpu1", 0 ) /* MCU Code */ |
| 3415 | 3425 | ROM_LOAD( "fb040e.u33", 0x000000, 0x020000, CRC(299d0746) SHA1(67fe3a47ab01fa02ce2bb5836c2041986c19d875) ) |
| 3416 | 3426 | |
| 3417 | ROM_REGION( 0x1000000, "gfx1", | |
| 3427 | ROM_REGION( 0x1000000, "gfx1", ROMREGION_ERASEFF ) /* Sprites | |
| 3418 | 3428 | ROM_LOAD( "fb-020a.u1", 0x000000, 0x100000, CRC(87e55c6d) SHA1(87886c045d7c30b8dee3c8fb0bf8f2cdbc5fd7fb) ) |
| 3419 | 3429 | ROM_LOAD( "fb020b.u2", 0x100000, 0x100000, CRC(276b9d7b) SHA1(7a154f65b4737f2b6ac8effa3352711079f571dc) ) |
| 3420 | 3430 | ROM_LOAD( "fb021a.u3", 0x200000, 0x100000, CRC(7da15d37) SHA1(345cf2242e8210a697294a45197f2b3b974de885) ) |
| 3421 | 3431 | ROM_LOAD( "fb021b.u4", 0x300000, 0x100000, CRC(6a512d7b) SHA1(7fc3002d23262a9a590a283ea9e111e38d889ef2) ) |
| 3422 | ROM_LOAD( "fb022a.u5", 0x400000, 0x080000, CRC(60aa1282) SHA1(4648816016e00df3256226ba5134f6e5bb429909) ) | |
| 3423 | ROM_LOAD( "fb022b.u6", 0x480000, 0x080000, CRC(cd05a5c8) SHA1(9f000cca8d31e19fdc4b38c00c3ed13f71e5541c) ) | |
| 3424 | ROM_LOAD( "fb023.u7", 0x500000, 0x100000, CRC(132794bd) SHA1(bcc73c3183c59a4b66f79d04774773b8a9239501) ) | |
| 3432 | ROM_LOAD( "fb-22a.u5", 0x400000, 0x100000, CRC(9039e5d3) SHA1(222452cd7947f7c99c68e495835cca62e0449b5c) ) | |
| 3433 | ROM_LOAD( "fb-22b.u6", 0x500000, 0x100000, CRC(96ac9e54) SHA1(2b066375963dc57fe2ce89d65f6c0a9d183a838d) ) | |
| 3434 | ROM_LOAD( "fb023.u7", 0x600000, 0x100000, CRC(132794bd) SHA1(bcc73c3183c59a4b66f79d04774773b8a9239501) ) | |
| 3425 | 3435 | |
| 3426 | 3436 | ROM_REGION( 0x400000, "gfx2", 0 ) /* Tiles (scrambled) */ |
| 3427 | 3437 | ROM_LOAD( "fb010.u65", 0x000000, 0x100000, CRC(296ffd92) SHA1(183a28e4594c428deb4726ed22d5166592b94b60) ) // 42 pin mask rom |
| 3428 | 3438 | ROM_LOAD( "fb011.u66", 0x100000, 0x080000, CRC(500a0367) SHA1(6dc5190f81b21f59ee56a3b2332c8d86d6599782) ) // 40 pin mask rom (verified correct) |
| 3429 | 3439 | |
| 3430 | ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */ | |
| 3431 | ROM_LOAD( "fb000e.u42", 0x000000, 0x080000, CRC(969f1465) SHA1(4f56d1ad341b08f4db41b7ab2498740612ff7c3d) ) // 2 x $40000 | |
| 3432 | ROM_LOAD( "fb001e.u43", 0x080000, 0x080000, CRC(f524aaa1) SHA1(006a886f9df2e57c51b61c6cea70a6574fc20304) ) // 2 x $40000 | |
| 3440 | ROM_REGION( 0x300000, "samples", 0 ) | |
| 3441 | ROM_LOAD( "fb001e.u43", 0x000000, 0x080000, CRC(f524aaa1) SHA1(006a886f9df2e57c51b61c6cea70a6574fc20304) ) | |
| 3442 | ROM_LOAD( "fb000e.u42", 0x080000, 0x080000, CRC(969f1465) SHA1(4f56d1ad341b08f4db41b7ab2498740612ff7c3d) ) | |
| 3433 | 3443 | |
| 3434 | ROM_REGION( 0x100000, "oki2", 0 ) /* Samples */ | |
| 3435 | ROM_LOAD( "fb002.u44", 0x000000, 0x080000, CRC(05d7c2a9) SHA1(e34d395985caec10139a22daa179bb185df157d6) ) // 2 x $40000 | |
| 3436 | ROM_LOAD( "fb003.u45", 0x080000, 0x080000, CRC(405722e9) SHA1(92e51093d50f74f650ba137f5fc2910e0f85337e) ) // 2 x $40000 | |
| 3444 | /* Sound data is copied here during driver init */ | |
| 3445 | ROM_REGION( 0x400000*16, "oki1", 0 ) | |
| 3446 | ROM_FILL( 0x00000, 0x400000*16, 0x00 ) | |
| 3447 | ||
| 3448 | ROM_REGION( 0x200000, "oki2", 0 ) | |
| 3449 | ROM_LOAD( "fb-002.u45", 0x000000, 0x100000, CRC(010acc17) SHA1(2dc0897c7778eacf6bce12ff0adbadb307ea6c17) ) | |
| 3450 | ROM_LOAD( "fb-003.u44", 0x100000, 0x100000, CRC(0aea4ac5) SHA1(8f3b30e505b0ba51c140a0a2c071680d4fa05db9) ) | |
| 3437 | 3451 | ROM_END |
| 3438 | 3452 | |
| 3439 | 3453 | /*************************************************************************** |
| r5613 | r5614 | |
| 3482 | 3496 | ROM_REGION( 0x020000, "cpu1", 0 ) /* MCU Code */ |
| 3483 | 3497 | ROM_LOAD( "fb040j.u33", 0x000000, 0x020000, CRC(299d0746) SHA1(67fe3a47ab01fa02ce2bb5836c2041986c19d875) ) |
| 3484 | 3498 | |
| 3485 | ROM_REGION( 0x1000000, "gfx1", | |
| 3499 | ROM_REGION( 0x1000000, "gfx1", ROMREGION_ERASEFF ) /* Sprites | |
| 3486 | 3500 | ROM_LOAD( "fb-020a.u1", 0x000000, 0x100000, CRC(87e55c6d) SHA1(87886c045d7c30b8dee3c8fb0bf8f2cdbc5fd7fb) ) |
| 3487 | 3501 | ROM_LOAD( "fb020b.u2", 0x100000, 0x100000, CRC(276b9d7b) SHA1(7a154f65b4737f2b6ac8effa3352711079f571dc) ) |
| 3488 | 3502 | ROM_LOAD( "fb021a.u3", 0x200000, 0x100000, CRC(7da15d37) SHA1(345cf2242e8210a697294a45197f2b3b974de885) ) |
| 3489 | 3503 | ROM_LOAD( "fb021b.u4", 0x300000, 0x100000, CRC(6a512d7b) SHA1(7fc3002d23262a9a590a283ea9e111e38d889ef2) ) |
| 3490 | ROM_LOAD( "fb022a.u5", 0x400000, 0x080000, CRC(60aa1282) SHA1(4648816016e00df3256226ba5134f6e5bb429909) ) | |
| 3491 | ROM_LOAD( "fb022b.u6", 0x480000, 0x080000, CRC(cd05a5c8) SHA1(9f000cca8d31e19fdc4b38c00c3ed13f71e5541c) ) | |
| 3492 | ROM_LOAD( "fb023.u7", 0x500000, 0x100000, CRC(132794bd) SHA1(bcc73c3183c59a4b66f79d04774773b8a9239501) ) | |
| 3504 | ROM_LOAD( "fb-22a.u5", 0x400000, 0x100000, CRC(9039e5d3) SHA1(222452cd7947f7c99c68e495835cca62e0449b5c) ) | |
| 3505 | ROM_LOAD( "fb-22b.u6", 0x500000, 0x100000, CRC(96ac9e54) SHA1(2b066375963dc57fe2ce89d65f6c0a9d183a838d) ) | |
| 3506 | ROM_LOAD( "fb023.u7", 0x600000, 0x100000, CRC(132794bd) SHA1(bcc73c3183c59a4b66f79d04774773b8a9239501) ) | |
| 3493 | 3507 | |
| 3494 | 3508 | ROM_REGION( 0x400000, "gfx2", 0 ) /* Tiles (scrambled) */ |
| 3495 | 3509 | ROM_LOAD( "fb010.u65", 0x000000, 0x100000, CRC(296ffd92) SHA1(183a28e4594c428deb4726ed22d5166592b94b60) ) // 42 pin mask rom |
| 3496 | 3510 | ROM_LOAD( "fb011.u66", 0x100000, 0x080000, CRC(500a0367) SHA1(6dc5190f81b21f59ee56a3b2332c8d86d6599782) ) // 40 pin mask rom (verified correct) |
| 3497 | 3511 | |
| 3498 | ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */ | |
| 3499 | ROM_LOAD( "fb000j.u43", 0x000000, 0x080000, CRC(a7522555) SHA1(ea88d90dda20bc309f98a1924c41551e7708e6af) ) // 2 x $40000 | |
| 3500 | ROM_LOAD( "fb001j_u.101", 0x080000, 0x080000, CRC(07d4e8e2) SHA1(0de911f452ddeb54b0b435b9c1cf5d5881175d44) ) // 2 x $40000 | |
| 3501 | 3512 | |
| 3502 | ROM_REGION( 0x100000, "oki2", 0 ) /* Samples */ | |
| 3503 | ROM_LOAD( "fb002.u44", 0x000000, 0x080000, CRC(05d7c2a9) SHA1(e34d395985caec10139a22daa179bb185df157d6) ) // 2 x $40000 | |
| 3504 | ROM_LOAD( "fb003.u45", 0x080000, 0x080000, CRC(405722e9) SHA1(92e51093d50f74f650ba137f5fc2910e0f85337e) ) // 2 x $40000 | |
| 3513 | ROM_REGION( 0x300000, "samples", 0 ) | |
| 3514 | ROM_LOAD( "fb000j.u43", 0x000000, 0x080000, CRC(a7522555) SHA1(ea88d90dda20bc309f98a1924c41551e7708e6af) ) | |
| 3515 | ROM_LOAD( "fb001j_u.101", 0x080000, 0x080000, CRC(07d4e8e2) SHA1(0de911f452ddeb54b0b435b9c1cf5d5881175d44) ) | |
| 3516 | ||
| 3517 | /* Sound data is copied here during driver init */ | |
| 3518 | ROM_REGION( 0x400000*16, "oki1", 0 ) | |
| 3519 | ROM_FILL( 0x00000, 0x400000*16, 0x00 ) | |
| 3520 | ||
| 3521 | ROM_REGION( 0x200000, "oki2", 0 ) | |
| 3522 | ROM_LOAD( "fb-002.u45", 0x000000, 0x100000, CRC(010acc17) SHA1(2dc0897c7778eacf6bce12ff0adbadb307ea6c17) ) | |
| 3523 | ROM_LOAD( "fb-003.u44", 0x100000, 0x100000, CRC(0aea4ac5) SHA1(8f3b30e505b0ba51c140a0a2c071680d4fa05db9) ) | |
| 3505 | 3524 | ROM_END |
| 3506 | 3525 | |
| 3507 | 3526 | /*************************************************************************** |
| r5613 | r5614 | |
| 3616 | 3635 | |
| 3617 | 3636 | ***************************************************************************/ |
| 3618 | 3637 | |
| 3638 | ||
| 3619 | 3639 | ROM_START( brapboys ) /* Single PCB, fully populated, no rom sub board */ |
| 3620 | 3640 | ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 Code */ |
| 3621 | 3641 | ROM_LOAD16_BYTE( "rb-030.u61", 0x000000, 0x020000, CRC(ccbe9a53) SHA1(b96baf0ecbf6550bfaf8e512d9275c53a3928bee) ) |
| r5613 | r5614 | |
| 3799 | 3819 | DRIVER_INIT_CALL(kaneko16); |
| 3800 | 3820 | // MCU is a 78K series III type CPU |
| 3801 | 3821 | } |
| 3802 | ||
| 3803 | static DRIVER_INIT( brapboys ) | |
| 3822 | static void expand_shogwarr_samples(running_machine* machine) | |
| 3804 | 3823 | { |
| 3805 | 3824 | /* |
| 3806 | 3825 | Expand the OKI sample data |
| r5613 | r5614 | |
| 3808 | 3827 | OKI 1: |
| 3809 | 3828 | Address space 0x00000-0x2ffff is fixed |
| 3810 | 3829 | Address space 0x30000-0x3ffff is banked (13 banks) |
| 3830 | */ | |
| 3811 | 3831 | |
| 3812 | OKI 2: | |
| 3813 | Address space 0x00000-0x1ffff is fixed | |
| 3814 | Address space 0x20000-0x3ffff is banked (15 banks) | |
| 3815 | ||
| 3816 | The current sound device implementation can't handle | |
| 3817 | the banking dynamically so we have to expand all the bank | |
| 3818 | combinations here and use use okim6295_set_bank_base(). | |
| 3819 | */ | |
| 3820 | 3832 | int bank; |
| 3821 | 3833 | UINT8 *src = memory_region(machine, "samples"); |
| 3822 | 3834 | UINT8 *dst1 = memory_region(machine, "oki1"); |
| 3823 | UINT8 *dst2 = memory_region(machine, "oki2"); | |
| 3824 | 3835 | |
| 3825 | 3836 | /* OKI 1 */ |
| 3826 | 3837 | for (bank = 0; bank < 13; ++bank) |
| r5613 | r5614 | |
| 3833 | 3844 | memcpy(dst, src, 0x30000); |
| 3834 | 3845 | memcpy(dst + 0x30000, srcn, 0x10000); |
| 3835 | 3846 | } |
| 3847 | } | |
| 3836 | 3848 | |
| 3849 | static void expand_brapboys_music(running_machine* machine) | |
| 3850 | { | |
| 3851 | /* | |
| 3852 | Expand the OKI sample data | |
| 3853 | ||
| 3854 | OKI 2: | |
| 3855 | Address space 0x00000-0x1ffff is fixed | |
| 3856 | Address space 0x20000-0x3ffff is banked (15 banks) | |
| 3857 | */ | |
| 3858 | ||
| 3859 | int bank; | |
| 3860 | UINT8 *src = memory_region(machine, "samples"); | |
| 3861 | UINT8 *dst2 = memory_region(machine, "oki2"); | |
| 3862 | ||
| 3837 | 3863 | /* OKI 2 */ |
| 3838 | 3864 | for (bank = 0; bank < 15; ++bank) |
| 3839 | 3865 | { |
| r5613 | r5614 | |
| 3844 | 3870 | memcpy(dst, src + 0x100000, 0x20000); |
| 3845 | 3871 | memcpy(dst + 0x20000, srcn, 0x20000); |
| 3846 | 3872 | } |
| 3873 | } | |
| 3847 | 3874 | |
| 3875 | static DRIVER_INIT( shogwarr ) | |
| 3876 | { | |
| 3877 | expand_shogwarr_samples(machine); | |
| 3848 | 3878 | DRIVER_INIT_CALL(calc3); |
| 3849 | 3879 | } |
| 3850 | 3880 | |
| 3851 | 3881 | |
| 3882 | static DRIVER_INIT( brapboys ) | |
| 3883 | { | |
| 3884 | expand_shogwarr_samples(machine); | |
| 3885 | // sample banking is different on brap boys for the music, why? GALs / PALs ? | |
| 3886 | expand_brapboys_music(machine); | |
| 3887 | DRIVER_INIT_CALL(calc3); | |
| 3888 | } | |
| 3889 | ||
| 3890 | ||
| 3852 | 3891 | /*************************************************************************** |
| 3853 | 3892 | |
| 3854 | 3893 | |
| r5613 | r5614 | |
| 3878 | 3917 | // some functionality of the protection chip still needs investigating on these, but they seem to be playable |
| 3879 | 3918 | GAME( 1992, brapboys, 0, shogwarr, brapboys, brapboys, ROT0, "Kaneko", "B.Rap Boys (World)", 0 ) |
| 3880 | 3919 | GAME( 1992, brapboysj,brapboys, shogwarr, brapboys, brapboys, ROT0, "Kaneko", "B.Rap Boys Special (Japan)", 0 ) |
| 3920 | GAME( 1992, shogwarr, 0, shogwarr, shogwarr, shogwarr, ROT0, "Kaneko", "Shogun Warriors (US)", 0 ) | |
| 3921 | GAME( 1992, shogwarre,shogwarr, shogwarr, shogwarr, shogwarr, ROT0, "Kaneko", "Shogun Warriors (World)", 0 ) | |
| 3922 | GAME( 1992, fjbuster, shogwarr, shogwarr, shogwarr, shogwarr, ROT0, "Kaneko", "Fujiyama Buster (Japan)", 0 ) | |
| 3881 | 3923 | |
| 3882 | /* Non-working games (mainly due to protection) */ | |
| 3883 | ||
| 3884 | GAME( 1992, shogwarr, 0, shogwarr, shogwarr, calc3, ROT0, "Kaneko", "Shogun Warriors", GAME_NOT_WORKING ) | |
| 3885 | GAME( 1992, shogwarre,shogwarr, shogwarr, shogwarr, calc3, ROT0, "Kaneko", "Shogun Warriors (Euro)", GAME_NOT_WORKING ) | |
| 3886 | GAME( 1992, fjbuster, shogwarr, shogwarr, shogwarr, calc3, ROT0, "Kaneko", "Fujiyama Buster (Japan)", GAME_NOT_WORKING ) | |
| 3887 |
| r5613 | r5614 | |
|---|---|---|
| 456 | 456 | ROM_START( mrdrilr2 ) |
| 457 | 457 | ROM_REGION32_LE( 0x800000, "user1", 0 ) /* main prg */ |
| 458 | 458 | ROM_LOAD( "dr21vera.1a", 0x000000, 0x800000, CRC(f93532a2) SHA1(8b72f2868978be1f0e0abd11425a3c8b2b0c4e99) ) |
| 459 | ||
| 460 | ROM_REGION( 0x4000000, "user2", 0 ) /* main prg */ | |
| 461 | ROM_LOAD( "dr21ma1.1d", 0x0000000, 0x1000000, CRC(26dc6f55) SHA1(a9cedf547fa7a4d5850b9b3b867d46e577a035e0) ) | |
| 462 | ROM_LOAD( "dr21ma2.2d", 0x1000000, 0x1000000, CRC(702556ff) SHA1(c95defd5fd6a9b406fc8d8f28ecfab732ef1ff42) ) | |
| 459 | 463 | ROM_END |
| 460 | 464 | |
| 465 | ROM_START( mrdrlr2a ) | |
| 466 | ROM_REGION32_LE( 0x800000, "user1", 0 ) /* main prg */ | |
| 467 | ROM_LOAD( "dr22vera.1a", 0x000000, 0x800000, CRC(f2633388) SHA1(42e56c9758ee833390003d4b41956f75f5a22760) ) | |
| 468 | ||
| 469 | ROM_REGION( 0x4000000, "user2", 0 ) /* main prg */ | |
| 470 | ROM_LOAD( "dr21ma1.1d", 0x0000000, 0x1000000, CRC(26dc6f55) SHA1(a9cedf547fa7a4d5850b9b3b867d46e577a035e0) ) | |
| 471 | ROM_LOAD( "dr21ma2.2d", 0x1000000, 0x1000000, CRC(702556ff) SHA1(c95defd5fd6a9b406fc8d8f28ecfab732ef1ff42) ) | |
| 472 | ROM_END | |
| 473 | ||
| 461 | 474 | ROM_START( gjspace ) |
| 462 | 475 | ROM_REGION32_LE( 0x400000, "user1", 0 ) /* bios */ |
| 463 | 476 | ROM_FILL( 0x0000000, 0x400000, 0x55 ) |
| r5613 | r5614 | |
| 508 | 521 | ROM_END |
| 509 | 522 | |
| 510 | 523 | GAME( 2000, mrdrilr2, 0, namcos10, namcos10, mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (Japan, DR21 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 524 | GAME( 2000, mrdrlr2a, mrdrilr2, namcos10, namcos10, mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (Japan, DR22 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) | |
| 511 | 525 | GAME( 2001, gjspace, 0, namcos10, namcos10, gjspace, ROT0, "Namco/Metro", "Gekitoride-Jong Space (10011 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 512 | 526 | GAME( 2001, mrdrilrg, 0, namcos10, namcos10, mrdrilrg, ROT0, "Namco", "Mr. Driller G (Japan, DRG1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 513 | 527 | GAME( 2001, knpuzzle, 0, namcos10, namcos10, knpuzzle, ROT0, "Namco", "Kotoba no Puzzle Mojipittan (Japan, KPM1 Ver.A)", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| r5613 | r5614 | |
|---|---|---|
| 2097 | 2097 | |
| 2098 | 2098 | memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, (read8_space_func)SMH_BANK(10)); |
| 2099 | 2099 | memory_set_bankptr(machine, 10, memory_region(machine, "audiocpu") + 0xe200); |
| 2100 | audio_nmi_enable_type = AUDIO_ENABLE_ | |
| 2100 | audio_nmi_enable_type = AUDIO_ENABLE_AY8910; | |
| 2101 | 2101 | } |
| 2102 | 2102 | |
| 2103 | 2103 | static DRIVER_INIT( sdtennis ) |
| r5613 | r5614 | |
|---|---|---|
| 221 | 221 | { |
| 222 | 222 | #ifdef MAME_DEBUG |
| 223 | 223 | static int toggle = 0; |
| 224 | if (input_code_pressed_once(KEYCODE_T)) toggle = 1-toggle; | |
| 224 | if (input_code_pressed_once(machine, KEYCODE_T)) toggle = 1-toggle; | |
| 225 | 225 | if (toggle) { |
| 226 | 226 | static int a = 0, w = 512; |
| 227 | 227 | int h = 256; |
| 228 | 228 | |
| 229 | if (input_code_pressed(KEYCODE_O)) w += 1; | |
| 230 | if (input_code_pressed(KEYCODE_I)) w -= 1; | |
| 229 | if (input_code_pressed(machine, KEYCODE_O)) w += 1; | |
| 230 | if (input_code_pressed(machine, KEYCODE_I)) w -= 1; | |
| 231 | 231 | |
| 232 | if (input_code_pressed(KEYCODE_U)) w += 8; | |
| 233 | if (input_code_pressed(KEYCODE_Y)) w -= 8; | |
| 232 | if (input_code_pressed(machine, KEYCODE_U)) w += 8; | |
| 233 | if (input_code_pressed(machine, KEYCODE_Y)) w -= 8; | |
| 234 | 234 | |
| 235 | if (input_code_pressed(KEYCODE_RIGHT)) a += 1; | |
| 236 | if (input_code_pressed(KEYCODE_LEFT)) a -= 1; | |
| 235 | if (input_code_pressed(machine, KEYCODE_RIGHT)) a += 1; | |
| 236 | if (input_code_pressed(machine, KEYCODE_LEFT)) a -= 1; | |
| 237 | 237 | |
| 238 | if (input_code_pressed(KEYCODE_DOWN)) a += w; | |
| 239 | if (input_code_pressed(KEYCODE_UP)) a -= w; | |
| 238 | if (input_code_pressed(machine, KEYCODE_DOWN)) a += w; | |
| 239 | if (input_code_pressed(machine, KEYCODE_UP)) a -= w; | |
| 240 | 240 | |
| 241 | if (input_code_pressed(KEYCODE_PGDN)) a += w * h; | |
| 242 | if (input_code_pressed(KEYCODE_PGUP)) a -= w * h; | |
| 241 | if (input_code_pressed(machine, KEYCODE_PGDN)) a += w * h; | |
| 242 | if (input_code_pressed(machine, KEYCODE_PGUP)) a -= w * h; | |
| 243 | 243 | |
| 244 | 244 | if (a < 0) a = 0; |
| 245 | 245 | if (a > sprites_gfx_size) a = sprites_gfx_size; |
| r5613 | r5614 | |
| 264 | 264 | int layers_ctrl = -1; |
| 265 | 265 | |
| 266 | 266 | #ifdef MAME_DEBUG |
| 267 | if (input_code_pressed(KEYCODE_Z)) | |
| 267 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 268 | 268 | { |
| 269 | 269 | int mask = 0; |
| 270 | if (input_code_pressed(KEYCODE_Q)) mask |= 1; | |
| 271 | if (input_code_pressed(KEYCODE_W)) mask |= 2; | |
| 272 | if (input_code_pressed(KEYCODE_A)) mask |= 4; | |
| 270 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; | |
| 271 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; | |
| 272 | if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4; | |
| 273 | 273 | if (mask != 0) layers_ctrl &= mask; |
| 274 | 274 | } |
| 275 | 275 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 155 | 155 | |
| 156 | 156 | if ((playmark_oki_control & 0x38) == 0x30) { |
| 157 | 157 | data = playmark_snd_command; |
| 158 | // logerror("PortB reading %02x from the 68K\n",data); | |
| 158 | // logerror("PC$%03x PortB reading %02x from the 68K\n",cpu_get_previouspc(space->cpu),data); | |
| 159 | 159 | } |
| 160 | 160 | else if ((playmark_oki_control & 0x38) == 0x28) { |
| 161 | 161 | data = (okim6295_r(devtag_get_device(space->machine, "oki"),0) & 0x0f); |
| 162 | // logerror("PortB reading %02x from the OKI status port\n",data); | |
| 162 | // logerror("PC$%03x PortB reading %02x from the OKI status port\n",cpu_get_previouspc(space->cpu),data); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | return data; |
| r5613 | r5614 | |
| 198 | 198 | |
| 199 | 199 | static WRITE8_DEVICE_HANDLER( playmark_snd_control_w ) |
| 200 | 200 | { |
| 201 | // const address_space *space = cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM); | |
| 202 | ||
| 201 | 203 | /* This port controls communications to and from the 68K, and the OKI |
| 202 | 204 | device. |
| 203 | 205 | |
| r5613 | r5614 | |
| 215 | 217 | |
| 216 | 218 | if ((data & 0x38) == 0x18) |
| 217 | 219 | { |
| 218 | // logerror("Writing %02x to OKI1, PortC=%02x, Code=%02x\n",playmark_oki_command,playmark_oki_control,playmark_snd_command); | |
| 220 | // logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",cpu_get_previouspc(space->cpu),playmark_oki_command,playmark_oki_control,playmark_snd_command); | |
| 219 | 221 | okim6295_w(device, 0, playmark_oki_command); |
| 220 | 222 | } |
| 221 | 223 | } |
| r5613 | r5614 | |
| 392 | 394 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 393 | 395 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 394 | 396 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 395 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 396 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 397 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 398 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 399 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 400 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 397 | PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) | |
| 398 | // PORT_DIPSETTING( 0x20, DEF_STR( Easy ) ) /* Seems same as Medium */ | |
| 399 | PORT_DIPSETTING( 0x30, DEF_STR( Medium ) ) | |
| 400 | PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) | |
| 401 | PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) | |
| 401 | 402 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) |
| 402 | 403 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 403 | 404 | PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) |
| r5613 | r5614 | |
|---|---|---|
| 1203 | 1203 | } |
| 1204 | 1204 | memory_set_bankptr(machine, 1, RAM); |
| 1205 | 1205 | |
| 1206 | sound_global_enable( 1 ); /* mixer enabled */ | |
| 1206 | sound_global_enable( machine, 1 ); /* mixer enabled */ | |
| 1207 | 1207 | |
| 1208 | 1208 | for( i = 0; i < DARIUS_VOL_MAX; i++ ){ |
| 1209 | 1209 | darius_vol[i] = 0x00; /* min volume */ |
| r5613 | r5614 | |
|---|---|---|
| 253 | 253 | int x,y,b; |
| 254 | 254 | |
| 255 | 255 | b = ((HD63484_reg[0xcc/2] & 0x000f) << 16) + HD63484_reg[0xce/2]; |
| 256 | /* | |
| 257 | if (input_code_pressed(KEYCODE_M)) b = 0; | |
| 258 | if (input_code_pressed(KEYCODE_Q)) b += 0x060 * 280 * 1; | |
| 259 | if (input_code_pressed(KEYCODE_W)) b += 0x060 * 280 * 2; | |
| 260 | if (input_code_pressed(KEYCODE_E)) b += 0x060 * 280 * 3; | |
| 261 | if (input_code_pressed(KEYCODE_R)) b += 0x060 * 280 * 4; | |
| 262 | if (input_code_pressed(KEYCODE_T)) b += 0x060 * 280 * 5; | |
| 263 | if (input_code_pressed(KEYCODE_Y)) b += 0x060 * 280 * 6; | |
| 264 | if (input_code_pressed(KEYCODE_U)) b += 0x060 * 280 * 7; | |
| 265 | if (input_code_pressed(KEYCODE_I)) b += 0x060 * 280 * 8; | |
| 266 | if (input_code_pressed(KEYCODE_A)) b += 0x060 * 280 * 9; | |
| 267 | if (input_code_pressed(KEYCODE_S)) b += 0x060 * 280 * 10; | |
| 268 | if (input_code_pressed(KEYCODE_D)) b += 0x060 * 280 * 11; | |
| 269 | if (input_code_pressed(KEYCODE_F)) b += 0x060 * 280 * 12; | |
| 270 | if (input_code_pressed(KEYCODE_G)) b += 0x060 * 280 * 13; | |
| 271 | if (input_code_pressed(KEYCODE_H)) b += 0x060 * 280 * 14; | |
| 272 | if (input_code_pressed(KEYCODE_J)) b += 0x060 * 280 * 15; | |
| 273 | if (input_code_pressed(KEYCODE_K)) b += 0x060 * 280 * 16; | |
| 274 | if (input_code_pressed(KEYCODE_Z)) b += 0x060 * 280 * 17; | |
| 275 | if (input_code_pressed(KEYCODE_X)) b += 0x060 * 280 * 18; | |
| 276 | if (input_code_pressed(KEYCODE_C)) b += 0x060 * 280 * 19; | |
| 277 | if (input_code_pressed(KEYCODE_V)) b += 0x060 * 280 * 20; | |
| 278 | if (input_code_pressed(KEYCODE_B)) b += 0x060 * 280 * 21; | |
| 279 | if (input_code_pressed(KEYCODE_N)) b += 0x060 * 280 * 22; | |
| 280 | */ | |
| 256 | #if 0 | |
| 257 | if (input_code_pressed(screen->machine, KEYCODE_M)) b = 0; | |
| 258 | if (input_code_pressed(screen->machine, KEYCODE_Q)) b += 0x060 * 280 * 1; | |
| 259 | if (input_code_pressed(screen->machine, KEYCODE_W)) b += 0x060 * 280 * 2; | |
| 260 | if (input_code_pressed(screen->machine, KEYCODE_E)) b += 0x060 * 280 * 3; | |
| 261 | if (input_code_pressed(screen->machine, KEYCODE_R)) b += 0x060 * 280 * 4; | |
| 262 | if (input_code_pressed(screen->machine, KEYCODE_T)) b += 0x060 * 280 * 5; | |
| 263 | if (input_code_pressed(screen->machine, KEYCODE_Y)) b += 0x060 * 280 * 6; | |
| 264 | if (input_code_pressed(screen->machine, KEYCODE_U)) b += 0x060 * 280 * 7; | |
| 265 | if (input_code_pressed(screen->machine, KEYCODE_I)) b += 0x060 * 280 * 8; | |
| 266 | if (input_code_pressed(screen->machine, KEYCODE_A)) b += 0x060 * 280 * 9; | |
| 267 | if (input_code_pressed(screen->machine, KEYCODE_S)) b += 0x060 * 280 * 10; | |
| 268 | if (input_code_pressed(screen->machine, KEYCODE_D)) b += 0x060 * 280 * 11; | |
| 269 | if (input_code_pressed(screen->machine, KEYCODE_F)) b += 0x060 * 280 * 12; | |
| 270 | if (input_code_pressed(screen->machine, KEYCODE_G)) b += 0x060 * 280 * 13; | |
| 271 | if (input_code_pressed(screen->machine, KEYCODE_H)) b += 0x060 * 280 * 14; | |
| 272 | if (input_code_pressed(screen->machine, KEYCODE_J)) b += 0x060 * 280 * 15; | |
| 273 | if (input_code_pressed(screen->machine, KEYCODE_K)) b += 0x060 * 280 * 16; | |
| 274 | if (input_code_pressed(screen->machine, KEYCODE_Z)) b += 0x060 * 280 * 17; | |
| 275 | if (input_code_pressed(screen->machine, KEYCODE_X)) b += 0x060 * 280 * 18; | |
| 276 | if (input_code_pressed(screen->machine, KEYCODE_C)) b += 0x060 * 280 * 19; | |
| 277 | if (input_code_pressed(screen->machine, KEYCODE_V)) b += 0x060 * 280 * 20; | |
| 278 | if (input_code_pressed(screen->machine, KEYCODE_B)) b += 0x060 * 280 * 21; | |
| 279 | if (input_code_pressed(screen->machine, KEYCODE_N)) b += 0x060 * 280 * 22; | |
| 280 | #endif | |
| 281 | 281 | for (y = 0;y < 280;y++) |
| 282 | 282 | { |
| 283 | 283 | for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4) |
| r5613 | r5614 | |
| 290 | 290 | b++; |
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | if (!input_code_pressed(KEYCODE_O)) | |
| 293 | if (!input_code_pressed(screen->machine, KEYCODE_O)) | |
| 294 | 294 | if ((HD63484_reg[0x06/2] & 0x0300) == 0x0300) |
| 295 | 295 | { |
| 296 | 296 | int sy = (HD63484_reg[0x94/2] & 0x0fff) - (HD63484_reg[0x88/2] >> 8); |
| r5613 | r5614 | |
|---|---|---|
| 167 | 167 | crbaloon_set_clear_collision_address((data & 0x01) ? TRUE : FALSE); |
| 168 | 168 | |
| 169 | 169 | /* D1 - SOUND STOP */ |
| 170 | sound_global_enable((data & 0x02) ? TRUE : FALSE); | |
| 170 | sound_global_enable(space->machine, (data & 0x02) ? TRUE : FALSE); | |
| 171 | 171 | |
| 172 | 172 | /* D2 - unlabeled - music enable */ |
| 173 | 173 | crbaloon_audio_set_music_enable(discrete, 0, (data & 0x04) ? TRUE : FALSE); |
| r5613 | r5614 | |
|---|---|---|
| 262 | 262 | |
| 263 | 263 | static INTERRUPT_GEN( cmmb_irq ) |
| 264 | 264 | { |
| 265 | //if(input_code_pressed_once(KEYCODE_Z)) | |
| 265 | //if(input_code_pressed_once(device->machine, KEYCODE_Z)) | |
| 266 | 266 | // cpu_set_input_line(device, 0, HOLD_LINE); |
| 267 | 267 | } |
| 268 | 268 |
| r5613 | r5614 | |
|---|---|---|
| 815 | 815 | ROM_LOAD( "jokerpoker_icb_9-30-86", 0x10000, 0x2000, CRC(a1473367) SHA1(9b37ccafc02704e8f1d61150326494e86148d84e) ) |
| 816 | 816 | ROM_LOAD( "blackjack_icb_9-30-86", 0x12000, 0x2000, CRC(82804184) SHA1(2e2e6a80c99c8eb226dc54c1d32d0bf24de300a4) ) |
| 817 | 817 | ROM_LOAD( "casinoslots_icb_9-30-86", 0x14000, 0x2000, CRC(713c3963) SHA1(a9297c04fc44522ca6891516a2c744712132896a) ) |
| 818 | ROM_LOAD( "instantbingo_t24_10-07-86", 0x16000, 0x2000, CRC(de87ed0a) SHA1(4a26d93368c1a39dd38aabe450c34203101f0ef7) ) /* Found with this set, is it compatible or an operater swap? */ | |
| 818 | ROM_LOAD( "beatthespread_icb_9-30-86", 0x16000, 0x2000, CRC(93654d2a) SHA1(3aa5a54b91867c03182e93a7f1607545503a33f7) ) | |
| 819 | ROM_LOAD( "instantbingo_t24_10-07-86", 0x18000, 0x2000, CRC(de87ed0a) SHA1(4a26d93368c1a39dd38aabe450c34203101f0ef7) ) /* Found with this set, is it compatible or an operater swap? */ | |
| 819 | 820 | ROM_END |
| 820 | 821 | |
| 821 | 822 | ROM_START( gepoker2 ) /* v50.02 with control dated 9-30-84 */ |
| r5613 | r5614 | |
|---|---|---|
| 300 | 300 | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | { | |
| 304 | FILE*FP; | |
| 303 | /* Uncommented until actively worked on | |
| 304 | { | |
| 305 | FILE*FP; | |
| 305 | 306 | |
| 306 | ||
| 307 | FP=fopen("hshavoc.dump","wb"); | |
| 307 | 308 | |
| 308 | fwrite(src, rom_size/2, 2, FP); | |
| 309 | fclose(FP); | |
| 310 | } | |
| 309 | fwrite(src, rom_size/2, 2, FP); | |
| 310 | fclose(FP); | |
| 311 | } | |
| 312 | */ | |
| 311 | 313 | |
| 312 | 314 | |
| 313 | ||
| 314 | 315 | DRIVER_INIT_CALL(genesis); |
| 315 | 316 | |
| 316 | 317 | } |
| r5613 | r5614 | |
|---|---|---|
| 78 | 78 | AM_RANGE(0xe000, 0xe1ff) AM_RAM_WRITE(speedbal_background_videoram_w) AM_BASE(&speedbal_background_videoram) |
| 79 | 79 | AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(speedbal_foreground_videoram_w) AM_BASE(&speedbal_foreground_videoram) |
| 80 | 80 | AM_RANGE(0xf000, 0xf5ff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_be_w) AM_BASE(&paletteram) |
| 81 | AM_RANGE(0xf600, 0xfeff) AM_RAM | |
| 81 | AM_RANGE(0xf600, 0xfeff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) | |
| 82 | 82 | AM_RANGE(0xff00, 0xffff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) |
| 83 | 83 | ADDRESS_MAP_END |
| 84 | 84 | |
| r5613 | r5614 | |
| 238 | 238 | MDRV_CPU_IO_MAP(sound_cpu_io_map) |
| 239 | 239 | MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,8) |
| 240 | 240 | |
| 241 | MDRV_NVRAM_HANDLER(generic_1fill) | |
| 242 | ||
| 241 | 243 | /* video hardware */ |
| 242 | 244 | MDRV_SCREEN_ADD("screen", RASTER) |
| 243 | 245 | MDRV_SCREEN_REFRESH_RATE(60) |
| r5613 | r5614 | |
|---|---|---|
| 141 | 141 | |
| 142 | 142 | static READ16_HANDLER( littlerb_vdp_r ) |
| 143 | 143 | { |
| 144 | logerror("%06x littlerb_vdp_r offs %04x mask %04x\n", cpu_get_pc(space->cpu), offset, mem_mask); | |
| 145 | ||
| 144 | 146 | switch (offset) |
| 145 | 147 | { |
| 146 | 148 | case 0: |
| r5613 | r5614 | |
| 159 | 161 | return -1; |
| 160 | 162 | } |
| 161 | 163 | |
| 164 | int type2_writes = 0; | |
| 165 | UINT32 lasttype2pc = 0; | |
| 162 | 166 | static WRITE16_HANDLER( littlerb_vdp_w ) |
| 163 | 167 | { |
| 168 | ||
| 169 | if (offset!=2) | |
| 170 | { | |
| 171 | if (type2_writes) | |
| 172 | { | |
| 173 | if (type2_writes>2) | |
| 174 | { | |
| 175 | logerror("******************************* BIG WRITE OCCURRED BEFORE THIS!!! ****************************\n"); | |
| 176 | } | |
| 177 | ||
| 178 | logerror("~%06x previously wrote %08x data bytes\n", lasttype2pc, type2_writes*2); | |
| 179 | type2_writes = 0; | |
| 180 | } | |
| 181 | ||
| 182 | logerror("%06x littlerb_vdp_w offs %04x data %04x mask %04x\n", cpu_get_pc(space->cpu), offset, data, mem_mask); | |
| 183 | } | |
| 184 | else | |
| 185 | { | |
| 186 | if (mem_mask==0xffff) | |
| 187 | { | |
| 188 | if (type2_writes==0) | |
| 189 | { | |
| 190 | logerror("data write started %06x %04x data %04x mask %04x\n", cpu_get_pc(space->cpu), offset, data, mem_mask); | |
| 191 | } | |
| 192 | ||
| 193 | type2_writes++; | |
| 194 | lasttype2pc = cpu_get_pc(space->cpu); | |
| 195 | } | |
| 196 | else | |
| 197 | { | |
| 198 | logerror("xxx %06x littlerb_vdp_w offs %04x data %04x mask %04x\n", cpu_get_pc(space->cpu), offset, data, mem_mask); | |
| 199 | } | |
| 200 | } | |
| 201 | ||
| 202 | ||
| 164 | 203 | switch (offset) |
| 165 | 204 | { |
| 166 | 205 | case 0: |
| r5613 | r5614 | |
| 359 | 398 | return 0; |
| 360 | 399 | } |
| 361 | 400 | |
| 401 | static INTERRUPT_GEN( littlerb ) | |
| 402 | { | |
| 403 | logerror("IRQ\n"); | |
| 404 | cpu_set_input_line(device, 4, HOLD_LINE); | |
| 405 | } | |
| 406 | ||
| 362 | 407 | static MACHINE_DRIVER_START( littlerb ) |
| 363 | 408 | MDRV_CPU_ADD("maincpu", M68000, 12000000) |
| 364 | 409 | MDRV_CPU_PROGRAM_MAP(littlerb_main) |
| 365 | MDRV_CPU_VBLANK_INT("screen", | |
| 410 | MDRV_CPU_VBLANK_INT("screen", | |
| 366 | 411 | |
| 367 | 412 | |
| 368 | 413 | MDRV_SCREEN_ADD("screen", RASTER) |
| r5613 | r5614 | |
|---|---|---|
| 1 | /* Chihiro Skeleton | |
| 2 | -- split from Naomi.c | |
| 1 | /* | |
| 3 | 2 | |
| 4 | Chihiro uses | |
| 3 | Chihiro is an Xbox based arcade motherboard from SEGA | |
| 4 | A Chihiro system consists of network board, media board, base board & Xbox board | |
| 5 | 5 | |
| 6 | custom XBOX motherboard + bios | |
| 6 | The whole system is divided into 2 parts and each part has two boards. | |
| 7 | The upper part contains a media board with a TSOP48 where there is an xbox .xbe loader | |
| 8 | (this is the dashboard you see when you power the Chihiro) and for a network board (100% the same | |
| 9 | as the one in the Triforce v3, same firmware also) | |
| 7 | 10 | |
| 11 | The bottom section consists of an Xbox board with 128MB of RAM and with a different MCPX than | |
| 12 | a retail one and a base board that handles JVS and Video. | |
| 13 | ||
| 14 | Network Board Dump : Ver1305.bin | |
| 15 | Media Board dump : FPR21042_M29W160ET.bin | |
| 16 | Base Board Dumps : ic10_g24lc64.bin ic11_24lc024.bin pc20_g24lc64.bin | |
| 17 | Xbox Board Dump : Not dumped | |
| 18 | ||
| 19 | FPR21042_M29W160ET.bin : | |
| 20 | As in Triforce, it consists of two versions in the same flash, the first MB of the flash has | |
| 21 | an older version as backup, and the second MB has the current version, versions included are: | |
| 22 | SegaBoot Ver.2.00.0 Build:Feb 7 2003 12:28:30 | |
| 23 | SegaBoot Ver.2.13.0 Build:Mar 3 2005 17:03:15 | |
| 24 | ||
| 25 | ic10_g24lc64.bin: This dump contains the firmware of the Base Board, serial number and REGION of the whole system | |
| 26 | Region is located at Offset 0x00001F10 , 01 means JAP, 02 Means USA, 03 Means EXPORT, if you | |
| 27 | want to change the region of your Chihiro Board, just change this byte. | |
| 28 | pc20_g24lc64.bin: it seems a backup of the base board without region or serial, older version maybe? | |
| 29 | ic11_24lc024.bin: this is the mysterious one, as the previous 2, its on the Base Board, and just contains some | |
| 30 | strings the interesting thing is that it contains the string SBJE and if you go to the system info menu | |
| 31 | on the Chihiro and you press service button 16 times in a row, a message will be displayed: GAME ID SBJE | |
| 32 | ||
| 33 | Thanks to Alex, Mr Mudkips, and Philip Burke for this info. | |
| 34 | ||
| 8 | 35 | */ |
| 9 | 36 | |
| 10 | 37 | #include "driver.h" |
| r5613 | r5614 | |
|---|---|---|
| 292 | 292 | int x,y; |
| 293 | 293 | static int base = 0; |
| 294 | 294 | |
| 295 | if ( input_code_pressed_once(KEYCODE_E) ) | |
| 295 | if ( input_code_pressed_once(screen->machine, KEYCODE_E) ) | |
| 296 | 296 | base += 512*512; |
| 297 | 297 | |
| 298 | if ( input_code_pressed_once(KEYCODE_Q) ) | |
| 298 | if ( input_code_pressed_once(screen->machine, KEYCODE_Q) ) | |
| 299 | 299 | base -= 512*512; |
| 300 | 300 | |
| 301 | 301 | if (base<0x000000) base = 0x000000; |
| r5613 | r5614 | |
| 306 | 306 | copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0); |
| 307 | 307 | bitmap_fill(wheelfir_tmp_bitmap[0], video_screen_get_visible_area(screen),0); |
| 308 | 308 | |
| 309 | if ( input_code_pressed(KEYCODE_R) ) | |
| 309 | if ( input_code_pressed(screen->machine, KEYCODE_R) ) | |
| 310 | 310 | { |
| 311 | 311 | const UINT8 *gfx = memory_region(machine, "gfx1"); |
| 312 | 312 | for (y=0;y<128;y++) |
| r5613 | r5614 | |
|---|---|---|
| 19 | 19 | X1-014 Sprites? |
| 20 | 20 | |
| 21 | 21 | ------------------------------------------------------------------------------- |
| 22 | Ordered by Board Year + Game Licensed To | |
| 22 | Ordered by Board Year + Game Licensed To | |
| 23 | 23 | ------------------------------------------------------------------------------- |
| 24 | P0-029-A (M6100287A) 88 Thundercade / Twin Formation (1) Taito | |
| 25 | ? (M6100326A) 88 Twin Eagle Taito | |
| 26 | P0-045-A (M6100429A) 89 DownTown Taito / RomStar | |
| 27 | ? (M6100430A) 89 U.S. Classic(2) Taito / RomStar | |
| 28 | ? 88 Caliber 50 Taito / RomStar | |
| 29 | ? 89 Arbalester Taito / RomStar | |
| 24 | P0-029-A (M6100287A) 88 Thundercade / Twin Formation (1) Taito | |
| 25 | ? (M6100326A) 88 Twin Eagle Taito | |
| 26 | P0-045-A (M6100429A) 89 DownTown Taito / RomStar | |
| 27 | ? (M6100430A) 89 U.S. Classic(2) Taito / RomStar | |
| 28 | ? 88 Caliber 50 Taito / RomStar | |
| 29 | ? 89 Arbalester Taito / RomStar | |
| 30 | 30 | P1-036-A + P0-045-A + |
| 31 | P1-049-A 89 Meta Fox Taito / RomStar | |
| 32 | P0-053-1 89 Castle of Dragon/Dragon Unit Taito / RomStar / Athena | |
| 33 | P0-053-A 91 Strike Gunner S.T.G Athena / Tecmo | |
| 34 | P0-053-A 92 Quiz Kokology Tecmo | |
| 35 | P0-055-B 89 Wit's Athena | |
| 36 | P0-055-D 90 Thunder & Lightning Romstar / Visco | |
| 37 | Promat PCB 94 Wiggie Waggie(5) -- | |
| 38 | P0-058-C 98 Internation Toote (6) Coinmaster | |
| 39 | P0-063-A 91 Rezon Allumer | |
| 40 | P0-068-B (M6100723A) 92 Block Carnival Visco | |
| 41 | P0-072-2 (prototype) 92 Blandia (prototype) Allumer | |
| 42 | P0-077-A (BP922) 92 Ultraman Club Banpresto | |
| 43 | PO-078-A 92 Blandia Allumer | |
| 44 | P0-079-A 92 Zing Zing Zip Allumer + Tecmo | |
| 45 | P0-079-A 94 Eight Forces Tecmo | |
| 46 | PO-080-A (BP923) 92 SD Gundam Neo Battling (3) Banpresto | |
| 47 | ? 93 Athena no Hatena? Athena | |
| 48 | ? 93 J.J.Squawkers Athena / Able | |
| 49 | ? (93111A) 93 War Of Aero Yang Cheng | |
| 50 | P0-081-A 93 Mobile Suit Gundam Banpresto | |
| 51 | PO-083-A (BP931) 93 Ultra Toukon Densetsu Banpresto + Tsuburaya Prod. | |
| 52 | PO-092-A 93 Daioh Athena | |
| 53 | PO-096-A (BP934KA) 93 Kamen Rider Banpresto | |
| 54 | P0-097-A 93 Oishii Puzzle .. Sunsoft + Atlus | |
| 55 | bootleg 9? Triple Fun (4) bootleg (Comad?) | |
| 56 | P0-100-A 93 Quiz Kokology 2 Tecmo | |
| 57 | P0-101-1 94 Pro Mahjong Kiwame Athena | |
| 58 | PO-102-A 93 Mad Shark Allumer | |
| 59 | PO-107-A (prototype?) 94 Orbs (prototype?) American Sammy | |
| 60 | P0-114-A (SKB-001) 94 Krazy Bowl American Sammy | |
| 61 | P0-117-A (DH-01) 95 Extreme Downhill Sammy Japan | |
| 62 | P0-117-A? 95 Sokonuke Taisen Game Sammy Industries | |
| 63 | P0-120-A (BP954KA) 95 Gundhara Banpresto | |
| 64 | PO-122-A (SZR-001) 95 Zombie Raid American Sammy | |
| 65 | ? 96 Crazy Fight Subsino | |
| 31 | P1-049-A 89 Meta Fox Taito / RomStar | |
| 32 | P0-053-1 89 Castle of Dragon/Dragon Unit Taito / RomStar / Athena | |
| 33 | P0-053-A 91 Strike Gunner S.T.G Athena / Tecmo | |
| 34 | P0-053-A 92 Quiz Kokology Tecmo | |
| 35 | P0-055-B 89 Wit's Athena | |
| 36 | P0-055-D 90 Thunder & Lightning Romstar / Visco | |
| 37 | Promat PCB 94 Wiggie Waggie(5) -- | |
| 38 | P0-058-C 98 Internation Toote (6) Coinmaster | |
| 39 | P0-063-A 91 Rezon Allumer | |
| 40 | P0-068-B (M6100723A) 92 Block Carnival Visco | |
| 41 | P0-072-2 (prototype) 92 Blandia (prototype) Allumer | |
| 42 | P0-077-A (BP922) 92 Ultraman Club Banpresto | |
| 43 | PO-078-A 92 Blandia Allumer | |
| 44 | P0-079-A 92 Zing Zing Zip Allumer + Tecmo | |
| 45 | P0-079-A 94 Eight Forces Tecmo | |
| 46 | PO-080-A (BP923) 92 SD Gundam Neo Battling (3) Banpresto | |
| 47 | ? 93 Athena no Hatena? Athena | |
| 48 | ? 93 J.J.Squawkers Athena / Able | |
| 49 | ? (93111A) 93 War Of Aero Yang Cheng | |
| 50 | P0-081-A 93 Mobile Suit Gundam Banpresto | |
| 51 | PO-083-A (BP931) 93 Ultra Toukon Densetsu Banpresto + Tsuburaya Prod. | |
| 52 | PO-092-A 93 Daioh Athena | |
| 53 | PO-096-A (BP934KA) 93 Kamen Rider Banpresto | |
| 54 | P0-097-A 93 Oishii Puzzle .. Sunsoft + Atlus | |
| 55 | bootleg 9? Triple Fun (4) bootleg (Comad?) | |
| 56 | P0-100-A 93 Quiz Kokology 2 Tecmo | |
| 57 | P0-101-1 94 Pro Mahjong Kiwame Athena | |
| 58 | PO-102-A 93 Mad Shark Allumer | |
| 59 | PO-107-A (prototype?) 94 Orbs (prototype?) American Sammy | |
| 60 | PO-107-A 93 Kero Kero Keroppi no Issyoni Asobou Sammy Industries [added Chack'n, Hau] | |
| 61 | P0-114-A (SKB-001) 94 Krazy Bowl American Sammy | |
| 62 | P0-117-A (DH-01) 95 Extreme Downhill Sammy Japan | |
| 63 | P0-117-A? 95 Sokonuke Taisen Game Sammy Industries | |
| 64 | P0-120-A (BP954KA) 95 Gundhara Banpresto | |
| 65 | PO-122-A (SZR-001) 95 Zombie Raid American Sammy | |
| 66 | ? 96 Crazy Fight Subsino | |
| 66 | 67 | ------------------------------------------------------------------------------- |
| 67 | 68 | (1) YM2203 + YM3812 instead of X1-010 |
| 68 | 69 | (2) wrong colors |
| r5613 | r5614 | |
| 1983 | 1984 | ADDRESS_MAP_END |
| 1984 | 1985 | |
| 1985 | 1986 | /*************************************************************************** |
| 1987 | Kero Kero Keroppi no Issyoni Asobou | |
| 1988 | ***************************************************************************/ | |
| 1989 | ||
| 1990 | static int keroppi_prize_hop; | |
| 1991 | static int keroppi_protection_count; | |
| 1992 | static const UINT16 keroppi_protection_word[] = { | |
| 1993 | 0x0000, | |
| 1994 | 0x0000, 0x0000, 0x0000, | |
| 1995 | 0x2000, 0x2000, 0x2000, | |
| 1996 | 0x2000, 0x2000, 0x2000, | |
| 1997 | 0x0400, 0x0400, 0x0400, | |
| 1998 | 0x0000, 0x0000, 0x0000 | |
| 1999 | }; | |
| 2000 | ||
| 2001 | ||
| 2002 | static READ16_HANDLER( keroppi_protection_r ) | |
| 2003 | { | |
| 2004 | UINT16 result = keroppi_protection_word[keroppi_protection_count]; | |
| 2005 | ||
| 2006 | keroppi_protection_count++; | |
| 2007 | if (keroppi_protection_count > 15) | |
| 2008 | keroppi_protection_count = 15; | |
| 2009 | ||
| 2010 | return result; | |
| 2011 | } | |
| 2012 | ||
| 2013 | static READ16_HANDLER( keroppi_protection_init_r ) | |
| 2014 | { | |
| 2015 | keroppi_protection_count = 0; | |
| 2016 | ||
| 2017 | return 0x00; | |
| 2018 | } | |
| 2019 | ||
| 2020 | static READ16_HANDLER( keroppi_coin_r ) | |
| 2021 | { | |
| 2022 | UINT16 result = input_port_read(space->machine, "COINS"); | |
| 2023 | ||
| 2024 | if (keroppi_prize_hop == 2) | |
| 2025 | { | |
| 2026 | result &= ~0x0002; /* prize hopper */ | |
| 2027 | keroppi_prize_hop = 0; | |
| 2028 | } | |
| 2029 | ||
| 2030 | return result; | |
| 2031 | } | |
| 2032 | ||
| 2033 | static TIMER_CALLBACK( keroppi_prize_hop_callback ) | |
| 2034 | { | |
| 2035 | keroppi_prize_hop = 2; | |
| 2036 | } | |
| 2037 | ||
| 2038 | static WRITE16_HANDLER( keroppi_prize_w ) | |
| 2039 | { | |
| 2040 | if ((data & 0x0010) && !keroppi_prize_hop) | |
| 2041 | { | |
| 2042 | keroppi_prize_hop = 1; | |
| 2043 | timer_set(space->machine, ATTOTIME_IN_SEC(3), NULL, 0x20, keroppi_prize_hop_callback); /* 3 seconds */ | |
| 2044 | } | |
| 2045 | } | |
| 2046 | ||
| 2047 | static ADDRESS_MAP_START( keroppi_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 2048 | AM_RANGE(0x000000, 0x07ffff) AM_ROM // ROM | |
| 2049 | AM_RANGE(0xf00000, 0xf0ffff) AM_RAM // RAM | |
| 2050 | AM_RANGE(0x100000, 0x100001) AM_READ(keroppi_protection_r) // | |
| 2051 | AM_RANGE(0x200000, 0x200001) AM_READ(keroppi_protection_init_r) // | |
| 2052 | AM_RANGE(0x300000, 0x300003) AM_READ(seta_dsw_r) // DSW | |
| 2053 | AM_RANGE(0x400000, 0x400001) AM_WRITENOP // ? | |
| 2054 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("P1") // P1 | |
| 2055 | AM_RANGE(0x500002, 0x500003) AM_READ_PORT("P2") // P2 | |
| 2056 | AM_RANGE(0x500004, 0x500005) AM_READ(keroppi_coin_r) // Coins | |
| 2057 | AM_RANGE(0x8000f0, 0x8000f1) AM_RAM // NVRAM | |
| 2058 | AM_RANGE(0x800100, 0x8001ff) AM_RAM // NVRAM | |
| 2059 | AM_RANGE(0x900000, 0x900001) AM_WRITENOP // ? | |
| 2060 | AM_RANGE(0x900002, 0x900003) AM_WRITE(keroppi_prize_w) // | |
| 2061 | AM_RANGE(0xa00000, 0xa03fff) AM_DEVREADWRITE("x1", seta_sound_word_r,seta_sound_word_w) // Sound | |
| 2062 | AM_RANGE(0xb00000, 0xb003ff) AM_RAM AM_BASE(&paletteram16) AM_SIZE(&seta_paletteram_size) // Palette | |
| 2063 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM AM_BASE(&spriteram16_2) // Sprites Code + X + Attr | |
| 2064 | /**/AM_RANGE(0xd00000, 0xd00001) AM_RAM // ? 0x4000 | |
| 2065 | /**/AM_RANGE(0xe00000, 0xe00607) AM_RAM AM_BASE(&spriteram16) // Sprites Y | |
| 2066 | ADDRESS_MAP_END | |
| 2067 | ||
| 2068 | static MACHINE_START( keroppi ) | |
| 2069 | { | |
| 2070 | keroppi_prize_hop = 0; | |
| 2071 | keroppi_protection_count = 0; | |
| 2072 | } | |
| 2073 | ||
| 2074 | /*************************************************************************** | |
| 1986 | 2075 | Block Carnival |
| 1987 | 2076 | ***************************************************************************/ |
| 1988 | 2077 | |
| r5613 | r5614 | |
| 5808 | 5897 | INPUT_PORTS_END |
| 5809 | 5898 | |
| 5810 | 5899 | /*************************************************************************** |
| 5900 | Kero Kero Keroppi no Issyoni Asobou | |
| 5901 | ***************************************************************************/ | |
| 5902 | ||
| 5903 | static INPUT_PORTS_START( keroppi ) | |
| 5904 | PORT_START("P1") | |
| 5905 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5906 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5907 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5908 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5909 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 5910 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5911 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Prize Out") PORT_CODE(KEYCODE_W) | |
| 5912 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5913 | ||
| 5914 | PORT_START("P2") | |
| 5915 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5916 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5917 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(5) | |
| 5918 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5919 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5920 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5921 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5922 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5923 | ||
| 5924 | PORT_START("COINS") //Coins | |
| 5925 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) | |
| 5926 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Prize Hopper") PORT_CODE(KEYCODE_Q) | |
| 5927 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5928 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5929 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5930 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5931 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5932 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 5933 | ||
| 5934 | PORT_START("DSW") //2 DSWs - $600001 & 3.b | |
| 5935 | PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2,3") | |
| 5936 | PORT_DIPSETTING( 0x0003, "1" ) | |
| 5937 | PORT_DIPSETTING( 0x0005, "2" ) | |
| 5938 | PORT_DIPSETTING( 0x0001, "3" ) | |
| 5939 | PORT_DIPSETTING( 0x0007, "4" ) | |
| 5940 | PORT_DIPSETTING( 0x0006, "5" ) | |
| 5941 | PORT_DIPSETTING( 0x0002, "6" ) | |
| 5942 | PORT_DIPSETTING( 0x0004, "7" ) | |
| 5943 | PORT_DIPSETTING( 0x0000, "8" ) | |
| 5944 | PORT_DIPNAME( 0x0038, 0x0038, "Game Select" ) PORT_DIPLOCATION("SW2:4,5,6") | |
| 5945 | PORT_DIPSETTING( 0x0038, "No. 1,2,3" ) | |
| 5946 | PORT_DIPSETTING( 0x0030, "No. 1" ) | |
| 5947 | PORT_DIPSETTING( 0x0028, "No. 2,3" ) | |
| 5948 | PORT_DIPSETTING( 0x0020, "No. 3" ) | |
| 5949 | PORT_DIPSETTING( 0x0018, "No. 1,2" ) | |
| 5950 | PORT_DIPSETTING( 0x0010, "No. 2" ) | |
| 5951 | PORT_DIPSETTING( 0x0008, "No. 1,3" ) | |
| 5952 | PORT_DIPSETTING( 0x0000, "No. 1,2,3" ) | |
| 5953 | PORT_DIPNAME( 0x0040, 0x0040, "Unknown 2-7" ) PORT_DIPLOCATION("SW2:7") | |
| 5954 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) | |
| 5955 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 5956 | PORT_DIPNAME( 0x0080, 0x0080, "Unknown 2-8" ) PORT_DIPLOCATION("SW2:8") | |
| 5957 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) | |
| 5958 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 5959 | ||
| 5960 | PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") | |
| 5961 | PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) | |
| 5962 | PORT_DIPSETTING( 0x0400, DEF_STR( 4C_1C ) ) | |
| 5963 | PORT_DIPSETTING( 0x0200, DEF_STR( 3C_1C ) ) | |
| 5964 | PORT_DIPSETTING( 0x0600, DEF_STR( 2C_1C ) ) | |
| 5965 | PORT_DIPSETTING( 0x0700, DEF_STR( 1C_1C ) ) | |
| 5966 | PORT_DIPSETTING( 0x0300, DEF_STR( 1C_2C ) ) | |
| 5967 | PORT_DIPSETTING( 0x0500, DEF_STR( 1C_3C ) ) | |
| 5968 | PORT_DIPSETTING( 0x0100, DEF_STR( 1C_4C ) ) | |
| 5969 | PORT_DIPNAME( 0x0800, 0x0800, "Unknown 1-4" ) PORT_DIPLOCATION("SW1:4") | |
| 5970 | PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) | |
| 5971 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 5972 | PORT_DIPNAME( 0x1000, 0x1000, "Unknown 1-5" ) PORT_DIPLOCATION("SW1:5") | |
| 5973 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) | |
| 5974 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 5975 | PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW1:6") | |
| 5976 | PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) | |
| 5977 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 5978 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") | |
| 5979 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) | |
| 5980 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) | |
| 5981 | PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" ) | |
| 5982 | INPUT_PORTS_END | |
| 5983 | ||
| 5984 | /*************************************************************************** | |
| 5811 | 5985 | Crazy Fight |
| 5812 | 5986 | ***************************************************************************/ |
| 5813 | 5987 | |
| r5613 | r5614 | |
| 7320 | 7494 | |
| 7321 | 7495 | |
| 7322 | 7496 | /*************************************************************************** |
| 7497 | Kero Kero Keroppi no Issyoni Asobou | |
| 7498 | ***************************************************************************/ | |
| 7499 | ||
| 7500 | static MACHINE_DRIVER_START( keroppi ) | |
| 7501 | ||
| 7502 | /* basic machine hardware */ | |
| 7503 | MDRV_CPU_ADD("maincpu", M68000, 14318180/2) /* 7.143 MHz */ | |
| 7504 | MDRV_CPU_PROGRAM_MAP(keroppi_map) | |
| 7505 | MDRV_CPU_VBLANK_INT_HACK(seta_interrupt_1_and_2,SETA_INTERRUPTS_NUM) | |
| 7506 | ||
| 7507 | MDRV_MACHINE_START(keroppi) | |
| 7508 | ||
| 7509 | /* video hardware */ | |
| 7510 | MDRV_SCREEN_ADD("screen", RASTER) | |
| 7511 | MDRV_SCREEN_REFRESH_RATE(60) | |
| 7512 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 7513 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 7514 | MDRV_SCREEN_SIZE(64*8, 32*8) | |
| 7515 | MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) | |
| 7516 | ||
| 7517 | MDRV_GFXDECODE(orbs) | |
| 7518 | MDRV_PALETTE_LENGTH(512) /* sprites only */ | |
| 7519 | ||
| 7520 | MDRV_VIDEO_START(seta_no_layers) | |
| 7521 | MDRV_VIDEO_UPDATE(seta_no_layers) /* just draw the sprites */ | |
| 7522 | ||
| 7523 | /* sound hardware */ | |
| 7524 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") | |
| 7525 | ||
| 7526 | MDRV_SOUND_ADD("x1", X1_010, 14318180) /* 14.318180 MHz */ | |
| 7527 | MDRV_SOUND_CONFIG(seta_sound_intf) | |
| 7528 | MDRV_SOUND_ROUTE(0, "lspeaker", 1.0) | |
| 7529 | MDRV_SOUND_ROUTE(1, "rspeaker", 1.0) | |
| 7530 | MACHINE_DRIVER_END | |
| 7531 | ||
| 7532 | ||
| 7533 | /*************************************************************************** | |
| 7323 | 7534 | Krazy Bowl |
| 7324 | 7535 | ***************************************************************************/ |
| 7325 | 7536 | |
| r5613 | r5614 | |
| 8944 | 9155 | ROM_LOAD( "orbs.u16", 0x080000, 0x080000, CRC(aecd8373) SHA1(5620bcb281a9ea4920cfe81d163827013289c5bf) ) |
| 8945 | 9156 | ROM_END |
| 8946 | 9157 | |
| 9158 | ROM_START( keroppi ) | |
| 9159 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ | |
| 9160 | ROM_LOAD16_BYTE( "ft-001-001.u10", 0x000000, 0x080000, CRC(37861e7d) SHA1(4bf75f119b0ef1420c96844224850867fa8e273f) ) | |
| 9161 | ROM_LOAD16_BYTE( "ft-001-002.u9", 0x000001, 0x080000, CRC(f531d4ef) SHA1(75a99695679de083765700c250bd1fdfd8be9981) ) | |
| 9162 | ||
| 9163 | ROM_REGION( 0x200000, "gfx1", 0 ) /* Sprites */ | |
| 9164 | ROM_LOAD( "ft-001-003.u14", 0x000000, 0x080000, CRC(62fb22fb) SHA1(a67cb46152b73a47c2287c4058d0a22fb7064e7e) ) | |
| 9165 | ROM_LOAD( "ft-001-004.u13", 0x080000, 0x080000, CRC(69908c98) SHA1(1af069e9330a33cd2f0e1365e05c72eb23c3244e) ) | |
| 9166 | ROM_LOAD( "ft-001-005.u12", 0x100000, 0x080000, CRC(de6432a8) SHA1(afee9b29e0b3db4815fc29456044532aee03597e) ) | |
| 9167 | ROM_LOAD( "ft-001-006.u11", 0x180000, 0x080000, CRC(9c500eae) SHA1(3448adef04c9ad2e0b39a283e4eb9c9bac7d4967) ) | |
| 9168 | ||
| 9169 | ROM_REGION( 0x100000, "x1", 0 ) /* Samples */ | |
| 9170 | ROM_LOAD( "ft-001-007.u15", 0x000000, 0x080000, CRC(c98dacf0) SHA1(b508433e2383af1e8bd5fda253c9925c48443490) ) | |
| 9171 | ROM_LOAD( "ft-001-008.u16", 0x080000, 0x080000, CRC(b9c4b637) SHA1(82977d10de1048f71525bab5431b031cca510114) ) | |
| 9172 | ROM_END | |
| 9173 | ||
| 8947 | 9174 | ROM_START( extdwnhl ) |
| 8948 | 9175 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ |
| 8949 | 9176 | ROM_LOAD16_BYTE( "fw001002.201", 0x000000, 0x080000, CRC(24d21924) SHA1(9914a68a578f884b06305ffcd9aeed7d83df1c7b) ) |
| r5613 | r5614 | |
| 9570 | 9797 | GAME( 1994, kiwame, 0, kiwame, kiwame, kiwame, ROT0, "Athena", "Pro Mahjong Kiwame", 0 ) |
| 9571 | 9798 | GAME( 1994, krzybowl, 0, krzybowl, krzybowl, 0, ROT270, "American Sammy", "Krazy Bowl", 0 ) |
| 9572 | 9799 | GAME( 1994, orbs, 0, orbs, orbs, 0, ROT0, "American Sammy", "Orbs (10/7/94 prototype?)", 0 ) |
| 9800 | GAME( 1993, keroppi, 0, keroppi, keroppi, 0, ROT0, "Sammy Industries", "Kero Kero Keroppi no Issyoni Asobou (Japan)", 0 ) | |
| 9573 | 9801 | GAME( 1995, extdwnhl, 0, extdwnhl, extdwnhl, 0, ROT0, "Sammy Industries Japan", "Extreme Downhill (v1.5)", GAME_IMPERFECT_GRAPHICS ) |
| 9574 | 9802 | GAME( 1995, gundhara, 0, gundhara, gundhara, 0, ROT270, "Banpresto", "Gundhara", 0 ) |
| 9575 | 9803 | GAME( 1995, sokonuke, 0, extdwnhl, sokonuke, 0, ROT0, "Sammy Industries", "Sokonuke Taisen Game (Japan)", GAME_IMPERFECT_SOUND ) |
| r5613 | r5614 | |
|---|---|---|
| 1271 | 1271 | |
| 1272 | 1272 | AM_RANGE(0x00200000, 0x00207fff) AM_RAM // bios uses it (battery backed ram ?) |
| 1273 | 1273 | AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w ) |
| 1274 | AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( | |
| 1274 | AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( naomi_maple_r, naomi_maple_w ) | |
| 1275 | 1275 | AM_RANGE(0x005f7000, 0x005f70ff) AM_DEVREADWRITE("rom_board", naomibd_r, naomibd_w) |
| 1276 | 1276 | AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w ) |
| 1277 | 1277 | AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w ) |
| r5613 | r5614 | |
| 1285 | 1285 | |
| 1286 | 1286 | AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known |
| 1287 | 1287 | |
| 1288 | AM_RANGE(0x03010098, 0x0301009f) AM_RAM // Naomi 2 BIOS tests this, needs to read back as written | |
| 1289 | ||
| 1288 | 1290 | /* Area 1 */ |
| 1289 | 1291 | AM_RANGE(0x04000000, 0x04ffffff) AM_RAM AM_BASE( &dc_texture_ram ) // texture memory 64 bit access |
| 1290 | 1292 | AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now |
| r5613 | r5614 | |
| 1322 | 1324 | AM_RANGE(0x00, 0x0f) AM_READWRITE(eeprom_93c46a_r, eeprom_93c46a_w) |
| 1323 | 1325 | ADDRESS_MAP_END |
| 1324 | 1326 | |
| 1327 | /* | |
| 1328 | * Atomiswave address map, almost identical to Dreamcast | |
| 1329 | */ | |
| 1330 | ||
| 1325 | 1331 | static READ64_HANDLER( aw_flash_r ) |
| 1326 | 1332 | { |
| 1327 | 1333 | return (UINT64)intelflash_read(0, offset*8) | (UINT64)intelflash_read(0, (offset*8)+1)<<8 | (UINT64)intelflash_read(0, (offset*8)+2)<<16 | (UINT64)intelflash_read(0, (offset*8)+3)<<24 | |
| r5613 | r5614 | |
| 1343 | 1349 | } |
| 1344 | 1350 | |
| 1345 | 1351 | data >>= (i*8); |
| 1352 | ||
| 1346 | 1353 | intelflash_write(0, addr, data); |
| 1347 | 1354 | } |
| 1348 | 1355 | |
| 1356 | INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_mask, UINT64 *shift) | |
| 1357 | { | |
| 1358 | int reg = offset * 2; | |
| 1349 | 1359 | |
| 1350 | /* | |
| 1351 | * Atomiswave address map, almost identical to Dreamcast | |
| 1352 | */ | |
| 1360 | *shift = 0; | |
| 1353 | 1361 | |
| 1362 | // non 32-bit accesses have not yet been seen here, we need to know when they are | |
| 1363 | if ((mem_mask != U64(0xffffffff00000000)) && (mem_mask != U64(0x00000000ffffffff))) | |
| 1364 | { | |
| 1365 | mame_printf_verbose("%s:Wrong mask!\n", cpuexec_describe_context(machine)); | |
| 1366 | // debugger_break(machine); | |
| 1367 | } | |
| 1368 | ||
| 1369 | if (mem_mask == U64(0xffffffff00000000)) | |
| 1370 | { | |
| 1371 | reg++; | |
| 1372 | *shift = 32; | |
| 1373 | } | |
| 1374 | ||
| 1375 | return reg; | |
| 1376 | } | |
| 1377 | ||
| 1378 | READ64_HANDLER( aw_modem_r ) | |
| 1379 | { | |
| 1380 | int reg; | |
| 1381 | UINT64 shift; | |
| 1382 | ||
| 1383 | reg = decode_reg32_64(space->machine, offset, mem_mask, &shift); | |
| 1384 | ||
| 1385 | if (reg == 0x280/4) | |
| 1386 | { | |
| 1387 | UINT32 coins = input_port_read(space->machine, "COINS"); | |
| 1388 | ||
| 1389 | if (coins & 0x01) | |
| 1390 | { | |
| 1391 | return U64(0xffffffff00000002); // coin A | |
| 1392 | } | |
| 1393 | else if (coins & 0x02) | |
| 1394 | { | |
| 1395 | return U64(0xffffffff00000001); // coin B | |
| 1396 | } | |
| 1397 | ||
| 1398 | return U64(0xffffffffffffffff); | |
| 1399 | } | |
| 1400 | ||
| 1401 | mame_printf_verbose("MODEM: Unmapped read %08x\n", 0x600000+reg*4); | |
| 1402 | return 0; | |
| 1403 | } | |
| 1404 | ||
| 1405 | WRITE64_HANDLER( aw_modem_w ) | |
| 1406 | { | |
| 1407 | int reg; | |
| 1408 | UINT64 shift; | |
| 1409 | UINT32 dat; | |
| 1410 | ||
| 1411 | reg = decode_reg32_64(space->machine, offset, mem_mask, &shift); | |
| 1412 | dat = (UINT32)(data >> shift); | |
| 1413 | mame_printf_verbose("MODEM: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x600000+reg*4, dat, data, offset, mem_mask); | |
| 1414 | } | |
| 1415 | ||
| 1354 | 1416 | static ADDRESS_MAP_START( aw_map, ADDRESS_SPACE_PROGRAM, 64 ) |
| 1355 | 1417 | /* Area 0 */ |
| 1356 | 1418 | AM_RANGE(0x00000000, 0x0001ffff) AM_READWRITE( aw_flash_r, aw_flash_w ) |
| r5613 | r5614 | |
| 1364 | 1426 | AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w ) |
| 1365 | 1427 | AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w ) |
| 1366 | 1428 | AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE( pvr_ta_r, pvr_ta_w ) |
| 1367 | AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( | |
| 1429 | AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( aw_modem_r, aw_modem_w ) | |
| 1368 | 1430 | AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE( "aica", dc_aica_reg_r, dc_aica_reg_w ) |
| 1369 | 1431 | AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w ) |
| 1370 | 1432 | AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE( naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB) |
| r5613 | r5614 | |
| 1595 | 1657 | NAOMI_MAME_DEBUG_DIP |
| 1596 | 1658 | INPUT_PORTS_END |
| 1597 | 1659 | |
| 1660 | // Atomiswave - inputs are read as standard Dreamcast controllers/lightguns. | |
| 1661 | // Controller bit patterns: | |
| 1662 | // | |
| 1663 | // SHOT3 (1<<0) | |
| 1664 | // SHOT2 (1<<1) | |
| 1665 | // SHOT1 (1<<2) | |
| 1666 | // START (1<<3) | |
| 1667 | // UP (1<<4) | |
| 1668 | // DOWN (1<<5) | |
| 1669 | // LEFT (1<<6) | |
| 1670 | // RIGHT (1<<7) | |
| 1671 | // SHOT5 (1<<9) | |
| 1672 | // SHOT4 (1<<10) | |
| 1673 | // SERVICE (1<<13) | |
| 1674 | // TEST (1<<14) | |
| 1675 | // COIN (1<<15) | |
| 1676 | ||
| 1677 | static INPUT_PORTS_START( aw ) | |
| 1678 | PORT_START("P1L") | |
| 1679 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) | |
| 1680 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) | |
| 1681 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) | |
| 1682 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) | |
| 1683 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) | |
| 1684 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) | |
| 1685 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) | |
| 1686 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) | |
| 1687 | PORT_START("P1H") | |
| 1688 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) | |
| 1689 | PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW ) | |
| 1690 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 1691 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1692 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1693 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) | |
| 1694 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) | |
| 1695 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) | |
| 1696 | ||
| 1697 | PORT_START("P2L") | |
| 1698 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) | |
| 1699 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) | |
| 1700 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) | |
| 1701 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) | |
| 1702 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) | |
| 1703 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) | |
| 1704 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) | |
| 1705 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) | |
| 1706 | PORT_START("P2H") | |
| 1707 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) | |
| 1708 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1709 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 ) | |
| 1710 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1711 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1712 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) | |
| 1713 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) | |
| 1714 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) | |
| 1715 | ||
| 1716 | PORT_START("P3L") | |
| 1717 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) | |
| 1718 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) | |
| 1719 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) | |
| 1720 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) | |
| 1721 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 ) | |
| 1722 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) | |
| 1723 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) | |
| 1724 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) | |
| 1725 | PORT_START("P3H") | |
| 1726 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) | |
| 1727 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1728 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) | |
| 1729 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1730 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1731 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(3) | |
| 1732 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(3) | |
| 1733 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(3) | |
| 1734 | ||
| 1735 | PORT_START("P4L") | |
| 1736 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) | |
| 1737 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) | |
| 1738 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) | |
| 1739 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) | |
| 1740 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) | |
| 1741 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) | |
| 1742 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) | |
| 1743 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) | |
| 1744 | PORT_START("P4H") | |
| 1745 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4 ) | |
| 1746 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1747 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE4 ) | |
| 1748 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1749 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 1750 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) | |
| 1751 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) | |
| 1752 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) | |
| 1753 | ||
| 1754 | PORT_START("COINS") | |
| 1755 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[0]) | |
| 1756 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(dc_coin_slots_callback, &dc_coin_counts[1]) | |
| 1757 | ||
| 1758 | NAOMI_MAME_DEBUG_DIP | |
| 1759 | INPUT_PORTS_END | |
| 1760 | ||
| 1598 | 1761 | static MACHINE_RESET( naomi ) |
| 1599 | 1762 | { |
| 1600 | 1763 | MACHINE_RESET_CALL(dc); |
| r5613 | r5614 | |
| 1788 | 1951 | // bios for House of the Dead 2 |
| 1789 | 1952 | #define HOTD2_BIOS \ |
| 1790 | 1953 | ROM_SYSTEM_BIOS( 0, "bios0", "HOTD2 (Export)" ) \ |
| 1791 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21331. | |
| 1954 | ROM_LOAD16_WORD_SWAP_BIOS( 0, "epr-21331. | |
| 1792 | 1955 | ROM_SYSTEM_BIOS( 1, "bios1", "HOTD2 (USA)" ) \ |
| 1793 | ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21330. | |
| 1956 | ROM_LOAD16_WORD_SWAP_BIOS( 1, "epr-21330. | |
| 1794 | 1957 | |
| 1795 | 1958 | #define F355_BIOS \ |
| 1796 | 1959 | ROM_SYSTEM_BIOS( 0, "bios0", "Ferrari F355 (Export)" ) \ |
| r5613 | r5614 | |
| 1946 | 2109 | IC10 64M 7C94 8779 |
| 1947 | 2110 | IC11 64M 271E BEF7 |
| 1948 | 2111 | IC12 64M BA24 102F |
| 2112 | ||
| 1949 | 2113 | */ |
| 1950 | 2114 | |
| 1951 | 2115 | ROM_START( cspike ) |
| r5613 | r5614 | |
| 1999 | 2163 | ROM_REGION( 0x200000, "maincpu", 0) |
| 2000 | 2164 | NAOMI_BIOS |
| 2001 | 2165 | |
| 2002 | ROM_REGION( 0x7 | |
| 2166 | ROM_REGION( 0x7800000, "user1", ROMREGION_ERASEFF) | |
| 2003 | 2167 | ROM_LOAD( "epr-23511.ic22", 0x000000, 0x400000, CRC(3dbf8eb2) SHA1(1f7b89ba99e018cc85022fa852d56d4e345e1bd2) ) |
| 2004 | ROM_LOAD( "mpr-23498.ic1", 0x800000, 0x800000, CRC(ff7918b9) SHA1(5fa548939b83d307d6047931b0af405e20de04f6) ) | |
| 2005 | ROM_LOAD( "mpr-23499.ic2", 0x1000000, 0x800000, CRC(5d2d9439) SHA1(6fd24a3966f04a8175e1b1ec4560de6722b621d1) ) | |
| 2006 | ROM_LOAD( "mpr-23500.ic3", 0x1800000, 0x800000, CRC(bc58de9e) SHA1(8db2dfa4f1e0bbd7f5b3c8050d53533535750399) ) | |
| 2007 | ROM_LOAD( "mpr-23501.ic4", 0x2000000, 0x800000, CRC(f938123c) SHA1(058b35301e3ef81ac903f18f6a034e9b282223c3) ) | |
| 2008 | ROM_LOAD( "mpr-23502.ic5", 0x2800000, 0x800000, CRC(d58cbab2) SHA1(638a3fec531c200a909228477955de82d6352fcc) ) | |
| 2009 | ROM_LOAD( "mpr-23503.ic6", 0x3000000, 0x800000, CRC(66a6a80f) SHA1(f6d413f3631e43b3a5067fefc7252f2122773110) ) | |
| 2010 | ROM_LOAD( "mpr-23504.ic7", 0x3800000, 0x800000, CRC(29c1fe16) SHA1(af96d809f8160d45f061120dfe2df36d6c940cb9) ) | |
| 2011 | ROM_LOAD( "mpr-23505.ic8", 0x4000000, 0x800000, CRC(451816b2) SHA1(38af527ca7987019fa4727d2db715f6bd31f366d) ) | |
| 2012 | ROM_LOAD( "mpr-23506.ic9", 0x4800000, 0x800000, CRC(5031ef58) SHA1(a9cbe1ee05e729519175020d9560954a9253ba5b) ) | |
| 2013 | ROM_LOAD( "mpr-23507.ic10", 0x5000000, 0x800000, CRC(d77b0783) SHA1(2ac6584922754bfe85bff8554ddc83736b095c7a) ) | |
| 2014 | ROM_LOAD( "mpr-23508.ic11", 0x5800000, 0x800000, CRC(4c24c946) SHA1(f088d0f0e2ccf3d657ee68791397e3edaa0c79c0) ) | |
| 2015 | ROM_LOAD( "mpr-23509.ic12", 0x6000000, 0x800000, CRC(38379fc1) SHA1(82e3a12615709e974a6635d25d5f17ef7fe8ac78) ) | |
| 2016 | ROM_LOAD( "mpr-23510.ic13", 0x6800000, 0x800000, CRC(38523873) SHA1(5d25ada6cba8c9bbf5f9e90aa3599e796e4e1727) ) | |
| 2168 | ROM_LOAD( "mpr-23504.ic1", 0x0800000, 0x1000000, CRC(e01a31d2) SHA1(e00e138f6a20175c7aadb6500f6d7541b91def14) ) | |
| 2169 | ROM_LOAD( "mpr-23505.ic2", 0x1800000, 0x1000000, CRC(3a34d5fe) SHA1(f3c5f6fcbaa7004d371923eb412ea1fcf3fa461a) ) | |
| 2170 | ROM_LOAD( "mpr-23506.ic3", 0x2800000, 0x1000000, CRC(9cbab27d) SHA1(f166352355a03c9ccafbc15f926330b3622ec040) ) | |
| 2171 | ROM_LOAD( "mpr-23507.ic4", 0x3800000, 0x1000000, CRC(363c1734) SHA1(16b0485f1aacc8925b3c6d6152680139748e6df8) ) | |
| 2172 | ROM_LOAD( "mpr-23508.ic5", 0x4800000, 0x1000000, CRC(0a3590aa) SHA1(84c0e1853f069b003d09b268caee97e58c4dacb6) ) | |
| 2173 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) | |
| 2174 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) | |
| 2017 | 2175 | |
| 2018 | 2176 | // trojaned protection data (filename is address read from) |
| 2019 | 2177 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) |
| r5613 | r5614 | |
| 2048 | 2206 | ROM_REGION( 0x200000, "maincpu", 0) |
| 2049 | 2207 | NAOMI_BIOS |
| 2050 | 2208 | |
| 2051 | ROM_REGION( 0x7 | |
| 2209 | ROM_REGION( 0x7800000, "user1", ROMREGION_ERASEFF) | |
| 2052 | 2210 | ROM_LOAD( "epr23511a.ic22", 0x000000, 0x400000, CRC(fe00650f) SHA1(ca8e9e9178ed2b6598bdea83be1bf0dd7aa509f9) ) |
| 2053 | ROM_LOAD( "mpr-23498.ic1", 0x800000, 0x800000, CRC(ff7918b9) SHA1(5fa548939b83d307d6047931b0af405e20de04f6) ) | |
| 2054 | ROM_LOAD( "mpr-23499.ic2", 0x1000000, 0x800000, CRC(5d2d9439) SHA1(6fd24a3966f04a8175e1b1ec4560de6722b621d1) ) | |
| 2055 | ROM_LOAD( "mpr-23500.ic3", 0x1800000, 0x800000, CRC(bc58de9e) SHA1(8db2dfa4f1e0bbd7f5b3c8050d53533535750399) ) | |
| 2056 | ROM_LOAD( "mpr-23501.ic4", 0x2000000, 0x800000, CRC(f938123c) SHA1(058b35301e3ef81ac903f18f6a034e9b282223c3) ) | |
| 2057 | ROM_LOAD( "mpr-23502.ic5", 0x2800000, 0x800000, CRC(d58cbab2) SHA1(638a3fec531c200a909228477955de82d6352fcc) ) | |
| 2058 | ROM_LOAD( "mpr-23503.ic6", 0x3000000, 0x800000, CRC(66a6a80f) SHA1(f6d413f3631e43b3a5067fefc7252f2122773110) ) | |
| 2059 | ROM_LOAD( "mpr-23504.ic7", 0x3800000, 0x800000, CRC(29c1fe16) SHA1(af96d809f8160d45f061120dfe2df36d6c940cb9) ) | |
| 2060 | ROM_LOAD( "mpr-23505.ic8", 0x4000000, 0x800000, CRC(451816b2) SHA1(38af527ca7987019fa4727d2db715f6bd31f366d) ) | |
| 2061 | ROM_LOAD( "mpr-23506.ic9", 0x4800000, 0x800000, CRC(5031ef58) SHA1(a9cbe1ee05e729519175020d9560954a9253ba5b) ) | |
| 2062 | ROM_LOAD( "mpr-23507.ic10", 0x5000000, 0x800000, CRC(d77b0783) SHA1(2ac6584922754bfe85bff8554ddc83736b095c7a) ) | |
| 2063 | ROM_LOAD( "mpr-23508.ic11", 0x5800000, 0x800000, CRC(4c24c946) SHA1(f088d0f0e2ccf3d657ee68791397e3edaa0c79c0) ) | |
| 2064 | ROM_LOAD( "mpr-23509.ic12", 0x6000000, 0x800000, CRC(38379fc1) SHA1(82e3a12615709e974a6635d25d5f17ef7fe8ac78) ) | |
| 2065 | ROM_LOAD( "mpr-23510.ic13", 0x6800000, 0x800000, CRC(38523873) SHA1(5d25ada6cba8c9bbf5f9e90aa3599e796e4e1727) ) | |
| 2211 | ROM_LOAD( "mpr-23504.ic1", 0x0800000, 0x1000000, CRC(e01a31d2) SHA1(e00e138f6a20175c7aadb6500f6d7541b91def14) ) | |
| 2212 | ROM_LOAD( "mpr-23505.ic2", 0x1800000, 0x1000000, CRC(3a34d5fe) SHA1(f3c5f6fcbaa7004d371923eb412ea1fcf3fa461a) ) | |
| 2213 | ROM_LOAD( "mpr-23506.ic3", 0x2800000, 0x1000000, CRC(9cbab27d) SHA1(f166352355a03c9ccafbc15f926330b3622ec040) ) | |
| 2214 | ROM_LOAD( "mpr-23507.ic4", 0x3800000, 0x1000000, CRC(363c1734) SHA1(16b0485f1aacc8925b3c6d6152680139748e6df8) ) | |
| 2215 | ROM_LOAD( "mpr-23508.ic5", 0x4800000, 0x1000000, CRC(0a3590aa) SHA1(84c0e1853f069b003d09b268caee97e58c4dacb6) ) | |
| 2216 | ROM_LOAD( "mpr-23509.ic6", 0x5800000, 0x1000000, CRC(281d633d) SHA1(d773be8e95f7bf9212ee1061f3076220d4fce9e0) ) | |
| 2217 | ROM_LOAD( "mpr-23510.ic7", 0x6800000, 0x1000000, CRC(b856fef5) SHA1(0634f86740c438b40286256a0269570d24cb845a) ) | |
| 2066 | 2218 | |
| 2067 | 2219 | // trojaned protection data (filename is address read from) |
| 2068 | 2220 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) |
| r5613 | r5614 | |
| 2417 | 2569 | ROM_REGION( 0x200000, "maincpu", 0) |
| 2418 | 2570 | NAOMI_BIOS |
| 2419 | 2571 | |
| 2420 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) | |
| 2421 | ROM_LOAD("epr-22306.ic22", 0x0000000, 0x0400000, CRC(fcac20eb) SHA1(26cec9f615cd18ce7fccfc5e273e42c58dea1995) ) | |
| 2422 | ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) | |
| 2423 | ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) | |
| 2424 | ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) | |
| 2425 | ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) | |
| 2426 | ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) | |
| 2427 | ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) | |
| 2428 | ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) | |
| 2429 | ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) | |
| 2430 | ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) | |
| 2431 | ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) | |
| 2432 | ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) | |
| 2433 | ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) | |
| 2434 | ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) | |
| 2435 | ROM_LOAD("ic14",0x7000000, 0x0800000, NO_DUMP ) | |
| 2436 | ROM_LOAD("ic15",0x7800000, 0x0800000, NO_DUMP ) | |
| 2437 | ROM_LOAD("ic16",0x8000000, 0x0800000, NO_DUMP ) | |
| 2438 | ROM_LOAD("ic17",0x8800000, 0x0800000, NO_DUMP ) | |
| 2439 | ROM_LOAD("ic18",0x9000000, 0x0800000, NO_DUMP ) | |
| 2440 | ROM_LOAD("ic19",0x9800000, 0x0800000, NO_DUMP ) | |
| 2441 | ROM_LOAD("ic20",0xa000000, 0x0800000, NO_DUMP ) | |
| 2442 | ROM_LOAD("ic21",0xa800000, 0x0800000, NO_DUMP ) | |
| 2572 | ROM_REGION( 0xb800000, "user1", ROMREGION_ERASEFF) | |
| 2573 | ROM_LOAD("epr-22306.ic22", 0x0000000, 0x0400000, CRC(fcac20eb) SHA1(26cec9f615cd18ce7fccfc5e273e42c58dea1995) ) | |
| 2574 | ROM_LOAD( "mpr-22295.ic1", 0x0800000, 0x1000000, CRC(1085001b) SHA1(096ac0ecc7d5324f04514d24eb338de591926a3d) ) | |
| 2575 | ROM_LOAD( "mpr-22296.ic2", 0x1800000, 0x1000000, CRC(f18cb28b) SHA1(e7f253a35e15f62e178a1ff565f8a94102eea057) ) | |
| 2576 | ROM_LOAD( "mpr-22297.ic3", 0x2800000, 0x1000000, CRC(a78a527b) SHA1(7d4e7bd93519377a8676f7ca6f72c4d0de2a0475) ) | |
| 2577 | ROM_LOAD( "mpr-22298.ic4", 0x3800000, 0x1000000, CRC(cd76c7ea) SHA1(2db200c8853d1bc9da31da6c197c6b55e570dc69) ) | |
| 2578 | ROM_LOAD( "mpr-22299.ic5", 0x4800000, 0x1000000, CRC(ffb96da5) SHA1(bfe8f4a455d3eeec0fa9728fc1bb52cebd13b2a8) ) | |
| 2579 | ROM_LOAD( "mpr-22300.ic6", 0x5800000, 0x1000000, CRC(6fb05214) SHA1(9cececc46ac463bc5df3c3f5fb9268d5ced31837) ) | |
| 2580 | ROM_LOAD( "mpr-22301.ic7", 0x6800000, 0x1000000, CRC(52eb076d) SHA1(a79bb286594cc5d196a37a17147ad1770db5cd67) ) | |
| 2581 | ROM_LOAD( "mpr-22302.ic8", 0x7800000, 0x1000000, CRC(86767b0b) SHA1(54ed418cef78506fb824e3d16cadefdb684f2b34) ) | |
| 2582 | ROM_LOAD( "mpr-22303.ic9", 0x8800000, 0x1000000, CRC(73a80bd5) SHA1(d607f1d993af4b78d3609991e47e9540664380fd) ) | |
| 2583 | ROM_LOAD( "mpr-22304.ic10", 0x9800000, 0x1000000, CRC(46c1fb1f) SHA1(6daca76a75df3501f77e473eb065d48804fcc64a) ) | |
| 2584 | ROM_LOAD( "mpr-22305.ic11", 0xa800000, 0x1000000, CRC(027d0e7b) SHA1(e3c874e60cabb6f9ce686696d9055a0c0d5289ae) ) | |
| 2443 | 2585 | ROM_END |
| 2444 | 2586 | |
| 2445 | 2587 | /* |
| r5613 | r5614 | |
| 2578 | 2720 | ROM_LOAD("mpr-22140.ic19", 0x9800000, 0x0800000, CRC(4cb54893) SHA1(a99b39cc3c82c3cf90f794bb8c8ba60638a6f921) ) |
| 2579 | 2721 | ROM_END |
| 2580 | 2722 | |
| 2723 | ROM_START( smlg99 ) | |
| 2724 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 2725 | NAOMI_BIOS | |
| 2726 | ||
| 2727 | ROM_REGION( 0xb000000, "user1", ROMREGION_ERASEFF) | |
| 2728 | ROM_LOAD( "epr-22059.ic22", 0x0000000, 0x200000, CRC(5784f970) SHA1(e9ec692206a95cc260521154305693f6022190bc) ) | |
| 2729 | ROM_LOAD( "mpr-22038.ic1", 0x0800000, 0x800000, CRC(0a59fc5b) SHA1(efcbe2f847927fba173d333c889dd7df329d6df6) ) | |
| 2730 | ROM_LOAD( "mpr-22039.ic2", 0x1000000, 0x800000, CRC(4de79b52) SHA1(c63a3ce88db316e882948baf121fa96242010c8d) ) | |
| 2731 | ROM_LOAD( "mpr-22040.ic3", 0x1800000, 0x800000, CRC(b993fd90) SHA1(609de1509f393f884813ca4bcac533e10088ca84) ) | |
| 2732 | ROM_LOAD( "mpr-22041.ic4", 0x2000000, 0x800000, CRC(ddadfabd) SHA1(64531e68b10635415d49c0304a8ba550a3a9cef1) ) | |
| 2733 | ROM_LOAD( "mpr-22042.ic5", 0x2800000, 0x800000, CRC(136c101e) SHA1(a35d8d574b263d672a08963a992a7b507c838b70) ) | |
| 2734 | ROM_LOAD( "mpr-22043.ic6", 0x3000000, 0x800000, CRC(7f15a0a5) SHA1(5c36fa580f7eef448fb32d050078843470fafb31) ) | |
| 2735 | ROM_LOAD( "mpr-22044.ic7", 0x3800000, 0x800000, CRC(94376002) SHA1(8c4b954da69a079d9a73b8f34a9f1a94cceee9cc) ) | |
| 2736 | ROM_LOAD( "mpr-22045.ic8", 0x4000000, 0x800000, CRC(e520e2d9) SHA1(c7a9306b2dafb20baaa8bd6708fb5ece775c37f0) ) | |
| 2737 | ROM_LOAD( "mpr-22046.ic9", 0x4800000, 0x800000, CRC(976edfc8) SHA1(340b701b9e1d256963a8fe056ec975d8cbfec3d8) ) | |
| 2738 | ROM_LOAD( "mpr-22047.ic10", 0x5000000, 0x800000, CRC(32b136de) SHA1(4019e9836174b47135d7e1bbc02c23dd3ab52904) ) | |
| 2739 | ROM_LOAD( "mpr-22048.ic11", 0x5800000, 0x800000, CRC(32a9488a) SHA1(70c11fbcb1e24ed120f74aa455806e7dfbfa75b5) ) | |
| 2740 | ROM_LOAD( "mpr-22049.ic12", 0x6000000, 0x800000, CRC(8295696d) SHA1(5820cac054070aa35a64abc5bf8c6f45fe9be03f) ) | |
| 2741 | ROM_LOAD( "mpr-22050.ic13", 0x6800000, 0x800000, CRC(1cfebe44) SHA1(24415f723cd6c1efaa2513f6b52e076364eb0875) ) | |
| 2742 | ROM_LOAD( "mpr-22051.ic14", 0x7000000, 0x800000, CRC(58b9dbef) SHA1(1021d4dfbd5bcf6e1703ce608560c76d60dac71c) ) | |
| 2743 | ROM_LOAD( "mpr-22052.ic15", 0x7800000, 0x800000, CRC(95b87c1d) SHA1(bf0a89703fea7bd37e4d0fd10c7729d2cfe848d6) ) | |
| 2744 | ROM_LOAD( "mpr-22053.ic16", 0x8000000, 0x800000, CRC(666589a1) SHA1(130477f247661e87bdc4f2370788ca676336f563) ) | |
| 2745 | ROM_LOAD( "mpr-22054.ic17", 0x8800000, 0x800000, CRC(9d8c82e9) SHA1(13ebf9ffac9e1e960fa9662800c5e682284a5cdd) ) | |
| 2746 | ROM_LOAD( "mpr-22055.ic18", 0x9000000, 0x800000, CRC(fa865125) SHA1(04e0d77287f4e29df514875683992ede1e385dbc) ) | |
| 2747 | ROM_LOAD( "mpr-22056.ic19", 0x9800000, 0x800000, CRC(45a23d29) SHA1(2499637a4b389cda7cc9a7aa21014696bd1dafe2) ) | |
| 2748 | ROM_LOAD( "mpr-22057.ic20", 0xa000000, 0x800000, CRC(a056c109) SHA1(637e80c2d605851265430b0fa771a4ad5233be8a) ) | |
| 2749 | ROM_LOAD( "mpr-22058.ic21", 0xa800000, 0x800000, CRC(f16edaa0) SHA1(e093f5594df43c592a9acd45002ecc65035c2435) ) | |
| 2750 | ROM_END | |
| 2751 | ||
| 2581 | 2752 | /* |
| 2582 | 2753 | |
| 2583 | 2754 | SYSTEMID: NAOMI |
| r5613 | r5614 | |
| 2618 | 2789 | ROM_LOAD("mpr-21901.ic21",0xa800000, 0x0800000, BAD_DUMP CRC(55dcbd6d) SHA1(9fec353f9e58016090e177f899a799e2e8fc7c9f) ) // returns bad in Naomi test mode |
| 2619 | 2790 | ROM_END |
| 2620 | 2791 | |
| 2792 | ROM_START( hotd2 ) | |
| 2793 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 2794 | HOTD2_BIOS | |
| 2795 | ||
| 2796 | ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF) | |
| 2797 | ROM_LOAD( "epr-21585.ic22", 0x0000000, 0x200000, CRC(b23d1a0c) SHA1(9e77980d1aa980c879886e53cc76a16d7a9d43a1) ) | |
| 2798 | ROM_LOAD( "mpr-21565.ic1", 0x0800000, 0x800000, CRC(88fb0562) SHA1(185a0eab68d86617cb6325d64c48a2dd4854622b) ) | |
| 2799 | ROM_LOAD( "mpr-21566.ic2", 0x1000000, 0x800000, CRC(5f4dd576) SHA1(5483c3949e587bbcca7e8fc7db9aff4cd2a33f02) ) | |
| 2800 | ROM_LOAD( "mpr-21567.ic3", 0x1800000, 0x800000, CRC(3e62fca4) SHA1(8cdebdebabc88160f458e1e779d9ebb4e6a14523) ) | |
| 2801 | ROM_LOAD( "mpr-21568.ic4", 0x2000000, 0x800000, CRC(6f73a852) SHA1(d5fd4c0800b3a1ea04231018fcaba79184fa1d87) ) | |
| 2802 | ROM_LOAD( "mpr-21569.ic5", 0x2800000, 0x800000, CRC(c7950445) SHA1(4f56768f07703452ef92d183e4ee654ab9711283) ) | |
| 2803 | ROM_LOAD( "mpr-21570.ic6", 0x3000000, 0x800000, CRC(5a812247) SHA1(7636661da0cc9bd5a1a2062f9f3ef65889c86fd5) ) | |
| 2804 | ROM_LOAD( "mpr-21571.ic7", 0x3800000, 0x800000, CRC(17e9414a) SHA1(9f291c4dd9a049eeed88d80867f7fca1d15c6095) ) | |
| 2805 | ROM_LOAD( "mpr-21572.ic8", 0x4000000, 0x800000, CRC(5d2d8134) SHA1(a2941b6afd0302822133d932064d1aad873b1c04) ) | |
| 2806 | ROM_LOAD( "mpr-21573.ic9", 0x4800000, 0x800000, CRC(eacaf26d) SHA1(21e35def0ed998a70cc982f373feb50b7974612a) ) | |
| 2807 | ROM_LOAD( "mpr-21574.ic10", 0x5000000, 0x800000, CRC(1e3686be) SHA1(7ec1b3c9c94882c5fe7b6ba6ffe9220e90824870) ) | |
| 2808 | ROM_LOAD( "mpr-21575.ic11", 0x5800000, 0x800000, CRC(5ada00a2) SHA1(981c65310c89e7a26e2b2c3e57623e78f6ad33d0) ) | |
| 2809 | ROM_LOAD( "mpr-21576.ic12", 0x6000000, 0x800000, CRC(9eff6247) SHA1(9257492fc3e48516897002dd3ff247093af27d87) ) | |
| 2810 | ROM_LOAD( "mpr-21577.ic13", 0x6800000, 0x800000, CRC(8a80b16a) SHA1(ffeb061b31027ac322c14b9050c686b2b844d2e1) ) | |
| 2811 | ROM_LOAD( "mpr-21578.ic14", 0x7000000, 0x800000, CRC(7ae20daf) SHA1(b36d8e490ac477db178b8df08f7997448308d3fd) ) | |
| 2812 | ROM_LOAD( "mpr-21579.ic15", 0x7800000, 0x800000, CRC(fbb8641b) SHA1(6cb44f0a3f80eb68a218bba97b2395961c596b9c) ) | |
| 2813 | ROM_LOAD( "mpr-21580.ic16", 0x8000000, 0x800000, CRC(3881ec23) SHA1(e4b87a6c6fd6a2eeda8e0e5ae7bed01b18386e54) ) | |
| 2814 | ROM_LOAD( "mpr-21581.ic17", 0x8800000, 0x800000, CRC(66bff6e4) SHA1(f87d618231b71b65952fc7ea7ccabdd208622a00) ) | |
| 2815 | ROM_LOAD( "mpr-21582.ic18", 0x9000000, 0x800000, CRC(8cd2f654) SHA1(77eb7061caaf0288aad04ed88c4247d27617f338) ) | |
| 2816 | ROM_LOAD( "mpr-21583.ic19", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) | |
| 2817 | ROM_LOAD( "mpr-21584.ic20", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) | |
| 2818 | ROM_END | |
| 2819 | ||
| 2621 | 2820 | /* |
| 2622 | 2821 | SYSTEMID: NAOMI |
| 2623 | 2822 | JAP: GIANT GRAM |
| r5613 | r5614 | |
| 2637 | 2836 | |
| 2638 | 2837 | ROM_REGION( 0x6000000, "user1", ROMREGION_ERASEFF) |
| 2639 | 2838 | ROM_LOAD("epr-21820.ic22", 0x0000000, 0x0200000, CRC(0a198278) SHA1(0df5fc8b56ddafc66d92cb3923b851a5717b551d) ) |
| 2839 | ROM_RELOAD( 0x200000, 0x200000 ) | |
| 2840 | ROM_RELOAD( 0x400000, 0x200000 ) | |
| 2841 | ROM_RELOAD( 0x600000, 0x200000 ) | |
| 2640 | 2842 | ROM_LOAD("mpr-21821.ic1", 0x0800000, 0x0800000, CRC(ed127b65) SHA1(8b6d03fc733f601a48006d3268faa8983ca69d70) ) |
| 2641 | 2843 | /* IC2 empty */ |
| 2642 | 2844 | ROM_LOAD("mpr-21823.ic3", 0x1800000, 0x0800000, CRC(a304b528) SHA1(32197c74c659de2cc5f72f13c84bacac7b136d36) ) |
| r5613 | r5614 | |
| 2719 | 2921 | JAP: GUILTY GEAR X |
| 2720 | 2922 | USA: DISABLE |
| 2721 | 2923 | EXP: DISABLE |
| 2722 | ||
| 2723 | 2924 | */ |
| 2724 | 2925 | |
| 2725 | 2926 | ROM_START( ggx ) |
| r5613 | r5614 | |
| 2742 | 2943 | ROM_LOAD("mpr-23353.ic12", 0x6000000, 0x0800000, CRC(daa0ca24) SHA1(afce14e213e79add7fded838e71bb4447425906a) ) |
| 2743 | 2944 | ROM_LOAD("mpr-23354.ic13", 0x6800000, 0x0800000, CRC(cea127f7) SHA1(11f12472ebfc93eb72b764c780e30afd4812dbe9) ) |
| 2744 | 2945 | ROM_LOAD("mpr-23355.ic14", 0x7000000, 0x0800000, CRC(e809685f) SHA1(dc052b4eb4fdcfdc22c4807316ce34ee7a0d58a6) ) |
| 2946 | ||
| 2947 | // trojaned protection data | |
| 2948 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 2949 | ROM_LOAD( "a0100000.bin", 0x000000, 0x010000, CRC(cbe5a37a) SHA1(63f40758ef94d02a53ad860b2bed9c41e20a8263) ) | |
| 2950 | ROM_LOAD( "a010b268.bin", 0x010000, 0x010000, CRC(7f0ba37e) SHA1(2d33703c9ec08800c3fae23991859f713f8c944b) ) | |
| 2951 | ROM_LOAD( "a0115558.bin", 0x020000, 0x010000, CRC(882c945f) SHA1(60bf8fe3dcf079464f660c7c210d2a379b2ef04f) ) | |
| 2952 | ROM_LOAD( "a0120b28.bin", 0x030000, 0x010000, CRC(024952c0) SHA1(98e4ce87b5ac1169b5ab1ba9cc7553069e09cbbe) ) | |
| 2953 | ROM_LOAD( "a012987a.bin", 0x040000, 0x010000, CRC(50ea6621) SHA1(ea4e5e0b9563c5e49794a634c08be8d2e81fb773) ) | |
| 2954 | ROM_LOAD( "a012e320.bin", 0x050000, 0x010000, CRC(e445906e) SHA1(cd585100b78253bdd16f3895fdb37ff1e08690f6) ) | |
| 2955 | ROM_LOAD( "a0133cf6.bin", 0x060000, 0x00f014, CRC(5763d154) SHA1(645b0a10fd196f53ff7f656b8db798c8e753c4ed) ) | |
| 2956 | ROM_LOAD( "a0170000.bin", 0x070000, 0x010000, CRC(e153030a) SHA1(e1738ec558f0e3d5a796e34618c533cfcd6928ed) ) | |
| 2957 | ROM_LOAD( "a017cf18.bin", 0x080000, 0x010000, CRC(def783cf) SHA1(911e6b99f8ce498ddd5048ea655b76cad33f47c0) ) | |
| 2958 | ROM_LOAD( "a018a45a.bin", 0x090000, 0x010000, CRC(408cd99b) SHA1(110f9922cded7ffc5108ed964b82ac39beb6ce6b) ) | |
| 2959 | ROM_LOAD( "a0197852.bin", 0x0a0000, 0x010000, CRC(09d10a60) SHA1(04bfdba2ea9a45cb10a60fe95d7d2e0997012b4f) ) | |
| 2960 | ROM_LOAD( "a01a4916.bin", 0x0b0000, 0x010000, CRC(3895730e) SHA1(b2c0a839e330916e598c8f27f2a4873bbaaddbde) ) | |
| 2961 | ROM_LOAD( "a01b1c3e.bin", 0x0c0000, 0x010000, CRC(eecb6a13) SHA1(0203c54b98aaf203e7d1b3646102efe63c550115) ) | |
| 2962 | ROM_LOAD( "a01bef38.bin", 0x0d0000, 0x010000, CRC(7d9a497c) SHA1(680a49389e7774aa03ebe6fc844dea53b430796f) ) | |
| 2963 | ROM_LOAD( "a01cbb10.bin", 0x0e0000, 0x010000, CRC(69b770bd) SHA1(aac5801d9a8a48ef77e932195cd7c30ae562bc38) ) | |
| 2964 | ROM_LOAD( "a01d7500.bin", 0x0f0000, 0x010000, CRC(a1119fca) SHA1(1acda8f73a5b1fb180985245b8b0eb9453db0cea) ) | |
| 2965 | ROM_LOAD( "a0200000.bin", 0x100000, 0x010000, CRC(21662b41) SHA1(4dab25dcc92d1a7418d308542499bdec6c3b3b2b) ) | |
| 2966 | ROM_LOAD( "a0210004.bin", 0x110000, 0x010000, CRC(07166890) SHA1(529c28bf925243468fc00b0ad5ea57429d4de907) ) | |
| 2967 | ROM_LOAD( "a0220008.bin", 0x120000, 0x008000, CRC(09cd1354) SHA1(83f6b36aec4e7c5aa1b8bc21dc6fabf8f283ed55) ) | |
| 2968 | ROM_LOAD( "a0228000.bin", 0x130000, 0x008000, CRC(628a4917) SHA1(cf36bc2413cb63fb511936ab4b5f11b7c8cbb057) ) | |
| 2745 | 2969 | ROM_END |
| 2746 | 2970 | |
| 2747 | 2971 | /* |
| r5613 | r5614 | |
| 2765 | 2989 | IC10 64M 6442 18AC |
| 2766 | 2990 | IC11 64M 4F77 EEFE |
| 2767 | 2991 | |
| 2768 | */ | |
| 2992 | */ | |
| 2769 | 2993 | |
| 2770 | 2994 | |
| 2771 | 2995 | ROM_START( hmgeo ) |
| r5613 | r5614 | |
| 2786 | 3010 | ROM_LOAD("mpr-23713.ic9", 0x4800000, 0x0800000, CRC(2969bac7) SHA1(5f1cf6ac726c2fe183d66e4022962e44592f9ccd) ) |
| 2787 | 3011 | ROM_LOAD("mpr-23714.ic10",0x5000000, 0x0800000, CRC(da462c44) SHA1(ca450b6c07f939f96eba7b44c45b4e38abd598aa) ) |
| 2788 | 3012 | ROM_LOAD("mpr-23715.ic11",0x5800000, 0x0800000, BAD_DUMP CRC(59dfd3ad) SHA1(bb8f7a1bcf16038b18f4485a6b6d81fa72ca7bd0) ) |
| 3013 | ||
| 3014 | // trojaned protection data | |
| 3015 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3016 | ROM_LOAD( "a3075ac0.bin", 0x000000, 0x00ff04, CRC(440dca2a) SHA1(4e261ff309e7e774fa2061de30174b0e4e967c00) ) | |
| 3017 | ROM_LOAD( "a30859c4.bin", 0x010000, 0x00ff04, CRC(c22c76a7) SHA1(76d9e47730e4551e6e1a96eeee937296f1153b8b) ) | |
| 3018 | ROM_LOAD( "a30958c8.bin", 0x020000, 0x00ff04, CRC(8f29ee4d) SHA1(e1ac1ccf85dc338e9d5381dfa8ededc8af8f3e92) ) | |
| 3019 | ROM_LOAD( "a30a57cc.bin", 0x030000, 0x00ff04, CRC(479846c1) SHA1(b063e2f7d521cd8a60b770477c13946679e06dd7) ) | |
| 3020 | ROM_LOAD( "a30b56d0.bin", 0x040000, 0x00ff04, CRC(107f777e) SHA1(002f062a2073dff5f0d4722803aef0a8ffc7a61a) ) | |
| 3021 | ROM_LOAD( "a30c55d4.bin", 0x050000, 0x00ff04, CRC(d73b35c1) SHA1(951cceaf6a53d4fc4b967c3675d3fa98a6874b2a) ) | |
| 3022 | ROM_LOAD( "a30d54d8.bin", 0x060000, 0x00ff04, CRC(969a6957) SHA1(ee6909f832b96ec3e6ae0cec3f18a7983cae89d9) ) | |
| 3023 | ROM_LOAD( "a30e53dc.bin", 0x070000, 0x00ff04, CRC(002f7b41) SHA1(12bb33f1229d74b32ab481f5a2e57332f0def6e7) ) | |
| 3024 | ROM_LOAD( "a30f52e0.bin", 0x080000, 0x00a904, CRC(97e32fdd) SHA1(a40f412e40544a45784b2f8d9d5494b6491efc4a) ) | |
| 3025 | ROM_LOAD( "a30ffbe4.bin", 0x090000, 0x000084, CRC(c4311af6) SHA1(7a53061a1a1a024d72880a9a9c2e6a61d2607a46) ) | |
| 3026 | ROM_LOAD( "a30ffc80.bin", 0x0a0000, 0x00ff04, CRC(b1b5e559) SHA1(2f5963d8aa46d7aeb869769a7052d3006d56d5a4) ) | |
| 3027 | ROM_LOAD( "a310fb84.bin", 0x0b0000, 0x00ff04, CRC(91bdc0b2) SHA1(3f77fe6b67dba605296c3c038265b4e0e7eabd97) ) | |
| 3028 | ROM_LOAD( "a311fa88.bin", 0x0c0000, 0x00ff04, CRC(dc5d1334) SHA1(52287bd3ade05be4511e43a7707de8cc38117316) ) | |
| 3029 | ROM_LOAD( "a312f98c.bin", 0x0d0000, 0x00ff04, CRC(e3d9ea36) SHA1(0860f5ac3086d16132f3d0d27266c644470b4f1e) ) | |
| 3030 | ROM_LOAD( "a313f890.bin", 0x0e0000, 0x00ff04, CRC(8b23c562) SHA1(fcc9d04c150f007dcd4a9a2bbee1e438a81b7c49) ) | |
| 3031 | ROM_LOAD( "a314f794.bin", 0x0f0000, 0x009104, CRC(0c0a9aa2) SHA1(1b9063a18703ce4a03ffe20e3f13e9bae06bdb57) ) | |
| 3032 | ROM_LOAD( "a3158898.bin", 0x100000, 0x0000ac, CRC(e23f61d5) SHA1(80ff570a6846f1af2b87e5888675257728e8e253) ) | |
| 3033 | ROM_LOAD( "a0800f40.bin", 0x110000, 0x000204, CRC(f4935846) SHA1(d7eaa710274080f378afa4fb2e14f3bd406c45fe) ) | |
| 3034 | ROM_LOAD( "a0801144.bin", 0x120000, 0x000034, CRC(28a62ac0) SHA1(d9bb6baf5feaca655f333e2f0b9b200f44ef1726) ) | |
| 3035 | ROM_LOAD( "a0801180.bin", 0x130000, 0x00ff04, CRC(4b9e08b7) SHA1(dab208f7af4475210135aeb648e6bed7db7399b9) ) | |
| 3036 | ROM_LOAD( "a0811084.bin", 0x140000, 0x00ff04, CRC(4003bab7) SHA1(0b1df4b9b1d1a1072719b559a71f5ae5811be63c) ) | |
| 3037 | ROM_LOAD( "a0820f88.bin", 0x150000, 0x007e04, CRC(67fb4342) SHA1(8b8c384a1628756a08aa8131095e49756967b5e2) ) | |
| 3038 | ROM_LOAD( "a0828d8c.bin", 0x160000, 0x0000f4, CRC(71c85e2b) SHA1(680b6ee02ea24a502bc42bade23e11e6a7ddc7ad) ) | |
| 2789 | 3039 | ROM_END |
| 2790 | 3040 | |
| 2791 | 3041 | /* |
| r5613 | r5614 | |
| 2808 | 3058 | IC9 64M 717F 40ED |
| 2809 | 3059 | IC10 64M 1E43 0F1A |
| 2810 | 3060 | |
| 3061 | byteswaped @ e0158 key b957 read count 400, write 404 | |
| 3062 | e055c key 37ca read count 400, write 404 | |
| 3063 | ||
| 2811 | 3064 | */ |
| 2812 | 3065 | |
| 2813 | 3066 | ROM_START( gwing2 ) |
| r5613 | r5614 | |
| 2815 | 3068 | NAOMI_BIOS |
| 2816 | 3069 | |
| 2817 | 3070 | ROM_REGION( 0x5800000, "user1", ROMREGION_ERASEFF) |
| 2818 | ROM_LOAD("epr-22270.ic22", 0x0000000, 0x0200000, CRC(876b3c97) SHA1(eb171d4a0521c3bea42b4aae3607faec63e10581) ) | |
| 2819 | ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) | |
| 2820 | ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) | |
| 2821 | ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) | |
| 2822 | ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) | |
| 2823 | ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) | |
| 2824 | ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) | |
| 2825 | ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) | |
| 2826 | ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) | |
| 2827 | ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) | |
| 2828 | ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) | |
| 3071 | ROM_LOAD("epr-22270.ic22",0x0000000, 0x0200000, CRC(876b3c97) SHA1(eb171d4a0521c3bea42b4aae3607faec63e10581) ) | |
| 3072 | ROM_LOAD("mpr-22271.ic1", 0x0800000, 0x1000000, CRC(9a072af5) SHA1(d5edff43d180346ba4d4f214c08f2db290a72def) ) | |
| 3073 | ROM_LOAD("mpr-22272.ic2", 0x1800000, 0x1000000, CRC(1e816ab1) SHA1(6e1fd47a21f5da7d2145caaf68094445f122a239) ) | |
| 3074 | ROM_LOAD("mpr-22273.ic3", 0x2800000, 0x1000000, CRC(cd633dcf) SHA1(f044d93802a4ba29d0e70c597d3fbe65da591335) ) | |
| 3075 | ROM_LOAD("mpr-22274.ic4", 0x3800000, 0x1000000, CRC(f8daaaf3) SHA1(8854d3f8e3d55715ede33ee918b641e251f752b4) ) | |
| 3076 | ROM_LOAD("mpr-22275.ic5", 0x4800000, 0x1000000, CRC(61aa1521) SHA1(7d9f5790e72a9151d128ac7887e236526fdf72a0) ) | |
| 3077 | ||
| 3078 | // trojaned protection data (filename is address read from) | |
| 3079 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3080 | ROM_LOAD( "a085ddc0.bin", 0x000000, 0x00c960, CRC(77303f1c) SHA1(5dc8799b9ec102540c6e7647eccb69dfc5e6ecfb) ) | |
| 3081 | ROM_LOAD( "a080c6c0.bin", 0x010000, 0x020000, CRC(168e551a) SHA1(03bb8ce4bb233db75a0e07a8b5ad28149b5f126e) ) | |
| 3082 | ROM_LOAD( "a082c6c4.bin", 0x030000, 0x020000, CRC(bd2fcd3a) SHA1(2eefa22472d7caf30a3467c1f7ed8dc72f1665c1) ) | |
| 3083 | ROM_LOAD( "a084c6c8.bin", 0x050000, 0x020000, CRC(c1d28ba0) SHA1(5e497758c3756fe993b481ab2009402a105fbc63) ) | |
| 3084 | ROM_LOAD( "a08c67e0.bin", 0x070000, 0x020000, CRC(ceabcb70) SHA1(bbc97218f32913eefe52b1bb1606bad60d7c2894) ) | |
| 3085 | ROM_LOAD( "a08e67e4.bin", 0x090000, 0x020000, CRC(4bc98e7b) SHA1(5f506d05a05a129bf500f0112e39b722872f1220) ) | |
| 3086 | ROM_LOAD( "a09067e8.bin", 0x0b0000, 0x020000, CRC(4cd8a958) SHA1(d3a96287986ab851acced420c4ff9f4d2035188a) ) | |
| 3087 | ROM_LOAD( "a09267ec.bin", 0x0d0000, 0x020000, CRC(17c1df0d) SHA1(62964224f27c54651518a8622756c253d777629a) ) | |
| 3088 | ROM_LOAD( "a09467f0.bin", 0x0f0000, 0x020000, CRC(99c78505) SHA1(bbb95757bc0be76c680255a0e72d2eacc4ca525e) ) | |
| 3089 | ROM_LOAD( "a09667f4.bin", 0x110000, 0x016360, CRC(bec1fd2f) SHA1(e2e9d47d6d5d35bfa9a432c7f47f95c780b17551) ) | |
| 3090 | ROM_LOAD( "a088acc0.bin", 0x130000, 0x020000, CRC(abb1e0d9) SHA1(a1d5d484faaa806b365069755660ec14c1cecada) ) | |
| 3091 | ROM_LOAD( "a08aacc4.bin", 0x150000, 0x01bb00, CRC(2acc08c8) SHA1(c04276ec940a73e4b8fe140ef9f4bec8c629ecc9) ) | |
| 3092 | ROM_LOAD( "a086a740.bin", 0x170000, 0x020000, CRC(5d90c88c) SHA1(7af4107e1930292d3c64b80cb29d31aae8a565b6) ) | |
| 3093 | ROM_LOAD( "a088a744.bin", 0x190000, 0x000560, CRC(79c8eb0f) SHA1(0216fa128d9851b96f3864446ef71e0ed6f4ccd0) ) | |
| 3094 | ROM_LOAD( "a097cb60.bin", 0x1a0000, 0x010820, CRC(371e88d9) SHA1(04f0167000e96d556227e8abf6e06e0698e61e9f) ) | |
| 3095 | ROM_LOAD( "a0807fa0.bin", 0x1c0000, 0x004700, CRC(4eed5ff3) SHA1(26425baa06959d612b3b7e9f367fbb97258f544e) ) | |
| 3096 | ROM_LOAD( "a0800000.bin", 0x1d0000, 0x006040, CRC(17651005) SHA1(500806ba917133ae604817c6ee2913d10762e290) ) | |
| 3097 | ROM_LOAD( "a0806060.bin", 0x1e0000, 0x001f20, CRC(ff25a8fe) SHA1(e8c0ddf63802e3d35478e1a491dc7162283b2474) ) | |
| 2829 | 3098 | ROM_END |
| 2830 | 3099 | |
| 2831 | 3100 | /* |
| r5613 | r5614 | |
| 2964 | 3233 | ROM_LOAD("mpr-22032.ic8", 0x4000000, 0x0800000, CRC(3c48c9ba) SHA1(00be199b23040f8e81db2ec489ba98cbf615652c) ) |
| 2965 | 3234 | ROM_LOAD("mpr-22033.ic9", 0x4800000, 0x0800000, CRC(5fe5586e) SHA1(3ff41ae1f81469597684faadd88e62b5e0634352) ) |
| 2966 | 3235 | ROM_LOAD("mpr-22034.ic10",0x5000000, 0x0800000, CRC(3aa5ce5e) SHA1(f00a906235e4522d6fc2ac771324114346875314) ) |
| 3236 | ||
| 3237 | // trojaned protection data (filename is address read from) | |
| 3238 | ROM_REGION( 0x4000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3239 | ROM_LOAD( "a0309000.bin", 0x000000, 0x000400, CRC(e4f8b4a2) SHA1(a0d54aa6e1ffd5b1db31002ee4a94943c2157a3e) ) | |
| 3240 | ROM_LOAD( "a0309500.bin", 0x001000, 0x000400, CRC(5d3a9b15) SHA1(30d55a686493bb2f5e7d2c7d7df3dedf2f93dff0) ) | |
| 3241 | ROM_LOAD( "a030a000.bin", 0x002000, 0x000400, CRC(22b88804) SHA1(7b53778ddbf360b364376f0358b0acfb689e8713) ) | |
| 3242 | ROM_LOAD( "a030a500.bin", 0x003000, 0x000400, CRC(6a501389) SHA1(c2c75cd8beed6bb9e3fa39722fa01b35f2e7992d) ) | |
| 2967 | 3243 | ROM_END |
| 2968 | 3244 | |
| 2969 | 3245 | |
| r5613 | r5614 | |
| 3062 | 3338 | ROM_REGION( 0x200000, "maincpu", 0) |
| 3063 | 3339 | NAOMI_BIOS |
| 3064 | 3340 | |
| 3065 | ROM_REGION( 0xb | |
| 3341 | ROM_REGION( 0xb800000, "user1", ROMREGION_ERASEFF) | |
| 3066 | 3342 | ROM_LOAD("epr-23548a.ic22", 0x0000000, 0x0400000, CRC(f4ccf1ec) SHA1(97485b2a4b9452ffeea2501f42d20d718410e716) ) |
| 3067 | ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) | |
| 3068 | ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) | |
| 3069 | ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) | |
| 3070 | ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) | |
| 3071 | ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) | |
| 3072 | ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) | |
| 3073 | ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) | |
| 3074 | ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) | |
| 3075 | ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) | |
| 3076 | ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) | |
| 3077 | ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) | |
| 3078 | ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) | |
| 3079 | ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) | |
| 3080 | ROM_LOAD("ic14",0x7000000, 0x0800000, NO_DUMP ) | |
| 3081 | ROM_LOAD("ic15",0x7800000, 0x0800000, NO_DUMP ) | |
| 3082 | ROM_LOAD("ic16",0x8000000, 0x0800000, NO_DUMP ) | |
| 3083 | ROM_LOAD("ic17",0x8800000, 0x0800000, NO_DUMP ) | |
| 3084 | ROM_LOAD("ic18",0x9000000, 0x0800000, NO_DUMP ) | |
| 3085 | ROM_LOAD("ic19",0x9800000, 0x0800000, NO_DUMP ) | |
| 3086 | ROM_LOAD("ic20",0xa000000, 0x0800000, NO_DUMP ) | |
| 3087 | ROM_LOAD("ic21",0xa800000, 0x0800000, NO_DUMP ) | |
| 3343 | ROM_LOAD( "mpr-23537.ic1", 0x0800000, 0x1000000, CRC(a2462770) SHA1(2d06f2efb686b2c45e5cc0b0776ba5fb1d392951) ) | |
| 3344 | ROM_LOAD( "mpr-23538.ic2", 0x1800000, 0x1000000, CRC(e4480832) SHA1(281700b10bd6b29e4d33b5230d085f9cc102fa01) ) | |
| 3345 | ROM_LOAD( "mpr-23539.ic3", 0x2800000, 0x1000000, CRC(97e3f7f5) SHA1(89ad30782ba148777ce3aad2d41e9dfda2dd0c5c) ) | |
| 3346 | ROM_LOAD( "mpr-23540.ic4", 0x3800000, 0x1000000, CRC(b9e92d21) SHA1(a9b465e83ecfbf47168f83ad4ae8ed4b802345ac) ) | |
| 3347 | ROM_LOAD( "mpr-23541.ic5", 0x4800000, 0x1000000, CRC(95b8a9c6) SHA1(2c9df93d9f599cf01d895a37d03ba0d86b9b3033) ) | |
| 3348 | ROM_LOAD( "mpr-23542.ic6", 0x5800000, 0x1000000, CRC(dfd490f5) SHA1(13fe0a11a75f1a7ebfe40433833241e656bb1511) ) | |
| 3349 | ROM_LOAD( "mpr-23543.ic7", 0x6800000, 0x1000000, CRC(66847ebd) SHA1(853d4fc7e53ac7b19b9ba616f756eb8a8fcd242d) ) | |
| 3350 | ROM_LOAD( "mpr-23544.ic8", 0x7800000, 0x1000000, CRC(d1f5b460) SHA1(f0789630871d728113abacceff21c6328a9fa9fc) ) | |
| 3351 | ROM_LOAD( "mpr-23545.ic9", 0x8800000, 0x1000000, CRC(60bd692f) SHA1(37b508f4a821d832eafff81574e7df3fe1c729f8) ) | |
| 3352 | ROM_LOAD( "mpr-23546.ic10", 0x9800000, 0x1000000, CRC(85db2248) SHA1(37845c269a2e65ee6181a8e7500c2e7dd9b2e343) ) | |
| 3353 | ROM_LOAD( "mpr-23547.ic11", 0xa800000, 0x1000000, CRC(18b369c7) SHA1(b61cb3fda8cc685865684f7afc7dad0b29d93ca5) ) | |
| 3354 | ||
| 3355 | // trojaned protection data (filename is address read from) | |
| 3356 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3357 | ROM_LOAD( "a0820000.bin", 0x000000, 0x00267e, CRC(15db53ed) SHA1(a28ba1abc77ca559cff2fd34f3499c556ad8674e) ) | |
| 3358 | ROM_LOAD( "a0920000.bin", 0x010000, 0x00c91c, CRC(431436f8) SHA1(0136d6b210689b2023f982300bc8842b5c0914b4) ) | |
| 3359 | ROM_LOAD( "a092c920.bin", 0x020000, 0x00a53c, CRC(43e1a419) SHA1(34020cc7b10a1c5b2860db84d133489bce53d3d4) ) | |
| 3360 | ROM_LOAD( "a0936e60.bin", 0x030000, 0x001a32, CRC(2a998df6) SHA1(c7bed2777b2358bc0f1d7a3c23f3029591eb674d) ) | |
| 3361 | ROM_LOAD( "a3480000.bin", 0x040000, 0x008e9c, CRC(c8939e48) SHA1(a8d26c2b32211a50b8cc49b51c0d2e34416cc715) ) | |
| 3088 | 3362 | ROM_END |
| 3089 | 3363 | |
| 3090 | 3364 | /* |
| r5613 | r5614 | |
| 3105 | 3379 | IC7 64M 374E 46F6 |
| 3106 | 3380 | IC8 64M C529 0501 |
| 3107 | 3381 | |
| 3382 | prot | |
| 3383 | ||
| 3108 | 3384 | */ |
| 3109 | 3385 | |
| 3110 | 3386 | ROM_START( pstone ) |
| r5613 | r5614 | |
| 3113 | 3389 | |
| 3114 | 3390 | ROM_REGION( 0x4800000, "user1", ROMREGION_ERASEFF) |
| 3115 | 3391 | ROM_LOAD("epr-21597.ic22",0x0000000, 0x0200000, CRC(62c7acc0) SHA1(bb61641a7f3650757132cde379447bdc9bd91c78) ) |
| 3116 | ROM_RELOAD( 0x200000, 0x200000) | |
| 3117 | ROM_RELOAD( 0x400000, 0x200000) | |
| 3118 | ROM_RELOAD( 0x600000, 0x200000) | |
| 3119 | 3392 | ROM_LOAD("mpr-21589.ic1", 0x0800000, 0x0800000, CRC(2fa66608) SHA1(144bda75f892a1e4dbd8332439e9e44fad1d0695) ) |
| 3120 | 3393 | ROM_LOAD("mpr-21590.ic2", 0x1000000, 0x0800000, CRC(6341b399) SHA1(d123b6a3eb7c4800950cc5849d748b0edafabc7d) ) |
| 3121 | 3394 | ROM_LOAD("mpr-21591.ic3", 0x1800000, 0x0800000, CRC(7f2d99aa) SHA1(00f9ae67be0d7229c37479b6dc0ed5816035fd98) ) |
| r5613 | r5614 | |
| 3165 | 3438 | ROM_LOAD("mpr-23124.ic7", 0x3800000, 0x0800000, CRC(508c0207) SHA1(e50d97a17cdd6771fbc63a254a4d638e7daa8f57) ) |
| 3166 | 3439 | ROM_LOAD("mpr-23125.ic8", 0x4000000, 0x0800000, CRC(b9938bbc) SHA1(d55d7adecb5a5a4a276a5a17c12808085d980fd9) ) |
| 3167 | 3440 | ROM_LOAD("mpr-23126.ic9", 0x4800000, 0x0800000, CRC(fbb0325b) SHA1(21b965519d7508d84344641d43e8af2c3ca29ba4) ) |
| 3441 | ||
| 3442 | // trojaned protection data (filename is address read from) | |
| 3443 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3168 | 3444 | ROM_END |
| 3169 | 3445 | |
| 3170 | 3446 | /* |
| r5613 | r5614 | |
| 3646 | 3922 | ROM_REGION( 0x200000, "maincpu", 0) |
| 3647 | 3923 | NAOMI_BIOS |
| 3648 | 3924 | |
| 3649 | ROM_REGION( 0x8 | |
| 3925 | ROM_REGION( 0x8800000, "user1", ROMREGION_ERASEFF) | |
| 3650 | 3926 | ROM_LOAD("epr-22261.ic22", 0x0000000, 0x0400000, CRC(60e5a6cd) SHA1(d74ee8318e40190231b94030176223da8305c053) ) |
| 3651 | ROM_LOAD("ic1", 0x0800000, 0x0800000, NO_DUMP ) | |
| 3652 | ROM_LOAD("ic2", 0x1000000, 0x0800000, NO_DUMP ) | |
| 3653 | ROM_LOAD("ic3", 0x1800000, 0x0800000, NO_DUMP ) | |
| 3654 | ROM_LOAD("ic4", 0x2000000, 0x0800000, NO_DUMP ) | |
| 3655 | ROM_LOAD("ic5", 0x2800000, 0x0800000, NO_DUMP ) | |
| 3656 | ROM_LOAD("ic6", 0x3000000, 0x0800000, NO_DUMP ) | |
| 3657 | ROM_LOAD("ic7", 0x3800000, 0x0800000, NO_DUMP ) | |
| 3658 | ROM_LOAD("ic8", 0x4000000, 0x0800000, NO_DUMP ) | |
| 3659 | ROM_LOAD("ic9", 0x4800000, 0x0800000, NO_DUMP ) | |
| 3660 | ROM_LOAD("ic10",0x5000000, 0x0800000, NO_DUMP ) | |
| 3661 | ROM_LOAD("ic11",0x5800000, 0x0800000, NO_DUMP ) | |
| 3662 | ROM_LOAD("ic12",0x6000000, 0x0800000, NO_DUMP ) | |
| 3663 | ROM_LOAD("ic13",0x6800000, 0x0800000, NO_DUMP ) | |
| 3664 | ROM_LOAD("ic14",0x7000000, 0x0800000, NO_DUMP ) | |
| 3665 | ROM_LOAD("ic15",0x7800000, 0x0800000, NO_DUMP ) | |
| 3927 | ROM_LOAD( "mpr-22262.ic1", 0x0800000, 0x1000000, CRC(f18c7920) SHA1(76fb592f62b8a359df19074265b44772ab2ecea0) ) | |
| 3928 | ROM_LOAD( "mpr-22263.ic2", 0x1800000, 0x1000000, CRC(5a397a54) SHA1(4b41b19ab7c49e09eeb5df2e688fdaecf8bb33a9) ) | |
| 3929 | ROM_LOAD( "mpr-22264.ic3", 0x2800000, 0x1000000, CRC(edca701e) SHA1(459b533d862e011f8daa0e4997d69fa7339b0755) ) | |
| 3930 | ROM_LOAD( "mpr-22265.ic4", 0x3800000, 0x1000000, CRC(7dfe71a1) SHA1(f2053544de8a177ab931c4d6a9010dfb6cc92e31) ) | |
| 3931 | ROM_LOAD( "mpr-22266.ic5", 0x4800000, 0x1000000, CRC(3e9ac148) SHA1(05a5725c72bbfc65db47aaa677b95f07aa9a3909) ) | |
| 3932 | ROM_LOAD( "mpr-22267.ic6", 0x5800000, 0x1000000, CRC(67ec1027) SHA1(2432b33983bbc9b07477459adb5ee1a62b6c0ea3) ) | |
| 3933 | ROM_LOAD( "mpr-22268.ic7", 0x6800000, 0x1000000, CRC(536f5eea) SHA1(f1de8624f82595adf75693b604fb026bf3f778ee) ) | |
| 3934 | ROM_LOAD( "mpr-22269.ic8", 0x7800000, 0x1000000, CRC(6c0cf740) SHA1(da10b33a6e54afbe1d7e52801216e7119b0b33b1) ) | |
| 3935 | ||
| 3936 | // trojaned protection data (filename is address read from) | |
| 3937 | ROM_REGION( 0x200000, "naomibd_prot", ROMREGION_ERASE00 ) | |
| 3938 | ROM_LOAD( "a24db210.bin", 0x000000, 0x00005e, CRC(79fc852b) SHA1(58229b71d1a7067dd6ce3a617edc7d8bdd132036) ) | |
| 3666 | 3939 | ROM_END |
| 3667 | 3940 | |
| 3668 | 3941 | /* |
| r5613 | r5614 | |
| 3736 | 4009 | ROM_LOAD("mpr-21726.ic19",0x9800000, 0x0800000, CRC(429bf290) SHA1(6733e1bcf100e73ab43273f6feedc187fcaa55d4) ) |
| 3737 | 4010 | ROM_END |
| 3738 | 4011 | |
| 4012 | ROM_START( gunsur2 ) | |
| 4013 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 4014 | NAOMI_BIOS | |
| 4015 | ||
| 4016 | ROM_REGION( 0xb800000, "user1", ROMREGION_ERASEFF) | |
| 4017 | ROM_LOAD( "bhf1vere.2f", 0x0000000, 0x0800000, CRC(121ea283) SHA1(e4bf2b90fa3d42727b8393ffa2c5a8863914a630) ) | |
| 4018 | ROM_LOAD( "bhf1ma2.4m", 0x2000000, 0x1000000, CRC(8073dec7) SHA1(2d4173ff0de37b95a8cb02e1b572a9cdeb448c24) ) | |
| 4019 | ROM_END | |
| 4020 | ||
| 3739 | 4021 | /* GD-ROM titles - a PIC supplies a decryption key |
| 3740 | 4022 | |
| 3741 | 4023 | PIC stuff |
| r5613 | r5614 | |
| 3879 | 4161 | /* 0016C */ GAME( 1999, derbyoc, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3880 | 4162 | /* 0017C */ GAME( 1999, otrigger, naomi, naomi, naomi, naomi, ROT0, "Sega", "OutTrigger (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3881 | 4163 | /* 0019C */ GAME( 1999, dybb99, naomi, naomi, naomi, naomi, ROT0, "Sega", "Dynamite Baseball '99 (JPN) / World Series '99 (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4164 | /* 00??C */ GAME( 1999, smlg99, naomi, naomi, naomi, naomi, ROT0, "Sega", "Super Major League '99", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3882 | 4165 | /* 0020C */ GAME( 1999, samba, naomi, naomi, naomi, naomi, ROT0, "Sega", "Samba De Amigo (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4166 | /* 0083C */ GAME( 1999, derbyoc2, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club II (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3883 | 4167 | /* 0021C */ GAME( 2000, virnba, naomi, naomi, naomi, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3884 | 4168 | /* 0021C */ GAME( 2000, virnbao, virnba, naomi, naomi, naomi, ROT0, "Sega", "Virtua NBA (JPN, USA, EXP, KOR, AUS) (original)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3885 | 4169 | /* 0026C */ GAME( 2000, totd, naomi, naomi, naomi, naomi, ROT0, "Sega", "The Typing of the Dead (JPN, USA, EXP, KOR, AUS)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3886 | 4170 | /* 0027C */ GAME( 2000, smarinef, naomi, naomi, naomi, naomi, ROT0, "Sega", "Sega Marine Fishing", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3887 | 4171 | /* 0030C */ GAME( 2000, qmegamis, naomi, naomi, naomi, naomi, ROT0, "Sega", "Quiz Ah Megamisama (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3888 | 4172 | /* 0039C */ GAME( 2000, gram2000, naomi, naomi, naomi, naomi, ROT0, "Sega", "Giant Gram 2000 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4173 | /* 0040C */ GAME( 2000, wwfroyal, naomi, naomi, naomi, naomi, ROT0, "Sega", "WWF Royal Rumble (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3889 | 4174 | /* 0041C */ GAME( 2000, slasho, naomi, naomi, naomi, naomi, ROT0, "Sega", "Slashout (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3890 | 4175 | /* 0044C */ GAME( 2001, csmash, naomi, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (rev. A)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3891 | 4176 | /* 0044C */ GAME( 2001, csmasho, csmash, naomi, naomi, naomi, ROT0, "Sega", "Cosmic Smash (JPN, USA, EXP, KOR, AUS) (original)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r5613 | r5614 | |
| 3900 | 4185 | /* 0005C */ GAME( 1999, spawn, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Spawn (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3901 | 4186 | /* 0007C */ GAME( 2000, mvsc2, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Marvel vs. Capcom 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3902 | 4187 | /* 0008C */ GAME( 2000, pstone2, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Power Stone 2 (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3903 | /* 841-0011C */ GAME( 2000, capsnk, naomi, naomi, naomi, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (000904 JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3904 | /* 841-0011C */ GAME( 2000, capsnka, capsnk, naomi, naomi, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (000804 JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 4188 | /* 0011C */ GAME( 2000, capsnk, naomi, naomi, naomi, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (000904 JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 4189 | /* 0011C */ GAME( 2000, capsnka, capsnk, naomi, naomi, naomi, ROT0, "Capcom / SNK", "Capcom Vs. SNK Millennium Fight 2000 (000804 JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3905 | 4190 | /* 0012C */ GAME( 2000, cspike, naomi, naomi, naomi, naomi, ROT0, "Psikyo / Capcom", "Gun Spike (JPN) / Cannon Spike (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3906 | 4191 | /* 0013C */ GAME( 2000, ggx, naomi, naomi, naomi, naomi, ROT0, "Arc System Works","Guilty Gear X (JPN)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 4192 | /* 0014C */ GAME( 2000, gwing2, naomi, naomi, naomi, naomi, ROT0, "Takumi / Capcom", "Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 4193 | /* 0015C */ GAME( 2000, pjustic, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3907 | 4194 | /* 0016 */ GAME( 2000, deathcox, naomi, naomi, naomi, naomi, ROT0, "Ecole", "Death Crimson OX (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3908 | 4195 | /* xxxx */ GAME( 2001, hmgeo, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Heavy Metal Geomatrix (JPN, USA, EUR, ASI, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3909 | 4196 | |
| 3910 | /* Incomplete Dumps (just the program rom IC22) */ | |
| 3911 | /* 840-0083C */ GAME( 1999, derbyoc2, naomi, naomi, naomi, naomi, ROT0, "Sega", "Derby Owners Club II (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3912 | /* 841-0014C */ GAME( 2000, gwing2, naomi, naomi, naomi, naomi, ROT0, "Takumi / Capcom", "Giga Wing 2 (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3913 | /* 841-0015C */ GAME( 2000, pjustic, naomi, naomi, naomi, naomi, ROT0, "Capcom", "Moero Justice Gakuen (JPN) / Project Justice (USA, EXP, KOR, AUS) ", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3914 | /* 840-0040C */ GAME( 2000, wwfroyal, naomi, naomi, naomi, naomi, ROT0, "Sega", "WWF Royal Rumble (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 4197 | /* Games with incomplete dumps */ | |
| 4198 | /* xxxx */ GAME( 2001, gunsur2, naomi, naomi, naomi, naomi, ROT0, "Capcom / Namco", "Gun Survivor 2: Bio Hazard Code Veronica", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3915 | 4199 | |
| 3916 | 4200 | /* Games with game specific bios sets */ |
| 3917 | 4201 | GAME( 1998, hod2bios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi House of the Dead 2 Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 3918 | ||
| 4202 | GAME( 1999, hotd2, hod2bios, naomi, naomi, 0, ROT0, "Sega", "House of the Dead 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 3919 | 4203 | GAME( 1999, f355bios, 0, naomi, naomi, 0, ROT0, "Sega", "Naomi Ferrari F355 Challenge Bios", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| 3920 | 4204 | GAME( 1999, f355, f355bios, naomi, naomi, 0, ROT0, "Sega", "Ferrari F355 Challenge", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 3921 | 4205 | |
| r5613 | r5614 | |
| 4908 | 5192 | NAOMI2_BIOS |
| 4909 | 5193 | |
| 4910 | 5194 | ROM_REGION( 0xa800000, "user1", ROMREGION_ERASEFF) |
| 4911 | ROM_LOAD("epr-23622.ic22", 0x0000000, 0x0400000, CRC(8acafa5b) SHA1(c92bcd40bad6ba8efd1edbfd7e439fb2b3c67fb0) ) | |
| 4912 | ROM_LOAD("ic.1", 0x0800000, 0x0800000, NO_DUMP ) | |
| 4913 | ROM_LOAD("ic.2", 0x1000000, 0x0800000, NO_DUMP ) | |
| 4914 | ROM_LOAD("ic.3", 0x1800000, 0x0800000, NO_DUMP ) | |
| 4915 | ROM_LOAD("ic.4", 0x2000000, 0x0800000, NO_DUMP ) | |
| 4916 | ROM_LOAD("ic.5", 0x2800000, 0x0800000, NO_DUMP ) | |
| 4917 | ROM_LOAD("ic.6", 0x3000000, 0x0800000, NO_DUMP ) | |
| 4918 | ROM_LOAD("ic.7", 0x3800000, 0x0800000, NO_DUMP ) | |
| 4919 | ROM_LOAD("ic.8", 0x4000000, 0x0800000, NO_DUMP ) | |
| 4920 | ROM_LOAD("ic.9", 0x4800000, 0x0800000, NO_DUMP ) | |
| 4921 | ROM_LOAD("ic.10",0x5000000, 0x0800000, NO_DUMP ) | |
| 4922 | ROM_LOAD("ic.11",0x5800000, 0x0800000, NO_DUMP ) | |
| 4923 | ROM_LOAD("ic.12",0x6000000, 0x0800000, NO_DUMP ) | |
| 4924 | ROM_LOAD("ic.13",0x6800000, 0x0800000, NO_DUMP ) | |
| 4925 | ROM_LOAD("ic.14",0x7000000, 0x0800000, NO_DUMP ) | |
| 4926 | ROM_LOAD("ic.15",0x7800000, 0x0800000, NO_DUMP ) | |
| 4927 | ROM_LOAD("ic.16",0x8000000, 0x0800000, NO_DUMP ) | |
| 4928 | ROM_LOAD("ic.17",0x8800000, 0x0800000, NO_DUMP ) | |
| 4929 | ROM_LOAD("ic.18",0x9000000, 0x0800000, NO_DUMP ) | |
| 4930 | ROM_LOAD("ic.19",0x9800000, 0x0800000, NO_DUMP ) | |
| 4931 | ROM_LOAD("ic.20",0xa000000, 0x0800000, NO_DUMP ) | |
| 5195 | ROM_LOAD( "epr-23622.ic22", 0x0000000, 0x0400000, CRC(8acafa5b) SHA1(c92bcd40bad6ba8efd1edbfd7e439fb2b3c67fb0) ) | |
| 5196 | ROM_LOAD( "mpr-23611.ic1", 0x0800000, 0x1000000, CRC(943bc32a) SHA1(11ced99e9dbd7cc93031779e00d4ee1f2dff9086) ) | |
| 5197 | ROM_LOAD( "mpr-23612.ic2", 0x1800000, 0x1000000, CRC(f71d87e5) SHA1(c36d1d07702642db282278f1cf556ed472e930d3) ) | |
| 5198 | ROM_LOAD( "mpr-23613.ic3", 0x2800000, 0x1000000, CRC(689e783e) SHA1(1264c3389610bbf2745b7e6d50f327b1df33b63b) ) | |
| 5199 | ROM_LOAD( "mpr-23614.ic4", 0x3800000, 0x1000000, CRC(e5b8c5e5) SHA1(4b81ecc6375bf731dc3423cf87c2228eb304f2b5) ) | |
| 5200 | ROM_LOAD( "mpr-23615.ic5", 0x4800000, 0x1000000, CRC(95c35866) SHA1(a3dd4cd2c8818a3c5de7aa6c4afc74f872d52b37) ) | |
| 5201 | ROM_LOAD( "mpr-23616.ic6", 0x5800000, 0x1000000, CRC(6288848f) SHA1(a69ddde96d15cee9154ed3e87514286db6bbb622) ) | |
| 5202 | ROM_LOAD( "mpr-23617.ic7", 0x6800000, 0x1000000, CRC(19298892) SHA1(78493587dc49c7c99c5a98f152b17500003316b3) ) | |
| 5203 | ROM_LOAD( "mpr-23618.ic8", 0x7800000, 0x1000000, CRC(67d7b659) SHA1(44e75e16f2740c6e147e101a8714be8c5d9b71f3) ) | |
| 5204 | ROM_LOAD( "mpr-23619.ic9", 0x8800000, 0x1000000, CRC(a5f4f6af) SHA1(bb89d3f0f5bbaf7c40fa43680c7e51ef93f7ed26) ) | |
| 5205 | ROM_LOAD( "mpr-23620.ic10", 0x9800000, 0x1000000, CRC(67aa15a9) SHA1(42c24cbf7069c27430a71509a872cd1c4224aaeb) ) | |
| 4932 | 5206 | ROM_END |
| 4933 | 5207 | |
| 5208 | ROM_START( vf4cart ) | |
| 5209 | NAOMI2_BIOS | |
| 5210 | ||
| 5211 | ROM_REGION( 0xb800000, "user1", ROMREGION_ERASEFF) | |
| 5212 | ROM_LOAD( "epr-23785.ic22", 0x0000000, 0x0400000, CRC(9bd98d4b) SHA1(3b0622625317cd6b2736c5b4a23484fb8bf39e4b) ) | |
| 5213 | ROM_LOAD( "mpr-23774.ic1", 0x0800000, 0x1000000, CRC(0fe7b864) SHA1(357ca3a5d96d7ff27e06367e115ddfd00cb260e3) ) | |
| 5214 | ROM_LOAD( "mpr-23775.ic2", 0x1800000, 0x1000000, BAD_DUMP CRC(6c64d9d9) SHA1(d2033ca3ab9838cad39e17b5c1eb079c6d15b758) ) | |
| 5215 | ROM_LOAD( "mpr-23776.ic3", 0x2800000, 0x1000000, CRC(44b8429e) SHA1(0ec6b6156bef1621700791651903a4589f4b5f84) ) | |
| 5216 | ROM_LOAD( "mpr-23777.ic4", 0x3800000, 0x1000000, CRC(78a4264e) SHA1(40d045240173f330ac6f108b132f9a87884922be) ) | |
| 5217 | ROM_LOAD( "mpr-23778.ic5", 0x4800000, 0x1000000, CRC(02dee78b) SHA1(e08ce0fc0b1db2dcef957c2edb6d51db400a38cb) ) | |
| 5218 | ROM_LOAD( "mpr-23779.ic6", 0x5800000, 0x1000000, CRC(6e458eea) SHA1(4c85fcacf4ff46d4a137afcf5906092fd88fe4b1) ) | |
| 5219 | ROM_LOAD( "mpr-23780.ic7", 0x6800000, 0x1000000, CRC(a775a51c) SHA1(b3eae20e5e7d74252368fd902c4e94a6ba6cb154) ) | |
| 5220 | ROM_LOAD( "mpr-23781.ic8", 0x7800000, 0x1000000, BAD_DUMP CRC(689457fa) SHA1(734b6b5f2ba78af24a613aef8d4e739f296413f7) ) | |
| 5221 | ROM_LOAD( "mpr-23782.ic9", 0x8800000, 0x1000000, CRC(4f72e901) SHA1(a1d231c446d2c34e5a7e7145754b2313a2d03fd4) ) | |
| 5222 | ROM_LOAD( "mpr-23783.ic10", 0x9800000, 0x1000000, CRC(c8d4f6f9) SHA1(9e9df605c050b3780d7df34bd5041d30bc084d2d) ) | |
| 5223 | ROM_LOAD( "mpr-23784.ic11", 0xa800000, 0x1000000, BAD_DUMP CRC(3a7ebe78) SHA1(6f414db03761be0d2f995193df8146f3b82c18a8) ) | |
| 5224 | ROM_END | |
| 5225 | ||
| 5226 | ROM_START( clubkrte ) | |
| 5227 | NAOMI2_BIOS | |
| 5228 | ||
| 5229 | ROM_REGION( 0xb800000, "user1", ROMREGION_ERASEFF) | |
| 5230 | ROM_LOAD( "epr-23704.ic22", 0x0000000, 0x0400000, CRC(ff700a0d) SHA1(e2db0d2bd7dc88b3a487077e8ce56eb6cfd9b02d) ) | |
| 5231 | ROM_LOAD( "mpr-23693.ic1", 0x0800000, 0x1000000, CRC(28995764) SHA1(a1457f9935dde2e5aaa5ef245c736c0f2f8c74b7) ) | |
| 5232 | ROM_LOAD( "mpr-22694.ic2", 0x1800000, 0x1000000, CRC(37d30111) SHA1(4c07df8cd548cac79d48709e61f692d762471f8f) ) | |
| 5233 | ROM_LOAD( "mpr-22695.ic3", 0x2800000, 0x1000000, BAD_DUMP CRC(9fdeaa70) SHA1(2d01a49b8d8d23f61584bec31d75723cee47dc44) ) | |
| 5234 | ROM_LOAD( "mpr-22696.ic4", 0x3800000, 0x1000000, BAD_DUMP CRC(cb12ae00) SHA1(cf94ae123217071c169aa79c842f0a28abba9713) ) | |
| 5235 | ROM_LOAD( "mpr-22697.ic5", 0x4800000, 0x1000000, CRC(1383c742) SHA1(6efd17632a277a4bb0e47cc912fbc9865a8b14c3) ) | |
| 5236 | ROM_LOAD( "mpr-22698.ic6", 0x5800000, 0x1000000, BAD_DUMP CRC(1701cd3a) SHA1(e217206745ce9dca51733f77eb093b3ef2a10c5e) ) | |
| 5237 | ROM_LOAD( "mpr-22699.ic7", 0x6800000, 0x1000000, BAD_DUMP CRC(e58cfa77) SHA1(27c421c37d7e3df88cb7b2240bfec1ae460001a3) ) | |
| 5238 | ROM_LOAD( "mpr-22700.ic8", 0x7800000, 0x1000000, CRC(db9e5c1d) SHA1(db918c0fa1860f4345806e574d44354aba5fcd54) ) | |
| 5239 | ROM_LOAD( "mpr-22701.ic9", 0x8800000, 0x1000000, BAD_DUMP CRC(66ee25be) SHA1(17804308aa63bf58d2bde0b4b202d2bd0974a981) ) | |
| 5240 | ROM_LOAD( "mpr-22702.ic10", 0x9800000, 0x1000000, CRC(e302b582) SHA1(787192ed9f9a08541eecc3128855485cad802a42) ) | |
| 5241 | ROM_LOAD( "mpr-22703.ic11", 0xa800000, 0x1000000, CRC(702b8b4a) SHA1(3a8dfde458f341e7db20664382b9fce2b6e5d462) ) | |
| 5242 | ROM_END | |
| 5243 | ||
| 4934 | 5244 | /********************************************** |
| 4935 | 5245 | * |
| 4936 | 5246 | * Naomi 2 GD-ROM defines |
| r5613 | r5614 | |
| 5164 | 5474 | //Naomi 2 Cart Games |
| 5165 | 5475 | /* Complete Dumps */ |
| 5166 | 5476 | GAME( 2001, vstrik3c, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (Cart) (USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5167 | ||
| 5168 | /* Incomplete Dumps (just the program rom IC22) */ | |
| 5169 | 5477 | GAME( 2001, wldrider, naomi2, naomi, naomi, 0, ROT0, "Sega", "Wild Riders (JPN, USA, EXP, KOR, AUS)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| 5478 | GAME( 2001, vf4cart, naomi2, naomi, naomi, 0, ROT0, "Sega", "Virtua Fighter 4 (Cart)", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5479 | GAME( 2002, clubkrte, naomi2, naomi, naomi, 0, ROT0, "Sega", "Club Kart: European Session", GAME_UNEMULATED_PROTECTION|GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5170 | 5480 | |
| 5171 | 5481 | /* GDS-xxxx (Sega first party games) */ |
| 5172 | 5482 | GAME( 2001, vstrik3, naomi2, naomigd, naomi, 0, ROT0, "Sega", "Virtua Striker 3 (GDS-0006)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r5613 | r5614 | |
| 5208 | 5518 | {4,0,1,2,5,7,3,6} |
| 5209 | 5519 | }; |
| 5210 | 5520 | |
| 5211 | static const atomiswave_key df_key = { | |
| 5212 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, | |
| 5213 | {9,15,28,7,13,24,2,23,21,1,22,16,18,8,17,31,27,6,30,12,4,20,5,19,0,25,3,29,10,14,11,26}, | |
| 5214 | {5,2,13,11,8,6,12,1,4,3,0,10,14,15,7,9}, | |
| 5215 | {11,6,10,0,12,1,8,14,2,9,13,3,7,4,15,5}, | |
| 5216 | {1,5,6,2,4,7,3,0} | |
| 5217 | }; | |
| 5218 | ||
| 5219 | 5521 | static const atomiswave_key rm_key = { |
| 5220 | 5522 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, |
| 5221 | 5523 | {3,0,14,17,10,15,31,20,13,2,29,28,9,18,25,27,6,19,30,22,7,12,1,16,23,11,24,4,8,26,21,5}, |
| r5613 | r5614 | |
| 5248 | 5550 | {4,0,1,2,5,7,3,6} |
| 5249 | 5551 | }; |
| 5250 | 5552 | |
| 5553 | static const atomiswave_key dolphin_key = { | |
| 5554 | {8,10,1,3,7,4,11,2,5,15,6,0,12,13,9,14}, | |
| 5555 | {11,8,6,25,2,7,23,28,5,10,21,20,1,26,17,19,14,27,22,30,15,4,9,24,31,3,16,12,0,18,29,13}, | |
| 5556 | {13,5,9,6,4,2,11,10,12,0,8,1,3,14,15,7}, | |
| 5557 | {1,13,11,3,8,7,9,10,12,15,4,14,0,5,6,2}, | |
| 5558 | {3,0,5,6,2,4,1,7} | |
| 5559 | }; | |
| 5560 | ||
| 5561 | static const atomiswave_key demofist_key = { | |
| 5562 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, | |
| 5563 | {9,15,28,7,13,24,2,23,21,1,22,16,18,8,17,31,27,6,30,12,4,20,5,19,0,25,3,29,10,14,11,26}, | |
| 5564 | {5,2,13,11,8,6,12,1,4,3,0,10,14,15,7,9}, | |
| 5565 | {11,6,10,0,12,1,8,14,2,9,13,3,7,4,15,5}, | |
| 5566 | {1,5,6,2,4,7,3,0} | |
| 5567 | }; | |
| 5568 | ||
| 5569 | static const atomiswave_key rumblef_key = { | |
| 5570 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, | |
| 5571 | {11,3,7,1,31,17,16,15,24,18,23,26,4,25,20,10,12,27,29,21,5,8,30,14,19,9,0,2,13,6,22,28}, | |
| 5572 | {7,11,10,3,15,6,14,4,9,5,8,0,1,12,2,13}, | |
| 5573 | {11,1,8,10,9,5,15,14,12,3,0,6,4,7,13,2}, | |
| 5574 | {4,0,1,2,5,7,3,6} | |
| 5575 | }; | |
| 5576 | ||
| 5577 | static const atomiswave_key ngbc_key = { | |
| 5578 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, | |
| 5579 | {17,25,29,27,5,11,10,21,2,8,13,0,30,3,14,16,22,1,7,15,31,18,4,20,9,19,26,24,23,28,12,6}, | |
| 5580 | {15,3,2,11,7,14,6,12,1,13,0,8,9,4,10,5}, | |
| 5581 | {6,12,5,7,4,8,2,3,1,14,13,11,9,10,0,15}, | |
| 5582 | {5,1,0,3,4,6,2,7} | |
| 5583 | }; | |
| 5584 | ||
| 5585 | static const atomiswave_key kofnw_key = { | |
| 5586 | {4,5,9,6,1,13,7,11,10,0,14,12,8,15,2,3}, | |
| 5587 | {22,16,3,24,18,7,29,8,10,30,9,15,13,23,14,0,4,25,1,19,27,11,26,12,31,6,28,2,21,17,20,5}, | |
| 5588 | {8,15,0,6,5,11,1,12,9,14,13,7,3,2,10,4}, | |
| 5589 | {2,15,3,9,5,8,1,7,11,0,4,10,14,13,6,12}, | |
| 5590 | {4,0,3,7,1,2,6,5} | |
| 5591 | }; | |
| 5592 | ||
| 5593 | static const atomiswave_key kov7sprt_key = { | |
| 5594 | {14,1,11,15,7,3,8,13,0,4,2,12,6,10,5,9}, | |
| 5595 | {17,3,31,2,28,10,9,29,6,25,24,8,13,1,19,15,22,0,14,20,16,7,21,4,18,26,27,5,12,23,11,30}, | |
| 5596 | {4,8,11,15,3,14,7,12,1,0,9,5,6,13,2,10}, | |
| 5597 | {14,0,9,11,4,1,7,5,13,6,8,12,2,3,10,15}, | |
| 5598 | {2,1,0,5,4,6,7,3} | |
| 5599 | }; | |
| 5600 | ||
| 5601 | static const atomiswave_key ggisuka_key = { | |
| 5602 | {12,7,11,2,0,5,15,6,1,8,14,4,9,13,3,10}, | |
| 5603 | {14,6,2,4,26,20,21,10,29,23,18,31,1,28,17,15,9,30,24,16,0,13,27,11,22,12,5,7,8,3,19,25}, | |
| 5604 | {5,9,8,1,13,4,12,6,11,7,10,2,3,14,0,15}, | |
| 5605 | {15,5,12,14,13,1,11,10,8,7,4,2,0,3,9,6}, | |
| 5606 | {1,5,4,7,0,2,6,3} | |
| 5607 | }; | |
| 5608 | ||
| 5251 | 5609 | static UINT16 atomiswave_decrypt(UINT16 cipherText, int address, const atomiswave_key* key) |
| 5252 | 5610 | { |
| 5253 | 5611 | int b0,b1,b2,b3; |
| r5613 | r5614 | |
| 5274 | 5632 | static DRIVER_INIT( atomiswave ) |
| 5275 | 5633 | { |
| 5276 | 5634 | UINT64 *ROM = (UINT64 *)memory_region(machine, "maincpu"); |
| 5635 | #if 0 | |
| 5636 | UINT8 *dcdata = (UINT8 *)memory_region(machine, "user1"); | |
| 5637 | FILE *f; | |
| 5277 | 5638 | |
| 5639 | f = fopen("aw.bin", "wb"); | |
| 5640 | fwrite(dcdata, 0x8000000, 1, f); | |
| 5641 | fclose(f); | |
| 5642 | #endif | |
| 5278 | 5643 | // patch out long startup delay |
| 5279 | 5644 | ROM[0x98e/8] = (ROM[0x98e/8] & U64(0xffffffffffff)) | (UINT64)0x0009<<48; |
| 5280 | 5645 | |
| r5613 | r5614 | |
| 5308 | 5673 | |
| 5309 | 5674 | for(i=0; i<rom_size/2; i++) |
| 5310 | 5675 | { |
| 5311 | src[i] = atomiswave_decrypt(src[i], i*2, &df_key); | |
| 5676 | src[i] = atomiswave_decrypt(src[i], i*2, &demofist_key); | |
| 5312 | 5677 | } |
| 5313 | 5678 | |
| 5314 | 5679 | DRIVER_INIT_CALL(atomiswave); |
| r5613 | r5614 | |
| 5374 | 5739 | DRIVER_INIT_CALL(atomiswave); |
| 5375 | 5740 | } |
| 5376 | 5741 | |
| 5742 | static DRIVER_INIT(dolphin) | |
| 5743 | { | |
| 5744 | int i; | |
| 5745 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); | |
| 5746 | ||
| 5747 | long rom_size = memory_region_length(machine, "user1"); | |
| 5748 | ||
| 5749 | for(i=0; i<rom_size/2; i++) | |
| 5750 | { | |
| 5751 | src[i] = atomiswave_decrypt(src[i], i*2, &dolphin_key); | |
| 5752 | } | |
| 5753 | ||
| 5754 | DRIVER_INIT_CALL(atomiswave); | |
| 5755 | } | |
| 5756 | ||
| 5757 | static DRIVER_INIT(rumblef) | |
| 5758 | { | |
| 5759 | int i; | |
| 5760 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); | |
| 5761 | ||
| 5762 | long rom_size = memory_region_length(machine, "user1"); | |
| 5763 | ||
| 5764 | for(i=0; i<rom_size/2; i++) | |
| 5765 | { | |
| 5766 | src[i] = atomiswave_decrypt(src[i], i*2, &rumblef_key); | |
| 5767 | } | |
| 5768 | ||
| 5769 | DRIVER_INIT_CALL(atomiswave); | |
| 5770 | } | |
| 5771 | ||
| 5772 | static DRIVER_INIT(ngbc) | |
| 5773 | { | |
| 5774 | int i; | |
| 5775 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); | |
| 5776 | ||
| 5777 | long rom_size = memory_region_length(machine, "user1"); | |
| 5778 | ||
| 5779 | for(i=0; i<rom_size/2; i++) | |
| 5780 | { | |
| 5781 | src[i] = atomiswave_decrypt(src[i], i*2, &ngbc_key); | |
| 5782 | } | |
| 5783 | ||
| 5784 | DRIVER_INIT_CALL(atomiswave); | |
| 5785 | } | |
| 5786 | ||
| 5787 | static DRIVER_INIT(kofnw) | |
| 5788 | { | |
| 5789 | int i; | |
| 5790 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); | |
| 5791 | ||
| 5792 | long rom_size = memory_region_length(machine, "user1"); | |
| 5793 | ||
| 5794 | for(i=0; i<rom_size/2; i++) | |
| 5795 | { | |
| 5796 | src[i] = atomiswave_decrypt(src[i], i*2, &kofnw_key); | |
| 5797 | } | |
| 5798 | ||
| 5799 | DRIVER_INIT_CALL(atomiswave); | |
| 5800 | } | |
| 5801 | ||
| 5802 | static DRIVER_INIT(kov7sprt) | |
| 5803 | { | |
| 5804 | int i; | |
| 5805 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); | |
| 5806 | ||
| 5807 | long rom_size = memory_region_length(machine, "user1"); | |
| 5808 | ||
| 5809 | for(i=0; i<rom_size/2; i++) | |
| 5810 | { | |
| 5811 | src[i] = atomiswave_decrypt(src[i], i*2, &kov7sprt_key); | |
| 5812 | } | |
| 5813 | ||
| 5814 | DRIVER_INIT_CALL(atomiswave); | |
| 5815 | } | |
| 5816 | ||
| 5817 | static DRIVER_INIT(ggisuka) | |
| 5818 | { | |
| 5819 | int i; | |
| 5820 | UINT16 *src = (UINT16 *)(memory_region(machine, "user1")); | |
| 5821 | ||
| 5822 | long rom_size = memory_region_length(machine, "user1"); | |
| 5823 | ||
| 5824 | for(i=0; i<rom_size/2; i++) | |
| 5825 | { | |
| 5826 | src[i] = atomiswave_decrypt(src[i], i*2, &ggisuka_key); | |
| 5827 | } | |
| 5828 | ||
| 5829 | DRIVER_INIT_CALL(atomiswave); | |
| 5830 | } | |
| 5831 | ||
| 5377 | 5832 | ROM_START( fotns ) |
| 5378 | 5833 | ROM_REGION( 0x200000, "maincpu", 0) |
| 5379 | 5834 | AW_BIOS |
| r5613 | r5614 | |
| 5389 | 5844 | ROM_LOAD("ax1907m01.ic17", 0x7000000, 0x1000000, CRC(9d3a0520) SHA1(78583fd171b34439f77a04a97ebe3c9d1bab61cc) ) |
| 5390 | 5845 | ROM_END |
| 5391 | 5846 | |
| 5392 | ROM_START( demofist ) | |
| 5393 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5394 | AW_BIOS | |
| 5395 | ||
| 5396 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5397 | ROM_LOAD("ax0601p01.ic18", 0x0000000, 0x0800000, CRC(0efb38ad) SHA1(9400e37efe3e936474d74400ebdf28ad0869b67b) ) | |
| 5398 | ROM_LOAD("ic11", 0x1000000, 0x1000000, NO_DUMP ) | |
| 5399 | ROM_LOAD("ic12", 0x2000000, 0x1000000, NO_DUMP ) | |
| 5400 | ROM_LOAD("ic13", 0x3000000, 0x1000000, NO_DUMP ) | |
| 5401 | ROM_LOAD("ic14", 0x4000000, 0x1000000, NO_DUMP ) | |
| 5402 | ROM_LOAD("ic15", 0x5000000, 0x1000000, NO_DUMP ) | |
| 5403 | ROM_LOAD("ic16", 0x6000000, 0x1000000, NO_DUMP ) | |
| 5404 | ROM_LOAD("ic17", 0x7000000, 0x1000000, NO_DUMP ) | |
| 5405 | ROM_END | |
| 5406 | ||
| 5407 | 5847 | ROM_START( rangrmsn ) |
| 5408 | 5848 | ROM_REGION( 0x200000, "maincpu", 0) |
| 5409 | 5849 | AW_BIOS |
| r5613 | r5614 | |
| 5462 | 5902 | ROM_LOAD( "flash128.ic4s", 0x400000, 0x1000000, CRC(866ed675) SHA1(2c4c06935b7ab1876e640cede51713b841833567) ) |
| 5463 | 5903 | ROM_END |
| 5464 | 5904 | |
| 5905 | ROM_START( dolphin ) | |
| 5906 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5907 | AW_BIOS | |
| 5908 | ||
| 5909 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5910 | ROM_LOAD( "ax0401p01.ic18", 0x0000000, 0x0800000, CRC(195d6328) SHA1(cf3b5699f81235919dd3b1974d2ecb0376cb4552) ) | |
| 5911 | ROM_LOAD( "ax0401m01.ic11", 0x1000000, 0x1000000, CRC(5e5dca57) SHA1(e0623c84f66cada37d4c9399a7a8fc6866933144) ) | |
| 5912 | ROM_LOAD( "ax0402m01.ic12", 0x2000000, 0x1000000, CRC(77dd4771) SHA1(dcd23b8ddc82eab2f325266ffd7ed3fbc1bcdf71) ) | |
| 5913 | ROM_LOAD( "ax0403m01.ic13", 0x3000000, 0x1000000, CRC(911d0674) SHA1(eec35badcfbfe412b7104a86c2111f5a1b5fb5cd) ) | |
| 5914 | ROM_LOAD( "ax0404m01.ic14", 0x4000000, 0x1000000, CRC(f82a4ca3) SHA1(da686d86e176a9f24874d2916b1932f03a99a52d) ) | |
| 5915 | ROM_LOAD( "ax0405m01.ic15", 0x5000000, 0x1000000, CRC(b88298d7) SHA1(490c3ec471018895b7268ee33498dddaccbbfd5a) ) | |
| 5916 | ROM_END | |
| 5917 | ||
| 5918 | ROM_START( demofist ) | |
| 5919 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5920 | AW_BIOS | |
| 5921 | ||
| 5922 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5923 | ROM_LOAD( "ax0601p01.ic18", 0x0000000, 0x0800000, CRC(0efb38ad) SHA1(9400e37efe3e936474d74400ebdf28ad0869b67b) ) | |
| 5924 | ROM_LOAD( "ax0601m01.ic11", 0x1000000, 0x1000000, CRC(12fda2c7) SHA1(3afbac221ffe249386e4cb50b4edd013d9a40062) ) | |
| 5925 | ROM_LOAD( "ax0602m01.ic12", 0x2000000, 0x1000000, CRC(aea61fdf) SHA1(0a088848bbf7a47df8b44b69bf72ed0d4a1088f8) ) | |
| 5926 | ROM_LOAD( "ax0603m01.ic13", 0x3000000, 0x1000000, CRC(d5879d35) SHA1(977cd3b373c6f94eb21ffb24ff564971d3d633e5) ) | |
| 5927 | ROM_LOAD( "ax0604m01.ic14", 0x4000000, 0x1000000, CRC(a7b09048) SHA1(229fa2332b58fec2a712c3ebd672662f35a9485a) ) | |
| 5928 | ROM_LOAD( "ax0605m01.ic15", 0x5000000, 0x1000000, CRC(18d8437e) SHA1(fe2e189e40a89141335e754268d29d46e3eb3bb8) ) | |
| 5929 | ROM_LOAD( "ax0606m01.ic16", 0x6000000, 0x1000000, CRC(42c81617) SHA1(1cc686af5e3fc56143836e3dcc0067893f82fcf9) ) | |
| 5930 | ROM_LOAD( "ax0607m01.ic17", 0x7000000, 0x1000000, CRC(96e5aa84) SHA1(e9841f550f2ef409d97004542bcadabb6b9e84af) ) | |
| 5931 | ROM_END | |
| 5932 | ||
| 5933 | ROM_START( rumblef ) | |
| 5934 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5935 | AW_BIOS | |
| 5936 | ||
| 5937 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5938 | ROM_LOAD( "ax1801p01.ic18", 0x0000000, 0x0800000, CRC(2f7fb163) SHA1(bf819d798d9a3a7bc754e111a3f53b9db6d6042a) ) | |
| 5939 | ROM_LOAD( "ax1801m01.ic11", 0x1000000, 0x1000000, CRC(c38aa61c) SHA1(e2f688a0aa8b0119f5fd3d53c8904e035d43a4b1) ) | |
| 5940 | ROM_LOAD( "ax1802m01.ic12", 0x2000000, 0x1000000, CRC(72e0ebc8) SHA1(e85300a405ea14c4c9d857eb9685c93faaca1d56) ) | |
| 5941 | ROM_LOAD( "ax1803m01.ic13", 0x3000000, 0x1000000, CRC(d0f59d98) SHA1(b854796087e9f76a13a21da8249f7224e451e129) ) | |
| 5942 | ROM_LOAD( "ax1804m01.ic14", 0x4000000, 0x1000000, CRC(15595cba) SHA1(8dd06d1f986cd21a58d20b662b11ed7ba8a6ff7a) ) | |
| 5943 | ROM_LOAD( "ax1805m01.ic15", 0x5000000, 0x1000000, CRC(3d3f8e0d) SHA1(364a0bda890722b9fb72171f96c742b8f3fef23e) ) | |
| 5944 | ROM_LOAD( "ax1806m01.ic16", 0x6000000, 0x1000000, CRC(ac2751bb) SHA1(5070fa12bf109ab87e8f7ea46ac4ae78a73105da) ) | |
| 5945 | ROM_LOAD( "ax1807m01.ic17", 0x7000000, 0x1000000, CRC(3b2fbdb0) SHA1(f9f7e06785d3a07282247aaedd9999aa7c2670b9) ) | |
| 5946 | ROM_END | |
| 5947 | ||
| 5948 | ROM_START( ngbc ) | |
| 5949 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5950 | AW_BIOS | |
| 5951 | ||
| 5952 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5953 | ROM_LOAD( "ax3301p01.fmem1", 0x000000, 0x800000, CRC(f7e24e67) SHA1(8eef26d44b294faa509304b1b04f4d801337bc99) ) | |
| 5954 | ROM_END | |
| 5955 | ||
| 5956 | ROM_START( kofnw ) | |
| 5957 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5958 | AW_BIOS | |
| 5959 | ||
| 5960 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5961 | ROM_LOAD( "ax2201p01.ic18", 0x0000000, 0x0800000, CRC(27aab918) SHA1(41c5ddd8bd4c91481750606ab44aa115b5fe01d0) ) | |
| 5962 | ROM_LOAD( "ax2201m01.ic11", 0x1000000, 0x1000000, CRC(22ea665b) SHA1(292c92c9ae43eea2d1c27cedfb89c3956b8dea32) ) | |
| 5963 | ROM_LOAD( "ax2202m01.ic12", 0x2000000, 0x1000000, CRC(7fad1bea) SHA1(89f3f88af48973a4685955d86ef97a1487b8e7a8) ) | |
| 5964 | ROM_LOAD( "ax2203m01.ic13", 0x3000000, 0x1000000, CRC(78986ca4) SHA1(5a6c8c12955573f33361d2c6f20f85de35ac7bae) ) | |
| 5965 | ROM_LOAD( "ax2204m01.ic14", 0x4000000, 0x1000000, CRC(6ffbeb04) SHA1(975062cf364589dbdd5c5cb5ca945f76d87fc120) ) | |
| 5966 | ROM_LOAD( "ax2205m01.ic15", 0x5000000, 0x1000000, CRC(2851b791) SHA1(566ef95ea066b7bf548986085670242be217befc) ) | |
| 5967 | ROM_LOAD( "ax2206m01.ic16", 0x6000000, 0x1000000, CRC(e53eb965) SHA1(f50cd53a5859f081d8a278d24a519c9d9b49ab96) ) | |
| 5968 | ROM_END | |
| 5969 | ||
| 5970 | ROM_START( kov7sprt ) | |
| 5971 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5972 | AW_BIOS | |
| 5973 | ||
| 5974 | ROM_REGION( 0x8000000, "user1", ROMREGION_ERASE) | |
| 5975 | ROM_LOAD( "ax1301p01.ic18", 0x0000000, 0x0800000, CRC(6833a334) SHA1(646aaa578e09ad23bc9c7f4fbdfb3c1486916fd3) ) | |
| 5976 | ROM_LOAD( "ax1301m01.ic11", 0x1000000, 0x1000000, CRC(58ae7ca1) SHA1(e91975697b797ea05488ace649cbb9964b4cd500) ) | |
| 5977 | ROM_LOAD( "ax1301m02.ic12", 0x2000000, 0x1000000, CRC(871ea03f) SHA1(6806910832ca271a9240aca8e91279556e5b0cb7) ) | |
| 5978 | ROM_LOAD( "ax1301m03.ic13", 0x3000000, 0x1000000, CRC(abc328bc) SHA1(d9271d4e5abe76d31de0f60a5c106260338d42e9) ) | |
| 5979 | ROM_LOAD( "ax1301m04.ic14", 0x4000000, 0x1000000, CRC(25a176d1) SHA1(6d815bf6acb645fead060733660e24fb0d44282d) ) | |
| 5980 | ROM_LOAD( "ax1301m05.ic15", 0x5000000, 0x1000000, CRC(e6573a93) SHA1(0666e52d0088263f28938e4c8aae201e604ec1f2) ) | |
| 5981 | ROM_LOAD( "ax1301m06.ic16", 0x6000000, 0x1000000, CRC(cb8cacb4) SHA1(5d008e8a934451b9bfa33fedfd492c86d9226ef5) ) | |
| 5982 | ROM_LOAD( "ax1301m07.ic17", 0x7000000, 0x1000000, CRC(0ca92213) SHA1(115c50fa55e6de3439de23e74621695510c6a7ba) ) | |
| 5983 | ROM_END | |
| 5984 | ||
| 5985 | ROM_START( ggisuka ) | |
| 5986 | ROM_REGION( 0x200000, "maincpu", 0) | |
| 5987 | AW_BIOS | |
| 5988 | ||
| 5989 | ROM_REGION( 0x9000000, "user1", ROMREGION_ERASE) | |
| 5990 | ROM_LOAD( "ax1201p01.ic18", 0x0000000, 0x0800000, CRC(0a78d52c) SHA1(e9006dc43cd11d5ba49a092a1dff31dc10700c28) ) | |
| 5991 | ROM_LOAD( "ax1202m01.ic11", 0x1000000, 0x1000000, CRC(dfc6fd67) SHA1(f9d35b18a03d22f70feda42d314b0f9dd54eea55) ) | |
| 5992 | ROM_LOAD( "ax1203m01.ic12", 0x2000000, 0x1000000, CRC(bf623df9) SHA1(8b9a8e8100ff6d2ce9a982ab8eb1d542f1c7af03) ) | |
| 5993 | ROM_LOAD( "ax1204m01.ic13", 0x3000000, 0x1000000, CRC(c80c3930) SHA1(5c39fde36e2ebbfe72967d7d0202eb454a8d3bbe) ) | |
| 5994 | ROM_LOAD( "ax1205m01.ic14", 0x4000000, 0x1000000, CRC(e99a269d) SHA1(a52148b82b0338b8bad8b52985302eaf81a4cfde) ) | |
| 5995 | ROM_LOAD( "ax1206m01.ic15", 0x5000000, 0x1000000, CRC(807ab795) SHA1(17c86b1a56333c05b68ff84f83e964d013c1819c) ) | |
| 5996 | ROM_LOAD( "ax1207m01.ic16", 0x6000000, 0x1000000, CRC(6636d1b8) SHA1(9bd8fc114557f6fbe772f85eeb246f7336d4255e) ) | |
| 5997 | ROM_LOAD( "ax1208m01.ic17", 0x7000000, 0x1000000, CRC(38bda476) SHA1(0234a6f5fbaf5e958b3ba0db311dff157f80addc) ) | |
| 5998 | ROM_LOAD( "ax1201m01.ic10", 0x8000000, 0x1000000, CRC(df96ce30) SHA1(25a9f743b1c2b11896d0c7a2dc1c198fc977aaca) ) | |
| 5999 | ROM_END | |
| 6000 | ||
| 5465 | 6001 | /* Atomiswave */ |
| 5466 | GAME( 2001, awbios, 0, aw, | |
| 6002 | GAME( 2001, awbios, 0, aw, | |
| 5467 | 6003 | |
| 5468 | GAME( 2002, sprtshot, awbios, aw, naomi, sprtshot, ROT0, "Sammy", "Sports Shooting USA", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5469 | GAME( 2003, demofist, awbios, aw, naomi, demofist, ROT0, "Polygon Magic / Dimps", "Demolish Fist", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5470 | GAME( 2004, rangrmsn, awbios, aw, naomi, rangrmsn, ROT0, "Sammy", "Ranger Mission", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5471 | GAME( 2005, fotns, awbios, aw, naomi, fotns, ROT0, "Arc System Works", "Fist Of The North Star", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5472 | GAME( 2005, xtrmhunt, awbios, aw, naomi, xtrmhunt, ROT0, "Sammy", "Extreme Hunting", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5473 | GAME( 2006, xtrmhnt2, awbios, aw, naomi, xtrmhnt2, ROT0, "Sammy", "Extreme Hunting 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 5474 | ||
| 6004 | GAME( 2002, sprtshot, awbios, aw, aw, sprtshot, ROT0, "Sammy USA", "Sports Shooting USA", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6005 | GAME( 2003, demofist, awbios, aw, aw, demofist, ROT0, "Polygon Magic / Dimps", "Demolish Fist", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6006 | GAME( 2003, dolphin, awbios, aw, aw, dolphin, ROT0, "Sammy", "Dolphin Blue", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) | |
| 6007 | GAME( 2003, ggisuka, awbios, aw, aw, ggisuka, ROT0, "Sammy / Arc System Works", "Guilty Gear Isuka", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6008 | GAME( 2004, rumblef, awbios, aw, aw, rumblef, ROT0, "Sammy / Dimps", "The Rumble Fish", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) | |
| 6009 | GAME( 2004, rangrmsn, awbios, aw, aw, rangrmsn, ROT0, "Sammy", "Ranger Mission", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6010 | GAME( 2004, kov7sprt, awbios, aw, aw, kov7sprt, ROT0, "Sammy / IGS", "Knights of Valour - The Seven Spirits", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND ) | |
| 6011 | GAME( 2005, ngbc, awbios, aw, aw, ngbc, ROT0, "Sammy / SNK Playmore", "Neo-Geo Battle Coliseum", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6012 | GAME( 2005, fotns, awbios, aw, aw, fotns, ROT0, "Sega / Arc System Works", "Fist Of The North Star", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6013 | GAME( 2005, kofnw, awbios, aw, aw, kofnw, ROT0, "Sammy / SNK Playmore", "The King of Fighters Neowave", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6014 | GAME( 2005, xtrmhunt, awbios, aw, aw, xtrmhunt, ROT0, "Sammy", "Extreme Hunting", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) | |
| 6015 | GAME( 2006, xtrmhnt2, awbios, aw, aw, xtrmhnt2, ROT0, "Sega", "Extreme Hunting 2", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING ) |
| r5613 | r5614 | |
|---|---|---|
| 369 | 369 | |
| 370 | 370 | static VIDEO_UPDATE( meritm ) |
| 371 | 371 | { |
| 372 | if(input_code_pressed_once(KEYCODE_Q)) | |
| 372 | if(input_code_pressed_once(screen->machine, KEYCODE_Q)) | |
| 373 | 373 | { |
| 374 | 374 | layer0_enabled^=1; |
| 375 | 375 | popmessage("Layer 0 %sabled",layer0_enabled ? "en" : "dis"); |
| 376 | 376 | } |
| 377 | if(input_code_pressed_once(KEYCODE_W)) | |
| 377 | if(input_code_pressed_once(screen->machine, KEYCODE_W)) | |
| 378 | 378 | { |
| 379 | 379 | layer1_enabled^=1; |
| 380 | 380 | popmessage("Layer 1 %sabled",layer1_enabled ? "en" : "dis"); |
| r5613 | r5614 | |
|---|---|---|
| 196 | 196 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 197 | 197 | INPUT_PORTS_END |
| 198 | 198 | |
| 199 | ||
| 199 | /* this makes no sense at all! it seems impossible to get the colours to align up in the korean flag ingame and everything else is slightly broken too */ | |
| 200 | 200 | static const gfx_layout pokechmp_charlayout = |
| 201 | 201 | { |
| 202 | 202 | 8,8, /* 8*8 characters */ |
| r5613 | r5614 | |
| 209 | 209 | }; |
| 210 | 210 | |
| 211 | 211 | |
| 212 | /* should be ok.. */ | |
| 212 | 213 | static const gfx_layout pokechmp_spritelayout = |
| 213 | 214 | { |
| 214 | 16,16, /* 16*16 sprites */ | |
| 215 | RGN_FRAC(1,8), /* 1024 sprites */ | |
| 216 | 4, | |
| 217 | { RGN_FRAC(1,8),RGN_FRAC(5,8), RGN_FRAC(3,8),RGN_FRAC(7,8) }, | |
| 218 | { 128+7, 128+6, 128+5, 128+4, 128+3, 128+2, 128+1, 128+0, 7, 6, 5, 4, 3, 2, 1, 0 }, | |
| 219 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 220 | 32*8 /* every char takes 8 consecutive bytes */ | |
| 215 | 16,16, /* 16*16 sprites */ | |
| 216 | RGN_FRAC(1,8), /* 1024 sprites */ | |
| 217 | 4, | |
| 218 | {RGN_FRAC(1,8),RGN_FRAC(3,8),RGN_FRAC(5,8),RGN_FRAC(7,8)}, | |
| 219 | { 128+7, 128+6, 128+5, 128+4, 128+3, 128+2, 128+1, 128+0, 7, 6, 5, 4, 3, 2, 1, 0 }, | |
| 220 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, | |
| 221 | 32*8 /* every char takes 8 consecutive bytes */ | |
| 221 | 222 | }; |
| 222 | 223 | |
| 223 | 224 | |
| r5613 | r5614 | |
| 290 | 291 | ROM_LOAD( "pokechamp_08_27c020.bin", 0xc0000, 0x40000, CRC(e9db54d6) SHA1(ac3b7c06d0f61847bf9bc6147f2f88d712f2b4b3) ) |
| 291 | 292 | |
| 292 | 293 | ROM_REGION( 0x40000, "gfx2", 0 ) |
| 293 | /* the first half of all these roms is identical... for rom 3 both halves match, is the first half unused? 4bpp gfx? */ | |
| 294 | ROM_LOAD( "pokechamp_01_27c512.bin", 0x00000, 0x10000, CRC(338fc412) SHA1(bb8ae99ee6a399a8c67bedb88d0837fd0a4a426c) ) | |
| 295 | ROM_LOAD( "pokechamp_02_27c512.bin", 0x10000, 0x10000, CRC(1ff44545) SHA1(2eee44484accce7b0ba21babf6e8344b234a4e87) ) | |
| 296 | ROM_LOAD( "pokechamp_03_27c512.bin", 0x20000, 0x10000, CRC(99f9884a) SHA1(096d6ce70dc51fb9142e80e1ec45d6d7225481f5) ) | |
| 297 | ROM_LOAD( "pokechamp_04_27c512.bin", 0x30000, 0x10000, CRC(ee6991af) SHA1(8eca3cdfd2eb74257253957a87b245b7f85bd038) ) | |
| 294 | /* the first half of all these roms is identical. For rom 3 both halves match. Correct decode is to ignore the first half */ | |
| 295 | ROM_LOAD( "pokechamp_02_27c512.bin", 0x00000, 0x10000, CRC(1ff44545) SHA1(2eee44484accce7b0ba21babf6e8344b234a4e87) ) | |
| 296 | ROM_LOAD( "pokechamp_01_27c512.bin", 0x10000, 0x10000, CRC(338fc412) SHA1(bb8ae99ee6a399a8c67bedb88d0837fd0a4a426c) ) | |
| 297 | ROM_LOAD( "pokechamp_04_27c512.bin", 0x20000, 0x10000, CRC(ee6991af) SHA1(8eca3cdfd2eb74257253957a87b245b7f85bd038) ) | |
| 298 | ROM_LOAD( "pokechamp_03_27c512.bin", 0x30000, 0x10000, CRC(99f9884a) SHA1(096d6ce70dc51fb9142e80e1ec45d6d7225481f5) ) | |
| 298 | 299 | |
| 299 | 300 | ROM_REGION( 0x80000, "oki", 0 ) |
| 300 | 301 | ROM_LOAD( "pokechamp_10_27c040.bin", 0x00000, 0x80000, CRC(b54806ed) SHA1(c6e1485c263ebd9102ff1e8c09b4c4ca5f63c3da) ) |
| r5613 | r5614 | |
|---|---|---|
| 161 | 161 | int layers_ctrl = -1; |
| 162 | 162 | |
| 163 | 163 | #if MIDAS_DEBUG |
| 164 | if ( input_code_pressed(KEYCODE_Z) ) | |
| 164 | if ( input_code_pressed(screen->machine, KEYCODE_Z) ) | |
| 165 | 165 | { |
| 166 | 166 | int msk = 0; |
| 167 | if (input_code_pressed(KEYCODE_Q)) msk |= 1 << 0; // for tmap | |
| 168 | if (input_code_pressed(KEYCODE_A)) msk |= 1 << 1; // for sprites | |
| 167 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1 << 0; // for tmap | |
| 168 | if (input_code_pressed(screen->machine, KEYCODE_A)) msk |= 1 << 1; // for sprites | |
| 169 | 169 | if (msk != 0) layers_ctrl &= msk; |
| 170 | 170 | } |
| 171 | 171 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 131 | 131 | int layers_ctrl = -1; |
| 132 | 132 | |
| 133 | 133 | #ifdef MAME_DEBUG |
| 134 | if (input_code_pressed(KEYCODE_R)) // remapped due to inputs changes. | |
| 134 | if (input_code_pressed(screen->machine, KEYCODE_R)) // remapped due to inputs changes. | |
| 135 | 135 | { |
| 136 | 136 | int msk = 0; |
| 137 | if (input_code_pressed(KEYCODE_T)) msk |= 1; | |
| 138 | if (input_code_pressed(KEYCODE_Y)) msk |= 2; | |
| 139 | if (input_code_pressed(KEYCODE_U)) msk |= 4; | |
| 140 | if (input_code_pressed(KEYCODE_I)) msk |= 8; | |
| 141 | if (input_code_pressed(KEYCODE_O)) msk |= 16; | |
| 137 | if (input_code_pressed(screen->machine, KEYCODE_T)) msk |= 1; | |
| 138 | if (input_code_pressed(screen->machine, KEYCODE_Y)) msk |= 2; | |
| 139 | if (input_code_pressed(screen->machine, KEYCODE_U)) msk |= 4; | |
| 140 | if (input_code_pressed(screen->machine, KEYCODE_I)) msk |= 8; | |
| 141 | if (input_code_pressed(screen->machine, KEYCODE_O)) msk |= 16; | |
| 142 | 142 | if (msk != 0) layers_ctrl &= msk; |
| 143 | 143 | } |
| 144 | 144 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 619 | 619 | ROM_LOAD( "br25", 0x0200, 0x0100, CRC(ba4a5651) SHA1(77e81bd64ab59a7466d20eabdff4be241e963c52) ) /* blue */ |
| 620 | 620 | ROM_END |
| 621 | 621 | |
| 622 | ROM_START( kchampvs2 ) | |
| 623 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 624 | ROM_LOAD( "lt.d13", 0x0000, 0x2000, CRC(eef41aa8) SHA1(6d4e8159e9c3cd629337863c0397ff90b4c8d3fa) ) | |
| 625 | ROM_LOAD( "lt.d11", 0x2000, 0x2000, CRC(091f810e) SHA1(283edb08ce106835185a1c2d6b88f7544d75f3b4) ) | |
| 626 | ROM_LOAD( "lt.d10", 0x4000, 0x2000, CRC(d4df2a52) SHA1(60d6cb1cb51c6f80a0f88913d4152ab8bda752d6) ) | |
| 627 | ROM_LOAD( "lt.d8", 0x6000, 0x2000, CRC(3d4ef0da) SHA1(228c8e47bb7123b69746506402edb875a43d7af5) ) | |
| 628 | ROM_LOAD( "lt.d7", 0x8000, 0x2000, CRC(623a467b) SHA1(5f150c67632f8e32769b75aa0615d0eb018afdc4) ) | |
| 629 | ROM_LOAD( "lt.d6", 0xa000, 0x2000, CRC(c3bc6e46) SHA1(a7b9420592905b0df5ff00c392d887f40395179f) ) | |
| 630 | ROM_CONTINUE( 0xe000, 0x2000 ) | |
| 631 | ||
| 632 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */ | |
| 633 | ROM_LOAD( "lt.d4", 0x0000, 0x2000, CRC(eaa646eb) SHA1(cbd48f4d5d225b71c2dd0b14f420838561e3f83e) ) | |
| 634 | ROM_LOAD( "lt.d2", 0x2000, 0x2000, CRC(d71031ad) SHA1(b168f4ef4feb4195305404df699acecb731eab02) ) /* adpcm */ | |
| 635 | ROM_LOAD( "lt.d1", 0x4000, 0x2000, CRC(6f811c43) SHA1(1d33ac8129562ab709bd7396b4c2457b6db99277) ) /* adpcm */ | |
| 636 | ||
| 637 | ROM_REGION( 0x08000, "gfx1", 0 ) | |
| 638 | ROM_LOAD( "lt.k1", 0x00000, 0x2000, CRC(4c574ecd) SHA1(86914eef33da73463ba6261eecae75209d24fac1) ) | |
| 639 | ROM_LOAD( "lt.k3", 0x02000, 0x2000, CRC(750b66af) SHA1(c7824994b977d4e846f3ecadfcfc51331f52b6f4) ) | |
| 640 | ROM_LOAD( "lt.k5", 0x04000, 0x2000, CRC(9ad6227c) SHA1(708af5e70927040cf7f2ae6f792344c19099530c) ) | |
| 641 | ROM_LOAD( "lt.k6", 0x06000, 0x2000, CRC(3b6d5de5) SHA1(288fffcbc9369db5c75e7e0d6181612de6f12da3) ) | |
| 642 | ||
| 643 | ROM_REGION( 0x18000, "gfx2", 0 ) | |
| 644 | ROM_LOAD( "lt.a1", 0x00000, 0x2000, CRC(51eda56c) SHA1(31438e115e95c2a684ec65ed2bdb9125e3675226) ) | |
| 645 | ROM_LOAD( "lt.c1", 0x02000, 0x2000, CRC(593264cf) SHA1(866469f37b6c90afc65e53e6589b67ac4b25997e) ) | |
| 646 | ROM_LOAD( "lt.a3", 0x04000, 0x2000, CRC(b4842ea9) SHA1(471475f65edbd292b9162ad50e5cb0c7144845b0) ) /* top, plane0 */ /* sprites */ | |
| 647 | ROM_LOAD( "lt.c3", 0x06000, 0x2000, CRC(8cd166a5) SHA1(4b623c4c0025d75b3ed9746f8b6730bf3e65d85a) ) /* bot, plane0 */ /* sprites */ | |
| 648 | ROM_LOAD( "lt.a5", 0x08000, 0x2000, CRC(4cbd3aa3) SHA1(a9a683dcc4f52b18450659a20434a4d2a7b411d9) ) /* top, plane0 */ /* sprites */ | |
| 649 | ROM_LOAD( "lt.c5", 0x0a000, 0x2000, CRC(6be342a6) SHA1(0b8ac7ef7c6a6464fbc027a9fd17fa7ce1ffd962) ) /* bot, plane0 */ /* sprites */ | |
| 650 | ROM_LOAD( "lt.a7", 0x0c000, 0x2000, CRC(8dcd271a) SHA1(0abeaa46433a59c110815ecf188c7afd6fa387a4) ) | |
| 651 | ROM_LOAD( "lt.c6", 0x0e000, 0x2000, CRC(4ee1dba7) SHA1(717ce9a4e20f6e02adf678b1400af4aaecdbfb40) ) | |
| 652 | ROM_LOAD( "lt.a8", 0x10000, 0x2000, CRC(7346db8a) SHA1(d2b2c1700ae0ff9c614a9981a3da3d69879e9f25) ) /* top, plane1 */ /* sprites */ | |
| 653 | ROM_LOAD( "lt.c8", 0x12000, 0x2000, CRC(b78714fc) SHA1(4df7f15c37d56a9d66d0049aad65b32063e5c29a) ) /* bot, plane1 */ /* sprites */ | |
| 654 | ROM_LOAD( "lt.a10", 0x14000, 0x2000, CRC(b2557102) SHA1(ec4285029fc3ee1ad0adb05f363b234c67f8903d) ) /* top, plane1 */ /* sprites */ | |
| 655 | ROM_LOAD( "lt.c10", 0x16000, 0x2000, CRC(c85aba0e) SHA1(4be21b38623c2a8ae7f1e7397fb002e4cb9e4614) ) /* bot, plane1 */ /* sprites */ | |
| 656 | ||
| 657 | ROM_REGION( 0x0300, "proms", 0 ) | |
| 658 | ROM_LOAD( "lt.k10", 0x0000, 0x0100, CRC(f683c54a) SHA1(92893990456b92f04a2be98b8e9626e97b7a2562) ) /* red */ | |
| 659 | ROM_LOAD( "lt.k9", 0x0100, 0x0100, CRC(3ddbb6c4) SHA1(0eca5594d6812bc79f8b78f83fe003877d20c973) ) /* green */ | |
| 660 | ROM_LOAD( "lt.k8", 0x0200, 0x0100, CRC(ba4a5651) SHA1(77e81bd64ab59a7466d20eabdff4be241e963c52) ) /* blue */ | |
| 661 | ROM_END | |
| 662 | ||
| 622 | 663 | ROM_START( karatevs ) |
| 623 | 664 | ROM_REGION( 0x10000, "maincpu", 0 ) /* 64k for code + 64k for decrypted opcodes */ |
| 624 | 665 | ROM_LOAD( "br24", 0x0000, 0x2000, CRC(ea9cda49) SHA1(7d753a8d391418d0fe5231eb88b3627f7d3fd99e) ) |
| r5613 | r5614 | |
| 661 | 702 | ROM_END |
| 662 | 703 | |
| 663 | 704 | |
| 664 | ||
| 665 | static DRIVER_INIT( kchampvs ) | |
| 705 | static UINT8 *decrypt_code(running_machine *machine) | |
| 666 | 706 | { |
| 667 | 707 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 668 | 708 | UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000); |
| r5613 | r5614 | |
| 674 | 714 | for (A = 0;A < 0x10000;A++) |
| 675 | 715 | decrypted[A] = (rom[A] & 0x55) | ((rom[A] & 0x88) >> 2) | ((rom[A] & 0x22) << 2); |
| 676 | 716 | |
| 717 | return decrypted; | |
| 718 | } | |
| 719 | ||
| 720 | ||
| 721 | static DRIVER_INIT( kchampvs ) | |
| 722 | { | |
| 723 | UINT8 *rom = memory_region(machine, "maincpu"); | |
| 724 | UINT8 *decrypted = decrypt_code(machine); | |
| 725 | int A; | |
| 726 | ||
| 677 | 727 | /* |
| 678 | 728 | Note that the first 4 opcodes that the program |
| 679 | 729 | executes aren't encrypted for some obscure reason. |
| r5613 | r5614 | |
| 695 | 745 | } |
| 696 | 746 | |
| 697 | 747 | |
| 748 | static DRIVER_INIT( kchampvs2 ) | |
| 749 | { | |
| 750 | decrypt_code(machine); | |
| 751 | } | |
| 698 | 752 | |
| 699 | GAME( 1984, kchamp, 0, kchamp, kchamp, 0, ROT90, "Data East USA", "Karate Champ (US)", 0 ) | |
| 700 | GAME( 1984, karatedo, kchamp, kchamp, kchamp, 0, ROT90, "Data East Corporation", "Karate Dou (Japan)", 0 ) | |
| 701 | GAME( 1984, kchampvs, kchamp, kchampvs, kchampvs, kchampvs, ROT90, "Data East USA", "Karate Champ (US VS version)", 0 ) | |
| 702 | GAME( 1984, karatevs, kchamp, kchampvs, kchampvs, kchampvs, ROT90, "Data East Corporation", "Taisen Karate Dou (Japan VS version)", 0 ) | |
| 703 | 753 | |
| 754 | ||
| 755 | GAME( 1984, kchamp, 0, kchamp, kchamp, 0, ROT90, "Data East USA", "Karate Champ (US)", 0 ) | |
| 756 | GAME( 1984, karatedo, kchamp, kchamp, kchamp, 0, ROT90, "Data East Corporation", "Karate Dou (Japan)", 0 ) | |
| 757 | GAME( 1984, kchampvs, kchamp, kchampvs, kchampvs, kchampvs, ROT90, "Data East USA", "Karate Champ (US, VS version set 1)", 0 ) | |
| 758 | GAME( 1984, kchampvs2, kchamp, kchampvs, kchampvs, kchampvs2, ROT90, "Data East USA", "Karate Champ (US, VS version set 2)", 0 ) | |
| 759 | GAME( 1984, karatevs, kchamp, kchampvs, kchampvs, kchampvs, ROT90, "Data East Corporation", "Taisen Karate Dou (Japan VS version)", 0 ) | |
| 760 |
| r5613 | r5614 | |
|---|---|---|
| 95 | 95 | UINT8 *gfxdata = memory_region( screen->machine, "gfx1" ); |
| 96 | 96 | UINT8 data; |
| 97 | 97 | |
| 98 | if ( input_code_pressed_once(KEYCODE_ENTER) ) view_roms ^= 1; | |
| 98 | if ( input_code_pressed_once(screen->machine, KEYCODE_ENTER) ) view_roms ^= 1; | |
| 99 | 99 | if ( view_roms ) |
| 100 | 100 | { |
| 101 | if ( input_code_pressed_once(KEYCODE_PGDN) ) base += 512 * 256; | |
| 102 | if ( input_code_pressed_once(KEYCODE_PGUP) ) base -= 512 * 256; | |
| 101 | if ( input_code_pressed_once(screen->machine, KEYCODE_PGDN) ) base += 512 * 256; | |
| 102 | if ( input_code_pressed_once(screen->machine, KEYCODE_PGUP) ) base -= 512 * 256; | |
| 103 | 103 | base %= memory_region_length( screen->machine, "gfx1" ); |
| 104 | 104 | |
| 105 | 105 | count = base; |
| r5613 | r5614 | |
|---|---|---|
| 267 | 267 | if (bits_gone_hi & 0x04) sample_start(samples, 2, SND_BASEHIT, 0); |
| 268 | 268 | if (bits_gone_hi & 0x08) sample_start(samples, 3, SND_INVADERHIT, 0); |
| 269 | 269 | |
| 270 | sound_global_enable(data & 0x20); | |
| 270 | sound_global_enable(device->machine, data & 0x20); | |
| 271 | 271 | screen_red = data & 0x04; |
| 272 | 272 | } |
| 273 | 273 | |
| r5613 | r5614 | |
| 313 | 313 | int bits_gone_hi = data & ~sound_state[1]; |
| 314 | 314 | sound_state[1] = data; |
| 315 | 315 | |
| 316 | sound_global_enable(data & 0x02); | |
| 316 | sound_global_enable(space->machine, data & 0x02); | |
| 317 | 317 | |
| 318 | 318 | if (bits_gone_hi & 0x04) sample_start(samples, 3, SND_INVADERHIT, 0); |
| 319 | 319 |
| r5613 | r5614 | |
|---|---|---|
| 1727 | 1727 | ROM_LOAD16_BYTE( "993jaa10.27d", 0x100001, 0x80000, CRC(9D113A2D) SHA1(eee94a5f7015c49aa630b8df0c8e9d137d238811) ) |
| 1728 | 1728 | |
| 1729 | 1729 | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1730 | DISK_IMAGE( "993hdda01", 0, SHA1( | |
| 1730 | DISK_IMAGE( "993hdda01", 0, SHA1(f5d4 | |
| 1731 | 1731 | // this image has not been verified |
| 1732 | 1732 | // DISK_IMAGE( "993jaa11", 0, MD5(e26eb62d7cf3357585f5066da6063143) ) /* ver 1.00 JA */ |
| 1733 | 1733 | |
| r5613 | r5614 | |
| 1917 | 1917 | ROM_LOAD16_BYTE( "831jaa10.27d", 0x100001, 0x80000, CRC(85173CB6) SHA1(bc4d86bf4654a9a0a58e624f77090854950f3993) ) |
| 1918 | 1918 | |
| 1919 | 1919 | DISK_REGION( "ide" ) /* IDE HARD DRIVE */ |
| 1920 | DISK_IMAGE( "831jhdda01", 0, SHA1(2 | |
| 1920 | DISK_IMAGE( "831jhdda01", 0, SHA1(ef62d | |
| 1921 | 1921 | |
| 1922 | 1922 | ROM_REGION( 0x1000000, "shared", ROMREGION_ERASE00 ) /* K054539 RAM */ |
| 1923 | 1923 | ROM_END |
| r5613 | r5614 | |
|---|---|---|
| 304 | 304 | cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); |
| 305 | 305 | segaic16_tilemap_set_colscroll(device->machine, 0, ~data & 0x04); |
| 306 | 306 | segaic16_tilemap_set_rowscroll(device->machine, 0, ~data & 0x02); |
| 307 | sound_global_enable(data & 0x01); | |
| 307 | sound_global_enable(device->machine, data & 0x01); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 |
| r5613 | r5614 | |
|---|---|---|
| 127 | 127 | |
| 128 | 128 | static WRITE8_HANDLER( sound_enable_w ) |
| 129 | 129 | { |
| 130 | sound_global_enable(data & 1); | |
| 130 | sound_global_enable(space->machine, data & 1); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 |
| r5613 | r5614 | |
|---|---|---|
| 614 | 614 | |
| 615 | 615 | static void laserdisc_audio_process(const device_config *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1) |
| 616 | 616 | { |
| 617 | int logit = LOG_AUDIO_DECODE && input_code_pressed(KEYCODE_L); | |
| 617 | int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine, KEYCODE_L); | |
| 618 | 618 | attotime time_per_sample = ATTOTIME_IN_HZ(samplerate); |
| 619 | 619 | attotime curtime = laserdisc_last_time; |
| 620 | 620 | int cursamp; |
| r5613 | r5614 | |
|---|---|---|
| 20 | 20 | * Good Luck. 198?, Unknown. |
| 21 | 21 | * Royale (set 1). 198?, Unknown. |
| 22 | 22 | * Royale (set 2). 198?, Unknown. |
| 23 | * Witch Card ( | |
| 23 | * Witch Card (Video Klein). | |
| 24 | 24 | * Witch Card (spanish, witch game, set 1). 1991, Unknown. |
| 25 | 25 | * Witch Card (spanish, witch game, set 2). 1991, Unknown. |
| 26 | 26 | * Witch Card (english, no witch game). 1991, Unknown. |
| 27 | * Witch Card (german, set 1). 1994, Proma. | |
| 28 | * Witch Card (german, set 2). 1994, Unknown. | |
| 29 | * Witch Card (english, witch game, lamps). 1985, PlayMan. | |
| 27 | 30 | * Super Loco 93 (spanish, set 1). 1993, Unknown. |
| 28 | 31 | * Super Loco 93 (spanish, set 2). 1993, Unknown. |
| 29 | 32 | * Maverik. 198?, Unknown. |
| r5613 | r5614 | |
| 578 | 581 | - Added new games: Maverik, Brasil 89 & Poker'91. |
| 579 | 582 | - Reworked the sets parent-clone relationship (still in progress). |
| 580 | 583 | |
| 584 | ||
| 581 | 585 | [2008-12-26] |
| 582 | 586 | |
| 583 | 587 | - Correctly setup the MC6845 device for all systems. |
| r5613 | r5614 | |
| 588 | 592 | the 50/60 Hz. DIP switch connection patched. |
| 589 | 593 | |
| 590 | 594 | |
| 595 | [2009-09-05] | |
| 596 | ||
| 597 | - Added 2 new Witch Card sets. | |
| 598 | - Reworked inputs for Witch Card (german set 1). | |
| 599 | - Created new inputs for Witch Card (english, witch game, lamps). | |
| 600 | - Added and connected lamps for both sets. | |
| 601 | - Added minimal bet and 50/60 Hz. switches to both sets. | |
| 602 | - Added DIP switches info for Witch Card (german, set 2). | |
| 603 | ||
| 604 | ||
| 591 | 605 | TODO: |
| 592 | 606 | |
| 593 | 607 | - Missing PIA connections. |
| r5613 | r5614 | |
| 1484 | 1498 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1485 | 1499 | INPUT_PORTS_END |
| 1486 | 1500 | |
| 1501 | static INPUT_PORTS_START( witchcdd ) | |
| 1502 | /* Multiplexed - 4x5bits */ | |
| 1503 | PORT_INCLUDE( witchcrd ) | |
| 1504 | ||
| 1505 | PORT_MODIFY("IN0-1") | |
| 1506 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_IMPULSE(3) PORT_NAME("Manual Collect") PORT_CODE(KEYCODE_Q) | |
| 1507 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_W) | |
| 1508 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("IN0-1-6") | |
| 1509 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("IN0-1-7") | |
| 1510 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("IN0-1-8") | |
| 1511 | ||
| 1512 | PORT_MODIFY("IN0-2") | |
| 1513 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("IN0-2-6") | |
| 1514 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("IN0-2-7") | |
| 1515 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("IN0-2-8") | |
| 1516 | ||
| 1517 | PORT_MODIFY("IN0-3") | |
| 1518 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_F2) | |
| 1519 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("D-31") PORT_CODE(KEYCODE_E) | |
| 1520 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note In") | |
| 1521 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Coin In") | |
| 1522 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) PORT_NAME("IN0-3-5") | |
| 1523 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) PORT_NAME("IN0-3-6") | |
| 1524 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("IN0-3-7") | |
| 1525 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("IN0-3-8") //IPT_UNKNOWN ) | |
| 1526 | ||
| 1527 | PORT_MODIFY("SW1") | |
| 1528 | /* only bits 4-7 are connected here and were routed to SW1 1-4 */ | |
| 1529 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1530 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1531 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1532 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1533 | /* even when the following one is forced to OFF, | |
| 1534 | turned ON behaves like "Jacks and Better" */ | |
| 1535 | PORT_DIPNAME( 0x10, 0x10, "SW 1 (always to OFF)") | |
| 1536 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1537 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1538 | PORT_DIPNAME( 0x20, 0x00, "50hz/60hz" ) | |
| 1539 | PORT_DIPSETTING( 0x20, "50hz" ) | |
| 1540 | PORT_DIPSETTING( 0x00, "60hz" ) | |
| 1541 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1542 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1543 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1544 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1545 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1546 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1547 | ||
| 1548 | PORT_MODIFY("SW2") | |
| 1549 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 1550 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1551 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1552 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 1553 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1554 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1555 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1556 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1557 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1558 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1559 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1560 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1561 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1562 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1563 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1564 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1565 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1566 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1567 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1568 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1569 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1570 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1571 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1572 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1573 | INPUT_PORTS_END | |
| 1574 | ||
| 1575 | static INPUT_PORTS_START( witchcde ) | |
| 1576 | /* Multiplexed - 4x5bits */ | |
| 1577 | PORT_INCLUDE( witchcrd ) | |
| 1578 | ||
| 1579 | PORT_MODIFY("IN0-1") | |
| 1580 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_IMPULSE(3) PORT_NAME("Manual Collect") PORT_CODE(KEYCODE_Q) | |
| 1581 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_W) | |
| 1582 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("IN0-1-6") | |
| 1583 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("IN0-1-7") | |
| 1584 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("IN0-1-8") | |
| 1585 | ||
| 1586 | PORT_MODIFY("IN0-2") | |
| 1587 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("IN0-2-6") | |
| 1588 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("IN0-2-7") | |
| 1589 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("IN0-2-8") | |
| 1590 | ||
| 1591 | PORT_MODIFY("IN0-3") | |
| 1592 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_F2) | |
| 1593 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("D-31") PORT_CODE(KEYCODE_E) | |
| 1594 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note In") | |
| 1595 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Coin In") | |
| 1596 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) PORT_NAME("IN0-3-5") | |
| 1597 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) PORT_NAME("IN0-3-6") | |
| 1598 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("IN0-3-7") | |
| 1599 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("IN0-3-8") //IPT_UNKNOWN ) | |
| 1600 | ||
| 1601 | PORT_MODIFY("SW1") | |
| 1602 | /* only bits 4-7 are connected here and were routed to SW1 1-4 */ | |
| 1603 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1604 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1605 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1606 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1607 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) | |
| 1608 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1609 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1610 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) | |
| 1611 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1612 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1613 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1614 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1615 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1616 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1617 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1618 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1619 | ||
| 1620 | /* DIP Switches (as shown in the epoxy block) | |
| 1621 | ||
| 1622 | Schalter 1 2 3 4 5 6 7 8 | |
| 1623 | -------------------------------------------- | |
| 1624 | Bet > 10 OFF OFF | |
| 1625 | Bet > 20 ON OFF | |
| 1626 | Bet > 50 OFF ON | |
| 1627 | Bet > 100 ON ON | |
| 1628 | -------------------------------------------- | |
| 1629 | Jolli-Witch OFF | |
| 1630 | Witch-Card ON | |
| 1631 | -------------------------------------------- | |
| 1632 | 6 Taster ON | |
| 1633 | 12 Taster OFF | |
| 1634 | -------------------------------------------- | |
| 1635 | Hohes Paar ON | |
| 1636 | 2 Paar OFF | |
| 1637 | -------------------------------------------- | |
| 1638 | 1 DM - 1 PKT OFF OFF | |
| 1639 | 1 DM - 10 PKT OFF ON | |
| 1640 | -------------------------------------------- | |
| 1641 | RF ON | |
| 1642 | RF NO OFF | |
| 1643 | -------------------------------------------- | |
| 1644 | */ | |
| 1645 | PORT_MODIFY("SW2") | |
| 1646 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 1647 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1648 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1649 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 1650 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1651 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1652 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1653 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1654 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1655 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1656 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1657 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1658 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1659 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1660 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1661 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1662 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1663 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1664 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1665 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1666 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1667 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1668 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1669 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1670 | INPUT_PORTS_END | |
| 1671 | ||
| 1672 | static INPUT_PORTS_START( witchcdf ) | |
| 1673 | /* Multiplexed - 4x5bits */ | |
| 1674 | PORT_INCLUDE( witchcrd ) | |
| 1675 | ||
| 1676 | PORT_MODIFY("IN0-1") | |
| 1677 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_IMPULSE(3) PORT_NAME("Manual Collect") PORT_CODE(KEYCODE_Q) | |
| 1678 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_W) | |
| 1679 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("IN0-1-6") | |
| 1680 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("IN0-1-7") | |
| 1681 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("IN0-1-8") | |
| 1682 | ||
| 1683 | PORT_MODIFY("IN0-2") | |
| 1684 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("IN0-2-6") | |
| 1685 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("IN0-2-7") | |
| 1686 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("IN0-2-8") | |
| 1687 | ||
| 1688 | PORT_MODIFY("IN0-3") | |
| 1689 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_F2) | |
| 1690 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("D-31") PORT_CODE(KEYCODE_E) | |
| 1691 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note In") | |
| 1692 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Coin In") | |
| 1693 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) PORT_NAME("IN0-3-5") | |
| 1694 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) PORT_NAME("IN0-3-6") | |
| 1695 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("IN0-3-7") | |
| 1696 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("IN0-3-8") //IPT_UNKNOWN ) | |
| 1697 | ||
| 1698 | PORT_MODIFY("SW1") | |
| 1699 | /* only bits 4-7 are connected here and were routed to SW1 1-4 */ | |
| 1700 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1701 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1702 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1703 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1704 | PORT_DIPNAME( 0x10, 0x00, "Minimal Winning Hand" ) | |
| 1705 | PORT_DIPSETTING( 0x10, "Double Pair" ) | |
| 1706 | PORT_DIPSETTING( 0x00, "Jacks or Better" ) | |
| 1707 | PORT_DIPNAME( 0x20, 0x00, "50hz/60hz" ) | |
| 1708 | PORT_DIPSETTING( 0x20, "50hz" ) | |
| 1709 | PORT_DIPSETTING( 0x00, "60hz" ) | |
| 1710 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1711 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1712 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1713 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1714 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1715 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1716 | ||
| 1717 | PORT_MODIFY("SW2") | |
| 1718 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 1719 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1720 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1721 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 1722 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1723 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1724 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 1725 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1726 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1727 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 1728 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1729 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1730 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1731 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1732 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1733 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1734 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1735 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1736 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 1737 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1738 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1739 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 1740 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1741 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1742 | INPUT_PORTS_END | |
| 1743 | ||
| 1487 | 1744 | static INPUT_PORTS_START( sloco93 ) |
| 1488 | 1745 | /* Multiplexed - 4x5bits */ |
| 1489 | 1746 | PORT_INCLUDE( witchcda ) |
| r5613 | r5614 | |
| 2294 | 2551 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ |
| 2295 | 2552 | ROM_END |
| 2296 | 2553 | |
| 2297 | ROM_START( witchcrd ) /* Video Klein original with epoxy block module */ | |
| 2554 | /* Witch Card (Video Klein) | |
| 2555 | Video Klein original with epoxy block module | |
| 2556 | */ | |
| 2557 | ROM_START( witchcrd ) | |
| 2298 | 2558 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2299 | 2559 | ROM_LOAD( "epoxy_27128.bin", 0x4000, 0x4000, CRC(48186272) SHA1(d211bfa89404a292e6d0f0169ed11e1e74a361d9) ) /* epoxy block program ROM */ |
| 2300 | 2560 | |
| r5613 | r5614 | |
| 2313 | 2573 | ROM_LOAD( "epoxy_82s129.bin", 0x0100, 0x0100, CRC(f0c012b1) SHA1(5502977404172e8c5b9fbf305581a406668ad1d9) ) /* original epoxy block PROM */ |
| 2314 | 2574 | ROM_END |
| 2315 | 2575 | |
| 2576 | /* Witch Card (spanish, set 1) | |
| 2577 | */ | |
| 2316 | 2578 | ROM_START( witchcda ) |
| 2317 | 2579 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2318 | 2580 | ROM_LOAD( "w_card.256", 0x0000, 0x8000, CRC(63a471f8) SHA1(96a2140e2da0050e7865a6662f707cf024130832) ) |
| r5613 | r5614 | |
| 2330 | 2592 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ |
| 2331 | 2593 | ROM_END |
| 2332 | 2594 | |
| 2595 | /* Witch Card (spanish, set 2) | |
| 2596 | */ | |
| 2333 | 2597 | ROM_START( witchcdb ) |
| 2334 | 2598 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2335 | 2599 | ROM_LOAD( "w_card.128", 0x4000, 0x4000, CRC(11ecac96) SHA1(717709b31f3dfa09be321c14fbf0e95d492ad2f2) ) |
| r5613 | r5614 | |
| 2347 | 2611 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ |
| 2348 | 2612 | ROM_END |
| 2349 | 2613 | |
| 2614 | /* Witch Card (english, no witch game) | |
| 2615 | */ | |
| 2350 | 2616 | ROM_START( witchcdc ) |
| 2351 | 2617 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2352 | 2618 | ROM_LOAD( "wc_sbruj.256", 0x0000, 0x8000, CRC(5689ae41) SHA1(c7a624ec881204137489b147ce66cc9a9900650a) ) |
| r5613 | r5614 | |
| 2364 | 2630 | ROM_LOAD( "82s129.9c", 0x0000, 0x0100, CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) /* PROM dump needed */ |
| 2365 | 2631 | ROM_END |
| 2366 | 2632 | |
| 2367 | ROM_START( witchcdd ) | |
| 2633 | /* Witch Card (german, set 1) | |
| 2634 | ||
| 2635 | TV GAME ELEKTRONIK 1994 | |
| 2636 | PROVA | |
| 2637 | CASINOVERSION WC3050 | |
| 2638 | */ | |
| 2639 | ROM_START( witchcdd ) | |
| 2368 | 2640 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2369 | 2641 | ROM_LOAD( "12a.bin", 0x0000, 0x8000, CRC(a5c1186a) SHA1(b6c662bf489fbcccc3063ce55c957e630ba96ccb) ) |
| 2370 | 2642 | |
| 2371 | 2643 | ROM_REGION( 0x6000, "gfx1", 0 ) |
| 2372 | ROM_FILL( 0x0000, 0x4000, 0 ) /* filling the R-G bitplanes */ | |
| 2644 | ROM_FILL( 0x0000, 0x4000, 0 ) /* filling the R-G bitplanes */ | |
| 2373 | 2645 | ROM_LOAD( "ce-3-tvg.bin", 0x4000, 0x2000, CRC(54b51497) SHA1(8c3a74377fde8c7c5a6b277a9c1e717e6bdd98f8) ) /* text layer */ |
| 2374 | 2646 | |
| 2375 | 2647 | ROM_REGION( 0x6000, "gfx2", 0 ) |
| r5613 | r5614 | |
| 2378 | 2650 | ROM_COPY( "gfx1", 0x4800, 0x4000, 0x0800 ) /* cards deck gfx, bitplane3. found in the 2nd quarter of the text layer rom */ |
| 2379 | 2651 | |
| 2380 | 2652 | ROM_REGION( 0x0100, "proms", 0 ) |
| 2381 | ROM_LOAD( "tbp24s10n.7d", | |
| 2653 | ROM_LOAD( "tbp24s10n.7d", | |
| 2382 | 2654 | ROM_END |
| 2383 | 2655 | |
| 2656 | /* Witch Card (german, set 2) | |
| 2657 | Epoxy CPU box. | |
| 2658 | ||
| 2659 | Code jumps into a zero-filled zone. | |
| 2660 | Addressing seems to be scrambled in some way | |
| 2661 | maybe through a PLD. | |
| 2662 | */ | |
| 2663 | ROM_START( witchcde ) | |
| 2664 | ROM_REGION( 0x10000, "maincpu", 0 ) /* inside epoxy block with the CPU */ | |
| 2665 | ROM_LOAD( "27c256.bin", 0x0000, 0x8000, CRC(14f05e3b) SHA1(83578f6a82b0974dd0325903926b2fd0d8e5c236) ) | |
| 2666 | ||
| 2667 | ROM_REGION( 0x6000, "gfx1", 0 ) | |
| 2668 | ROM_FILL( 0x0000, 0x4000, 0 ) /* filling the R-G bitplanes */ | |
| 2669 | ROM_LOAD( "iii.5a", 0x4000, 0x2000, CRC(5ea338da) SHA1(5e55e17689541ffb9c23e45f689dda98a79bf789) ) /* text layer */ | |
| 2670 | ||
| 2671 | ROM_REGION( 0x6000, "gfx2", 0 ) | |
| 2672 | ROM_LOAD( "i.2a", 0x0000, 0x2000, CRC(d467f6e2) SHA1(6aaf4cdfb76f5efeeee45635fea120711483648e) ) /* cards deck gfx, bitplane1 */ | |
| 2673 | ROM_LOAD( "ii.4a", 0x2000, 0x2000, CRC(044dfac0) SHA1(721f8f57e05ddcbdb838d12fd3e81a45346ee6db) ) /* cards deck gfx, bitplane2 */ | |
| 2674 | ROM_COPY( "gfx1", 0x5000, 0x4000, 0x1000 ) /* cards deck gfx, bitplane3. found in the 2nd quarter of the text layer rom */ | |
| 2675 | ||
| 2676 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 2677 | ROM_LOAD( "82s129.7d", 0x0000, 0x0100, BAD_DUMP CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) | |
| 2678 | ROM_END | |
| 2679 | ||
| 2680 | /* Witch Card (english, witch game, lights) | |
| 2681 | PCB by PM. Hybrid hardware. | |
| 2682 | ||
| 2683 | Copyright 1983/84/85 | |
| 2684 | W.BECK ELEKTRONIK | |
| 2685 | */ | |
| 2686 | ROM_START( witchcdf ) | |
| 2687 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2688 | ROM_LOAD( "$25.bin", 0x5000, 0x1000, CRC(afd6cb4a) SHA1(4c769e1c724bada5875e028781086c32967953a1) ) | |
| 2689 | ROM_LOAD( "$26.bin", 0x6000, 0x1000, CRC(ad11960c) SHA1(2b562cfe9401e21c9dcd90307165e2c2d1acfc5b) ) | |
| 2690 | ROM_LOAD( "$27.bin", 0x7000, 0x1000, CRC(e6f9c973) SHA1(f209d13d1565160bc2c05c6c4fce73d14a9a56ab) ) | |
| 2691 | ||
| 2692 | ROM_REGION( 0x3000, "gfx1", 0 ) | |
| 2693 | ROM_FILL( 0x0000, 0x2000, 0 ) /* filling the R-G bitplanes */ | |
| 2694 | ROM_LOAD( "$14.bin", 0x2000, 0x1000, CRC(19b68bec) SHA1(b8ef17ba5545e2f104cd2783e5f1c97c400fcbbc) ) /* text layer */ | |
| 2695 | ||
| 2696 | ROM_REGION( 0x3000, "gfx2", 0 ) | |
| 2697 | ROM_LOAD( "11.bin", 0x0000, 0x1000, CRC(b5a1f5a3) SHA1(a34aaaab5443c6962177a5dd35002bd09d0d2772) ) /* cards deck gfx, bitplane1 */ | |
| 2698 | ROM_LOAD( "12.bin", 0x1000, 0x1000, CRC(40e426af) SHA1(7e7cb30dafc96bcb87a05d3e0ef5c2d426ed6a74) ) /* cards deck gfx, bitplane2 */ | |
| 2699 | ROM_LOAD( "13.bin", 0x2000, 0x1000, CRC(232374f3) SHA1(b75907edbf769b8c46fb1ebdb301c325c556e6c2) ) /* cards deck gfx, bitplane3 */ | |
| 2700 | ||
| 2701 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 2702 | ROM_LOAD( "wc_bprom.bin", 0x0000, 0x0100, BAD_DUMP CRC(7f31066b) SHA1(15420780ec6b2870fc4539ec3afe4f0c58eedf12) ) | |
| 2703 | ROM_END | |
| 2704 | ||
| 2384 | 2705 | ROM_START( sloco93 ) |
| 2385 | 2706 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2386 | 2707 | ROM_LOAD( "locoloco.128", 0x4000, 0x4000, CRC(f626a770) SHA1(afbd33b3f65b8a781c716a3d6e5447aa817d856c) ) |
| r5613 | r5614 | |
| 2915 | 3236 | GAMEL( 1981, goldnpkb, goldnpkr, goldnpkr, goldnpkr, 0, ROT0, "Bonanza Enterprises, Ltd", "Golden Poker Double Up (Mini Boy)", 0, layout_goldnpkr ) |
| 2916 | 3237 | GAMEL( 1981, pmpoker, 0, goldnpkr, pmpoker, 0, ROT0, "PlayMan", "PlayMan Poker (german)", 0, layout_pmpoker ) |
| 2917 | 3238 | GAMEL( 198?, pottnpkr, 0, pottnpkr, pottnpkr, 0, ROT0, "bootleg", "Jack Potten's Poker (set 1)", 0, layout_goldnpkr ) |
| 2918 | GAMEL( 198?, potnpkra, pottnpkr, pottnpkr, potnpkra, 0, ROT0, "bootleg", "Jack Potten's Poker (set 2) | |
| 3239 | GAMEL( 198?, potnpkra, pottnpkr, pottnpkr, potnpkra, 0, ROT0, "bootleg", "Jack Potten's Poker (set 2) | |
| 2919 | 3240 | GAMEL( 198?, potnpkrb, pottnpkr, pottnpkr, pottnpkr, 0, ROT0, "bootleg", "Jack Potten's Poker (set 3)", 0, layout_goldnpkr ) |
| 2920 | 3241 | GAMEL( 198?, potnpkrc, pottnpkr, pottnpkr, potnpkrc, 0, ROT0, "bootleg", "Jack Potten's Poker (set 4)", 0, layout_goldnpkr ) |
| 2921 | 3242 | GAMEL( 198?, potnpkrd, pottnpkr, pottnpkr, potnpkrc, 0, ROT0, "bootleg", "Jack Potten's Poker (set 5)", 0, layout_goldnpkr ) |
| r5613 | r5614 | |
| 2927 | 3248 | GAME( 1991, witchcda, witchcrd, witchcrd, witchcda, 0, ROT0, "<unknown>", "Witch Card (spanish, witch game, set 1)", 0 ) |
| 2928 | 3249 | GAME( 1991, witchcdb, witchcrd, witchcrd, witchcda, 0, ROT0, "<unknown>", "Witch Card (spanish, witch game, set 2)", 0 ) |
| 2929 | 3250 | GAME( 1991, witchcdc, witchcrd, witchcrd, witchcdc, 0, ROT0, "<unknown>", "Witch Card (english, no witch game)", 0 ) |
| 2930 | GAME( 1991, witchcdd, witchcrd, witchcrd, witchcrd, 0, ROT0, "<unknown>", "Witch Card (german?)", 0 ) | |
| 3251 | GAMEL( 1994, witchcdd, witchcrd, witchcrd, witchcdd, 0, ROT0, "Proma", "Witch Card (german, set 1)", 0, layout_goldnpkr ) | |
| 3252 | GAME( 1994, witchcde, witchcrd, witchcrd, witchcde, 0, ROT0, "<unknown>", "Witch Card (german, set 2)", GAME_NOT_WORKING ) | |
| 3253 | GAMEL( 1985, witchcdf, witchcrd, witchcrd, witchcdf, 0, ROT0, "PlayMan", "Witch Card (english, witch game, lamps)", 0, layout_goldnpkr ) | |
| 2931 | 3254 | GAME( 1993, sloco93, 0, witchcrd, sloco93, 0, ROT0, "<unknown>", "Super Loco 93 (spanish, set 1)", 0 ) |
| 2932 | 3255 | GAME( 1993, sloco93a, sloco93, witchcrd, sloco93, 0, ROT0, "<unknown>", "Super Loco 93 (spanish, set 2)", 0 ) |
| 2933 | 3256 | GAME( 198?, maverik, 0, witchcrd, bsuerte, 0, ROT0, "<unknown>", "Maverik", 0 ) |
| r5613 | r5614 | |
|---|---|---|
| 160 | 160 | |
| 161 | 161 | static WRITE8_HANDLER( thepit_sound_enable_w ) |
| 162 | 162 | { |
| 163 | sound_global_enable(data); | |
| 163 | sound_global_enable(space->machine, data); | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 |
| r5613 | r5614 | |
|---|---|---|
| 104 | 104 | if(data != old_data) |
| 105 | 105 | { |
| 106 | 106 | old_data = data; |
| 107 | | |
| 107 | logerror | |
| 108 | 108 | //logerror("port80 = %02X\n",data); |
| 109 | 109 | } |
| 110 | 110 | |
| r5613 | r5614 | |
| 134 | 134 | |
| 135 | 135 | //address |= (data & 0x08) ? 0x8000 : 0; |
| 136 | 136 | |
| 137 | // | |
| 137 | // logerror | |
| 138 | 138 | |
| 139 | 139 | memory_set_bankptr(space->machine, 1, &rom[address]); |
| 140 | 140 | } |
| r5613 | r5614 | |
| 166 | 166 | { |
| 167 | 167 | /* static int old = -1; |
| 168 | 168 | if(data!=old) |
| 169 | | |
| 169 | logerror | |
| 170 | 170 | */ |
| 171 | 171 | } |
| 172 | 172 | |
| r5613 | r5614 | |
| 174 | 174 | { |
| 175 | 175 | /* static int old = -1; |
| 176 | 176 | if(data!=old) |
| 177 | | |
| 177 | logerror | |
| 178 | 178 | */ |
| 179 | 179 | } |
| 180 | 180 | |
| r5613 | r5614 | |
| 187 | 187 | cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE); |
| 188 | 188 | } |
| 189 | 189 | // else |
| 190 | // | |
| 190 | // logerror | |
| 191 | 191 | |
| 192 | 192 | } |
| 193 | 193 |
| r5613 | r5614 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | static UINT8 x; |
| 63 | 63 | |
| 64 | if(input_code_pressed_once(KEYCODE_Z)) | |
| 64 | if(input_code_pressed_once(space->machine, KEYCODE_Z)) | |
| 65 | 65 | x++; |
| 66 | 66 | |
| 67 | if(input_code_pressed_once(KEYCODE_X)) | |
| 67 | if(input_code_pressed_once(space->machine, KEYCODE_X)) | |
| 68 | 68 | x--; |
| 69 | 69 | |
| 70 | if(input_code_pressed_once(KEYCODE_A)) | |
| 70 | if(input_code_pressed_once(space->machine, KEYCODE_A)) | |
| 71 | 71 | return 0xff; |
| 72 | 72 | |
| 73 | 73 | popmessage("%02x",x); |
| r5613 | r5614 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | static WRITE8_HANDLER( sound_mute_w ) |
| 85 | 85 | { |
| 86 | sound_global_enable(~data & 1); | |
| 86 | sound_global_enable(space->machine, ~data & 1); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 |
| r5613 | r5614 | |
|---|---|---|
| 1351 | 1351 | ROM_LOAD( "u26", 0x6e0000, 0x10000, CRC(cb19f784) SHA1(1e4d85603c940e247fdc45f0366dfb484285e588) ) |
| 1352 | 1352 | ROM_END |
| 1353 | 1353 | |
| 1354 | ROM_START( narc2 ) | |
| 1355 | ROM_REGION( 0x90000, "narc1cpu", 0 ) /* sound CPU */ | |
| 1356 | ROM_LOAD( "narcrev2.u4", 0x50000, 0x10000, CRC(450a591a) SHA1(bbda8061262738e5866f2707f69483a0a51d2910) ) | |
| 1357 | ROM_RELOAD( 0x60000, 0x10000 ) | |
| 1358 | ROM_LOAD( "narcrev2.u5", 0x70000, 0x10000, CRC(e551e5e3) SHA1(c8b4f53dbd4c534abb77d4dc07c4d12653b79894) ) | |
| 1359 | ROM_RELOAD( 0x80000, 0x10000 ) | |
| 1354 | 1360 | |
| 1361 | ROM_REGION( 0x90000, "narc2cpu", 0 ) /* slave sound CPU */ | |
| 1362 | ROM_LOAD( "narcrev2.u35", 0x10000, 0x10000, CRC(81295892) SHA1(159664e5ee03c88d6e940e70e87e2150dc5b8b25) ) | |
| 1363 | ROM_RELOAD( 0x20000, 0x10000 ) | |
| 1364 | ROM_LOAD( "narcrev2.u36", 0x30000, 0x10000, CRC(16cdbb13) SHA1(2dfd961a5d909c1804f4fda34de33ee2664c4bc6) ) | |
| 1365 | ROM_RELOAD( 0x40000, 0x10000 ) | |
| 1366 | ROM_LOAD( "narcrev2.u37", 0x50000, 0x10000, CRC(29dbeffd) SHA1(4cbdc619db34f9c552de1ed3d034f8c079987e03) ) | |
| 1367 | ROM_RELOAD( 0x60000, 0x10000 ) | |
| 1368 | ROM_LOAD( "narcrev2.u38", 0x70000, 0x10000, CRC(09b03b80) SHA1(a45782d29a426fac38299b56af0815e844e35ae4) ) | |
| 1369 | ROM_RELOAD( 0x80000, 0x10000 ) | |
| 1370 | ||
| 1371 | ROM_REGION16_LE( 0x100000, "user1", 0 ) /* 34010 code */ | |
| 1372 | ROM_LOAD16_BYTE( "narcrev2.u78", 0x00000, 0x10000, CRC(150c2dc4) SHA1(c7e3f90f5fed08f2a6951779166cbc6d2dbcd380) ) | |
| 1373 | ROM_RELOAD( 0x20000, 0x10000 ) | |
| 1374 | ROM_LOAD16_BYTE( "narcrev2.u60", 0x00001, 0x10000, CRC(9720ddea) SHA1(27f0182799f14c1c7c8dc48f7cf4160768b24662) ) | |
| 1375 | ROM_RELOAD( 0x20001, 0x10000 ) | |
| 1376 | ROM_LOAD16_BYTE( "narcrev2.u77", 0x40000, 0x10000, CRC(75ba4c74) SHA1(8713c22d30107d01612571d3a42aa9edda795fb0) ) | |
| 1377 | ROM_RELOAD( 0x60000, 0x10000 ) | |
| 1378 | ROM_LOAD16_BYTE( "narcrev2.u59", 0x40001, 0x10000, CRC(f7c6c104) SHA1(1b57a95f2232a9433831b99b689802ef185ff203) ) | |
| 1379 | ROM_RELOAD( 0x60001, 0x10000 ) | |
| 1380 | ROM_LOAD16_BYTE( "narcrev2.u42", 0x80000, 0x10000, CRC(3db20bb8) SHA1(688844bd573e5d0c5225fccbc12ae91b88b95bd8) ) | |
| 1381 | ROM_RELOAD( 0xa0000, 0x10000 ) | |
| 1382 | ROM_LOAD16_BYTE( "narcrev2.u24", 0x80001, 0x10000, CRC(91bae451) SHA1(549ad5938ae9ae4e320d0c5f8f30f23f5de2c802) ) | |
| 1383 | ROM_RELOAD( 0xa0001, 0x10000 ) | |
| 1384 | ROM_LOAD16_BYTE( "narcrev2.u41", 0xc0000, 0x10000, CRC(b0d463e1) SHA1(f6f1a9088aab838f3efe21f71616374ffec35a05) ) | |
| 1385 | ROM_RELOAD( 0xe0000, 0x10000 ) | |
| 1386 | ROM_LOAD16_BYTE( "narcrev2.u23", 0xc0001, 0x10000, CRC(a9eb4825) SHA1(9c0b98451f1a240a3cb7ed4c1aab6c7c4abd27e6) ) | |
| 1387 | ROM_RELOAD( 0xe0001, 0x10000 ) | |
| 1388 | ||
| 1389 | ROM_REGION( 0x800000, "gfx1", 0 ) | |
| 1390 | ROM_LOAD( "u94", 0x000000, 0x10000, CRC(ca3194e4) SHA1(d6aa6a09e4353a1dddd502abf85acf48e6e94cef) ) | |
| 1391 | ROM_LOAD( "u93", 0x010000, 0x10000, CRC(0ed7f7f5) SHA1(913d0dc81531adc6a7e6ffabfe681150aa4638a3) ) | |
| 1392 | ROM_LOAD( "u92", 0x020000, 0x10000, CRC(40d2fc66) SHA1(95b8d90e6abe336ad05dc3746d02b38823d2b8cd) ) | |
| 1393 | ROM_LOAD( "u91", 0x030000, 0x10000, CRC(f39325e0) SHA1(c1179825c76ed2934dfeff263a9296c2c1a5abe4) ) | |
| 1394 | ROM_LOAD( "u90", 0x040000, 0x10000, CRC(0132aefa) SHA1(9bf11ebc06f1069ea056427750902c204facbd3d) ) | |
| 1395 | ROM_LOAD( "u89", 0x050000, 0x10000, CRC(f7260c9e) SHA1(5a3fd88c7c0fa01ec2eb6fdef380ccee9d7da3a8) ) | |
| 1396 | ROM_LOAD( "u88", 0x060000, 0x10000, CRC(edc19f42) SHA1(b7121b3df743e5744ae72de2216b679fe71a2049) ) | |
| 1397 | ROM_LOAD( "u87", 0x070000, 0x10000, CRC(d9b42ff9) SHA1(cab05a5f8aadff010fba1107eb2000cc128063ff) ) | |
| 1398 | ROM_LOAD( "u86", 0x080000, 0x10000, CRC(af7daad3) SHA1(e2635a0acd6a238159ef91c1c3c9dfe8de8ae18f) ) | |
| 1399 | ROM_LOAD( "u85", 0x090000, 0x10000, CRC(095fae6b) SHA1(94f1df799142990a559e54cd949d9723481806b1) ) | |
| 1400 | ROM_LOAD( "u84", 0x0a0000, 0x10000, CRC(3fdf2057) SHA1(25ac6263a4eb962d90a305572fb95b75cb9f4138) ) | |
| 1401 | ROM_LOAD( "u83", 0x0b0000, 0x10000, CRC(f2d27c9f) SHA1(de30c7e0191adf62b11b2f2fbdf80687e653de12) ) | |
| 1402 | ROM_LOAD( "u82", 0x0c0000, 0x10000, CRC(962ce47c) SHA1(ea32f7f58a5ec1d941b372db5378d14fd850a2a7) ) | |
| 1403 | ROM_LOAD( "u81", 0x0d0000, 0x10000, CRC(00fe59ec) SHA1(85efd623b9cd75b249e19b2e97440a47718da728) ) | |
| 1404 | ROM_LOAD( "u80", 0x0e0000, 0x10000, CRC(147ba8e9) SHA1(1065b57082e0198025fe6f0bb3548f37c6a715e4) ) | |
| 1405 | ||
| 1406 | ROM_LOAD( "u76", 0x200000, 0x10000, CRC(1cd897f4) SHA1(80414c3718ac6719abcca83f483302fc16fcfef3) ) | |
| 1407 | ROM_LOAD( "u75", 0x210000, 0x10000, CRC(78abfa01) SHA1(1523f537491b901f2d987d4443077b92e24b969d) ) | |
| 1408 | ROM_LOAD( "u74", 0x220000, 0x10000, CRC(66d2a234) SHA1(290b3051fa9d35e24a9d00fcc2b72d2751f3e7f1) ) | |
| 1409 | ROM_LOAD( "u73", 0x230000, 0x10000, CRC(efa5cd4e) SHA1(7aca6058d644a025c6799d55ffa082ba8eb5d76f) ) | |
| 1410 | ROM_LOAD( "u72", 0x240000, 0x10000, CRC(70638eb5) SHA1(fbafb354fca7c3c402be5073fa03060de569f536) ) | |
| 1411 | ROM_LOAD( "u71", 0x250000, 0x10000, CRC(61226883) SHA1(09a366df0603cc0afc8c6c5547ec6ae3a02724b2) ) | |
| 1412 | ROM_LOAD( "u70", 0x260000, 0x10000, CRC(c808849f) SHA1(bd3f69c4641331738e415d6d72fafe0eeeb2e56b) ) | |
| 1413 | ROM_LOAD( "u69", 0x270000, 0x10000, CRC(e7f9c34f) SHA1(f65aed012f1d575a63690222b8c8f2c56bc196c3) ) | |
| 1414 | ROM_LOAD( "u68", 0x280000, 0x10000, CRC(88a634d5) SHA1(9ddf86ca8cd91965348bc311cc722151f831db21) ) | |
| 1415 | ROM_LOAD( "u67", 0x290000, 0x10000, CRC(4ab8b69e) SHA1(4320407c78864edc7876ad3604405414a3e7762d) ) | |
| 1416 | ROM_LOAD( "u66", 0x2a0000, 0x10000, CRC(e1da4b25) SHA1(c81ed1ffc0a4bf64e794a1313559453f9455c312) ) | |
| 1417 | ROM_LOAD( "u65", 0x2b0000, 0x10000, CRC(6df0d125) SHA1(37392cc917e73cfa09970fd24503b45ced399976) ) | |
| 1418 | ROM_LOAD( "u64", 0x2c0000, 0x10000, CRC(abab1b16) SHA1(2913a94e1fcf8df52e29d0fb6e373aa64d23c019) ) | |
| 1419 | ROM_LOAD( "u63", 0x2d0000, 0x10000, CRC(80602f31) SHA1(f1c5c4476dbf80382f33c0776c103cff9bed8346) ) | |
| 1420 | ROM_LOAD( "u62", 0x2e0000, 0x10000, CRC(c2a476d1) SHA1(ffde1784548050d87f1404aaca3689417e6f7a81) ) | |
| 1421 | ||
| 1422 | ROM_LOAD( "u58", 0x400000, 0x10000, CRC(8a7501e3) SHA1(dcd87c464fcb88180cc1c24ec82586440a197a5c) ) | |
| 1423 | ROM_LOAD( "u57", 0x410000, 0x10000, CRC(a504735f) SHA1(2afe58e576eea2e0326c6b42adb621358a270881) ) | |
| 1424 | ROM_LOAD( "u56", 0x420000, 0x10000, CRC(55f8cca7) SHA1(0b0a0d50be4401e4ac4e75d8040f18540f9ddc61) ) | |
| 1425 | ROM_LOAD( "u55", 0x430000, 0x10000, CRC(d3c932c1) SHA1(1a7ffc04e796ba355506bf9037c21aef18fe01a3) ) | |
| 1426 | ROM_LOAD( "u54", 0x440000, 0x10000, CRC(c7f4134b) SHA1(aea523e17f95c27d1f2c1f69884f626d96c8cb3b) ) | |
| 1427 | ROM_LOAD( "u53", 0x450000, 0x10000, CRC(6be4da56) SHA1(35a93a259be04a644ca70df4922f6915274c3932) ) | |
| 1428 | ROM_LOAD( "u52", 0x460000, 0x10000, CRC(1ea36a4a) SHA1(78e5437d46c1ecff5e221bc301925b10f00c5269) ) | |
| 1429 | ROM_LOAD( "u51", 0x470000, 0x10000, CRC(9d4b0324) SHA1(80fb38a9ac81a0383112df680b9755d7cccbd50b) ) | |
| 1430 | ROM_LOAD( "u50", 0x480000, 0x10000, CRC(6f9f0c26) SHA1(be77d99fb37fa31c3824725b28ee74206c584b90) ) | |
| 1431 | ROM_LOAD( "u49", 0x490000, 0x10000, CRC(80386fce) SHA1(f182ed0f1a3753dedc56cb120cb8d10e1556e966) ) | |
| 1432 | ROM_LOAD( "u48", 0x4a0000, 0x10000, CRC(05c16185) SHA1(429910c5b1f1fe47fdec6cfcba765ee9f10749f0) ) | |
| 1433 | ROM_LOAD( "u47", 0x4b0000, 0x10000, CRC(4c0151f1) SHA1(b526066fc594f3ec83bb4866986e3b73cdae3992) ) | |
| 1434 | ROM_LOAD( "u46", 0x4c0000, 0x10000, CRC(5670bfcb) SHA1(b20829b715c6421894c10c02aebb08d22b5109c9) ) | |
| 1435 | ROM_LOAD( "u45", 0x4d0000, 0x10000, CRC(27f10d98) SHA1(b027ade2b4a52977d9c40c9549b9067d37fab41c) ) | |
| 1436 | ROM_LOAD( "u44", 0x4e0000, 0x10000, CRC(93b8eaa4) SHA1(b786f3286c5443cf08e556e9fb030b3444288f3c) ) | |
| 1437 | ||
| 1438 | ROM_LOAD( "u40", 0x600000, 0x10000, CRC(7fcaebc7) SHA1(b951d63c072d693f7dfc7e362a12513eb9bd6bab) ) | |
| 1439 | ROM_LOAD( "u39", 0x610000, 0x10000, CRC(7db5cf52) SHA1(478aefc1126493378d22c857646e2fce221c7d21) ) | |
| 1440 | ROM_LOAD( "u38", 0x620000, 0x10000, CRC(3f9f3ef7) SHA1(5315e8c372bb63d95f814d8eafe0f41e4d95ba1a) ) | |
| 1441 | ROM_LOAD( "u37", 0x630000, 0x10000, CRC(ed81826c) SHA1(afe1c0fc692a802279c1f7f31143d33028d35ce4) ) | |
| 1442 | ROM_LOAD( "u36", 0x640000, 0x10000, CRC(e5d855c0) SHA1(3fa0f765238ad2a27c0c65805bf56ebfbe50bf05) ) | |
| 1443 | ROM_LOAD( "u35", 0x650000, 0x10000, CRC(3a7b1329) SHA1(e8b547a3b8f85cd13e12cfe0bf3949acc1486e6b) ) | |
| 1444 | ROM_LOAD( "u34", 0x660000, 0x10000, CRC(fe982b0e) SHA1(a03e7e348186339fd93ce119f65e8f0ea7b7bb7a) ) | |
| 1445 | ROM_LOAD( "u33", 0x670000, 0x10000, CRC(6bc7eb0f) SHA1(6964ef63d0daf1bc7fa9585567659cfc198b6cc3) ) | |
| 1446 | ROM_LOAD( "u32", 0x680000, 0x10000, CRC(5875a6d3) SHA1(ae64aa786239be39c3c99bbe019bdc91003c1691) ) | |
| 1447 | ROM_LOAD( "u31", 0x690000, 0x10000, CRC(2fa4b8e5) SHA1(8e4e4abd60d20e0ef955ac4b1f300cfd157e50ca) ) | |
| 1448 | ROM_LOAD( "u30", 0x6a0000, 0x10000, CRC(7e4bb8ee) SHA1(7166bd56a569329e01ed0c03579a403d659a4a7b) ) | |
| 1449 | ROM_LOAD( "u29", 0x6b0000, 0x10000, CRC(45136fd9) SHA1(44388e16d02a8c55fed0dbbcd842c941fa4b11b1) ) | |
| 1450 | ROM_LOAD( "u28", 0x6c0000, 0x10000, CRC(d6cdac24) SHA1(d4bbe3a1be89be7d21769bfe476b50c05cd0c357) ) | |
| 1451 | ROM_LOAD( "u27", 0x6d0000, 0x10000, CRC(4d33bbec) SHA1(05a3bd66ff91c824e841ca3943585f6aa383c5c2) ) | |
| 1452 | ROM_LOAD( "u26", 0x6e0000, 0x10000, CRC(cb19f784) SHA1(1e4d85603c940e247fdc45f0366dfb484285e588) ) | |
| 1453 | ROM_END | |
| 1454 | ||
| 1455 | ||
| 1355 | 1456 | ROM_START( trog ) |
| 1356 | 1457 | ROM_REGION( 0x90000, "cvsdcpu", 0 ) /* sound CPU */ |
| 1357 | 1458 | ROM_LOAD ( "trogu4.bin", 0x10000, 0x10000, CRC(759d0bf4) SHA1(c4c3fa51c43cf7fd241ac1f33d7d220aa9f9edb3) ) |
| r5613 | r5614 | |
| 2125 | 2226 | ROM_END |
| 2126 | 2227 | |
| 2127 | 2228 | |
| 2229 | ROM_START( mkyturbo ) | |
| 2230 | ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */ | |
| 2231 | ROM_LOAD ( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) ) | |
| 2232 | ||
| 2233 | ROM_REGION( 0x200000, "oki", 0 ) /* ADPCM */ | |
| 2234 | ROM_LOAD ( "mks-u12.rom", 0x00000, 0x40000, CRC(258bd7f9) SHA1(463890b23f17350fb9b8a85897b0777c45bc2d54) ) | |
| 2235 | ROM_RELOAD( 0x40000, 0x40000 ) | |
| 2236 | ROM_LOAD ( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) ) | |
| 2237 | ROM_RELOAD( 0xc0000, 0x40000 ) | |
| 2238 | ||
| 2239 | /* A 'NIBBLE BOARD' daughtercard holding a GAL16V8A-2SP, 27C040 EPROM and a 9.8304MHz XTAL plugs into the U89 socket */ | |
| 2240 | ROM_REGION16_LE( 0x100000, "user1", 0 ) /* 34010 code */ | |
| 2241 | ROM_LOAD16_BYTE( "kombo-rom-u105.bin", 0x00000, 0x80000, CRC(80d5618c) SHA1(9bdfddbc70b61c94c1871abac1de153b8b728761) ) | |
| 2242 | ROM_LOAD16_BYTE( "kombo-rom-u89.bin", 0x00001, 0x80000, CRC(450788e3) SHA1(34e4fa9c2ede66799301c3d1755df25edc432539) ) | |
| 2243 | ||
| 2244 | ROM_REGION( 0x800000, "gfx1", 0 ) | |
| 2245 | ROM_LOAD ( "mkg-u111.rom", 0x000000, 0x80000, CRC(d17096c4) SHA1(01ef390a372c9d94adf138f9543ebb88b89f4c38) ) | |
| 2246 | ROM_LOAD ( "mkg-u112.rom", 0x080000, 0x80000, CRC(993bc2e4) SHA1(7791edbec2b4b8971a3e790346dd7564ecf16d5c) ) | |
| 2247 | ROM_LOAD ( "mkg-u113.rom", 0x100000, 0x80000, CRC(6fb91ede) SHA1(a3735b49f93b08c44fbc97e2b5aad394628fbe90) ) | |
| 2248 | ROM_LOAD ( "mkg-u114.rom", 0x180000, 0x80000, CRC(ed1ff88a) SHA1(6b090b658ee6148af953bd0c9216f37162b6460f) ) | |
| 2249 | ||
| 2250 | ROM_LOAD ( "mkg-u95.rom", 0x200000, 0x80000, CRC(a002a155) SHA1(3cf7909e92bcd428063596fc5b9953e0000d6eca) ) | |
| 2251 | ROM_LOAD ( "mkg-u96.rom", 0x280000, 0x80000, CRC(dcee8492) SHA1(a912b74d3b26ebd1b1613cc631080f83ececeaf8) ) | |
| 2252 | ROM_LOAD ( "mkg-u97.rom", 0x300000, 0x80000, CRC(de88caef) SHA1(a7927b504dc56ca5c9048373977fe5743b0a3f0b) ) | |
| 2253 | ROM_LOAD ( "mkg-u98.rom", 0x380000, 0x80000, CRC(37eb01b4) SHA1(06092460bd137e08d0f8df8560942ed877d40e09) ) | |
| 2254 | ||
| 2255 | ROM_LOAD ( "mkg-u106.rom", 0x400000, 0x80000, CRC(45acaf21) SHA1(5edd36c55f4e5d3c74fb85171728ec0a58284b12) ) | |
| 2256 | ROM_LOAD ( "mkg-u107.rom", 0x480000, 0x80000, CRC(2a6c10a0) SHA1(cc90923c44f2961b945a0fd0f85ecc2ba04af2cb) ) | |
| 2257 | ROM_LOAD ( "mkg-u108.rom", 0x500000, 0x80000, CRC(23308979) SHA1(0b36788624a1cf0d3f4c895be5ba967b8dfcf85e) ) | |
| 2258 | ROM_LOAD ( "mkg-u109.rom", 0x580000, 0x80000, CRC(cafc47bb) SHA1(8610af6e52f7089ff4acd850c53ab8b4119e4445) ) | |
| 2259 | ROM_END | |
| 2260 | ||
| 2261 | ||
| 2128 | 2262 | ROM_START( mkyawdim ) |
| 2129 | 2263 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound CPU */ |
| 2130 | 2264 | ROM_LOAD ( "1.u67", 0x00000, 0x10000, CRC(b58d229e) SHA1(3ed14ef650dfa7f9d460611b19e9233a022cbea6) ) |
| r5613 | r5614 | |
| 2335 | 2469 | |
| 2336 | 2470 | GAME( 1988, narc, 0, zunit, narc, narc, ROT0, "Williams", "Narc (rev 7.00)", GAME_SUPPORTS_SAVE ) |
| 2337 | 2471 | GAME( 1988, narc3, narc, zunit, narc, narc, ROT0, "Williams", "Narc (rev 3.20)", GAME_SUPPORTS_SAVE ) |
| 2472 | GAME( 1988, narc2, narc, zunit, narc, narc, ROT0, "Williams", "Narc (rev 2.00)", GAME_SUPPORTS_SAVE ) | |
| 2338 | 2473 | |
| 2339 | 2474 | GAME( 1990, trog, 0, yunit_cvsd_4bit_slow, trog, trog, ROT0, "Midway", "Trog (rev LA5 03/29/91)", GAME_SUPPORTS_SAVE ) |
| 2340 | 2475 | GAME( 1990, trog4, trog, yunit_cvsd_4bit_slow, trog, trog, ROT0, "Midway", "Trog (rev LA4 03/11/91)", GAME_SUPPORTS_SAVE ) |
| r5613 | r5614 | |
| 2368 | 2503 | GAME( 1992, mkla2, mk, yunit_adpcm_6bit_fast, mkla2, mkyunit, ROT0, "Midway", "Mortal Kombat (rev 2.0 08/18/92)", GAME_SUPPORTS_SAVE ) |
| 2369 | 2504 | GAME( 1992, mkla3, mk, yunit_adpcm_6bit_fast, mkla4, mkyunit, ROT0, "Midway", "Mortal Kombat (rev 3.0 08/31/92)", GAME_SUPPORTS_SAVE ) |
| 2370 | 2505 | GAME( 1992, mkla4, mk, yunit_adpcm_6bit_fast, mkla4, mkyunit, ROT0, "Midway", "Mortal Kombat (rev 4.0 09/28/92)", GAME_SUPPORTS_SAVE ) |
| 2506 | GAME( 1992, mkyturbo, mk, yunit_adpcm_6bit_fast, mkla4, mkyturbo, ROT0, "hack", "Mortal Kombat (Turbo 3.1 09/09/93, hack)", GAME_SUPPORTS_SAVE ) | |
| 2371 | 2507 | GAME( 1992, mkyawdim, mk, mkyawdim, mkla4, mkyawdim, ROT0, "bootleg", "Mortal Kombat (Yawdim bootleg)", GAME_SUPPORTS_SAVE ) |
| 2372 | 2508 | GAME( 1992, totcarn, 0, yunit_adpcm_6bit_fast, totcarn, totcarn, ROT0, "Midway", "Total Carnage (rev LA1 03/10/92)", GAME_SUPPORTS_SAVE ) |
| 2373 | 2509 | GAME( 1992, totcarnp, totcarn, yunit_adpcm_6bit_fast, totcarn, totcarn, ROT0, "Midway", "Total Carnage (prototype, rev 1.0 01/25/92)", GAME_SUPPORTS_SAVE ) |
| r5613 | r5614 | |
|---|---|---|
| 306 | 306 | AM_RANGE(0x1810, 0x1810) AM_DEVREAD("mathbox", mathbox_lo_r) |
| 307 | 307 | AM_RANGE(0x1818, 0x1818) AM_DEVREAD("mathbox", mathbox_hi_r) |
| 308 | 308 | AM_RANGE(0x1820, 0x182f) AM_DEVREADWRITE("pokey", pokey_r, pokey_w) |
| 309 | #if BZONE_DISCRETE | |
| 310 | 309 | AM_RANGE(0x1840, 0x1840) AM_DEVWRITE("discrete", bzone_sounds_w) |
| 311 | #else | |
| 312 | AM_RANGE(0x1840, 0x1840) AM_WRITE(bzone_sounds_w) | |
| 313 | #endif | |
| 314 | 310 | AM_RANGE(0x1860, 0x187f) AM_DEVWRITE("mathbox", mathbox_go_w) |
| 315 | 311 | AM_RANGE(0x2000, 0x2fff) AM_RAM AM_BASE(&vectorram) AM_SIZE(&vectorram_size) AM_REGION("maincpu", 0x2000) |
| 316 | 312 | AM_RANGE(0x3000, 0x7fff) AM_ROM |
| r5613 | r5614 | |
| 407 | 403 | PORT_DIPSETTING( 0x60, "6 credits/4 coins" )\ |
| 408 | 404 | PORT_DIPSETTING( 0x80, "6 credits/5 coins" ) |
| 409 | 405 | |
| 406 | #define BZONEADJ \ | |
| 407 | PORT_START("R11") \ | |
| 408 | PORT_ADJUSTER( 50, "Engine Frequency" ) | |
| 409 | ||
| 410 | 410 | static INPUT_PORTS_START( bzone ) |
| 411 | 411 | BZONEIN0 |
| 412 | 412 | BZONEDSW0 |
| r5613 | r5614 | |
| 422 | 422 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 ) |
| 423 | 423 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 424 | 424 | |
| 425 | #if BZONE_DISCRETE | |
| 426 | PORT_START("R11") | |
| 427 | PORT_ADJUSTER( 50, "Engine Frequency" ) | |
| 428 | #endif | |
| 425 | BZONEADJ | |
| 429 | 426 | INPUT_PORTS_END |
| 430 | 427 | |
| 431 | 428 | |
| r5613 | r5614 | |
| 519 | 516 | |
| 520 | 517 | PORT_START("AN2") /* analog 2 = shell firing range hack removed, now uses Z */ |
| 521 | 518 | PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_REVERSE |
| 519 | ||
| 520 | BZONEADJ | |
| 522 | 521 | INPUT_PORTS_END |
| 523 | 522 | |
| 524 | 523 | |
| r5613 | r5614 | |
| 578 | 577 | MDRV_IMPORT_FROM(bzone_base) |
| 579 | 578 | |
| 580 | 579 | /* sound hardware */ |
| 581 | #if BZONE_DISCRETE | |
| 582 | 580 | MDRV_IMPORT_FROM(bzone_audio) |
| 583 | #else | |
| 584 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 585 | 581 | |
| 586 | MDRV_SOUND_ADD("pokey", POKEY, MASTER_CLOCK / 8) | |
| 587 | MDRV_SOUND_CONFIG(bzone_pokey_interface) | |
| 588 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 589 | ||
| 590 | MDRV_SOUND_ADD("custom", BZONE, 0) | |
| 591 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) | |
| 592 | #endif | |
| 593 | 582 | MACHINE_DRIVER_END |
| 594 | 583 | |
| 595 | 584 | |
| 596 | static MACHINE_DRIVER_START( bradley ) | |
| 597 | 585 | |
| 598 | /* basic machine hardware */ | |
| 599 | MDRV_IMPORT_FROM(bzone) | |
| 600 | ||
| 601 | /* sound hardware */ | |
| 602 | MDRV_SOUND_REPLACE("pokey", POKEY, BZONE_MASTER_CLOCK / 8) | |
| 603 | MDRV_SOUND_CONFIG(bzone_pokey_interface) | |
| 604 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 605 | MACHINE_DRIVER_END | |
| 606 | ||
| 607 | ||
| 608 | 586 | static MACHINE_DRIVER_START( redbaron ) |
| 609 | 587 | |
| 610 | 588 | /* basic machine hardware */ |
| r5613 | r5614 | |
| 842 | 820 | GAMEL(1980, bzone, 0, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (set 1)", GAME_SUPPORTS_SAVE, layout_bzone ) |
| 843 | 821 | GAMEL(1980, bzone2, bzone, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (set 2)", GAME_SUPPORTS_SAVE, layout_bzone ) |
| 844 | 822 | GAMEL(1980, bzonec, bzone, bzone, bzone, 0, ROT0, "Atari", "Battle Zone (cocktail)", GAME_SUPPORTS_SAVE|GAME_NO_COCKTAIL, layout_bzone ) |
| 845 | GAME( 1980, bradley, 0, b | |
| 823 | GAME( 1980, bradley, 0, bzon | |
| 846 | 824 | GAMEL(1980, redbaron, 0, redbaron, redbaron, 0, ROT0, "Atari", "Red Baron", GAME_SUPPORTS_SAVE, layout_ho88ffff ) |
| r5613 | r5614 | |
|---|---|---|
| 711 | 711 | ROM_END |
| 712 | 712 | |
| 713 | 713 | |
| 714 | ROM_START( mkturbo ) | |
| 714 | ROM_START( mktturbo ) | |
| 715 | 715 | ROM_REGION( 0x50000, "adpcm", 0 ) /* sound CPU */ |
| 716 | 716 | ROM_LOAD( "mks-u3.rom", 0x10000, 0x40000, CRC(c615844c) SHA1(5732f9053a5f73b0cc3b0166d7dc4430829d5bc7) ) |
| 717 | 717 | |
| r5613 | r5614 | |
| 721 | 721 | ROM_LOAD( "mks-u13.rom", 0x80000, 0x40000, CRC(7b7ec3b6) SHA1(6eec1b90d4a4855f34a7ebfbf93f3358d5627db4) ) |
| 722 | 722 | ROM_RELOAD( 0xc0000, 0x40000 ) |
| 723 | 723 | |
| 724 | /* A ' | |
| 724 | /* A 'NI | |
| 725 | 725 | ROM_REGION16_LE( 0x100000, "user1", 0 ) /* 34010 code */ |
| 726 | 726 | ROM_LOAD16_BYTE( "kombo-rom-uj-12.bin", 0x00000, 0x80000, CRC(7a441f2d) SHA1(3b731bcbd73721ea0cc20157ec5181d25922523c) ) |
| 727 | 727 | ROM_LOAD16_BYTE( "kombo-rom-ug-12.bin", 0x00001, 0x80000, CRC(45bed5a1) SHA1(dba2c21878925afdcaf61520c18ebefd5e9617db) ) |
| r5613 | r5614 | |
| 1312 | 1312 | |
| 1313 | 1313 | GAME( 1992, mk, 0, tunit_adpcm, mk, mktunit, ROT0, "Midway", "Mortal Kombat (rev 5.0 T-Unit 03/19/93)", GAME_SUPPORTS_SAVE ) |
| 1314 | 1314 | GAME( 1992, mkr4, mk, tunit_adpcm, mk, mktunit, ROT0, "Midway", "Mortal Kombat (rev 4.0 T-Unit 02/11/93)", GAME_SUPPORTS_SAVE ) |
| 1315 | GAME( 1992, mkturbo, mk, | |
| 1315 | GAME( 1992, mktturbo, mk, | |
| 1316 | 1316 | |
| 1317 | 1317 | GAME( 1993, mk2, 0, tunit_dcs, mk2, mk2, ROT0, "Midway", "Mortal Kombat II (rev L3.1)", GAME_SUPPORTS_SAVE ) |
| 1318 | 1318 | GAME( 1993, mk2r32, mk2, tunit_dcs, mk2, mk2, ROT0, "Midway", "Mortal Kombat II (rev L3.2 (European))", GAME_SUPPORTS_SAVE ) |
| r5613 | r5614 | |
|---|---|---|
| 464 | 464 | static WRITE8_DEVICE_HANDLER( sound_control_w ) |
| 465 | 465 | { |
| 466 | 466 | /* bit 0 = MUTE (inverted sense on System 2) */ |
| 467 | sound_global_enable(~(data ^ mute_xor) & 1); | |
| 467 | sound_global_enable(device->machine, ~(data ^ mute_xor) & 1); | |
| 468 | 468 | |
| 469 | 469 | /* bit 6 = feedback from sound board that read occurrred */ |
| 470 | 470 |
| r5613 | r5614 | |
|---|---|---|
| 139 | 139 | VIDEO_START( gaiden ); |
| 140 | 140 | VIDEO_START( raiga ); |
| 141 | 141 | VIDEO_START( drgnbowl ); |
| 142 | VIDEO_START( mastninj ); | |
| 142 | 143 | |
| 143 | 144 | VIDEO_UPDATE( gaiden ); |
| 144 | 145 | VIDEO_UPDATE( raiga ); |
| r5613 | r5614 | |
| 774 | 775 | GFXDECODE_ENTRY( "gfx4", 0, spritelayout, 0x000, 16 + 128 ) /* sprites 8x8 (only colors 0x00-x0f and 0x80-0x8f are used) */ |
| 775 | 776 | GFXDECODE_END |
| 776 | 777 | |
| 778 | static const gfx_layout mastninj_tile2layout = | |
| 779 | { | |
| 780 | 16,16, | |
| 781 | RGN_FRAC(1,1), | |
| 782 | 4, | |
| 783 | { 24,16,8,0 }, | |
| 784 | { 0,1,2,3,4,5,6,7, 256,257,258,259,260,261,262,263 }, | |
| 785 | { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32, 512+0*32, 512+1*32, 512+2*32, 512+3*32, 512+4*32, 512+5*32, 512+6*32, 512+7*32}, | |
| 786 | 32*32 | |
| 787 | }; | |
| 788 | ||
| 789 | static const gfx_layout mastninj_spritelayout = | |
| 790 | { | |
| 791 | 8,8, /* tile size */ | |
| 792 | RGN_FRAC(1,4), /* number of tiles */ | |
| 793 | 4, /* 4 bits per pixel */ | |
| 794 | { RGN_FRAC(0,4),RGN_FRAC(1,4),RGN_FRAC(2,4),RGN_FRAC(3,4) }, | |
| 795 | { 0,1,2,3,4,5,6,7 }, | |
| 796 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, | |
| 797 | 8*8 /* offset to next tile */ | |
| 798 | }; | |
| 799 | ||
| 800 | static GFXDECODE_START( mastninj ) | |
| 801 | GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0x000, 16 ) /* tiles 8x8 */ | |
| 802 | GFXDECODE_ENTRY( "gfx2", 0, mastninj_tile2layout, 0x300, 16 ) /* tiles 16x16 */ | |
| 803 | GFXDECODE_ENTRY( "gfx3", 0, mastninj_tile2layout, 0x200, 16 ) /* tiles 16x16 */ | |
| 804 | GFXDECODE_ENTRY( "gfx4", 0, mastninj_spritelayout, 0x100, 16 ) /* sprites 8x8 */ | |
| 805 | GFXDECODE_END | |
| 806 | ||
| 777 | 807 | static const gfx_layout drgnbowl_tile2layout = |
| 778 | 808 | { |
| 779 | 809 | 16,16, |
| r5613 | r5614 | |
| 914 | 944 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 915 | 945 | MACHINE_DRIVER_END |
| 916 | 946 | |
| 947 | /* | |
| 948 | Master Ninja | |
| 949 | ||
| 950 | CPUs | |
| 951 | ||
| 952 | QTY Type position function | |
| 953 | 1x MC68000P10 68000 main PCB main | |
| 954 | 1x Z8400HB1 ic36 main PCB sound | |
| 955 | 2x YM2203C ic31,ic32 main PCB sound | |
| 956 | 2x Y3014B c16,ic17 main PCB sound | |
| 957 | 2x LM324N ic2,ic6 main PCB sound | |
| 958 | 1x TDA2002 ic1 main PCB sound | |
| 959 | ||
| 960 | Oscillators | |
| 961 | 1x oscillator 20.000 (xl2 main PCB) | |
| 962 | 1x blu resonator 400K (xl1 main PCB) | |
| 963 | ||
| 964 | ROMs | |
| 965 | ||
| 966 | QTY Type position status | |
| 967 | 6x AM27C512 1-6 main PCB dumped | |
| 968 | 32x AM27C512 8-39 ROMs PCB dumped | |
| 969 | ||
| 970 | RAMs | |
| 971 | ||
| 972 | QTY Type position | |
| 973 | 4x HY6264LP-10 ic25,ic28,ic61,ic62 main PCB | |
| 974 | 3x HY6116ALP-10 ic33,ic123,ic124 main PCB | |
| 975 | 1x HM6148P ic80 main PCB | |
| 976 | 1x MCM2018AN45 ic81 main PCB | |
| 977 | 4x HM6148P ic63-66 ROMs PCB | |
| 978 | 1x HY6116ALP-10 ic85 ROMs PCB | |
| 979 | ||
| 980 | PLDs | |
| 981 | ||
| 982 | QTY Type position status | |
| 983 | 2x TIBPAL16L8 ic15,ic54 main PCB read protected | |
| 984 | 1x GAL16L8 ic42 ROMs PCB read protected | |
| 985 | ||
| 986 | Others | |
| 987 | ||
| 988 | 1x JAMMA edge connector | |
| 989 | 1x trimmer (volume) | |
| 990 | 2x 8x2 switches DIP | |
| 991 | */ | |
| 992 | ||
| 993 | static ADDRESS_MAP_START( mastninj_sound_map, ADDRESS_SPACE_PROGRAM, 8 ) | |
| 994 | AM_RANGE(0x0000, 0xdfff) AM_ROM | |
| 995 | AM_RANGE(0xf000, 0xf7ff) AM_RAM | |
| 996 | AM_RANGE(0xc400, 0xc401) AM_DEVWRITE("ym1", ym2203_w) | |
| 997 | AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("ym2", ym2203_w) | |
| 998 | // AM_RANGE(0xfc00, 0xfc00) AM_NOP /* ?? */ | |
| 999 | // AM_RANGE(0xfc20, 0xfc20) AM_READ(soundlatch_r) | |
| 1000 | ADDRESS_MAP_END | |
| 1001 | ||
| 1002 | static ADDRESS_MAP_START( mastninj_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 1003 | AM_RANGE(0x000000, 0x03ffff) AM_ROM | |
| 1004 | AM_RANGE(0x060000, 0x063fff) AM_RAM | |
| 1005 | AM_RANGE(0x070000, 0x070fff) AM_RAM_WRITE(gaiden_videoram_w) AM_BASE(&gaiden_videoram) | |
| 1006 | AM_RANGE(0x072000, 0x073fff) AM_READWRITE(gaiden_videoram2_r, gaiden_videoram2_w) AM_BASE(&gaiden_videoram2) | |
| 1007 | AM_RANGE(0x074000, 0x075fff) AM_READWRITE(gaiden_videoram3_r, gaiden_videoram3_w) AM_BASE(&gaiden_videoram3) | |
| 1008 | AM_RANGE(0x076000, 0x077fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size) | |
| 1009 | AM_RANGE(0x078000, 0x079fff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16) | |
| 1010 | // AM_RANGE(0x078800, 0x079fff) AM_RAM | |
| 1011 | AM_RANGE(0x07a000, 0x07a001) AM_READ_PORT("SYSTEM") | |
| 1012 | AM_RANGE(0x07a002, 0x07a003) AM_READ_PORT("P1_P2") | |
| 1013 | AM_RANGE(0x07a004, 0x07a005) AM_READ_PORT("DSW") | |
| 1014 | // AM_RANGE(0x07a104, 0x07a105) AM_WRITE(gaiden_txscrolly_w) | |
| 1015 | // AM_RANGE(0x07a10c, 0x07a10d) AM_WRITE(gaiden_txscrollx_w) | |
| 1016 | AM_RANGE(0x07f000, 0x07f001) AM_WRITE(gaiden_bgscrolly_w) | |
| 1017 | AM_RANGE(0x07f002, 0x07f003) AM_WRITE(gaiden_bgscrollx_w) | |
| 1018 | AM_RANGE(0x07f004, 0x07f005) AM_WRITE(gaiden_fgscrolly_w) | |
| 1019 | AM_RANGE(0x07f006, 0x07f007) AM_WRITE(gaiden_fgscrollx_w) | |
| 1020 | AM_RANGE(0x07a800, 0x07a801) AM_WRITE(watchdog_reset16_w) | |
| 1021 | AM_RANGE(0x07e000, 0x07e001) AM_WRITE(gaiden_sound_command_w) | |
| 1022 | // AM_RANGE(0x07a806, 0x07a807) AM_WRITENOP | |
| 1023 | // AM_RANGE(0x07a808, 0x07a809) AM_WRITE(gaiden_flip_w) | |
| 1024 | ADDRESS_MAP_END | |
| 1025 | ||
| 1026 | static MACHINE_DRIVER_START( mastninj ) | |
| 1027 | ||
| 1028 | /* basic machine hardware */ | |
| 1029 | MDRV_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz? */ | |
| 1030 | MDRV_CPU_PROGRAM_MAP(mastninj_map) | |
| 1031 | MDRV_CPU_VBLANK_INT("screen", irq5_line_hold) | |
| 1032 | ||
| 1033 | MDRV_CPU_ADD("audiocpu", Z80, 4000000) /* ?? MHz */ | |
| 1034 | MDRV_CPU_PROGRAM_MAP(mastninj_sound_map) | |
| 1035 | /* IRQs are triggered by the YM2203 */ | |
| 1036 | ||
| 1037 | MDRV_MACHINE_RESET(raiga) | |
| 1038 | ||
| 1039 | /* video hardware */ | |
| 1040 | MDRV_SCREEN_ADD("screen", RASTER) | |
| 1041 | MDRV_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */ | |
| 1042 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) | |
| 1043 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) | |
| 1044 | MDRV_SCREEN_SIZE(32*8, 32*8) | |
| 1045 | MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) | |
| 1046 | ||
| 1047 | MDRV_GFXDECODE(mastninj) | |
| 1048 | MDRV_PALETTE_LENGTH(4096) | |
| 1049 | ||
| 1050 | MDRV_VIDEO_START(mastninj) | |
| 1051 | MDRV_VIDEO_UPDATE(gaiden) | |
| 1052 | ||
| 1053 | /* sound hardware */ | |
| 1054 | MDRV_SPEAKER_STANDARD_MONO("mono") | |
| 1055 | ||
| 1056 | MDRV_SOUND_ADD("ym1", YM2203, 4000000) /* ?? MHz */ | |
| 1057 | MDRV_SOUND_CONFIG(ym2203_config) | |
| 1058 | MDRV_SOUND_ROUTE(0, "mono", 0.15) | |
| 1059 | MDRV_SOUND_ROUTE(1, "mono", 0.15) | |
| 1060 | MDRV_SOUND_ROUTE(2, "mono", 0.15) | |
| 1061 | MDRV_SOUND_ROUTE(3, "mono", 0.60) | |
| 1062 | ||
| 1063 | MDRV_SOUND_ADD("ym2", YM2203, 4000000) /* ?? MHz */ | |
| 1064 | MDRV_SOUND_ROUTE(0, "mono", 0.15) | |
| 1065 | MDRV_SOUND_ROUTE(1, "mono", 0.15) | |
| 1066 | MDRV_SOUND_ROUTE(2, "mono", 0.15) | |
| 1067 | MDRV_SOUND_ROUTE(3, "mono", 0.60) | |
| 1068 | ||
| 1069 | /* no OKI on the bootleg */ | |
| 1070 | // MDRV_SOUND_ADD("oki", OKIM6295, 1000000) | |
| 1071 | // MDRV_SOUND_CONFIG(okim6295_interface_pin7high) | |
| 1072 | // MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) | |
| 1073 | MACHINE_DRIVER_END | |
| 1074 | ||
| 917 | 1075 | /*************************************************************************** |
| 918 | 1076 | |
| 919 | 1077 | Game driver(s) |
| r5613 | r5614 | |
| 1128 | 1286 | ROM_LOAD( "4.4a", 0x0000, 0x20000, CRC(b0e0faf9) SHA1(2275d2ef5eee356ccf80b9e9644d16fc30a4d107) ) /* samples */ |
| 1129 | 1287 | ROM_END |
| 1130 | 1288 | |
| 1289 | ROM_START( mastninj ) | |
| 1290 | ROM_REGION( 0x40000, "maincpu", 0 ) | |
| 1291 | ROM_LOAD16_BYTE( "3.ic27", 0x00000, 0x10000, CRC(41fedeb3) SHA1(7e95f8e5b0c38b578eedbce9afbd10dbb14cdddf) ) | |
| 1292 | ROM_LOAD16_BYTE( "1.ic30", 0x00001, 0x10000, CRC(93b1e3dd) SHA1(325b2f0ef5d92f4d760086de6cb23494d1e6c6e6) ) | |
| 1293 | ROM_LOAD16_BYTE( "4.ic26", 0x20000, 0x10000, CRC(d375c5f6) SHA1(925e84d79f35595a344a417125d74dc46ebec310) ) // 1ST AND 2ND HALF IDENTICAL (but correct?) | |
| 1294 | ROM_LOAD16_BYTE( "2.ic29", 0x20001, 0x10000, CRC(6b53b8b1) SHA1(68bffc992fecae5e113592a9481c0cee80925135) ) | |
| 1131 | 1295 | |
| 1296 | ROM_REGION( 0x10000, "audiocpu", 0 ) | |
| 1297 | ROM_LOAD( "5.ic35", 0x000000, 0x10000, CRC(ba528424) SHA1(5ab93059e26483a756d80b8c18d9669d2a3416de) ) | |
| 1132 | 1298 | |
| 1299 | ROM_REGION( 0x010000, "gfx1", 0 ) | |
| 1300 | ROM_LOAD( "6.ic120", 0x000000, 0x10000, CRC(847cc552) SHA1(e5e2ed19efcedb52885f9f91a1690c88a6b6261d) ) | |
| 1301 | ||
| 1302 | ROM_REGION( 0x080000, "gfx2", 0 ) | |
| 1303 | ROM_LOAD32_BYTE( "8.ic13", 0x000000, 0x10000, CRC(e3987e0f) SHA1(8805443e56575fc455d21703bd2f9ebef434e262) ) | |
| 1304 | ROM_LOAD32_BYTE( "10.ic11", 0x000001, 0x10000, CRC(5e8afc68) SHA1(ecef113a947b9bda6abbef5f75557cd201e355b3) ) | |
| 1305 | ROM_LOAD32_BYTE( "12.ic9", 0x000002, 0x10000, CRC(2713e9f1) SHA1(87614a79596216d2b710925167f3130d4c2e07c9) ) | |
| 1306 | ROM_LOAD32_BYTE( "14.ic7", 0x000003, 0x10000, CRC(ca59280f) SHA1(d5a1d85f75ea667812708758915f43f01c8c9830) ) | |
| 1307 | ROM_LOAD32_BYTE( "20.ic27", 0x040000, 0x10000, CRC(72e5c1c2) SHA1(0e744407c52a61ed657557978cdfe455fe5e931e) ) | |
| 1308 | ROM_LOAD32_BYTE( "22.ic25", 0x040001, 0x10000, CRC(55affaf8) SHA1(c121a904ba44dc53c8a10b8d56c4c25ab879d8be) ) | |
| 1309 | ROM_LOAD32_BYTE( "24.ic23", 0x040002, 0x10000, CRC(bd76fd53) SHA1(bc2ad054b63573f16c99f82c680f0f6de2ee4683) ) | |
| 1310 | ROM_LOAD32_BYTE( "26.ic21", 0x040003, 0x10000, CRC(f3bfcfd6) SHA1(7d73a2ae00825979b3d09502f52d78f61f3ea1a9) ) | |
| 1311 | ||
| 1312 | ROM_REGION( 0x080000, "gfx3", 0 ) | |
| 1313 | ROM_LOAD32_BYTE( "9.ic12", 0x000000, 0x10000, CRC(ae043a2e) SHA1(3513b21d4ee7f869c9ebda68707845d030b0ecad) ) | |
| 1314 | ROM_LOAD32_BYTE( "11.ic10", 0x000001, 0x10000, CRC(e197fd97) SHA1(1e92139ae6a1c15de629039757c21e32cacc42d6) ) | |
| 1315 | ROM_LOAD32_BYTE( "13.ic8", 0x000002, 0x10000, CRC(0871971c) SHA1(ede9bb5d6d968fc532217b4eb1cd4c0d7ea9a4a1) ) | |
| 1316 | ROM_LOAD32_BYTE( "15.ic6", 0x000003, 0x10000, CRC(6850aea3) SHA1(670820ba2df040ded8739907bfdde4ac97373200) ) | |
| 1317 | ROM_LOAD32_BYTE( "21.ic26", 0x040000, 0x10000, CRC(dd162ce7) SHA1(70ec5a722ea31434be2a4b3104f9c54a48b8ec05) ) | |
| 1318 | ROM_LOAD32_BYTE( "23.ic24", 0x040001, 0x10000, CRC(edd65385) SHA1(3b5c0115ae1972bfe696a22edd2da9e6fb9739f4) ) | |
| 1319 | ROM_LOAD32_BYTE( "25.ic22", 0x040002, 0x10000, CRC(ca691635) SHA1(177f94a17cfaf67c764c2a2dff48475039207fae) ) | |
| 1320 | ROM_LOAD32_BYTE( "27.ic20", 0x040003, 0x10000, CRC(2ae70f42) SHA1(aad89dbd0309a5e3a786aa028995b56859d5b5ff) ) | |
| 1321 | ||
| 1322 | ROM_REGION( 0x100000, "gfx4", 0) /* these will need a further descramble to be in the same format as gaiden, although the sprites on the bootleg look different anyway */ | |
| 1323 | ROM_LOAD( "36.ic50", 0x000000, 0x10000, CRC(3c117e62) SHA1(dee45d6bbe053996e0b3faaba0293a273faf1ffa) ) | |
| 1324 | ROM_LOAD( "37.ic49", 0x010000, 0x10000, CRC(f6d6422d) SHA1(933487b09d3bcff9714fb2469b3d751b38459cfd) ) | |
| 1325 | ROM_LOAD( "38.ic48", 0x020000, 0x10000, CRC(642f06e7) SHA1(5b30b5029884b7eddcad201224a639f94ee27823) ) | |
| 1326 | ROM_LOAD( "39.ic47", 0x030000, 0x10000, CRC(51f00702) SHA1(c2a7819beb37ebf613cb2d65476dcee39f72a781) ) | |
| 1327 | ROM_LOAD( "32.ic34", 0x040000, 0x10000, CRC(940f3dbb) SHA1(4e2f224ed2ec1b8da992bd375d3ab1cf6fbfdd1f) ) | |
| 1328 | ROM_LOAD( "33.ic33", 0x050000, 0x10000, CRC(f6baccb0) SHA1(2244d16127efe67fcf59a59e50eabc54e3081dd1) ) | |
| 1329 | ROM_LOAD( "34.ic32", 0x060000, 0x10000, CRC(bb46ef1b) SHA1(4c8f9e06fa4d7f14206f6180a999b3f32681785a) ) | |
| 1330 | ROM_LOAD( "35.ic31", 0x070000, 0x10000, CRC(c0b6ba3e) SHA1(8849cf5c7777e4b5e52c695bcb6038b3bad4e04c) ) | |
| 1331 | ROM_LOAD( "28.ic19", 0x080000, 0x10000, CRC(012da98d) SHA1(413e1f02e2e3267fb4b893b14f627105789aa1c9) ) | |
| 1332 | ROM_LOAD( "29.ic18", 0x090000, 0x10000, CRC(fa32da96) SHA1(5e240f6f91813bdafacf1d29ea65704f2c4f2ae6) ) | |
| 1333 | ROM_LOAD( "30.ic17", 0x0a0000, 0x10000, CRC(910fccdb) SHA1(99523b53ae0dbf82783ab5a731df3c02984c72fe) ) | |
| 1334 | ROM_LOAD( "31.ic16", 0x0b0000, 0x10000, CRC(d16b593b) SHA1(2895b2eba0f3ad5e209fe8c550dd8cc3c3e08742) ) | |
| 1335 | ROM_LOAD( "16.ic5", 0x0c0000, 0x10000, CRC(216eeef5) SHA1(5167af8cef220a5092add2bf578e8323360132a5) ) | |
| 1336 | ROM_LOAD( "17.ic4", 0x0d0000, 0x10000, CRC(f72f8bfd) SHA1(ccf0aab11987e76c927a73f12e5cd4bb125c1258) ) | |
| 1337 | ROM_LOAD( "18.ic3", 0x0e0000, 0x10000, CRC(6de96087) SHA1(0b9028320cb622dad07cf8bde015428eba7f8a5e) ) | |
| 1338 | ROM_LOAD( "19.ic2", 0x0f0000, 0x10000, CRC(c12c367b) SHA1(9835292f335f1353f7b9bd0bb85124942822646f) ) | |
| 1339 | ||
| 1340 | ROM_REGION( 0x080000, "misc", 0 ) | |
| 1341 | ROM_LOAD( "gal16v8.ic42.bad.dump", 0x000, 0x117, BAD_DUMP CRC(61d6a8d7) SHA1(d3a6331b1fccd374e4f080740094d3832ff98ad9) ) | |
| 1342 | ROM_LOAD( "tibpal16l8.ic15.bad.dump", 0x000, 0x104, BAD_DUMP CRC(e9cd78fb) SHA1(557d3e7ef3b25c1338b24722cac91bca788c02b8) ) | |
| 1343 | ROM_LOAD( "tibpal16l8.ic54.bad.dump", 0x000, 0x104, BAD_DUMP CRC(e9cd78fb) SHA1(557d3e7ef3b25c1338b24722cac91bca788c02b8) ) | |
| 1344 | ROM_END | |
| 1345 | ||
| 1346 | ||
| 1133 | 1347 | ROM_START( tknight ) |
| 1134 | 1348 | ROM_REGION( 0x40000, "maincpu", 0 ) /* 2*128k for 68000 code */ |
| 1135 | 1349 | ROM_LOAD16_BYTE( "tkni1.bin", 0x00000, 0x20000, CRC(9121daa8) SHA1(06ba7779602df8fae32e859371d27c0dbb8d3430) ) |
| r5613 | r5614 | |
| 1391 | 1605 | free(buffer); |
| 1392 | 1606 | } |
| 1393 | 1607 | |
| 1608 | static void descramble_mastninj_gfx(UINT8* src) | |
| 1609 | { | |
| 1610 | UINT8 *buffer; | |
| 1611 | int len = 0x80000; | |
| 1394 | 1612 | |
| 1613 | /* rearrange gfx */ | |
| 1614 | buffer = alloc_array_or_die(UINT8, len); | |
| 1615 | { | |
| 1616 | int i; | |
| 1617 | for (i = 0;i < len; i++) | |
| 1618 | { | |
| 1619 | buffer[i] = src[BITSWAP24(i, | |
| 1620 | 23,22,21,20, | |
| 1621 | 19,18,17,16, | |
| 1622 | 15,5,14,13,12, | |
| 1623 | 11,10,9,8, | |
| 1624 | 7,6,4, | |
| 1625 | 3,2,1,0)]; | |
| 1626 | } | |
| 1627 | memcpy(src,buffer,len); | |
| 1628 | free(buffer); | |
| 1629 | } | |
| 1630 | ||
| 1631 | buffer = alloc_array_or_die(UINT8, len); | |
| 1632 | { | |
| 1633 | int i; | |
| 1634 | for (i = 0;i < len; i++) | |
| 1635 | { | |
| 1636 | buffer[i] = src[BITSWAP24(i, | |
| 1637 | 23,22,21,20, | |
| 1638 | 19,18,17,16, | |
| 1639 | 15,6,14,13,12, | |
| 1640 | 11,10,9,8, | |
| 1641 | 7,5,4, | |
| 1642 | 3,2,1,0)]; | |
| 1643 | } | |
| 1644 | memcpy(src,buffer,len); | |
| 1645 | free(buffer); | |
| 1646 | } | |
| 1647 | } | |
| 1648 | ||
| 1649 | DRIVER_INIT(mastninj) | |
| 1650 | { | |
| 1651 | // rearrange the graphic roms into a format that MAME can decode | |
| 1652 | descramble_mastninj_gfx(memory_region(machine,"gfx2")); | |
| 1653 | descramble_mastninj_gfx(memory_region(machine,"gfx3")); | |
| 1654 | DRIVER_INIT_CALL(shadoww); | |
| 1655 | } | |
| 1656 | ||
| 1395 | 1657 | GAME( 1988, shadoww, 0, shadoww, shadoww, shadoww, ROT0, "Tecmo", "Shadow Warriors (World, set 1)", 0 ) |
| 1396 | 1658 | GAME( 1988, shadowwa, shadoww, shadoww, shadoww, shadoww, ROT0, "Tecmo", "Shadow Warriors (World, set 2)", 0 ) |
| 1397 | 1659 | GAME( 1988, gaiden, shadoww, shadoww, shadoww, shadoww, ROT0, "Tecmo", "Ninja Gaiden (US)", 0 ) |
| 1398 | 1660 | GAME( 1989, ryukendn, shadoww, shadoww, shadoww, shadoww, ROT0, "Tecmo", "Ninja Ryukenden (Japan, set 1)", 0 ) |
| 1399 | 1661 | GAME( 1989, ryukendna,shadoww, shadoww, shadoww, shadoww, ROT0, "Tecmo", "Ninja Ryukenden (Japan, set 2)", 0 ) |
| 1662 | GAME( 1989, mastninj, shadoww, mastninj,shadoww, mastninj, ROT0, "bootleg", "Master Ninja (bootleg of Shadow Warriors / Ninja Gaiden)", GAME_NOT_WORKING ) // sprites need fixing, sound and yscroll too. | |
| 1400 | 1663 | GAME( 1989, wildfang, 0, shadoww, wildfang, wildfang, ROT0, "Tecmo", "Wild Fang / Tecmo Knight", 0 ) |
| 1401 | 1664 | GAME( 1989, tknight, wildfang, shadoww, tknight, wildfang, ROT0, "Tecmo", "Tecmo Knight", 0 ) |
| 1402 | 1665 | GAME( 1991, stratof, 0, raiga, raiga, raiga, ROT0, "Tecmo", "Raiga - Strato Fighter (US)", GAME_IMPERFECT_GRAPHICS ) |
| r5613 | r5614 | |
|---|---|---|
| 284 | 284 | static CUSTOM_INPUT( hopper_r ) |
| 285 | 285 | { |
| 286 | 286 | if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); |
| 287 | return input_code_pressed(KEYCODE_H); | |
| 287 | return input_code_pressed(field->port->machine, KEYCODE_H); | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | static READ8_HANDLER( exp_rom_r ) |
| r5613 | r5614 | |
|---|---|---|
| 412 | 412 | D7: /MUTE |
| 413 | 413 | D6-D0: unknown |
| 414 | 414 | */ |
| 415 | sound_global_enable(data & 0x80); | |
| 415 | sound_global_enable(space->machine, data & 0x80); | |
| 416 | 416 | } |
| 417 | 417 | return; |
| 418 | 418 |
| r5613 | r5614 | |
|---|---|---|
| 174 | 174 | int x,y,x_size,y_size; |
| 175 | 175 | UINT32 src; |
| 176 | 176 | |
| 177 | printf("blit copy %04x %04x %04x %04x %04x\n", blit_romaddr[0], blit_attr1_ram[0], blit_dst_ram_loword[0], blit_attr2_ram[0], blit_dst_ram_hiword[0] ); | |
| 178 | printf("blit vregs %04x %04x %04x %04x\n",blit_vregs[0/2],blit_vregs[2/2],blit_vregs[4/2],blit_vregs[6/2]); | |
| 179 | printf("blit transpen %04x %04x %04x %04x %04x %04x %04x %04x\n",blit_transpen[0/2],blit_transpen[2/2],blit_transpen[4/2],blit_transpen[6/2], | |
| 177 | logerror("blit copy %04x %04x %04x %04x %04x\n", blit_romaddr[0], blit_attr1_ram[0], blit_dst_ram_loword[0], blit_attr2_ram[0], blit_dst_ram_hiword[0] ); | |
| 178 | logerror("blit vregs %04x %04x %04x %04x\n",blit_vregs[0/2],blit_vregs[2/2],blit_vregs[4/2],blit_vregs[6/2]); | |
| 179 | logerror("blit transpen %04x %04x %04x %04x %04x %04x %04x %04x\n",blit_transpen[0/2],blit_transpen[2/2],blit_transpen[4/2],blit_transpen[6/2], | |
| 180 | 180 | blit_transpen[8/2],blit_transpen[10/2],blit_transpen[12/2],blit_transpen[14/2]); |
| 181 | 181 | |
| 182 | 182 | blit_dst_xpos = (blit_dst_ram_loword[0] & 0x00ff)*2; |
| r5613 | r5614 | |
|---|---|---|
| 166 | 166 | |
| 167 | 167 | bitmap_fill(tmpbitmaps[0],NULL,color_base); |
| 168 | 168 | |
| 169 | if (input_code_pressed_once(KEYCODE_1)) /* plane 1 */ | |
| 169 | if (input_code_pressed_once(screen->machine, KEYCODE_1)) /* plane 1 */ | |
| 170 | 170 | planes_enabled[0] ^= 1; |
| 171 | 171 | |
| 172 | if (input_code_pressed_once(KEYCODE_2)) /* plane 2 */ | |
| 172 | if (input_code_pressed_once(screen->machine, KEYCODE_2)) /* plane 2 */ | |
| 173 | 173 | planes_enabled[1] ^= 1; |
| 174 | 174 | |
| 175 | if (input_code_pressed_once(KEYCODE_3)) /* plane 3 */ | |
| 175 | if (input_code_pressed_once(screen->machine, KEYCODE_3)) /* plane 3 */ | |
| 176 | 176 | planes_enabled[2] ^= 1; |
| 177 | 177 | |
| 178 | if (input_code_pressed_once(KEYCODE_4)) /* plane 4 */ | |
| 178 | if (input_code_pressed_once(screen->machine, KEYCODE_4)) /* plane 4 */ | |
| 179 | 179 | planes_enabled[3] ^= 1; |
| 180 | 180 | |
| 181 | if (input_code_pressed_once(KEYCODE_I)) /* show/hide debug info */ | |
| 181 | if (input_code_pressed_once(screen->machine, KEYCODE_I)) /* show/hide debug info */ | |
| 182 | 182 | dbg_info = !dbg_info; |
| 183 | 183 | |
| 184 | if (input_code_pressed_once(KEYCODE_G)) /* enable gfx area handling */ | |
| 184 | if (input_code_pressed_once(screen->machine, KEYCODE_G)) /* enable gfx area handling */ | |
| 185 | 185 | dbg_gfx_e = !dbg_gfx_e; |
| 186 | 186 | |
| 187 | if (input_code_pressed_once(KEYCODE_C)) /* enable color area handling */ | |
| 187 | if (input_code_pressed_once(screen->machine, KEYCODE_C)) /* enable color area handling */ | |
| 188 | 188 | dbg_clr_e = !dbg_clr_e; |
| 189 | 189 | |
| 190 | if (input_code_pressed_once(KEYCODE_V)) /* draw only when vbank==dbg_vbank */ | |
| 190 | if (input_code_pressed_once(screen->machine, KEYCODE_V)) /* draw only when vbank==dbg_vbank */ | |
| 191 | 191 | dbg_vbank ^= 1; |
| 192 | 192 | |
| 193 | if (input_code_pressed_once(KEYCODE_L)) /* showlookup ram */ | |
| 193 | if (input_code_pressed_once(screen->machine, KEYCODE_L)) /* showlookup ram */ | |
| 194 | 194 | dbg_lookup = (dbg_lookup+1)%5;//0,1,2,3, 4-off |
| 195 | 195 | |
| 196 | 196 |
| r5613 | r5614 | |
|---|---|---|
| 60 | 60 | const UINT8 *blit_ram = memory_region(screen->machine,"gfx1"); |
| 61 | 61 | static int test_x = 256,test_y = 256,start_offs; |
| 62 | 62 | |
| 63 | if(input_code_pressed(KEYCODE_Z)) | |
| 63 | if(input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 64 | 64 | test_x++; |
| 65 | 65 | |
| 66 | if(input_code_pressed(KEYCODE_X)) | |
| 66 | if(input_code_pressed(screen->machine, KEYCODE_X)) | |
| 67 | 67 | test_x--; |
| 68 | 68 | |
| 69 | if(input_code_pressed(KEYCODE_A)) | |
| 69 | if(input_code_pressed(screen->machine, KEYCODE_A)) | |
| 70 | 70 | test_y++; |
| 71 | 71 | |
| 72 | if(input_code_pressed(KEYCODE_S)) | |
| 72 | if(input_code_pressed(screen->machine, KEYCODE_S)) | |
| 73 | 73 | test_y--; |
| 74 | 74 | |
| 75 | if(input_code_pressed(KEYCODE_Q)) | |
| 75 | if(input_code_pressed(screen->machine, KEYCODE_Q)) | |
| 76 | 76 | start_offs+=0x200; |
| 77 | 77 | |
| 78 | if(input_code_pressed(KEYCODE_W)) | |
| 78 | if(input_code_pressed(screen->machine, KEYCODE_W)) | |
| 79 | 79 | start_offs-=0x200; |
| 80 | 80 | |
| 81 | if(input_code_pressed(KEYCODE_E)) | |
| 81 | if(input_code_pressed(screen->machine, KEYCODE_E)) | |
| 82 | 82 | start_offs++; |
| 83 | 83 | |
| 84 | if(input_code_pressed(KEYCODE_R)) | |
| 84 | if(input_code_pressed(screen->machine, KEYCODE_R)) | |
| 85 | 85 | start_offs--; |
| 86 | 86 | |
| 87 | 87 | popmessage("%d %d %04x",test_x,test_y,start_offs); |
| r5613 | r5614 | |
|---|---|---|
| 207 | 207 | 136014-231 which matches Namco's PP1-27. The bad bit should cause a tiny gfx |
| 208 | 208 | glitch, though it's difficult to notice. |
| 209 | 209 | |
| 210 | - topracra: Use Service1 to start game | |
| 210 | 211 | |
| 212 | Todo: | |
| 213 | ||
| 214 | - topracra: Gear is not updated in artwork | |
| 215 | ||
| 211 | 216 | ***************************************************************************/ |
| 212 | 217 | |
| 213 | 218 | #include "driver.h" |
| r5613 | r5614 | |
| 347 | 352 | } |
| 348 | 353 | |
| 349 | 354 | |
| 350 | static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine, (const char *)param) >> 4; } | |
| 355 | static CUSTOM_INPUT( high_port_r ) { return input_port_read(field->port->machine, (const char *)param) >> 4; } | |
| 356 | static CUSTOM_INPUT( low_port_r ) { return input_port_read(field->port->machine, (const char *)param) & 0x0f; } | |
| 351 | 357 | static CUSTOM_INPUT( auto_start_r ) { return auto_start_mask; } |
| 352 | 358 | |
| 353 | 359 | static WRITE8_DEVICE_HANDLER( out_0 ) |
| r5613 | r5614 | |
| 553 | 559 | PORT_DIPSETTING( 0x00, "4" ) |
| 554 | 560 | |
| 555 | 561 | PORT_START("DSWA_HI") |
| 556 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 562 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 557 | 563 | |
| 558 | 564 | PORT_START("DSWB") |
| 559 | 565 | PORT_DIPNAME( 0x07, 0x07, "Extended Rank" ) |
| r5613 | r5614 | |
| 582 | 588 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 583 | 589 | |
| 584 | 590 | PORT_START("DSWB_HI") |
| 585 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 591 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 586 | 592 | |
| 587 | 593 | PORT_START("BRAKE") |
| 588 | 594 | PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) |
| r5613 | r5614 | |
| 633 | 639 | PORT_DIPSETTING( 0x00, "4" ) |
| 634 | 640 | |
| 635 | 641 | PORT_START("DSWA_HI") |
| 636 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 642 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 637 | 643 | |
| 638 | 644 | PORT_START("DSWB") |
| 639 | 645 | PORT_DIPNAME( 0xe0, 0xe0, "Practice Rank" ) |
| r5613 | r5614 | |
| 662 | 668 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 663 | 669 | |
| 664 | 670 | PORT_START("DSWB_HI") |
| 665 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 671 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 666 | 672 | |
| 667 | 673 | PORT_START("BRAKE") |
| 668 | 674 | PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) |
| r5613 | r5614 | |
| 686 | 692 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) |
| 687 | 693 | PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) |
| 688 | 694 | |
| 695 | PORT_START("IN0L") | |
| 696 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(low_port_r, "IN0") | |
| 697 | ||
| 698 | PORT_START("IN0H") | |
| 699 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(high_port_r, "IN0") | |
| 700 | ||
| 689 | 701 | PORT_START("DSWA") |
| 690 | 702 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) |
| 691 | 703 | PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) ) |
| r5613 | r5614 | |
| 711 | 723 | PORT_DIPSETTING( 0x00, "4" ) |
| 712 | 724 | |
| 713 | 725 | PORT_START("DSWA_HI") |
| 714 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 726 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 715 | 727 | |
| 716 | 728 | PORT_START("DSWB") |
| 717 | 729 | PORT_DIPNAME( 0x07, 0x07, "Extended Rank" ) |
| r5613 | r5614 | |
| 740 | 752 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 741 | 753 | |
| 742 | 754 | PORT_START("DSWB_HI") |
| 743 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 755 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 744 | 756 | |
| 745 | 757 | PORT_START("BRAKE") |
| 746 | 758 | PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) |
| r5613 | r5614 | |
| 792 | 804 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 793 | 805 | |
| 794 | 806 | PORT_START("DSWA_HI") |
| 795 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 807 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 796 | 808 | |
| 797 | 809 | PORT_START("DSWB") |
| 798 | 810 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Game_Time ) ) |
| r5613 | r5614 | |
| 818 | 830 | PORT_DIPSETTING( 0x00, DEF_STR( High ) ) |
| 819 | 831 | |
| 820 | 832 | PORT_START("DSWB_HI") |
| 821 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 833 | PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM( | |
| 822 | 834 | |
| 823 | 835 | PORT_START("BRAKE") |
| 824 | 836 | PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16) |
| r5613 | r5614 | |
|---|---|---|
| 1098 | 1098 | ROM_LOAD( "strategy.10k", 0x0000, 0x0020, CRC(d95c0318) SHA1(83e5355fdca7b4e1fb5a0e6eeaacfbf9561e2c36) ) |
| 1099 | 1099 | ROM_END |
| 1100 | 1100 | |
| 1101 | ROM_START( strongx ) | |
| 1102 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 1103 | ROM_LOAD( "strongx.2d", 0x0000, 0x1000, CRC(c2f7268c) SHA1(2943198d82d4bc7990b327c44bbce7e7eb011886) ) | |
| 1104 | ROM_LOAD( "strongx.2e", 0x1000, 0x1000, CRC(91059422) SHA1(c73b50bc4035bd7268628cf92b21acbafef0456e) ) | |
| 1105 | ROM_LOAD( "2f_3.bin", 0x2000, 0x1000, CRC(849e2504) SHA1(0ec00a5c77e9d81d69f8b847a50f36af2dacc8d0) ) | |
| 1106 | ROM_LOAD( "2h_4.bin", 0x3000, 0x1000, CRC(8a64069b) SHA1(ccc0e0441360e3ed93f2a0dab70c3a66edad969f) ) | |
| 1107 | ROM_LOAD( "2j_5.bin", 0x4000, 0x1000, CRC(78b9b898) SHA1(158e11352d68ed9e4277efbcb7e927e9bdc662f8) ) | |
| 1108 | ROM_LOAD( "2l_6.bin", 0x5000, 0x1000, CRC(20bae414) SHA1(cd3c03d3b6a3abb64cb86cffa733d5494cb226f7) ) | |
| 1101 | 1109 | |
| 1110 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for sound code */ | |
| 1111 | ROM_LOAD( "s1.bin", 0x0000, 0x1000, CRC(713a5db8) SHA1(8ec41cb93cfd856dc5aecace6238240a5d114ce1) ) | |
| 1112 | ROM_LOAD( "s2.bin", 0x1000, 0x1000, CRC(46079411) SHA1(72bfc39979818309ac5a49654a825f9e4bd0236c) ) | |
| 1113 | ||
| 1114 | ROM_REGION( 0x1000, "gfx1", 0 ) | |
| 1115 | ROM_LOAD( "5f_c2.bin", 0x0000, 0x0800, CRC(7121b679) SHA1(bf76c5b777d1f1468b31524bfe250a1bc4911b09) ) | |
| 1116 | ROM_LOAD( "5h_c1.bin", 0x0800, 0x0800, CRC(d105ad91) SHA1(fd30d001764cf37ae52bab010db27acdc35fece6) ) | |
| 1117 | ||
| 1118 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 1119 | ROM_LOAD( "strategy.6e", 0x0000, 0x0020, CRC(51a629e1) SHA1(f9826202c91a4a3deb8d815cbaa107b29dce5835) ) | |
| 1120 | ||
| 1121 | ROM_REGION( 0x0020, "user1", 0 ) | |
| 1122 | ROM_LOAD( "strategy.10k", 0x0000, 0x0020, CRC(d95c0318) SHA1(83e5355fdca7b4e1fb5a0e6eeaacfbf9561e2c36) ) /* background color map */ | |
| 1123 | ROM_END | |
| 1124 | ||
| 1102 | 1125 | ROM_START( darkplnt ) |
| 1103 | 1126 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 1104 | 1127 | ROM_LOAD( "drkplt2c.dat", 0x0000, 0x1000, CRC(5a0ca559) SHA1(cf77bda30bb08633d274c22734a8f186520ddf7d) ) |
| r5613 | r5614 | |
| 1353 | 1376 | |
| 1354 | 1377 | GAME( 1981, stratgyx, 0, stratgyx, stratgyx, stratgyx, ROT0, "Konami", "Strategy X", GAME_SUPPORTS_SAVE ) |
| 1355 | 1378 | GAME( 1981, stratgys, stratgyx, stratgyx, stratgyx, stratgyx, ROT0, "[Konami] (Stern license)", "Strategy X (Stern)", GAME_SUPPORTS_SAVE ) |
| 1379 | GAME( 1982, strongx, stratgyx, stratgyx, stratgyx, stratgyx, ROT0, "bootleg", "Strong X", GAME_SUPPORTS_SAVE ) | |
| 1356 | 1380 | GAME( 1982, darkplnt, 0, darkplnt, darkplnt, darkplnt, ROT180, "Stern", "Dark Planet", GAME_SUPPORTS_SAVE ) |
| 1357 | 1381 | GAME( 1982, tazmani2, tazmania, type2, tazmania, tazmani2, ROT90, "Stern", "Tazz-Mania (set 2)", GAME_SUPPORTS_SAVE ) |
| 1358 | 1382 | GAME( 1983, anteatg, anteater, anteatg, anteatg, scramble_ppi, ROT90, "TV-Tuning (F.E.G. license)", "Ameisenbaer (German)", GAME_SUPPORTS_SAVE ) |
| r5613 | r5614 | |
|---|---|---|
| 341 | 341 | okim6295_w(adpcm,0,0x81); |
| 342 | 342 | } |
| 343 | 343 | } |
| 344 | if ( input_code_pressed_once(KEYCODE_PGUP) ) | |
| 344 | if ( input_code_pressed_once(device->machine, KEYCODE_PGUP) ) | |
| 345 | 345 | { |
| 346 | 346 | if (m6295_key_delay >= (0x60 * oki_time_base)) |
| 347 | 347 | { |
| r5613 | r5614 | |
| 357 | 357 | else |
| 358 | 358 | m6295_key_delay += (0x01 * oki_time_base); |
| 359 | 359 | } |
| 360 | else if ( input_code_pressed_once(KEYCODE_PGDN) ) | |
| 360 | else if ( input_code_pressed_once(device->machine, KEYCODE_PGDN) ) | |
| 361 | 361 | { |
| 362 | 362 | if (m6295_key_delay >= (0x60 * oki_time_base)) |
| 363 | 363 | { |
| r5613 | r5614 | |
| 373 | 373 | else |
| 374 | 374 | m6295_key_delay += (0x01 * oki_time_base); |
| 375 | 375 | } |
| 376 | else if ( input_code_pressed_once(KEYCODE_INSERT) ) | |
| 376 | else if ( input_code_pressed_once(device->machine, KEYCODE_INSERT) ) | |
| 377 | 377 | { |
| 378 | 378 | if (m6295_key_delay >= (0x60 * oki_time_base)) |
| 379 | 379 | { |
| r5613 | r5614 | |
| 392 | 392 | else |
| 393 | 393 | m6295_key_delay += (0x01 * oki_time_base); |
| 394 | 394 | } |
| 395 | else if ( input_code_pressed_once(KEYCODE_DEL) ) | |
| 395 | else if ( input_code_pressed_once(device->machine, KEYCODE_DEL) ) | |
| 396 | 396 | { |
| 397 | 397 | if (m6295_key_delay >= (0x60 * oki_time_base)) |
| 398 | 398 | { |
| r5613 | r5614 | |
| 411 | 411 | else |
| 412 | 412 | m6295_key_delay += (0x01 * oki_time_base); |
| 413 | 413 | } |
| 414 | else if ( input_code_pressed_once(KEYCODE_Z) ) | |
| 414 | else if ( input_code_pressed_once(device->machine, KEYCODE_Z) ) | |
| 415 | 415 | { |
| 416 | 416 | if (m6295_key_delay >= (0x80 * oki_time_base)) |
| 417 | 417 | { |
| r5613 | r5614 | |
|---|---|---|
| 221 | 221 | - kingbalj : full Dip Switches and Inputs |
| 222 | 222 | - frogg : fix read/writes at/to unmapped/wrong memory |
| 223 | 223 | - scprpng : fix read/writes at/to unmapped/wrong memory |
| 224 | - scorpion : check whether konami filters are used | |
| 225 | - explorer : check whether konami filters are used | |
| 224 | 226 | |
| 225 | 227 | ***************************************************************************/ |
| 226 | 228 | |
| r5613 | r5614 | |
| 371 | 373 | cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE); |
| 372 | 374 | |
| 373 | 375 | /* bit 4 is sound disable */ |
| 374 | sound_global_enable(~data & 0x10); | |
| 376 | sound_global_enable(device->machine, ~data & 0x10); | |
| 375 | 377 | } |
| 376 | 378 | |
| 377 | 379 | |
| r5613 | r5614 | |
| 743 | 745 | /* the decoding here is very simplistic, and you can address both simultaneously */ |
| 744 | 746 | UINT8 result = 0xff; |
| 745 | 747 | if (offset & 0x08) result &= ay8910_r(devtag_get_device(space->machine, "8910.2"), 0); |
| 746 | if (offset & 0x20) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0); | |
| 747 | if (offset & 0x80) result &= ay8910_r(devtag_get_device(space->machine, "8910.1"), 0); | |
| 748 | if (offset & 0x20) result &= ay8910_r(devtag_get_device(space->machine, "8910.1"), 0); | |
| 749 | if (offset & 0x80) result &= ay8910_r(devtag_get_device(space->machine, "8910.0"), 0); | |
| 748 | 750 | return result; |
| 749 | 751 | } |
| 750 | 752 | |
| r5613 | r5614 | |
| 754 | 756 | /* the decoding here is very simplistic, and you can address all six simultaneously */ |
| 755 | 757 | if (offset & 0x04) ay8910_address_w(devtag_get_device(space->machine, "8910.2"), 0, data); |
| 756 | 758 | if (offset & 0x08) ay8910_data_w(devtag_get_device(space->machine, "8910.2"), 0, data); |
| 757 | if (offset & 0x10) ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data); | |
| 758 | if (offset & 0x20) ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data); | |
| 759 | if (offset & 0x40) ay8910_address_w(devtag_get_device(space->machine, "8910.1"), 0, data); | |
| 760 | if (offset & 0x80) ay8910_data_w(devtag_get_device(space->machine, "8910.1"), 0, data); | |
| 759 | if (offset & 0x10) ay8910_address_w(devtag_get_device(space->machine, "8910.1"), 0, data); | |
| 760 | if (offset & 0x20) ay8910_data_w(devtag_get_device(space->machine, "8910.1"), 0, data); | |
| 761 | if (offset & 0x40) ay8910_address_w(devtag_get_device(space->machine, "8910.0"), 0, data); | |
| 762 | if (offset & 0x80) ay8910_data_w(devtag_get_device(space->machine, "8910.0"), 0, data); | |
| 761 | 763 | } |
| 762 | 764 | |
| 763 | 765 | |
| r5613 | r5614 | |
| 1618 | 1620 | { |
| 1619 | 1621 | AY8910_LEGACY_OUTPUT, |
| 1620 | 1622 | AY8910_DEFAULT_LOADS, |
| 1621 | DEVCB_HANDLER( | |
| 1623 | DEVCB_HANDLER(explorer | |
| 1622 | 1624 | DEVCB_NULL, |
| 1623 | 1625 | DEVCB_NULL, |
| 1624 | 1626 | DEVCB_NULL |
| r5613 | r5614 | |
| 1628 | 1630 | { |
| 1629 | 1631 | AY8910_LEGACY_OUTPUT, |
| 1630 | 1632 | AY8910_DEFAULT_LOADS, |
| 1631 | DEVCB_HANDLER( | |
| 1633 | DEVCB_HANDLER(k | |
| 1632 | 1634 | DEVCB_NULL, |
| 1633 | 1635 | DEVCB_NULL, |
| 1634 | 1636 | DEVCB_NULL |
| r5613 | r5614 | |
|---|---|---|
| 106 | 106 | -----+--------------------------+--------+---------+----------+---------+----------+---------+---------------+------+------+------- |
| 107 | 107 | VER | NAME | SYSTEM | PROGRAM | CHAR GEN | CG P/N | CLR PROM | CP P/N | GAME TYPE | DUMP | STAT | ADDED |
| 108 | 108 | -----+--------------------------+--------+---------+----------+---------+----------+---------+---------------+------+------+------- |
| 109 | * 7.4 | Gaming Poker (w. export) | 903 | AUG/81 | PKCG | 6300010 | POKCLR | 6600020 | Gaming | Yes | OK | Yes | |
| 109 | 110 | 7.6 | Poker | 903 | AUG/81 | PKCG | 6300010 | POKCLR | 6600020 | Amusement | Yes | OK | Yes |
| 110 | 111 | * 7.9 | Arcade Poker | 903 | AUG/81 | PKCG | 6300010 | POKCLR | 6600020 | Amusement | Yes | BD | Yes |
| 111 | 112 | * 8.0 | Arcade Black Jack | 903 | SEP/81 | CPKCG | 6300010 | POKCLR | 6600020 | Amusement? | Yes | BD | Yes |
| r5613 | r5614 | |
| 450 | 451 | -------------- |
| 451 | 452 | |
| 452 | 453 | |
| 454 | [2009-09-03] | |
| 455 | ||
| 456 | - Added Game 7.4 (Gaming Poker, W.Export). | |
| 457 | - Added Game 7.4 proper inputs. Game is now playable with full sound. | |
| 458 | - Updated games list and technical notes. | |
| 459 | ||
| 460 | ||
| 453 | 461 | [2008-12-26] |
| 454 | 462 | |
| 455 | 463 | - Correctly setup the MC6845 device for all systems. |
| r5613 | r5614 | |
| 1147 | 1155 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1148 | 1156 | INPUT_PORTS_END |
| 1149 | 1157 | |
| 1158 | static INPUT_PORTS_START( comg074 ) | |
| 1159 | PORT_START("IN0-0") | |
| 1160 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* credits */ | |
| 1161 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Collect") PORT_CODE(KEYCODE_Q) | |
| 1162 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) | |
| 1163 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Deal / Draw") | |
| 1164 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_NAME("Cancel Discards") | |
| 1165 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("IN0-0-6") | |
| 1166 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1167 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1168 | ||
| 1169 | PORT_START("IN0-1") | |
| 1170 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hand Pay") PORT_CODE(KEYCODE_W) | |
| 1171 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("IN0-1-2") | |
| 1172 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) PORT_NAME("Door Open") | |
| 1173 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Test Mode") /* in some games you need to open the door first */ | |
| 1174 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("IN0-1-5") | |
| 1175 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("IN0-1-6") | |
| 1176 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1177 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1178 | ||
| 1179 | PORT_START("IN0-2") | |
| 1180 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Discard 1") | |
| 1181 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Discard 2") | |
| 1182 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Discard 3") | |
| 1183 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Discard 4") | |
| 1184 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Discard 5") | |
| 1185 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_NAME("Small") | |
| 1186 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1187 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1188 | ||
| 1189 | PORT_START("IN0-3") | |
| 1190 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("IN0-3-1") | |
| 1191 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) | |
| 1192 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) | |
| 1193 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") | |
| 1194 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("IN0-3-5") | |
| 1195 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("IN0-3-6") | |
| 1196 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1197 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 1198 | ||
| 1199 | /* SW1-5 should be wired to PIA0 portA, bit 6. | |
| 1200 | SW1-6 should be wired to H-POL. | |
| 1201 | SW1-7 should be wired to V-POL. | |
| 1202 | */ | |
| 1203 | PORT_START("SW1") /* settings (PIA1), SW2 in schematics */ | |
| 1204 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* L6 */ | |
| 1205 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* L7 */ | |
| 1206 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* L8 */ | |
| 1207 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* L9 */ | |
| 1208 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 1209 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1210 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1211 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 1212 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1213 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1214 | PORT_DIPNAME( 0xC0, 0x80, "Maximum Bet") | |
| 1215 | PORT_DIPSETTING( 0x00, "5" ) | |
| 1216 | PORT_DIPSETTING( 0x40, "10" ) | |
| 1217 | PORT_DIPSETTING( 0x80, "40" ) | |
| 1218 | PORT_DIPSETTING( 0xC0, "80" ) | |
| 1219 | ||
| 1220 | PORT_START("SW2") /* baud (serial 6850-4024), SW1 in schematics */ | |
| 1221 | PORT_DIPNAME( 0x3f, 0x08, "Baud Rate" ) PORT_DIPLOCATION("SW1:1,2,3,4,5,6") | |
| 1222 | PORT_DIPSETTING( 0x01, "300" ) | |
| 1223 | PORT_DIPSETTING( 0x02, "600" ) | |
| 1224 | PORT_DIPSETTING( 0x04, "1200" ) | |
| 1225 | PORT_DIPSETTING( 0x08, "2400" ) | |
| 1226 | PORT_DIPSETTING( 0x10, "4800" ) | |
| 1227 | PORT_DIPSETTING( 0x20, "9600" ) | |
| 1228 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") | |
| 1229 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1230 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1231 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:8") | |
| 1232 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1233 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1234 | ||
| 1235 | PORT_START("SW3") /* unknown (ay8912), SW3 in schematics */ | |
| 1236 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") | |
| 1237 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) | |
| 1238 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1239 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2") | |
| 1240 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) | |
| 1241 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1242 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:3") | |
| 1243 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) | |
| 1244 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1245 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4") | |
| 1246 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) | |
| 1247 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1248 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:5") | |
| 1249 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) | |
| 1250 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1251 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:6") | |
| 1252 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) | |
| 1253 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1254 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:7") | |
| 1255 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) | |
| 1256 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1257 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:8") | |
| 1258 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) | |
| 1259 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) | |
| 1260 | INPUT_PORTS_END | |
| 1261 | ||
| 1150 | 1262 | static INPUT_PORTS_START( comg076 ) |
| 1151 | 1263 | PORT_START("IN0-0") |
| 1152 | 1264 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* credits */ |
| r5613 | r5614 | |
| 2002 | 2114 | |
| 2003 | 2115 | */ |
| 2004 | 2116 | |
| 2117 | ROM_START( comg074 ) /* Cal Omega v7.4 (Gaming Poker) */ | |
| 2118 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 2119 | ROM_LOAD( "1800.u5", 0x1800, 0x0800, CRC(69759432) SHA1(d64646476b4f67088bf5996ffc272d2571e62c53) ) /* Seems to be from v6.5. Unused. */ | |
| 2120 | ROM_LOAD( "2000.u6", 0x2000, 0x0800, CRC(bd9044f6) SHA1(9ebfc8379fe79a84982a0176a6b26267580272de) ) | |
| 2121 | ROM_LOAD( "2800.u7", 0x2800, 0x0800, CRC(d1d2e111) SHA1(2e5b6fbaf04539851d0f0674f0fd86e9be90c0fd) ) | |
| 2122 | ROM_LOAD( "3000.u8", 0x3000, 0x0800, CRC(cac4af01) SHA1(aed2986575b8d5539581515d818cb5bb9054c7c9) ) | |
| 2123 | ROM_LOAD( "3800.u9", 0x3800, 0x0800, CRC(6d32c533) SHA1(286cd511dc42e4e98c0e5fee2c7b265a4db949cf) ) | |
| 2124 | ||
| 2125 | ROM_REGION( 0x0800, "gfx1", 0 ) | |
| 2126 | ROM_LOAD( "poker_cg0.u67", 0x0000, 0x0800, CRC(b626ad89) SHA1(551b75f4559d11a4f8f56e38982114a21c77d4e7) ) | |
| 2127 | ||
| 2128 | ROM_REGION( 0x1800, "gfx2", 0 ) | |
| 2129 | ROM_LOAD( "poker_cgc.u70", 0x0000, 0x0800, CRC(f2f94661) SHA1(f37f7c0dff680fd02897dae64e13e297d0fdb3e7) ) | |
| 2130 | ROM_LOAD( "poker_cgb.u69", 0x0800, 0x0800, CRC(6bbb1e2d) SHA1(51ee282219bf84218886ad11a24bc6a8e7337527) ) | |
| 2131 | ROM_LOAD( "poker_cga.u68", 0x1000, 0x0800, CRC(6e3e9b1d) SHA1(14eb8d14ce16719a6ad7d13db01e47c8f05955f0) ) | |
| 2132 | ||
| 2133 | ROM_REGION( 0x400, "proms", 0 ) /* from other set */ | |
| 2134 | ROM_LOAD( "pokclr.u28", 0x0000, 0x0100, BAD_DUMP CRC(a8191ef7) SHA1(d6f777980179ab091e2713ee815d46bf9c0ac486) ) | |
| 2135 | ROM_RELOAD( 0x0100, 0x0100 ) | |
| 2136 | ROM_RELOAD( 0x0200, 0x0100 ) | |
| 2137 | ROM_RELOAD( 0x0300, 0x0100 ) | |
| 2138 | ROM_END | |
| 2139 | ||
| 2005 | 2140 | ROM_START( comg076 ) /* Cal Omega v7.6 (Arcade Poker) */ |
| 2006 | 2141 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2007 | 2142 | ROM_FILL( 0x1800, 0x0800, 0xff ) /* empty socket */ |
| r5613 | r5614 | |
| 2978 | 3113 | *************************/ |
| 2979 | 3114 | |
| 2980 | 3115 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ |
| 3116 | GAME( 1981, comg074, 0, sys903, comg074, standard, ROT0, "Cal Omega Inc.", "Cal Omega - Game 7.4 (Gaming Poker, W.Export)", 0 ) | |
| 2981 | 3117 | GAME( 1981, comg076, 0, sys903, comg076, standard, ROT0, "Cal Omega Inc.", "Cal Omega - Game 7.6 (Arcade Poker)", 0 ) |
| 2982 | 3118 | GAME( 1981, comg079, 0, sys903, comg076, standard, ROT0, "Cal Omega Inc.", "Cal Omega - Game 7.9 (Arcade Poker)", GAME_NOT_WORKING ) /* bad dump */ |
| 2983 | 3119 | GAME( 1981, comg080, 0, sys903, stand903, standard, ROT0, "Cal Omega Inc.", "Cal Omega - Game 8.0 (Arcade Black Jack)", GAME_NOT_WORKING ) /* bad dump */ |
| r5613 | r5614 | |
|---|---|---|
| 175 | 175 | // static int ytlim = 1; |
| 176 | 176 | // static int xtlim = 1; |
| 177 | 177 | |
| 178 | // if ( input_code_pressed_once(KEYCODE_Q) ) ytlim--; | |
| 179 | // if ( input_code_pressed_once(KEYCODE_W) ) ytlim++; | |
| 178 | // if ( input_code_pressed_once(machine, KEYCODE_Q) ) ytlim--; | |
| 179 | // if ( input_code_pressed_once(machine, KEYCODE_W) ) ytlim++; | |
| 180 | 180 | |
| 181 | // if ( input_code_pressed_once(KEYCODE_A) ) xtlim--; | |
| 182 | // if ( input_code_pressed_once(KEYCODE_S) ) xtlim++; | |
| 181 | // if ( input_code_pressed_once(machine, KEYCODE_A) ) xtlim--; | |
| 182 | // if ( input_code_pressed_once(machine, KEYCODE_S) ) xtlim++; | |
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | /*00 ???? ???? (colour / priority?) |
| r5613 | r5614 | |
| 454 | 454 | int mod = 0; |
| 455 | 455 | tick = 0; |
| 456 | 456 | |
| 457 | if(input_code_pressed(KEYCODE_R)) { | |
| 457 | if(input_code_pressed(screen->machine, KEYCODE_R)) { | |
| 458 | 458 | mod = 1; |
| 459 | 459 | bg_bank++; |
| 460 | 460 | if(bg_bank == 8) |
| 461 | 461 | bg_bank = 0; |
| 462 | 462 | } |
| 463 | if(input_code_pressed(KEYCODE_T)) { | |
| 463 | if(input_code_pressed(screen->machine, KEYCODE_T)) { | |
| 464 | 464 | mod = 1; |
| 465 | 465 | if(bg_bank == 0) |
| 466 | 466 | bg_bank = 8; |
| 467 | 467 | bg_bank--; |
| 468 | 468 | } |
| 469 | if(input_code_pressed(KEYCODE_Y)) { | |
| 469 | if(input_code_pressed(screen->machine, KEYCODE_Y)) { | |
| 470 | 470 | mod = 1; |
| 471 | 471 | mid_bank++; |
| 472 | 472 | if(mid_bank == 8) |
| 473 | 473 | mid_bank = 0; |
| 474 | 474 | } |
| 475 | if(input_code_pressed(KEYCODE_U)) { | |
| 475 | if(input_code_pressed(screen->machine, KEYCODE_U)) { | |
| 476 | 476 | mod = 1; |
| 477 | 477 | if(mid_bank == 0) |
| 478 | 478 | mid_bank = 8; |
| 479 | 479 | mid_bank--; |
| 480 | 480 | } |
| 481 | if(input_code_pressed(KEYCODE_O)) { | |
| 481 | if(input_code_pressed(screen->machine, KEYCODE_O)) { | |
| 482 | 482 | mod = 1; |
| 483 | 483 | fg_bank++; |
| 484 | 484 | if(fg_bank == 8) |
| 485 | 485 | fg_bank = 0; |
| 486 | 486 | } |
| 487 | if(input_code_pressed(KEYCODE_I)) { | |
| 487 | if(input_code_pressed(screen->machine, KEYCODE_I)) { | |
| 488 | 488 | mod = 1; |
| 489 | 489 | if(fg_bank == 0) |
| 490 | 490 | fg_bank = 8; |
| 491 | 491 | fg_bank--; |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | if(input_code_pressed(KEYCODE_D)) { | |
| 494 | if(input_code_pressed(screen->machine, KEYCODE_D)) { | |
| 495 | 495 | mod = 1; |
| 496 | 496 | bg_col++; |
| 497 | 497 | if(bg_col == 8) |
| 498 | 498 | bg_col = 0; |
| 499 | 499 | } |
| 500 | if(input_code_pressed(KEYCODE_F)) { | |
| 500 | if(input_code_pressed(screen->machine, KEYCODE_F)) { | |
| 501 | 501 | mod = 1; |
| 502 | 502 | if(bg_col == 0) |
| 503 | 503 | bg_col = 8; |
| 504 | 504 | bg_col--; |
| 505 | 505 | } |
| 506 | if(input_code_pressed(KEYCODE_G)) { | |
| 506 | if(input_code_pressed(screen->machine, KEYCODE_G)) { | |
| 507 | 507 | mod = 1; |
| 508 | 508 | mid_col++; |
| 509 | 509 | if(mid_col == 8) |
| 510 | 510 | mid_col = 0; |
| 511 | 511 | } |
| 512 | if(input_code_pressed(KEYCODE_H)) { | |
| 512 | if(input_code_pressed(screen->machine, KEYCODE_H)) { | |
| 513 | 513 | mod = 1; |
| 514 | 514 | if(mid_col == 0) |
| 515 | 515 | mid_col = 8; |
| 516 | 516 | mid_col--; |
| 517 | 517 | } |
| 518 | if(input_code_pressed(KEYCODE_J)) { | |
| 518 | if(input_code_pressed(screen->machine, KEYCODE_J)) { | |
| 519 | 519 | mod = 1; |
| 520 | 520 | fg_col++; |
| 521 | 521 | if(fg_col == 8) |
| 522 | 522 | fg_col = 0; |
| 523 | 523 | } |
| 524 | if(input_code_pressed(KEYCODE_K)) { | |
| 524 | if(input_code_pressed(screen->machine, KEYCODE_K)) { | |
| 525 | 525 | mod = 1; |
| 526 | 526 | if(fg_col == 0) |
| 527 | 527 | fg_col = 8; |
| 528 | 528 | fg_col--; |
| 529 | 529 | } |
| 530 | if(mod || input_code_pressed(KEYCODE_L)) { | |
| 530 | if(mod || input_code_pressed(screen->machine, KEYCODE_L)) { | |
| 531 | 531 | popmessage("b:%x.%x m:%x.%x f:%x.%x %d%d%d", bg_bank, bg_col, mid_bank, mid_col, fg_bank, fg_col, info_1, info_2, info_3); |
| 532 | 532 | tilemap_mark_all_tiles_dirty(background_layer); |
| 533 | 533 | tilemap_mark_all_tiles_dirty(midground_layer); |
| r5613 | r5614 | |
| 539 | 539 | |
| 540 | 540 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); |
| 541 | 541 | |
| 542 | if (!input_code_pressed(KEYCODE_Q)) | |
| 542 | if (!input_code_pressed(screen->machine, KEYCODE_Q)) | |
| 543 | 543 | tilemap_draw(bitmap, cliprect, background_layer, 0, 0); |
| 544 | if (!input_code_pressed(KEYCODE_W)) | |
| 544 | if (!input_code_pressed(screen->machine, KEYCODE_W)) | |
| 545 | 545 | tilemap_draw(bitmap, cliprect, midground_layer, 0, 0); |
| 546 | if (!input_code_pressed(KEYCODE_E)) | |
| 546 | if (!input_code_pressed(screen->machine, KEYCODE_E)) | |
| 547 | 547 | tilemap_draw(bitmap, cliprect, foreground_layer, 0, 0); |
| 548 | 548 | |
| 549 | 549 | draw_sprites(screen->machine, bitmap, cliprect, 0); |
| 550 | 550 | |
| 551 | if (!input_code_pressed(KEYCODE_A)) | |
| 551 | if (!input_code_pressed(screen->machine, KEYCODE_A)) | |
| 552 | 552 | tilemap_draw(bitmap, cliprect, text_layer, 0, 0); |
| 553 | 553 | |
| 554 | 554 | return 0; |
| r5613 | r5614 | |
| 2002 | 2002 | { |
| 2003 | 2003 | mcu_prog[mcu_prog_offs*2+1] = data; |
| 2004 | 2004 | |
| 2005 | { | |
| 2006 | FILE *fp; | |
| 2007 | fp=fopen("rdx_v33.dmp", "w+b"); | |
| 2008 | if (fp) | |
| 2009 | { | |
| 2010 | fwrite(mcu_prog, 0x400, 2, fp); | |
| 2011 | fclose(fp); | |
| 2012 | } | |
| 2013 | } | |
| 2005 | /* Uncommented until actively worked on | |
| 2006 | { | |
| 2007 | FILE *fp; | |
| 2008 | fp=fopen("rdx_v33.dmp", "w+b"); | |
| 2009 | if (fp) | |
| 2010 | { | |
| 2011 | fwrite(mcu_prog, 0x400, 2, fp); | |
| 2012 | fclose(fp); | |
| 2013 | } | |
| 2014 | } | |
| 2015 | */ | |
| 2014 | 2016 | } |
| 2015 | 2017 | |
| 2016 | 2018 | static WRITE16_HANDLER( mcu_prog_offs_w ) |
| r5613 | r5614 | |
|---|---|---|
| 228 | 228 | int layers_ctrl = video_enable ? -1 : 0; |
| 229 | 229 | |
| 230 | 230 | #ifdef MAME_DEBUG |
| 231 | if (input_code_pressed(KEYCODE_Z)) | |
| 231 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 232 | 232 | { |
| 233 | 233 | int mask = 0; |
| 234 | if (input_code_pressed(KEYCODE_Q)) mask |= 1; | |
| 235 | if (input_code_pressed(KEYCODE_W)) mask |= 2; | |
| 236 | if (input_code_pressed(KEYCODE_A)) mask |= 4; | |
| 234 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; | |
| 235 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; | |
| 236 | if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4; | |
| 237 | 237 | if (mask != 0) layers_ctrl &= mask; |
| 238 | 238 | } |
| 239 | 239 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 80 | 80 | VIDEO_START( psikyo ); |
| 81 | 81 | VIDEO_EOF( psikyo ); |
| 82 | 82 | VIDEO_UPDATE( psikyo ); |
| 83 | VIDEO_START( sngkace ); | |
| 83 | 84 | |
| 84 | 85 | extern void psikyo_switch_banks( int tmap, int bank ); |
| 85 | 86 | |
| r5613 | r5614 | |
| 1205 | 1206 | MDRV_GFXDECODE(psikyo) |
| 1206 | 1207 | MDRV_PALETTE_LENGTH(0x1000) |
| 1207 | 1208 | |
| 1208 | MDRV_VIDEO_START( | |
| 1209 | MDRV_VIDEO_START( | |
| 1209 | 1210 | MDRV_VIDEO_EOF(psikyo) |
| 1210 | 1211 | MDRV_VIDEO_UPDATE(psikyo) |
| 1211 | 1212 | |
| r5613 | r5614 | |
| 1431 | 1432 | memory_install_write32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc00010, 0xc00013, 0, 0, psikyo_soundlatch_w); |
| 1432 | 1433 | |
| 1433 | 1434 | psikyo_ka302c_banking = 0; // SH201B doesn't have any gfx banking |
| 1434 | psikyo_switch_banks(0, 0); // sngkace / samuraia don't use banking | |
| 1435 | psikyo_switch_banks(1, 1); // They share "gfx2" to save memory on other boards | |
| 1436 | 1435 | |
| 1437 | 1436 | /* Enable other regions */ |
| 1438 | 1437 | #if 0 |
| r5613 | r5614 | |
|---|---|---|
| 175 | 175 | }; |
| 176 | 176 | |
| 177 | 177 | static GFXDECODE_START( cb2001 ) |
| 178 | GFXDECODE_ENTRY( "gfx", 0, cb2001_layout, 0x0, 2 ) | |
| 179 | GFXDECODE_ENTRY( "gfx", 0, cb2001_layout32, 0x0, 2 ) | |
| 178 | GFXDECODE_ENTRY( "gfx", 0, cb2001_layout, 0x0, 32 ) | |
| 179 | GFXDECODE_ENTRY( "gfx", 0, cb2001_layout32, 0x0, 32 ) | |
| 180 | 180 | GFXDECODE_END |
| 181 | 181 | |
| 182 | static PALETTE_INIT(cb2001) | |
| 183 | { | |
| 184 | int i; | |
| 185 | for (i = 0; i < 0x200; i++) | |
| 186 | { | |
| 187 | int r,g,b; | |
| 188 | ||
| 189 | UINT8*proms = memory_region(machine, "proms"); | |
| 190 | UINT16 dat; | |
| 191 | ||
| 192 | dat = (proms[0x000+i] << 8) | proms[0x200+i]; | |
| 193 | ||
| 194 | ||
| 195 | b = ((dat >> 1) & 0x1f)<<3; | |
| 196 | r = ((dat >> 6 )& 0x1f)<<3; | |
| 197 | g = ((dat >> 11 ) & 0x1f)<<3; | |
| 198 | ||
| 199 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); | |
| 200 | } | |
| 201 | } | |
| 202 | ||
| 203 | ||
| 182 | 204 | static const nec_config cb2001_config = { cb2001_decryption_table, }; |
| 183 | 205 | static MACHINE_DRIVER_START( cb2001 ) |
| 184 | 206 | MDRV_CPU_ADD("maincpu", V30, 20000000) // CPU91A-011-0016JK004; encrypted cpu like nec v25/35 used in some irem game |
| r5613 | r5614 | |
| 189 | 211 | |
| 190 | 212 | MDRV_GFXDECODE(cb2001) |
| 191 | 213 | |
| 214 | MDRV_PALETTE_INIT( cb2001 ) | |
| 215 | ||
| 192 | 216 | MDRV_SCREEN_ADD("screen", RASTER) |
| 193 | 217 | MDRV_SCREEN_REFRESH_RATE(60) |
| 194 | 218 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| r5613 | r5614 | |
| 210 | 234 | ROM_REGION( 0x080000, "gfx", 0 ) |
| 211 | 235 | ROM_LOAD( "c0111.12a", 0x000000, 0x80000, CRC(342b760e) SHA1(bc168bec384ccacd73543f604e3ab5b2b8f4f441) ) |
| 212 | 236 | |
| 213 | ROM_REGION( 0x200, "user1", 0 ) // ? | |
| 214 | ROM_LOAD( "am27s29.9b", 0x000, 0x200, CRC(6c90f6a2) SHA1(f3f592954000d189ded0ed8c6c4444ace0b616a4) ) | |
| 215 | ROM_REGION( 0x200, "user2", 0 ) // ? | |
| 216 | ROM_LOAD( "am27s29.11b", 0x000, 0x200, CRC(e5aa3ec7) SHA1(675711dd6788b3d0c37573b49b6297cbcd8c8209) ) | |
| 237 | ROM_REGION( 0x400, "proms", 0 ) // ? | |
| 238 | ROM_LOAD( "am27s29.9b", 0x000, 0x200, CRC(6c90f6a2) SHA1(f3f592954000d189ded0ed8c6c4444ace0b616a4) ) | |
| 239 | ROM_LOAD( "am27s29.11b", 0x200, 0x200, CRC(e5aa3ec7) SHA1(675711dd6788b3d0c37573b49b6297cbcd8c8209) ) | |
| 217 | 240 | ROM_END |
| 218 | 241 | |
| 219 | 242 | ROM_START( scherrym ) |
| r5613 | r5614 | |
| 223 | 246 | ROM_REGION( 0x080000, "gfx", 0 ) |
| 224 | 247 | ROM_LOAD( "12a.bin", 0x000000, 0x80000,NO_DUMP ) // missing on PCB |
| 225 | 248 | |
| 226 | // assumed to be the same | |
| 227 | ROM_REGION( 0x200, "user1", 0 ) // ? | |
| 228 | ROM_LOAD( "am27s29.9b", 0x000, 0x200, CRC(6c90f6a2) SHA1(f3f592954000d189ded0ed8c6c4444ace0b616a4) ) | |
| 229 | ROM_REGION( 0x200, "user2", 0 ) // ? | |
| 230 | ROM_LOAD( "am27s29.11b", 0x000, 0x200, CRC(e5aa3ec7) SHA1(675711dd6788b3d0c37573b49b6297cbcd8c8209) ) | |
| 249 | ROM_REGION( 0x400, "proms", 0 ) | |
| 250 | ROM_LOAD( "n82s135-1.bin", 0x000, 0x100, CRC(66ed363f) SHA1(65bd37842c441c2e712844b07c0cfe37ef16d0ef) ) | |
| 251 | ROM_LOAD( "n82s135-2.bin", 0x200, 0x100, CRC(a19821db) SHA1(62dda90dd67dfbc0b96f161f1f2b7a46a5805eae) ) | |
| 231 | 252 | ROM_END |
| 232 | 253 | |
| 233 | 254 | GAME( 2001, cb2001, 0, cb2001, cb2001, 0, ROT0, "Dyna", "Cherry Bonus 2001", GAME_NOT_WORKING|GAME_NO_SOUND ) |
| r5613 | r5614 | |
|---|---|---|
| 298 | 298 | int layers_ctrl = -1; |
| 299 | 299 | |
| 300 | 300 | #ifdef MAME_DEBUG |
| 301 | if (input_code_pressed(KEYCODE_Z)) | |
| 301 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 302 | 302 | { |
| 303 | 303 | int mask = 0; |
| 304 | if (input_code_pressed(KEYCODE_Q)) mask |= 1; | |
| 305 | if (input_code_pressed(KEYCODE_W)) mask |= 2; | |
| 304 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; | |
| 305 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; | |
| 306 | 306 | if (mask != 0) layers_ctrl &= mask; |
| 307 | 307 | } |
| 308 | 308 | #endif |
| r5613 | r5614 | |
| 541 | 541 | #define GALGAMES_EEPROM_CART3 "eeprom_cart3" |
| 542 | 542 | #define GALGAMES_EEPROM_CART4 "eeprom_cart4" |
| 543 | 543 | |
| 544 | const char | |
| 544 | const char | |
| 545 | 545 | |
| 546 | 546 | static READ16_HANDLER( galgames_eeprom_r ) |
| 547 | 547 | { |
| r5613 | r5614 | |
|---|---|---|
| 426 | 426 | static ADDRESS_MAP_START( mooncrst_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 427 | 427 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
| 428 | 428 | AM_RANGE(0x8000, 0x87ff) AM_RAM |
| 429 | AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram) | |
| 429 | AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram) | |
| 430 | 430 | AM_RANGE(0x9400, 0x97ff) AM_READ(galaxold_videoram_r) |
| 431 | 431 | AM_RANGE(0x9800, 0x983f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram) |
| 432 | 432 | AM_RANGE(0x9840, 0x985f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size) |
| r5613 | r5614 | |
|---|---|---|
| 138 | 138 | |
| 139 | 139 | /* CS5 */ |
| 140 | 140 | case 3: |
| 141 | device = devtag_get_device(space->machine, "fltdisc"); | |
| 142 | discrete_sound_w(device, NODE_03, data); | |
| 141 | device = devtag_get_device(space->machine, "dac"); | |
| 142 | dac_w(device, 0, data); | |
| 143 | 143 | break; |
| 144 | 144 | |
| 145 | 145 | /* CS6 */ |
| r5613 | r5614 | |
| 324 | 324 | |
| 325 | 325 | DISCRETE_INPUTX_STREAM(NODE_01, 0, 1.0, 0) |
| 326 | 326 | DISCRETE_INPUTX_STREAM(NODE_02, 1, 1.0, 0) |
| 327 | DISCRETE_INPUTX_ | |
| 327 | DISCRETE_INPUTX_S | |
| 328 | 328 | |
| 329 | 329 | DISCRETE_INPUT_DATA(NODE_05) |
| 330 | 330 | DISCRETE_INPUT_DATA(NODE_06) |
| r5613 | r5614 | |
| 378 | 378 | MDRV_SOUND_ADD("sn2", SN76496, 14318180/8) |
| 379 | 379 | MDRV_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 1) |
| 380 | 380 | |
| 381 | MDRV_SOUND_ADD("dac", DAC, 0) | |
| 382 | MDRV_SOUND_ROUTE_EX(0, "fltdisc", 1.0, 2) | |
| 383 | ||
| 381 | 384 | MDRV_SOUND_ADD("fltdisc", DISCRETE, 0) |
| 382 | 385 | |
| 383 | 386 | MDRV_SOUND_CONFIG_DISCRETE(circusc) |
| r5613 | r5614 | |
|---|---|---|
| 508 | 508 | if (tick >= 5) |
| 509 | 509 | { |
| 510 | 510 | tick = 0; |
| 511 | if (input_code_pressed(KEYCODE_0)) | |
| 511 | if (input_code_pressed(screen->machine, KEYCODE_0)) | |
| 512 | 512 | { |
| 513 | 513 | layer++; |
| 514 | 514 | if (layer > 2) |
| r5613 | r5614 | |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /* |
| 521 | if (input_code_pressed_once(KEYCODE_9)) | |
| 521 | if (input_code_pressed_once(screen->machine, KEYCODE_9)) | |
| 522 | 522 | { |
| 523 | 523 | FILE *file = fopen("vram0.bin", "wb"); |
| 524 | 524 | int i; |
| r5613 | r5614 | |
|---|---|---|
| 388 | 388 | static int b=0; |
| 389 | 389 | static VIDEO_UPDATE( bballoon ) |
| 390 | 390 | { |
| 391 | if(input_code_pressed_once(KEYCODE_Q)) | |
| 391 | if(input_code_pressed_once(screen->machine, KEYCODE_Q)) | |
| 392 | 392 | { |
| 393 | 393 | irq_en ^= 1; |
| 394 | 394 | printf("en = %d\n",irq_en); |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | if(input_code_pressed(KEYCODE_W)) | |
| 397 | if(input_code_pressed(screen->machine, KEYCODE_W)) | |
| 398 | 398 | { |
| 399 | 399 | |
| 400 | 400 | printf("b = %d\n",++b); |
| 401 | 401 | } |
| 402 | 402 | |
| 403 | if(input_code_pressed(KEYCODE_E)) | |
| 403 | if(input_code_pressed(screen->machine, KEYCODE_E)) | |
| 404 | 404 | { |
| 405 | 405 | |
| 406 | 406 | printf("b = %d\n",--b); |
| r5613 | r5614 | |
|---|---|---|
| 117 | 117 | int layers_ctrl = -1; |
| 118 | 118 | |
| 119 | 119 | #if DUNHUANG_DEBUG |
| 120 | if (input_code_pressed(KEYCODE_Z)) | |
| 120 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 121 | 121 | { |
| 122 | 122 | int msk = 0; |
| 123 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 124 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 123 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 124 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 125 | 125 | if (msk != 0) layers_ctrl &= msk; |
| 126 | 126 | } |
| 127 | 127 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 311 | 311 | static CUSTOM_INPUT( hopper_r ) |
| 312 | 312 | { |
| 313 | 313 | if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); |
| 314 | return input_code_pressed(KEYCODE_H); | |
| 314 | return input_code_pressed(field->port->machine, KEYCODE_H); | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | static INPUT_PORTS_START( jackie ) |
| r5613 | r5614 | |
|---|---|---|
| 710 | 710 | banknum = -1; |
| 711 | 711 | |
| 712 | 712 | /**** mixer control enable ****/ |
| 713 | sound_global_enable( 1 ); /* mixer enabled */ | |
| 713 | sound_global_enable( machine, 1 ); /* mixer enabled */ | |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 |
| r5613 | r5614 | |
|---|---|---|
| 107 | 107 | UINT16 *pri_ram; |
| 108 | 108 | |
| 109 | 109 | #ifdef MAME_DEBUG |
| 110 | if (input_code_pressed(KEYCODE_Z)) | |
| 110 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 111 | 111 | { |
| 112 | 112 | int mask = 0; |
| 113 | if (input_code_pressed(KEYCODE_Q)) mask |= 0x01; | |
| 114 | if (input_code_pressed(KEYCODE_W)) mask |= 0x02; | |
| 115 | if (input_code_pressed(KEYCODE_E)) mask |= 0x04; | |
| 116 | if (input_code_pressed(KEYCODE_R)) mask |= 0x08; | |
| 117 | if (input_code_pressed(KEYCODE_A)) mask |= 0x10; | |
| 118 | if (input_code_pressed(KEYCODE_S)) mask |= 0x20; | |
| 119 | if (input_code_pressed(KEYCODE_D)) mask |= 0x40; | |
| 120 | if (input_code_pressed(KEYCODE_F)) mask |= 0x80; | |
| 113 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 0x01; | |
| 114 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 0x02; | |
| 115 | if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 0x04; | |
| 116 | if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 0x08; | |
| 117 | if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 0x10; | |
| 118 | if (input_code_pressed(screen->machine, KEYCODE_S)) mask |= 0x20; | |
| 119 | if (input_code_pressed(screen->machine, KEYCODE_D)) mask |= 0x40; | |
| 120 | if (input_code_pressed(screen->machine, KEYCODE_F)) mask |= 0x80; | |
| 121 | 121 | if (mask) layer_enable &= mask; |
| 122 | 122 | } |
| 123 | 123 | #endif |
| r5613 | r5614 | |
| 327 | 327 | |
| 328 | 328 | #ifdef MAME_DEBUG |
| 329 | 329 | #if 1 |
| 330 | if (input_code_pressed(KEYCODE_Z)) | |
| 330 | if (input_code_pressed(space->machine, KEYCODE_Z)) | |
| 331 | 331 | { char buf[20]; |
| 332 | 332 | sprintf(buf, "%02X%02X",blitter.depth,blitter.flags&0xff); |
| 333 | 333 | // ui_draw_text(buf, blitter.x, blitter.y); // crashes mame! |
| r5613 | r5614 | |
|---|---|---|
| 42 | 42 | 2008-07 |
| 43 | 43 | Added Dip Locations based on Service Mode |
| 44 | 44 | |
| 45 | ||
| 46 | Is this based on some Seta / Taito HW design, the sprite-tilemaps look familiar | |
| 47 | ||
| 45 | 48 | */ |
| 46 | 49 | |
| 47 | 50 | #include "driver.h" |
| r5613 | r5614 | |
| 57 | 60 | static UINT16* blackt96_tilemapram; |
| 58 | 61 | static UINT16* blackt96_tilemapram2; |
| 59 | 62 | |
| 60 | static | |
| 63 | static void draw_strip | |
| 61 | 64 | { |
| 62 | int y,x; | |
| 65 | const gfx_element *gfxspr = machine->gfx[1]; | |
| 66 | const gfx_element *gfxbg = machine->gfx[0]; | |
| 67 | ||
| 68 | int base = stripnum; | |
| 63 | 69 | int count = 0; |
| 64 | int base; | |
| 65 | const gfx_element *gfx = screen->machine->gfx[2]; | |
| 66 | const gfx_element *gfxbg = screen->machine->gfx[0]; | |
| 67 | const gfx_element *gfxspr = screen->machine->gfx[1]; | |
| 70 | int y; | |
| 68 | 71 | |
| 69 | count = 0; | |
| 70 | for (x=0;x<64;x++) | |
| 72 | for (y=0;y<32;y++) | |
| 71 | 73 | { |
| 72 | for (y=0;y<32;y++) | |
| 73 | { | |
| 74 | UINT16 tile = (blackt96_tilemapram2[count*2 + (0x2000/2)+1]); | |
| 75 | drawgfx_opaque(bitmap,cliprect,gfxbg,tile,6,0,0,x*16,y*16); | |
| 76 | count++; | |
| 77 | } | |
| 78 | } | |
| 74 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x3fff); | |
| 75 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 76 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x00ff); | |
| 79 | 77 | |
| 80 | /* the sprite are arranged in tilemaps.. I don't know how this works yet */ | |
| 81 | count = 0; | |
| 82 | base = 0x1000; | |
| 83 | for (x=0;x<32;x++) | |
| 84 | { | |
| 85 | for (y=0;y<32;y++) | |
| 78 | if (tile&0x2000) | |
| 86 | 79 | { |
| 87 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x1fff); | |
| 88 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 89 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; | |
| 90 | ||
| 91 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0); | |
| 92 | count++; | |
| 80 | if (bg) drawgfx_transpen(bitmap,cliprect,gfxbg,tile&0x1fff,colour>>4,flipx,0,xbase,ybase+y*16,0); | |
| 93 | 81 | } |
| 94 | } | |
| 95 | count = 0; | |
| 96 | base = 0x1800; | |
| 97 | for (x=0;x<32;x++) | |
| 98 | { | |
| 99 | for (y=0;y<32;y++) | |
| 82 | else | |
| 100 | 83 | { |
| 101 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x1fff); | |
| 102 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 103 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; | |
| 104 | ||
| 105 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0); | |
| 106 | count++; | |
| 84 | if (!bg) drawgfx_transpen(bitmap,cliprect,gfxspr,tile&0x1fff,colour,flipx,0,xbase,ybase+y*16,0); | |
| 107 | 85 | } |
| 108 | } | |
| 109 | count = 0; | |
| 110 | base = 0x3000; | |
| 111 | for (x=0;x<32;x++) | |
| 112 | { | |
| 113 | for (y=0;y<32;y++) | |
| 114 | { | |
| 115 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x1fff); | |
| 116 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 117 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; | |
| 118 | 86 | |
| 119 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0); | |
| 120 | count++; | |
| 121 | } | |
| 87 | count++; | |
| 122 | 88 | } |
| 123 | count = 0; | |
| 124 | base = 0x3800; | |
| 125 | for (x=0;x<32;x++) | |
| 126 | { | |
| 127 | for (y=0;y<32;y++) | |
| 128 | { | |
| 129 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x1fff); | |
| 130 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 131 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; | |
| 132 | 89 | |
| 133 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0); | |
| 134 | count++; | |
| 135 | } | |
| 136 | } | |
| 137 | base = 0x4000; | |
| 138 | for (x=0;x<32;x++) | |
| 139 | { | |
| 140 | for (y=0;y<32;y++) | |
| 141 | { | |
| 142 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x1fff); | |
| 143 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 144 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; | |
| 90 | } | |
| 145 | 91 | |
| 146 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0); | |
| 147 | count++; | |
| 148 | } | |
| 149 | } | |
| 150 | base = 0x4800; | |
| 151 | for (x=0;x<32;x++) | |
| 92 | static void draw_main(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bg) | |
| 93 | { | |
| 94 | ||
| 95 | int x; | |
| 96 | ||
| 97 | ||
| 98 | for (x=(0x1000/2)-2;x>=0;x-=2) | |
| 152 | 99 | { |
| 153 | for (y=0;y<32;y++) | |
| 154 | { | |
| 155 | UINT16 tile = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x1fff); | |
| 156 | UINT16 flipx = (blackt96_tilemapram2[count*2 + (base/2)+1]&0x4000); | |
| 157 | UINT16 colour = (blackt96_tilemapram2[count*2 + (base/2)]&0x000f)+0x10; | |
| 100 | int xx; | |
| 101 | int yy; | |
| 102 | int s = 0; | |
| 158 | 103 | |
| 159 | drawgfx_transpen(bitmap,cliprect,gfxspr,tile,colour,flipx,0,x*16,y*16,0); | |
| 160 | count++; | |
| 161 | } | |
| 104 | xx= ((blackt96_tilemapram2[x+0]&0x001f)<<4) | (blackt96_tilemapram2[x+1]&0xf000)>>12; | |
| 105 | yy = ((blackt96_tilemapram2[x+1]&0x1ff)); | |
| 106 | ||
| 107 | if (xx&0x100) xx-=0x200; | |
| 108 | yy = 0x1ff-yy; | |
| 109 | if (yy&0x100) yy-=0x200; | |
| 110 | ||
| 111 | s = x*2; | |
| 112 | s &=0xfff; | |
| 113 | s += (x&7)*0x800; | |
| 114 | ||
| 115 | ||
| 116 | draw_strip(machine,bitmap,cliprect,s,xx,yy,bg); | |
| 162 | 117 | } |
| 163 | 118 | |
| 119 | } | |
| 120 | ||
| 121 | static VIDEO_UPDATE( blackt96 ) | |
| 122 | { | |
| 123 | int count; | |
| 124 | int x,y; | |
| 125 | const gfx_element *gfx = screen->machine->gfx[2]; | |
| 126 | ||
| 127 | bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); | |
| 128 | ||
| 129 | draw_main(screen->machine,bitmap,cliprect,1); | |
| 130 | draw_main(screen->machine,bitmap,cliprect,0); | |
| 131 | ||
| 164 | 132 | /* Text Layer */ |
| 165 | 133 | count = 0; |
| 166 | 134 | for (x=0;x<64;x++) |
| r5613 | r5614 | |
| 168 | 136 | for (y=0;y<32;y++) |
| 169 | 137 | { |
| 170 | 138 | UINT16 tile = (blackt96_tilemapram[count*2]&0x7ff)+0x800; // +0xc00 for korean text |
| 171 | drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8,0); | |
| 139 | drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,-16+y*8,0); | |
| 172 | 140 | count++; |
| 173 | 141 | } |
| 174 | ||
| 175 | 142 | } |
| 176 | 143 | |
| 177 | ||
| 178 | ||
| 179 | ||
| 180 | 144 | return 0; |
| 181 | 145 | } |
| 182 | 146 | |
| r5613 | r5614 | |
| 203 | 167 | AM_RANGE(0x0f0008, 0x0f0009) AM_READ_PORT("DSW2") |
| 204 | 168 | |
| 205 | 169 | AM_RANGE(0x100000, 0x100fff) AM_RAM AM_BASE(&blackt96_tilemapram) // text tilemap |
| 206 | AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(&blackt96_tilemapram2)// sprite list | |
| 170 | AM_RANGE(0x200000, 0x207fff) AM_RAM AM_BASE(&blackt96_tilemapram2)// sprite list + sprite tilemaps | |
| 207 | 171 | AM_RANGE(0x400000, 0x400fff) AM_RAM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) |
| 208 | 172 | AM_RANGE(0xc00000, 0xc03fff) AM_RAM // main ram |
| 209 | 173 | |
| r5613 | r5614 | |
| 443 | 407 | 16,16, |
| 444 | 408 | RGN_FRAC(1,1), |
| 445 | 409 | 4, |
| 446 | { 0, | |
| 410 | { 0,24,8, 16 }, | |
| 447 | 411 | { 519, 515, 518, 514, 517,513, 516,512, 7,3,6,2,5,1,4,0 }, |
| 448 | 412 | { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,8*32,9*32,10*32,11*32,12*32,13*32,14*32,15*32 }, |
| 449 | 413 | 32*32 |
| r5613 | r5614 | |
| 463 | 427 | }; |
| 464 | 428 | |
| 465 | 429 | static GFXDECODE_START( blackt96 ) |
| 466 | GFXDECODE_ENTRY( "gfx1", 0, blackt96_layout, 0x0, 0x10 ) | |
| 430 | GFXDECODE_ENTRY( "gfx1", 0, blackt96_layout, 0x0, 0x10 ) | |
| 467 | 431 | GFXDECODE_ENTRY( "gfx2", 0, blackt962_layout, 0x0, 0x80 ) |
| 468 | 432 | GFXDECODE_ENTRY( "gfx3", 0, blackt963_layout, 0x0, 0x80 ) |
| 469 | 433 | GFXDECODE_END |
| r5613 | r5614 | |
| 486 | 450 | MDRV_SCREEN_REFRESH_RATE(60) |
| 487 | 451 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 488 | 452 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 489 | MDRV_SCREEN_SIZE(6 | |
| 453 | MDRV_SCREEN_SIZE(256 | |
| 490 | 454 | // MDRV_SCREEN_VISIBLE_AREA(0*8, 16*32-1, 0*8, 16*32-1) |
| 491 | MDRV_SCREEN_VISIBLE_AREA(0*8, | |
| 455 | MDRV_SCREEN_VISIBLE_AREA(0*8, | |
| 492 | 456 | |
| 493 | 457 | MDRV_PALETTE_LENGTH(0x800) |
| 494 | 458 |
| r5613 | r5614 | |
|---|---|---|
| 84 | 84 | static CUSTOM_INPUT( hopper_r ) |
| 85 | 85 | { |
| 86 | 86 | if (hopper) return !(video_screen_get_frame_number(field->port->machine->primary_screen)%10); |
| 87 | return input_code_pressed(KEYCODE_H); | |
| 87 | return input_code_pressed(field->port->machine, KEYCODE_H); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | static UINT8 out[3]; |
| r5613 | r5614 | |
|---|---|---|
| 2732 | 2732 | ROM_LOAD( "u11_tms27c256.bin",0x0000, 0x8000, CRC(d6834c3a) SHA1(4b071b9826c086439b9763393b23c671261b3788) ) |
| 2733 | 2733 | ROM_LOAD( "u4_nmc27c256.bin", 0x8000, 0x8000, CRC(41f7a0b3) SHA1(9aff2b8832d2a4f868daa9849a0bfe5e44f88fc0) ) |
| 2734 | 2734 | |
| 2735 | ROM_REGION( 0x0200, "proms", 0 ) /* not present in the set */ | |
| 2736 | ROM_LOAD( "n82s147.bin", 0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) ) | |
| 2735 | ROM_REGION( 0x0200, "proms", 0 ) | |
| 2736 | ROM_LOAD( "n82s147a.bin", 0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) ) | |
| 2737 | 2737 | |
| 2738 | 2738 | ROM_REGION( 0x0200, "plds", 0 ) /* correct PAL dump */ |
| 2739 | 2739 | ROM_LOAD( "palce16v8h_1.bin", 0x0000, 0x0117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) ) |
| r5613 | r5614 | |
| 2765 | 2765 | |
| 2766 | 2766 | ROM_START( magicrd2 ) /* Impera */ |
| 2767 | 2767 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2768 | ||
| 2768 | | |
| 2769 | 2769 | ROM_LOAD( "magicard.01", 0x8000, 0x10000, CRC(c94767d4) SHA1(171ac946bdf2575f9e4a31e534a8e641597af519) ) /* 1st and 2nd half identical */ |
| 2770 | 2770 | |
| 2771 | 2771 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| r5613 | r5614 | |
| 2781 | 2781 | |
| 2782 | 2782 | ROM_START( magicd2a ) /* for green TAB or Impera boards */ |
| 2783 | 2783 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2784 | ||
| 2784 | | |
| 2785 | 2785 | // ROM_LOAD( "mc2prgv2.bin", 0x8000, 0x8000, CRC(b0ed6b40) SHA1(7167e67608f1b0b1cd956c838dacc1310861cb4a) ) |
| 2786 | 2786 | |
| 2787 | 2787 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| r5613 | r5614 | |
| 2798 | 2798 | ROM_START( magicd2b ) /* for blue TAB board (encrypted)*/ |
| 2799 | 2799 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 2800 | 2800 | // ROM_LOAD( "mc2prgv1.bin", 0x8000, 0x8000, CRC(7f759b70) SHA1(23a1a6e8eda57c4a90c51a970302f9a7bf590083) ) |
| 2801 | ||
| 2801 | | |
| 2802 | 2802 | |
| 2803 | 2803 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 2804 | 2804 | ROM_LOAD( "mc2gr1b.bin", 0x0000, 0x8000, CRC(ce2629a7) SHA1(84767ed5da8dcee44a210255537e10372bcc264b) ) |
| r5613 | r5614 | |
| 2877 | 2877 | Seems to be a Big Deal clone. |
| 2878 | 2878 | */ |
| 2879 | 2879 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 2880 | ||
| 2880 | | |
| 2881 | 2881 | ROM_LOAD( "ic37.bin", 0x10000, 0x8000, CRC(8e0d70c4) SHA1(018f92631acbe98e5826a41698f0e07b4b46cd71) ) /* 1st and 2nd half identical */ |
| 2882 | 2882 | ROM_COPY( "maincpu", 0x10000, 0xc000, 0x4000 ) /* rgn, srcoffset, offset, length */ |
| 2883 | 2883 | |
| r5613 | r5614 | |
| 3204 | 3204 | GAME( 1991, royalcrd, 0, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Royal Card (austrian, set 1)", 0 ) |
| 3205 | 3205 | GAME( 1991, royalcdb, royalcrd, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Royal Card (austrian, set 2)", 0 ) |
| 3206 | 3206 | GAME( 1991, royalcdc, royalcrd, royalcrd, royalcrd, 0, ROT0, "Evona Electronic","Royal Card (slovak, encrypted)", GAME_WRONG_COLORS | GAME_NOT_WORKING ) |
| 3207 | GAME( 1993, royalcdp, royalcrd, cuoreuno, royalcrd, 0, ROT0, "Digital Dreams", "Royal Card v2.0 Professional", GAME_ | |
| 3207 | GAME( 1993, royalcdp, royalcrd, cuoreuno, royalcrd, 0, ROT0, "Digital Dreams", "Royal Card v2.0 Professional", GAME_ | |
| 3208 | 3208 | GAME( 1991, lluck3x3, royalcrd, cuoreuno, royalcrd, 0, ROT0, "TAB-Austria", "Lucky Lady (3x3 deal)", 0 ) |
| 3209 | 3209 | GAME( 1991, lluck4x1, royalcrd, royalcrd, royalcrd, 0, ROT0, "TAB-Austria", "Lucky Lady (4x1 aces)", 0 ) |
| 3210 | 3210 | GAME( 1996, magicrd2, 0, magicrd2, magicrd2, 0, ROT0, "Impera", "Magic Card II (bulgarian)", GAME_IMPERFECT_SOUND ) |
| r5613 | r5614 | |
|---|---|---|
| 196 | 196 | static int xxx=0x18f; |
| 197 | 197 | static int yyy=512; |
| 198 | 198 | static int sss=0xa8; |
| 199 | /* | |
| 200 | if ( input_code_pressed_once(KEYCODE_Q) ) | |
| 201 | { | |
| 202 | xxx--; | |
| 203 | mame_printf_debug("xxx %04x\n",xxx); | |
| 204 | } | |
| 205 | 199 | |
| 206 | if ( input_code_pressed_once(KEYCODE_W) ) | |
| 207 | { | |
| 208 | xxx++; | |
| 209 | mame_printf_debug("xxx %04x\n",xxx); | |
| 210 | } | |
| 200 | #if 0 | |
| 201 | if ( input_code_pressed_once(screen->machine, KEYCODE_Q) ) | |
| 202 | { | |
| 203 | xxx--; | |
| 204 | mame_printf_debug("xxx %04x\n",xxx); | |
| 205 | } | |
| 211 | 206 | |
| 212 | if ( input_code_pressed_once(KEYCODE_A) ) | |
| 213 | { | |
| 214 | yyy--; | |
| 215 | mame_printf_debug("yyy %04x\n",yyy); | |
| 216 | } | |
| 207 | if ( input_code_pressed_once(screen->machine, KEYCODE_W) ) | |
| 208 | { | |
| 209 | xxx++; | |
| 210 | mame_printf_debug("xxx %04x\n",xxx); | |
| 211 | } | |
| 217 | 212 | |
| 218 | if ( input_code_pressed_once(KEYCODE_S) ) | |
| 219 | { | |
| 220 | yyy++; | |
| 221 | mame_printf_debug("yyy %04x\n",yyy); | |
| 222 | } | |
| 213 | if ( input_code_pressed_once(screen->machine, KEYCODE_A) ) | |
| 214 | { | |
| 215 | yyy--; | |
| 216 | mame_printf_debug("yyy %04x\n",yyy); | |
| 217 | } | |
| 223 | 218 | |
| 224 | if ( input_code_pressed_once(KEYCODE_Z) ) | |
| 225 | { | |
| 226 | sss--; | |
| 227 | mame_printf_debug("sss %04x\n",sss); | |
| 228 | } | |
| 219 | if ( input_code_pressed_once(screen->machine, KEYCODE_S) ) | |
| 220 | { | |
| 221 | yyy++; | |
| 222 | mame_printf_debug("yyy %04x\n",yyy); | |
| 223 | } | |
| 229 | 224 | |
| 230 | if ( input_code_pressed_once(KEYCODE_X) ) | |
| 231 | { | |
| 232 | sss++; | |
| 233 | mame_printf_debug("sss %04x\n",sss); | |
| 234 | } | |
| 235 | */ | |
| 225 | if ( input_code_pressed_once(screen->machine, KEYCODE_Z) ) | |
| 226 | { | |
| 227 | sss--; | |
| 228 | mame_printf_debug("sss %04x\n",sss); | |
| 229 | } | |
| 236 | 230 | |
| 231 | if ( input_code_pressed_once(screen->machine, KEYCODE_X) ) | |
| 232 | { | |
| 233 | sss++; | |
| 234 | mame_printf_debug("sss %04x\n",sss); | |
| 235 | } | |
| 236 | #endif | |
| 237 | 237 | |
| 238 | ||
| 238 | 239 | count=sss; |
| 239 | 240 | |
| 240 | 241 | for(y=0;y<yyy;y++) |
| r5613 | r5614 | |
|---|---|---|
| 38 | 38 | UINT8 diff = data ^ jamma_if_control_latch; |
| 39 | 39 | jamma_if_control_latch = data; |
| 40 | 40 | |
| 41 | sound_global_enable( (data >> 7) & 1 ); | |
| 41 | sound_global_enable( space->machine, (data >> 7) & 1 ); | |
| 42 | 42 | |
| 43 | 43 | if ( diff & 0x40 ) |
| 44 | 44 | { |
| r5613 | r5614 | |
|---|---|---|
| 160 | 160 | int layers_ctrl = -1; |
| 161 | 161 | |
| 162 | 162 | #if DARKHORS_DEBUG |
| 163 | if (input_code_pressed(KEYCODE_Z)) | |
| 163 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 164 | 164 | { |
| 165 | 165 | int mask = 0; |
| 166 | if (input_code_pressed(KEYCODE_Q)) mask |= 1; | |
| 167 | if (input_code_pressed(KEYCODE_W)) mask |= 2; | |
| 168 | if (input_code_pressed(KEYCODE_A)) mask |= 4; | |
| 166 | if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1; | |
| 167 | if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2; | |
| 168 | if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4; | |
| 169 | 169 | if (mask != 0) layers_ctrl &= mask; |
| 170 | 170 | } |
| 171 | 171 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 236 | 236 | int y; |
| 237 | 237 | |
| 238 | 238 | #ifdef MAME_DEBUG |
| 239 | if (input_code_pressed(KEYCODE_Z)) | |
| 239 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 240 | 240 | { |
| 241 | 241 | int msk = 0; |
| 242 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 243 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 242 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 243 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 244 | 244 | if (msk != 0) layers_ctrl &= msk; |
| 245 | 245 | } |
| 246 | 246 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 90 | 90 | int layers_ctrl = -1; |
| 91 | 91 | |
| 92 | 92 | #ifdef MAME_DEBUG |
| 93 | if (input_code_pressed(KEYCODE_Z)) | |
| 93 | if (input_code_pressed(screen->machine, KEYCODE_Z)) | |
| 94 | 94 | { |
| 95 | 95 | int msk = 0; |
| 96 | if (input_code_pressed(KEYCODE_Q)) msk |= 1; | |
| 97 | if (input_code_pressed(KEYCODE_W)) msk |= 2; | |
| 96 | if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1; | |
| 97 | if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2; | |
| 98 | 98 | if (msk != 0) layers_ctrl &= msk; |
| 99 | 99 | } |
| 100 | 100 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 1006 | 1006 | static MACHINE_RESET( ninjaw ) |
| 1007 | 1007 | { |
| 1008 | 1008 | /**** mixer control enable ****/ |
| 1009 | sound_global_enable( 1 ); /* mixer enabled */ | |
| 1009 | sound_global_enable( machine, 1 ); /* mixer enabled */ | |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 |
| r5613 | r5614 | |
|---|---|---|
| 162 | 162 | |
| 163 | 163 | #if 0 |
| 164 | 164 | /* debug */ |
| 165 | if(input_code_pressed_once(KEYCODE_Q)) | |
| 165 | if(input_code_pressed_once(screen->machine, KEYCODE_Q)) | |
| 166 | 166 | { |
| 167 | 167 | ++xixi; |
| 168 | 168 | printf("%x\n",xixi); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | if(input_code_pressed_once(KEYCODE_W)) | |
| 171 | if(input_code_pressed_once(screen->machine, KEYCODE_W)) | |
| 172 | 172 | { |
| 173 | 173 | --xixi; |
| 174 | 174 | printf("%x\n",xixi); |
| r5613 | r5614 | |
| 259 | 259 | |
| 260 | 260 | memcpy(sprram_old, sprram, 0x80000); |
| 261 | 261 | |
| 262 | if(input_code_pressed_once(KEYCODE_Q)) | |
| 262 | if(input_code_pressed_once(screen->machine, KEYCODE_Q)) | |
| 263 | 263 | { |
| 264 | 264 | FILE *p=fopen("tileram.bin","wb"); |
| 265 | 265 | fwrite(tileram,1,0x100000*16,p); |
| r5613 | r5614 | |
|---|---|---|
| 124 | 124 | { |
| 125 | 125 | static UINT8 res; |
| 126 | 126 | |
| 127 | if(input_code_pressed_once(KEYCODE_Z)) | |
| 127 | if(input_code_pressed_once(space->machine, KEYCODE_Z)) | |
| 128 | 128 | test_mcu++; |
| 129 | 129 | |
| 130 | if(input_code_pressed_once(KEYCODE_X)) | |
| 130 | if(input_code_pressed_once(space->machine, KEYCODE_X)) | |
| 131 | 131 | test_mcu--; |
| 132 | 132 | |
| 133 | 133 | if(mcu_ram.access_ram_r) |
| r5613 | r5614 | |
|---|---|---|
| 335 | 335 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_BASE(&nmk16_mainram) |
| 336 | 336 | ADDRESS_MAP_END |
| 337 | 337 | |
| 338 | static ADDRESS_MAP_START( vandykeb_map, ADDRESS_SPACE_PROGRAM, 16 ) | |
| 339 | AM_RANGE(0x000000, 0x03ffff) AM_ROM | |
| 340 | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") | |
| 341 | AM_RANGE(0x080002, 0x080003) AM_READ_PORT("IN1") | |
| 342 | AM_RANGE(0x080008, 0x080009) AM_READ_PORT("DSW1") | |
| 343 | AM_RANGE(0x08000a, 0x08000b) AM_READ_PORT("DSW2") | |
| 344 | AM_RANGE(0x08000e, 0x08000f) AM_READ(NMK004_r) | |
| 345 | AM_RANGE(0x080016, 0x080017) AM_WRITENOP /* IRQ enable? */ | |
| 346 | AM_RANGE(0x080018, 0x080019) AM_WRITE(nmk_tilebank_w) | |
| 347 | AM_RANGE(0x080010, 0x08001d) AM_WRITE(vandykeb_scroll_w) /* 10, 12, 1a, 1c */ | |
| 348 | AM_RANGE(0x08001e, 0x08001f) AM_WRITE(NMK004_w) | |
| 349 | AM_RANGE(0x088000, 0x0887ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16) | |
| 350 | AM_RANGE(0x08c000, 0x08c007) AM_WRITENOP /* just in case... */ | |
| 351 | AM_RANGE(0x090000, 0x093fff) AM_RAM_WRITE(nmk_bgvideoram0_w) AM_BASE(&nmk_bgvideoram0) | |
| 352 | AM_RANGE(0x094000, 0x097fff) AM_RAM /* what is this? */ | |
| 353 | AM_RANGE(0x09d000, 0x09d7ff) AM_RAM_WRITE(nmk_txvideoram_w) AM_BASE(&nmk_txvideoram) | |
| 354 | AM_RANGE(0x0f0000, 0x0fffff) AM_RAM AM_BASE(&nmk16_mainram) | |
| 355 | ADDRESS_MAP_END | |
| 356 | ||
| 338 | 357 | static ADDRESS_MAP_START( manybloc_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 339 | 358 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 340 | 359 | AM_RANGE(0x080000, 0x080001) AM_READ_PORT("IN0") |
| r5613 | r5614 | |
| 1188 | 1207 | PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) ) |
| 1189 | 1208 | INPUT_PORTS_END |
| 1190 | 1209 | |
| 1210 | static INPUT_PORTS_START( vandykeb ) | |
| 1211 | PORT_INCLUDE( vandyke ) | |
| 1212 | ||
| 1213 | PORT_MODIFY("IN0") | |
| 1214 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* Tested on boot */ | |
| 1215 | INPUT_PORTS_END | |
| 1216 | ||
| 1191 | 1217 | static INPUT_PORTS_START( blkheart ) |
| 1192 | 1218 | PORT_START("IN0") |
| 1193 | 1219 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) |
| r5613 | r5614 | |
| 3771 | 3797 | |
| 3772 | 3798 | /* basic machine hardware */ |
| 3773 | 3799 | MDRV_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */ |
| 3774 | MDRV_CPU_PROGRAM_MAP(vandyke_map) | |
| 3800 | MDRV_CPU_PROGRAM_MAP(vandykeb_map) | |
| 3775 | 3801 | MDRV_CPU_VBLANK_INT_HACK(nmk_interrupt,2) |
| 3776 | 3802 | MDRV_CPU_PERIODIC_INT(irq1_line_hold,112)/* ???????? */ |
| 3777 | 3803 | |
| r5613 | r5614 | |
| 5129 | 5155 | |
| 5130 | 5156 | ROM_REGION( 0x080000, "gfx2", 0 ) |
| 5131 | 5157 | ROM_LOAD( "4.bin", 0x000000, 0x040000, CRC(4ba4138d) SHA1(56f9c9422085eaf74ddec8977663a33c122b7e8b) ) /* 16x16 tiles */ |
| 5132 | ROM_LOAD( "5.bin", 0x0 | |
| 5158 | ROM_LOAD( "5.bin", 0x040000, 0x040000, CRC(9a1ac697) SHA1(a8200b10606edf4578c7e2f53a0046bb1209a041) ) /* 16x16 tiles */ | |
| 5133 | 5159 | |
| 5134 | 5160 | ROM_REGION( 0x200000, "gfx3", 0 ) |
| 5135 | 5161 | ROM_LOAD16_BYTE( "13.bin", 0x000000, 0x040000, CRC(bb561871) SHA1(33dcaf956112181eed531320d3ececb90b17a599) ) /* Sprites */ |
| 5162 | ROM_LOAD16_BYTE( "17.bin", 0x000001, 0x040000, CRC(346e3b66) SHA1(34df7167ed4048e1f236e7d8fa6dcdffb0965c71) ) /* Sprites */ | |
| 5136 | 5163 | ROM_LOAD16_BYTE( "12.bin", 0x080000, 0x040000, CRC(cdef9b17) SHA1(ec024a21685b87c82dc574cd050118d856a3cf57) ) /* Sprites */ |
| 5137 | ROM_LOAD16_BYTE( "17.bin", 0x000001, 0x040000, CRC(346e3b66) SHA1(34df7167ed4048e1f236e7d8fa6dcdffb0965c71) ) /* Sprites */ | |
| 5138 | 5164 | ROM_LOAD16_BYTE( "16.bin", 0x080001, 0x040000, CRC(beda678c) SHA1(3dfb8763241a97b9d65113c6eb99b52ec5245cd6) ) /* Sprites */ |
| 5139 | 5165 | ROM_LOAD16_BYTE( "11.bin", 0x100000, 0x020000, CRC(823185d9) SHA1(eaf0f3ab0921d894eb1d09d5b2e9d5b785928804) ) /* Sprites */ |
| 5166 | ROM_LOAD16_BYTE( "15.bin", 0x100001, 0x020000, CRC(149f3247) SHA1(5f515cb10468da048c89b543807280bd3e39e45a) ) /* Sprites */ | |
| 5140 | 5167 | ROM_LOAD16_BYTE( "10.bin", 0x140000, 0x020000, CRC(388b1abc) SHA1(9d1c43070130672a5e1a41807d796c944b0676ae) ) /* Sprites */ |
| 5141 | ROM_LOAD16_BYTE( "15.bin", 0x100001, 0x020000, CRC(149f3247) SHA1(5f515cb10468da048c89b543807280bd3e39e45a) ) /* Sprites */ | |
| 5142 | 5168 | ROM_LOAD16_BYTE( "14.bin", 0x140001, 0x020000, CRC(32eeba37) SHA1(0d0218e864ed647bd33bbe379f0ef76ccefbd06c) ) /* Sprites */ |
| 5143 | 5169 | |
| 5144 | 5170 | ROM_REGION( 0x0a0000, "oki1", 0 ) /* OKIM6295 samples */ |
| r5613 | r5614 | |
| 7100 | 7126 | GAME( 1990, vandyke, 0, vandyke, vandyke, 0, ROT270, "UPL", "Vandyke (Japan)", GAME_IMPERFECT_SOUND ) |
| 7101 | 7127 | GAME( 1990, vandykejal, vandyke, vandyke, vandyke, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, Set 1)", GAME_IMPERFECT_SOUND ) |
| 7102 | 7128 | GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, Set 2)", GAME_IMPERFECT_SOUND ) |
| 7103 | GAME( 1990, vandykeb, | |
| 7129 | GAME( 1990, vandykeb, | |
| 7104 | 7130 | |
| 7105 | 7131 | GAME( 1991, blkheart, 0, blkheart, blkheart, 0, ROT0, "UPL", "Black Heart", GAME_IMPERFECT_SOUND ) |
| 7106 | 7132 | GAME( 1991, blkheartj,blkheart, blkheart, blkheart, 0, ROT0, "UPL", "Black Heart (Japan)", GAME_IMPERFECT_SOUND ) |
| r5613 | r5614 | |
|---|---|---|
| 239 | 239 | state->flip = ~data & 0x10; |
| 240 | 240 | |
| 241 | 241 | if (!(input_port_read(space->machine, "CAB") & 0x02)) |
| 242 | sound_global_enable(~data & 0x80); | |
| 242 | sound_global_enable(space->machine, ~data & 0x80); | |
| 243 | 243 | |
| 244 | 244 | /* sound command in lower 4 bytes */ |
| 245 | 245 | switch (data & 0x07) |
| r5613 | r5614 | |
| 315 | 315 | state->flip = ~data & 0x10; |
| 316 | 316 | |
| 317 | 317 | if (!(input_port_read(space->machine, "CAB") & 0x02)) |
| 318 | sound_global_enable(~data & 0x80); | |
| 318 | sound_global_enable(space->machine, ~data & 0x80); | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /* |
| r5613 | r5614 | |
| 344 | 344 | if (input_port_read(space->machine, "CAB") & 0x01) |
| 345 | 345 | state->flip = ~data & 0x04; |
| 346 | 346 | if (!(input_port_read(space->machine, "CAB") & 0x02)) |
| 347 | sound_global_enable(~data & 0x08); | |
| 347 | sound_global_enable(space->machine, ~data & 0x08); | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 |
| r5613 | r5614 | |
|---|---|---|
| 53 | 53 | UINT8 norawbytes; |
| 54 | 54 | UINT8 lower; |
| 55 | 55 | UINT8 upper; |
| 56 | int mode; | |
| 56 | 57 | const dasm_table_entry *dasm; |
| 57 | 58 | }; |
| 58 | 59 | |
| r5613 | r5614 | |
| 173 | 174 | CPU_DISASSEMBLE( z180 ); |
| 174 | 175 | CPU_DISASSEMBLE( z8000 ); |
| 175 | 176 | CPU_DISASSEMBLE( z80 ); |
| 177 | CPU_DISASSEMBLE( z8 ); | |
| 176 | 178 | |
| 177 | 179 | |
| 178 | 180 | static const dasm_table_entry dasm_table[] = |
| r5613 | r5614 | |
| 295 | 297 | { "z180", _8bit, 0, CPU_DISASSEMBLE_NAME(z180) }, |
| 296 | 298 | // { "z8000", _16be, 0, CPU_DISASSEMBLE_NAME(z8000) }, |
| 297 | 299 | { "z80", _8bit, 0, CPU_DISASSEMBLE_NAME(z80) }, |
| 300 | { "z8", _8bit, 0, CPU_DISASSEMBLE_NAME(z8) }, | |
| 298 | 301 | }; |
| 299 | 302 | |
| 300 | 303 | |
| r5613 | r5614 | |
| 327 | 330 | { |
| 328 | 331 | int pending_base = FALSE; |
| 329 | 332 | int pending_arch = FALSE; |
| 333 | int pending_mode = FALSE; | |
| 330 | 334 | int curarch; |
| 331 | 335 | int numrows; |
| 332 | 336 | int arg; |
| r5613 | r5614 | |
| 341 | 345 | // is it a switch? |
| 342 | 346 | if (curarg[0] == '-') |
| 343 | 347 | { |
| 344 | if (pending_base || pending_arch) | |
| 348 | if (pending_base || pending_arch || pending_mode) | |
| 345 | 349 | goto usage; |
| 346 | 350 | |
| 347 | if (tolower(curarg[1]) == 'a') | |
| 351 | if (tolower((UINT8)curarg[1]) == 'a') | |
| 348 | 352 | pending_arch = TRUE; |
| 349 | else if (tolower(curarg[1]) == 'b') | |
| 353 | else if (tolower((UINT8)curarg[1]) == 'b') | |
| 350 | 354 | pending_base = TRUE; |
| 351 | else if (tolower(curarg[1]) == 'l') | |
| 355 | else if (tolower((UINT8)curarg[1]) == 'l') | |
| 352 | 356 | opts->lower = TRUE; |
| 353 | else if (tolower(curarg[1]) == 'n') | |
| 357 | else if (tolower((UINT8)curarg[1]) == 'm') | |
| 358 | pending_mode = TRUE; | |
| 359 | else if (tolower((UINT8)curarg[1]) == 'n') | |
| 354 | 360 | opts->norawbytes = TRUE; |
| 355 | else if (tolower(curarg[1]) == 'u') | |
| 361 | else if (tolower((UINT8)curarg[1]) == 'u') | |
| 356 | 362 | opts->upper = TRUE; |
| 357 | 363 | else |
| 358 | 364 | goto usage; |
| r5613 | r5614 | |
| 361 | 367 | // base PC |
| 362 | 368 | else if (pending_base) |
| 363 | 369 | { |
| 370 | int result; | |
| 364 | 371 | if (curarg[0] == '0' && curarg[1] == 'x') |
| 365 | sscanf(&curarg[2], "%x", &opts->basepc); | |
| 372 | result = sscanf(&curarg[2], "%x", &opts->basepc); | |
| 366 | 373 | else if (curarg[0] == '$') |
| 367 | sscanf(&curarg[1], "%x", &opts->basepc); | |
| 374 | result = sscanf(&curarg[1], "%x", &opts->basepc); | |
| 368 | 375 | else |
| 369 | sscanf(&curarg[0], "%x", &opts->basepc); | |
| 376 | result = sscanf(&curarg[0], "%x", &opts->basepc); | |
| 377 | if (result != 1) | |
| 378 | goto usage; | |
| 370 | 379 | pending_base = FALSE; |
| 371 | 380 | } |
| 372 | 381 | |
| 382 | // mode | |
| 383 | else if (pending_mode) | |
| 384 | { | |
| 385 | if (sscanf(curarg, "%d", &opts->mode) != 1) | |
| 386 | goto usage; | |
| 387 | pending_mode = FALSE; | |
| 388 | } | |
| 389 | ||
| 373 | 390 | // architecture |
| 374 | 391 | else if (pending_arch) |
| 375 | 392 | { |
| r5613 | r5614 | |
| 391 | 408 | goto usage; |
| 392 | 409 | } |
| 393 | 410 | |
| 411 | // if we have a dangling option, error | |
| 412 | if (pending_base || pending_arch || pending_mode) | |
| 413 | goto usage; | |
| 414 | ||
| 394 | 415 | // if no file or no architecture, fail |
| 395 | 416 | if (opts->filename == NULL || opts->dasm == NULL) |
| 396 | 417 | goto usage; |
| 397 | 418 | return 0; |
| 398 | 419 | |
| 399 | 420 | usage: |
| 400 | printf("Usage: %s <filename> -arch <architecture> [-basepc <pc>] [-norawbytes] [-upper] [-lower]\n", argv[0]); | |
| 421 | printf("Usage: %s <filename> -arch <architecture> [-basepc <pc>] [-mode <n>] [-norawbytes] [-upper] [-lower]\n", argv[0]); | |
| 401 | 422 | printf("\n"); |
| 402 | 423 | printf("Supported architectures:"); |
| 403 | 424 | numrows = (ARRAY_LENGTH(dasm_table) + 6) / 7; |
| r5613 | r5614 | |
| 461 | 482 | int numchunks; |
| 462 | 483 | |
| 463 | 484 | // disassemble |
| 464 | pcdelta = (*opts.dasm->func)(NULL, buffer, curpc, oprom, oprom) & DASMFLAG_LENGTHMASK; | |
| 485 | pcdelta = (*opts.dasm->func)(NULL, buffer, curpc, oprom, oprom, opts.mode) & DASMFLAG_LENGTHMASK; | |
| 465 | 486 | if (opts.dasm->pcshift < 0) |
| 466 | 487 | numbytes = pcdelta << -opts.dasm->pcshift; |
| 467 | 488 | else |
| r5613 | r5614 | |
| 497 | 518 | if (opts.lower) |
| 498 | 519 | { |
| 499 | 520 | for (p = buffer; *p != 0; p++) |
| 500 | *p = tolower(*p); | |
| 501 | } else if (opts.upper) | |
| 521 | *p = tolower((UINT8)*p); | |
| 522 | } | |
| 523 | else if (opts.upper) | |
| 502 | 524 | { |
| 503 | 525 | for (p = buffer; *p != 0; p++) |
| 504 | *p = toupper(*p); | |
| 526 | *p = toupper((UINT8)*p); | |
| 505 | 527 | } |
| 506 | 528 | printf("%s\n", buffer); |
| 507 | 529 | |
| r5613 | r5614 | |
| 526 | 548 | |
| 527 | 549 | // advance |
| 528 | 550 | curpc += pcdelta; |
| 529 | curbyte += numbytes; | |
| 530 | 551 | } |
| 531 | 552 | |
| 532 | 553 | return 0; |
| r5613 | r5614 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | //============================================================ |
| 37 | // | |
| 37 | // get_profile | |
| 38 | 38 | //============================================================ |
| 39 | 39 | |
| 40 | osd_ticks_t | |
| 40 | osd_ticks_t get_profile | |
| 41 | 41 | { |
| 42 | 42 | // on x86 platforms, we should return the value of RDTSC here |
| 43 | 43 | // generically, we fall back to clock(), which hopefully is |
| r5613 | r5614 | |
|---|---|---|
| 352 | 352 | -----------------------------------------------------------------------------*/ |
| 353 | 353 | osd_ticks_t osd_ticks(void); |
| 354 | 354 | |
| 355 | ||
| 356 | 355 | /*----------------------------------------------------------------------------- |
| 357 | 356 | osd_ticks_per_second: return the number of ticks per second |
| 358 | 357 | |
| r5613 | r5614 | |
| 367 | 366 | -----------------------------------------------------------------------------*/ |
| 368 | 367 | osd_ticks_t osd_ticks_per_second(void); |
| 369 | 368 | |
| 370 | ||
| 371 | 369 | /*----------------------------------------------------------------------------- |
| 372 | osd_profiling_ticks: return the current running "profiling" tick counter | |
| 373 | ||
| 374 | Parameters: | |
| 375 | ||
| 376 | None | |
| 377 | ||
| 378 | Return value: | |
| 379 | ||
| 380 | an osd_ticks_t value which represents the current "profiling" tick | |
| 381 | counter | |
| 382 | ||
| 383 | Notes: | |
| 384 | ||
| 385 | The profiling tick counter may or may not be different from the | |
| 386 | regular tick counter. However, the profiling counter has differing | |
| 387 | requirements. First, it must be as fast as possible, so as not to | |
| 388 | perturb profiling measurements in a significant way. Second, it | |
| 389 | should be a high resolution as possible to provide accurate short- | |
| 390 | term measurements (1us resolution or better is ideal). Third, it | |
| 391 | is not necessary to calibrate the timing (hence the lack of an | |
| 392 | osd_profiling_ticks_per_second call). | |
| 393 | ||
| 394 | On x86 system, this generally maps to an RDTSC instruction. | |
| 395 | -----------------------------------------------------------------------------*/ | |
| 396 | osd_ticks_t osd_profiling_ticks(void); | |
| 397 | ||
| 398 | ||
| 399 | /*----------------------------------------------------------------------------- | |
| 400 | 370 | osd_sleep: sleep for the specified time interval |
| 401 | 371 | |
| 402 | 372 | Parameters: |
| r5613 | r5614 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | //============================================================ |
| 80 | // osd_profiling_ticks | |
| 81 | //============================================================ | |
| 82 | ||
| 83 | #ifdef _MSC_VER | |
| 84 | ||
| 85 | #ifdef PTR64 | |
| 86 | ||
| 87 | osd_ticks_t osd_profiling_ticks(void) | |
| 88 | { | |
| 89 | return __rdtsc(); | |
| 90 | } | |
| 91 | ||
| 92 | #else | |
| 93 | ||
| 94 | osd_ticks_t osd_profiling_ticks(void) | |
| 95 | { | |
| 96 | INT64 result; | |
| 97 | INT64 *presult = &result; | |
| 98 | ||
| 99 | __asm { | |
| 100 | __asm _emit 0Fh __asm _emit 031h // rdtsc | |
| 101 | mov ebx, presult | |
| 102 | mov [ebx],eax | |
| 103 | mov [ebx+4],edx | |
| 104 | } | |
| 105 | ||
| 106 | return result; | |
| 107 | } | |
| 108 | ||
| 109 | #endif | |
| 110 | ||
| 111 | #else | |
| 112 | ||
| 113 | osd_ticks_t osd_profiling_ticks(void) | |
| 114 | { | |
| 115 | INT64 result; | |
| 116 | ||
| 117 | // use RDTSC | |
| 118 | __asm__ __volatile__ ( | |
| 119 | "rdtsc" | |
| 120 | : "=A" (result) | |
| 121 | ); | |
| 122 | ||
| 123 | return result; | |
| 124 | } | |
| 125 | ||
| 126 | #endif | |
| 127 | ||
| 128 | ||
| 129 | //============================================================ | |
| 130 | 80 | // osd_sleep |
| 131 | 81 | //============================================================ |
| 132 | 82 |
| r5613 | r5614 | |
|---|---|---|
| 538 | 538 | winwindow_process_events_periodic(machine); |
| 539 | 539 | |
| 540 | 540 | // track if mouse/lightgun is enabled, for mouse hiding purposes |
| 541 | mouse_enabled = input_device_class_enabled(DEVICE_CLASS_MOUSE); | |
| 542 | lightgun_enabled = input_device_class_enabled(DEVICE_CLASS_LIGHTGUN); | |
| 541 | mouse_enabled = input_device_class_enabled(machine, DEVICE_CLASS_MOUSE); | |
| 542 | lightgun_enabled = input_device_class_enabled(machine, DEVICE_CLASS_LIGHTGUN); | |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | // poll all of the devices |
| r5613 | r5614 | |
|---|---|---|
| 44 | 44 | |
| 45 | 45 | #if KEEP_STATISTICS |
| 46 | 46 | #define add_to_stat(v,x) do { interlocked_add((v), (x)); } while (0) |
| 47 | #define begin_timing(v) do { (v) -= osd_profiling_ticks(); } while (0) | |
| 48 | #define end_timing(v) do { (v) += osd_profiling_ticks(); } while (0) | |
| 47 | #define begin_timing(v) do { (v) -= get_profile_ticks(); } while (0) | |
| 48 | #define end_timing(v) do { (v) += get_profile_ticks(); } while (0) | |
| 49 | 49 | #else |
| 50 | 50 | #define add_to_stat(v,x) do { } while (0) |
| 51 | 51 | #define begin_timing(v) do { } while (0) |
| r5613 | r5614 | |
|---|---|---|
| 460 | 460 | } |
| 461 | 461 | #endif |
| 462 | 462 | |
| 463 | ||
| 464 | ||
| 465 | /*************************************************************************** | |
| 466 | INLINE TIMING FUNCTIONS | |
| 467 | ***************************************************************************/ | |
| 468 | ||
| 469 | /*------------------------------------------------- | |
| 470 | get_profile_ticks - return a tick counter | |
| 471 | from the processor that can be used for | |
| 472 | profiling. It does not need to run at any | |
| 473 | particular rate. | |
| 474 | -------------------------------------------------*/ | |
| 475 | ||
| 476 | #define get_profile_ticks _get_profile_ticks | |
| 477 | ||
| 478 | #ifdef PTR64 | |
| 479 | ||
| 480 | INLINE osd_ticks_t _get_profile_ticks(void) | |
| 481 | { | |
| 482 | return __rdtsc(); | |
| 483 | } | |
| 484 | ||
| 485 | #else | |
| 486 | ||
| 487 | INLINE osd_ticks_t _get_profile_ticks(void) | |
| 488 | { | |
| 489 | INT64 result; | |
| 490 | INT64 *presult = &result; | |
| 491 | ||
| 492 | __asm { | |
| 493 | __asm _emit 0Fh __asm _emit 031h // rdtsc | |
| 494 | mov ebx, presult | |
| 495 | mov [ebx],eax | |
| 496 | mov [ebx+4],edx | |
| 497 | } | |
| 498 | ||
| 499 | return result; | |
| 500 | } | |
| 501 | ||
| 502 | #endif | |
| 503 | ||
| 463 | 504 | #endif /* __EIVCX86__ */ |
| r5613 | r5614 | |
|---|---|---|
| 708 | 708 | const char *seq_string; |
| 709 | 709 | |
| 710 | 710 | seq_string = options_get_string(opts, name); |
| 711 | input_seq_from_tokens(seq_string, &seq); | |
| 711 | input_seq_from_tokens(NULL, seq_string, &seq); // HACK | |
| 712 | 712 | return &seq; |
| 713 | 713 | } |
| 714 | 714 |
| r5613 | r5614 | |
|---|---|---|
| 391 | 391 | |
| 392 | 392 | /* check for disassembler override */ |
| 393 | 393 | if (info->dasm_override != NULL) |
| 394 | result = (*info->dasm_override)(device, buffer, pc, oprom, opram); | |
| 394 | result = (*info->dasm_override)(device, buffer, pc, oprom, opram, 0); | |
| 395 | 395 | |
| 396 | 396 | /* if we have a disassembler, run it */ |
| 397 | 397 | if (result == 0 && info->disassemble != NULL) |
| 398 | result = (*info->disassemble)(device, buffer, pc, oprom, opram); | |
| 398 | result = (*info->disassemble)(device, buffer, pc, oprom, opram, 0); | |
| 399 | 399 | |
| 400 | 400 | /* if we still have nothing, output vanilla bytes */ |
| 401 | 401 | if (result == 0) |
| r5613 | r5614 | |
| 669 | 669 | debugger_refresh_display(device->machine); |
| 670 | 670 | |
| 671 | 671 | /* wait for the debugger; during this time, disable sound output */ |
| 672 | sound_mute(TRUE); | |
| 672 | sound_mute(device->machine, TRUE); | |
| 673 | 673 | while (global->execution_state == EXECUTION_STATE_STOPPED) |
| 674 | 674 | { |
| 675 | 675 | /* flush any pending updates before waiting again */ |
| r5613 | r5614 | |
| 694 | 694 | if (mame_is_scheduled_event_pending(device->machine)) |
| 695 | 695 | global->execution_state = EXECUTION_STATE_RUNNING; |
| 696 | 696 | } |
| 697 | sound_mute(FALSE); | |
| 697 | sound_mute(device->machine, FALSE); | |
| 698 | 698 | |
| 699 | 699 | /* remember the last visible CPU in the debugger */ |
| 700 | 700 | global->visiblecpu = device; |
| r5613 | r5614 | |
| 1531 | 1531 | |
| 1532 | 1532 | |
| 1533 | 1533 | /*------------------------------------------------- |
| 1534 | debug_read_memory - return 1,2,4 or 8 bytes | |
| 1535 | from the specified memory space | |
| 1536 | -------------------------------------------------*/ | |
| 1537 | ||
| 1538 | UINT64 debug_read_memory(const address_space *space, offs_t address, int size, int apply_translation) | |
| 1539 | { | |
| 1540 | UINT64 result = ~(UINT64)0 >> (64 - 8*size); | |
| 1541 | switch (size) | |
| 1542 | { | |
| 1543 | case 1: result = debug_read_byte(space, address, apply_translation); break; | |
| 1544 | case 2: result = debug_read_word(space, address, apply_translation); break; | |
| 1545 | case 4: result = debug_read_dword(space, address, apply_translation); break; | |
| 1546 | case 8: result = debug_read_qword(space, address, apply_translation); break; | |
| 1547 | } | |
| 1548 | return result; | |
| 1549 | } | |
| 1550 | ||
| 1551 | ||
| 1552 | /*------------------------------------------------- | |
| 1534 | 1553 | debug_write_byte - write a byte to the |
| 1535 | 1554 | specified memory space |
| 1536 | 1555 | -------------------------------------------------*/ |
| r5613 | r5614 | |
| 1727 | 1746 | |
| 1728 | 1747 | |
| 1729 | 1748 | /*------------------------------------------------- |
| 1749 | debug_write_memory - write 1,2,4 or 8 bytes | |
| 1750 | to the specified memory space | |
| 1751 | -------------------------------------------------*/ | |
| 1752 | ||
| 1753 | void debug_write_memory(const address_space *space, offs_t address, UINT64 data, int size, int apply_translation) | |
| 1754 | { | |
| 1755 | switch (size) | |
| 1756 | { | |
| 1757 | case 1: debug_write_byte(space, address, data, apply_translation); break; | |
| 1758 | case 2: debug_write_word(space, address, data, apply_translation); break; | |
| 1759 | case 4: debug_write_dword(space, address, data, apply_translation); break; | |
| 1760 | case 8: debug_write_qword(space, address, data, apply_translation); break; | |
| 1761 | } | |
| 1762 | } | |
| 1763 | ||
| 1764 | ||
| 1765 | /*------------------------------------------------- | |
| 1730 | 1766 | debug_read_opcode - read 1,2,4 or 8 bytes at |
| 1731 | 1767 | the given offset from opcode space |
| 1732 | 1768 | -------------------------------------------------*/ |
| r5613 | r5614 | |
| 2471 | 2507 | UINT64 result = ~(UINT64)0 >> (64 - 8*size); |
| 2472 | 2508 | |
| 2473 | 2509 | if (space != NULL) |
| 2474 | { | |
| 2475 | /* adjust the address into a byte address */ | |
| 2476 | address = memory_address_to_byte(space, address); | |
| 2477 | ||
| 2478 | /* switch contexts and do the read */ | |
| 2479 | switch (size) | |
| 2480 | { | |
| 2481 | case 1: result = debug_read_byte(space, address, TRUE); break; | |
| 2482 | case 2: result = debug_read_word(space, address, TRUE); break; | |
| 2483 | case 4: result = debug_read_dword(space, address, TRUE); break; | |
| 2484 | case 8: result = debug_read_qword(space, address, TRUE); break; | |
| 2485 | } | |
| 2486 | } | |
| 2510 | result = debug_read_memory(space, memory_address_to_byte(space, address), size, TRUE); | |
| 2487 | 2511 | return result; |
| 2488 | 2512 | } |
| 2489 | 2513 | |
| r5613 | r5614 | |
| 2677 | 2701 | static void expression_write_address_space(const address_space *space, offs_t address, int size, UINT64 data) |
| 2678 | 2702 | { |
| 2679 | 2703 | if (space != NULL) |
| 2680 | { | |
| 2681 | /* adjust the address into a byte address */ | |
| 2682 | address = memory_address_to_byte(space, address); | |
| 2683 | ||
| 2684 | /* switch contexts and do the write */ | |
| 2685 | switch (size) | |
| 2686 | { | |
| 2687 | case 1: debug_write_byte(space, address, data, TRUE); break; | |
| 2688 | case 2: debug_write_word(space, address, data, TRUE); break; | |
| 2689 | case 4: debug_write_dword(space, address, data, TRUE); break; | |
| 2690 | case 8: debug_write_qword(space, address, data, TRUE); break; | |
| 2691 | } | |
| 2692 | } | |
| 2704 | debug_write_memory(space, memory_address_to_byte(space, address), data, size, TRUE); | |
| 2693 | 2705 | } |
| 2694 | 2706 | |
| 2695 | 2707 |
| r5613 | r5614 | |
|---|---|---|
| 336 | 336 | /* return a qword from the the specified memory space */ |
| 337 | 337 | UINT64 debug_read_qword(const address_space *space, offs_t address, int apply_translation); |
| 338 | 338 | |
| 339 | /* return 1,2,4 or 8 bytes from the specified memory space */ | |
| 340 | UINT64 debug_read_memory(const address_space *space, offs_t address, int size, int apply_translation); | |
| 341 | ||
| 339 | 342 | /* write a byte to the specified memory space */ |
| 340 | 343 | void debug_write_byte(const address_space *space, offs_t address, UINT8 data, int apply_translation); |
| 341 | 344 | |
| r5613 | r5614 | |
| 348 | 351 | /* write a qword to the specified memory space */ |
| 349 | 352 | void debug_write_qword(const address_space *space, offs_t address, UINT64 data, int apply_translation); |
| 350 | 353 | |
| 354 | /* write 1,2,4 or 8 bytes to the specified memory space */ | |
| 355 | void debug_write_memory(const address_space *space, offs_t address, UINT64 data, int size, int apply_translation); | |
| 356 | ||
| 351 | 357 | /* read 1,2,4 or 8 bytes at the given offset from opcode space */ |
| 352 | 358 | UINT64 debug_read_opcode(const address_space *space, offs_t offset, int size, int arg); |
| 353 | 359 |
| r5613 | r5614 | |
|---|---|---|
| 41 | 41 | UINT32 size; |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | typedef struct _cheat_map cheat_map; | |
| 45 | struct _cheat_map | |
| 46 | { | |
| 47 | UINT64 offset; | |
| 48 | UINT64 first_value; | |
| 49 | UINT64 previous_value; | |
| 50 | UINT8 state:1; | |
| 51 | UINT8 undo:7; | |
| 52 | }; | |
| 44 | 53 | |
| 54 | typedef struct _cheat_system cheat_system; | |
| 55 | struct _cheat_system | |
| 56 | { | |
| 57 | char cpu; | |
| 58 | UINT64 length; | |
| 59 | UINT8 width; | |
| 60 | cheat_map * cheatmap; | |
| 61 | UINT8 undo; | |
| 62 | UINT8 signed_cheat; | |
| 63 | }; | |
| 45 | 64 | |
| 65 | ||
| 46 | 66 | /*************************************************************************** |
| 47 | 67 | GLOBAL VARIABLES |
| 48 | 68 | ***************************************************************************/ |
| 49 | 69 | |
| 50 | 70 | static global_entry global_array[MAX_GLOBALS]; |
| 71 | static cheat_system cheat; | |
| 51 | 72 | |
| 52 | 73 | |
| 53 | 74 | |
| r5613 | r5614 | |
| 96 | 117 | static void execute_hotspot(running_machine *machine, int ref, int params, const char **param); |
| 97 | 118 | static void execute_save(running_machine *machine, int ref, int params, const char **param); |
| 98 | 119 | static void execute_dump(running_machine *machine, int ref, int params, const char **param); |
| 120 | static void execute_cheatinit(running_machine *machine, int ref, int params, const char **param); | |
| 121 | static void execute_cheatnext(running_machine *machine, int ref, int params, const char **param); | |
| 122 | static void execute_cheatlist(running_machine *machine, int ref, int params, const char **param); | |
| 123 | static void execute_cheatundo(running_machine *machine, int ref, int params, const char **param); | |
| 99 | 124 | static void execute_dasm(running_machine *machine, int ref, int params, const char **param); |
| 100 | 125 | static void execute_find(running_machine *machine, int ref, int params, const char **param); |
| 101 | 126 | static void execute_trace(running_machine *machine, int ref, int params, const char **param); |
| r5613 | r5614 | |
| 113 | 138 | |
| 114 | 139 | |
| 115 | 140 | /*************************************************************************** |
| 141 | INLINE FUNCTIONS | |
| 142 | ***************************************************************************/ | |
| 143 | ||
| 144 | /*------------------------------------------------- | |
| 145 | cheat_address_is_valid - return TRUE if the | |
| 146 | given address is valid for cheating | |
| 147 | -------------------------------------------------*/ | |
| 148 | ||
| 149 | INLINE int cheat_address_is_valid(const address_space *space, offs_t address) | |
| 150 | { | |
| 151 | return debug_cpu_translate(space, TRANSLATE_READ, &address) && (memory_get_write_ptr(space, address) != NULL); | |
| 152 | } | |
| 153 | ||
| 154 | ||
| 155 | /*------------------------------------------------- | |
| 156 | cheat_sign_extend - sign-extend a value to | |
| 157 | the current cheat width, if signed | |
| 158 | -------------------------------------------------*/ | |
| 159 | ||
| 160 | INLINE UINT64 cheat_sign_extend(const cheat_system *cheatsys, UINT64 value) | |
| 161 | { | |
| 162 | if (cheatsys->signed_cheat) | |
| 163 | { | |
| 164 | switch (cheatsys->width) | |
| 165 | { | |
| 166 | case 1: value = (INT8)value; break; | |
| 167 | case 2: value = (INT16)value; break; | |
| 168 | case 4: value = (INT32)value; break; | |
| 169 | } | |
| 170 | } | |
| 171 | return value; | |
| 172 | } | |
| 173 | ||
| 174 | ||
| 175 | /*------------------------------------------------- | |
| 176 | cheat_read_extended - read a value from memory | |
| 177 | in the given address space, sign-extending | |
| 178 | if necessary | |
| 179 | -------------------------------------------------*/ | |
| 180 | ||
| 181 | INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, const address_space *space, offs_t address) | |
| 182 | { | |
| 183 | return cheat_sign_extend(cheatsys, debug_read_memory(space, address, cheatsys->width, TRUE)); | |
| 184 | } | |
| 185 | ||
| 186 | ||
| 187 | ||
| 188 | /*************************************************************************** | |
| 116 | 189 | INITIALIZATION |
| 117 | 190 | ***************************************************************************/ |
| 118 | 191 | |
| r5613 | r5614 | |
| 215 | 288 | debug_console_register_command(machine, "dumpd", CMDFLAG_NONE, ADDRESS_SPACE_DATA, 3, 6, execute_dump); |
| 216 | 289 | debug_console_register_command(machine, "dumpi", CMDFLAG_NONE, ADDRESS_SPACE_IO, 3, 6, execute_dump); |
| 217 | 290 | |
| 291 | debug_console_register_command(machine, "cheatinit", CMDFLAG_NONE, 0, 0, 4, execute_cheatinit); | |
| 292 | debug_console_register_command(machine, "ci", CMDFLAG_NONE, 0, 0, 4, execute_cheatinit); | |
| 293 | ||
| 294 | debug_console_register_command(machine, "cheatrange",CMDFLAG_NONE, 1, 2, 2, execute_cheatinit); | |
| 295 | debug_console_register_command(machine, "cr", CMDFLAG_NONE, 1, 2, 2, execute_cheatinit); | |
| 296 | ||
| 297 | debug_console_register_command(machine, "cheatnext", CMDFLAG_NONE, 0, 1, 2, execute_cheatnext); | |
| 298 | debug_console_register_command(machine, "cn", CMDFLAG_NONE, 0, 1, 2, execute_cheatnext); | |
| 299 | debug_console_register_command(machine, "cheatnextf",CMDFLAG_NONE, 1, 1, 2, execute_cheatnext); | |
| 300 | debug_console_register_command(machine, "cnf", CMDFLAG_NONE, 1, 1, 2, execute_cheatnext); | |
| 301 | ||
| 302 | debug_console_register_command(machine, "cheatlist", CMDFLAG_NONE, 0, 0, 1, execute_cheatlist); | |
| 303 | debug_console_register_command(machine, "cl", CMDFLAG_NONE, 0, 0, 1, execute_cheatlist); | |
| 304 | ||
| 305 | debug_console_register_command(machine, "cheatundo", CMDFLAG_NONE, 0, 0, 0, execute_cheatundo); | |
| 306 | debug_console_register_command(machine, "cu", CMDFLAG_NONE, 0, 0, 0, execute_cheatundo); | |
| 307 | ||
| 218 | 308 | debug_console_register_command(machine, "f", CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_PROGRAM, 3, MAX_COMMAND_PARAMS, execute_find); |
| 219 | 309 | debug_console_register_command(machine, "find", CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_PROGRAM, 3, MAX_COMMAND_PARAMS, execute_find); |
| 220 | 310 | debug_console_register_command(machine, "fd", CMDFLAG_KEEP_QUOTES, ADDRESS_SPACE_DATA, 3, MAX_COMMAND_PARAMS, execute_find); |
| r5613 | r5614 | |
| 273 | 363 | /* turn off all traces */ |
| 274 | 364 | for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) |
| 275 | 365 | debug_cpu_trace(cpu, NULL, 0, NULL); |
| 366 | ||
| 367 | if (cheat.length) | |
| 368 | free(cheat.cheatmap); | |
| 276 | 369 | } |
| 277 | 370 | |
| 278 | 371 | |
| r5613 | r5614 | |
| 1656 | 1749 | |
| 1657 | 1750 | |
| 1658 | 1751 | /*------------------------------------------------- |
| 1752 | execute_cheatinit - initialize the cheat system | |
| 1753 | -------------------------------------------------*/ | |
| 1754 | ||
| 1755 | static void execute_cheatinit(running_machine *machine, int ref, int params, const char *param[]) | |
| 1756 | { | |
| 1757 | UINT64 offset, endoffset, length = 0, real_length = 0; | |
| 1758 | const address_space *space; | |
| 1759 | UINT32 active_cheat = 0; | |
| 1760 | UINT64 curaddr; | |
| 1761 | ||
| 1762 | /* validate parameters */ | |
| 1763 | if (!debug_command_parameter_cpu_space(machine, (params > 3) ? param[3] : NULL, ADDRESS_SPACE_PROGRAM, &space)) | |
| 1764 | return; | |
| 1765 | ||
| 1766 | if (ref == 0) | |
| 1767 | { | |
| 1768 | if (params > 0) | |
| 1769 | { | |
| 1770 | if (!strcmp(param[0], "sb")) | |
| 1771 | { | |
| 1772 | cheat.width = 1; | |
| 1773 | cheat.signed_cheat = TRUE; | |
| 1774 | } | |
| 1775 | else if (!strcmp(param[0], "sw")) | |
| 1776 | { | |
| 1777 | cheat.width = 2; | |
| 1778 | cheat.signed_cheat = TRUE; | |
| 1779 | } | |
| 1780 | else if (!strcmp(param[0], "sd")) | |
| 1781 | { | |
| 1782 | cheat.width = 4; | |
| 1783 | cheat.signed_cheat = TRUE; | |
| 1784 | } | |
| 1785 | else if (!strcmp(param[0], "sq")) | |
| 1786 | { | |
| 1787 | cheat.width = 8; | |
| 1788 | cheat.signed_cheat = TRUE; | |
| 1789 | } | |
| 1790 | else if (!strcmp(param[0], "ub")) | |
| 1791 | { | |
| 1792 | cheat.width = 1; | |
| 1793 | cheat.signed_cheat = FALSE; | |
| 1794 | } | |
| 1795 | else if (!strcmp(param[0], "uw")) | |
| 1796 | { | |
| 1797 | cheat.width = 2; | |
| 1798 | cheat.signed_cheat = FALSE; | |
| 1799 | } | |
| 1800 | else if (!strcmp(param[0], "ud")) | |
| 1801 | { | |
| 1802 | cheat.width = 4; | |
| 1803 | cheat.signed_cheat = FALSE; | |
| 1804 | } | |
| 1805 | else if (!strcmp(param[0], "uq")) | |
| 1806 | { | |
| 1807 | cheat.width = 8; | |
| 1808 | cheat.signed_cheat = FALSE; | |
| 1809 | } | |
| 1810 | else | |
| 1811 | { | |
| 1812 | debug_console_printf(machine, "Invalid type: expected ub, uw, ud, uq, sb, sw, sd or sq\n"); | |
| 1813 | return; | |
| 1814 | } | |
| 1815 | } | |
| 1816 | else | |
| 1817 | { | |
| 1818 | cheat.width = 1; | |
| 1819 | cheat.signed_cheat = FALSE; | |
| 1820 | } | |
| 1821 | } | |
| 1822 | ||
| 1823 | if (params > 1) | |
| 1824 | { | |
| 1825 | if (!debug_command_parameter_number(machine, param[(ref == 0) ? 1 : 0], &offset)) | |
| 1826 | return; | |
| 1827 | if (!debug_command_parameter_number(machine, param[(ref == 0) ? 2 : 1], &length)) | |
| 1828 | return; | |
| 1829 | } | |
| 1830 | else | |
| 1831 | { | |
| 1832 | /* initialize entire memory */ | |
| 1833 | offset = 0; | |
| 1834 | length = space->bytemask + 1; | |
| 1835 | } | |
| 1836 | ||
| 1837 | endoffset = memory_address_to_byte(space, offset + length - 1) & space->bytemask; | |
| 1838 | offset = memory_address_to_byte(space, offset) & space->bytemask; | |
| 1839 | ||
| 1840 | /* counts the writable bytes in the area */ | |
| 1841 | for (curaddr = offset; curaddr <= endoffset; curaddr += cheat.width) | |
| 1842 | if (cheat_address_is_valid(space, curaddr)) | |
| 1843 | real_length++; | |
| 1844 | ||
| 1845 | if (real_length == 0) | |
| 1846 | { | |
| 1847 | debug_console_printf(machine, "No writable bytes found in this area\n"); | |
| 1848 | return; | |
| 1849 | } | |
| 1850 | ||
| 1851 | if (ref == 0) | |
| 1852 | { | |
| 1853 | /* initialize new cheat system */ | |
| 1854 | if (cheat.cheatmap != NULL) | |
| 1855 | free(cheat.cheatmap); | |
| 1856 | cheat.cheatmap = malloc(real_length * sizeof(cheat_map)); | |
| 1857 | if (cheat.cheatmap == NULL) | |
| 1858 | { | |
| 1859 | debug_console_printf(machine, "Unable of allocate the necessary memory\n"); | |
| 1860 | return; | |
| 1861 | } | |
| 1862 | ||
| 1863 | cheat.length = real_length; | |
| 1864 | cheat.undo = 0; | |
| 1865 | cheat.cpu = (params > 3) ? *param[3] : '0'; | |
| 1866 | } | |
| 1867 | else | |
| 1868 | { | |
| 1869 | /* add range to cheat system */ | |
| 1870 | cheat_map * cheatmap_bak = cheat.cheatmap; | |
| 1871 | ||
| 1872 | if (cheat.cpu == 0) | |
| 1873 | { | |
| 1874 | debug_console_printf(machine, "Use cheatinit before cheatrange\n"); | |
| 1875 | return; | |
| 1876 | } | |
| 1877 | ||
| 1878 | if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, ADDRESS_SPACE_PROGRAM, &space)) | |
| 1879 | return; | |
| 1880 | ||
| 1881 | cheat.cheatmap = realloc(cheat.cheatmap, (cheat.length + real_length) * sizeof(cheat_map)); | |
| 1882 | if (cheat.cheatmap == NULL) | |
| 1883 | { | |
| 1884 | cheat.cheatmap = cheatmap_bak; | |
| 1885 | debug_console_printf(machine, "Unable of allocate the necessary memory\n"); | |
| 1886 | return; | |
| 1887 | } | |
| 1888 | ||
| 1889 | active_cheat = cheat.length; | |
| 1890 | cheat.length += real_length; | |
| 1891 | } | |
| 1892 | ||
| 1893 | /* initialize cheatmap in the selected space */ | |
| 1894 | for (curaddr = offset; curaddr <= endoffset; curaddr += cheat.width) | |
| 1895 | if (cheat_address_is_valid(space, curaddr)) | |
| 1896 | { | |
| 1897 | cheat.cheatmap[active_cheat].previous_value = cheat_read_extended(&cheat, space, curaddr); | |
| 1898 | cheat.cheatmap[active_cheat].first_value = cheat.cheatmap[active_cheat].previous_value; | |
| 1899 | cheat.cheatmap[active_cheat].offset = curaddr; | |
| 1900 | cheat.cheatmap[active_cheat].state = 1; | |
| 1901 | cheat.cheatmap[active_cheat].undo = 0; | |
| 1902 | active_cheat++; | |
| 1903 | } | |
| 1904 | ||
| 1905 | debug_console_printf(machine, "%u cheat initialized\n", active_cheat); | |
| 1906 | } | |
| 1907 | ||
| 1908 | ||
| 1909 | /*------------------------------------------------- | |
| 1910 | execute_cheatnext - execute the search | |
| 1911 | -------------------------------------------------*/ | |
| 1912 | ||
| 1913 | static void execute_cheatnext(running_machine *machine, int ref, int params, const char *param[]) | |
| 1914 | { | |
| 1915 | const address_space *space; | |
| 1916 | UINT64 cheatindex; | |
| 1917 | UINT32 active_cheat = 0; | |
| 1918 | UINT8 condition; | |
| 1919 | UINT64 comp_value = 0; | |
| 1920 | ||
| 1921 | enum | |
| 1922 | { | |
| 1923 | CHEAT_ALL = 0, | |
| 1924 | CHEAT_EQUAL, | |
| 1925 | CHEAT_NOTEQUAL, | |
| 1926 | CHEAT_EQUALTO, | |
| 1927 | CHEAT_NOTEQUALTO, | |
| 1928 | CHEAT_DECREASE, | |
| 1929 | CHEAT_INCREASE, | |
| 1930 | CHEAT_DECREASEOF, | |
| 1931 | CHEAT_INCREASEOF, | |
| 1932 | CHEAT_SMALLEROF, | |
| 1933 | CHEAT_GREATEROF | |
| 1934 | }; | |
| 1935 | ||
| 1936 | if (cheat.cpu == 0) | |
| 1937 | { | |
| 1938 | debug_console_printf(machine, "Use cheatinit before cheatnext\n"); | |
| 1939 | return; | |
| 1940 | } | |
| 1941 | ||
| 1942 | if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, ADDRESS_SPACE_PROGRAM, &space)) | |
| 1943 | return; | |
| 1944 | ||
| 1945 | if (params > 1 && !debug_command_parameter_number(machine, param[1], &comp_value)) | |
| 1946 | return; | |
| 1947 | comp_value = cheat_sign_extend(&cheat, comp_value); | |
| 1948 | ||
| 1949 | /* decode contidion */ | |
| 1950 | if (!strcmp(param[0], "all")) | |
| 1951 | condition = CHEAT_ALL; | |
| 1952 | else if (!strcmp(param[0], "equal") || !strcmp(param[0], "eq")) | |
| 1953 | condition = (params > 1) ? CHEAT_EQUALTO : CHEAT_EQUAL; | |
| 1954 | else if (!strcmp(param[0], "notequal") || !strcmp(param[0], "ne")) | |
| 1955 | condition = (params > 1) ? CHEAT_NOTEQUALTO : CHEAT_NOTEQUAL; | |
| 1956 | else if (!strcmp(param[0], "decrease") || !strcmp(param[0], "de") || !strcmp(param[0], "-")) | |
| 1957 | condition = (params > 1) ? CHEAT_DECREASEOF : CHEAT_DECREASE; | |
| 1958 | else if (!strcmp(param[0], "increase") || !strcmp(param[0], "in") || !strcmp(param[0], "+")) | |
| 1959 | condition = (params > 1) ? CHEAT_INCREASEOF : CHEAT_INCREASE; | |
| 1960 | else if (!strcmp(param[0], "smallerof") || !strcmp(param[0], "lt") || !strcmp(param[0], "<")) | |
| 1961 | condition = CHEAT_SMALLEROF; | |
| 1962 | else if (!strcmp(param[0], "greaterof") || !strcmp(param[0], "gt") || !strcmp(param[0], ">")) | |
| 1963 | condition = CHEAT_GREATEROF; | |
| 1964 | else | |
| 1965 | { | |
| 1966 | debug_console_printf(machine, "Invalid condition type\n"); | |
| 1967 | return; | |
| 1968 | } | |
| 1969 | ||
| 1970 | cheat.undo++; | |
| 1971 | ||
| 1972 | /* execute the search */ | |
| 1973 | for (cheatindex = 0; cheatindex < cheat.length; cheatindex += 1) | |
| 1974 | if (cheat.cheatmap[cheatindex].state == 1) | |
| 1975 | { | |
| 1976 | UINT64 cheat_value = cheat_read_extended(&cheat, space, cheat.cheatmap[cheatindex].offset); | |
| 1977 | UINT64 comp_byte = (ref == 0) ? cheat.cheatmap[cheatindex].previous_value : cheat.cheatmap[cheatindex].first_value; | |
| 1978 | UINT8 disable_byte = FALSE; | |
| 1979 | ||
| 1980 | switch (condition) | |
| 1981 | { | |
| 1982 | case CHEAT_ALL: | |
| 1983 | break; | |
| 1984 | ||
| 1985 | case CHEAT_EQUAL: | |
| 1986 | disable_byte = (cheat_value != comp_byte); | |
| 1987 | break; | |
| 1988 | ||
| 1989 | case CHEAT_NOTEQUAL: | |
| 1990 | disable_byte = (cheat_value == comp_byte); | |
| 1991 | break; | |
| 1992 | ||
| 1993 | case CHEAT_EQUALTO: | |
| 1994 | disable_byte = (cheat_value != comp_value); | |
| 1995 | break; | |
| 1996 | ||
| 1997 | case CHEAT_NOTEQUALTO: | |
| 1998 | disable_byte = (cheat_value == comp_value); | |
| 1999 | break; | |
| 2000 | ||
| 2001 | case CHEAT_DECREASE: | |
| 2002 | if (cheat.signed_cheat) | |
| 2003 | disable_byte = ((INT64)cheat_value >= (INT64)comp_byte); | |
| 2004 | else | |
| 2005 | disable_byte = ((UINT64)cheat_value >= (UINT64)comp_byte); | |
| 2006 | break; | |
| 2007 | ||
| 2008 | case CHEAT_INCREASE: | |
| 2009 | if (cheat.signed_cheat) | |
| 2010 | disable_byte = ((INT64)cheat_value <= (INT64)comp_byte); | |
| 2011 | else | |
| 2012 | disable_byte = ((UINT64)cheat_value <= (UINT64)comp_byte); | |
| 2013 | break; | |
| 2014 | ||
| 2015 | case CHEAT_DECREASEOF: | |
| 2016 | disable_byte = (cheat_value != comp_byte - comp_value); | |
| 2017 | break; | |
| 2018 | ||
| 2019 | case CHEAT_INCREASEOF: | |
| 2020 | disable_byte = (cheat_value != comp_byte + comp_value); | |
| 2021 | break; | |
| 2022 | ||
| 2023 | case CHEAT_SMALLEROF: | |
| 2024 | if (cheat.signed_cheat) | |
| 2025 | disable_byte = ((INT64)cheat_value >= (INT64)comp_value); | |
| 2026 | else | |
| 2027 | disable_byte = ((UINT64)cheat_value >= (UINT64)comp_value); | |
| 2028 | break; | |
| 2029 | ||
| 2030 | case CHEAT_GREATEROF: | |
| 2031 | if (cheat.signed_cheat) | |
| 2032 | disable_byte = ((INT64)cheat_value <= (INT64)comp_value); | |
| 2033 | else | |
| 2034 | disable_byte = ((UINT64)cheat_value <= (UINT64)comp_value); | |
| 2035 | break; | |
| 2036 | } | |
| 2037 | ||
| 2038 | if (disable_byte) | |
| 2039 | { | |
| 2040 | cheat.cheatmap[cheatindex].state = 0; | |
| 2041 | cheat.cheatmap[cheatindex].undo = cheat.undo; | |
| 2042 | } | |
| 2043 | else | |
| 2044 | active_cheat++; | |
| 2045 | ||
| 2046 | /* update previous value */ | |
| 2047 | cheat.cheatmap[cheatindex].previous_value = cheat_value; | |
| 2048 | } | |
| 2049 | ||
| 2050 | if (active_cheat <= 5) | |
| 2051 | execute_cheatlist(machine, 0, 0, NULL); | |
| 2052 | ||
| 2053 | debug_console_printf(machine, "%u cheats found\n", active_cheat); | |
| 2054 | } | |
| 2055 | ||
| 2056 | ||
| 2057 | /*------------------------------------------------- | |
| 2058 | execute_cheatlist - show a list of active cheat | |
| 2059 | -------------------------------------------------*/ | |
| 2060 | ||
| 2061 | static void execute_cheatlist(running_machine *machine, int ref, int params, const char *param[]) | |
| 2062 | { | |
| 2063 | char spaceletter, sizeletter; | |
| 2064 | const address_space *space; | |
| 2065 | UINT32 active_cheat = 0; | |
| 2066 | UINT64 cheatindex; | |
| 2067 | UINT64 sizemask; | |
| 2068 | FILE *f = NULL; | |
| 2069 | ||
| 2070 | if (!debug_command_parameter_cpu_space(machine, &cheat.cpu, ADDRESS_SPACE_PROGRAM, &space)) | |
| 2071 | return; | |
| 2072 | ||
| 2073 | if (params > 0) | |
| 2074 | f = fopen(param[0], "w"); | |
| 2075 | ||
| 2076 | switch (space->spacenum) | |
| 2077 | { | |
| 2078 | default: | |
| 2079 | case ADDRESS_SPACE_PROGRAM: spaceletter = 'p'; break; | |
| 2080 | case ADDRESS_SPACE_DATA: spaceletter = 'd'; break; | |
| 2081 | case ADDRESS_SPACE_IO: spaceletter = 'i'; break; | |
| 2082 | } | |
| 2083 | ||
| 2084 | switch (cheat.width) | |
| 2085 | { | |
| 2086 | default: | |
| 2087 | case 1: sizeletter = 'b'; sizemask = 0xff; break; | |
| 2088 | case 2: sizeletter = 'w'; sizemask = 0xffff; break; | |
| 2089 | case 4: sizeletter = 'd'; sizemask = 0xffffffff; break; | |
| 2090 | case 8: sizeletter = 'q'; sizemask = U64(0xffffffffffffffff); break; | |
| 2091 | } | |
| 2092 | ||
| 2093 | /* write the cheat list */ | |
| 2094 | for (cheatindex = 0; cheatindex < cheat.length; cheatindex += 1) | |
| 2095 | { | |
| 2096 | if (cheat.cheatmap[cheatindex].state == 1) | |
| 2097 | { | |
| 2098 | UINT64 value = cheat_read_extended(&cheat, space, cheat.cheatmap[cheatindex].offset) & sizemask; | |
| 2099 | offs_t address = memory_byte_to_address(space, cheat.cheatmap[cheatindex].offset); | |
| 2100 | ||
| 2101 | if (params > 0) | |
| 2102 | { | |
| 2103 | active_cheat++; | |
| 2104 | fprintf(f, " <cheat desc=\"Possibility %d : %0*X (%0*" I64FMT "X)\">\n", active_cheat, space->logaddrchars, address, cheat.width * 2, value); | |
| 2105 | fprintf(f, " <script state=\"run\">\n"); | |
| 2106 | fprintf(f, " <action>maincpu.%c%c@%0*X=%0*" I64FMT "X</action>\n", spaceletter, sizeletter, space->logaddrchars, address, cheat.width * 2, cheat.cheatmap[cheatindex].first_value & sizemask); | |
| 2107 | fprintf(f, " </script>\n"); | |
| 2108 | fprintf(f, " </cheat>\n\n"); | |
| 2109 | } | |
| 2110 | else | |
| 2111 | debug_console_printf(machine, "Address=%0*X Start=%0*" I64FMT "X Current=%0*" I64FMT "X\n", space->logaddrchars, address, cheat.width * 2, cheat.cheatmap[cheatindex].first_value & sizemask, cheat.width * 2, value); | |
| 2112 | } | |
| 2113 | } | |
| 2114 | if (params > 0) | |
| 2115 | fclose(f); | |
| 2116 | } | |
| 2117 | ||
| 2118 | ||
| 2119 | /*------------------------------------------------- | |
| 2120 | execute_cheatundo - undo the last search | |
| 2121 | -------------------------------------------------*/ | |
| 2122 | ||
| 2123 | static void execute_cheatundo(running_machine *machine, int ref, int params, const char *param[]) | |
| 2124 | { | |
| 2125 | UINT64 cheatindex; | |
| 2126 | UINT32 undo_count = 0; | |
| 2127 | ||
| 2128 | if (cheat.undo > 0) | |
| 2129 | { | |
| 2130 | for (cheatindex = 0; cheatindex < cheat.length; cheatindex += 1) | |
| 2131 | { | |
| 2132 | if (cheat.cheatmap[cheatindex].undo == cheat.undo) | |
| 2133 | { | |
| 2134 | cheat.cheatmap[cheatindex].state = 1; | |
| 2135 | cheat.cheatmap[cheatindex].undo = 0; | |
| 2136 | undo_count++; | |
| 2137 | } | |
| 2138 | } | |
| 2139 | ||
| 2140 | cheat.undo--; | |
| 2141 | debug_console_printf(machine, "%u cheat reactivated\n", undo_count); | |
| 2142 | } | |
| 2143 | else | |
| 2144 | debug_console_printf(machine, "Maximum undo reached\n"); | |
| 2145 | } | |
| 2146 | ||
| 2147 | ||
| 2148 | /*------------------------------------------------- | |
| 1659 | 2149 | execute_find - execute the find command |
| 1660 | 2150 | -------------------------------------------------*/ |
| 1661 | 2151 |
| r5613 | r5614 | |
|---|---|---|
| 69 | 69 | " Watchpoints\n" |
| 70 | 70 | " Expressions\n" |
| 71 | 71 | " Comments\n" |
| 72 | " Cheats\n" | |
| 72 | 73 | }, |
| 73 | 74 | { |
| 74 | 75 | "general", |
| r5613 | r5614 | |
| 204 | 205 | "\n" |
| 205 | 206 | }, |
| 206 | 207 | { |
| 208 | "cheats", | |
| 209 | "\n" | |
| 210 | "Cheat Commands\n" | |
| 211 | "Type help <command> for further details on each command\n" | |
| 212 | "\n" | |
| 213 | " cheatinit [<address>,<length>[,<cpu>]] -- initialize the cheat search to the selected memory area\n" | |
| 214 | " cheatrange <address>,<length> -- add to the cheat search the selected memory area\n" | |
| 215 | " cheatnext <condition>[,<comparisonvalue>] -- continue cheat search comparing with the the last value\n" | |
| 216 | " cheatnextf <condition>[,<comparisonvalue>] -- continue cheat search comparing with the the first value\n" | |
| 217 | " cheatlist [<filename>] -- show the list of cheat search matches or save them to <filename>\n" | |
| 218 | " cheatundo [<wpnum>] -- undo the last cheat search (state only)\n" | |
| 219 | }, | |
| 220 | { | |
| 207 | 221 | "do", |
| 208 | 222 | "\n" |
| 209 | 223 | " do <expression>\n" |
| r5613 | r5614 | |
| 1029 | 1043 | "comdelete 10\n" |
| 1030 | 1044 | " Deletes the comment at code address 0x10 (using the current memory bank settings)\n" |
| 1031 | 1045 | "\n" |
| 1046 | }, | |
| 1047 | { | |
| 1048 | "cheatinit", | |
| 1049 | "\n" | |
| 1050 | " cheatinit [<type>,[<address>,<length>[,<cpu>]]]\n" | |
| 1051 | "\n" | |
| 1052 | "The cheatinit command initializes the cheat search to the selected memory area.\n" | |
| 1053 | "If no parameter is specified the cheat search is initialized to all changeable memory of the main cpu.\n" | |
| 1054 | "Possible <type>:\n" | |
| 1055 | " ub\n" | |
| 1056 | " 8 bit unsigned int\n" | |
| 1057 | " uw\n" | |
| 1058 | " 16 bit unsigned int\n" | |
| 1059 | " ud\n" | |
| 1060 | " 32 bit unsigned int\n" | |
| 1061 | " uq\n" | |
| 1062 | " 64 bit unsigned int\n" | |
| 1063 | " sb\n" | |
| 1064 | " 8 bit signed int\n" | |
| 1065 | " sw\n" | |
| 1066 | " 16 bit signed int\n" | |
| 1067 | " sd\n" | |
| 1068 | " 32 bit signed int\n" | |
| 1069 | " sq\n" | |
| 1070 | " 64 bit signed int\n" | |
| 1071 | "\n" | |
| 1072 | "Examples:\n" | |
| 1073 | "\n" | |
| 1074 | "cheatinit ub,0x1000,0x10\n" | |
| 1075 | " Initialize the cheat search from 0x1000 to 0x1010 of the first CPU.\n" | |
| 1076 | "\n" | |
| 1077 | "cheatinit sw,0x2000,0x1000,1\n" | |
| 1078 | " Initialize the cheat search with width of 2 byte in signed mode from 0x2000 to 0x3000 of the second CPU.\n" | |
| 1079 | }, | |
| 1080 | { | |
| 1081 | "cheatrange", | |
| 1082 | "\n" | |
| 1083 | " cheatrange <address>,<length>\n" | |
| 1084 | "\n" | |
| 1085 | "The cheatrange command adds the selected memory area to the cheat search.\n" | |
| 1086 | "Before using cheatrange it is necessary to initialize the cheat search with cheatinit.\n" | |
| 1087 | "\n" | |
| 1088 | "Examples:\n" | |
| 1089 | "\n" | |
| 1090 | "cheatrange 0x1000,0x10\n" | |
| 1091 | " Add the bytes from 0x1000 to 0x1010 to the cheat search.\n" | |
| 1092 | }, | |
| 1093 | { | |
| 1094 | "cheatnext", | |
| 1095 | "\n" | |
| 1096 | " cheatnext <condition>[,<comparisonvalue>]\n" | |
| 1097 | "\n" | |
| 1098 | "The cheatnext command will make comparisons with the last search matches.\n" | |
| 1099 | "Possible <condition>:\n" | |
| 1100 | " all\n" | |
| 1101 | " no <comparisonvalue> needed.\n" | |
| 1102 | " use to update the last value without changing the current matches.\n" | |
| 1103 | " equal [eq]\n" | |
| 1104 | " without <comparisonvalue> search for all bytes that are equal to the last search.\n" | |
| 1105 | " with <comparisonvalue> search for all bytes that are equal to the <comparisonvalue>.\n" | |
| 1106 | " notequal [ne]\n" | |
| 1107 | " without <comparisonvalue> search for all bytes that are not equal to the last search.\n" | |
| 1108 | " with <comparisonvalue> search for all bytes that are not equal to the <comparisonvalue>.\n" | |
| 1109 | " decrease [de, +]\n" | |
| 1110 | " without <comparisonvalue> search for all bytes that have decreased since the last search.\n" | |
| 1111 | " with <comparisonvalue> search for all bytes that have decreased by the <comparisonvalue> since the last search.\n" | |
| 1112 | " increase [in, -]\n" | |
| 1113 | " without <comparisonvalue> search for all bytes that have increased since the last search.\n" | |
| 1114 | " with <comparisonvalue> search for all bytes that have increased by the <comparisonvalue> since the last search.\n" | |
| 1115 | " smallerof [lt]\n" | |
| 1116 | " without <comparisonvalue> this condition is invalid\n" | |
| 1117 | " with <comparisonvalue> search for all bytes that are smaller than the <comparisonvalue>.\n" | |
| 1118 | " greaterof [gt]\n" | |
| 1119 | " without <comparisonvalue> this condition is invalid\n" | |
| 1120 | " with <comparisonvalue> search for all bytes that are larger than the <comparisonvalue>.\n" | |
| 1121 | "\n" | |
| 1122 | "Examples:\n" | |
| 1123 | "\n" | |
| 1124 | "cheatnext increase\n" | |
| 1125 | " search for all bytes that have increased since the last search.\n" | |
| 1126 | "\n" | |
| 1127 | "cheatnext decrease, 1\n" | |
| 1128 | " search for all bytes that have decreased by 1 since the last search.\n" | |
| 1129 | }, | |
| 1130 | { | |
| 1131 | "cheatnextf", | |
| 1132 | "\n" | |
| 1133 | " cheatnextf <condition>[,<comparisonvalue>]\n" | |
| 1134 | "\n" | |
| 1135 | "The cheatnextf command will make comparisons with the initial search.\n" | |
| 1136 | "Possible <condition>:\n" | |
| 1137 | " all\n" | |
| 1138 | " no <comparisonvalue> needed.\n" | |
| 1139 | " use to update the last value without changing the current matches.\n" | |
| 1140 | " equal [eq]\n" | |
| 1141 | " without <comparisonvalue> search for all bytes that are equal to the initial search.\n" | |
| 1142 | " with <comparisonvalue> search for all bytes that are equal to the <comparisonvalue>.\n" | |
| 1143 | " notequal [ne]\n" | |
| 1144 | " without <comparisonvalue> search for all bytes that are not equal to the initial search.\n" | |
| 1145 | " with <comparisonvalue> search for all bytes that are not equal to the <comparisonvalue>.\n" | |
| 1146 | " decrease [de, +]\n" | |
| 1147 | " without <comparisonvalue> search for all bytes that have decreased since the initial search.\n" | |
| 1148 | " with <comparisonvalue> search for all bytes that have decreased by the <comparisonvalue> since the initial search.\n" | |
| 1149 | " increase [in, -]\n" | |
| 1150 | " without <comparisonvalue> search for all bytes that have increased since the initial search.\n" | |
| 1151 | " with <comparisonvalue> search for all bytes that have increased by the <comparisonvalue> since the initial search.\n" | |
| 1152 | " smallerof [lt]\n" | |
| 1153 | " without <comparisonvalue> this condition is invalid.\n" | |
| 1154 | " with <comparisonvalue> search for all bytes that are smaller than the <comparisonvalue>.\n" | |
| 1155 | " greaterof [gt]\n" | |
| 1156 | " without <comparisonvalue> this condition is invalid.\n" | |
| 1157 | " with <comparisonvalue> search for all bytes that are larger than the <comparisonvalue>.\n" | |
| 1158 | "\n" | |
| 1159 | "Examples:\n" | |
| 1160 | "\n" | |
| 1161 | "cheatnextf increase\n" | |
| 1162 | " search for all bytes that have increased since the initial search.\n" | |
| 1163 | "\n" | |
| 1164 | "cheatnextf decrease, 1\n" | |
| 1165 | " search for all bytes that have decreased by 1 since the initial search.\n" | |
| 1166 | }, | |
| 1167 | { | |
| 1168 | "cheatlist", | |
| 1169 | "\n" | |
| 1170 | " cheatlist [<filename>]\n" | |
| 1171 | "\n" | |
| 1172 | "Without <filename> show the list of matches in the debug console.\n" | |
| 1173 | "With <filename> save the list of matches in basic xml format to <filename>.\n" | |
| 1174 | "\n" | |
| 1175 | "Examples:\n" | |
| 1176 | "\n" | |
| 1177 | "cheatlist\n" | |
| 1178 | " Show the current matches in the debug console.\n" | |
| 1179 | "cheatlist cheat.txt\n" | |
| 1180 | " Save the current matches to cheat.txt.\n" | |
| 1181 | }, | |
| 1182 | { | |
| 1183 | " cheatundo\n" | |
| 1184 | "\n" | |
| 1185 | "Undo the results of the last search.\n" | |
| 1186 | "The undo command has no effect on the last value.\n" | |
| 1187 | "\n" | |
| 1188 | "Examples:\n" | |
| 1189 | "\n" | |
| 1190 | "cheatundo\n" | |
| 1191 | " Undo the last search (state only).\n" | |
| 1032 | 1192 | } |
| 1033 | 1193 | }; |
| 1034 | 1194 |
| r5613 | r5614 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | #define LOG_GFX_OPS 0 |
| 14 | #define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(KEYCODE_L)) logerror x; } while (0) | |
| 14 | #define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine, KEYCODE_L)) logerror x; } while (0) | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /* Graphics Instructions */ |
| r5613 | r5614 | |
|---|---|---|
| 1504 | 1504 | |
| 1505 | 1505 | |
| 1506 | 1506 | #------------------------------------------------- |
| 1507 | # Zilog Z8 | |
| 1508 | #------------------------------------------------- | |
| 1509 | ||
| 1510 | ifneq ($(filter Z8,$(CPUS)),) | |
| 1511 | OBJDIRS += $(CPUOBJ)/z8 | |
| 1512 | CPUOBJS += $(CPUOBJ)/z8/z8.o | |
| 1513 | DASMOBJS += $(CPUOBJ)/z8/z8dasm.o | |
| 1514 | endif | |
| 1515 | ||
| 1516 | $(CPUOBJ)/z8/z8.o: $(CPUSRC)/z8/z8.c \ | |
| 1517 | $(CPUSRC)/z8/z8ops.c \ | |
| 1518 | $(CPUSRC)/z8/z8.h | |
| 1519 | ||
| 1520 | ||
| 1521 | ||
| 1522 | #------------------------------------------------- | |
| 1523 | 1507 | # Zilog Z80 |
| 1524 | 1508 | #------------------------------------------------- |
| 1525 | 1509 | |
| r5613 | r5614 | |
| 1594 | 1578 | |
| 1595 | 1579 | |
| 1596 | 1580 | #------------------------------------------------- |
| 1581 | # Zilog Z8 | |
| 1582 | #------------------------------------------------- | |
| 1583 | ||
| 1584 | ifneq ($(filter Z8,$(CPUS)),) | |
| 1585 | OBJDIRS += $(CPUOBJ)/z8 | |
| 1586 | CPUOBJS += $(CPUOBJ)/z8/z8.o | |
| 1587 | DASMOBJS += $(CPUOBJ)/z8/z8dasm.o | |
| 1588 | endif | |
| 1589 | ||
| 1590 | $(CPUOBJ)/z8/z8.o: $(CPUSRC)/z8/z8.c \ | |
| 1591 | $(CPUSRC)/z8/z8ops.c \ | |
| 1592 | $(CPUSRC)/z8/z8.h | |
| 1593 | ||
| 1594 | ||
| 1595 | ||
| 1596 | #------------------------------------------------- | |
| 1597 | 1597 | # Argonaut SuperFX |
| 1598 | 1598 | #------------------------------------------------- |
| 1599 | 1599 |
| r5613 | r5614 | |
|---|---|---|
| 77 | 77 | { |
| 78 | 78 | address = ADDRESS_37710(address); |
| 79 | 79 | if (address & 1) |
| 80 | return m37710_read_8(address) | m37710_read_8(address+1)<<8; | |
| 80 | return m37710_read_8(address) | m37710_read_8((address)+1)<<8; | |
| 81 | 81 | else |
| 82 | 82 | return m37710_read_16(address); |
| 83 | 83 | } |
| r5613 | r5614 | |
| 2253 | 2253 | CLK(CLK_OP + CLK_RMW8 + CLK_W_##MODE); \ |
| 2254 | 2254 | DST = EA_##MODE(cpustate); \ |
| 2255 | 2255 | REG_IM = read_8_##MODE(DST); \ |
| 2256 | REG_IM2 = read_8_NORM(REG_PC); \ | |
| 2256 | REG_IM2 = read_8_NORM(REG_PB | REG_PC); \ | |
| 2257 | 2257 | REG_PC++; \ |
| 2258 | 2258 | write_8_##MODE(DST, REG_IM & ~REG_IM2); |
| 2259 | 2259 | #else |
| r5613 | r5614 | |
| 2261 | 2261 | CLK(CLK_OP + CLK_RMW16 + CLK_W_##MODE); \ |
| 2262 | 2262 | DST = EA_##MODE(cpustate); \ |
| 2263 | 2263 | REG_IM = read_16_##MODE(DST); \ |
| 2264 | REG_IM2 = read_16_NORM(REG_PC); \ | |
| 2264 | REG_IM2 = read_16_NORM(REG_PB | REG_PC); \ | |
| 2265 | 2265 | REG_PC+=2; \ |
| 2266 | 2266 | write_16_##MODE(DST, REG_IM & ~REG_IM2); |
| 2267 | 2267 | #endif |
| r5613 | r5614 | |
| 2273 | 2273 | CLK(CLK_OP + CLK_RMW8 + CLK_W_##MODE); \ |
| 2274 | 2274 | DST = EA_##MODE(cpustate); \ |
| 2275 | 2275 | REG_IM = read_8_##MODE(DST); \ |
| 2276 | REG_IM2 = read_8_NORM(REG_PC); \ | |
| 2276 | REG_IM2 = read_8_NORM(REG_PB | REG_PC); \ | |
| 2277 | 2277 | REG_PC++; \ |
| 2278 | 2278 | write_8_##MODE(DST, REG_IM | REG_IM2); |
| 2279 | 2279 | #else |
| r5613 | r5614 | |
| 2281 | 2281 | CLK(CLK_OP + CLK_RMW16 + CLK_W_##MODE); \ |
| 2282 | 2282 | DST = EA_##MODE(cpustate); \ |
| 2283 | 2283 | REG_IM = read_16_##MODE(DST); \ |
| 2284 | REG_IM2 = read_16_NORM(REG_PC); \ | |
| 2284 | REG_IM2 = read_16_NORM(REG_PB | REG_PC); \ | |
| 2285 | 2285 | REG_PC+=2; \ |
| 2286 | 2286 | write_16_##MODE(DST, REG_IM | REG_IM2); |
| 2287 | 2287 | #endif |
| r5613 | r5614 | |
|---|---|---|
| 2748 | 2748 | static void sharcop_unimplemented(SHARC_REGS *cpustate) |
| 2749 | 2749 | { |
| 2750 | 2750 | char dasm[1000]; |
| 2751 | CPU_DISASSEMBLE_NAME(sharc)(NULL, dasm, cpustate->pc, NULL, NULL); | |
| 2751 | CPU_DISASSEMBLE_NAME(sharc)(NULL, dasm, cpustate->pc, NULL, NULL, 0); | |
| 2752 | 2752 | mame_printf_debug("SHARC: %08X: %s\n", cpustate->pc, dasm); |
| 2753 | 2753 | fatalerror("SHARC: Unimplemented opcode %04X%08X at %08X", (UINT16)(cpustate->opcode >> 32), (UINT32)(cpustate->opcode), cpustate->pc); |
| 2754 | 2754 | } |
| r5613 | r5614 | |
|---|---|---|
| 1104 | 1104 | opr[1] = opcode >> 8; |
| 1105 | 1105 | opr[2] = opcode >> 16; |
| 1106 | 1106 | |
| 1107 | CPU_DISASSEMBLE_NAME(tms57002)(0, buf, s->pc, opr, opr); | |
| 1107 | CPU_DISASSEMBLE_NAME(tms57002)(0, buf, s->pc, opr, opr, 0); | |
| 1108 | 1108 | popmessage("tms57002: %s - Contact Mamedev", buf); |
| 1109 | 1109 | } |
| 1110 | 1110 |
| r5613 | r5614 | |
|---|---|---|
| 120 | 120 | if( modrm >= 0xc0 ) { |
| 121 | 121 | src = LOAD_REG16(modrm); |
| 122 | 122 | dst = LOAD_RM16(modrm); |
| 123 | src = ADD16(cpustate,src, cpustate->CF); | |
| 124 | dst = ADD16(cpustate,dst, src); | |
| 123 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 125 | 124 | STORE_RM16(modrm, dst); |
| 126 | 125 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 127 | 126 | } else { |
| 128 | 127 | UINT32 ea = GetEA(cpustate,modrm); |
| 129 | 128 | src = LOAD_REG16(modrm); |
| 130 | 129 | dst = READ16(cpustate,ea); |
| 131 | src = ADD16(cpustate,src, cpustate->CF); | |
| 132 | dst = ADD16(cpustate,dst, src); | |
| 130 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 133 | 131 | WRITE16(cpustate,ea, dst); |
| 134 | 132 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 135 | 133 | } |
| r5613 | r5614 | |
| 142 | 140 | if( modrm >= 0xc0 ) { |
| 143 | 141 | src = LOAD_RM16(modrm); |
| 144 | 142 | dst = LOAD_REG16(modrm); |
| 145 | src = ADD16(cpustate,src, cpustate->CF); | |
| 146 | dst = ADD16(cpustate,dst, src); | |
| 143 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 147 | 144 | STORE_REG16(modrm, dst); |
| 148 | 145 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 149 | 146 | } else { |
| 150 | 147 | UINT32 ea = GetEA(cpustate,modrm); |
| 151 | 148 | src = READ16(cpustate,ea); |
| 152 | 149 | dst = LOAD_REG16(modrm); |
| 153 | src = ADD16(cpustate,src, cpustate->CF); | |
| 154 | dst = ADD16(cpustate,dst, src); | |
| 150 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 155 | 151 | STORE_REG16(modrm, dst); |
| 156 | 152 | CYCLES(cpustate,CYCLES_ALU_MEM_REG); |
| 157 | 153 | } |
| r5613 | r5614 | |
| 162 | 158 | UINT16 src, dst; |
| 163 | 159 | src = FETCH16(cpustate); |
| 164 | 160 | dst = REG16(AX); |
| 165 | src = ADD16(cpustate,src, cpustate->CF); | |
| 166 | dst = ADD16(cpustate,dst, src); | |
| 161 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 167 | 162 | REG16(AX) = dst; |
| 168 | 163 | CYCLES(cpustate,CYCLES_ALU_IMM_ACC); |
| 169 | 164 | } |
| r5613 | r5614 | |
| 1729 | 1724 | UINT16 src, dst; |
| 1730 | 1725 | UINT8 modrm = FETCH(cpustate); |
| 1731 | 1726 | if( modrm >= 0xc0 ) { |
| 1732 | src = LOAD_REG16(modrm) | |
| 1727 | src = LOAD_REG16(modrm) | |
| 1733 | 1728 | dst = LOAD_RM16(modrm); |
| 1734 | dst = S | |
| 1729 | dst = S | |
| 1735 | 1730 | STORE_RM16(modrm, dst); |
| 1736 | 1731 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1737 | 1732 | } else { |
| 1738 | 1733 | UINT32 ea = GetEA(cpustate,modrm); |
| 1739 | src = LOAD_REG16(modrm) | |
| 1734 | src = LOAD_REG16(modrm) | |
| 1740 | 1735 | dst = READ16(cpustate,ea); |
| 1741 | dst = S | |
| 1736 | dst = S | |
| 1742 | 1737 | WRITE16(cpustate,ea, dst); |
| 1743 | 1738 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 1744 | 1739 | } |
| r5613 | r5614 | |
| 1749 | 1744 | UINT16 src, dst; |
| 1750 | 1745 | UINT8 modrm = FETCH(cpustate); |
| 1751 | 1746 | if( modrm >= 0xc0 ) { |
| 1752 | src = LOAD_RM16(modrm) | |
| 1747 | src = LOAD_RM16(modrm) | |
| 1753 | 1748 | dst = LOAD_REG16(modrm); |
| 1754 | dst = S | |
| 1749 | dst = S | |
| 1755 | 1750 | STORE_REG16(modrm, dst); |
| 1756 | 1751 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1757 | 1752 | } else { |
| 1758 | 1753 | UINT32 ea = GetEA(cpustate,modrm); |
| 1759 | src = READ16(cpustate,ea) | |
| 1754 | src = READ16(cpustate,ea) | |
| 1760 | 1755 | dst = LOAD_REG16(modrm); |
| 1761 | dst = S | |
| 1756 | dst = S | |
| 1762 | 1757 | STORE_REG16(modrm, dst); |
| 1763 | 1758 | CYCLES(cpustate,CYCLES_ALU_MEM_REG); |
| 1764 | 1759 | } |
| r5613 | r5614 | |
| 1767 | 1762 | static void I386OP(sbb_ax_i16)(i386_state *cpustate) // Opcode 0x1d |
| 1768 | 1763 | { |
| 1769 | 1764 | UINT16 src, dst; |
| 1770 | src = FETCH16(cpustate) | |
| 1765 | src = FETCH16(cpustate) | |
| 1771 | 1766 | dst = REG16(AX); |
| 1772 | dst = S | |
| 1767 | dst = S | |
| 1773 | 1768 | REG16(AX) = dst; |
| 1774 | 1769 | CYCLES(cpustate,CYCLES_ALU_IMM_ACC); |
| 1775 | 1770 | } |
| r5613 | r5614 | |
| 2210 | 2205 | if( modrm >= 0xc0 ) { |
| 2211 | 2206 | dst = LOAD_RM16(modrm); |
| 2212 | 2207 | src = FETCH16(cpustate); |
| 2213 | src = ADD16(cpustate,src, cpustate->CF); | |
| 2214 | dst = ADD16(cpustate,dst, src); | |
| 2208 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 2215 | 2209 | STORE_RM16(modrm, dst); |
| 2216 | 2210 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2217 | 2211 | } else { |
| 2218 | 2212 | ea = GetEA(cpustate,modrm); |
| 2219 | 2213 | dst = READ16(cpustate,ea); |
| 2220 | 2214 | src = FETCH16(cpustate); |
| 2221 | src = ADD16(cpustate,src, cpustate->CF); | |
| 2222 | dst = ADD16(cpustate,dst, src); | |
| 2215 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 2223 | 2216 | WRITE16(cpustate,ea, dst); |
| 2224 | 2217 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2225 | 2218 | } |
| r5613 | r5614 | |
| 2227 | 2220 | case 3: // SBB Rm16, i16 |
| 2228 | 2221 | if( modrm >= 0xc0 ) { |
| 2229 | 2222 | dst = LOAD_RM16(modrm); |
| 2230 | src = FETCH16(cpustate) + cpustate->CF; | |
| 2231 | dst = SUB16(cpustate,dst, src); | |
| 2223 | src = FETCH16(cpustate); | |
| 2224 | dst = SBB16(cpustate, dst, src, cpustate->CF); | |
| 2232 | 2225 | STORE_RM16(modrm, dst); |
| 2233 | 2226 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2234 | 2227 | } else { |
| 2235 | 2228 | ea = GetEA(cpustate,modrm); |
| 2236 | 2229 | dst = READ16(cpustate,ea); |
| 2237 | src = FETCH16(cpustate) + cpustate->CF; | |
| 2238 | dst = SUB16(cpustate,dst, src); | |
| 2230 | src = FETCH16(cpustate); | |
| 2231 | dst = SBB16(cpustate, dst, src, cpustate->CF); | |
| 2239 | 2232 | WRITE16(cpustate,ea, dst); |
| 2240 | 2233 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2241 | 2234 | } |
| r5613 | r5614 | |
| 2349 | 2342 | if( modrm >= 0xc0 ) { |
| 2350 | 2343 | dst = LOAD_RM16(modrm); |
| 2351 | 2344 | src = (UINT16)(INT16)(INT8)FETCH(cpustate); |
| 2352 | src = ADD16(cpustate,src, cpustate->CF); | |
| 2353 | dst = ADD16(cpustate,dst, src); | |
| 2345 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 2354 | 2346 | STORE_RM16(modrm, dst); |
| 2355 | 2347 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2356 | 2348 | } else { |
| 2357 | 2349 | ea = GetEA(cpustate,modrm); |
| 2358 | 2350 | dst = READ16(cpustate,ea); |
| 2359 | 2351 | src = (UINT16)(INT16)(INT8)FETCH(cpustate); |
| 2360 | src = ADD16(cpustate,src, cpustate->CF); | |
| 2361 | dst = ADD16(cpustate,dst, src); | |
| 2352 | dst = ADC16(cpustate, dst, src, cpustate->CF); | |
| 2362 | 2353 | WRITE16(cpustate,ea, dst); |
| 2363 | 2354 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2364 | 2355 | } |
| r5613 | r5614 | |
| 2366 | 2357 | case 3: // SBB Rm16, i16 |
| 2367 | 2358 | if( modrm >= 0xc0 ) { |
| 2368 | 2359 | dst = LOAD_RM16(modrm); |
| 2369 | src = ((UINT16)(INT16)(INT8)FETCH(cpustate)) + cpustate->CF; | |
| 2370 | dst = SUB16(cpustate,dst, src); | |
| 2360 | src = ((UINT16)(INT16)(INT8)FETCH(cpustate)); | |
| 2361 | dst = SBB16(cpustate, dst, src, cpustate->CF); | |
| 2371 | 2362 | STORE_RM16(modrm, dst); |
| 2372 | 2363 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2373 | 2364 | } else { |
| 2374 | 2365 | ea = GetEA(cpustate,modrm); |
| 2375 | 2366 | dst = READ16(cpustate,ea); |
| 2376 | src = ((UINT16)(INT16)(INT8)FETCH(cpustate)) + cpustate->CF; | |
| 2377 | dst = SUB16(cpustate,dst, src); | |
| 2367 | src = ((UINT16)(INT16)(INT8)FETCH(cpustate)); | |
| 2368 | dst = SBB16(cpustate, dst, src, cpustate->CF); | |
| 2378 | 2369 | WRITE16(cpustate,ea, dst); |
| 2379 | 2370 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2380 | 2371 | } |
| r5613 | r5614 | |
|---|---|---|
| 691 | 691 | return res; |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | INLINE UINT8 SUB8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 694 | #define SUB8(cpu, dst, src) SBB8(cpu, dst, src, 0) | |
| 695 | INLINE UINT8 SBB8(i386_state *cpustate,UINT8 dst, UINT8 src, UINT8 b) | |
| 695 | 696 | { |
| 696 | UINT16 res = (UINT16)dst - (UINT16)src; | |
| 697 | UINT16 res = (UINT16)dst - (UINT16)src - (UINT8)b; | |
| 697 | 698 | SetCF8(res); |
| 698 | 699 | SetOF_Sub8(res,src,dst); |
| 699 | 700 | SetAF(res,src,dst); |
| 700 | 701 | SetSZPF8(res); |
| 701 | 702 | return (UINT8)res; |
| 702 | 703 | } |
| 703 | INLINE UINT16 SUB16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 704 | ||
| 705 | #define SUB16(cpu, dst, src) SBB16(cpu, dst, src, 0) | |
| 706 | INLINE UINT16 SBB16(i386_state *cpustate,UINT16 dst, UINT16 src, UINT16 b) | |
| 704 | 707 | { |
| 705 | UINT32 res = (UINT32)dst - (UINT32)src; | |
| 708 | UINT32 res = (UINT32)dst - (UINT32)src - (UINT32)b; | |
| 706 | 709 | SetCF16(res); |
| 707 | 710 | SetOF_Sub16(res,src,dst); |
| 708 | 711 | SetAF(res,src,dst); |
| 709 | 712 | SetSZPF16(res); |
| 710 | 713 | return (UINT16)res; |
| 711 | 714 | } |
| 712 | INLINE UINT32 SUB32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 715 | ||
| 716 | #define SUB32(cpu, dst, src) SBB32(cpu, dst, src, 0) | |
| 717 | INLINE UINT32 SBB32(i386_state *cpustate,UINT32 dst, UINT32 src, UINT32 b) | |
| 713 | 718 | { |
| 714 | UINT64 res = (UINT64)dst - (UINT64)src; | |
| 719 | UINT64 res = (UINT64)dst - (UINT64)src - (UINT64) b; | |
| 715 | 720 | SetCF32(res); |
| 716 | 721 | SetOF_Sub32(res,src,dst); |
| 717 | 722 | SetAF(res,src,dst); |
| r5613 | r5614 | |
| 719 | 724 | return (UINT32)res; |
| 720 | 725 | } |
| 721 | 726 | |
| 722 | INLINE UINT8 ADD8(i386_state *cpustate,UINT8 dst, UINT8 src) | |
| 727 | #define ADD8(cpu, dst, src) ADC8(cpu, dst, src, 0) | |
| 728 | INLINE UINT8 ADC8(i386_state *cpustate,UINT8 dst, UINT8 src, UINT8 c) | |
| 723 | 729 | { |
| 724 | UINT16 res = (UINT16)dst + (UINT16)src; | |
| 730 | UINT16 res = (UINT16)dst + (UINT16)src + (UINT16)c; | |
| 725 | 731 | SetCF8(res); |
| 726 | 732 | SetOF_Add8(res,src,dst); |
| 727 | 733 | SetAF(res,src,dst); |
| 728 | 734 | SetSZPF8(res); |
| 729 | 735 | return (UINT8)res; |
| 730 | 736 | } |
| 731 | INLINE UINT16 ADD16(i386_state *cpustate,UINT16 dst, UINT16 src) | |
| 737 | ||
| 738 | #define ADD16(cpu, dst, src) ADC16(cpu, dst, src, 0) | |
| 739 | INLINE UINT16 ADC16(i386_state *cpustate,UINT16 dst, UINT16 src, UINT8 c) | |
| 732 | 740 | { |
| 733 | UINT32 res = (UINT32)dst + (UINT32)src; | |
| 741 | UINT32 res = (UINT32)dst + (UINT32)src + (UINT32)c; | |
| 734 | 742 | SetCF16(res); |
| 735 | 743 | SetOF_Add16(res,src,dst); |
| 736 | 744 | SetAF(res,src,dst); |
| 737 | 745 | SetSZPF16(res); |
| 738 | 746 | return (UINT16)res; |
| 739 | 747 | } |
| 740 | INLINE UINT32 ADD32(i386_state *cpustate,UINT32 dst, UINT32 src) | |
| 748 | ||
| 749 | #define ADD32(cpu, dst, src) ADC32(cpu, dst, src, 0) | |
| 750 | INLINE UINT32 ADC32(i386_state *cpustate,UINT32 dst, UINT32 src, UINT32 c) | |
| 741 | 751 | { |
| 742 | UINT64 res = (UINT64)dst + (UINT64)src; | |
| 752 | UINT64 res = (UINT64)dst + (UINT64)src + (UINT64) c; | |
| 743 | 753 | SetCF32(res); |
| 744 | 754 | SetOF_Add32(res,src,dst); |
| 745 | 755 | SetAF(res,src,dst); |
| r5613 | r5614 | |
|---|---|---|
| 121 | 121 | if( modrm >= 0xc0 ) { |
| 122 | 122 | src = LOAD_REG8(modrm); |
| 123 | 123 | dst = LOAD_RM8(modrm); |
| 124 | src = ADD8(cpustate,src, cpustate->CF); | |
| 125 | dst = ADD8(cpustate,dst, src); | |
| 124 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 126 | 125 | STORE_RM8(modrm, dst); |
| 127 | 126 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 128 | 127 | } else { |
| 129 | 128 | UINT32 ea = GetEA(cpustate,modrm); |
| 130 | 129 | src = LOAD_REG8(modrm); |
| 131 | 130 | dst = READ8(cpustate,ea); |
| 132 | src = ADD8(cpustate,src, cpustate->CF); | |
| 133 | dst = ADD8(cpustate,dst, src); | |
| 131 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 134 | 132 | WRITE8(cpustate,ea, dst); |
| 135 | 133 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 136 | 134 | } |
| r5613 | r5614 | |
| 143 | 141 | if( modrm >= 0xc0 ) { |
| 144 | 142 | src = LOAD_RM8(modrm); |
| 145 | 143 | dst = LOAD_REG8(modrm); |
| 146 | src = ADD8(cpustate,src, cpustate->CF); | |
| 147 | dst = ADD8(cpustate,dst, src); | |
| 144 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 148 | 145 | STORE_REG8(modrm, dst); |
| 149 | 146 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 150 | 147 | } else { |
| 151 | 148 | UINT32 ea = GetEA(cpustate,modrm); |
| 152 | 149 | src = READ8(cpustate,ea); |
| 153 | 150 | dst = LOAD_REG8(modrm); |
| 154 | src = ADD8(cpustate,src, cpustate->CF); | |
| 155 | dst = ADD8(cpustate,dst, src); | |
| 151 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 156 | 152 | STORE_REG8(modrm, dst); |
| 157 | 153 | CYCLES(cpustate,CYCLES_ALU_MEM_REG); |
| 158 | 154 | } |
| r5613 | r5614 | |
| 163 | 159 | UINT8 src, dst; |
| 164 | 160 | src = FETCH(cpustate); |
| 165 | 161 | dst = REG8(AL); |
| 166 | src = ADD8(cpustate,src, cpustate->CF); | |
| 167 | dst = ADD8(cpustate,dst, src); | |
| 162 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 168 | 163 | REG8(AL) = dst; |
| 169 | 164 | CYCLES(cpustate,CYCLES_ALU_IMM_ACC); |
| 170 | 165 | } |
| r5613 | r5614 | |
| 1141 | 1136 | UINT8 src, dst; |
| 1142 | 1137 | UINT8 modrm = FETCH(cpustate); |
| 1143 | 1138 | if( modrm >= 0xc0 ) { |
| 1144 | src = LOAD_REG8(modrm) | |
| 1139 | src = LOAD_REG8(modrm) | |
| 1145 | 1140 | dst = LOAD_RM8(modrm); |
| 1146 | dst = S | |
| 1141 | dst = S | |
| 1147 | 1142 | STORE_RM8(modrm, dst); |
| 1148 | 1143 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1149 | 1144 | } else { |
| 1150 | 1145 | UINT32 ea = GetEA(cpustate,modrm); |
| 1151 | src = LOAD_REG8(modrm) | |
| 1146 | src = LOAD_REG8(modrm) | |
| 1152 | 1147 | dst = READ8(cpustate,ea); |
| 1153 | dst = S | |
| 1148 | dst = S | |
| 1154 | 1149 | WRITE8(cpustate,ea, dst); |
| 1155 | 1150 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 1156 | 1151 | } |
| r5613 | r5614 | |
| 1161 | 1156 | UINT8 src, dst; |
| 1162 | 1157 | UINT8 modrm = FETCH(cpustate); |
| 1163 | 1158 | if( modrm >= 0xc0 ) { |
| 1164 | src = LOAD_RM8(modrm) | |
| 1159 | src = LOAD_RM8(modrm) | |
| 1165 | 1160 | dst = LOAD_REG8(modrm); |
| 1166 | dst = S | |
| 1161 | dst = S | |
| 1167 | 1162 | STORE_REG8(modrm, dst); |
| 1168 | 1163 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1169 | 1164 | } else { |
| 1170 | 1165 | UINT32 ea = GetEA(cpustate,modrm); |
| 1171 | src = READ8(cpustate,ea) | |
| 1166 | src = READ8(cpustate,ea) | |
| 1172 | 1167 | dst = LOAD_REG8(modrm); |
| 1173 | dst = S | |
| 1168 | dst = S | |
| 1174 | 1169 | STORE_REG8(modrm, dst); |
| 1175 | 1170 | CYCLES(cpustate,CYCLES_ALU_MEM_REG); |
| 1176 | 1171 | } |
| r5613 | r5614 | |
| 1179 | 1174 | static void I386OP(sbb_al_i8)(i386_state *cpustate) // Opcode 0x1c |
| 1180 | 1175 | { |
| 1181 | 1176 | UINT8 src, dst; |
| 1182 | src = FETCH(cpustate) | |
| 1177 | src = FETCH(cpustate) | |
| 1183 | 1178 | dst = REG8(AL); |
| 1184 | dst = S | |
| 1179 | dst = S | |
| 1185 | 1180 | REG8(EAX) = dst; |
| 1186 | 1181 | CYCLES(cpustate,CYCLES_ALU_IMM_ACC); |
| 1187 | 1182 | } |
| r5613 | r5614 | |
| 1707 | 1702 | if( modrm >= 0xc0 ) { |
| 1708 | 1703 | dst = LOAD_RM8(modrm); |
| 1709 | 1704 | src = FETCH(cpustate); |
| 1710 | src = ADD8(cpustate,src, cpustate->CF); | |
| 1711 | dst = ADD8(cpustate,dst, src); | |
| 1705 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 1712 | 1706 | STORE_RM8(modrm, dst); |
| 1713 | 1707 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1714 | 1708 | } else { |
| 1715 | 1709 | ea = GetEA(cpustate,modrm); |
| 1716 | 1710 | dst = READ8(cpustate,ea); |
| 1717 | 1711 | src = FETCH(cpustate); |
| 1718 | src = ADD8(cpustate,src, cpustate->CF); | |
| 1719 | dst = ADD8(cpustate,dst, src); | |
| 1712 | dst = ADC8(cpustate, dst, src, cpustate->CF); | |
| 1720 | 1713 | WRITE8(cpustate,ea, dst); |
| 1721 | 1714 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 1722 | 1715 | } |
| r5613 | r5614 | |
| 1724 | 1717 | case 3: // SBB Rm8, i8 |
| 1725 | 1718 | if( modrm >= 0xc0 ) { |
| 1726 | 1719 | dst = LOAD_RM8(modrm); |
| 1727 | src = FETCH(cpustate) + cpustate->CF; | |
| 1728 | dst = SUB8(cpustate,dst, src); | |
| 1720 | src = FETCH(cpustate); | |
| 1721 | dst = SBB8(cpustate, dst, src, cpustate->CF); | |
| 1729 | 1722 | STORE_RM8(modrm, dst); |
| 1730 | 1723 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1731 | 1724 | } else { |
| 1732 | 1725 | ea = GetEA(cpustate,modrm); |
| 1733 | 1726 | dst = READ8(cpustate,ea); |
| 1734 | src = FETCH(cpustate) + cpustate->CF; | |
| 1735 | dst = SUB8(cpustate,dst, src); | |
| 1727 | src = FETCH(cpustate); | |
| 1728 | dst = SBB8(cpustate, dst, src, cpustate->CF); | |
| 1736 | 1729 | WRITE8(cpustate,ea, dst); |
| 1737 | 1730 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 1738 | 1731 | } |
| r5613 | r5614 | |
|---|---|---|
| 122 | 122 | if( modrm >= 0xc0 ) { |
| 123 | 123 | src = LOAD_REG32(modrm); |
| 124 | 124 | dst = LOAD_RM32(modrm); |
| 125 | src = ADD32(cpustate,src, cpustate->CF); | |
| 126 | dst = ADD32(cpustate,dst, src); | |
| 125 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 127 | 126 | STORE_RM32(modrm, dst); |
| 128 | 127 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 129 | 128 | } else { |
| 130 | 129 | UINT32 ea = GetEA(cpustate,modrm); |
| 131 | 130 | src = LOAD_REG32(modrm); |
| 132 | 131 | dst = READ32(cpustate,ea); |
| 133 | src = ADD32(cpustate,src, cpustate->CF); | |
| 134 | dst = ADD32(cpustate,dst, src); | |
| 132 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 135 | 133 | WRITE32(cpustate,ea, dst); |
| 136 | 134 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 137 | 135 | } |
| r5613 | r5614 | |
| 144 | 142 | if( modrm >= 0xc0 ) { |
| 145 | 143 | src = LOAD_RM32(modrm); |
| 146 | 144 | dst = LOAD_REG32(modrm); |
| 147 | src = ADD32(cpustate,src, cpustate->CF); | |
| 148 | dst = ADD32(cpustate,dst, src); | |
| 145 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 149 | 146 | STORE_REG32(modrm, dst); |
| 150 | 147 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 151 | 148 | } else { |
| 152 | 149 | UINT32 ea = GetEA(cpustate,modrm); |
| 153 | 150 | src = READ32(cpustate,ea); |
| 154 | 151 | dst = LOAD_REG32(modrm); |
| 155 | src = ADD32(cpustate,src, cpustate->CF); | |
| 156 | dst = ADD32(cpustate,dst, src); | |
| 152 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 157 | 153 | STORE_REG32(modrm, dst); |
| 158 | 154 | CYCLES(cpustate,CYCLES_ALU_MEM_REG); |
| 159 | 155 | } |
| r5613 | r5614 | |
| 164 | 160 | UINT32 src, dst; |
| 165 | 161 | src = FETCH32(cpustate); |
| 166 | 162 | dst = REG32(EAX); |
| 167 | src = ADD32(cpustate,src, cpustate->CF); | |
| 168 | dst = ADD32(cpustate,dst, src); | |
| 163 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 169 | 164 | REG32(EAX) = dst; |
| 170 | 165 | CYCLES(cpustate,CYCLES_ALU_IMM_ACC); |
| 171 | 166 | } |
| r5613 | r5614 | |
| 1026 | 1021 | static void I386OP(loop32)(i386_state *cpustate) // Opcode 0xe2 |
| 1027 | 1022 | { |
| 1028 | 1023 | INT8 disp = FETCH(cpustate); |
| 1029 | REG32(ECX)--; | |
| 1030 | if( REG32(ECX) != 0 ) { | |
| 1024 | INT32 reg = (cpustate->address_size)?--REG32(ECX):--REG16(CX); | |
| 1025 | if( reg != 0 ) { | |
| 1031 | 1026 | cpustate->eip += disp; |
| 1032 | 1027 | CHANGE_PC(cpustate,cpustate->eip); |
| 1033 | 1028 | } |
| r5613 | r5614 | |
| 1037 | 1032 | static void I386OP(loopne32)(i386_state *cpustate) // Opcode 0xe0 |
| 1038 | 1033 | { |
| 1039 | 1034 | INT8 disp = FETCH(cpustate); |
| 1040 | REG32(ECX)--; | |
| 1041 | if( REG32(ECX) != 0 && cpustate->ZF == 0 ) { | |
| 1035 | INT32 reg = (cpustate->address_size)?--REG32(ECX):--REG16(CX); | |
| 1036 | if( reg != 0 && cpustate->ZF == 0 ) { | |
| 1042 | 1037 | cpustate->eip += disp; |
| 1043 | 1038 | CHANGE_PC(cpustate,cpustate->eip); |
| 1044 | 1039 | } |
| r5613 | r5614 | |
| 1048 | 1043 | static void I386OP(loopz32)(i386_state *cpustate) // Opcode 0xe1 |
| 1049 | 1044 | { |
| 1050 | 1045 | INT8 disp = FETCH(cpustate); |
| 1051 | REG32(ECX)--; | |
| 1052 | if( REG32(ECX) != 0 && cpustate->ZF != 0 ) { | |
| 1046 | INT32 reg = (cpustate->address_size)?--REG32(ECX):--REG16(CX); | |
| 1047 | if( reg != 0 && cpustate->ZF != 0 ) { | |
| 1053 | 1048 | cpustate->eip += disp; |
| 1054 | 1049 | CHANGE_PC(cpustate,cpustate->eip); |
| 1055 | 1050 | } |
| r5613 | r5614 | |
| 1596 | 1591 | UINT32 src, dst; |
| 1597 | 1592 | UINT8 modrm = FETCH(cpustate); |
| 1598 | 1593 | if( modrm >= 0xc0 ) { |
| 1599 | src = LOAD_REG32(modrm) | |
| 1594 | src = LOAD_REG32(modrm) | |
| 1600 | 1595 | dst = LOAD_RM32(modrm); |
| 1601 | dst = S | |
| 1596 | dst = S | |
| 1602 | 1597 | STORE_RM32(modrm, dst); |
| 1603 | 1598 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1604 | 1599 | } else { |
| 1605 | 1600 | UINT32 ea = GetEA(cpustate,modrm); |
| 1606 | src = LOAD_REG32(modrm) | |
| 1601 | src = LOAD_REG32(modrm) | |
| 1607 | 1602 | dst = READ32(cpustate,ea); |
| 1608 | dst = S | |
| 1603 | dst = S | |
| 1609 | 1604 | WRITE32(cpustate,ea, dst); |
| 1610 | 1605 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 1611 | 1606 | } |
| r5613 | r5614 | |
| 1616 | 1611 | UINT32 src, dst; |
| 1617 | 1612 | UINT8 modrm = FETCH(cpustate); |
| 1618 | 1613 | if( modrm >= 0xc0 ) { |
| 1619 | src = LOAD_RM32(modrm) | |
| 1614 | src = LOAD_RM32(modrm) | |
| 1620 | 1615 | dst = LOAD_REG32(modrm); |
| 1621 | dst = S | |
| 1616 | dst = S | |
| 1622 | 1617 | STORE_REG32(modrm, dst); |
| 1623 | 1618 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 1624 | 1619 | } else { |
| 1625 | 1620 | UINT32 ea = GetEA(cpustate,modrm); |
| 1626 | src = READ32(cpustate,ea) | |
| 1621 | src = READ32(cpustate,ea) | |
| 1627 | 1622 | dst = LOAD_REG32(modrm); |
| 1628 | dst = S | |
| 1623 | dst = S | |
| 1629 | 1624 | STORE_REG32(modrm, dst); |
| 1630 | 1625 | CYCLES(cpustate,CYCLES_ALU_MEM_REG); |
| 1631 | 1626 | } |
| r5613 | r5614 | |
| 1634 | 1629 | static void I386OP(sbb_eax_i32)(i386_state *cpustate) // Opcode 0x1d |
| 1635 | 1630 | { |
| 1636 | 1631 | UINT32 src, dst; |
| 1637 | src = FETCH32(cpustate) | |
| 1632 | src = FETCH32(cpustate) | |
| 1638 | 1633 | dst = REG32(EAX); |
| 1639 | dst = S | |
| 1634 | dst = S | |
| 1640 | 1635 | REG32(EAX) = dst; |
| 1641 | 1636 | CYCLES(cpustate,CYCLES_ALU_IMM_ACC); |
| 1642 | 1637 | } |
| r5613 | r5614 | |
| 2059 | 2054 | if( modrm >= 0xc0 ) { |
| 2060 | 2055 | dst = LOAD_RM32(modrm); |
| 2061 | 2056 | src = FETCH32(cpustate); |
| 2062 | src = ADD32(cpustate,src, cpustate->CF); | |
| 2063 | dst = ADD32(cpustate,dst, src); | |
| 2057 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 2064 | 2058 | STORE_RM32(modrm, dst); |
| 2065 | 2059 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2066 | 2060 | } else { |
| 2067 | 2061 | ea = GetEA(cpustate,modrm); |
| 2068 | 2062 | dst = READ32(cpustate,ea); |
| 2069 | 2063 | src = FETCH32(cpustate); |
| 2070 | src = ADD32(cpustate,src, cpustate->CF); | |
| 2071 | dst = ADD32(cpustate,dst, src); | |
| 2064 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 2072 | 2065 | WRITE32(cpustate,ea, dst); |
| 2073 | 2066 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2074 | 2067 | } |
| r5613 | r5614 | |
| 2076 | 2069 | case 3: // SBB Rm32, i32 |
| 2077 | 2070 | if( modrm >= 0xc0 ) { |
| 2078 | 2071 | dst = LOAD_RM32(modrm); |
| 2079 | src = FETCH32(cpustate) + cpustate->CF; | |
| 2080 | dst = SUB32(cpustate,dst, src); | |
| 2072 | src = FETCH32(cpustate); | |
| 2073 | dst = SBB32(cpustate, dst, src, cpustate->CF); | |
| 2081 | 2074 | STORE_RM32(modrm, dst); |
| 2082 | 2075 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2083 | 2076 | } else { |
| 2084 | 2077 | ea = GetEA(cpustate,modrm); |
| 2085 | 2078 | dst = READ32(cpustate,ea); |
| 2086 | src = FETCH32(cpustate) + cpustate->CF; | |
| 2087 | dst = SUB32(cpustate,dst, src); | |
| 2079 | src = FETCH32(cpustate); | |
| 2080 | dst = SBB32(cpustate, dst, src, cpustate->CF); | |
| 2088 | 2081 | WRITE32(cpustate,ea, dst); |
| 2089 | 2082 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2090 | 2083 | } |
| r5613 | r5614 | |
| 2198 | 2191 | if( modrm >= 0xc0 ) { |
| 2199 | 2192 | dst = LOAD_RM32(modrm); |
| 2200 | 2193 | src = (UINT32)(INT32)(INT8)FETCH(cpustate); |
| 2201 | src = ADD32(cpustate,src, cpustate->CF); | |
| 2202 | dst = ADD32(cpustate,dst, src); | |
| 2194 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 2203 | 2195 | STORE_RM32(modrm, dst); |
| 2204 | 2196 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2205 | 2197 | } else { |
| 2206 | 2198 | ea = GetEA(cpustate,modrm); |
| 2207 | 2199 | dst = READ32(cpustate,ea); |
| 2208 | 2200 | src = (UINT32)(INT32)(INT8)FETCH(cpustate); |
| 2209 | src = ADD32(cpustate,src, cpustate->CF); | |
| 2210 | dst = ADD32(cpustate,dst, src); | |
| 2201 | dst = ADC32(cpustate, dst, src, cpustate->CF); | |
| 2211 | 2202 | WRITE32(cpustate,ea, dst); |
| 2212 | 2203 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2213 | 2204 | } |
| r5613 | r5614 | |
| 2215 | 2206 | case 3: // SBB Rm32, i32 |
| 2216 | 2207 | if( modrm >= 0xc0 ) { |
| 2217 | 2208 | dst = LOAD_RM32(modrm); |
| 2218 | src = ((UINT32)(INT32)(INT8)FETCH(cpustate)) + cpustate->CF; | |
| 2219 | dst = SUB32(cpustate,dst, src); | |
| 2209 | src = ((UINT32)(INT32)(INT8)FETCH(cpustate)); | |
| 2210 | dst = SBB32(cpustate, dst, src, cpustate->CF); | |
| 2220 | 2211 | STORE_RM32(modrm, dst); |
| 2221 | 2212 | CYCLES(cpustate,CYCLES_ALU_REG_REG); |
| 2222 | 2213 | } else { |
| 2223 | 2214 | ea = GetEA(cpustate,modrm); |
| 2224 | 2215 | dst = READ32(cpustate,ea); |
| 2225 | src = ((UINT32)(INT32)(INT8)FETCH(cpustate)) + cpustate->CF; | |
| 2226 | dst = SUB32(cpustate,dst, src); | |
| 2216 | src = ((UINT32)(INT32)(INT8)FETCH(cpustate)); | |
| 2217 | dst = SBB32(cpustate, dst, src, cpustate->CF); | |
| 2227 | 2218 | WRITE32(cpustate,ea, dst); |
| 2228 | 2219 | CYCLES(cpustate,CYCLES_ALU_REG_MEM); |
| 2229 | 2220 | } |
| r5613 | r5614 | |
|---|---|---|
| 5 | 5 | |
| 6 | 6 | #include "cpuintrf.h" |
| 7 | 7 | |
| 8 | ||
| 8 | CPU | |
| 9 | 9 | |
| 10 | 10 | CPU_GET_INFO( mc68hc11 ); |
| 11 | 11 | #define CPU_MC68HC11 CPU_GET_INFO_NAME( mc68hc11 ) |
| r5613 | r5614 | |
|---|---|---|
| 1283 | 1283 | return flags; |
| 1284 | 1284 | } |
| 1285 | 1285 | |
| 1286 | ||
| 1286 | CPU | |
| 1287 | 1287 | { |
| 1288 | 1288 | UINT32 flags = 0; |
| 1289 | 1289 | UINT8 opcode; |
| r5613 | r5614 | |
|---|---|---|
| 582 | 582 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(hc11); break; |
| 583 | 583 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(hc11); break; |
| 584 | 584 | case CPUINFO_FCT_BURN: info->burn = NULL; break; |
| 585 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = hc11 | |
| 585 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(hc11) | |
| 586 | 586 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 587 | 587 | |
| 588 | 588 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| r5613 | r5614 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "cpuintrf.h" |
| 10 | 10 | |
| 11 | #define USE_ABI_REG_NAMES (1) | |
| 11 | 12 | |
| 13 | #if USE_ABI_REG_NAMES | |
| 12 | 14 | static const char *const reg[32] = |
| 13 | 15 | { |
| 14 | 16 | "$0", "$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3", |
| r5613 | r5614 | |
| 16 | 18 | "$s0", "$s1", "$s2", "$s3", "$s4", "$s5", "$s6", "$s7", |
| 17 | 19 | "$t8", "$t9", "$k0", "$k1", "$gp", "$sp", "$fp", "$ra" |
| 18 | 20 | }; |
| 21 | #else | |
| 22 | static const char *const reg[32] = | |
| 23 | { | |
| 24 | "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", | |
| 25 | "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", | |
| 26 | "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", | |
| 27 | "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" | |
| 28 | }; | |
| 29 | #endif | |
| 19 | 30 | |
| 20 | 31 | |
| 32 | ||
| 21 | 33 | static const char *const cpreg[4][32] = |
| 22 | 34 | { |
| 23 | 35 | { |
| r5613 | r5614 | |
|---|---|---|
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | 18 | #define PRINTF_TLB (0) |
| 19 | #define USE_ABI_REG_NAMES (1) | |
| 19 | 20 | |
| 20 | 21 | |
| 21 | ||
| 22 | 22 | /*************************************************************************** |
| 23 | 23 | FUNCTION PROTOTYPES |
| 24 | 24 | ***************************************************************************/ |
| r5613 | r5614 | |
| 558 | 558 | case CPUINFO_STR_REGISTER + MIPS3_WIRED: sprintf(info->s, "Wired:%08X", (UINT32)mips->cpr[0][COP0_Wired]); break; |
| 559 | 559 | case CPUINFO_STR_REGISTER + MIPS3_BADVADDR: sprintf(info->s, "BadVAddr:%08X", (UINT32)mips->cpr[0][COP0_BadVAddr]); break; |
| 560 | 560 | |
| 561 | #if USE_ABI_REG_NAMES | |
| 561 | 562 | case CPUINFO_STR_REGISTER + MIPS3_R0: sprintf(info->s, "$zero: %08X%08X", (UINT32)(mips->r[0] >> 32), (UINT32)mips->r[0]); break; |
| 562 | 563 | case CPUINFO_STR_REGISTER + MIPS3_R1: sprintf(info->s, " $at: %08X%08X", (UINT32)(mips->r[1] >> 32), (UINT32)mips->r[1]); break; |
| 563 | 564 | case CPUINFO_STR_REGISTER + MIPS3_R2: sprintf(info->s, " $v0: %08X%08X", (UINT32)(mips->r[2] >> 32), (UINT32)mips->r[2]); break; |
| r5613 | r5614 | |
| 590 | 591 | case CPUINFO_STR_REGISTER + MIPS3_R29: sprintf(info->s, " $sp:%08X%08X", (UINT32)(mips->r[29] >> 32), (UINT32)mips->r[29]); break; |
| 591 | 592 | case CPUINFO_STR_REGISTER + MIPS3_R30: sprintf(info->s, " $fp:%08X%08X", (UINT32)(mips->r[30] >> 32), (UINT32)mips->r[30]); break; |
| 592 | 593 | case CPUINFO_STR_REGISTER + MIPS3_R31: sprintf(info->s, " $ra:%08X%08X", (UINT32)(mips->r[31] >> 32), (UINT32)mips->r[31]); break; |
| 594 | #else | |
| 595 | case CPUINFO_STR_REGISTER + MIPS3_R0: sprintf(info->s, " R0: %08X%08X", (UINT32)(mips->r[0] >> 32), (UINT32)mips->r[0]); break; | |
| 596 | case CPUINFO_STR_REGISTER + MIPS3_R1: sprintf(info->s, " R1: %08X%08X", (UINT32)(mips->r[1] >> 32), (UINT32)mips->r[1]); break; | |
| 597 | case CPUINFO_STR_REGISTER + MIPS3_R2: sprintf(info->s, " R2: %08X%08X", (UINT32)(mips->r[2] >> 32), (UINT32)mips->r[2]); break; | |
| 598 | case CPUINFO_STR_REGISTER + MIPS3_R3: sprintf(info->s, " R3: %08X%08X", (UINT32)(mips->r[3] >> 32), (UINT32)mips->r[3]); break; | |
| 599 | case CPUINFO_STR_REGISTER + MIPS3_R4: sprintf(info->s, " R4: %08X%08X", (UINT32)(mips->r[4] >> 32), (UINT32)mips->r[4]); break; | |
| 600 | case CPUINFO_STR_REGISTER + MIPS3_R5: sprintf(info->s, " R5: %08X%08X", (UINT32)(mips->r[5] >> 32), (UINT32)mips->r[5]); break; | |
| 601 | case CPUINFO_STR_REGISTER + MIPS3_R6: sprintf(info->s, " R6: %08X%08X", (UINT32)(mips->r[6] >> 32), (UINT32)mips->r[6]); break; | |
| 602 | case CPUINFO_STR_REGISTER + MIPS3_R7: sprintf(info->s, " R7: %08X%08X", (UINT32)(mips->r[7] >> 32), (UINT32)mips->r[7]); break; | |
| 603 | case CPUINFO_STR_REGISTER + MIPS3_R8: sprintf(info->s, " R8: %08X%08X", (UINT32)(mips->r[8] >> 32), (UINT32)mips->r[8]); break; | |
| 604 | case CPUINFO_STR_REGISTER + MIPS3_R9: sprintf(info->s, " R9: %08X%08X", (UINT32)(mips->r[9] >> 32), (UINT32)mips->r[9]); break; | |
| 605 | case CPUINFO_STR_REGISTER + MIPS3_R10: sprintf(info->s, "R10: %08X%08X", (UINT32)(mips->r[10] >> 32), (UINT32)mips->r[10]); break; | |
| 606 | case CPUINFO_STR_REGISTER + MIPS3_R11: sprintf(info->s, "R11: %08X%08X", (UINT32)(mips->r[11] >> 32), (UINT32)mips->r[11]); break; | |
| 607 | case CPUINFO_STR_REGISTER + MIPS3_R12: sprintf(info->s, "R12: %08X%08X", (UINT32)(mips->r[12] >> 32), (UINT32)mips->r[12]); break; | |
| 608 | case CPUINFO_STR_REGISTER + MIPS3_R13: sprintf(info->s, "R13: %08X%08X", (UINT32)(mips->r[13] >> 32), (UINT32)mips->r[13]); break; | |
| 609 | case CPUINFO_STR_REGISTER + MIPS3_R14: sprintf(info->s, "R14: %08X%08X", (UINT32)(mips->r[14] >> 32), (UINT32)mips->r[14]); break; | |
| 610 | case CPUINFO_STR_REGISTER + MIPS3_R15: sprintf(info->s, "R15: %08X%08X", (UINT32)(mips->r[15] >> 32), (UINT32)mips->r[15]); break; | |
| 611 | case CPUINFO_STR_REGISTER + MIPS3_R16: sprintf(info->s, "R16: %08X%08X", (UINT32)(mips->r[16] >> 32), (UINT32)mips->r[16]); break; | |
| 612 | case CPUINFO_STR_REGISTER + MIPS3_R17: sprintf(info->s, "R17: %08X%08X", (UINT32)(mips->r[17] >> 32), (UINT32)mips->r[17]); break; | |
| 613 | case CPUINFO_STR_REGISTER + MIPS3_R18: sprintf(info->s, "R18: %08X%08X", (UINT32)(mips->r[18] >> 32), (UINT32)mips->r[18]); break; | |
| 614 | case CPUINFO_STR_REGISTER + MIPS3_R19: sprintf(info->s, "R19: %08X%08X", (UINT32)(mips->r[19] >> 32), (UINT32)mips->r[19]); break; | |
| 615 | case CPUINFO_STR_REGISTER + MIPS3_R20: sprintf(info->s, "R20: %08X%08X", (UINT32)(mips->r[20] >> 32), (UINT32)mips->r[20]); break; | |
| 616 | case CPUINFO_STR_REGISTER + MIPS3_R21: sprintf(info->s, "R21: %08X%08X", (UINT32)(mips->r[21] >> 32), (UINT32)mips->r[21]); break; | |
| 617 | case CPUINFO_STR_REGISTER + MIPS3_R22: sprintf(info->s, "R22: %08X%08X", (UINT32)(mips->r[22] >> 32), (UINT32)mips->r[22]); break; | |
| 618 | case CPUINFO_STR_REGISTER + MIPS3_R23: sprintf(info->s, "R23: %08X%08X", (UINT32)(mips->r[23] >> 32), (UINT32)mips->r[23]); break; | |
| 619 | case CPUINFO_STR_REGISTER + MIPS3_R24: sprintf(info->s, "R24: %08X%08X", (UINT32)(mips->r[24] >> 32), (UINT32)mips->r[24]); break; | |
| 620 | case CPUINFO_STR_REGISTER + MIPS3_R25: sprintf(info->s, "R25: %08X%08X", (UINT32)(mips->r[25] >> 32), (UINT32)mips->r[25]); break; | |
| 621 | case CPUINFO_STR_REGISTER + MIPS3_R26: sprintf(info->s, "R26: %08X%08X", (UINT32)(mips->r[26] >> 32), (UINT32)mips->r[26]); break; | |
| 622 | case CPUINFO_STR_REGISTER + MIPS3_R27: sprintf(info->s, "R27: %08X%08X", (UINT32)(mips->r[27] >> 32), (UINT32)mips->r[27]); break; | |
| 623 | case CPUINFO_STR_REGISTER + MIPS3_R28: sprintf(info->s, "R28: %08X%08X", (UINT32)(mips->r[28] >> 32), (UINT32)mips->r[28]); break; | |
| 624 | case CPUINFO_STR_REGISTER + MIPS3_R29: sprintf(info->s, "R29: %08X%08X", (UINT32)(mips->r[29] >> 32), (UINT32)mips->r[29]); break; | |
| 625 | case CPUINFO_STR_REGISTER + MIPS3_R30: sprintf(info->s, "R30: %08X%08X", (UINT32)(mips->r[30] >> 32), (UINT32)mips->r[30]); break; | |
| 626 | case CPUINFO_STR_REGISTER + MIPS3_R31: sprintf(info->s, "R31: %08X%08X", (UINT32)(mips->r[31] >> 32), (UINT32)mips->r[31]); break; | |
| 627 | #endif | |
| 593 | 628 | case CPUINFO_STR_REGISTER + MIPS3_HI: sprintf(info->s, "HI: %08X%08X", (UINT32)(mips->r[REG_HI] >> 32), (UINT32)mips->r[REG_HI]); break; |
| 594 | 629 | case CPUINFO_STR_REGISTER + MIPS3_LO: sprintf(info->s, "LO: %08X%08X", (UINT32)(mips->r[REG_LO] >> 32), (UINT32)mips->r[REG_LO]); break; |
| 595 | 630 |
| r5613 | r5614 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | /* |
| 11 | 11 | |
| 12 | ||
| 12 | TODO: | |
| 13 | 13 | |
| 14 | - strobed I/O | |
| 15 | - interrupts | |
| 16 | - expose register file to disassembler | |
| 17 | - decimal adjust instruction | |
| 18 | - timer Tin/Tout modes | |
| 19 | - serial | |
| 20 | - instruction pipeline | |
| 14 | - strobed I/O | |
| 15 | - interrupts | |
| 16 | - expose register file to disassembler | |
| 17 | - decimal adjust instruction | |
| 18 | - timer Tin/Tout modes | |
| 19 | - serial | |
| 20 | - instruction pipeline | |
| 21 | 21 | |
| 22 | 22 | */ |
| 23 | 23 | |
| r5613 | r5614 | |
| 107 | 107 | |
| 108 | 108 | #define Z8_P3M_P2_ACTIVE_PULLUPS 0x01 /* not supported */ |
| 109 | 109 | #define Z8_P3M_P0_STROBED 0x04 /* not supported */ |
| 110 | #define Z8_P3M_P1_MODE_MASK 0x18 | |
| 111 | //#define Z8_P3M_ 0x00 | |
| 112 | //#define Z8_P3M_ 0x08 | |
| 113 | //#define Z8_P3M_ 0x10 | |
| 114 | #define Z8_P3M_P1_STROBED 0x18 /* not supported */ | |
| 110 | #define Z8_P3M_P33_P34_MASK 0x18 | |
| 111 | #define Z8_P3M_P33_P34_INPUT_OUTPUT 0x00 | |
| 112 | #define Z8_P3M_P33_P34_INPUT_DM 0x08 /* not supported */ | |
| 113 | #define Z8_P3M_P33_P34_INPUT_DM_2 0x10 /* not supported */ | |
| 114 | #define Z8_P3M_P33_P34_DAV1_RDY1 0x18 /* not supported */ | |
| 115 | 115 | #define Z8_P3M_P2_STROBED 0x20 /* not supported */ |
| 116 | 116 | #define Z8_P3M_P3_SERIAL 0x40 /* not supported */ |
| 117 | 117 | #define Z8_P3M_PARITY 0x80 /* not supported */ |
| r5613 | r5614 | |
| 241 | 241 | assert(device != NULL); |
| 242 | 242 | assert(device->token != NULL); |
| 243 | 243 | assert(device->type == CPU); |
| 244 | assert((cpu_get_type(device) == CPU_Z8601) || | |
| 244 | assert((cpu_get_type(device) == CPU_Z8601) || | |
| 245 | 245 | (cpu_get_type(device) == CPU_UB8830D) || |
| 246 | 246 | (cpu_get_type(device) == CPU_Z8611)); |
| 247 | 247 | return (z8_state *)device->token; |
| r5613 | r5614 | |
| 294 | 294 | default: /* AD0..AD7 */ data = 0xff; break; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | if ((P3M & Z8_P3M_P | |
| 297 | if ((P3M & Z8_P3M_P33_P34 | |
| 298 | 298 | { |
| 299 | 299 | if (mask) cpustate->input[offset] = memory_read_byte_8be(cpustate->io, offset); |
| 300 | 300 | } |
| r5613 | r5614 | |
| 341 | 341 | case Z8_REGISTER_IPR: |
| 342 | 342 | /* write only */ |
| 343 | 343 | break; |
| 344 | ||
| 344 | ||
| 345 | 345 | default: |
| 346 | 346 | data = cpustate->r[offset]; |
| 347 | 347 | break; |
| r5613 | r5614 | |
| 382 | 382 | |
| 383 | 383 | case Z8_REGISTER_P3: |
| 384 | 384 | cpustate->output[offset] = data; |
| 385 | ||
| 385 | ||
| 386 | 386 | // TODO: special port 3 modes |
| 387 | 387 | if (!(P3M & 0x7c)) |
| 388 | 388 | { |
| r5613 | r5614 | |
| 394 | 394 | |
| 395 | 395 | case Z8_REGISTER_SIO: |
| 396 | 396 | break; |
| 397 | ||
| 397 | ||
| 398 | 398 | case Z8_REGISTER_TMR: |
| 399 | 399 | if (data & Z8_TMR_LOAD_T0) |
| 400 | { | |
| 400 | { | |
| 401 | 401 | cpustate->t0 = T0; |
| 402 | 402 | timer_adjust_periodic(cpustate->t0_timer, attotime_zero, 0, ATTOTIME_IN_HZ(cpustate->clock / 2 / 4 / ((PRE0 >> 2) + 1))); |
| 403 | 403 | } |
| r5613 | r5614 | |
| 405 | 405 | timer_enable(cpustate->t0_timer, data & Z8_TMR_ENABLE_T0); |
| 406 | 406 | |
| 407 | 407 | if (data & Z8_TMR_LOAD_T1) |
| 408 | { | |
| 408 | { | |
| 409 | 409 | cpustate->t1 = T1; |
| 410 | 410 | timer_adjust_periodic(cpustate->t1_timer, attotime_zero, 0, ATTOTIME_IN_HZ(cpustate->clock / 2 / 4 / ((PRE1 >> 2) + 1))); |
| 411 | 411 | } |
| r5613 | r5614 | |
| 597 | 597 | |
| 598 | 598 | static const z8_opcode_map Z8601_OPCODE_MAP[] = |
| 599 | 599 | { |
| 600 | { dec_R1, 6, 5 }, { dec_IR1, 6, 5 }, { add_r1_r2, 10, 5 }, { add_r1_Ir2, 10, 5 }, { add_R2_R1, 10, 5 }, { add_IR2_R1, 10, 5 }, { add_R1_IM, 10, 5 }, { add_IR1_IM, 10, 5 }, | |
| 601 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 600 | { dec_R1, 6, 5 }, { dec_IR1, 6, 5 }, { add_r1_r2, 10, 5 }, { add_r1_Ir2, 10, 5 }, { add_R2_R1, 10, 5 }, { add_IR2_R1, 10, 5 }, { add_R1_IM, 10, 5 }, { add_IR1_IM, 10, 5 }, | |
| 601 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 602 | 602 | |
| 603 | { rlc_R1, 6, 5 }, { rlc_IR1, 6, 5 }, { adc_r1_r2, 6, 5 }, { adc_r1_Ir2, 6, 5 }, { adc_R2_R1, 10, 5 }, { adc_IR2_R1, 10, 5 }, { adc_R1_IM, 10, 5 }, { adc_IR1_IM, 10, 5 }, | |
| 604 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 603 | { rlc_R1, 6, 5 }, { rlc_IR1, 6, 5 }, { adc_r1_r2, 6, 5 }, { adc_r1_Ir2, 6, 5 }, { adc_R2_R1, 10, 5 }, { adc_IR2_R1, 10, 5 }, { adc_R1_IM, 10, 5 }, { adc_IR1_IM, 10, 5 }, | |
| 604 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 605 | 605 | |
| 606 | { inc_R1, 6, 5 }, { inc_IR1, 6, 5 }, { sub_r1_r2, 6, 5 }, { sub_r1_Ir2, 6, 5 }, { sub_R2_R1, 10, 5 }, { sub_IR2_R1, 10, 5 }, { sub_R1_IM, 10, 5 }, { sub_IR1_IM, 10, 5 }, | |
| 607 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 606 | { inc_R1, 6, 5 }, { inc_IR1, 6, 5 }, { sub_r1_r2, 6, 5 }, { sub_r1_Ir2, 6, 5 }, { sub_R2_R1, 10, 5 }, { sub_IR2_R1, 10, 5 }, { sub_R1_IM, 10, 5 }, { sub_IR1_IM, 10, 5 }, | |
| 607 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 608 | 608 | |
| 609 | { jp_IRR1, 8, 0 }, { srp_IM, 6, 1 }, { sbc_r1_r2, 6, 5 }, { sbc_r1_Ir2, 6, 5 }, { sbc_R2_R1, 10, 5 }, { sbc_IR2_R1, 10, 5 }, { sbc_R1_IM, 10, 5 }, { sbc_IR1_IM, 10, 5 }, | |
| 610 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 609 | { jp_IRR1, 8, 0 }, { srp_IM, 6, 1 }, { sbc_r1_r2, 6, 5 }, { sbc_r1_Ir2, 6, 5 }, { sbc_R2_R1, 10, 5 }, { sbc_IR2_R1, 10, 5 }, { sbc_R1_IM, 10, 5 }, { sbc_IR1_IM, 10, 5 }, | |
| 610 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 611 | 611 | |
| 612 | { da_R1, 8, 5 }, { da_IR1, 8, 5 }, { or_r1_r2, 6, 5 }, { or_r1_Ir2, 6, 5 }, { or_R2_R1, 10, 5 }, { or_IR2_R1, 10, 5 }, { or_R1_IM, 10, 5 }, { or_IR1_IM, 10, 5 }, | |
| 613 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 612 | { da_R1, 8, 5 }, { da_IR1, 8, 5 }, { or_r1_r2, 6, 5 }, { or_r1_Ir2, 6, 5 }, { or_R2_R1, 10, 5 }, { or_IR2_R1, 10, 5 }, { or_R1_IM, 10, 5 }, { or_IR1_IM, 10, 5 }, | |
| 613 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 614 | 614 | |
| 615 | { pop_R1, 10, 5 }, { pop_IR1, 10, 5 }, { and_r1_r2, 6, 5 }, { and_r1_Ir2, 6, 5 }, { and_R2_R1, 10, 5 }, { and_IR2_R1, 10, 5 }, { and_R1_IM, 10, 5 }, { and_IR1_IM, 10, 5 }, | |
| 616 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 615 | { pop_R1, 10, 5 }, { pop_IR1, 10, 5 }, { and_r1_r2, 6, 5 }, { and_r1_Ir2, 6, 5 }, { and_R2_R1, 10, 5 }, { and_IR2_R1, 10, 5 }, { and_R1_IM, 10, 5 }, { and_IR1_IM, 10, 5 }, | |
| 616 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 617 | 617 | |
| 618 | { com_R1, 6, 5 }, { com_IR1, 6, 5 }, { tcm_r1_r2, 6, 5 }, { tcm_r1_Ir2, 6, 5 }, { tcm_R2_R1, 10, 5 }, { tcm_IR2_R1, 10, 5 }, { tcm_R1_IM, 10, 5 }, { tcm_IR1_IM, 10, 5 }, | |
| 619 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 618 | { com_R1, 6, 5 }, { com_IR1, 6, 5 }, { tcm_r1_r2, 6, 5 }, { tcm_r1_Ir2, 6, 5 }, { tcm_R2_R1, 10, 5 }, { tcm_IR2_R1, 10, 5 }, { tcm_R1_IM, 10, 5 }, { tcm_IR1_IM, 10, 5 }, | |
| 619 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 620 | 620 | |
| 621 | { push_R2, 10, 1 }, { push_IR2, 12, 1 },{ tm_r1_r2, 6, 5 }, { tm_r1_Ir2, 6, 5 }, { tm_R2_R1, 10, 5 }, { tm_IR2_R1, 10, 5 }, { tm_R1_IM, 10, 5 }, { tm_IR1_IM, 10, 5 }, | |
| 622 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 621 | { push_R2, 10, 1 }, { push_IR2, 12, 1 },{ tm_r1_r2, 6, 5 }, { tm_r1_Ir2, 6, 5 }, { tm_R2_R1, 10, 5 }, { tm_IR2_R1, 10, 5 }, { tm_R1_IM, 10, 5 }, { tm_IR1_IM, 10, 5 }, | |
| 622 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { illegal, 0, 0 }, | |
| 623 | 623 | |
| 624 | { decw_RR1, 10, 5 },{ decw_IR1, 10, 5 },{ lde_r1_Irr2, 12, 0 }, { ldei_Ir1_Irr2, 18, 0 },{ illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, | |
| 625 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { di, 6, 1 }, | |
| 624 | { decw_RR1, 10, 5 },{ decw_IR1, 10, 5 },{ lde_r1_Irr2, 12, 0 }, { ldei_Ir1_Irr2, 18, 0 },{ illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, | |
| 625 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { di, 6, 1 }, | |
| 626 | 626 | |
| 627 | { rl_R1, 6, 5 }, { rl_IR1, 6, 5 }, { lde_r2_Irr1, 12, 0 }, { ldei_Ir2_Irr1, 18, 0 },{ illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, | |
| 628 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { ei, 6, 1 }, | |
| 627 | { rl_R1, 6, 5 }, { rl_IR1, 6, 5 }, { lde_r2_Irr1, 12, 0 }, { ldei_Ir2_Irr1, 18, 0 },{ illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, | |
| 628 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { ei, 6, 1 }, | |
| 629 | 629 | |
| 630 | { incw_RR1, 10, 5 },{ incw_IR1, 10, 5 },{ cp_r1_r2, 6, 5 }, { cp_r1_Ir2, 6, 5 }, { cp_R2_R1, 10, 5 }, { cp_IR2_R1, 10, 5 }, { cp_R1_IM, 10, 5 }, { cp_IR1_IM, 10, 5 }, | |
| 631 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { ret, 14, 0 }, | |
| 630 | { incw_RR1, 10, 5 },{ incw_IR1, 10, 5 },{ cp_r1_r2, 6, 5 }, { cp_r1_Ir2, 6, 5 }, { cp_R2_R1, 10, 5 }, { cp_IR2_R1, 10, 5 }, { cp_R1_IM, 10, 5 }, { cp_IR1_IM, 10, 5 }, | |
| 631 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { ret, 14, 0 }, | |
| 632 | 632 | |
| 633 | { clr_R1, 6, 5 }, { clr_IR1, 6, 5 }, { xor_r1_r2, 6, 5 }, { xor_r1_Ir2, 6, 5 }, { xor_R2_R1, 10, 5 }, { xor_IR2_R1, 10, 5 }, { xor_R1_IM, 10, 5 }, { xor_IR1_IM, 10, 5 }, | |
| 634 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { iret, 16, 0 }, | |
| 633 | { clr_R1, 6, 5 }, { clr_IR1, 6, 5 }, { xor_r1_r2, 6, 5 }, { xor_r1_Ir2, 6, 5 }, { xor_R2_R1, 10, 5 }, { xor_IR2_R1, 10, 5 }, { xor_R1_IM, 10, 5 }, { xor_IR1_IM, 10, 5 }, | |
| 634 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { iret, 16, 0 }, | |
| 635 | 635 | |
| 636 | { rrc_R1, 6, 5 }, { rrc_IR1, 6, 5 }, { ldc_r1_Irr2, 12, 0 }, { ldci_Ir1_Irr2, 18, 0 },{ illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, { ld_r1_x_R2, 10, 5 }, | |
| 637 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { rcf, 6, 5 }, | |
| 636 | { rrc_R1, 6, 5 }, { rrc_IR1, 6, 5 }, { ldc_r1_Irr2, 12, 0 }, { ldci_Ir1_Irr2, 18, 0 },{ illegal, 0, 0 }, { illegal, 0, 0 }, { illegal, 0, 0 }, { ld_r1_x_R2, 10, 5 }, | |
| 637 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { rcf, 6, 5 }, | |
| 638 | 638 | |
| 639 | { sra_R1, 6, 5 }, { sra_IR1, 6, 5 }, { ldc_r2_Irr1, 12, 0 }, { ldci_Ir2_Irr1, 18, 0 },{ call_IRR1, 20, 0 }, { illegal, 0, 0 }, { call_DA, 20, 0 }, { ld_r2_x_R1, 10, 5 }, | |
| 640 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { scf, 6, 5 }, | |
| 639 | { sra_R1, 6, 5 }, { sra_IR1, 6, 5 }, { ldc_r2_Irr1, 12, 0 }, { ldci_Ir2_Irr1, 18, 0 },{ call_IRR1, 20, 0 }, { illegal, 0, 0 }, { call_DA, 20, 0 }, { ld_r2_x_R1, 10, 5 }, | |
| 640 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { scf, 6, 5 }, | |
| 641 | 641 | |
| 642 | { rr_R1, 6, 5 }, { rr_IR1, 6, 5 }, { illegal, 0, 0 }, { ld_r1_Ir2, 6, 5 }, { ld_R2_R1, 10, 5 }, { ld_IR2_R1, 10, 5 }, { ld_R1_IM, 10, 5 }, { ld_IR1_IM, 10, 5 }, | |
| 643 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { ccf, 6, 5 }, | |
| 642 | { rr_R1, 6, 5 }, { rr_IR1, 6, 5 }, { illegal, 0, 0 }, { ld_r1_Ir2, 6, 5 }, { ld_R2_R1, 10, 5 }, { ld_IR2_R1, 10, 5 }, { ld_R1_IM, 10, 5 }, { ld_IR1_IM, 10, 5 }, | |
| 643 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { ccf, 6, 5 }, | |
| 644 | 644 | |
| 645 | 645 | { swap_R1, 8, 5 }, { swap_IR1, 8, 5 }, { illegal, 0, 0 }, { ld_Ir1_r2, 6, 5 }, { illegal, 0, 0 }, { ld_R2_IR1, 10, 5 }, { illegal, 0, 0 }, { illegal, 0, 0 }, |
| 646 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { nop, 6, 0 }, | |
| 646 | { ld_r1_R2, 6, 5 }, { ld_r2_R1, 6, 5 }, { djnz_r1_RA, 10, 5 }, { jr_cc_RA, 10, 0 }, { ld_r1_IM, 6, 5 }, { jp_cc_DA, 10, 0 }, { inc_r1, 6, 5 }, { nop, 6, 0 }, | |
| 647 | 647 | }; |
| 648 | 648 | |
| 649 | 649 | /*************************************************************************** |
| r5613 | r5614 | |
| 728 | 728 | int cycles; |
| 729 | 729 | |
| 730 | 730 | debugger_instruction_hook(device, cpustate->pc); |
| 731 | ||
| 731 | ||
| 732 | 732 | /* TODO: sample interrupts */ |
| 733 | ||
| 733 | cpustate->input[3] = memory_read_byte_8be(cpustate->io, 3); | |
| 734 | ||
| 734 | 735 | /* fetch opcode */ |
| 735 | 736 | opcode = fetch(cpustate); |
| 736 | 737 | cycles = Z8601_OPCODE_MAP[opcode].execution_cycles; |
| 737 | 738 | |
| 738 | 739 | /* execute instruction */ |
| 739 | 740 | (*(Z8601_OPCODE_MAP[opcode].function))(cpustate, opcode, &cycles); |
| 740 | ||
| 741 | ||
| 741 | 742 | cpustate->icount -= cycles; |
| 742 | 743 | } |
| 743 | 744 | while (cpustate->icount > 0); |
| r5613 | r5614 | |
| 792 | 793 | cpustate->r[Z8_REGISTER_SPH] = cpustate->fake_sp >> 8; |
| 793 | 794 | cpustate->r[Z8_REGISTER_SPL] = cpustate->fake_sp & 0xff; |
| 794 | 795 | break; |
| 795 | ||
| 796 | ||
| 796 | 797 | case Z8_R0: case Z8_R1: case Z8_R2: case Z8_R3: case Z8_R4: case Z8_R5: case Z8_R6: case Z8_R7: case Z8_R8: case Z8_R9: case Z8_R10: case Z8_R11: case Z8_R12: case Z8_R13: case Z8_R14: case Z8_R15: |
| 797 | 798 | cpustate->r[cpustate->r[Z8_REGISTER_RP] + (entry->index - Z8_R0)] = cpustate->fake_r[entry->index - Z8_R0]; |
| 798 | 799 | break; |
| r5613 | r5614 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | UINT16 address = register_pair_read(cpustate, src); |
| 150 | 150 | UINT8 data = memory_decrypted_read_byte(cpustate->program, address); |
| 151 | ||
| 151 | ||
| 152 | 152 | register_write(cpustate, dst, data); |
| 153 | 153 | } |
| 154 | 154 | |
| r5613 | r5614 | |
| 173 | 173 | |
| 174 | 174 | UINT16 address = register_pair_read(cpustate, src); |
| 175 | 175 | UINT8 data = memory_decrypted_read_byte(cpustate->program, address); |
| 176 | ||
| 176 | ||
| 177 | 177 | register_write(cpustate, real_dst, data); |
| 178 | ||
| 178 | ||
| 179 | 179 | register_write(cpustate, dst, real_dst + 1); |
| 180 | 180 | register_pair_write(cpustate, src, address + 1); |
| 181 | 181 | } |
| r5613 | r5614 | |
| 191 | 191 | UINT8 data = register_read(cpustate, real_src); |
| 192 | 192 | |
| 193 | 193 | memory_write_byte(cpustate->program, address, data); |
| 194 | ||
| 194 | ||
| 195 | 195 | register_pair_write(cpustate, dst, address + 1); |
| 196 | 196 | register_write(cpustate, src, real_src + 1); |
| 197 | 197 | } |
| r5613 | r5614 | |
| 208 | 208 | static void pop(z8_state *cpustate, UINT8 dst) |
| 209 | 209 | { |
| 210 | 210 | /* dst <- @SP |
| 211 | ||
| 211 | SP <- SP + 1 */ | |
| 212 | 212 | register_write(cpustate, dst, stack_pop_byte(cpustate)); |
| 213 | 213 | } |
| 214 | 214 | |
| r5613 | r5614 | |
| 218 | 218 | static void push(z8_state *cpustate, UINT8 src) |
| 219 | 219 | { |
| 220 | 220 | /* SP <- SP - 1 |
| 221 | ||
| 221 | @SP <- src */ | |
| 222 | 222 | stack_push_byte(cpustate, read(src)); |
| 223 | 223 | } |
| 224 | 224 | |
| r5613 | r5614 | |
| 495 | 495 | |
| 496 | 496 | INSTRUCTION( djnz_r1_RA ) |
| 497 | 497 | { |
| 498 | INT8 ra = (INT8)fetch(cpustate); | |
| 498 | INT8 ra = (INT8)fetch(cpustate); | |
| 499 | 499 | |
| 500 | 500 | /* r <- r - 1 */ |
| 501 | 501 | int r = get_working_register(cpustate, opcode >> 4); |
| r5613 | r5614 | |
| 513 | 513 | INSTRUCTION( iret ) |
| 514 | 514 | { |
| 515 | 515 | /* FLAGS <- @SP |
| 516 | ||
| 516 | SP <- SP + 1 */ | |
| 517 | 517 | register_write(cpustate, Z8_REGISTER_FLAGS, stack_pop_byte(cpustate)); |
| 518 | 518 | |
| 519 | 519 | /* PC <- @SP |
| 520 | ||
| 520 | SP <- SP + 2 */ | |
| 521 | 521 | cpustate->pc = stack_pop_word(cpustate); |
| 522 | ||
| 522 | ||
| 523 | 523 | /* IMR (7) <- 1 */ |
| 524 | 524 | cpustate->r[Z8_REGISTER_IMR] |= Z8_IMR_ENABLE; |
| 525 | 525 | } |
| r5613 | r5614 | |
| 527 | 527 | INSTRUCTION( ret ) |
| 528 | 528 | { |
| 529 | 529 | /* PC <- @SP |
| 530 | ||
| 530 | SP <- SP + 2 */ | |
| 531 | 531 | cpustate->pc = stack_pop_word(cpustate); |
| 532 | 532 | } |
| 533 | 533 | |
| r5613 | r5614 | |
| 562 | 562 | case CC_NZ: truth = !flag(Z); break; |
| 563 | 563 | case CC_NC: truth = !flag(C); break; |
| 564 | 564 | } |
| 565 | ||
| 565 | ||
| 566 | 566 | return truth; |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | INSTRUCTION( jp_cc_DA ) |
| 570 | 570 | { |
| 571 | UINT16 dst = (fetch(cpustate) << 8) | fetch(cpustate); | |
| 572 | ||
| 571 | UINT16 dst = (fetch(cpustate) << 8) | fetch(cpustate); | |
| 572 | ||
| 573 | 573 | /* if cc is true, then PC <- dst */ |
| 574 | 574 | if (check_condition_code(cpustate, opcode >> 4)) |
| 575 | 575 | { |
| r5613 | r5614 | |
| 581 | 581 | INSTRUCTION( jr_cc_RA ) |
| 582 | 582 | { |
| 583 | 583 | INT8 ra = (INT8)fetch(cpustate); |
| 584 | UINT16 dst = cpustate->pc + ra; | |
| 584 | UINT16 dst = cpustate->pc + ra; | |
| 585 | 585 | |
| 586 | 586 | /* if cc is true, then PC <- dst */ |
| 587 | 587 | if (check_condition_code(cpustate, opcode >> 4)) |
| r5613 | r5614 | |
| 599 | 599 | { |
| 600 | 600 | /* NOT(dst) AND src */ |
| 601 | 601 | UINT8 data = (register_read(cpustate, dst) ^ 0xff) & src; |
| 602 | ||
| 602 | ||
| 603 | 603 | set_flag_z(data == 0); |
| 604 | 604 | set_flag_s(data & 0x80); |
| 605 | 605 | set_flag_v(0); |
| r5613 | r5614 | |
| 616 | 616 | { |
| 617 | 617 | /* dst AND src */ |
| 618 | 618 | UINT8 data = register_read(cpustate, dst) & src; |
| 619 | ||
| 619 | ||
| 620 | 620 | set_flag_z(data == 0); |
| 621 | 621 | set_flag_s(data & 0x80); |
| 622 | 622 | set_flag_v(0); |
| r5613 | r5614 | |
| 727 | 727 | |
| 728 | 728 | set_flag_z(data == 0); |
| 729 | 729 | set_flag_s(data & 0x80); |
| 730 | // | |
| 730 | // set_flag_v(0); undefined | |
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | INSTRUCTION( swap_R1 ) { mode_R1(swap) } |
| r5613 | r5614 | |
|---|---|---|
| 18 | 18 | { |
| 19 | 19 | Z8_PC, Z8_SP, Z8_RP, Z8_T0, Z8_T1, |
| 20 | 20 | |
| 21 | Z8_R0, Z8_R1, Z8_R2, Z8_R3, Z8_R4, Z8_R5, Z8_R6, Z8_R7, Z8_R8, Z8_R9, Z8_R10, Z8_R11, Z8_R12, Z8_R13, Z8_R14, Z8_R15, | |
| 21 | Z8_R0, Z8_R1, Z8_R2, Z8_R3, Z8_R4, Z8_R5, Z8_R6, Z8_R7, Z8_R8, Z8_R9, Z8_R10, Z8_R11, Z8_R12, Z8_R13, Z8_R14, Z8_R15, | |
| 22 | 22 | |
| 23 | 23 | Z8_GENPC = REG_GENPC, |
| 24 | 24 | Z8_GENSP = REG_GENSP |
| r5613 | r5614 | |
|---|---|---|
| 9 | 9 | static const char* REGISTER_NAME[256] = |
| 10 | 10 | { |
| 11 | 11 | "P0", "P1", "P2", "P3", "", "", "", "", "", "", "", "", "", "", "", "", |
| 12 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 13 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 14 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 15 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 16 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 17 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 18 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 19 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 20 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 21 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 22 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 23 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 24 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 25 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 12 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 13 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 14 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 15 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 16 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 17 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 18 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 19 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 20 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 21 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 22 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 23 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 24 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 25 | "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", | |
| 26 | 26 | "SIO", "TMR", "T1", "PRE1", "T0", "PRE0", "P2M", "P3M", "P01M", "IPR", "IRQ", "IMR", "FLAGS", "RP", "SPH", "SPL" |
| 27 | 27 | }; |
| 28 | 28 | |
| 29 | 29 | static const char* CONDITION_CODE[16] = |
| 30 | 30 | { |
| 31 | "F", "LT", "LE", "ULE", "OV", "MI", "Z", "C", | |
| 32 | "", "GE", "GT", "UGT", "NOV", "PL", "NZ", "NC" | |
| 31 | "F", "LT", "LE", "ULE", "OV", "MI", "Z", "C", | |
| 32 | "", "GE", "GT", "UGT", "NOV", "PL", "NZ", "NC" | |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | /*************************************************************************** |
| r5613 | r5614 | |
| 90 | 90 | |
| 91 | 91 | switch (pc) |
| 92 | 92 | { |
| 93 | case 0x0000: | |
| 93 | case 0x0000: | |
| 94 | 94 | case 0x0002: |
| 95 | 95 | case 0x0004: |
| 96 | 96 | case 0x0006: |
| r5613 | r5614 | |
| 235 | 235 | case 0x7d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 236 | 236 | case 0x7e: mnemonic("INC"); arg_r(OPH); break; |
| 237 | 237 | case 0x7f: illegal; /* mnemonic("HALT"); */ break; |
| 238 | ||
| 238 | ||
| 239 | 239 | case 0x80: mnemonic("DECW"); arg_RR(*oprom++); break; |
| 240 | 240 | case 0x81: mnemonic("DECW"); arg_IR(B0); bytes(2); break; |
| 241 | 241 | case 0x82: mnemonic("LDE"); arg_r(B0H); arg_Irr(B0L); bytes(2); break; |
| r5613 | r5614 | |
| 252 | 252 | case 0x8d: mnemonic("JP"); arg_DA; bytes(3); break; |
| 253 | 253 | case 0x8e: mnemonic("INC"); arg_r(OPH); break; |
| 254 | 254 | case 0x8f: mnemonic("DI"); break; |
| 255 | ||
| 255 | ||
| 256 | 256 | case 0x90: mnemonic("RL"); arg_R(B0); bytes(2); break; |
| 257 | 257 | case 0x91: mnemonic("RL"); arg_IR(B0); bytes(2); break; |
| 258 | 258 | case 0x92: mnemonic("LDE"); arg_r(B0L); arg_Irr(B0H); bytes(2); break; |
| r5613 | r5614 | |
| 269 | 269 | case 0x9d: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 270 | 270 | case 0x9e: mnemonic("INC"); arg_r(OPH); break; |
| 271 | 271 | case 0x9f: mnemonic("EI"); break; |
| 272 | ||
| 272 | ||
| 273 | 273 | case 0xa0: mnemonic("INCW"); arg_RR(B0); bytes(2); break; |
| 274 | 274 | case 0xa1: mnemonic("INCW"); arg_IR(B0); bytes(2); break; |
| 275 | 275 | case 0xa2: mnemonic("CP"); arg_r(B0H); arg_r(B0L); bytes(2); break; |
| r5613 | r5614 | |
| 286 | 286 | case 0xad: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 287 | 287 | case 0xae: mnemonic("INC"); arg_r(OPH); break; |
| 288 | 288 | case 0xaf: mnemonic("RET"); step_out; break; |
| 289 | ||
| 289 | ||
| 290 | 290 | case 0xb0: mnemonic("CLR"); arg_R(B0); bytes(2); break; |
| 291 | 291 | case 0xb1: mnemonic("XOR"); arg_IR(B0); bytes(2); break; |
| 292 | 292 | case 0xb2: mnemonic("XOR"); arg_r(B0H); arg_r(B0L); bytes(2); break; |
| r5613 | r5614 | |
| 303 | 303 | case 0xbd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 304 | 304 | case 0xbe: mnemonic("INC"); arg_r(OPH); break; |
| 305 | 305 | case 0xbf: mnemonic("IRET"); step_out; break; |
| 306 | ||
| 306 | ||
| 307 | 307 | case 0xc0: mnemonic("RRC"); arg_R(B0); bytes(2); break; |
| 308 | 308 | case 0xc1: mnemonic("RRC"); arg_IR(B0); bytes(2); break; |
| 309 | 309 | case 0xc2: mnemonic("LDC"); arg_r(B0H); arg_Irr(B0L); bytes(2); break; |
| r5613 | r5614 | |
| 320 | 320 | case 0xcd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 321 | 321 | case 0xce: mnemonic("INC"); arg_r(OPH); break; |
| 322 | 322 | case 0xcf: mnemonic("RCF"); break; |
| 323 | ||
| 323 | ||
| 324 | 324 | case 0xd0: mnemonic("SRA"); arg_R(B0); bytes(2); break; |
| 325 | 325 | case 0xd1: mnemonic("SRA"); arg_IR(B0); bytes(2); break; |
| 326 | 326 | case 0xd2: mnemonic("LDC"); arg_Irr(B0L); arg_r(B0H); bytes(2); break; |
| r5613 | r5614 | |
| 337 | 337 | case 0xdd: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 338 | 338 | case 0xde: mnemonic("INC"); arg_r(OPH); break; |
| 339 | 339 | case 0xdf: mnemonic("SCF"); break; |
| 340 | ||
| 340 | ||
| 341 | 341 | case 0xe0: mnemonic("RR"); arg_R(B0); bytes(2); break; |
| 342 | 342 | case 0xe1: mnemonic("RR"); arg_IR(B0); bytes(2); break; |
| 343 | 343 | case 0xe2: illegal; break; |
| r5613 | r5614 | |
| 354 | 354 | case 0xed: mnemonic("JP"); arg_cc; arg_DA; bytes(3); break; |
| 355 | 355 | case 0xee: mnemonic("INC"); arg_r(OPH); break; |
| 356 | 356 | case 0xef: mnemonic("CCF"); break; |
| 357 | ||
| 357 | ||
| 358 | 358 | case 0xf0: mnemonic("SWAP"); arg_R(B0); bytes(2); break; |
| 359 | 359 | case 0xf1: mnemonic("SWAP"); arg_IR(B0); bytes(2); break; |
| 360 | 360 | case 0xf2: illegal; break; |
| r5613 | r5614 | |
|---|---|---|
| 31 | 31 | * - The Prescaler rate was incorrectly being zeroed, instead of the * |
| 32 | 32 | * actual Prescaler counter in the CLRWDT and SLEEP instructions. * |
| 33 | 33 | * - Added masking to the FSR register. Upper unused bits are always 1. * |
| 34 | * TLP (27-Aug-2009) Ver 1.13 * | |
| 35 | * - Indirect addressing was not taking into account special purpose * | |
| 36 | * memory mapped locations. * | |
| 37 | * - 'iorlw' instruction was saving the result to memory instead of * | |
| 38 | * the W register. * | |
| 39 | * - 'tris' instruction no longer modifies Port-C on PIC models that * | |
| 40 | * do not have Port-C implemented. * | |
| 34 | 41 | * * |
| 35 | 42 | * * |
| 36 | 43 | * **** Notes: **** * |
| r5613 | r5614 | |
| 56 | 63 | |
| 57 | 64 | |
| 58 | 65 | |
| 59 | #define M_RDRAM(A) (((A) < 8) ? cpustate->internalram[A] : PIC16C5x_RAM_RDMEM(A)) | |
| 60 | #define M_WRTRAM(A,V) do { if ((A) < 8) cpustate->internalram[A] = (V); else PIC16C5x_RAM_WRMEM(A,V); } while (0) | |
| 61 | #define M_RDOP(A) PIC16C5x_RDOP(A) | |
| 62 | #define M_RDOP_ARG(A) PIC16C5x_RDOP_ARG(A) | |
| 63 | #define P_IN(A) PIC16C5x_In(A) | |
| 64 | #define P_OUT(A,V) PIC16C5x_Out(A,V) | |
| 65 | #define S_T0_IN PIC16C5x_T0_In | |
| 66 | #define ADDR_MASK 0x7ff | |
| 67 | 66 | |
| 68 | ||
| 69 | ||
| 70 | ||
| 71 | 67 | typedef struct _pic16c5x_state pic16c5x_state; |
| 72 | 68 | struct _pic16c5x_state |
| 73 | 69 | { |
| r5613 | r5614 | |
| 85 | 81 | UINT16 STACK[2]; |
| 86 | 82 | UINT16 prescaler; /* Note: this is really an 8-bit register */ |
| 87 | 83 | PAIR opcode; |
| 88 | UINT8 internalram | |
| 84 | UINT8 *internalram | |
| 89 | 85 | |
| 90 | 86 | int icount; |
| 91 | 87 | int reset_vector; |
| r5613 | r5614 | |
| 117 | 113 | return (pic16c5x_state *)device->token; |
| 118 | 114 | } |
| 119 | 115 | |
| 116 | ||
| 120 | 117 | /* opcode table entry */ |
| 121 | 118 | typedef struct _pic16c5x_opcode pic16c5x_opcode; |
| 122 | 119 | struct _pic16c5x_opcode |
| r5613 | r5614 | |
| 124 | 121 | UINT8 cycles; |
| 125 | 122 | void (*function)(pic16c5x_state *); |
| 126 | 123 | }; |
| 127 | /* opcode table entry (Opcode 00? has sub-opcodes) */ | |
| 128 | typedef struct _pic16c5x_opcode_00x pic16c5x_opcode_00x; | |
| 129 | struct _pic16c5x_opcode_00x | |
| 130 | { | |
| 131 | UINT8 cycles; | |
| 132 | void (*function)(pic16c5x_state *); | |
| 133 | }; | |
| 134 | 124 | |
| 135 | 125 | |
| 126 | INLINE void update_internalram_ptr(pic16c5x_state *cpustate) | |
| 127 | { | |
| 128 | cpustate->internalram = (UINT8 *)memory_get_write_ptr(cpustate->data, 0x00); | |
| 129 | } | |
| 136 | 130 | |
| 137 | /**************************************************************************** | |
| 138 | * Read the state of the T0 Clock input signal | |
| 139 | */ | |
| 140 | 131 | |
| 141 | #define PIC16C5x_T0_In (memory_read_byte_8le(cpustate->io, PIC16C5x_T0)) | |
| 142 | 132 | |
| 143 | 133 | |
| 144 | /**************************************************************************** | |
| 145 | * Input a word from given I/O port | |
| 146 | */ | |
| 147 | ||
| 148 | #define PIC16C5x_In(Port) ((UINT8)memory_read_byte_8le(cpustate->io, (Port))) | |
| 149 | ||
| 150 | ||
| 151 | /**************************************************************************** | |
| 152 | * Output a word to given I/O port | |
| 153 | */ | |
| 154 | ||
| 134 | #define PIC16C5x_RDOP(A) (memory_decrypted_read_word(cpustate->program, (A)<<1)) | |
| 135 | #define PIC16C5x_RAM_RDMEM(A) ((UINT8)memory_read_byte_8le(cpustate->data, A)) | |
| 136 | #define PIC16C5x_RAM_WRMEM(A,V) (memory_write_byte_8le(cpustate->data, A,V)) | |
| 137 | #define PIC16C5x_In(Port) ((UINT8)memory_read_byte_8le(cpustate->io, (Port))) | |
| 155 | 138 | #define PIC16C5x_Out(Port,Value) (memory_write_byte_8le(cpustate->io, (Port),Value)) |
| 139 | /************ Read the state of the T0 Clock input signal ************/ | |
| 140 | #define PIC16C5x_T0_In (memory_read_byte_8le(cpustate->io, PIC16C5x_T0)) | |
| 156 | 141 | |
| 142 | #define M_RDRAM(A) (((A) < 8) ? cpustate->internalram[A] : PIC16C5x_RAM_RDMEM(A)) | |
| 143 | #define M_WRTRAM(A,V) do { if ((A) < 8) cpustate->internalram[A] = (V); else PIC16C5x_RAM_WRMEM(A,V); } while (0) | |
| 144 | #define M_RDOP(A) PIC16C5x_RDOP(A) | |
| 145 | #define P_IN(A) PIC16C5x_In(A) | |
| 146 | #define P_OUT(A,V) PIC16C5x_Out(A,V) | |
| 147 | #define S_T0_IN PIC16C5x_T0_In | |
| 148 | #define ADDR_MASK 0x7ff | |
| 157 | 149 | |
| 158 | 150 | |
| 159 | /**************************************************************************** | |
| 160 | * Read a word from given RAM memory location | |
| 161 | */ | |
| 162 | 151 | |
| 163 | #define PIC16C5x_RAM_RDMEM(A) ((UINT8)memory_read_byte_8le(cpustate->data, A)) | |
| 164 | ||
| 165 | ||
| 166 | /**************************************************************************** | |
| 167 | * Write a word to given RAM memory location | |
| 168 | */ | |
| 169 | ||
| 170 | #define PIC16C5x_RAM_WRMEM(A,V) (memory_write_byte_8le(cpustate->data, A,V)) | |
| 171 | ||
| 172 | ||
| 173 | ||
| 174 | /**************************************************************************** | |
| 175 | * PIC16C5X_RDOP() is identical to PIC16C5X_RDMEM() except it is used for | |
| 176 | * reading opcodes. In case of system with memory mapped I/O, this function | |
| 177 | * can be used to greatly speed up emulation | |
| 178 | */ | |
| 179 | ||
| 180 | #define PIC16C5x_RDOP(A) (memory_decrypted_read_word(cpustate->program, (A)<<1)) | |
| 181 | ||
| 182 | ||
| 183 | /**************************************************************************** | |
| 184 | * PIC16C5X_RDOP_ARG() is identical to PIC16C5X_RDOP() except it is used | |
| 185 | * for reading opcode arguments. This difference can be used to support systems | |
| 186 | * that use different encoding mechanisms for opcodes and opcode arguments | |
| 187 | */ | |
| 188 | ||
| 189 | #define PIC16C5x_RDOP_ARG(A) (memory_raw_read_word(cpustate->program, (A)<<1)) | |
| 190 | ||
| 191 | ||
| 192 | 152 | #define TMR0 internalram[1] |
| 193 | 153 | #define PCL internalram[2] |
| 194 | 154 | #define STATUS internalram[3] |
| r5613 | r5614 | |
| 205 | 165 | |
| 206 | 166 | |
| 207 | 167 | /******** The following is the Status Flag register definition. *********/ |
| 208 | /* | 7 | 6 | 5 | 4 | 3 | 2 | | |
| 168 | /* | 7 | 6 | 5 | 4 | 3 | 2 | | |
| 209 | 169 | /* | PA | TO | PD | Z | DC | C | */ |
| 210 | 170 | #define PA_REG 0xe0 /* PA Program Page Preselect - bit 8 is unused here */ |
| 211 | 171 | #define TO_FLAG 0x10 /* TO Time Out flag (WatchDog) */ |
| r5613 | r5614 | |
| 251 | 211 | * Shortcuts |
| 252 | 212 | ************************************************************************/ |
| 253 | 213 | |
| 214 | #define CLR(flagreg, flag) ( flagreg &= (UINT8)(~flag) ) | |
| 215 | #define SET(flagreg, flag) ( flagreg |= flag ) | |
| 216 | ||
| 217 | ||
| 254 | 218 | /* Easy bit position selectors */ |
| 255 | 219 | #define POS ((cpustate->opcode.b.l >> 5) & 7) |
| 256 | 220 | static const unsigned int bit_clr[8] = { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f }; |
| 257 | 221 | static const unsigned int bit_set[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; |
| 258 | 222 | |
| 259 | 223 | |
| 260 | INLINE void CLR(pic16c5x_state *cpustate, UINT16 flag) { cpustate->STATUS &= ~flag; } | |
| 261 | INLINE void SET(pic16c5x_state *cpustate, UINT16 flag) { cpustate->STATUS |= flag; } | |
| 262 | 224 | |
| 263 | ||
| 264 | ||
| 265 | 225 | INLINE void CALCULATE_Z_FLAG(pic16c5x_state *cpustate) |
| 266 | 226 | { |
| 267 | if (cpustate->ALU == 0) SET(cpustate, Z_FLAG); | |
| 268 | else CLR(cpustate, Z_FLAG); | |
| 227 | if (cpustate->ALU == 0) SET(cpustate->STATUS, Z_FLAG); | |
| 228 | else CLR(cpustate->STATUS, Z_FLAG); | |
| 269 | 229 | } |
| 270 | 230 | |
| 271 | 231 | INLINE void CALCULATE_ADD_CARRY(pic16c5x_state *cpustate) |
| 272 | 232 | { |
| 273 | 233 | if ((UINT8)(cpustate->old_data) > (UINT8)(cpustate->ALU)) { |
| 274 | SET(cpustate, C_FLAG); | |
| 234 | SET(cpustate->STATUS, C_FLAG); | |
| 275 | 235 | } |
| 276 | 236 | else { |
| 277 | CLR(cpustate, C_FLAG); | |
| 237 | CLR(cpustate->STATUS, C_FLAG); | |
| 278 | 238 | } |
| 279 | 239 | } |
| 280 | 240 | |
| 281 | 241 | INLINE void CALCULATE_ADD_DIGITCARRY(pic16c5x_state *cpustate) |
| 282 | 242 | { |
| 283 | 243 | if (((UINT8)(cpustate->old_data) & 0x0f) > ((UINT8)(cpustate->ALU) & 0x0f)) { |
| 284 | SET(cpustate, DC_FLAG); | |
| 244 | SET(cpustate->STATUS, DC_FLAG); | |
| 285 | 245 | } |
| 286 | 246 | else { |
| 287 | CLR(cpustate, DC_FLAG); | |
| 247 | CLR(cpustate->STATUS, DC_FLAG); | |
| 288 | 248 | } |
| 289 | 249 | } |
| 290 | 250 | |
| 291 | 251 | INLINE void CALCULATE_SUB_CARRY(pic16c5x_state *cpustate) |
| 292 | 252 | { |
| 293 | 253 | if ((UINT8)(cpustate->old_data) < (UINT8)(cpustate->ALU)) { |
| 294 | CLR(cpustate, C_FLAG); | |
| 254 | CLR(cpustate->STATUS, C_FLAG); | |
| 295 | 255 | } |
| 296 | 256 | else { |
| 297 | SET(cpustate, C_FLAG); | |
| 257 | SET(cpustate->STATUS, C_FLAG); | |
| 298 | 258 | } |
| 299 | 259 | } |
| 300 | 260 | |
| 301 | 261 | INLINE void CALCULATE_SUB_DIGITCARRY(pic16c5x_state *cpustate) |
| 302 | 262 | { |
| 303 | 263 | if (((UINT8)(cpustate->old_data) & 0x0f) < ((UINT8)(cpustate->ALU) & 0x0f)) { |
| 304 | CLR(cpustate, DC_FLAG); | |
| 264 | CLR(cpustate->STATUS, DC_FLAG); | |
| 305 | 265 | } |
| 306 | 266 | else { |
| 307 | SET(cpustate, DC_FLAG); | |
| 267 | SET(cpustate->STATUS, DC_FLAG); | |
| 308 | 268 | } |
| 309 | 269 | } |
| 310 | 270 | |
| r5613 | r5614 | |
| 323 | 283 | } |
| 324 | 284 | |
| 325 | 285 | |
| 286 | ||
| 326 | 287 | INLINE UINT8 GET_REGFILE(pic16c5x_state *cpustate, offs_t addr) /* Read from internal memory */ |
| 327 | 288 | { |
| 328 | 289 | UINT8 data; |
| 329 | 290 | |
| 330 | if ((cpustate->picmodel == 0x16C57) || (cpustate->picmodel == 0x16C58)) | |
| 331 | { | |
| 332 | addr |= (cpustate->FSR & 0x60); /* FSR used for banking */ | |
| 291 | if (addr == 0) { /* Indirect addressing */ | |
| 292 | addr = (cpustate->FSR & cpustate->picRAMmask); | |
| 333 | 293 | } |
| 294 | ||
| 295 | if ((cpustate->picmodel == 0x16C57) || (cpustate->picmodel == 0x16C58)) { | |
| 296 | addr |= (cpustate->FSR & 0x60); /* FSR bits 6-5 are used for banking in direct mode */ | |
| 297 | } | |
| 298 | ||
| 334 | 299 | if ((addr & 0x10) == 0) addr &= 0x0f; |
| 335 | 300 | |
| 336 | 301 | switch(addr) |
| 337 | 302 | { |
| 338 | case 00: addr = (cpustate->FSR & cpustate->picRAMmask); | |
| 339 | if (addr == 0) { data = 0; break; } | |
| 340 | if ((addr & 0x10) == 0) addr &= 0x0f; | |
| 341 | data = M_RDRAM(addr); /* Indirect address */ | |
| 303 | case 00: /* Not an actual register, so return 0 */ | |
| 304 | data = 0; | |
| 342 | 305 | break; |
| 343 | case 04: data = (cpustate->FSR | (~cpustate->picRAMmask)); break; | |
| 306 | case 04: data = (cpustate->FSR | (UINT8)(~cpustate->picRAMmask)); | |
| 307 | break; | |
| 344 | 308 | case 05: data = P_IN(0); |
| 345 | 309 | data &= cpustate->TRISA; |
| 346 | data |= (~cpustate->TRISA & cpustate->PORTA); | |
| 347 | data &= 0xf; /* 4-bit port (only lower 4 bits used) */ | |
| 310 | data |= ((UINT8)(~cpustate->TRISA) & cpustate->PORTA); | |
| 311 | data &= 0x0f; /* 4-bit port (only lower 4 bits used) */ | |
| 348 | 312 | break; |
| 349 | 313 | case 06: data = P_IN(1); |
| 350 | 314 | data &= cpustate->TRISB; |
| 351 | data |= (~cpustate->TRISB & cpustate->PORTB); | |
| 315 | data |= ((UINT8)(~cpustate->TRISB) & cpustate->PORTB); | |
| 352 | 316 | break; |
| 353 | 317 | case 07: if ((cpustate->picmodel == 0x16C55) || (cpustate->picmodel == 0x16C57)) { |
| 354 | 318 | data = P_IN(2); |
| 355 | 319 | data &= cpustate->TRISC; |
| 356 | data |= (~cpustate->TRISC & cpustate->PORTC); | |
| 320 | data |= ((UINT8)(~cpustate->TRISC) & cpustate->PORTC); | |
| 357 | 321 | } |
| 358 | else { /* PIC16C54, PIC16C56, PIC16C58 */ | |
| 322 | else { /* PIC16C54, PIC16C56, PIC16C58 */ | |
| 359 | 323 | data = M_RDRAM(addr); |
| 360 | 324 | } |
| 361 | 325 | break; |
| 362 | default: data = M_RDRAM(addr); break; | |
| 326 | default: data = M_RDRAM(addr); | |
| 327 | break; | |
| 363 | 328 | } |
| 364 | ||
| 365 | 329 | return data; |
| 366 | 330 | } |
| 367 | 331 | |
| 368 | 332 | INLINE void STORE_REGFILE(pic16c5x_state *cpustate, offs_t addr, UINT8 data) /* Write to internal memory */ |
| 369 | 333 | { |
| 370 | if ((cpustate->picmodel == 0x16C57) || (cpustate->picmodel == 0x16C58)) | |
| 371 | { | |
| 372 | addr |= (cpustate->FSR & 0x60); | |
| 334 | if (addr == 0) { /* Indirect addressing */ | |
| 335 | addr = (cpustate->FSR & cpustate->picRAMmask); | |
| 373 | 336 | } |
| 337 | ||
| 338 | if ((cpustate->picmodel == 0x16C57) || (cpustate->picmodel == 0x16C58)) { | |
| 339 | addr |= (cpustate->FSR & 0x60); /* FSR bits 6-5 are used for banking in direct mode */ | |
| 340 | } | |
| 341 | ||
| 374 | 342 | if ((addr & 0x10) == 0) addr &= 0x0f; |
| 375 | 343 | |
| 376 | 344 | switch(addr) |
| 377 | 345 | { |
| 378 | case 00: addr = (cpustate->FSR & cpustate->picRAMmask); | |
| 379 | if (addr == 0) break; | |
| 380 | if ((addr & 0x10) == 0) addr &= 0x0f; | |
| 381 | M_WRTRAM(addr, data); break; /* Indirect address */ | |
| 346 | case 00: /* Not an actual register, nothing to save */ | |
| 347 | break; | |
| 382 | 348 | case 01: cpustate->delay_timer = 2; /* Timer starts after next two instructions */ |
| 383 | 349 | if (PSA == 0) cpustate->prescaler = 0; /* Must clear the Prescaler */ |
| 384 | cpustate->TMR0 = data; break; | |
| 350 | cpustate->TMR0 = data; | |
| 351 | break; | |
| 385 | 352 | case 02: cpustate->PCL = data; |
| 386 | cpustate->PC = ((cpustate->STATUS & PA_REG) << 4) | data; break; | |
| 387 | case 03: cpustate->STATUS &= ~PA_REG; cpustate->STATUS |= (data & PA_REG); break; | |
| 388 | case 04: cpustate->FSR = (data | (~cpustate->picRAMmask)); break; | |
| 389 | case 05: data &= 0xf; /* 4-bit port (only lower 4 bits used) */ | |
| 390 | P_OUT(0,data & (~cpustate->TRISA)); cpustate->PORTA = data; break; | |
| 391 | case 06: P_OUT(1,data & (~cpustate->TRISB)); cpustate->PORTB = data; break; | |
| 353 | cpustate->PC = ((cpustate->STATUS & PA_REG) << 4) | data; | |
| 354 | break; | |
| 355 | case 03: cpustate->STATUS &= (UINT8)(~PA_REG); cpustate->STATUS |= (data & PA_REG); | |
| 356 | break; | |
| 357 | case 04: cpustate->FSR = (data | (UINT8)(~cpustate->picRAMmask)); | |
| 358 | break; | |
| 359 | case 05: data &= 0x0f; /* 4-bit port (only lower 4 bits used) */ | |
| 360 | P_OUT(0,data & (UINT8)(~cpustate->TRISA)); cpustate->PORTA = data; | |
| 361 | break; | |
| 362 | case 06: P_OUT(1,data & (UINT8)(~cpustate->TRISB)); cpustate->PORTB = data; | |
| 363 | break; | |
| 392 | 364 | case 07: if ((cpustate->picmodel == 0x16C55) || (cpustate->picmodel == 0x16C57)) { |
| 393 | P_OUT(2,data & (~cpustate->TRISC)); | |
| 365 | P_OUT(2,data & (UINT8)(~cpustate->TRISC)); | |
| 394 | 366 | cpustate->PORTC = data; |
| 395 | 367 | } |
| 396 | 368 | else { /* PIC16C54, PIC16C56, PIC16C58 */ |
| 397 | 369 | M_WRTRAM(addr, data); |
| 398 | 370 | } |
| 399 | 371 | break; |
| 400 | default: M_WRTRAM(addr, data); break; | |
| 372 | default: M_WRTRAM(addr, data); | |
| 373 | break; | |
| 401 | 374 | } |
| 402 | 375 | } |
| 403 | 376 | |
| r5613 | r5614 | |
| 498 | 471 | static void clrw(pic16c5x_state *cpustate) |
| 499 | 472 | { |
| 500 | 473 | cpustate->W = 0; |
| 501 | SET(cpustate, Z_FLAG); | |
| 474 | SET(cpustate->STATUS, Z_FLAG); | |
| 502 | 475 | } |
| 503 | 476 | |
| 504 | 477 | static void clrf(pic16c5x_state *cpustate) |
| 505 | 478 | { |
| 506 | 479 | STORE_REGFILE(cpustate, ADDR, 0); |
| 507 | SET(cpustate, Z_FLAG); | |
| 480 | SET(cpustate->STATUS, Z_FLAG); | |
| 508 | 481 | } |
| 509 | 482 | |
| 510 | 483 | static void clrwdt(pic16c5x_state *cpustate) |
| 511 | 484 | { |
| 512 | 485 | cpustate->WDT = 0; |
| 513 | 486 | if (PSA) cpustate->prescaler = 0; |
| 514 | SET(cpustate, TO_FLAG); | |
| 515 | SET(cpustate, PD_FLAG); | |
| 487 | SET(cpustate->STATUS, TO_FLAG); | |
| 488 | SET(cpustate->STATUS, PD_FLAG); | |
| 516 | 489 | } |
| 517 | 490 | |
| 518 | 491 | static void comf(pic16c5x_state *cpustate) |
| 519 | 492 | { |
| 520 | cpustate->ALU = ~(GET_REGFILE(cpustate, ADDR)); | |
| 493 | cpustate->ALU = (UINT8)(~(GET_REGFILE(cpustate, ADDR))); | |
| 521 | 494 | STORE_RESULT(cpustate, ADDR, cpustate->ALU); |
| 522 | 495 | CALCULATE_Z_FLAG(cpustate); |
| 523 | 496 | } |
| r5613 | r5614 | |
| 570 | 543 | static void iorlw(pic16c5x_state *cpustate) |
| 571 | 544 | { |
| 572 | 545 | cpustate->ALU = cpustate->opcode.b.l | cpustate->W; |
| 573 | | |
| 546 | | |
| 574 | 547 | CALCULATE_Z_FLAG(cpustate); |
| 575 | 548 | } |
| 576 | 549 | |
| r5613 | r5614 | |
| 605 | 578 | |
| 606 | 579 | static void option(pic16c5x_state *cpustate) |
| 607 | 580 | { |
| 608 | cpustate->OPTION = cpustate->W & 0 | |
| 581 | cpustate->OPTION = cpustate->W & (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); | |
| 609 | 582 | } |
| 610 | 583 | |
| 611 | 584 | static void retlw(pic16c5x_state *cpustate) |
| r5613 | r5614 | |
| 620 | 593 | cpustate->ALU = GET_REGFILE(cpustate, ADDR); |
| 621 | 594 | cpustate->ALU <<= 1; |
| 622 | 595 | if (cpustate->STATUS & C_FLAG) cpustate->ALU |= 1; |
| 623 | if (GET_REGFILE(cpustate, ADDR) & 0x80) SET(cpustate, C_FLAG); | |
| 624 | else CLR(cpustate, C_FLAG); | |
| 596 | if (GET_REGFILE(cpustate, ADDR) & 0x80) SET(cpustate->STATUS, C_FLAG); | |
| 597 | else CLR(cpustate->STATUS, C_FLAG); | |
| 625 | 598 | STORE_RESULT(cpustate, ADDR, cpustate->ALU); |
| 626 | 599 | } |
| 627 | 600 | |
| r5613 | r5614 | |
| 630 | 603 | cpustate->ALU = GET_REGFILE(cpustate, ADDR); |
| 631 | 604 | cpustate->ALU >>= 1; |
| 632 | 605 | if (cpustate->STATUS & C_FLAG) cpustate->ALU |= 0x80; |
| 633 | if (GET_REGFILE(cpustate, ADDR) & 1) SET(cpustate, C_FLAG); | |
| 634 | else CLR(cpustate, C_FLAG); | |
| 606 | if (GET_REGFILE(cpustate, ADDR) & 1) SET(cpustate->STATUS, C_FLAG); | |
| 607 | else CLR(cpustate->STATUS, C_FLAG); | |
| 635 | 608 | STORE_RESULT(cpustate, ADDR, cpustate->ALU); |
| 636 | 609 | } |
| 637 | 610 | |
| r5613 | r5614 | |
| 639 | 612 | { |
| 640 | 613 | if (WDTE) cpustate->WDT = 0; |
| 641 | 614 | if (PSA) cpustate->prescaler = 0; |
| 642 | SET(cpustate, TO_FLAG); | |
| 643 | CLR(cpustate, PD_FLAG); | |
| 615 | SET(cpustate->STATUS, TO_FLAG); | |
| 616 | CLR(cpustate->STATUS, PD_FLAG); | |
| 644 | 617 | } |
| 645 | 618 | |
| 646 | 619 | static void subwf(pic16c5x_state *cpustate) |
| r5613 | r5614 | |
| 664 | 637 | { |
| 665 | 638 | switch(cpustate->opcode.b.l & 0x7) |
| 666 | 639 | { |
| 667 | case 05: if (cpustate->TRISA == cpustate->W) break; | |
| 668 | else cpustate->TRISA = cpustate->W; P_OUT(0,cpustate->PORTA & (~cpustate->TRISA) & 0xf); break; | |
| 669 | case 06: if (cpustate->TRISB == cpustate->W) break; | |
| 670 | else cpustate->TRISB = cpustate->W; P_OUT(1,cpustate->PORTB & (~cpustate->TRISB)); break; | |
| 671 | case 07: if (cpustate->TRISC == cpustate->W) break; | |
| 672 | else cpustate->TRISC = cpustate->W; P_OUT(2,cpustate->PORTC & (~cpustate->TRISC)); break; | |
| 640 | case 05: if (cpustate->TRISA == cpustate->W) break; | |
| 641 | else { cpustate->TRISA = cpustate->W | 0xf0; P_OUT(0,cpustate->PORTA & (UINT8)(~cpustate->TRISA) & 0x0f); break; } | |
| 642 | case 06: if (cpustate->TRISB == cpustate->W) break; | |
| 643 | else { cpustate->TRISB = cpustate->W; P_OUT(1,cpustate->PORTB & (UINT8)(~cpustate->TRISB)); break; } | |
| 644 | case 07: if ((cpustate->picmodel == 0x16C55) || (cpustate->picmodel == 0x16C57)) { | |
| 645 | if (cpustate->TRISC == cpustate->W) break; | |
| 646 | else { cpustate->TRISC = cpustate->W; P_OUT(2,cpustate->PORTC & (UINT8)(~cpustate->TRISC)); break; } | |
| 647 | } | |
| 648 | else { | |
| 649 | illegal(cpustate); break; | |
| 650 | } | |
| 673 | 651 | default: illegal(cpustate); break; |
| 674 | 652 | } |
| 675 | 653 | } |
| r5613 | r5614 | |
| 697 | 675 | |
| 698 | 676 | static const pic16c5x_opcode opcode_main[256]= |
| 699 | 677 | { |
| 700 | /*00*/ {1, nop | |
| 678 | /*00*/ {1, nop },{0, illegal },{1, movwf },{1, movwf },{1, clrw },{0, illegal },{1, clrf },{1, clrf }, | |
| 701 | 679 | /*08*/ {1, subwf },{1, subwf },{1, subwf },{1, subwf },{1, decf },{1, decf },{1, decf },{1, decf }, |
| 702 | 680 | /*10*/ {1, iorwf },{1, iorwf },{1, iorwf },{1, iorwf },{1, andwf },{1, andwf },{1, andwf },{1, andwf }, |
| 703 | 681 | /*18*/ {1, xorwf },{1, xorwf },{1, xorwf },{1, xorwf },{1, addwf },{1, addwf },{1, addwf },{1, addwf }, |
| r5613 | r5614 | |
| 732 | 710 | }; |
| 733 | 711 | |
| 734 | 712 | |
| 735 | static const pic16c5x_opcode | |
| 713 | static const pic16c5x_opcode | |
| 736 | 714 | { |
| 737 | 715 | /*00*/ {1, nop },{0, illegal },{1, option },{1, sleepic },{1, clrwdt },{1, tris },{1, tris },{1, tris }, |
| 738 | 716 | /*08*/ {0, illegal },{0, illegal },{0, illegal },{0, illegal },{0, illegal },{0, illegal },{0, illegal },{0, illegal } |
| r5613 | r5614 | |
| 748 | 726 | { |
| 749 | 727 | pic16c5x_state *cpustate = get_safe_token(device); |
| 750 | 728 | |
| 729 | cpustate->device = device; | |
| 730 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); | |
| 731 | cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA); | |
| 732 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); | |
| 733 | ||
| 734 | /* ensure the internal ram pointers are set before get_info is called */ | |
| 735 | update_internalram_ptr(cpustate); | |
| 736 | ||
| 751 | 737 | state_save_register_device_item(device, 0, cpustate->W); |
| 752 | 738 | state_save_register_device_item(device, 0, cpustate->ALU); |
| 753 | 739 | state_save_register_device_item(device, 0, cpustate->OPTION); |
| r5613 | r5614 | |
| 779 | 765 | state_save_register_device_item(device, 0, cpustate->icount); |
| 780 | 766 | state_save_register_device_item(device, 0, cpustate->temp_config); |
| 781 | 767 | state_save_register_device_item(device, 0, cpustate->inst_cycles); |
| 782 | ||
| 783 | ||
| 784 | cpustate->device = device; | |
| 785 | cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM); | |
| 786 | cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA); | |
| 787 | cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO); | |
| 788 | 768 | } |
| 789 | 769 | |
| 790 | 770 | |
| r5613 | r5614 | |
| 799 | 779 | cpustate->TRISA = 0xff; |
| 800 | 780 | cpustate->TRISB = 0xff; |
| 801 | 781 | cpustate->TRISC = 0xff; |
| 802 | cpustate->OPTION = 0 | |
| 782 | cpustate->OPTION = (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); | |
| 803 | 783 | cpustate->PCL = 0xff; |
| 804 | cpustate->FSR |= (~cpustate->picRAMmask); | |
| 784 | cpustate->FSR |= (UINT8)(~cpustate->picRAMmask); | |
| 805 | 785 | cpustate->PORTA &= 0x0f; |
| 806 | 786 | cpustate->prescaler = 0; |
| 807 | 787 | cpustate->delay_timer = 0; |
| r5613 | r5614 | |
| 811 | 791 | |
| 812 | 792 | static void pic16c5x_soft_reset(pic16c5x_state *cpustate) |
| 813 | 793 | { |
| 814 | cpustate->STATUS | |
| 794 | SET(cpustate->STATUS, (TO_FLAG | PD_FLAG | Z_FLAG | DC_FLAG | C_FLAG)); | |
| 815 | 795 | pic16c5x_reset_regs(cpustate); |
| 816 | 796 | } |
| 817 | 797 | |
| r5613 | r5614 | |
| 863 | 843 | cpustate->prescaler++; |
| 864 | 844 | if (cpustate->prescaler >= (1 << PS)) { /* Prescale values from 1 to 128 */ |
| 865 | 845 | cpustate->prescaler = 0; |
| 866 | CLR(cpustate, TO_FLAG); | |
| 846 | CLR(cpustate->STATUS, TO_FLAG); | |
| 867 | 847 | pic16c5x_soft_reset(cpustate); |
| 868 | 848 | } |
| 869 | 849 | } |
| 870 | 850 | else { |
| 871 | CLR(cpustate, TO_FLAG); | |
| 851 | CLR(cpustate->STATUS, TO_FLAG); | |
| 872 | 852 | pic16c5x_soft_reset(cpustate); |
| 873 | 853 | } |
| 874 | 854 | } |
| r5613 | r5614 | |
| 903 | 883 | { |
| 904 | 884 | pic16c5x_state *cpustate = get_safe_token(device); |
| 905 | 885 | int T0_in; |
| 886 | ||
| 887 | update_internalram_ptr(cpustate); | |
| 888 | ||
| 906 | 889 | cpustate->icount = cycles; |
| 907 | 890 | |
| 908 | 891 | do |
| r5613 | r5614 | |
| 988 | 971 | case CPUINFO_INT_SP: |
| 989 | 972 | case CPUINFO_INT_REGISTER + PIC16C5x_STK1: cpustate->STACK[1] = info->i; break; |
| 990 | 973 | case CPUINFO_INT_REGISTER + PIC16C5x_STK0: cpustate->STACK[0] = info->i; break; |
| 991 | case CPUINFO_INT_REGISTER + PIC16C5x_W: | |
| 974 | case CPUINFO_INT_REGISTER + PIC16C5x_W: | |
| 992 | 975 | case CPUINFO_INT_REGISTER + PIC16C5x_ALU: cpustate->ALU = info->i; break; |
| 993 | 976 | case CPUINFO_INT_REGISTER + PIC16C5x_STR: cpustate->STATUS = info->i; break; |
| 994 | case CPUINFO_INT_REGISTER + PIC16C5x_OPT: cpustate->OPTION = info->i; | |
| 977 | case CPUINFO_INT_REGISTER + PIC16C5x_OPT: cpustate->OPTION = info->i & (T0CS_FLAG | T0SE_FLAG | PSA_FLAG | PS_REG); | |
| 995 | 978 | case CPUINFO_INT_REGISTER + PIC16C5x_TMR0: cpustate->TMR0 = info->i; break; |
| 996 | 979 | case CPUINFO_INT_REGISTER + PIC16C5x_WDT: cpustate->WDT = info->i; break; |
| 997 | 980 | case CPUINFO_INT_REGISTER + PIC16C5x_PSCL: cpustate->prescaler = info->i; break; |
| 998 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTA: cpustate->PORTA = info->i; | |
| 981 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTA: cpustate->PORTA = info->i & 0x0f; | |
| 999 | 982 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTB: cpustate->PORTB = info->i; break; |
| 1000 | 983 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTC: cpustate->PORTC = info->i; break; |
| 1001 | case CPUINFO_INT_REGISTER + PIC16C5x_FSR: cpustate->FSR = (info->i & cpustate->picRAMmask); break; | |
| 984 | case CPUINFO_INT_REGISTER + PIC16C5x_FSR: cpustate->FSR = ((info->i & cpustate->picRAMmask) | (UINT8)(~cpustate->picRAMmask)); break; | |
| 1002 | 985 | } |
| 1003 | 986 | } |
| 1004 | 987 | |
| r5613 | r5614 | |
| 1015 | 998 | switch (state) |
| 1016 | 999 | { |
| 1017 | 1000 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 1018 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(pic16c5x_state); break; | |
| 1019 | case CPUINFO_INT_INPUT_LINES: info->i = 0; break; | |
| 1020 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; | |
| 1021 | case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; | |
| 1022 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 1023 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 1024 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; | |
| 1025 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 2; break; | |
| 1026 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; | |
| 1027 | case CPUINFO_INT_MAX_CYCLES: info->i = 10; break; | |
| 1001 | case CPUINFO_INT_CONTEXT_SIZE: info->i = sizeof(pic16c5x_state); break; | |
| 1002 | case CPUINFO_INT_INPUT_LINES: info->i = 1; break; | |
| 1003 | case CPUINFO_INT_DEFAULT_IRQ_VECTOR: info->i = 0; break; | |
| 1004 | case DEVINFO_INT_ENDIANNESS: info->i = ENDIANNESS_LITTLE; break; | |
| 1005 | case CPUINFO_INT_CLOCK_MULTIPLIER: info->i = 1; break; | |
| 1006 | case CPUINFO_INT_CLOCK_DIVIDER: info->i = 4; break; | |
| 1007 | case CPUINFO_INT_MIN_INSTRUCTION_BYTES: info->i = 2; break; | |
| 1008 | case CPUINFO_INT_MAX_INSTRUCTION_BYTES: info->i = 2; break; | |
| 1009 | case CPUINFO_INT_MIN_CYCLES: info->i = 1; break; | |
| 1010 | case CPUINFO_INT_MAX_CYCLES: info->i = 2; break; | |
| 1028 | 1011 | |
| 1029 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1030 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 1031 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 1032 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 1033 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 5; break; | |
| 1034 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1035 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1036 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 5; break; | |
| 1037 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1012 | case CPUINFO_INT_DATABUS_WIDTH_PROGRAM: info->i = 16; break; | |
| 1013 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 1014 | case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = -1; break; | |
| 1015 | case CPUINFO_INT_DATABUS_WIDTH_DATA: info->i = 8; break; | |
| 1016 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 5; break; | |
| 1017 | case CPUINFO_INT_ADDRBUS_SHIFT_DATA: info->i = 0; break; | |
| 1018 | case CPUINFO_INT_DATABUS_WIDTH_IO: info->i = 8; break; | |
| 1019 | case CPUINFO_INT_ADDRBUS_WIDTH_IO: info->i = 5; break; | |
| 1020 | case CPUINFO_INT_ADDRBUS_SHIFT_IO: info->i = 0; break; | |
| 1038 | 1021 | |
| 1039 | 1022 | case CPUINFO_INT_PREVIOUSPC: info->i = cpustate->PREVPC; break; |
| 1040 | 1023 | |
| r5613 | r5614 | |
| 1044 | 1027 | case CPUINFO_INT_SP: |
| 1045 | 1028 | case CPUINFO_INT_REGISTER + PIC16C5x_STK1: info->i = cpustate->STACK[1]; break; |
| 1046 | 1029 | case CPUINFO_INT_REGISTER + PIC16C5x_STK0: info->i = cpustate->STACK[0]; break; |
| 1047 | case CPUINFO_INT_REGISTER + PIC16C5x_W: info->i = cpustate->W; break; | |
| 1048 | case CPUINFO_INT_REGISTER + PIC16C5x_ALU: info->i = cpustate->ALU; break; | |
| 1049 | case CPUINFO_INT_REGISTER + PIC16C5x_STR: info->i = cpustate->STATUS; break; | |
| 1050 | case CPUINFO_INT_REGISTER + PIC16C5x_OPT: info->i = cpustate->OPTION; break; | |
| 1030 | case CPUINFO_INT_REGISTER + PIC16C5x_W: info->i = cpustate->W; break; | |
| 1031 | case CPUINFO_INT_REGISTER + PIC16C5x_ALU: info->i = cpustate->ALU; break; | |
| 1032 | case CPUINFO_INT_REGISTER + PIC16C5x_STR: info->i = cpustate->STATUS; break; | |
| 1033 | case CPUINFO_INT_REGISTER + PIC16C5x_OPT: info->i = cpustate->OPTION; break; | |
| 1051 | 1034 | case CPUINFO_INT_REGISTER + PIC16C5x_TMR0: info->i = cpustate->TMR0; break; |
| 1052 | case CPUINFO_INT_REGISTER + PIC16C5x_WDT: | |
| 1035 | case CPUINFO_INT_REGISTER + PIC16C5x_WDT: | |
| 1053 | 1036 | case CPUINFO_INT_REGISTER + PIC16C5x_PSCL: info->i = cpustate->prescaler; break; |
| 1054 | 1037 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTA: info->i = cpustate->PORTA; break; |
| 1055 | 1038 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTB: info->i = cpustate->PORTB; break; |
| 1056 | 1039 | case CPUINFO_INT_REGISTER + PIC16C5x_PRTC: info->i = cpustate->PORTC; break; |
| 1057 | case CPUINFO_INT_REGISTER + PIC16C5x_FSR: | |
| 1040 | case CPUINFO_INT_REGISTER + PIC16C5x_FSR: | |
| 1058 | 1041 | |
| 1059 | 1042 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1060 | 1043 | case CPUINFO_FCT_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(pic16c5x); break; |
| r5613 | r5614 | |
| 1063 | 1046 | case CPUINFO_FCT_EXIT: info->exit = CPU_EXIT_NAME(pic16c5x); break; |
| 1064 | 1047 | case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(pic16c5x); break; |
| 1065 | 1048 | case CPUINFO_FCT_BURN: info->burn = NULL; break; |
| 1066 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(pic16c5x); | |
| 1049 | case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(pic16c5x); | |
| 1067 | 1050 | case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break; |
| 1068 | 1051 | |
| 1069 | 1052 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1070 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C5x"); break; | |
| 1071 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Microchip"); break; | |
| 1072 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.12"); break; | |
| 1073 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1074 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Tony La Porta"); break; | |
| 1053 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C5x"); break; | |
| 1054 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Microchip"); break; | |
| 1055 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.13"); break; | |
| 1056 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; | |
| 1057 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Tony La Porta"); break; | |
| 1075 | 1058 | |
| 1076 | 1059 | case CPUINFO_STR_FLAGS: |
| 1077 | 1060 | sprintf(info->s, "%01x%c%c%c%c%c %c%c%c%03x", |
| r5613 | r5614 | |
| 1088 | 1071 | cpustate->OPTION & 0x08 ? (1<<(cpustate->OPTION&7)) : (2<<(cpustate->OPTION&7)) ); |
| 1089 | 1072 | break; |
| 1090 | 1073 | |
| 1091 | case CPUINFO_STR_REGISTER + PIC16C5x_PC: sprintf(info->s, "PC:%03X", cpustate->PC); break; | |
| 1092 | case CPUINFO_STR_REGISTER + PIC16C5x_W: sprintf(info->s, "W:%02X", cpustate->W); break; | |
| 1093 | case CPUINFO_STR_REGISTER + PIC16C5x_ALU: sprintf(info->s, "ALU:%02X", cpustate->ALU); break; | |
| 1094 | case CPUINFO_STR_REGISTER + PIC16C5x_STR: sprintf(info->s, "STR:%02X", cpustate->STATUS); break; | |
| 1095 | case CPUINFO_STR_REGISTER + PIC16C5x_TMR0: sprintf(info->s, "TMR:%02X", cpustate->TMR0); break; | |
| 1096 | case CPUINFO_STR_REGISTER + PIC16C5x_WDT: sprintf(info->s, "WDT:%04X", cpustate->WDT); break; | |
| 1097 | case CPUINFO_STR_REGISTER + PIC16C5x_OPT: sprintf(info->s, "OPT:%02X", cpustate->OPTION); break; | |
| 1098 | case CPUINFO_STR_REGISTER + PIC16C5x_STK0: sprintf(info->s, "STK0:%03X", cpustate->STACK[0]); break; | |
| 1099 | case CPUINFO_STR_REGISTER + PIC16C5x_STK1: sprintf(info->s, "STK1:%03X", cpustate->STACK[1]); break; | |
| 1100 | case CPUINFO_STR_REGISTER + PIC16C5x_PRTA: sprintf(info->s, "PRTA:%01X", ((cpustate->PORTA) & 0xf)); break; | |
| 1101 | case CPUINFO_STR_REGISTER + PIC16C5x_PRTB: sprintf(info->s, "PRTB:%02X", cpustate->PORTB); break; | |
| 1102 | case CPUINFO_STR_REGISTER + PIC16C5x_PRTC: sprintf(info->s, "PRTC:%02X", cpustate->PORTC); break; | |
| 1103 | case CPUINFO_STR_REGISTER + PIC16C5x_TRSA: sprintf(info->s, "TRSA:%01X", ((cpustate->TRISA) & 0xf)); break; | |
| 1104 | case CPUINFO_STR_REGISTER + PIC16C5x_TRSB: sprintf(info->s, "TRSB:%02X", cpustate->TRISB); break; | |
| 1105 | case CPUINFO_STR_REGISTER + PIC16C5x_TRSC: sprintf(info->s, "TRSC:%02X", cpustate->TRISC); break; | |
| 1106 | case CPUINFO_STR_REGISTER + PIC16C5x_FSR: sprintf(info->s, "FSR:%02X", ((cpustate->FSR) & cpustate->picRAMmask)); break; | |
| 1107 | case CPUINFO_STR_REGISTER + PIC16C5x_PSCL: sprintf(info->s, "PSCL:%c%02X", ((cpustate->OPTION & 0x08) ? 'W':'T'), cpustate->prescaler); break; | |
| 1074 | case CPUINFO_STR_REGISTER + PIC16C5x_PC: sprintf(info->s, "PC:%03X", cpustate->PC); break; | |
| 1075 | case CPUINFO_STR_REGISTER + PIC16C5x_W: sprintf(info->s, "W:%02X", cpustate->W); break; | |
| 1076 | case CPUINFO_STR_REGISTER + PIC16C5x_ALU: sprintf(info->s, "ALU:%02X", cpustate->ALU); break; | |
| 1077 | case CPUINFO_STR_REGISTER + PIC16C5x_STR: sprintf(info->s, "STR:%02X", cpustate->STATUS); break; | |
| 1078 | case CPUINFO_STR_REGISTER + PIC16C5x_TMR0: sprintf(info->s, "TMR:%02X", cpustate->TMR0); break; | |
| 1079 | case CPUINFO_STR_REGISTER + PIC16C5x_WDT: sprintf(info->s, "WDT:%04X", cpustate->WDT); break; | |
| 1080 | case CPUINFO_STR_REGISTER + PIC16C5x_OPT: sprintf(info->s, "OPT:%02X", cpustate->OPTION); break; | |
| 1081 | case CPUINFO_STR_REGISTER + PIC16C5x_STK0: sprintf(info->s, "STK0:%03X", cpustate->STACK[0]); break; | |
| 1082 | case CPUINFO_STR_REGISTER + PIC16C5x_STK1: sprintf(info->s, "STK1:%03X", cpustate->STACK[1]); break; | |
| 1083 | case CPUINFO_STR_REGISTER + PIC16C5x_PRTA: sprintf(info->s, "PRTA:%01X", ((cpustate->PORTA) & 0x0f)); break; | |
| 1084 | case CPUINFO_STR_REGISTER + PIC16C5x_PRTB: sprintf(info->s, "PRTB:%02X", cpustate->PORTB); break; | |
| 1085 | case CPUINFO_STR_REGISTER + PIC16C5x_PRTC: sprintf(info->s, "PRTC:%02X", cpustate->PORTC); break; | |
| 1086 | case CPUINFO_STR_REGISTER + PIC16C5x_TRSA: sprintf(info->s, "TRSA:%01X", ((cpustate->TRISA) & 0x0f)); break; | |
| 1087 | case CPUINFO_STR_REGISTER + PIC16C5x_TRSB: sprintf(info->s, "TRSB:%02X", cpustate->TRISB); break; | |
| 1088 | case CPUINFO_STR_REGISTER + PIC16C5x_TRSC: sprintf(info->s, "TRSC:%02X", cpustate->TRISC); break; | |
| 1089 | case CPUINFO_STR_REGISTER + PIC16C5x_FSR: sprintf(info->s, "FSR:%02X", ((cpustate->FSR) & cpustate->picRAMmask) | (UINT8)(~cpustate->picRAMmask)); break; | |
| 1090 | case CPUINFO_STR_REGISTER + PIC16C5x_PSCL: sprintf(info->s, "PSCL:%c%02X", ((cpustate->OPTION & 0x08) ? 'W':'T'), cpustate->prescaler); break; | |
| 1108 | 1091 | } |
| 1109 | 1092 | } |
| 1110 | 1093 | |
| r5613 | r5614 | |
| 1119 | 1102 | ADDRESS_MAP_END |
| 1120 | 1103 | |
| 1121 | 1104 | static ADDRESS_MAP_START( pic16c54_ram, ADDRESS_SPACE_DATA, 8 ) |
| 1122 | AM_RANGE(0x00, 0x1f) AM_RAM | |
| 1105 | AM_RANGE(0x00, 0x07) AM_RAM | |
| 1106 | AM_RANGE(0x08, 0x0f) AM_RAM | |
| 1107 | AM_RANGE(0x10, 0x1f) AM_RAM | |
| 1123 | 1108 | ADDRESS_MAP_END |
| 1124 | 1109 | |
| 1125 | 1110 | |
| r5613 | r5614 | |
| 1131 | 1116 | { |
| 1132 | 1117 | pic16c5x_state *cpustate = get_safe_token(device); |
| 1133 | 1118 | |
| 1119 | update_internalram_ptr(cpustate); | |
| 1120 | ||
| 1134 | 1121 | cpustate->picmodel = 0x16C54; |
| 1135 | 1122 | cpustate->picRAMmask = 0x1f; |
| 1136 | 1123 | cpustate->reset_vector = 0x1ff; |
| 1137 | 1124 | pic16c5x_reset_regs(cpustate); |
| 1138 | cpustate->STATUS = 0x00; | |
| 1139 | SET(cpustate, TO_FLAG); | |
| 1140 | SET(cpustate, PD_FLAG); | |
| 1125 | CLR(cpustate->STATUS, PA_REG); | |
| 1126 | SET(cpustate->STATUS, (TO_FLAG | PD_FLAG)); | |
| 1141 | 1127 | } |
| 1142 | 1128 | |
| 1143 | 1129 | |
| r5613 | r5614 | |
| 1149 | 1135 | { |
| 1150 | 1136 | switch (state) |
| 1151 | 1137 | { |
| 1138 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 1139 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 5; break; | |
| 1140 | ||
| 1152 | 1141 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1153 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c54); break; | |
| 1154 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c54_rom); break; | |
| 1155 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c54_ram); break; | |
| 1142 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c54); break; | |
| 1143 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c54_rom); break; | |
| 1144 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c54_ram); break; | |
| 1156 | 1145 | |
| 1157 | 1146 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1158 | 1147 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C54"); break; |
| r5613 | r5614 | |
| 1171 | 1160 | ADDRESS_MAP_END |
| 1172 | 1161 | |
| 1173 | 1162 | static ADDRESS_MAP_START( pic16c55_ram, ADDRESS_SPACE_DATA, 8 ) |
| 1174 | AM_RANGE(0x00, 0x1f) AM_RAM | |
| 1163 | AM_RANGE(0x00, 0x07) AM_RAM | |
| 1164 | AM_RANGE(0x08, 0x0f) AM_RAM | |
| 1165 | AM_RANGE(0x10, 0x1f) AM_RAM | |
| 1175 | 1166 | ADDRESS_MAP_END |
| 1176 | 1167 | |
| 1177 | 1168 | |
| r5613 | r5614 | |
| 1183 | 1174 | { |
| 1184 | 1175 | pic16c5x_state *cpustate = get_safe_token(device); |
| 1185 | 1176 | |
| 1177 | update_internalram_ptr(cpustate); | |
| 1178 | ||
| 1186 | 1179 | cpustate->picmodel = 0x16C55; |
| 1187 | 1180 | cpustate->picRAMmask = 0x1f; |
| 1188 | 1181 | cpustate->reset_vector = 0x1ff; |
| 1189 | 1182 | pic16c5x_reset_regs(cpustate); |
| 1190 | cpustate->STATUS = 0x00; | |
| 1191 | SET(cpustate, TO_FLAG); | |
| 1192 | SET(cpustate, PD_FLAG); | |
| 1183 | CLR(cpustate->STATUS, PA_REG); | |
| 1184 | SET(cpustate->STATUS, (TO_FLAG | PD_FLAG)); | |
| 1193 | 1185 | } |
| 1194 | 1186 | |
| 1195 | 1187 | |
| r5613 | r5614 | |
| 1201 | 1193 | { |
| 1202 | 1194 | switch (state) |
| 1203 | 1195 | { |
| 1196 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 9; break; | |
| 1197 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 5; break; | |
| 1198 | ||
| 1204 | 1199 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1205 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c55); break; | |
| 1206 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c55_rom); break; | |
| 1207 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c55_ram); break; | |
| 1200 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c55); break; | |
| 1201 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c55_rom); break; | |
| 1202 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c55_ram); break; | |
| 1208 | 1203 | |
| 1209 | 1204 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1210 | 1205 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C55"); break; |
| r5613 | r5614 | |
| 1223 | 1218 | ADDRESS_MAP_END |
| 1224 | 1219 | |
| 1225 | 1220 | static ADDRESS_MAP_START( pic16c56_ram, ADDRESS_SPACE_DATA, 8 ) |
| 1226 | AM_RANGE(0x00, 0x1f) AM_RAM | |
| 1221 | AM_RANGE(0x00, 0x07) AM_RAM | |
| 1222 | AM_RANGE(0x08, 0x0f) AM_RAM | |
| 1223 | AM_RANGE(0x10, 0x1f) AM_RAM | |
| 1227 | 1224 | ADDRESS_MAP_END |
| 1228 | 1225 | |
| 1229 | 1226 | |
| r5613 | r5614 | |
| 1235 | 1232 | { |
| 1236 | 1233 | pic16c5x_state *cpustate = get_safe_token(device); |
| 1237 | 1234 | |
| 1235 | update_internalram_ptr(cpustate); | |
| 1236 | ||
| 1238 | 1237 | cpustate->picmodel = 0x16C56; |
| 1239 | 1238 | cpustate->picRAMmask = 0x1f; |
| 1240 | 1239 | cpustate->reset_vector = 0x3ff; |
| 1241 | 1240 | pic16c5x_reset_regs(cpustate); |
| 1242 | cpustate->STATUS = 0x00; | |
| 1243 | SET(cpustate, TO_FLAG); | |
| 1244 | SET(cpustate, PD_FLAG); | |
| 1241 | CLR(cpustate->STATUS, PA_REG); | |
| 1242 | SET(cpustate->STATUS, (TO_FLAG | PD_FLAG)); | |
| 1245 | 1243 | } |
| 1246 | 1244 | |
| 1247 | 1245 | |
| r5613 | r5614 | |
| 1253 | 1251 | { |
| 1254 | 1252 | switch (state) |
| 1255 | 1253 | { |
| 1254 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 1255 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 5; break; | |
| 1256 | ||
| 1256 | 1257 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1257 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c56); break; | |
| 1258 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c56_rom); break; | |
| 1259 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c56_ram); break; | |
| 1258 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c56); break; | |
| 1259 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c56_rom); break; | |
| 1260 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c56_ram); break; | |
| 1260 | 1261 | |
| 1261 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10; break; | |
| 1262 | ||
| 1263 | 1262 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1264 | 1263 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C56"); break; |
| 1265 | 1264 | |
| r5613 | r5614 | |
| 1277 | 1276 | ADDRESS_MAP_END |
| 1278 | 1277 | |
| 1279 | 1278 | static ADDRESS_MAP_START( pic16c57_ram, ADDRESS_SPACE_DATA, 8 ) |
| 1280 | AM_RANGE(0x00, 0x1f) AM_RAM | |
| 1279 | AM_RANGE(0x00, 0x07) AM_RAM AM_MIRROR(0x60) | |
| 1280 | AM_RANGE(0x08, 0x0f) AM_RAM AM_MIRROR(0x60) | |
| 1281 | AM_RANGE(0x10, 0x1f) AM_RAM | |
| 1281 | 1282 | AM_RANGE(0x30, 0x3f) AM_RAM |
| 1282 | 1283 | AM_RANGE(0x50, 0x5f) AM_RAM |
| 1283 | 1284 | AM_RANGE(0x70, 0x7f) AM_RAM |
| r5613 | r5614 | |
| 1292 | 1293 | { |
| 1293 | 1294 | pic16c5x_state *cpustate = get_safe_token(device); |
| 1294 | 1295 | |
| 1296 | update_internalram_ptr(cpustate); | |
| 1297 | ||
| 1295 | 1298 | cpustate->picmodel = 0x16C57; |
| 1296 | 1299 | cpustate->picRAMmask = 0x7f; |
| 1297 | 1300 | cpustate->reset_vector = 0x7ff; |
| 1298 | 1301 | pic16c5x_reset_regs(cpustate); |
| 1299 | cpustate->STATUS = 0x00; | |
| 1300 | SET(cpustate, TO_FLAG); | |
| 1301 | SET(cpustate, PD_FLAG); | |
| 1302 | CLR(cpustate->STATUS, PA_REG); | |
| 1303 | SET(cpustate->STATUS, (TO_FLAG | PD_FLAG)); | |
| 1302 | 1304 | } |
| 1303 | 1305 | |
| 1304 | 1306 | |
| r5613 | r5614 | |
| 1310 | 1312 | { |
| 1311 | 1313 | switch (state) |
| 1312 | 1314 | { |
| 1315 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 1316 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1313 | 1317 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1314 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c57); break; | |
| 1315 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c57_rom); break; | |
| 1316 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c57_ram); break; | |
| 1318 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c57); break; | |
| 1319 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c57_rom); break; | |
| 1320 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c57_ram); break; | |
| 1317 | 1321 | |
| 1318 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 1319 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1320 | ||
| 1321 | 1322 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1322 | 1323 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C57"); break; |
| 1323 | 1324 | |
| r5613 | r5614 | |
| 1335 | 1336 | ADDRESS_MAP_END |
| 1336 | 1337 | |
| 1337 | 1338 | static ADDRESS_MAP_START( pic16c58_ram, ADDRESS_SPACE_DATA, 8 ) |
| 1338 | AM_RANGE(0x00, 0x1f) AM_RAM | |
| 1339 | AM_RANGE(0x00, 0x07) AM_RAM AM_MIRROR(0x60) | |
| 1340 | AM_RANGE(0x08, 0x0f) AM_RAM AM_MIRROR(0x60) | |
| 1341 | AM_RANGE(0x10, 0x1f) AM_RAM | |
| 1339 | 1342 | AM_RANGE(0x30, 0x3f) AM_RAM |
| 1340 | 1343 | AM_RANGE(0x50, 0x5f) AM_RAM |
| 1341 | 1344 | AM_RANGE(0x70, 0x7f) AM_RAM |
| r5613 | r5614 | |
| 1350 | 1353 | { |
| 1351 | 1354 | pic16c5x_state *cpustate = get_safe_token(device); |
| 1352 | 1355 | |
| 1356 | update_internalram_ptr(cpustate); | |
| 1357 | ||
| 1353 | 1358 | cpustate->picmodel = 0x16C58; |
| 1354 | 1359 | cpustate->picRAMmask = 0x7f; |
| 1355 | 1360 | cpustate->reset_vector = 0x7ff; |
| 1356 | 1361 | pic16c5x_reset_regs(cpustate); |
| 1357 | cpustate->STATUS = 0x00; | |
| 1358 | SET(cpustate, TO_FLAG); | |
| 1359 | SET(cpustate, PD_FLAG); | |
| 1362 | CLR(cpustate->STATUS, PA_REG); | |
| 1363 | SET(cpustate->STATUS, (TO_FLAG | PD_FLAG)); | |
| 1360 | 1364 | } |
| 1361 | 1365 | |
| 1362 | 1366 | |
| r5613 | r5614 | |
| 1368 | 1372 | { |
| 1369 | 1373 | switch (state) |
| 1370 | 1374 | { |
| 1375 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 1376 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1371 | 1377 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 1372 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c58); break; | |
| 1373 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c58_rom); break; | |
| 1374 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c58_ram); break; | |
| 1378 | case CPUINFO_FCT_RESET: info->reset = CPU_RESET_NAME(pic16c58); break; | |
| 1379 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: info->internal_map16 = ADDRESS_MAP_NAME(pic16c58_rom); break; | |
| 1380 | case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA: info->internal_map8 = ADDRESS_MAP_NAME(pic16c58_ram); break; | |
| 1375 | 1381 | |
| 1376 | case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11; break; | |
| 1377 | case CPUINFO_INT_ADDRBUS_WIDTH_DATA: info->i = 7; break; | |
| 1378 | ||
| 1379 | 1382 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 1380 | 1383 | case DEVINFO_STR_NAME: strcpy(info->s, "PIC16C58"); break; |
| 1381 | 1384 |
| r5613 | r5614 | |
|---|---|---|
| 994 | 994 | |
| 995 | 995 | /* handle navigation (up,down,left,right) */ |
| 996 | 996 | step = 8; |
| 997 | if (input_code_pressed(KEYCODE_LSHIFT)) step = 1; | |
| 998 | if (input_code_pressed(KEYCODE_LCONTROL)) step = 64; | |
| 997 | if (input_code_pressed(machine, KEYCODE_LSHIFT)) step = 1; | |
| 998 | if (input_code_pressed(machine, KEYCODE_LCONTROL)) step = 64; | |
| 999 | 999 | if (ui_input_pressed_repeat(machine, IPT_UI_UP, 4)) |
| 1000 | 1000 | state->tilemap.yoffs -= step; |
| 1001 | 1001 | if (ui_input_pressed_repeat(machine, IPT_UI_DOWN, 4)) |
| r5613 | r5614 | |
|---|---|---|
| 1394 | 1394 | have to test. |
| 1395 | 1395 | */ |
| 1396 | 1396 | |
| 1397 | static void v9938_interrupt_start_vblank ( | |
| 1397 | static void v9938_interrupt_start_vblank (running_machine *machine) | |
| 1398 | 1398 | { |
| 1399 | 1399 | #if 0 |
| 1400 | if (input_code_pressed (KEYCODE_D) ) | |
| 1400 | if (input_code_pressed (machine, KEYCODE_D) ) | |
| 1401 | 1401 | { |
| 1402 | 1402 | FILE *fp; |
| 1403 | 1403 | int i; |
| r5613 | r5614 | |
| 1492 | 1492 | /* check for start of vblank */ |
| 1493 | 1493 | if ((pal && (vdp->scanline == 310)) || |
| 1494 | 1494 | (!pal && (vdp->scanline == 259))) |
| 1495 | v9938_interrupt_start_vblank (); | |
| 1495 | v9938_interrupt_start_vblank (machine); | |
| 1496 | 1496 | |
| 1497 | 1497 | /* render the current line */ |
| 1498 | 1498 | if ((vdp->scanline >= scanline_start) && (vdp->scanline < (212 + 28 + scanline_start))) |
| r5613 | r5614 | |
|---|---|---|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /* debugging! */ |
| 382 | if (input_code_pressed(KEYCODE_L)) | |
| 382 | if (input_code_pressed(device->machine, KEYCODE_L)) | |
| 383 | 383 | drawbuf = v->fbi.backbuf; |
| 384 | 384 | |
| 385 | 385 | /* copy from the current front buffer */ |
| r5613 | r5614 | |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /* update stats display */ |
| 396 | statskey = (input_code_pressed(KEYCODE_BACKSLASH) != 0); | |
| 396 | statskey = (input_code_pressed(device->machine, KEYCODE_BACKSLASH) != 0); | |
| 397 | 397 | if (statskey && statskey != v->stats.lastkey) |
| 398 | 398 | v->stats.display = !v->stats.display; |
| 399 | 399 | v->stats.lastkey = statskey; |
| r5613 | r5614 | |
| 403 | 403 | popmessage(v->stats.buffer, 0, 0); |
| 404 | 404 | |
| 405 | 405 | /* update render override */ |
| 406 | v->stats.render_override = input_code_pressed(KEYCODE_ENTER); | |
| 406 | v->stats.render_override = input_code_pressed(device->machine, KEYCODE_ENTER); | |
| 407 | 407 | if (DEBUG_DEPTH && v->stats.render_override) |
| 408 | 408 | { |
| 409 | 409 | for (y = cliprect->min_y; y <= cliprect->max_y; y++) |
| r5613 | r5614 | |
|---|---|---|
| 421 | 421 | |
| 422 | 422 | /* remember the start time if we're logging */ |
| 423 | 423 | if (LOG_WAITS) |
| 424 | time = | |
| 424 | time = get_profile | |
| 425 | 425 | |
| 426 | 426 | /* wait for all pending work items to complete */ |
| 427 | 427 | if (poly->queue != NULL) |
| r5613 | r5614 | |
| 438 | 438 | /* log any long waits */ |
| 439 | 439 | if (LOG_WAITS) |
| 440 | 440 | { |
| 441 | time = | |
| 441 | time = get_profile | |
| 442 | 442 | if (time > LOG_WAIT_THRESHOLD) |
| 443 | 443 | logerror("Poly:Waited %d cycles for %s\n", (int)time, debug_reason); |
| 444 | 444 | } |
| r5613 | r5614 | |
|---|---|---|
| 644 | 644 | return result - 1; |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | ||
| 648 | ||
| 649 | /*************************************************************************** | |
| 650 | INLINE TIMING FUNCTIONS | |
| 651 | ***************************************************************************/ | |
| 652 | ||
| 653 | /*------------------------------------------------- | |
| 654 | get_profile_ticks - return a tick counter | |
| 655 | from the processor that can be used for | |
| 656 | profiling. It does not need to run at any | |
| 657 | particular rate. | |
| 658 | -------------------------------------------------*/ | |
| 659 | ||
| 660 | #define get_profile_ticks _get_profile_ticks | |
| 661 | INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) | |
| 662 | { | |
| 663 | UINT64 result; | |
| 664 | __asm__ __volatile__ ( | |
| 665 | "rdtsc" | |
| 666 | : "=A" (result) | |
| 667 | ); | |
| 668 | return (INT64) (result & U64(0x7fffffffffffffff)); | |
| 669 | } | |
| 670 | ||
| 647 | 671 | #endif /* __EIGCCX86__ */ |
| r5613 | r5614 | |
|---|---|---|
| 104 | 104 | /* update the state of all the UI keys */ |
| 105 | 105 | for (code = __ipt_ui_start; code <= __ipt_ui_end; code++) |
| 106 | 106 | { |
| 107 | int pressed = input_seq_pressed(input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD)); | |
| 107 | int pressed = input_seq_pressed(machine, input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD)); | |
| 108 | 108 | if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET) |
| 109 | 109 | uidata->seqpressed[code] = pressed; |
| 110 | 110 | } |
| r5613 | r5614 | |
|---|---|---|
| 278 | 278 | static void menu_input_specific_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate); |
| 279 | 279 | static void menu_input_common(running_machine *machine, ui_menu *menu, void *parameter, void *state); |
| 280 | 280 | static int CLIB_DECL menu_input_compare_items(const void *i1, const void *i2); |
| 281 | static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate); | |
| 281 | static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate); | |
| 282 | 282 | static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu, void *parameter, void *state); |
| 283 | 283 | static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, void *parameter, void *state); |
| 284 | 284 | static void menu_settings_categories(running_machine *machine, ui_menu *menu, void *parameter, void *state); |
| r5613 | r5614 | |
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | 1631 | /* sort and populate the menu in a standard fashion */ |
| 1632 | menu_input_populate_and_sort(menu, itemlist, menustate); | |
| 1632 | menu_input_populate_and_sort(machine, menu, itemlist, menustate); | |
| 1633 | 1633 | astring_free(tempstring); |
| 1634 | 1634 | } |
| 1635 | 1635 | |
| r5613 | r5614 | |
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | 1711 | /* sort and populate the menu in a standard fashion */ |
| 1712 | menu_input_populate_and_sort(menu, itemlist, menustate); | |
| 1712 | menu_input_populate_and_sort(machine, menu, itemlist, menustate); | |
| 1713 | 1713 | astring_free(tempstring); |
| 1714 | 1714 | } |
| 1715 | 1715 | |
| r5613 | r5614 | |
| 1758 | 1758 | } |
| 1759 | 1759 | |
| 1760 | 1760 | /* poll again; if finished, update the sequence */ |
| 1761 | if (input_seq_poll(&newseq)) | |
| 1761 | if (input_seq_poll(machine, &newseq)) | |
| 1762 | 1762 | { |
| 1763 | 1763 | menustate->pollingitem = NULL; |
| 1764 | 1764 | menustate->record_next = TRUE; |
| r5613 | r5614 | |
| 1778 | 1778 | menustate->pollingitem = item; |
| 1779 | 1779 | menustate->last_sortorder = item->sortorder; |
| 1780 | 1780 | menustate->starting_seq = item->seq; |
| 1781 | input_seq_poll_start((item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL); | |
| 1781 | input_seq_poll_start(machine, (item->type == INPUT_TYPE_ANALOG) ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, menustate->record_next ? &item->seq : NULL); | |
| 1782 | 1782 | invalidate = TRUE; |
| 1783 | 1783 | break; |
| 1784 | 1784 | |
| r5613 | r5614 | |
| 1854 | 1854 | menu from them |
| 1855 | 1855 | -------------------------------------------------*/ |
| 1856 | 1856 | |
| 1857 | static void menu_input_populate_and_sort(ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate) | |
| 1857 | static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate) | |
| 1858 | 1858 | { |
| 1859 | 1859 | const char *nameformat[INPUT_TYPE_TOTAL] = { 0 }; |
| 1860 | 1860 | input_item_data **itemarray, *item; |
| r5613 | r5614 | |
| 1900 | 1900 | /* otherwise, generate the sequence name and invert it if different from the default */ |
| 1901 | 1901 | else |
| 1902 | 1902 | { |
| 1903 | input_seq_name(subtext, &item->seq); | |
| 1903 | input_seq_name(machine, subtext, &item->seq); | |
| 1904 | 1904 | flags |= input_seq_cmp(&item->seq, item->defseq) ? MENU_FLAG_INVERT : 0; |
| 1905 | 1905 | } |
| 1906 | 1906 | |
| r5613 | r5614 | |
| 2225 | 2225 | |
| 2226 | 2226 | /* left decrements */ |
| 2227 | 2227 | case IPT_UI_LEFT: |
| 2228 | newval -= input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; | |
| 2228 | newval -= input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; | |
| 2229 | 2229 | break; |
| 2230 | 2230 | |
| 2231 | 2231 | /* right increments */ |
| 2232 | 2232 | case IPT_UI_RIGHT: |
| 2233 | newval += input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; | |
| 2233 | newval += input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; | |
| 2234 | 2234 | break; |
| 2235 | 2235 | } |
| 2236 | 2236 | |
| r5613 | r5614 | |
| 2494 | 2494 | { |
| 2495 | 2495 | int changed = FALSE; |
| 2496 | 2496 | |
| 2497 | /* handle reset all */ | |
| 2498 | if ((FPTR)event->itemref == 1 && event->iptkey == IPT_UI_SELECT) | |
| 2497 | /* clear cheat comment on any movement or keypress */ | |
| 2498 | popmessage(NULL); | |
| 2499 | ||
| 2500 | /* handle reset all + reset all cheats for reload all option */ | |
| 2501 | if ((FPTR)event->itemref < 3 && event->iptkey == IPT_UI_SELECT) | |
| 2499 | 2502 | { |
| 2500 | 2503 | void *curcheat; |
| 2501 | 2504 | for (curcheat = cheat_get_next_menu_entry(machine, NULL, NULL, NULL, NULL); |
| r5613 | r5614 | |
| 2506 | 2509 | } |
| 2507 | 2510 | } |
| 2508 | 2511 | |
| 2512 | ||
| 2509 | 2513 | /* handle individual cheats */ |
| 2510 | else if ((FPTR)event->itemref > | |
| 2514 | else if ((FPTR)event->itemref > 2) | |
| 2511 | 2515 | { |
| 2512 | 2516 | switch (event->iptkey) |
| 2513 | 2517 | { |
| r5613 | r5614 | |
| 2530 | 2534 | case IPT_UI_RIGHT: |
| 2531 | 2535 | changed = cheat_select_next_state(machine, event->itemref); |
| 2532 | 2536 | break; |
| 2537 | ||
| 2538 | /* bring up display comment if one exists */ | |
| 2539 | case IPT_UI_DISPLAY_COMMENT: | |
| 2540 | case IPT_UI_UP: | |
| 2541 | case IPT_UI_DOWN: | |
| 2542 | if (cheat_get_comment(event->itemref) != NULL) | |
| 2543 | popmessage("Cheat Comment:\n%s", astring_c(cheat_get_comment(event->itemref))); | |
| 2544 | break; | |
| 2533 | 2545 | } |
| 2534 | 2546 | } |
| 2535 | 2547 | |
| 2548 | /* handle reload all */ | |
| 2549 | if ((FPTR)event->itemref == 2 && event->iptkey == IPT_UI_SELECT) | |
| 2550 | { | |
| 2551 | /* re-init cheat engine and thus reload cheats/cheats have already been turned off by here */ | |
| 2552 | cheat_reload(machine); | |
| 2553 | ||
| 2554 | /* display the reloaded cheats */ | |
| 2555 | ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF); | |
| 2556 | popmessage("All cheats reloaded"); | |
| 2557 | } | |
| 2558 | ||
| 2536 | 2559 | /* if things changed, update */ |
| 2537 | 2560 | if (changed) |
| 2538 | 2561 | ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF); |
| r5613 | r5614 | |
| 2563 | 2586 | |
| 2564 | 2587 | /* add a reset all option */ |
| 2565 | 2588 | ui_menu_item_append(menu, "Reset All", NULL, 0, (void *)1); |
| 2589 | ||
| 2590 | /* add a reload all cheats option */ | |
| 2591 | ui_menu_item_append(menu, "Reload All", NULL, 0, (void *)2); | |
| 2566 | 2592 | } |
| 2567 | 2593 | |
| 2568 | 2594 | |
| r5613 | r5614 | |
| 2716 | 2742 | |
| 2717 | 2743 | /* decrease value */ |
| 2718 | 2744 | case IPT_UI_LEFT: |
| 2719 | if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT)) | |
| 2745 | if (input_code_pressed(machine, KEYCODE_LALT) || input_code_pressed(machine, KEYCODE_RALT)) | |
| 2720 | 2746 | increment = -1; |
| 2721 | else if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)) | |
| 2747 | else if (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT)) | |
| 2722 | 2748 | increment = (slider->incval > 10) ? -(slider->incval / 10) : -1; |
| 2723 | else if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL)) | |
| 2749 | else if (input_code_pressed(machine, KEYCODE_LCONTROL) || input_code_pressed(machine, KEYCODE_RCONTROL)) | |
| 2724 | 2750 | increment = -slider->incval * 10; |
| 2725 | 2751 | else |
| 2726 | 2752 | increment = -slider->incval; |
| r5613 | r5614 | |
| 2728 | 2754 | |
| 2729 | 2755 | /* increase value */ |
| 2730 | 2756 | case IPT_UI_RIGHT: |
| 2731 | if (input_code_pressed(KEYCODE_LALT) || input_code_pressed(KEYCODE_RALT)) | |
| 2757 | if (input_code_pressed(machine, KEYCODE_LALT) || input_code_pressed(machine, KEYCODE_RALT)) | |
| 2732 | 2758 | increment = 1; |
| 2733 | else if (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)) | |
| 2759 | else if (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT)) | |
| 2734 | 2760 | increment = (slider->incval > 10) ? (slider->incval / 10) : 1; |
| 2735 | else if (input_code_pressed(KEYCODE_LCONTROL) || input_code_pressed(KEYCODE_RCONTROL)) | |
| 2761 | else if (input_code_pressed(machine, KEYCODE_LCONTROL) || input_code_pressed(machine, KEYCODE_RCONTROL)) | |
| 2736 | 2762 | increment = slider->incval * 10; |
| 2737 | 2763 | else |
| 2738 | 2764 | increment = slider->incval; |
| r5613 | r5614 | |
| 3095 | 3121 | |
| 3096 | 3122 | /* left decrements */ |
| 3097 | 3123 | case IPT_UI_LEFT: |
| 3098 | newval -= input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; | |
| 3124 | newval -= input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; | |
| 3099 | 3125 | break; |
| 3100 | 3126 | |
| 3101 | 3127 | /* right increments */ |
| 3102 | 3128 | case IPT_UI_RIGHT: |
| 3103 | newval += input_code_pressed(KEYCODE_LSHIFT) ? 10 : 1; | |
| 3129 | newval += input_code_pressed(machine, KEYCODE_LSHIFT) ? 10 : 1; | |
| 3104 | 3130 | break; |
| 3105 | 3131 | } |
| 3106 | 3132 |
| r5613 | r5614 | |
|---|---|---|
| 430 | 430 | } |
| 431 | 431 | #endif |
| 432 | 432 | |
| 433 | ||
| 434 | ||
| 435 | /*************************************************************************** | |
| 436 | INLINE TIMING FUNCTIONS | |
| 437 | ***************************************************************************/ | |
| 438 | ||
| 439 | /*------------------------------------------------- | |
| 440 | get_profile_ticks - return a tick counter | |
| 441 | from the processor that can be used for | |
| 442 | profiling. It does not need to run at any | |
| 443 | particular rate. | |
| 444 | -------------------------------------------------*/ | |
| 445 | ||
| 446 | #ifndef get_profile_ticks | |
| 447 | INLINE INT64 get_profile_ticks(void) | |
| 448 | { | |
| 449 | return osd_ticks(); | |
| 450 | } | |
| 451 | #endif | |
| 452 | ||
| 433 | 453 | #endif /* __EMINLINE__ */ |
| r5613 | r5614 | |
|---|---|---|
| 449 | 449 | static void frame_update_callback(running_machine *machine); |
| 450 | 450 | static void frame_update(running_machine *machine); |
| 451 | 451 | static void frame_update_digital_joysticks(running_machine *machine); |
| 452 | static void frame_update_analog_field(analog_field_state *analog); | |
| 452 | static void frame_update_analog_field(running_machine *machine, analog_field_state *analog); | |
| 453 | 453 | static int frame_get_digital_field_state(const input_field_config *field, int mouse_down); |
| 454 | 454 | |
| 455 | 455 | /* port configuration helpers */ |
| r5613 | r5614 | |
| 478 | 478 | |
| 479 | 479 | /* settings save */ |
| 480 | 480 | static void save_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode); |
| 481 | static void save_sequence(xml_data_node *parentnode, int type, int porttype, const input_seq *seq); | |
| 481 | static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq); | |
| 482 | 482 | static int save_this_input_field_type(int type); |
| 483 | 483 | static void save_default_inputs(running_machine *machine, xml_data_node *parentnode); |
| 484 | 484 | static void save_game_inputs(running_machine *machine, xml_data_node *parentnode); |
| r5613 | r5614 | |
| 1174 | 1174 | |
| 1175 | 1175 | int input_type_pressed(running_machine *machine, int type, int player) |
| 1176 | 1176 | { |
| 1177 | return input_seq_pressed(input_type_seq(machine, type, player, SEQ_TYPE_STANDARD)); | |
| 1177 | return input_seq_pressed(machine, input_type_seq(machine, type, player, SEQ_TYPE_STANDARD)); | |
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | 1180 | |
| r5613 | r5614 | |
| 1321 | 1321 | value *= field->crossscale; |
| 1322 | 1322 | value += field->crossoffset; |
| 1323 | 1323 | |
| 1324 | /* apply custom mapping if necessary */ | |
| 1325 | if (field->crossmapper != NULL) | |
| 1326 | value = (*field->crossmapper)(field, value); | |
| 1327 | ||
| 1324 | 1328 | /* handle X axis */ |
| 1325 | 1329 | if (field->crossaxis == CROSSHAIR_AXIS_X) |
| 1326 | 1330 | { |
| r5613 | r5614 | |
| 1646 | 1650 | for (field = port->fieldlist; field != NULL; field = field->next) |
| 1647 | 1651 | if (field->state->joystick != NULL && field->way == 4) |
| 1648 | 1652 | { |
| 1649 | input_device_set_joystick_map(-1, (field->flags & FIELD_FLAG_ROTATED) ? joystick_map_4way_diagonal : joystick_map_4way_sticky); | |
| 1653 | input_device_set_joystick_map(machine, -1, (field->flags & FIELD_FLAG_ROTATED) ? joystick_map_4way_diagonal : joystick_map_4way_sticky); | |
| 1650 | 1654 | break; |
| 1651 | 1655 | } |
| 1652 | 1656 | } |
| r5613 | r5614 | |
| 1695 | 1699 | mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp); |
| 1696 | 1700 | |
| 1697 | 1701 | /* only scan the list if we haven't already enabled this class of control */ |
| 1698 | if (!input_device_class_enabled(autoenable)) | |
| 1702 | if (!input_device_class_enabled(portlist->machine, autoenable)) | |
| 1699 | 1703 | for (port = portlist; port != NULL; port = port->next) |
| 1700 | 1704 | for (field = port->fieldlist; field != NULL; field = field->next) |
| 1701 | 1705 | |
| r5613 | r5614 | |
| 1705 | 1709 | (type3 != 0 && field->type == type3)) |
| 1706 | 1710 | { |
| 1707 | 1711 | mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame); |
| 1708 | input_device_class_enable(autoenable, TRUE); | |
| 1712 | input_device_class_enable(portlist->machine, autoenable, TRUE); | |
| 1709 | 1713 | break; |
| 1710 | 1714 | } |
| 1711 | 1715 | } |
| r5613 | r5614 | |
| 1988 | 1992 | |
| 1989 | 1993 | /* handle analog inputs */ |
| 1990 | 1994 | else if (field->state->analog != NULL) |
| 1991 | frame_update_analog_field(field->state->analog); | |
| 1995 | frame_update_analog_field(machine, field->state->analog); | |
| 1992 | 1996 | |
| 1993 | 1997 | /* handle non-analog types, but only when the UI isn't visible */ |
| 1994 | 1998 | else if (!ui_visible && frame_get_digital_field_state(field, field == mouse_field)) |
| r5613 | r5614 | |
| 2050 | 2054 | joystick->current = 0; |
| 2051 | 2055 | |
| 2052 | 2056 | /* read all the associated ports */ |
| 2053 | if (joystick->field[JOYDIR_UP] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_UP], SEQ_TYPE_STANDARD))) | |
| 2057 | if (joystick->field[JOYDIR_UP] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_UP], SEQ_TYPE_STANDARD))) | |
| 2054 | 2058 | joystick->current |= JOYDIR_UP_BIT; |
| 2055 | if (joystick->field[JOYDIR_DOWN] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_DOWN], SEQ_TYPE_STANDARD))) | |
| 2059 | if (joystick->field[JOYDIR_DOWN] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_DOWN], SEQ_TYPE_STANDARD))) | |
| 2056 | 2060 | joystick->current |= JOYDIR_DOWN_BIT; |
| 2057 | if (joystick->field[JOYDIR_LEFT] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_LEFT], SEQ_TYPE_STANDARD))) | |
| 2061 | if (joystick->field[JOYDIR_LEFT] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_LEFT], SEQ_TYPE_STANDARD))) | |
| 2058 | 2062 | joystick->current |= JOYDIR_LEFT_BIT; |
| 2059 | if (joystick->field[JOYDIR_RIGHT] != NULL && input_seq_pressed(input_field_seq(joystick->field[JOYDIR_RIGHT], SEQ_TYPE_STANDARD))) | |
| 2063 | if (joystick->field[JOYDIR_RIGHT] != NULL && input_seq_pressed(machine, input_field_seq(joystick->field[JOYDIR_RIGHT], SEQ_TYPE_STANDARD))) | |
| 2060 | 2064 | joystick->current |= JOYDIR_RIGHT_BIT; |
| 2061 | 2065 | |
| 2062 | 2066 | /* lock out opposing directions (left + right or up + down) */ |
| r5613 | r5614 | |
| 2117 | 2121 | internals of a single analog field |
| 2118 | 2122 | -------------------------------------------------*/ |
| 2119 | 2123 | |
| 2120 | static void frame_update_analog_field(analog_field_state *analog) | |
| 2124 | static void frame_update_analog_field(running_machine *machine, analog_field_state *analog) | |
| 2121 | 2125 | { |
| 2122 | 2126 | input_item_class itemclass; |
| 2123 | 2127 | int keypressed = FALSE; |
| r5613 | r5614 | |
| 2129 | 2133 | analog->previous = analog->accum = apply_analog_min_max(analog, analog->accum); |
| 2130 | 2134 | |
| 2131 | 2135 | /* get the new raw analog value and its type */ |
| 2132 | rawvalue = input_seq_axis_value(input_field_seq(analog->field, SEQ_TYPE_STANDARD), &itemclass); | |
| 2136 | rawvalue = input_seq_axis_value(machine, input_field_seq(analog->field, SEQ_TYPE_STANDARD), &itemclass); | |
| 2133 | 2137 | |
| 2134 | 2138 | /* if we got an absolute input, it overrides everything else */ |
| 2135 | 2139 | if (itemclass == ITEM_CLASS_ABSOLUTE) |
| r5613 | r5614 | |
| 2187 | 2191 | |
| 2188 | 2192 | /* if the decrement code sequence is pressed, add the key delta to */ |
| 2189 | 2193 | /* the accumulated delta; also note that the last input was a digital one */ |
| 2190 | if (input_seq_pressed(input_field_seq(analog->field, SEQ_TYPE_DECREMENT))) | |
| 2194 | if (input_seq_pressed(machine, input_field_seq(analog->field, SEQ_TYPE_DECREMENT))) | |
| 2191 | 2195 | { |
| 2192 | 2196 | keypressed = TRUE; |
| 2193 | 2197 | if (analog->delta != 0) |
| r5613 | r5614 | |
| 2199 | 2203 | } |
| 2200 | 2204 | |
| 2201 | 2205 | /* same for the increment code sequence */ |
| 2202 | if (input_seq_pressed(input_field_seq(analog->field, SEQ_TYPE_INCREMENT))) | |
| 2206 | if (input_seq_pressed(machine, input_field_seq(analog->field, SEQ_TYPE_INCREMENT))) | |
| 2203 | 2207 | { |
| 2204 | 2208 | keypressed = TRUE; |
| 2205 | 2209 | if (analog->delta) |
| r5613 | r5614 | |
| 2263 | 2267 | |
| 2264 | 2268 | static int frame_get_digital_field_state(const input_field_config *field, int mouse_down) |
| 2265 | 2269 | { |
| 2266 | int curstate = mouse_down || input_seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD)); | |
| 2270 | int curstate = mouse_down || input_seq_pressed(field->port->machine, input_field_seq(field, SEQ_TYPE_STANDARD)); | |
| 2267 | 2271 | int changed = FALSE; |
| 2268 | 2272 | |
| 2269 | 2273 | /* if the state changed, look for switch down/switch up */ |
| r5613 | r5614 | |
| 2713 | 2717 | curfield->crossoffset *= 1.0f / 65536.0f; |
| 2714 | 2718 | break; |
| 2715 | 2719 | |
| 2720 | /* crosshair mapper callback */ | |
| 2721 | case INPUT_TOKEN_CROSSHAIR_MAPPER: | |
| 2722 | if (curfield == NULL) | |
| 2723 | { | |
| 2724 | error_buf_append(errorbuf, errorbuflen, "INPUT_TOKEN_CROSSHAIR_MAPPER encountered with no active field\n"); | |
| 2725 | TOKEN_SKIP_PTR(ipt); | |
| 2726 | break; | |
| 2727 | } | |
| 2728 | curfield->crossmapper = TOKEN_GET_PTR(ipt, crossmapptr); | |
| 2729 | break; | |
| 2730 | ||
| 2716 | 2731 | /* analog decrement sequence */ |
| 2717 | 2732 | case INPUT_TOKEN_CODE_DEC: |
| 2718 | 2733 | TOKEN_UNGET_UINT32(ipt); |
| r5613 | r5614 | |
| 3403 | 3418 | { |
| 3404 | 3419 | if (strcmp(seqnode->value, "NONE") == 0) |
| 3405 | 3420 | input_seq_set_0(&newseq[seqtype]); |
| 3406 | else if (input_seq_from_tokens(seqnode->value, &tempseq) != 0) | |
| 3421 | else if (input_seq_from_tokens(machine, seqnode->value, &tempseq) != 0) | |
| 3407 | 3422 | newseq[seqtype] = tempseq; |
| 3408 | 3423 | } |
| 3409 | 3424 | } |
| r5613 | r5614 | |
| 3459 | 3474 | count = 0; |
| 3460 | 3475 | for (remapnode = xml_get_sibling(parentnode->child, "remap"); remapnode != NULL; remapnode = xml_get_sibling(remapnode->next, "remap")) |
| 3461 | 3476 | { |
| 3462 | input_code origcode = input_code_from_token(xml_get_attribute_string(remapnode, "origcode", "")); | |
| 3463 | input_code newcode = input_code_from_token(xml_get_attribute_string(remapnode, "newcode", "")); | |
| 3477 | input_code origcode = input_code_from_token(machine, xml_get_attribute_string(remapnode, "origcode", "")); | |
| 3478 | input_code newcode = input_code_from_token(machine, xml_get_attribute_string(remapnode, "newcode", "")); | |
| 3464 | 3479 | if (origcode != INPUT_CODE_INVALID && newcode != INPUT_CODE_INVALID) |
| 3465 | 3480 | { |
| 3466 | 3481 | oldtable[count] = origcode; |
| r5613 | r5614 | |
| 3609 | 3624 | sequence |
| 3610 | 3625 | -------------------------------------------------*/ |
| 3611 | 3626 | |
| 3612 | static void save_sequence(xml_data_node *parentnode, int type, int porttype, const input_seq *seq) | |
| 3627 | static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq) | |
| 3613 | 3628 | { |
| 3614 | 3629 | astring *seqstring = astring_alloc(); |
| 3615 | 3630 | xml_data_node *seqnode; |
| r5613 | r5614 | |
| 3618 | 3633 | if (input_seq_get_1(seq) == SEQCODE_END) |
| 3619 | 3634 | astring_cpyc(seqstring, "NONE"); |
| 3620 | 3635 | else |
| 3621 | input_seq_to_tokens(seqstring, seq); | |
| 3636 | input_seq_to_tokens(machine, seqstring, seq); | |
| 3622 | 3637 | |
| 3623 | 3638 | /* add the new node */ |
| 3624 | 3639 | seqnode = xml_add_child(parentnode, "newseq", astring_c(seqstring)); |
| r5613 | r5614 | |
| 3684 | 3699 | /* add only the sequences that have changed from the defaults */ |
| 3685 | 3700 | for (seqtype = 0; seqtype < ARRAY_LENGTH(typestate->seq); seqtype++) |
| 3686 | 3701 | if (input_seq_cmp(&typestate->seq[seqtype], &typestate->typedesc.seq[seqtype]) != 0) |
| 3687 | save_sequence(portnode, seqtype, typestate->typedesc.type, &typestate->seq[seqtype]); | |
| 3702 | save_sequence(machine, portnode, seqtype, typestate->typedesc.type, &typestate->seq[seqtype]); | |
| 3688 | 3703 | } |
| 3689 | 3704 | } |
| 3690 | 3705 | } |
| r5613 | r5614 | |
| 3745 | 3760 | /* add sequences if changed */ |
| 3746 | 3761 | for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++) |
| 3747 | 3762 | if (input_seq_cmp(&field->state->seq[seqtype], &field->seq[seqtype]) != 0) |
| 3748 | save_sequence(portnode, seqtype, field->type, &field->state->seq[seqtype]); | |
| 3763 | save_sequence(machine, portnode, seqtype, field->type, &field->state->seq[seqtype]); | |
| 3749 | 3764 | |
| 3750 | 3765 | /* write out non-analog changes */ |
| 3751 | 3766 | if (field->state->analog == NULL) |
| r5613 | r5614 | |
|---|---|---|
| 335 | 335 | /* load the configuration settings and NVRAM */ |
| 336 | 336 | settingsloaded = config_load_settings(machine); |
| 337 | 337 | nvram_load(machine); |
| 338 | sound_mute(FALSE); | |
| 338 | sound_mute(machine, FALSE); | |
| 339 | 339 | |
| 340 | 340 | /* display the startup screens */ |
| 341 | 341 | ui_display_startup_screens(machine, firstrun, !settingsloaded); |
| r5613 | r5614 | |
| 377 | 377 | end_resource_tracking(); |
| 378 | 378 | |
| 379 | 379 | /* save the NVRAM and configuration */ |
| 380 | sound_mute(TRUE); | |
| 380 | sound_mute(machine, TRUE); | |
| 381 | 381 | nvram_save(machine); |
| 382 | 382 | config_save_settings(machine); |
| 383 | 383 | } |
| r5613 | r5614 | |
|---|---|---|
| 595 | 595 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_PAGE_DOWN, "UI Page Down", SEQ_DEF_1(KEYCODE_PGDN) ) |
| 596 | 596 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_SELECT, "UI Select", SEQ_DEF_3(KEYCODE_ENTER, SEQCODE_OR, INDEXED(JOYCODE_BUTTON1, 0)) ) |
| 597 | 597 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_CANCEL, "UI Cancel", SEQ_DEF_1(KEYCODE_ESC) ) |
| 598 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_DISPLAY_COMMENT, "UI Display Comment", SEQ_DEF_1(KEYCODE_SPACE) ) | |
| 598 | 599 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_CLEAR, "UI Clear", SEQ_DEF_1(KEYCODE_DEL) ) |
| 599 | 600 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_ZOOM_IN, "UI Zoom In", SEQ_DEF_1(KEYCODE_EQUALS) ) |
| 600 | 601 | INPUT_PORT_DIGITAL_TYPE( 0, UI, UI_ZOOM_OUT, "UI Zoom Out", SEQ_DEF_1(KEYCODE_MINUS) ) |
| r5613 | r5614 | |
|---|---|---|
| 470 | 470 | return result; |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | ||
| 474 | ||
| 475 | /*************************************************************************** | |
| 476 | INLINE TIMING FUNCTIONS | |
| 477 | ***************************************************************************/ | |
| 478 | ||
| 479 | /*------------------------------------------------- | |
| 480 | get_profile_ticks - return a tick counter | |
| 481 | from the processor that can be used for | |
| 482 | profiling. It does not need to run at any | |
| 483 | particular rate. | |
| 484 | -------------------------------------------------*/ | |
| 485 | ||
| 486 | #define get_profile_ticks _get_profile_ticks | |
| 487 | INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void) | |
| 488 | { | |
| 489 | // fix me - should use the time base | |
| 490 | return osd_ticks(); | |
| 491 | } | |
| 492 | ||
| 473 | 493 | #endif /* __EIGCCPPC__ */ |
| r5613 | r5614 | |
|---|---|---|
| 745 | 745 | data = timer->mode; |
| 746 | 746 | break; |
| 747 | 747 | } |
| 748 | ||
| 749 | 748 | return data; |
| 750 | 749 | } |
| 751 | 750 | |
| r5613 | r5614 | |
| 937 | 936 | default: DEVICE_GET_INFO_CALL(cia6526r1); break; |
| 938 | 937 | } |
| 939 | 938 | } |
| 939 |
| r5613 | r5614 | |
|---|---|---|
| 111 | 111 | static void duart68681_update_interrupts(duart68681_state *duart68681) |
| 112 | 112 | { |
| 113 | 113 | /* update SR state and update interrupt ISR state for the following bits: |
| 114 | SRn: bits 7-4: handled elsewhere. | |
| 115 | SRn: bit 3 (TxEMTn) (we can assume since we're not actually emulating the delay/timing of sending bits, that as long as TxRDYn is set, TxEMTn is also set since the transmit byte has 'already happened', therefore TxEMTn is always 1 assuming tx is enabled on channel n and the MSR2n mode is 0 or 2; in mode 1 it is explicitly zeroed, and mode 3 is undefined) | |
| 116 | SRn: bit 2 (TxRDYn) (we COULD assume since we're not emulating delay and timing output, that as long as tx is enabled on channel n, TxRDY is 1 for channel n and the MSR2n mode is 0 or 2; in mode 1 it is explicitly zeroed, and mode 3 is undefined; however, tx_ready is already nicely handled for us elsewhere, so we can use that instead for now, though we may need to retool that code as well) | |
| 117 | SRn: bit 1 (FFULLn) (this bit we actually emulate; if the recieve fifo for channel n is full, this bit is 1, otherwise it is 0. the recieve fifo should be three words long.) | |
| 118 | SRn: bit 0 (RxRDYn) (this bit we also emulate; the bit is always asserted if the recieve fifo is not empty) | |
| 119 | ISR: bit 7: Input Port change; this should be handled elsewhere, on the input port handler | |
| 120 | ISR: bit 6: Delta Break B; this should be handled elsewhere, on the data recieve handler | |
| 121 | ISR: bit 5: RxRDYB/FFULLB: this is handled here; depending on whether MSR1B bit 6 is 0 or 1, this bit holds the state of SRB bit 0 or bit 1 respectively | |
| 122 | ISR: bit 4: TxRDYB: this is handled here; it mirrors SRB bit 2 | |
| 123 | ISR: bit 3: Counter ready; this should be handled by the timer generator | |
| 124 | ISR: bit 2: Delta Break A; this should be handled elsewhere, on the data recieve handler | |
| 125 | ISR: bit 1: RxRDYA/FFULLA: this is handled here; depending on whether MSR1A bit 6 is 0 or 1, this bit holds the state of SRA bit 0 or bit 1 respectively | |
| 126 | ISR: bit 0: TxRDYA: this is handled here; it mirrors SRA bit 2 | |
| 127 | */ | |
| 114 | SRn: bits 7-4: handled elsewhere. | |
| 115 | SRn: bit 3 (TxEMTn) (we can assume since we're not actually emulating the delay/timing of sending bits, that as long as TxRDYn is set, TxEMTn is also set since the transmit byte has 'already happened', therefore TxEMTn is always 1 assuming tx is enabled on channel n and the MSR2n mode is 0 or 2; in mode 1 it is explicitly zeroed, and mode 3 is undefined) | |
| 116 | SRn: bit 2 (TxRDYn) (we COULD assume since we're not emulating delay and timing output, that as long as tx is enabled on channel n, TxRDY is 1 for channel n and the MSR2n mode is 0 or 2; in mode 1 it is explicitly zeroed, and mode 3 is undefined; however, tx_ready is already nicely handled for us elsewhere, so we can use that instead for now, though we may need to retool that code as well) | |
| 117 | SRn: bit 1 (FFULLn) (this bit we actually emulate; if the recieve fifo for channel n is full, this bit is 1, otherwise it is 0. the recieve fifo should be three words long.) | |
| 118 | SRn: bit 0 (RxRDYn) (this bit we also emulate; the bit is always asserted if the recieve fifo is not empty) | |
| 119 | ISR: bit 7: Input Port change; this should be handled elsewhere, on the input port handler | |
| 120 | ISR: bit 6: Delta Break B; this should be handled elsewhere, on the data recieve handler | |
| 121 | ISR: bit 5: RxRDYB/FFULLB: this is handled here; depending on whether MSR1B bit 6 is 0 or 1, this bit holds the state of SRB bit 0 or bit 1 respectively | |
| 122 | ISR: bit 4: TxRDYB: this is handled here; it mirrors SRB bit 2 | |
| 123 | ISR: bit 3: Counter ready; this should be handled by the timer generator | |
| 124 | ISR: bit 2: Delta Break A; this should be handled elsewhere, on the data recieve handler | |
| 125 | ISR: bit 1: RxRDYA/FFULLA: this is handled here; depending on whether MSR1A bit 6 is 0 or 1, this bit holds the state of SRA bit 0 or bit 1 respectively | |
| 126 | ISR: bit 0: TxRDYA: this is handled here; it mirrors SRA bit 2 | |
| 127 | */ | |
| 128 | 128 | UINT8 ch = 0; |
| 129 | 129 | //logerror("DEBUG: 68681 int check: upon func call, SRA is %02X, SRB is %02X, ISR is %02X\n", duart68681->channel[0].SR, duart68681->channel[1].SR, duart68681->ISR); |
| 130 | 130 | for (ch = 0; ch < 2; ch++) |
| r5613 | r5614 | |
| 156 | 156 | // Handle the TxEMT and TxRDY bits based on mode |
| 157 | 157 | switch( duart68681->channel[ch].MR2&0xC0) // what mode are we in? |
| 158 | 158 | { |
| 159 | case 0x00: // normal mode | |
| 159 | case 0x00: // normal mode | |
| 160 | 160 | if ( duart68681->channel[ch].tx_enabled ) |
| 161 | 161 | { |
| 162 | 162 | duart68681->channel[ch].SR |= STATUS_TRANSMITTER_EMPTY; |
| r5613 | r5614 | |
| 498 | 498 | else |
| 499 | 499 | { |
| 500 | 500 | r = 0xff; |
| 501 | /* | |
| 502 | if (input_code_pressed(KEYCODE_1)) r ^= 0x0001; | |
| 503 | if (input_code_pressed(KEYCODE_2)) r ^= 0x0002; | |
| 504 | if (input_code_pressed(KEYCODE_3)) r ^= 0x0004; | |
| 505 | if (input_code_pressed(KEYCODE_4)) r ^= 0x0008; | |
| 506 | if (input_code_pressed(KEYCODE_5)) r ^= 0x0010; | |
| 507 | if (input_code_pressed(KEYCODE_6)) r ^= 0x0020; | |
| 508 | if (input_code_pressed(KEYCODE_7)) r ^= 0x0040; | |
| 509 | if (input_code_pressed(KEYCODE_8)) r ^= 0x0080; | |
| 510 | */ | |
| 501 | #if 0 | |
| 502 | if (input_code_pressed(device->machine, KEYCODE_1)) r ^= 0x0001; | |
| 503 | if (input_code_pressed(device->machine, KEYCODE_2)) r ^= 0x0002; | |
| 504 | if (input_code_pressed(device->machine, KEYCODE_3)) r ^= 0x0004; | |
| 505 | if (input_code_pressed(device->machine, KEYCODE_4)) r ^= 0x0008; | |
| 506 | if (input_code_pressed(device->machine, KEYCODE_5)) r ^= 0x0010; | |
| 507 | if (input_code_pressed(device->machine, KEYCODE_6)) r ^= 0x0020; | |
| 508 | if (input_code_pressed(device->machine, KEYCODE_7)) r ^= 0x0040; | |
| 509 | if (input_code_pressed(device->machine, KEYCODE_8)) r ^= 0x0080; | |
| 510 | #endif | |
| 511 | 511 | } |
| 512 | 512 | break; |
| 513 | 513 | case 0x0e: /* Start counter command */ |
| r5613 | r5614 | |
|---|---|---|
| 319 | 319 | IPT_UI_PAGE_DOWN, |
| 320 | 320 | IPT_UI_SELECT, |
| 321 | 321 | IPT_UI_CANCEL, |
| 322 | IPT_UI_DISPLAY_COMMENT, | |
| 322 | 323 | IPT_UI_CLEAR, |
| 323 | 324 | IPT_UI_ZOOM_IN, |
| 324 | 325 | IPT_UI_ZOOM_OUT, |
| r5613 | r5614 | |
| 398 | 399 | INPUT_TOKEN_KEYDELTA, |
| 399 | 400 | INPUT_TOKEN_CENTERDELTA, |
| 400 | 401 | INPUT_TOKEN_CROSSHAIR, |
| 402 | INPUT_TOKEN_CROSSHAIR_MAPPER, | |
| 401 | 403 | INPUT_TOKEN_FULL_TURN_COUNT, |
| 402 | 404 | INPUT_TOKEN_POSITIONS, |
| 403 | 405 | INPUT_TOKEN_WRAPS, |
| r5613 | r5614 | |
| 568 | 570 | /* input port changed callback function */ |
| 569 | 571 | typedef void (*input_field_changed_func)(const input_field_config *field, void *param, UINT32 oldval, UINT32 newval); |
| 570 | 572 | |
| 573 | /* crosshair mapping function */ | |
| 574 | typedef float (*input_field_crossmap_func)(const input_field_config *field, float linear_value); | |
| 571 | 575 | |
| 576 | ||
| 572 | 577 | /* this type is used to encode input port definitions */ |
| 573 | 578 | typedef union _input_port_token input_port_token; |
| 574 | 579 | union _input_port_token |
| r5613 | r5614 | |
| 577 | 582 | const input_port_token * tokenptr; |
| 578 | 583 | input_field_custom_func customptr; |
| 579 | 584 | input_field_changed_func changedptr; |
| 585 | input_field_crossmap_func crossmapptr; | |
| 580 | 586 | }; |
| 581 | 587 | |
| 582 | 588 | |
| r5613 | r5614 | |
| 646 | 652 | float crossscale; /* crosshair scale */ |
| 647 | 653 | float crossoffset; /* crosshair offset */ |
| 648 | 654 | float crossaltaxis; /* crosshair alternate axis value */ |
| 655 | input_field_crossmap_func crossmapper; /* crosshair mapping function */ | |
| 649 | 656 | UINT16 full_turn_count;/* number of optical counts for 1 full turn of the original control */ |
| 650 | 657 | const input_port_value * remap_table; /* pointer to an array that remaps the port value */ |
| 651 | 658 | |
| r5613 | r5614 | |
| 725 | 732 | /* macro for port changed callback functions (PORT_CHANGED) */ |
| 726 | 733 | #define INPUT_CHANGED(name) void name(const input_field_config *field, void *param, UINT32 oldval, UINT32 newval) |
| 727 | 734 | |
| 735 | /* macro for port changed callback functions (PORT_CROSSHAIR_MAPPER) */ | |
| 736 | #define CROSSHAIR_MAPPER(name) float name(const input_field_config *field, float linear_value) | |
| 737 | ||
| 728 | 738 | /* macro for wrapping a default string */ |
| 729 | 739 | #define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num) |
| 730 | 740 | |
| r5613 | r5614 | |
| 847 | 857 | TOKEN_UINT32_PACK3(INPUT_TOKEN_CROSSHAIR, 8, CROSSHAIR_AXIS_##axis, 4, (INT32)((altaxis) * 65536.0f), 20), \ |
| 848 | 858 | TOKEN_UINT64_PACK2((INT32)((scale) * 65536.0f), 32, (INT32)((offset) * 65536.0f), 32), |
| 849 | 859 | |
| 860 | #define PORT_CROSSHAIR_MAPPER(_callback) \ | |
| 861 | TOKEN_UINT32_PACK1(INPUT_TOKEN_CROSSHAIR_MAPPER, 8), \ | |
| 862 | TOKEN_PTR(crossmapptr, _callback), | |
| 863 | ||
| 850 | 864 | /* how many optical counts for 1 full turn of the control */ |
| 851 | 865 | #define PORT_FULL_TURN_COUNT(_count) \ |
| 852 | 866 | TOKEN_UINT32_PACK2(INPUT_TOKEN_FULL_TURN_COUNT, 8, _count, 24), |
| r5613 | r5614 | |
|---|---|---|
| 134 | 134 | typedef struct _streams_private streams_private; |
| 135 | 135 | typedef struct _devices_private devices_private; |
| 136 | 136 | typedef struct _romload_private romload_private; |
| 137 | typedef struct _sound_private sound_private; | |
| 138 | typedef struct _input_private input_private; | |
| 137 | 139 | typedef struct _input_port_private input_port_private; |
| 138 | 140 | typedef struct _ui_input_private ui_input_private; |
| 139 | 141 | typedef struct _cheat_private cheat_private; |
| r5613 | r5614 | |
| 184 | 186 | streams_private * streams_data; /* internal data from streams.c */ |
| 185 | 187 | devices_private * devices_data; /* internal data from devices.c */ |
| 186 | 188 | romload_private * romload_data; /* internal data from romload.c */ |
| 189 | sound_private * sound_data; /* internal data from sound.c */ | |
| 190 | input_private * input_data; /* internal data from input.c */ | |
| 187 | 191 | input_port_private * input_port_data; /* internal data from inptport.c */ |
| 188 | 192 | ui_input_private * ui_input_data; /* internal data from uiinput.c */ |
| 189 | 193 | cheat_private * cheat_data; /* internal data from cheat.c */ |
| r5613 | r5614 | |
|---|---|---|
| 161 | 161 | CPUINFO_FCT_EXIT, /* R/O: void (*exit)(const device_config *device) */ |
| 162 | 162 | CPUINFO_FCT_EXECUTE, /* R/O: int (*execute)(const device_config *device, int cycles) */ |
| 163 | 163 | CPUINFO_FCT_BURN, /* R/O: void (*burn)(const device_config *device, int cycles) */ |
| 164 | CPUINFO_FCT_DISASSEMBLE, /* R/O: offs_t (*disassemble)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) */ | |
| 164 | CPUINFO_FCT_DISASSEMBLE, /* R/O: offs_t (*disassemble)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) */ | |
| 165 | 165 | CPUINFO_FCT_TRANSLATE, /* R/O: int (*translate)(const device_config *device, int space, int intention, offs_t *address) */ |
| 166 | 166 | CPUINFO_FCT_READ, /* R/O: int (*read)(const device_config *device, int space, UINT32 offset, int size, UINT64 *value) */ |
| 167 | 167 | CPUINFO_FCT_WRITE, /* R/O: int (*write)(const device_config *device, int space, UINT32 offset, int size, UINT64 value) */ |
| r5613 | r5614 | |
| 286 | 286 | #define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device) |
| 287 | 287 | |
| 288 | 288 | #define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name |
| 289 | #define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) | |
| 290 | #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram) | |
| 289 | #define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options) | |
| 290 | #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram, options) | |
| 291 | 291 | |
| 292 | 292 | #define CPU_VALIDITY_CHECK_NAME(name) cpu_validity_check_##name |
| 293 | 293 | #define CPU_VALIDITY_CHECK(name) int CPU_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const void *config) |
| r5613 | r5614 | |
| 379 | 379 | typedef int (*cpu_write_func)(const device_config *device, int space, UINT32 offset, int size, UINT64 value); |
| 380 | 380 | typedef int (*cpu_readop_func)(const device_config *device, UINT32 offset, int size, UINT64 *value); |
| 381 | 381 | typedef void (*cpu_debug_init_func)(const device_config *device); |
| 382 | typedef offs_t (*cpu_disassemble_func)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); | |
| 382 | typedef offs_t (*cpu_disassemble_func)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options); | |
| 383 | 383 | typedef int (*cpu_validity_check_func)(const game_driver *driver, const void *config); |
| 384 | 384 | typedef void (*cpu_state_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry); |
| 385 | 385 | typedef void (*cpu_string_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string); |
| r0 | r5614 | |
|---|---|---|
| 1 | /************************************************************************ | |
| 2 | * | |
| 3 | * MAME - Discrete sound system emulation library | |
| 4 | * | |
| 5 | * Written by Keith Wilkins (mame@esplexo.co.uk) | |
| 6 | * | |
| 7 | * (c) K.Wilkins 2000 | |
| 8 | * (c) D.Renaud 2003-2004 | |
| 9 | * | |
| 10 | ************************************************************************ | |
| 11 | * | |
| 12 | * DSO_OUTPUT - Output node | |
| 13 | * DSO_TASK - Task node | |
| 14 | * | |
| 15 | * Task and list routines | |
| 16 | * | |
| 17 | ************************************************************************/ | |
| 18 | ||
| 19 | struct dso_csvlog_context | |
| 20 | { | |
| 21 | FILE *csv_file; | |
| 22 | INT64 sample_num; | |
| 23 | char name[32]; | |
| 24 | }; | |
| 25 | ||
| 26 | struct dso_wavelog_context | |
| 27 | { | |
| 28 | wav_file *wav_file; | |
| 29 | char name[32]; | |
| 30 | }; | |
| 31 | ||
| 32 | ||
| 33 | /************************************* | |
| 34 | * | |
| 35 | * Task node (main task execution) | |
| 36 | * | |
| 37 | *************************************/ | |
| 38 | ||
| 39 | static DISCRETE_START( dso_task ) | |
| 40 | { | |
| 41 | discrete_task_context *task = (discrete_task_context *) node->context; | |
| 42 | int inputnum; | |
| 43 | const linked_list_entry *node_entry; | |
| 44 | const linked_list_entry *step_entry; | |
| 45 | ||
| 46 | /* Determine, which nodes in the task are referenced in the main task | |
| 47 | * and add them to the list of nodes to be buffered for further processing | |
| 48 | */ | |
| 49 | for (node_entry = task->list; node_entry != NULL; node_entry = node_entry->next) | |
| 50 | { | |
| 51 | node_description *node = (node_description *) node_entry->ptr; | |
| 52 | int found = 0; | |
| 53 | ||
| 54 | for (step_entry = node->info->step_list; step_entry != NULL; step_entry = step_entry->next) | |
| 55 | { | |
| 56 | node_description *snode = (node_description *) step_entry->ptr; | |
| 57 | ||
| 58 | /* loop over all active inputs */ | |
| 59 | for (inputnum = 0; inputnum < snode->active_inputs; inputnum++) | |
| 60 | { | |
| 61 | int inputnode = snode->block->input_node[inputnum]; | |
| 62 | if IS_VALUE_A_NODE(inputnode) | |
| 63 | { | |
| 64 | if (NODE_DEFAULT_NODE(node->block->node) == NODE_DEFAULT_NODE(inputnode)) | |
| 65 | { | |
| 66 | int i; | |
| 67 | found = 0; | |
| 68 | for (i = 0; i < task->numbuffered; i++) | |
| 69 | if (task->nodes[i]->block->node == inputnode) | |
| 70 | found = 1; | |
| 71 | if (!found) | |
| 72 | { | |
| 73 | if (task->numbuffered >= DISCRETE_MAX_TASK_OUTPUTS) | |
| 74 | fatalerror("dso_task_start - Number of maximum buffered nodes exceeded"); | |
| 75 | ||
| 76 | discrete_log(node->info, "dso_task_start - buffering %d(%d) in task %p referenced by %d", NODE_INDEX(inputnode), NODE_CHILD_NODE_NUM(inputnode), task, NODE_BLOCKINDEX(snode)); | |
| 77 | task->node_buf[task->numbuffered] = auto_alloc_array(node->info->device->machine, double, 2048); | |
| 78 | task->dest[task->numbuffered] = (double **) &snode->input[inputnum]; | |
| 79 | task->nodes[task->numbuffered] = discrete_find_node(node->info, inputnode); | |
| 80 | task->numbuffered++; | |
| 81 | } | |
| 82 | } | |
| 83 | } | |
| 84 | } | |
| 85 | } | |
| 86 | } | |
| 87 | } | |
| 88 | ||
| 89 | static DISCRETE_STEP( dso_task ) | |
| 90 | { | |
| 91 | discrete_task_context *task = (discrete_task_context *) node->context; | |
| 92 | int i; | |
| 93 | ||
| 94 | for (i = 0; i < task->numbuffered; i++) | |
| 95 | *(task->ptr[i]++) = **task->dest[i]; //DISCRETE_INPUT(i); | |
| 96 | } | |
| 97 | ||
| 98 | static DISCRETE_RESET( dso_task ) | |
| 99 | { | |
| 100 | /* nothing to do - just avoid being stepped */ | |
| 101 | } | |
| 102 | ||
| 103 | static DISCRETE_STEP( dso_output ) | |
| 104 | { | |
| 105 | stream_sample_t **output = (stream_sample_t **) &node->context; | |
| 106 | double val; | |
| 107 | ||
| 108 | /* Add gain to the output and put into the buffers */ | |
| 109 | /* Clipping will be handled by the main sound system */ | |
| 110 | val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); | |
| 111 | **output = val; | |
| 112 | (*output)++; | |
| 113 | } | |
| 114 | ||
| 115 | static DISCRETE_RESET( dso_output ) | |
| 116 | { | |
| 117 | /* nothing to do - just avoid being stepped */ | |
| 118 | } | |
| 119 | ||
| 120 | static DISCRETE_START( dso_csvlog ) | |
| 121 | { | |
| 122 | struct dso_csvlog_context *context = (struct dso_csvlog_context *) node->context; | |
| 123 | int log_num, node_num; | |
| 124 | ||
| 125 | log_num = node_module_index(node); | |
| 126 | context->sample_num = 0; | |
| 127 | ||
| 128 | sprintf(context->name, "discrete%s_%d.csv", node->info->device->tag, log_num); | |
| 129 | context->csv_file = fopen(context->name, "w"); | |
| 130 | /* Output some header info */ | |
| 131 | fprintf(context->csv_file, "\"MAME Discrete System Node Log\"\n"); | |
| 132 | fprintf(context->csv_file, "\"Log Version\", 1.0\n"); | |
| 133 | fprintf(context->csv_file, "\"Sample Rate\", %d\n", node->info->sample_rate); | |
| 134 | fprintf(context->csv_file, "\n"); | |
| 135 | fprintf(context->csv_file, "\"Sample\""); | |
| 136 | for (node_num = 0; node_num < node->active_inputs; node_num++) | |
| 137 | { | |
| 138 | fprintf(context->csv_file, ", \"NODE_%2d\"", NODE_INDEX(node->block->input_node[node_num])); | |
| 139 | } | |
| 140 | fprintf(context->csv_file, "\n"); | |
| 141 | } | |
| 142 | ||
| 143 | static DISCRETE_STOP( dso_csvlog ) | |
| 144 | { | |
| 145 | struct dso_csvlog_context *context = (struct dso_csvlog_context *) node->context; | |
| 146 | ||
| 147 | /* close any csv files */ | |
| 148 | if (context->csv_file) | |
| 149 | fclose(context->csv_file); | |
| 150 | } | |
| 151 | ||
| 152 | static DISCRETE_STEP( dso_csvlog ) | |
| 153 | { | |
| 154 | struct dso_csvlog_context *context = (struct dso_csvlog_context *) node->context; | |
| 155 | int nodenum; | |
| 156 | ||
| 157 | /* Dump any csv logs */ | |
| 158 | fprintf(context->csv_file, "%" I64FMT "d", ++context->sample_num); | |
| 159 | for (nodenum = 0; nodenum < node->active_inputs; nodenum++) | |
| 160 | { | |
| 161 | fprintf(context->csv_file, ", %f", *node->input[nodenum]); | |
| 162 | } | |
| 163 | fprintf(context->csv_file, "\n"); | |
| 164 | } | |
| 165 | ||
| 166 | static DISCRETE_START( dso_wavelog ) | |
| 167 | { | |
| 168 | struct dso_wavelog_context *context = (struct dso_wavelog_context *) node->context; | |
| 169 | int log_num; | |
| 170 | ||
| 171 | log_num = node_module_index(node); | |
| 172 | sprintf(context->name, "discrete%s_%d.wav", node->info->device->tag, log_num); | |
| 173 | context->wav_file = wav_open(context->name, node->info->sample_rate, node->active_inputs/2); | |
| 174 | } | |
| 175 | ||
| 176 | static DISCRETE_STOP( dso_wavelog ) | |
| 177 | { | |
| 178 | struct dso_wavelog_context *context = (struct dso_wavelog_context *) node->context; | |
| 179 | ||
| 180 | /* close any wave files */ | |
| 181 | if (context->wav_file) | |
| 182 | wav_close(context->wav_file); | |
| 183 | } | |
| 184 | ||
| 185 | static DISCRETE_STEP( dso_wavelog ) | |
| 186 | { | |
| 187 | struct dso_wavelog_context *context = (struct dso_wavelog_context *) node->context; | |
| 188 | double val; | |
| 189 | INT16 wave_data_l, wave_data_r; | |
| 190 | ||
| 191 | /* Dump any wave logs */ | |
| 192 | /* get nodes to be logged and apply gain, then clip to 16 bit */ | |
| 193 | val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); | |
| 194 | val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; | |
| 195 | wave_data_l = (INT16)val; | |
| 196 | if (node->active_inputs == 2) | |
| 197 | { | |
| 198 | /* DISCRETE_WAVELOG1 */ | |
| 199 | wav_add_data_16(context->wav_file, &wave_data_l, 1); | |
| 200 | } | |
| 201 | else | |
| 202 | { | |
| 203 | /* DISCRETE_WAVELOG2 */ | |
| 204 | val = DISCRETE_INPUT(2) * DISCRETE_INPUT(3); | |
| 205 | val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; | |
| 206 | wave_data_r = (INT16)val; | |
| 207 | ||
| 208 | wav_add_data_16lr(context->wav_file, &wave_data_l, &wave_data_r, 1); | |
| 209 | } | |
| 210 | } |
| r5613 | r5614 | |
|---|---|---|
| 388 | 388 | double gc_f0; |
| 389 | 389 | int gc_i, gc_j, gc_k, gc_l; |
| 390 | 390 | |
| 391 | if (input_code_pressed_once(KEYCODE_DEL_PAD)) | |
| 391 | if (input_code_pressed_once(device->machine, KEYCODE_DEL_PAD)) | |
| 392 | 392 | { |
| 393 | 393 | gc_active ^= 1; |
| 394 | 394 | if (!gc_active) popmessage(NULL); |
| r5613 | r5614 | |
| 396 | 396 | |
| 397 | 397 | if (gc_active) |
| 398 | 398 | { |
| 399 | if (input_code_pressed_once(KEYCODE_0_PAD)) gc_chip ^= 1; | |
| 399 | if (input_code_pressed_once(device->machine, KEYCODE_0_PAD)) gc_chip ^= 1; | |
| 400 | 400 | |
| 401 | 401 | gc_i = gc_pos[gc_chip]; |
| 402 | 402 | gc_j = 0; |
| 403 | if (input_code_pressed_once(KEYCODE_4_PAD)) { gc_i--; gc_j = 1; } | |
| 404 | if (input_code_pressed_once(KEYCODE_6_PAD)) { gc_i++; gc_j = 1; } | |
| 403 | if (input_code_pressed_once(device->machine, KEYCODE_4_PAD)) { gc_i--; gc_j = 1; } | |
| 404 | if (input_code_pressed_once(device->machine, KEYCODE_6_PAD)) { gc_i++; gc_j = 1; } | |
| 405 | 405 | if (gc_j) { gc_i &= 7; gc_pos[gc_chip] = gc_i; } |
| 406 | 406 | |
| 407 | if (input_code_pressed_once(KEYCODE_5_PAD)) | |
| 407 | if (input_code_pressed_once(device->machine, KEYCODE_5_PAD)) | |
| 408 | 408 | info->k054539_gain[gc_i] = 1.0; |
| 409 | 409 | else |
| 410 | 410 | { |
| 411 | 411 | gc_fptr = &info->k054539_gain[gc_i]; |
| 412 | 412 | gc_f0 = *gc_fptr; |
| 413 | 413 | gc_j = 0; |
| 414 | if (input_code_pressed_once(KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; } | |
| 415 | if (input_code_pressed_once(KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; } | |
| 414 | if (input_code_pressed_once(device->machine, KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; } | |
| 415 | if (input_code_pressed_once(device->machine, KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; } | |
| 416 | 416 | if (gc_j) { if (gc_f0 < 0) gc_f0 = 0; *gc_fptr = gc_f0; } |
| 417 | 417 | } |
| 418 | 418 |
| r5613 | r5614 | |
|---|---|---|
| 40 | 40 | UINT8 is_stream; |
| 41 | 41 | UINT8 is_buffered; |
| 42 | 42 | UINT32 stream_in_number; |
| 43 | UINT32 stream_out_number; | |
| 43 | /* the buffer stream */ | |
| 44 | sound_stream *buffer_stream; | |
| 44 | 45 | }; |
| 45 | 46 | |
| 46 | 47 | INLINE discrete_info *get_safe_token(const device_config *device) |
| r5613 | r5614 | |
| 93 | 94 | switch (node->module->type) |
| 94 | 95 | { |
| 95 | 96 | case DSS_INPUT_DATA: |
| 97 | case DSS_INPUT_BUFFER: | |
| 96 | 98 | new_data = data; |
| 97 | 99 | break; |
| 98 | 100 | case DSS_INPUT_LOGIC: |
| r5613 | r5614 | |
| 106 | 108 | |
| 107 | 109 | if (context->data != new_data) |
| 108 | 110 | { |
| 109 | /* Bring the system up to now */ | |
| 110 | stream_update(info->discrete_stream); | |
| 111 | if (context->is_buffered) | |
| 112 | { | |
| 113 | /* Bring the system up to now */ | |
| 114 | stream_update(context->buffer_stream); | |
| 111 | 115 | |
| 112 | context->data = new_data; | |
| 116 | context->data = new_data; | |
| 117 | } | |
| 118 | else | |
| 119 | { | |
| 120 | /* Bring the system up to now */ | |
| 121 | stream_update(info->discrete_stream); | |
| 113 | 122 | |
| 114 | /* Update the node output here so we don't have to do it each step */ | |
| 115 | node->output[0] = new_data * context->gain + context->offset; | |
| 123 | context->data = new_data; | |
| 124 | ||
| 125 | /* Update the node output here so we don't have to do it each step */ | |
| 126 | node->output[0] = new_data * context->gain + context->offset; | |
| 127 | } | |
| 116 | 128 | } |
| 117 | 129 | } |
| 118 | 130 | else |
| r5613 | r5614 | |
| 171 | 183 | { |
| 172 | 184 | context->port = input_port_by_tag(node->info->device->machine->portconfig, (const char *)node->custom); |
| 173 | 185 | if (context->port == NULL) |
| 174 | fatalerror("DISCRETE_ADJUSTMENT_TAG - NODE_%d has invalid tag", | |
| 186 | fatalerror("DISCRETE_ADJUSTMENT_TAG - NODE_%d has invalid tag", | |
| 175 | 187 | } |
| 176 | 188 | else |
| 177 | 189 | context->port = input_port_by_index(node->info->device->machine->portconfig, DSS_ADJUSTMENT__PORT); |
| r5613 | r5614 | |
| 294 | 306 | { |
| 295 | 307 | struct dss_input_context *context = (struct dss_input_context *)node->context; |
| 296 | 308 | |
| 309 | context->ptr = NULL; | |
| 310 | //context->data = 0; | |
| 311 | } | |
| 312 | ||
| 313 | static DISCRETE_START(dss_input_stream) | |
| 314 | { | |
| 315 | struct dss_input_context *context = (struct dss_input_context *)node->context; | |
| 316 | ||
| 297 | 317 | assert(DSS_INPUT_STREAM__STREAM < linked_list_count(node->info->input_list)); |
| 298 | ||
| 318 | ||
| 299 | 319 | context->is_stream = TRUE; |
| 320 | /* Stream out number is set during start */ | |
| 300 | 321 | context->stream_in_number = DSS_INPUT_STREAM__STREAM; |
| 301 | 322 | context->gain = DSS_INPUT_STREAM__GAIN; |
| 302 | 323 | context->offset = DSS_INPUT_STREAM__OFFSET; |
| 303 | 324 | context->ptr = NULL; |
| 325 | //context->data = 0; | |
| 326 | ||
| 327 | if (node->block->type == DSS_INPUT_BUFFER) | |
| 328 | { | |
| 329 | context->is_buffered = TRUE; | |
| 330 | context->buffer_stream = stream_create(node->info->device, 0, 1, node->info->sample_rate, (void *) node, buffer_stream_update); | |
| 331 | ||
| 332 | stream_set_input(node->info->discrete_stream, context->stream_in_number, | |
| 333 | context->buffer_stream, 0, 1.0); | |
| 334 | } | |
| 335 | else | |
| 336 | { | |
| 337 | context->is_buffered = FALSE; | |
| 338 | context->buffer_stream = NULL; | |
| 339 | } | |
| 304 | 340 | } |
| r5613 | r5614 | |
|---|---|---|
| 411 | 411 | if (info->cFilter) |
| 412 | 412 | { |
| 413 | 413 | /* Setup filter constants */ |
| 414 | context->exponent = RC_CHARGE_EXP(context->r_total * info->cFilter); | |
| 414 | context->exponent = RC_CHARGE_EXP(node, context->r_total * info->cFilter); | |
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | 417 | |
| r5613 | r5614 | |
| 491 | 491 | if(DST_DIVIDE__DIV == 0) |
| 492 | 492 | { |
| 493 | 493 | node->output[0 ]= DBL_MAX; /* Max out but don't break */ |
| 494 | discrete_log(node->info, "dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n",NODE_INDEX( | |
| 494 | discrete_log(node->info, "dst_divider_step() - Divide by Zero attempted in NODE_%02d.\n",NODE_BLOCKINDEX( | |
| 495 | 495 | } |
| 496 | 496 | else |
| 497 | 497 | { |
| r5613 | r5614 | |
| 1138 | 1138 | /* Re-calculate exponent if resistor is a node and has changed value */ |
| 1139 | 1139 | if (*context->r_node[bit] != context->r_last[bit]) |
| 1140 | 1140 | { |
| 1141 | context->exponent_rc[bit] = RC_CHARGE_EXP(rTemp2 * info->c[bit]); | |
| 1141 | context->exponent_rc[bit] = RC_CHARGE_EXP(node, rTemp2 * info->c[bit]); | |
| 1142 | 1142 | context->r_last[bit] = *context->r_node[bit]; |
| 1143 | 1143 | } |
| 1144 | 1144 | } |
| r5613 | r5614 | |
| 1194 | 1194 | if (r_node_bit_flag != 0) |
| 1195 | 1195 | { |
| 1196 | 1196 | /* Re-calculate exponent if resistor nodes are used */ |
| 1197 | context->exponent_c_f = RC_CHARGE_EXP(r_total * info->cF); | |
| 1197 | context->exponent_c_f = RC_CHARGE_EXP(node, r_total * info->cF); | |
| 1198 | 1198 | } |
| 1199 | 1199 | context->v_cap_f += (v - v_ref - context->v_cap_f) * context->exponent_c_f; |
| 1200 | 1200 | v = context->v_cap_f; |
| r5613 | r5614 | |
| 1288 | 1288 | break; |
| 1289 | 1289 | } |
| 1290 | 1290 | /* Setup filter constants */ |
| 1291 | context->exponent_rc[bit] = RC_CHARGE_EXP(rTemp * info->c[bit]); | |
| 1291 | context->exponent_rc[bit] = RC_CHARGE_EXP(node, rTemp * info->c[bit]); | |
| 1292 | 1292 | } |
| 1293 | 1293 | } |
| 1294 | 1294 | |
| r5613 | r5614 | |
| 1303 | 1303 | if (info->cF != 0) |
| 1304 | 1304 | { |
| 1305 | 1305 | /* Setup filter constants */ |
| 1306 | context->exponent_c_f = RC_CHARGE_EXP(((info->type == DISC_MIXER_IS_OP_AMP) ? info->rF : (1.0 / context->r_total)) * info->cF); | |
| 1306 | context->exponent_c_f = RC_CHARGE_EXP(node, ((info->type == DISC_MIXER_IS_OP_AMP) ? info->rF : (1.0 / context->r_total)) * info->cF); | |
| 1307 | 1307 | } |
| 1308 | 1308 | |
| 1309 | 1309 | context->v_cap_amp = 0; |
| r5613 | r5614 | |
| 1313 | 1313 | /* Setup filter constants */ |
| 1314 | 1314 | /* We will use 100k ohms as an average final stage impedance. */ |
| 1315 | 1315 | /* Your amp/speaker system will have more effect on incorrect filtering then any value used here. */ |
| 1316 | context->exponent_c_amp = RC_CHARGE_EXP(RES_K(100) * info->cAmp); | |
| 1316 | context->exponent_c_amp = RC_CHARGE_EXP(node, RES_K(100) * info->cAmp); | |
| 1317 | 1317 | } |
| 1318 | 1318 | |
| 1319 | 1319 | if (context->type == DISC_MIXER_IS_OP_AMP_WITH_RI) context->gain = info->rF / info->rI; |
| r5613 | r5614 | |
| 1354 | 1354 | else |
| 1355 | 1355 | { |
| 1356 | 1356 | /* Bad address. We will leave the output alone. */ |
| 1357 | discrete_log(node->info, "NODE_%02d - Address = %d. Out of bounds\n", | |
| 1357 | discrete_log(node->info, "NODE_%02d - Address = %d. Out of bounds\n", | |
| 1358 | 1358 | } |
| 1359 | 1359 | } |
| 1360 | 1360 | else |
| r5613 | r5614 | |
| 1641 | 1641 | |
| 1642 | 1642 | /************************************************************************ |
| 1643 | 1643 | * |
| 1644 | * DST_TRANSFORM - Programmable math module | |
| 1644 | * DST_TRANSFORM - Programmable math module | |
| 1645 | 1645 | * |
| 1646 | * input[0] - Enable input value | |
| 1647 | * input[1] - Channel0 input value | |
| 1648 | * input[2] - Channel1 input value | |
| 1649 | * input[3] - Channel2 input value | |
| 1650 | * input[4] - Channel3 input value | |
| 1651 | * input[5] - Channel4 input value | |
| 1646 | * input[0] - Channel0 input value | |
| 1647 | * input[1] - Channel1 input value | |
| 1648 | * input[2] - Channel2 input value | |
| 1649 | * input[3] - Channel3 input value | |
| 1650 | * input[4] - Channel4 input value | |
| 1652 | 1651 | * |
| 1653 | 1652 | ************************************************************************/ |
| 1654 | 1653 | #define DST_TRANSFORM__IN0 DISCRETE_INPUT(0) |
| r5613 | r5614 | |
| 1681 | 1680 | int trans_stack_ptr = 0; |
| 1682 | 1681 | |
| 1683 | 1682 | const char *fPTR = (const char *)node->custom; |
| 1684 | node->output[0] = 0; | |
| 1685 | 1683 | |
| 1686 | 1684 | top = HUGE_VAL; |
| 1687 | 1685 | |
| r5613 | r5614 | |
| 1762 | 1760 | top = (int)number1 ^ (int)top; |
| 1763 | 1761 | break; |
| 1764 | 1762 | default: |
| 1765 | discrete_log(node->info, "dst_transform_step - Invalid function type/variable passed"); | |
| 1766 | node->output[0] = 0; | |
| 1763 | discrete_log(node->info, "dst_transform_step - Invalid function type/variable passed: %s",(const char *)node->custom); | |
| 1764 | /* that is enough to fatalerror */ | |
| 1765 | fatalerror("dst_transform_step - Invalid function type/variable passed: %s", (const char *)node->custom); | |
| 1767 | 1766 | break; |
| 1768 | 1767 | } |
| 1769 | 1768 | } |
| r5613 | r5614 | |
| 1865 | 1864 | if (context->has_r4) |
| 1866 | 1865 | { |
| 1867 | 1866 | /* exponential charge */ |
| 1868 | context->exponent = RC_CHARGE_EXP(info->r4 * info->c); | |
| 1867 | context->exponent = RC_CHARGE_EXP(node, info->r4 * info->c); | |
| 1869 | 1868 | } |
| 1870 | 1869 | else |
| 1871 | 1870 | /* linear charge */ |
| r5613 | r5614 | |
| 1936 | 1935 | const discrete_op_amp_1sht_info *info = (const discrete_op_amp_1sht_info *)node->custom; |
| 1937 | 1936 | struct dst_op_amp_1sht_context *context = (struct dst_op_amp_1sht_context *)node->context; |
| 1938 | 1937 | |
| 1939 | context->exponent1c = RC_CHARGE_EXP(RES_2_PARALLEL(info->r3, info->r4) * info->c1); | |
| 1940 | context->exponent1d = RC_CHARGE_EXP(info->r4 * info->c1); | |
| 1941 | context->exponent2 = RC_CHARGE_EXP(info->r2 * info->c2); | |
| 1938 | context->exponent1c = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r3, info->r4) * info->c1); | |
| 1939 | context->exponent1d = RC_CHARGE_EXP(node, info->r4 * info->c1); | |
| 1940 | context->exponent2 = RC_CHARGE_EXP(node, info->r2 * info->c2); | |
| 1942 | 1941 | context->i_fixed = (info->vP - OP_AMP_NORTON_VBE) / info->r1; |
| 1943 | 1942 | context->v_cap1 = context->v_cap2 = 0; |
| 1944 | 1943 | context->v_max = info->vP - OP_AMP_NORTON_VBE; |
| r5613 | r5614 | |
| 2063 | 2062 | context->v_cap1 = 0; |
| 2064 | 2063 | /* Charge rate thru r5 */ |
| 2065 | 2064 | /* There can be a different charge rates depending on function F3. */ |
| 2066 | context->exponent_c[0] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r5, info->r6) * info->c1); | |
| 2067 | context->exponent_c[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r5, context->r67) * info->c1); | |
| 2065 | context->exponent_c[0] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r5, info->r6) * info->c1); | |
| 2066 | context->exponent_c[1] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r5, context->r67) * info->c1); | |
| 2068 | 2067 | /* Discharge rate thru r6 + r7 */ |
| 2069 | context->exponent_d[1] = RC_CHARGE_EXP(context->r67 * info->c1); | |
| 2068 | context->exponent_d[1] = RC_CHARGE_EXP(node, context->r67 * info->c1); | |
| 2070 | 2069 | /* Discharge rate thru r6 */ |
| 2071 | 2070 | if (info->r6 != 0) |
| 2072 | 2071 | { |
| 2073 | context->exponent_d[0] = RC_CHARGE_EXP(info->r6 * info->c1); | |
| 2072 | context->exponent_d[0] = RC_CHARGE_EXP(node, info->r6 * info->c1); | |
| 2074 | 2073 | } |
| 2075 | 2074 | context->v_cap2 = 0; |
| 2076 | 2075 | context->v_trig2 = (info->v2 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r8, info->r9); |
| 2077 | context->exponent2[0] = RC_CHARGE_EXP(info->r9 * info->c2); | |
| 2078 | context->exponent2[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r8, info->r9) * info->c2); | |
| 2076 | context->exponent2[0] = RC_CHARGE_EXP(node, info->r9 * info->c2); | |
| 2077 | context->exponent2[1] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r8, info->r9) * info->c2); | |
| 2079 | 2078 | context->v_cap3 = 0; |
| 2080 | 2079 | context->v_trig3 = (info->v3 - 0.6 - OP_AMP_NORTON_VBE) * RES_VOLTAGE_DIVIDER(info->r10, info->r11); |
| 2081 | context->exponent3[0] = RC_CHARGE_EXP(info->r11 * info->c3); | |
| 2082 | context->exponent3[1] = RC_CHARGE_EXP(RES_2_PARALLEL(info->r10, info->r11) * info->c3); | |
| 2080 | context->exponent3[0] = RC_CHARGE_EXP(node, info->r11 * info->c3); | |
| 2081 | context->exponent3[1] = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r10, info->r11) * info->c3); | |
| 2083 | 2082 | |
| 2084 | 2083 | DISCRETE_STEP_CALL(dst_tvca_op_amp); |
| 2085 | 2084 | } |
| r5613 | r5614 | |
|---|---|---|
| 876 | 876 | |
| 877 | 877 | if (r > 15) return 0; |
| 878 | 878 | |
| 879 | /* FIXME: calling stream_update here makes gyruss sound awfull. | |
| 880 | * For the time being, no idea why this is the case */ | |
| 881 | /* update the output buffer before returning the register */ | |
| 879 | /* There are no state dependent register in the AY8910! */ | |
| 882 | 880 | /* stream_update(psg->channel); */ |
| 883 | 881 | |
| 884 | 882 | switch (r) |
| r5613 | r5614 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | /************************************* |
| 62 | 62 | * |
| 63 | * Structures | |
| 64 | * | |
| 65 | *************************************/ | |
| 66 | ||
| 67 | typedef struct _task_info task_info; | |
| 68 | struct _task_info | |
| 69 | { | |
| 70 | discrete_task_context *context; | |
| 71 | int samples; | |
| 72 | }; | |
| 73 | ||
| 74 | ||
| 75 | /************************************* | |
| 76 | * | |
| 63 | 77 | * Prototypes |
| 64 | 78 | * |
| 65 | 79 | *************************************/ |
| 66 | 80 | |
| 67 | 81 | static void init_nodes(discrete_info *info, linked_list_entry *block_list, const device_config *device); |
| 68 | 82 | static void find_input_nodes(discrete_info *info); |
| 69 | static void setup_disc_logs(discrete_info *info); | |
| 70 | 83 | static node_description *discrete_find_node(const discrete_info *info, int node); |
| 71 | 84 | static DEVICE_RESET( discrete ); |
| 72 | 85 | static STREAM_UPDATE( discrete_stream_update ); |
| 86 | static STREAM_UPDATE( buffer_stream_update ); | |
| 73 | 87 | |
| 74 | 88 | |
| 75 | 89 | /************************************* |
| r5613 | r5614 | |
| 95 | 109 | } |
| 96 | 110 | } |
| 97 | 111 | |
| 98 | typedef struct _task_info task_info; | |
| 112 | /************************************* | |
| 113 | * | |
| 114 | * INLINEs | |
| 115 | * | |
| 116 | *************************************/ | |
| 99 | 117 | |
| 100 | ||
| 118 | INLINE int node_module_index(const node_description *node) | |
| 101 | 119 | { |
| 102 | discrete_task_context *context; | |
| 103 | int samples; | |
| 104 | }; | |
| 105 | ||
| 106 | INLINE void step_nodes_in_list(linked_list_entry **list) | |
| 107 | { | |
| 108 | 120 | linked_list_entry *entry; |
| 109 | for (entry = *list; entry != NULL; entry = entry->next) | |
| 121 | int index = 0; | |
| 122 | ||
| 123 | for (entry = node->info->node_list; entry != NULL; entry = entry->next) | |
| 110 | 124 | { |
| 111 | node_description *n | |
| 125 | node_description *n | |
| 112 | 126 | |
| 113 | /* Now step the node */ | |
| 114 | if (DISCRETE_PROFILING) | |
| 115 | node->run_time -= osd_profiling_ticks(); | |
| 116 | ||
| 117 | (*node->module->step)(node); | |
| 118 | //bigselect(info->device, node); | |
| 119 | ||
| 120 | if (DISCRETE_PROFILING) | |
| 121 | node->run_time += osd_profiling_ticks(); | |
| 127 | if (n == node) | |
| 128 | return index; | |
| 129 | if (n->module->type == node->module->type) | |
| 130 | index++; | |
| 122 | 131 | } |
| 132 | return -1; | |
| 123 | 133 | } |
| 124 | 134 | |
| 125 | static | |
| 135 | INLINE void linked_list_add(const discrete_info *info, linked_list_entry ***list_tail_ptr, const void *p | |
| 126 | 136 | { |
| 127 | task_info *ti = (task_info *) param; | |
| 128 | int samples, i; | |
| 129 | ||
| 130 | /* set up task buffers */ | |
| 131 | for (i = 0; i < ti->context->numbuffered; i++) | |
| 132 | ti->context->ptr[i] = &ti->context->node_buf[i][0]; | |
| 133 | ||
| 134 | samples = ti->samples; | |
| 135 | while (samples-- > 0) | |
| 136 | { | |
| 137 | step_nodes_in_list(&ti->context->list); | |
| 138 | } | |
| 139 | /* reset ptr */ | |
| 140 | for (i = 0; i < ti->context->numbuffered; i++) | |
| 141 | ti->context->ptr[i] = &ti->context->node_buf[i][0]; | |
| 142 | ||
| 143 | free(param); | |
| 144 | return NULL; | |
| 145 | } | |
| 146 | ||
| 147 | static DISCRETE_STEP( dso_task ) | |
| 148 | { | |
| 149 | discrete_task_context *ctx = (discrete_task_context *) node->context; | |
| 150 | int i; | |
| 151 | ||
| 152 | for (i = 0; i < ctx->numbuffered; i++) | |
| 153 | *(ctx->ptr[i]++) = (double) DISCRETE_INPUT(i); | |
| 154 | } | |
| 155 | ||
| 156 | static DISCRETE_RESET( dso_task ) | |
| 157 | { | |
| 158 | /* nothing to do - just avoid being stepped */ | |
| 159 | } | |
| 160 | ||
| 161 | static DISCRETE_STEP( dso_output ) | |
| 162 | { | |
| 163 | stream_sample_t **output = (stream_sample_t **) &node->context; | |
| 164 | double val; | |
| 165 | ||
| 166 | /* Add gain to the output and put into the buffers */ | |
| 167 | /* Clipping will be handled by the main sound system */ | |
| 168 | val = DISCRETE_INPUT(0) * DISCRETE_INPUT(1); | |
| 169 | **output = val; | |
| 170 | (*output)++; | |
| 171 | } | |
| 172 | ||
| 173 | static DISCRETE_RESET( dso_output ) | |
| 174 | { | |
| 175 | /* nothing to do - just avoid being stepped */ | |
| 176 | } | |
| 177 | ||
| 178 | ||
| 179 | /************************************* | |
| 180 | * | |
| 181 | * Add an entry to a list | |
| 182 | * | |
| 183 | *************************************/ | |
| 184 | ||
| 185 | static void linked_list_add(discrete_info *info, linked_list_entry ***list_tail_ptr, void *ptr) | |
| 186 | { | |
| 187 | 137 | **list_tail_ptr = auto_alloc(info->device->machine, linked_list_entry); |
| 188 | 138 | (**list_tail_ptr)->ptr = ptr; |
| 189 | 139 | (**list_tail_ptr)->next = NULL; |
| 190 | 140 | *list_tail_ptr = &((**list_tail_ptr)->next); |
| 191 | 141 | } |
| 192 | 142 | |
| 193 | /************************************* | |
| 194 | * | |
| 195 | * Count entries in a list | |
| 196 | * | |
| 197 | *************************************/ | |
| 198 | ||
| 199 | static int linked_list_count(linked_list_entry *list) | |
| 143 | INLINE int linked_list_count(const linked_list_entry *list) | |
| 200 | 144 | { |
| 201 | 145 | int cnt = 0; |
| 202 | linked_list_entry *entry; | |
| 146 | const linked_list_entry *entry; | |
| 203 | 147 | |
| 204 | 148 | for (entry = list; entry != NULL; entry = entry->next) |
| 205 | 149 | cnt++; |
| 206 | 150 | |
| 207 | 151 | return cnt; |
| 208 | 152 | } |
| 209 | ||
| 210 | ||
| 211 | 153 | /************************************* |
| 212 | 154 | * |
| 213 | 155 | * Included simulation objects |
| 214 | 156 | * |
| 215 | 157 | *************************************/ |
| 216 | 158 | |
| 159 | #include "disc_sys.c" /* discrete core modules and support functions */ | |
| 217 | 160 | #include "disc_wav.c" /* Wave sources - SINE/SQUARE/NOISE/etc */ |
| 218 | 161 | #include "disc_mth.c" /* Math Devices - ADD/GAIN/etc */ |
| 219 | 162 | #include "disc_inp.c" /* Input Devices - INPUT/CONST/etc */ |
| r5613 | r5614 | |
| 230 | 173 | |
| 231 | 174 | static const discrete_module module_list[] = |
| 232 | 175 | { |
| 233 | { DSO_OUTPUT ,"DSO_OUTPUT" , 0 ,0 ,dso_output_reset ,dso_output_step }, | |
| 234 | { DSO_CSVLOG ,"DSO_CSVLOG" , 0 ,0 ,NULL ,NULL }, | |
| 235 | { DSO_WAVELOG ,"DSO_WAVELOG" , 0 ,0 ,NULL ,NULL }, | |
| 236 | { DSO_IMPORT ,"DSO_IMPORT" , 0 ,0 ,NULL ,NULL }, | |
| 176 | { DSO_OUTPUT ,"DSO_OUTPUT" , 0 ,0 ,dso_output_reset ,dso_output_step ,NULL ,NULL }, | |
| 177 | { DSO_CSVLOG ,"DSO_CSVLOG" , 0 ,sizeof(struct dso_csvlog_context) ,NULL ,dso_csvlog_step ,dso_csvlog_start ,dso_csvlog_stop }, | |
| 178 | { DSO_WAVELOG ,"DSO_WAVELOG" , 0 ,sizeof(struct dso_wavelog_context) ,NULL ,dso_wavelog_step ,dso_wavelog_start ,dso_wavelog_stop }, | |
| 179 | { DSO_IMPORT ,"DSO_IMPORT" , 0 ,0 ,NULL ,NULL ,NULL ,NULL }, | |
| 237 | 180 | |
| 238 | 181 | /* parallel modules */ |
| 239 | { DSO_TASK_START ,"DSO_TASK_START" , 0 ,0 ,NULL ,NULL }, | |
| 240 | { DSO_TASK_END ,"DSO_TASK_END" , 0 ,0 ,dso_task_reset ,dso_task_step }, | |
| 241 | { DSO_TASK_SYNC ,"DSO_TASK_SYNC" , 0 ,0 ,NULL ,NULL }, | |
| 182 | { DSO_TASK_START ,"DSO_TASK_START" , 0 ,0 ,NULL ,NULL ,NULL ,NULL }, | |
| 183 | { DSO_TASK_END ,"DSO_TASK_END" , 0 ,0 ,dso_task_reset ,dso_task_step ,dso_task_start ,NULL }, | |
| 184 | { DSO_TASK_SYNC ,"DSO_TASK_SYNC" , 0 ,0 ,NULL ,NULL ,NULL ,NULL }, | |
| 242 | 185 | |
| 243 | 186 | /* nop */ |
| 244 | { DSS_NOP ,"DSS_NOP" , 0 ,0 ,NULL ,NULL }, | |
| 187 | { DSS_NOP ,"DSS_NOP" , 0 ,0 ,NULL ,NULL ,NULL ,NULL }, | |
| 245 | 188 | |
| 246 | 189 | /* from disc_inp.c */ |
| 247 | { DSS_ADJUSTMENT ,"DSS_ADJUSTMENT" , 1 ,sizeof(struct dss_adjustment_context) ,dss_adjustment_reset ,dss_adjustment_step }, | |
| 248 | { DSS_CONSTANT ,"DSS_CONSTANT" , 1 ,0 ,dss_constant_reset ,NULL }, | |
| 249 | { DSS_INPUT_DATA ,"DSS_INPUT_DATA" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,NULL }, | |
| 250 | { DSS_INPUT_LOGIC ,"DSS_INPUT_LOGIC" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,NULL }, | |
| 251 | { DSS_INPUT_NOT ,"DSS_INPUT_NOT" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,NULL }, | |
| 252 | { DSS_INPUT_PULSE ,"DSS_INPUT_PULSE" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,dss_input_pulse_step }, | |
| 253 | { DSS_INPUT_STREAM,"DSS_INPUT_STREAM", 1 ,sizeof(struct dss_input_context) ,dss_input_stream_reset,dss_input_stream_step}, | |
| 190 | { DSS_ADJUSTMENT ,"DSS_ADJUSTMENT" , 1 ,sizeof(struct dss_adjustment_context) ,dss_adjustment_reset ,dss_adjustment_step ,NULL ,NULL }, | |
| 191 | { DSS_CONSTANT ,"DSS_CONSTANT" , 1 ,0 ,dss_constant_reset ,NULL ,NULL ,NULL }, | |
| 192 | { DSS_INPUT_DATA ,"DSS_INPUT_DATA" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,NULL ,NULL ,NULL }, | |
| 193 | { DSS_INPUT_LOGIC ,"DSS_INPUT_LOGIC" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,NULL ,NULL ,NULL }, | |
| 194 | { DSS_INPUT_NOT ,"DSS_INPUT_NOT" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,NULL ,NULL ,NULL }, | |
| 195 | { DSS_INPUT_PULSE ,"DSS_INPUT_PULSE" , 1 ,sizeof(struct dss_input_context) ,dss_input_reset ,dss_input_pulse_step ,NULL ,NULL }, | |
| 196 | { DSS_INPUT_STREAM,"DSS_INPUT_STREAM", 1 ,sizeof(struct dss_input_context) ,dss_input_stream_reset,dss_input_stream_step,dss_input_stream_start,NULL }, | |
| 197 | { DSS_INPUT_BUFFER,"DSS_INPUT_BUFFER", 1 ,sizeof(struct dss_input_context) ,dss_input_stream_reset,dss_input_stream_step,dss_input_stream_start,NULL }, | |
| 254 | 198 | |
| 255 | 199 | /* from disc_wav.c */ |
| 256 | 200 | /* Generic modules */ |
| 257 | { DSS_COUNTER ,"DSS_COUNTER" , 1 ,sizeof(struct dss_counter_context) ,dss_counter_reset ,dss_counter_step }, | |
| 258 | { DSS_LFSR_NOISE ,"DSS_LFSR_NOISE" , 2 ,sizeof(struct dss_lfsr_context) ,dss_lfsr_reset ,dss_lfsr_step }, | |
| 259 | { DSS_NOISE ,"DSS_NOISE" , 1 ,sizeof(struct dss_noise_context) ,dss_noise_reset ,dss_noise_step }, | |
| 260 | { DSS_NOTE ,"DSS_NOTE" , 1 ,sizeof(struct dss_note_context) ,dss_note_reset ,dss_note_step }, | |
| 261 | { DSS_SAWTOOTHWAVE,"DSS_SAWTOOTHWAVE", 1 ,sizeof(struct dss_sawtoothwave_context),dss_sawtoothwave_reset,dss_sawtoothwave_step}, | |
| 262 | { DSS_SINEWAVE ,"DSS_SINEWAVE" , 1 ,sizeof(struct dss_sinewave_context) ,dss_sinewave_reset ,dss_sinewave_step }, | |
| 263 | { DSS_SQUAREWAVE ,"DSS_SQUAREWAVE" , 1 ,sizeof(struct dss_squarewave_context) ,dss_squarewave_reset ,dss_squarewave_step }, | |
| 264 | { DSS_SQUAREWFIX ,"DSS_SQUAREWFIX" , 1 ,sizeof(struct dss_squarewfix_context) ,dss_squarewfix_reset ,dss_squarewfix_step }, | |
| 265 | { DSS_SQUAREWAVE2 ,"DSS_SQUAREWAVE2" , 1 ,sizeof(struct dss_squarewave_context) ,dss_squarewave2_reset ,dss_squarewave2_step }, | |
| 266 | { DSS_TRIANGLEWAVE,"DSS_TRIANGLEWAVE", 1 ,sizeof(struct dss_trianglewave_context),dss_trianglewave_reset,dss_trianglewave_step}, | |
| 201 | { DSS_COUNTER ,"DSS_COUNTER" , 1 ,sizeof(struct dss_counter_context) ,dss_counter_reset ,dss_counter_step ,NULL ,NULL }, | |
| 202 | { DSS_LFSR_NOISE ,"DSS_LFSR_NOISE" , 2 ,sizeof(struct dss_lfsr_context) ,dss_lfsr_reset ,dss_lfsr_step ,NULL ,NULL }, | |
| 203 | { DSS_NOISE ,"DSS_NOISE" , 1 ,sizeof(struct dss_noise_context) ,dss_noise_reset ,dss_noise_step ,NULL ,NULL }, | |
| 204 | { DSS_NOTE ,"DSS_NOTE" , 1 ,sizeof(struct dss_note_context) ,dss_note_reset ,dss_note_step ,NULL ,NULL }, | |
| 205 | { DSS_SAWTOOTHWAVE,"DSS_SAWTOOTHWAVE", 1 ,sizeof(struct dss_sawtoothwave_context),dss_sawtoothwave_reset,dss_sawtoothwave_step,NULL ,NULL }, | |
| 206 | { DSS_SINEWAVE ,"DSS_SINEWAVE" , 1 ,sizeof(struct dss_sinewave_context) ,dss_sinewave_reset ,dss_sinewave_step ,NULL ,NULL }, | |
| 207 | { DSS_SQUAREWAVE ,"DSS_SQUAREWAVE" , 1 ,sizeof(struct dss_squarewave_context) ,dss_squarewave_reset ,dss_squarewave_step ,NULL ,NULL }, | |
| 208 | { DSS_SQUAREWFIX ,"DSS_SQUAREWFIX" , 1 ,sizeof(struct dss_squarewfix_context) ,dss_squarewfix_reset ,dss_squarewfix_step ,NULL ,NULL }, | |
| 209 | { DSS_SQUAREWAVE2 ,"DSS_SQUAREWAVE2" , 1 ,sizeof(struct dss_squarewave_context) ,dss_squarewave2_reset ,dss_squarewave2_step ,NULL ,NULL }, | |
| 210 | { DSS_TRIANGLEWAVE,"DSS_TRIANGLEWAVE", 1 ,sizeof(struct dss_trianglewave_context),dss_trianglewave_reset,dss_trianglewave_step,NULL ,NULL }, | |
| 267 | 211 | /* Component specific modules */ |
| 268 | { DSS_INVERTER_OSC ,"DSS_INVERTER_OSC" , 1 ,sizeof(struct dss_inverter_osc_context) ,dss_inverter_osc_reset ,dss_inverter_osc_step }, | |
| 269 | { DSS_OP_AMP_OSC ,"DSS_OP_AMP_OSC" , 1 ,sizeof(struct dss_op_amp_osc_context) ,dss_op_amp_osc_reset ,dss_op_amp_osc_step }, | |
| 270 | { DSS_SCHMITT_OSC ,"DSS_SCHMITT_OSC" , 1 ,sizeof(struct dss_schmitt_osc_context) ,dss_schmitt_osc_reset ,dss_schmitt_osc_step }, | |
| 212 | { DSS_INVERTER_OSC ,"DSS_INVERTER_OSC" , 1 ,sizeof(struct dss_inverter_osc_context) ,dss_inverter_osc_reset ,dss_inverter_osc_step ,NULL ,NULL }, | |
| 213 | { DSS_OP_AMP_OSC ,"DSS_OP_AMP_OSC" , 1 ,sizeof(struct dss_op_amp_osc_context) ,dss_op_amp_osc_reset ,dss_op_amp_osc_step ,NULL ,NULL }, | |
| 214 | { DSS_SCHMITT_OSC ,"DSS_SCHMITT_OSC" , 1 ,sizeof(struct dss_schmitt_osc_context) ,dss_schmitt_osc_reset ,dss_schmitt_osc_step ,NULL ,NULL }, | |
| 271 | 215 | /* Not yet implemented */ |
| 272 | { DSS_ADSR ,"DSS_ADSR" , 1 ,sizeof(struct dss_adsr_context) ,dss_adsrenv_reset ,dss_adsrenv_step }, | |
| 216 | { DSS_ADSR ,"DSS_ADSR" , 1 ,sizeof(struct dss_adsr_context) ,dss_adsrenv_reset ,dss_adsrenv_step ,NULL ,NULL }, | |
| 273 | 217 | |
| 274 | 218 | /* from disc_mth.c */ |
| 275 | 219 | /* Generic modules */ |
| 276 | { DST_ADDER ,"DST_ADDER" , 1 ,0 ,NULL ,dst_adder_step }, | |
| 277 | { DST_CLAMP ,"DST_CLAMP" , 1 ,0 ,NULL ,dst_clamp_step }, | |
| 278 | { DST_DIVIDE ,"DST_DIVIDE" , 1 ,0 ,NULL ,dst_divide_step }, | |
| 279 | { DST_GAIN ,"DST_GAIN" , 1 ,0 ,NULL ,dst_gain_step }, | |
| 280 | { DST_LOGIC_INV ,"DST_LOGIC_INV" , 1 ,0 ,NULL ,dst_logic_inv_step }, | |
| 281 | { DST_GAIN ,"DST_GAIN" , 1 ,0 ,NULL ,dst_gain_step }, | |
| 282 | { DST_BITS_DECODE ,"DST_BITS_DECODE" , 8 ,sizeof(struct dst_bits_decode_context) ,dst_bits_decode_reset ,dst_bits_decode_step }, | |
| 283 | { DST_LOGIC_AND ,"DST_LOGIC_AND" , 1 ,0 ,NULL ,dst_logic_and_step }, | |
| 284 | { DST_LOGIC_NAND ,"DST_LOGIC_NAND" , 1 ,0 ,NULL ,dst_logic_nand_step }, | |
| 285 | { DST_LOGIC_OR ,"DST_LOGIC_OR" , 1 ,0 ,NULL ,dst_logic_or_step }, | |
| 286 | { DST_LOGIC_NOR ,"DST_LOGIC_NOR" , 1 ,0 ,NULL ,dst_logic_nor_step }, | |
| 287 | { DST_LOGIC_XOR ,"DST_LOGIC_XOR" , 1 ,0 ,NULL ,dst_logic_xor_step }, | |
| 288 | { DST_LOGIC_NXOR ,"DST_LOGIC_NXOR" , 1 ,0 ,NULL ,dst_logic_nxor_step }, | |
| 289 | { DST_LOGIC_DFF ,"DST_LOGIC_DFF" , 1 ,sizeof(struct dst_flipflop_context) ,dst_logic_ff_reset ,dst_logic_dff_step }, | |
| 290 | { DST_LOGIC_JKFF ,"DST_LOGIC_JKFF" , 1 ,sizeof(struct dst_flipflop_context) ,dst_logic_ff_reset ,dst_logic_jkff_step }, | |
| 291 | { DST_LOOKUP_TABLE,"DST_LOOKUP_TABLE", 1 ,0 ,NULL ,dst_lookup_table_step}, | |
| 292 | { DST_MULTIPLEX ,"DST_MULTIPLEX" , 1 ,sizeof(struct dst_size_context) ,dst_multiplex_reset ,dst_multiplex_step }, | |
| 293 | { DST_ONESHOT ,"DST_ONESHOT" , 1 ,sizeof(struct dst_oneshot_context) ,dst_oneshot_reset ,dst_oneshot_step }, | |
| 294 | { DST_RAMP ,"DST_RAMP" , 1 ,sizeof(struct dss_ramp_context) ,dst_ramp_reset ,dst_ramp_step }, | |
| 295 | { DST_SAMPHOLD ,"DST_SAMPHOLD" , 1 ,sizeof(struct dst_samphold_context) ,dst_samphold_reset ,dst_samphold_step }, | |
| 296 | { DST_SWITCH ,"DST_SWITCH" , 1 ,0 ,NULL ,dst_switch_step }, | |
| 297 | { DST_ASWITCH ,"DST_ASWITCH" , 1 ,0 ,NULL ,dst_aswitch_step }, | |
| 298 | { DST_TRANSFORM ,"DST_TRANSFORM" , 1 ,0 ,NULL ,dst_transform_step }, | |
| 220 | { DST_ADDER ,"DST_ADDER" , 1 ,0 ,NULL ,dst_adder_step ,NULL ,NULL }, | |
| 221 | { DST_CLAMP ,"DST_CLAMP" , 1 ,0 ,NULL ,dst_clamp_step ,NULL ,NULL }, | |
| 222 | { DST_DIVIDE ,"DST_DIVIDE" , 1 ,0 ,NULL ,dst_divide_step ,NULL ,NULL }, | |
| 223 | { DST_GAIN ,"DST_GAIN" , 1 ,0 ,NULL ,dst_gain_step ,NULL ,NULL }, | |
| 224 | { DST_LOGIC_INV ,"DST_LOGIC_INV" , 1 ,0 ,NULL ,dst_logic_inv_step ,NULL ,NULL }, | |
| 225 | { DST_GAIN ,"DST_GAIN" , 1 ,0 ,NULL ,dst_gain_step ,NULL ,NULL }, | |
| 226 | { DST_BITS_DECODE ,"DST_BITS_DECODE" , 8 ,sizeof(struct dst_bits_decode_context) ,dst_bits_decode_reset ,dst_bits_decode_step ,NULL ,NULL }, | |
| 227 | { DST_LOGIC_AND ,"DST_LOGIC_AND" , 1 ,0 ,NULL ,dst_logic_and_step ,NULL ,NULL }, | |
| 228 | { DST_LOGIC_NAND ,"DST_LOGIC_NAND" , 1 ,0 ,NULL ,dst_logic_nand_step ,NULL ,NULL }, | |
| 229 | { DST_LOGIC_OR ,"DST_LOGIC_OR" , 1 ,0 ,NULL ,dst_logic_or_step ,NULL ,NULL }, | |
| 230 | { DST_LOGIC_NOR ,"DST_LOGIC_NOR" , 1 ,0 ,NULL ,dst_logic_nor_step ,NULL ,NULL }, | |
| 231 | { DST_LOGIC_XOR ,"DST_LOGIC_XOR" , 1 ,0 ,NULL ,dst_logic_xor_step ,NULL ,NULL }, | |
| 232 | { DST_LOGIC_NXOR ,"DST_LOGIC_NXOR" , 1 ,0 ,NULL ,dst_logic_nxor_step ,NULL ,NULL }, | |
| 233 | { DST_LOGIC_DFF ,"DST_LOGIC_DFF" , 1 ,sizeof(struct dst_flipflop_context) ,dst_logic_ff_reset ,dst_logic_dff_step ,NULL ,NULL }, | |
| 234 | { DST_LOGIC_JKFF ,"DST_LOGIC_JKFF" , 1 ,sizeof(struct dst_flipflop_context) ,dst_logic_ff_reset ,dst_logic_jkff_step ,NULL ,NULL }, | |
| 235 | { DST_LOOKUP_TABLE,"DST_LOOKUP_TABLE", 1 ,0 ,NULL ,dst_lookup_table_step,NULL ,NULL }, | |
| 236 | { DST_MULTIPLEX ,"DST_MULTIPLEX" , 1 ,sizeof(struct dst_size_context) ,dst_multiplex_reset ,dst_multiplex_step ,NULL ,NULL }, | |
| 237 | { DST_ONESHOT ,"DST_ONESHOT" , 1 ,sizeof(struct dst_oneshot_context) ,dst_oneshot_reset ,dst_oneshot_step ,NULL ,NULL }, | |
| 238 | { DST_RAMP ,"DST_RAMP" , 1 ,sizeof(struct dss_ramp_context) ,dst_ramp_reset ,dst_ramp_step ,NULL ,NULL }, | |
| 239 | { DST_SAMPHOLD ,"DST_SAMPHOLD" , 1 ,sizeof(struct dst_samphold_context) ,dst_samphold_reset ,dst_samphold_step ,NULL ,NULL }, | |
| 240 | { DST_SWITCH ,"DST_SWITCH" , 1 ,0 ,NULL ,dst_switch_step ,NULL ,NULL }, | |
| 241 | { DST_ASWITCH ,"DST_ASWITCH" , 1 ,0 ,NULL ,dst_aswitch_step ,NULL ,NULL }, | |
| 242 | { DST_TRANSFORM ,"DST_TRANSFORM" , 1 ,0 ,NULL ,dst_transform_step ,NULL ,NULL }, | |
| 299 | 243 | /* Component specific */ |
| 300 | { DST_COMP_ADDER ,"DST_COMP_ADDER" , 1 ,sizeof(struct dst_comp_adder_context) ,dst_comp_adder_reset ,dst_comp_adder_step }, | |
| 301 | { DST_DAC_R1 ,"DST_DAC_R1" , 1 ,sizeof(struct dst_dac_r1_context) ,dst_dac_r1_reset ,dst_dac_r1_step }, | |
| 302 | { DST_DIODE_MIX ,"DST_DIODE_MIX" , 1 ,sizeof(struct dst_diode_mix__context) ,dst_diode_mix_reset ,dst_diode_mix_step }, | |
| 303 | { DST_INTEGRATE ,"DST_INTEGRATE" , 1 ,sizeof(struct dst_integrate_context) ,dst_integrate_reset ,dst_integrate_step }, | |
| 304 | { DST_MIXER ,"DST_MIXER" , 1 ,sizeof(struct dst_mixer_context) ,dst_mixer_reset ,dst_mixer_step }, | |
| 305 | { DST_OP_AMP ,"DST_OP_AMP" , 1 ,sizeof(struct dst_op_amp_context) ,dst_op_amp_reset ,dst_op_amp_step }, | |
| 306 | { DST_OP_AMP_1SHT ,"DST_OP_AMP_1SHT" , 1 ,sizeof(struct dst_op_amp_1sht_context) ,dst_op_amp_1sht_reset ,dst_op_amp_1sht_step }, | |
| 307 | { DST_TVCA_OP_AMP ,"DST_TVCA_OP_AMP" , 1 ,sizeof(struct dst_tvca_op_amp_context) ,dst_tvca_op_amp_reset ,dst_tvca_op_amp_step }, | |
| 308 | { DST_VCA ,"DST_VCA" , 1 ,0 ,NULL ,NULL }, | |
| 244 | { DST_COMP_ADDER ,"DST_COMP_ADDER" , 1 ,sizeof(struct dst_comp_adder_context) ,dst_comp_adder_reset ,dst_comp_adder_step ,NULL ,NULL }, | |
| 245 | { DST_DAC_R1 ,"DST_DAC_R1" , 1 ,sizeof(struct dst_dac_r1_context) ,dst_dac_r1_reset ,dst_dac_r1_step ,NULL ,NULL }, | |
| 246 | { DST_DIODE_MIX ,"DST_DIODE_MIX" , 1 ,sizeof(struct dst_diode_mix__context) ,dst_diode_mix_reset ,dst_diode_mix_step ,NULL ,NULL }, | |
| 247 | { DST_INTEGRATE ,"DST_INTEGRATE" , 1 ,sizeof(struct dst_integrate_context) ,dst_integrate_reset ,dst_integrate_step ,NULL ,NULL }, | |
| 248 | { DST_MIXER ,"DST_MIXER" , 1 ,sizeof(struct dst_mixer_context) ,dst_mixer_reset ,dst_mixer_step ,NULL ,NULL }, | |
| 249 | { DST_OP_AMP ,"DST_OP_AMP" , 1 ,sizeof(struct dst_op_amp_context) ,dst_op_amp_reset ,dst_op_amp_step ,NULL ,NULL }, | |
| 250 | { DST_OP_AMP_1SHT ,"DST_OP_AMP_1SHT" , 1 ,sizeof(struct dst_op_amp_1sht_context) ,dst_op_amp_1sht_reset ,dst_op_amp_1sht_step ,NULL ,NULL }, | |
| 251 | { DST_TVCA_OP_AMP ,"DST_TVCA_OP_AMP" , 1 ,sizeof(struct dst_tvca_op_amp_context) ,dst_tvca_op_amp_reset ,dst_tvca_op_amp_step ,NULL ,NULL }, | |
| 252 | { DST_VCA ,"DST_VCA" , 1 ,0 ,NULL ,NULL ,NULL ,NULL }, | |
| 309 | 253 | |
| 310 | 254 | /* from disc_flt.c */ |
| 311 | 255 | /* Generic modules */ |
| 312 | { DST_FILTER1 ,"DST_FILTER1" , 1 ,sizeof(struct dss_filter1_context) ,dst_filter1_reset ,dst_filter1_step }, | |
| 313 | { DST_FILTER2 ,"DST_FILTER2" , 1 ,sizeof(struct dss_filter2_context) ,dst_filter2_reset ,dst_filter2_step }, | |
| 256 | { DST_FILTER1 ,"DST_FILTER1" , 1 ,sizeof(struct dss_filter1_context) ,dst_filter1_reset ,dst_filter1_step ,NULL ,NULL }, | |
| 257 | { DST_FILTER2 ,"DST_FILTER2" , 1 ,sizeof(struct dss_filter2_context) ,dst_filter2_reset ,dst_filter2_step ,NULL ,NULL }, | |
| 314 | 258 | /* Component specific modules */ |
| 315 | { DST_SALLEN_KEY ,"DST_SALLEN_KEY" , 1 ,sizeof(struct dss_filter2_context) ,dst_sallen_key_reset ,dst_sallen_key_step }, | |
| 316 | { DST_CRFILTER ,"DST_CRFILTER" , 1 ,sizeof(struct dst_rcfilter_context) ,dst_crfilter_reset ,dst_crfilter_step }, | |
| 317 | { DST_OP_AMP_FILT ,"DST_OP_AMP_FILT" , 1 ,sizeof(struct dst_op_amp_filt_context) ,dst_op_amp_filt_reset ,dst_op_amp_filt_step }, | |
| 318 | { DST_RCDISC ,"DST_RCDISC" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc_reset ,dst_rcdisc_step }, | |
| 319 | { DST_RCDISC2 ,"DST_RCDISC2" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc2_reset ,dst_rcdisc2_step }, | |
| 320 | { DST_RCDISC3 ,"DST_RCDISC3" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc3_reset ,dst_rcdisc3_step }, | |
| 321 | { DST_RCDISC4 ,"DST_RCDISC4" , 1 ,sizeof(struct dst_rcdisc4_context) ,dst_rcdisc4_reset ,dst_rcdisc4_step }, | |
| 322 | { DST_RCDISC5 ,"DST_RCDISC5" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc5_reset ,dst_rcdisc5_step }, | |
| 323 | { DST_RCINTEGRATE ,"DST_RCINTEGRATE" , 1 ,sizeof(struct dst_rcintegrate_context) ,dst_rcintegrate_reset ,dst_rcintegrate_step }, | |
| 324 | { DST_RCDISC_MOD ,"DST_RCDISC_MOD" , 1 ,sizeof(struct dst_rcdisc_mod_context) ,dst_rcdisc_mod_reset ,dst_rcdisc_mod_step }, | |
| 325 | { DST_RCFILTER ,"DST_RCFILTER" , 1 ,sizeof(struct dst_rcfilter_context) ,dst_rcfilter_reset ,dst_rcfilter_step }, | |
| 326 | { DST_RCFILTER_SW ,"DST_RCFILTER_SW" , 1 ,sizeof(struct dst_rcfilter_sw_context) ,dst_rcfilter_sw_reset ,dst_rcfilter_sw_step }, | |
| 259 | { DST_SALLEN_KEY ,"DST_SALLEN_KEY" , 1 ,sizeof(struct dss_filter2_context) ,dst_sallen_key_reset ,dst_sallen_key_step ,NULL ,NULL }, | |
| 260 | { DST_CRFILTER ,"DST_CRFILTER" , 1 ,sizeof(struct dst_rcfilter_context) ,dst_crfilter_reset ,dst_crfilter_step ,NULL ,NULL }, | |
| 261 | { DST_OP_AMP_FILT ,"DST_OP_AMP_FILT" , 1 ,sizeof(struct dst_op_amp_filt_context) ,dst_op_amp_filt_reset ,dst_op_amp_filt_step ,NULL ,NULL }, | |
| 262 | { DST_RCDISC ,"DST_RCDISC" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc_reset ,dst_rcdisc_step ,NULL ,NULL }, | |
| 263 | { DST_RCDISC2 ,"DST_RCDISC2" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc2_reset ,dst_rcdisc2_step ,NULL ,NULL }, | |
| 264 | { DST_RCDISC3 ,"DST_RCDISC3" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc3_reset ,dst_rcdisc3_step ,NULL ,NULL }, | |
| 265 | { DST_RCDISC4 ,"DST_RCDISC4" , 1 ,sizeof(struct dst_rcdisc4_context) ,dst_rcdisc4_reset ,dst_rcdisc4_step ,NULL ,NULL }, | |
| 266 | { DST_RCDISC5 ,"DST_RCDISC5" , 1 ,sizeof(struct dst_rcdisc_context) ,dst_rcdisc5_reset ,dst_rcdisc5_step ,NULL ,NULL }, | |
| 267 | { DST_RCINTEGRATE ,"DST_RCINTEGRATE" , 1 ,sizeof(struct dst_rcintegrate_context) ,dst_rcintegrate_reset ,dst_rcintegrate_step ,NULL ,NULL }, | |
| 268 | { DST_RCDISC_MOD ,"DST_RCDISC_MOD" , 1 ,sizeof(struct dst_rcdisc_mod_context) ,dst_rcdisc_mod_reset ,dst_rcdisc_mod_step ,NULL ,NULL }, | |
| 269 | { DST_RCFILTER ,"DST_RCFILTER" , 1 ,sizeof(struct dst_rcfilter_context) ,dst_rcfilter_reset ,dst_rcfilter_step ,NULL ,NULL }, | |
| 270 | { DST_RCFILTER_SW ,"DST_RCFILTER_SW" , 1 ,sizeof(struct dst_rcfilter_sw_context) ,dst_rcfilter_sw_reset ,dst_rcfilter_sw_step ,NULL ,NULL }, | |
| 327 | 271 | /* For testing - seem to be buggered. Use versions not ending in N. */ |
| 328 | { DST_RCFILTERN ,"DST_RCFILTERN" , 1 ,sizeof(struct dss_filter1_context) ,dst_rcfilterN_reset ,dst_filter1_step }, | |
| 329 | { DST_RCDISCN ,"DST_RCDISCN" , 1 ,sizeof(struct dss_filter1_context) ,dst_rcdiscN_reset ,dst_rcdiscN_step }, | |
| 330 | { DST_RCDISC2N ,"DST_RCDISC2N" , 1 ,sizeof(struct dss_rcdisc2_context) ,dst_rcdisc2N_reset ,dst_rcdisc2N_step }, | |
| 272 | { DST_RCFILTERN ,"DST_RCFILTERN" , 1 ,sizeof(struct dss_filter1_context) ,dst_rcfilterN_reset ,dst_filter1_step ,NULL ,NULL }, | |
| 273 | { DST_RCDISCN ,"DST_RCDISCN" , 1 ,sizeof(struct dss_filter1_context) ,dst_rcdiscN_reset ,dst_rcdiscN_step ,NULL ,NULL }, | |
| 274 | { DST_RCDISC2N ,"DST_RCDISC2N" , 1 ,sizeof(struct dss_rcdisc2_context) ,dst_rcdisc2N_reset ,dst_rcdisc2N_step ,NULL ,NULL }, | |
| 331 | 275 | |
| 332 | 276 | /* from disc_dev.c */ |
| 333 | 277 | /* generic modules */ |
| 334 | { DST_CUSTOM ,"DST_CUSTOM" , 1 ,0 ,NULL ,NULL }, | |
| 278 | { DST_CUSTOM ,"DST_CUSTOM" , 1 ,0 ,NULL ,NULL ,NULL ,NULL }, | |
| 335 | 279 | /* Component specific modules */ |
| 336 | { DSD_555_ASTBL ,"DSD_555_ASTBL" , 1 ,sizeof(struct dsd_555_astbl_context) ,dsd_555_astbl_reset ,dsd_555_astbl_step }, | |
| 337 | { DSD_555_MSTBL ,"DSD_555_MSTBL" , 1 ,sizeof(struct dsd_555_mstbl_context) ,dsd_555_mstbl_reset ,dsd_555_mstbl_step }, | |
| 338 | { DSD_555_CC ,"DSD_555_CC" , 1 ,sizeof(struct dsd_555_cc_context) ,dsd_555_cc_reset ,dsd_555_cc_step }, | |
| 339 | { DSD_555_VCO1 ,"DSD_555_VCO1" , 1 ,sizeof(struct dsd_555_vco1_context) ,dsd_555_vco1_reset ,dsd_555_vco1_step }, | |
| 340 | { DSD_566 ,"DSD_566" , 1 ,sizeof(struct dsd_566_context) ,dsd_566_reset ,dsd_566_step }, | |
| 341 | { DSD_LS624 ,"DSD_LS624" , 1 ,sizeof(struct dsd_ls624_context) ,dsd_ls624_reset ,dsd_ls624_step }, | |
| 280 | { DSD_555_ASTBL ,"DSD_555_ASTBL" , 1 ,sizeof(struct dsd_555_astbl_context) ,dsd_555_astbl_reset ,dsd_555_astbl_step ,NULL ,NULL }, | |
| 281 | { DSD_555_MSTBL ,"DSD_555_MSTBL" , 1 ,sizeof(struct dsd_555_mstbl_context) ,dsd_555_mstbl_reset ,dsd_555_mstbl_step ,NULL ,NULL }, | |
| 282 | { DSD_555_CC ,"DSD_555_CC" , 1 ,sizeof(struct dsd_555_cc_context) ,dsd_555_cc_reset ,dsd_555_cc_step ,NULL ,NULL }, | |
| 283 | { DSD_555_VCO1 ,"DSD_555_VCO1" , 1 ,sizeof(struct dsd_555_vco1_context) ,dsd_555_vco1_reset ,dsd_555_vco1_step ,NULL ,NULL }, | |
| 284 | { DSD_566 ,"DSD_566" , 1 ,sizeof(struct dsd_566_context) ,dsd_566_reset ,dsd_566_step ,NULL ,NULL }, | |
| 285 | { DSD_LS624 ,"DSD_LS624" , 1 ,sizeof(struct dsd_ls624_context) ,dsd_ls624_reset ,dsd_ls624_step ,NULL ,NULL }, | |
| 342 | 286 | /* must be the last one */ |
| 343 | { DSS_NULL ,"DSS_NULL" , 0 ,0 ,NULL ,NULL } | |
| 287 | { DSS_NULL ,"DSS_NULL" , 0 ,0 ,NULL ,NULL ,NULL ,NULL } | |
| 344 | 288 | }; |
| 345 | 289 | |
| 290 | INLINE void step_nodes_in_list(const linked_list_entry *list) | |
| 291 | { | |
| 292 | const linked_list_entry *entry; | |
| 293 | ||
| 294 | if (DISCRETE_PROFILING) | |
| 295 | { | |
| 296 | osd_ticks_t last = get_profile_ticks(); | |
| 297 | ||
| 298 | for (entry = list; entry != NULL; entry = entry->next) | |
| 299 | { | |
| 300 | node_description *node = (node_description *) entry->ptr; | |
| 301 | ||
| 302 | node->run_time -= last; | |
| 303 | (*node->module->step)(node); | |
| 304 | last = get_profile_ticks(); | |
| 305 | node->run_time += last; | |
| 306 | } | |
| 307 | } | |
| 308 | else | |
| 309 | { | |
| 310 | for (entry = list; entry != NULL; entry = entry->next) | |
| 311 | { | |
| 312 | node_description *node = (node_description *) entry->ptr; | |
| 313 | ||
| 314 | /* Now step the node */ | |
| 315 | (*node->module->step)(node); | |
| 316 | } | |
| 317 | } | |
| 318 | } | |
| 319 | ||
| 346 | 320 | /************************************* |
| 347 | 321 | * |
| 348 | 322 | * Find a given node |
| r5613 | r5614 | |
| 361 | 335 | * |
| 362 | 336 | *************************************/ |
| 363 | 337 | |
| 364 | static void discrete_build_list(discrete_info *info, discrete_sound_block *intf, linked_list_entry ***current) | |
| 338 | static void discrete_build_list(discrete_info *info, const discrete_sound_block *intf, linked_list_entry ***current) | |
| 365 | 339 | { |
| 366 | 340 | int node_count = 0; |
| 367 | 341 | |
| r5613 | r5614 | |
| 434 | 408 | * |
| 435 | 409 | *************************************/ |
| 436 | 410 | |
| 437 | static void discrete_sanity_check(discrete_info *info) | |
| 411 | static void discrete_sanity_check(const discrete_info *info) | |
| 438 | 412 | { |
| 439 | 413 | linked_list_entry *entry; |
| 440 | 414 | int node_count = 0; |
| r5613 | r5614 | |
| 475 | 449 | static DEVICE_START( discrete ) |
| 476 | 450 | { |
| 477 | 451 | linked_list_entry **intf; |
| 452 | linked_list_entry *entry; | |
| 478 | 453 | discrete_sound_block *intf_start = (discrete_sound_block *)device->static_config; |
| 479 | 454 | discrete_info *info = get_safe_token(device); |
| 480 | 455 | char name[32]; |
| r5613 | r5614 | |
| 490 | 465 | info->neg_sample_time = - info->sample_time; |
| 491 | 466 | |
| 492 | 467 | info->total_samples = 0; |
| 468 | info->total_stream_updates = 0; | |
| 493 | 469 | |
| 494 | 470 | /* create the logfile */ |
| 495 | 471 | sprintf(name, "discrete%s.log", device->tag); |
| r5613 | r5614 | |
| 519 | 495 | /* now go back and find pointers to all input nodes */ |
| 520 | 496 | find_input_nodes(info); |
| 521 | 497 | |
| 522 | /* then set up the output nodes */ | |
| 523 | 498 | /* initialize the stream(s) */ |
| 524 | 499 | info->discrete_stream = stream_create(device,linked_list_count(info->input_list), linked_list_count(info->output_list), info->sample_rate, info, discrete_stream_update); |
| 525 | 500 | |
| r5613 | r5614 | |
| 527 | 502 | |
| 528 | 503 | info->queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI | WORK_QUEUE_FLAG_HIGH_FREQ); |
| 529 | 504 | |
| 530 | setup_disc_logs(info); | |
| 505 | /* Process nodes which have a start func */ | |
| 506 | ||
| 507 | for (entry = info->node_list; entry != NULL; entry = entry->next) | |
| 508 | { | |
| 509 | node_description *node = (node_description *) entry->ptr; | |
| 510 | ||
| 511 | if (node->module->start) | |
| 512 | (*node->module->start)(node); | |
| 513 | } | |
| 514 | ||
| 531 | 515 | } |
| 532 | 516 | |
| 533 | 517 | |
| r5613 | r5614 | |
| 538 | 522 | * |
| 539 | 523 | *************************************/ |
| 540 | 524 | |
| 525 | static UINT64 list_run_time(const linked_list_entry *list) | |
| 526 | { | |
| 527 | const linked_list_entry *entry; | |
| 528 | UINT64 total = 0; | |
| 529 | ||
| 530 | for (entry = list; entry != NULL; entry = entry->next) | |
| 531 | { | |
| 532 | node_description *node = (node_description *) entry->ptr; | |
| 533 | ||
| 534 | total += node->run_time; | |
| 535 | } | |
| 536 | return total; | |
| 537 | } | |
| 538 | ||
| 539 | static void display_profiling(const discrete_info *info) | |
| 540 | { | |
| 541 | int count; | |
| 542 | UINT64 total; | |
| 543 | UINT64 tresh; | |
| 544 | double tt; | |
| 545 | linked_list_entry *entry; | |
| 546 | ||
| 547 | /* calculate total time */ | |
| 548 | total = list_run_time(info->node_list); | |
| 549 | count = linked_list_count(info->node_list); | |
| 550 | /* print statistics */ | |
| 551 | printf("Total Samples : %16" I64FMT "d\n", info->total_samples); | |
| 552 | tresh = total / count; | |
| 553 | printf("Treshold (mean): %16" I64FMT "d\n", tresh / info->total_samples ); | |
| 554 | for (entry = info->node_list; entry != NULL; entry = entry->next) | |
| 555 | { | |
| 556 | node_description *node = (node_description *) entry->ptr; | |
| 557 | ||
| 558 | if (node->run_time > tresh) | |
| 559 | printf("%3d: %20s %8.2f %10.2f\n", NODE_BLOCKINDEX(node), node->module->name, (float) node->run_time / (float) total * 100.0, ((float) node->run_time) / (float) info->total_samples); | |
| 560 | } | |
| 561 | ||
| 562 | /* Task information */ | |
| 563 | for (entry = info->task_list; entry != 0; entry = entry->next) | |
| 564 | { | |
| 565 | discrete_task_context *task = (discrete_task_context *) entry->ptr; | |
| 566 | tt = list_run_time(task->list); | |
| 567 | ||
| 568 | printf("Task: %8.2f %15.2f\n", tt / (double) total * 100.0, tt / (double) info->total_samples); | |
| 569 | } | |
| 570 | tt = list_run_time(info->step_list); | |
| 571 | ||
| 572 | printf("Main: %8.2f %15.2f\n", tt / (double) total * 100.0, tt / (double) info->total_samples); | |
| 573 | ||
| 574 | printf("Average samples/stream_update: %8.2f\n", (double) info->total_samples / (double) info->total_stream_updates); | |
| 575 | } | |
| 576 | ||
| 541 | 577 | static DEVICE_STOP( discrete ) |
| 542 | 578 | { |
| 543 | 579 | discrete_info *info = get_safe_token(device); |
| 544 | in | |
| 580 | linked_list_entry *entry; | |
| 545 | 581 | |
| 546 | 582 | osd_work_queue_free(info->queue); |
| 547 | 583 | |
| 548 | 584 | if (DISCRETE_PROFILING) |
| 549 | 585 | { |
| 550 | int count = 0; | |
| 551 | linked_list_entry *entry; | |
| 552 | osd_ticks_t total = 0; | |
| 553 | osd_ticks_t tresh; | |
| 586 | display_profiling(info); | |
| 587 | } | |
| 554 | 588 | |
| 555 | /* calculate total time */ | |
| 556 | for (entry = info->step_list; entry != NULL; entry = entry->next) | |
| 557 | { | |
| 558 | node_description *node = (node_description *) entry->ptr; | |
| 589 | /* Process nodes which have a stop func */ | |
| 559 | 590 | |
| 560 | /* Now step the node */ | |
| 561 | total += node->run_time; | |
| 562 | count++; | |
| 563 | } | |
| 564 | /* print statistics */ | |
| 565 | printf("Total Samples: %d\n", info->total_samples); | |
| 566 | tresh = total / count; | |
| 567 | for (entry = info->step_list; entry != NULL; entry = entry->next) | |
| 568 | { | |
| 569 | node_description *node = (node_description *) entry->ptr; | |
| 591 | for (entry = info->node_list; entry != NULL; entry = entry->next) | |
| 592 | { | |
| 593 | node_description *node = (node_description *) entry->ptr; | |
| 570 | 594 | |
| 571 | if (node->run_time > tresh) | |
| 572 | printf("%3d: %20s %8.2f %10d\n", NODE_INDEX(node->node), node->module->name, (float) node->run_time / (float) total * 100.0, ((int) node->run_time) / info->total_samples); | |
| 573 | } | |
| 595 | if (node->module->stop) | |
| 596 | (*node->module->stop)(node); | |
| 574 | 597 | } |
| 575 | 598 | |
| 576 | /* close any csv files */ | |
| 577 | for (log_num = 0; log_num < info->num_csvlogs; log_num++) | |
| 578 | if (info->disc_csv_file[log_num]) | |
| 579 | fclose(info->disc_csv_file[log_num]); | |
| 580 | ||
| 581 | /* close any wave files */ | |
| 582 | for (log_num = 0; log_num < info->num_wavelogs; log_num++) | |
| 583 | if (info->disc_wav_file[log_num]) | |
| 584 | wav_close(info->disc_wav_file[log_num]); | |
| 585 | ||
| 586 | 599 | if (DISCRETE_DEBUGLOG) |
| 587 | 600 | { |
| 588 | 601 | /* close the debug log */ |
| r5613 | r5614 | |
| 622 | 635 | } |
| 623 | 636 | } |
| 624 | 637 | |
| 625 | /* This was a try which unfortunately did not provide | |
| 626 | * any improvement. Left here for reference | |
| 627 | */ | |
| 628 | #if 0 | |
| 629 | INLINE void bigselect(const device_config *device, node_description *node) | |
| 630 | { | |
| 631 | switch (node->module.type) | |
| 632 | { | |
| 633 | case DSS_ADJUSTMENT : dss_adjustment_step(device, node); break; | |
| 634 | case DSS_INPUT_PULSE : dss_input_pulse_step(device, node); break; | |
| 635 | case DSS_INPUT_STREAM: dss_input_stream_step(device, node); break; | |
| 636 | case DSS_COUNTER : dss_counter_step(device, node); break; | |
| 637 | case DSS_LFSR_NOISE : dss_lfsr_step(device, node); break; | |
| 638 | case DSS_NOISE : dss_noise_step(device, node); break; | |
| 639 | case DSS_NOTE : dss_note_step(device, node); break; | |
| 640 | case DSS_SAWTOOTHWAVE: dss_sawtoothwave_step(device, node); break; | |
| 641 | case DSS_SINEWAVE : dss_sinewave_step(device, node); break; | |
| 642 | case DSS_SQUAREWAVE : dss_squarewave_step(device, node); break; | |
| 643 | case DSS_SQUAREWFIX : dss_squarewfix_step(device, node); break; | |
| 644 | case DSS_SQUAREWAVE2 : dss_squarewave2_step(device, node); break; | |
| 645 | case DSS_TRIANGLEWAVE: dss_trianglewave_step(device, node); break; | |
| 646 | case DSS_INVERTER_OSC : dss_inverter_osc_step(device, node); break; | |
| 647 | case DSS_OP_AMP_OSC : dss_op_amp_osc_step(device, node); break; | |
| 648 | case DSS_SCHMITT_OSC : dss_schmitt_osc_step(device, node); break; | |
| 649 | case DSS_ADSR : dss_adsrenv_step(device, node); break; | |
| 650 | case DST_ADDER : dst_adder_step(device, node); break; | |
| 651 | case DST_CLAMP : dst_clamp_step(device, node); break; | |
| 652 | case DST_DIVIDE : dst_divide_step(device, node); break; | |
| 653 | case DST_GAIN : dst_gain_step(device, node); break; | |
| 654 | case DST_LOGIC_INV : dst_logic_inv_step(device, node); break; | |
| 655 | case DST_LOGIC_AND : dst_logic_and_step(device, node); break; | |
| 656 | case DST_LOGIC_NAND : dst_logic_nand_step(device, node); break; | |
| 657 | case DST_LOGIC_OR : dst_logic_or_step(device, node); break; | |
| 658 | case DST_LOGIC_NOR : dst_logic_nor_step(device, node); break; | |
| 659 | case DST_LOGIC_XOR : dst_logic_xor_step(device, node); break; | |
| 660 | case DST_LOGIC_NXOR : dst_logic_nxor_step(device, node); break; | |
| 661 | case DST_LOGIC_DFF : dst_logic_dff_step(device, node); break; | |
| 662 | case DST_LOGIC_JKFF : dst_logic_jkff_step(device, node); break; | |
| 663 | case DST_LOOKUP_TABLE: dst_lookup_table_step(device, node); break; | |
| 664 | case DST_MULTIPLEX : dst_multiplex_step(device, node); break; | |
| 665 | case DST_ONESHOT : dst_oneshot_step(device, node); break; | |
| 666 | case DST_RAMP : dst_ramp_step(device, node); break; | |
| 667 | case DST_SAMPHOLD : dst_samphold_step(device, node); break; | |
| 668 | case DST_SWITCH : dst_switch_step(device, node); break; | |
| 669 | case DST_ASWITCH : dst_aswitch_step(device, node); break; | |
| 670 | case DST_TRANSFORM : dst_transform_step(device, node); break; | |
| 671 | case DST_COMP_ADDER : dst_comp_adder_step(device, node); break; | |
| 672 | case DST_DAC_R1 : dst_dac_r1_step(device, node); break; | |
| 673 | case DST_DIODE_MIX : dst_diode_mix_step(device, node); break; | |
| 674 | case DST_INTEGRATE : dst_integrate_step(device, node); break; | |
| 675 | case DST_MIXER : dst_mixer_step(device, node); break; | |
| 676 | case DST_OP_AMP : dst_op_amp_step(device, node); break; | |
| 677 | case DST_OP_AMP_1SHT : dst_op_amp_1sht_step(device, node); break; | |
| 678 | case DST_TVCA_OP_AMP : dst_tvca_op_amp_step(device, node); break; | |
| 679 | case DST_FILTER1 : dst_filter1_step(device, node); break; | |
| 680 | case DST_FILTER2 : dst_filter2_step(device, node); break; | |
| 681 | case DST_SALLEN_KEY : dst_sallen_key_step(device, node); break; | |
| 682 | case DST_CRFILTER : dst_crfilter_step(device, node); break; | |
| 683 | case DST_OP_AMP_FILT : dst_op_amp_filt_step(device, node); break; | |
| 684 | case DST_RCDISC : dst_rcdisc_step(device, node); break; | |
| 685 | case DST_RCDISC2 : dst_rcdisc2_step(device, node); break; | |
| 686 | case DST_RCDISC3 : dst_rcdisc3_step(device, node); break; | |
| 687 | case DST_RCDISC4 : dst_rcdisc4_step(device, node); break; | |
| 688 | case DST_RCDISC5 : dst_rcdisc5_step(device, node); break; | |
| 689 | case DST_RCINTEGRATE : dst_rcintegrate_step(device, node); break; | |
| 690 | case DST_RCDISC_MOD : dst_rcdisc_mod_step(device, node); break; | |
| 691 | case DST_RCFILTER : dst_rcfilter_step(device, node); break; | |
| 692 | case DST_RCFILTER_SW : dst_rcfilter_sw_step(device, node); break; | |
| 693 | case DST_RCFILTERN : dst_filter1_step(device, node); break; | |
| 694 | case DST_RCDISCN : dst_rcdiscN_step(device, node); break; | |
| 695 | case DST_RCDISC2N : dst_rcdisc2N_step(device, node); break; | |
| 696 | case DSD_555_ASTBL : dsd_555_astbl_step(device, node); break; | |
| 697 | case DSD_555_MSTBL : dsd_555_mstbl_step(device, node); break; | |
| 698 | case DSD_555_CC : dsd_555_cc_step(device, node); break; | |
| 699 | case DSD_555_VCO1 : dsd_555_vco1_step(device, node); break; | |
| 700 | case DSD_566 : dsd_566_step(device, node); break; | |
| 701 | case DSD_LS624 : dsd_ls624_step(device, node); break; | |
| 702 | } | |
| 703 | } | |
| 704 | #endif | |
| 705 | 638 | /************************************* |
| 706 | 639 | * |
| 707 | 640 | * Stream update functions |
| 708 | 641 | * |
| 709 | 642 | *************************************/ |
| 710 | 643 | |
| 711 | ||
| 644 | static void * | |
| 712 | 645 | { |
| 713 | int nodenum, outputnum; | |
| 646 | task_info *ti = (task_info *) param; | |
| 647 | int samples, i; | |
| 714 | 648 | |
| 715 | /* Dump any csv logs */ | |
| 716 | for (outputnum = 0; outputnum < info->num_csvlogs; outputnum++) | |
| 717 | { | |
| 718 | fprintf(info->disc_csv_file[outputnum], "%" I64FMT "d", ++info->sample_num); | |
| 719 | for (nodenum = 0; nodenum < info->csvlog_node[outputnum]->active_inputs; nodenum++) | |
| 720 | { | |
| 721 | fprintf(info->disc_csv_file[outputnum], ", %f", *info->csvlog_node[outputnum]->input[nodenum]); | |
| 722 | } | |
| 723 | fprintf(info->disc_csv_file[outputnum], "\n"); | |
| 724 | } | |
| 725 | } | |
| 649 | /* set up task buffers */ | |
| 650 | for (i = 0; i < ti->context->numbuffered; i++) | |
| 651 | ti->context->ptr[i] = &ti->context->node_buf[i][0]; | |
| 726 | 652 | |
| 727 | INLINE void discrete_stream_update_wave(discrete_info *info) | |
| 728 | { | |
| 729 | int outputnum; | |
| 730 | double val; | |
| 731 | INT16 wave_data_l, wave_data_r; | |
| 732 | ||
| 733 | /* Dump any wave logs */ | |
| 734 | for (outputnum = 0; outputnum < info->num_wavelogs; outputnum++) | |
| 653 | samples = ti->samples; | |
| 654 | while (samples-- > 0) | |
| 735 | 655 | { |
| 736 | /* get nodes to be logged and apply gain, then clip to 16 bit */ | |
| 737 | val = (*info->wavelog_node[outputnum]->input[0]) * (*info->wavelog_node[outputnum]->input[1]); | |
| 738 | val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; | |
| 739 | wave_data_l = (INT16)val; | |
| 740 | if (info->wavelog_node[outputnum]->active_inputs == 2) | |
| 741 | { | |
| 742 | /* DISCRETE_WAVELOG1 */ | |
| 743 | wav_add_data_16(info->disc_wav_file[outputnum], &wave_data_l, 1); | |
| 744 | } | |
| 745 | else | |
| 746 | { | |
| 747 | /* DISCRETE_WAVELOG2 */ | |
| 748 | val = (*info->wavelog_node[outputnum]->input[2]) * (*info->wavelog_node[outputnum]->input[3]); | |
| 749 | val = (val < -32768) ? -32768 : (val > 32767) ? 32767 : val; | |
| 750 | wave_data_r = (INT16)val; | |
| 751 | ||
| 752 | wav_add_data_16lr(info->disc_wav_file[outputnum], &wave_data_l, &wave_data_r, 1); | |
| 753 | } | |
| 656 | step_nodes_in_list(ti->context->list); | |
| 754 | 657 | } |
| 658 | /* reset ptr */ | |
| 659 | for (i = 0; i < ti->context->numbuffered; i++) | |
| 660 | ti->context->ptr[i] = &ti->context->node_buf[i][0]; | |
| 661 | ||
| 662 | free(param); | |
| 663 | return NULL; | |
| 755 | 664 | } |
| 756 | 665 | |
| 757 | 666 | INLINE void discrete_stream_update_nodes(discrete_info *info) |
| r5613 | r5614 | |
| 766 | 675 | { |
| 767 | 676 | discrete_task_context *task = (discrete_task_context *) entry->ptr; |
| 768 | 677 | int i; |
| 769 | ||
| 770 | for (i = 0; i < task->numbuffered; i++) | |
| 678 | ||
| 679 | for (i = task->numbuffered - 1; i >= 0 ; i--) | |
| 771 | 680 | **task->dest[i] = *task->ptr[i]++; |
| 772 | 681 | } |
| 773 | 682 | |
| 774 | 683 | /* loop over all nodes */ |
| 775 | step_nodes_in_list( | |
| 684 | step_nodes_in_list( | |
| 776 | 685 | } |
| 777 | 686 | |
| 687 | static STREAM_UPDATE( buffer_stream_update ) | |
| 688 | { | |
| 689 | node_description *node = (node_description *) param; | |
| 690 | struct dss_input_context *context = (struct dss_input_context *)node->context; | |
| 691 | stream_sample_t *ptr = outputs[0]; | |
| 692 | int data = context->data; | |
| 693 | int samplenum = samples; | |
| 694 | ||
| 695 | while (samplenum-- > 0) | |
| 696 | *(ptr++) = data; | |
| 697 | } | |
| 698 | ||
| 699 | ||
| 778 | 700 | static STREAM_UPDATE( discrete_stream_update ) |
| 779 | 701 | { |
| 780 | 702 | discrete_info *info = (discrete_info *)param; |
| r5613 | r5614 | |
| 797 | 719 | context->ptr = (void *) inputs[context->stream_in_number]; |
| 798 | 720 | } |
| 799 | 721 | |
| 722 | /* Queue tasks */ | |
| 800 | 723 | for (entry = info->task_list; entry != 0; entry = entry->next) |
| 801 | 724 | { |
| 802 | 725 | task_info *ti = malloc(sizeof(task_info)); |
| r5613 | r5614 | |
| 811 | 734 | /* and wait for them */ |
| 812 | 735 | osd_work_queue_wait(info->queue, osd_ticks_per_second()*10); |
| 813 | 736 | |
| 814 | if ((info->num_csvlogs == 0) && (info->num_wavelogs == 0)) | |
| 815 | { | |
| 816 | /* Now we must do samples iterations of the node list, one output for each step */ | |
| 817 | for (samplenum = 0; samplenum < samples; samplenum++) | |
| 818 | discrete_stream_update_nodes(info); | |
| 819 | } | |
| 820 | else | |
| 821 | { | |
| 822 | /* Now we must do samples iterations of the node list, one output for each step */ | |
| 823 | for (samplenum = 0; samplenum < samples; samplenum++) | |
| 824 | { | |
| 825 | discrete_stream_update_nodes(info); | |
| 826 | discrete_stream_update_csv(info); | |
| 827 | discrete_stream_update_wave(info); | |
| 737 | /* Now we must do samples iterations of the node list, one output for each step */ | |
| 738 | for (samplenum = 0; samplenum < samples; samplenum++) | |
| 739 | discrete_stream_update_nodes(info); | |
| 828 | 740 | |
| 829 | } | |
| 830 | } | |
| 741 | if (DISCRETE_PROFILING) | |
| 742 | info->total_stream_updates++; | |
| 831 | 743 | |
| 832 | 744 | } |
| 833 | 745 | |
| r5613 | r5614 | |
| 842 | 754 | |
| 843 | 755 | static void init_nodes(discrete_info *info, linked_list_entry *block_list, const device_config *device) |
| 844 | 756 | { |
| 845 | linked_list_entry ** | |
| 757 | linked_list_entry ** | |
| 846 | 758 | linked_list_entry *entry; |
| 759 | linked_list_entry *task_node_list = NULL; | |
| 847 | 760 | discrete_task_context *task = NULL; |
| 848 | 761 | /* list tail pointers */ |
| 849 | linked_list_entry **step_list = &info->step_list; | |
| 850 | linked_list_entry **node_list = &info->node_list; | |
| 851 | linked_list_entry **task_list = &info->task_list; | |
| 852 | linked_list_entry **output_list = &info->output_list; | |
| 853 | linked_list_entry **input_list = &info->input_list; | |
| 762 | linked_list_entry **step_list_ptr = &info->step_list; | |
| 763 | linked_list_entry **node_list_ptr = &info->node_list; | |
| 764 | linked_list_entry **task_list_ptr = &info->task_list; | |
| 765 | linked_list_entry **output_list_ptr = &info->output_list; | |
| 766 | linked_list_entry **input_list_ptr = &info->input_list; | |
| 854 | 767 | |
| 855 | 768 | /* loop over all nodes */ |
| 856 | 769 | for (entry = block_list; entry != NULL; entry = entry->next) |
| 857 | 770 | { |
| 858 | 771 | discrete_sound_block *block = (discrete_sound_block *) entry->ptr; |
| 859 | 772 | node_description *node = auto_alloc_clear(info->device->machine, node_description); |
| 860 | int | |
| 773 | int | |
| 861 | 774 | |
| 862 | 775 | /* find the requested module */ |
| 863 | 776 | for (modulenum = 0; module_list[modulenum].type != DSS_NULL; modulenum++) |
| r5613 | r5614 | |
| 869 | 782 | /* static inits */ |
| 870 | 783 | node->context = NULL; |
| 871 | 784 | node->info = info; |
| 872 | node->node = block->node; | |
| 873 | 785 | node->module = &module_list[modulenum]; |
| 874 | 786 | node->output[0] = 0.0; |
| 875 | 787 | node->block = block; |
| 876 | 788 | node->custom = block->custom; |
| 877 | 789 | node->active_inputs = block->active_inputs; |
| 790 | node->run_time = 0; | |
| 878 | 791 | |
| 792 | /* setup module if custom */ | |
| 793 | if (block->type == DST_CUSTOM) | |
| 794 | { | |
| 795 | const discrete_custom_info *custom = (const discrete_custom_info *)node->custom; | |
| 796 | node->module = &custom->module; | |
| 797 | node->custom = custom->custom; | |
| 798 | } | |
| 799 | ||
| 800 | /* allocate memory if necessary */ | |
| 801 | if (node->module->contextsize) | |
| 802 | node->context = auto_alloc_array_clear(device->machine, UINT8, node->module->contextsize); | |
| 803 | ||
| 879 | 804 | /* keep track of special nodes */ |
| 880 | 805 | if (block->node == NODE_SPECIAL) |
| 881 | 806 | { |
| r5613 | r5614 | |
| 883 | 808 | { |
| 884 | 809 | /* Output Node */ |
| 885 | 810 | case DSO_OUTPUT: |
| 886 | linked_list_add(info, &output_list, node); | |
| 811 | linked_list_add(info, &output_list_ptr, node); | |
| 887 | 812 | break; |
| 888 | 813 | |
| 889 | 814 | /* CSVlog Node for debugging */ |
| 890 | 815 | case DSO_CSVLOG: |
| 891 | if (info->num_csvlogs == DISCRETE_MAX_CSVLOGS) | |
| 892 | fatalerror("init_nodes() - There can not be more then %d discrete CSV logs.", DISCRETE_MAX_WAVELOGS); | |
| 893 | info->csvlog_node[info->num_csvlogs++] = node; | |
| 894 | 816 | break; |
| 895 | 817 | |
| 896 | 818 | /* Wavelog Node for debugging */ |
| 897 | 819 | case DSO_WAVELOG: |
| 898 | if (info->num_wavelogs == DISCRETE_MAX_WAVELOGS) | |
| 899 | fatalerror("init_nodes() - There can not be more then %d discrete wave logs.", DISCRETE_MAX_WAVELOGS); | |
| 900 | info->wavelog_node[info->num_wavelogs++] = node; | |
| 901 | 820 | break; |
| 902 | 821 | |
| 903 | 822 | /* Task processing */ |
| 904 | 823 | case DSO_TASK_START: |
| 905 | if ( | |
| 824 | if ( | |
| 906 | 825 | fatalerror("init_nodes() - Nested DISCRETE_START_TASK."); |
| 907 | task = auto_alloc_clear(info->device->machine, discrete_task_context); | |
| 908 | linked_list_add(info, &task_list, task); | |
| 909 | cur_task_node = &task->list; | |
| 826 | task_node_list = NULL; | |
| 827 | task_node_list_ptr = &task_node_list; | |
| 910 | 828 | break; |
| 911 | 829 | |
| 912 | 830 | case DSO_TASK_END: |
| 913 | if ( | |
| 831 | if ( | |
| 914 | 832 | fatalerror("init_nodes() - NO DISCRETE_START_TASK."); |
| 915 | task->numbuffered = node->active_inputs; | |
| 916 | { | |
| 917 | int i; | |
| 918 | for (i = 0; i < task->numbuffered; i++) | |
| 919 | task->dest[i] = (double **) &node->input[i]; | |
| 920 | } | |
| 833 | task = auto_alloc_clear(info->device->machine, discrete_task_context); | |
| 834 | task->numbuffered = 0; | |
| 835 | task->list = task_node_list; | |
| 836 | linked_list_add(info, &task_list_ptr, task); | |
| 921 | 837 | node->context = task; |
| 922 | 838 | task = NULL; |
| 839 | task_node_list = NULL; | |
| 923 | 840 | break; |
| 924 | 841 | |
| 925 | 842 | default: |
| r5613 | r5614 | |
| 935 | 852 | info->indexed_node[NODE_INDEX(block->node)] = node; |
| 936 | 853 | } |
| 937 | 854 | |
| 938 | for (inputnum = 0; inputnum < DISCRETE_MAX_INPUTS; inputnum++) | |
| 855 | /* if we are an stream input node, track that */ | |
| 856 | if (block->type == DSS_INPUT_STREAM) | |
| 939 | 857 | { |
| 940 | n | |
| 858 | link | |
| 941 | 859 | } |
| 942 | ||
| 943 | /* setup module if custom */ | |
| 944 | if (block->type == DST_CUSTOM) | |
| 860 | else if (block->type == DSS_INPUT_BUFFER) | |
| 945 | 861 | { |
| 946 | const discrete_custom_info *custom = (const discrete_custom_info *)node->custom; | |
| 947 | node->module = &custom->module; | |
| 948 | node->custom = custom->custom; | |
| 862 | linked_list_add(info, &input_list_ptr, node); | |
| 949 | 863 | } |
| 950 | 864 | |
| 951 | /* allocate memory if necessary */ | |
| 952 | if (node->module->contextsize) | |
| 953 | node->context = auto_alloc_array_clear(device->machine, UINT8, node->module->contextsize); | |
| 954 | ||
| 955 | /* if we are an stream input node, track that */ | |
| 956 | if (block->type == DSS_INPUT_STREAM) | |
| 957 | { | |
| 958 | linked_list_add(info, &input_list, node); | |
| 959 | } | |
| 960 | ||
| 961 | 865 | /* add to node list */ |
| 962 | linked_list_add(info, &node_list, node); | |
| 866 | linked_list_add(info, &node_list_ptr, node); | |
| 963 | 867 | |
| 964 | 868 | /* our running order just follows the order specified */ |
| 965 | 869 | /* does the node step ? */ |
| 966 | 870 | if (node->module->step != NULL) |
| 967 | 871 | { |
| 968 | 872 | /* do we belong to a task? */ |
| 969 | if (cur_task_node == NULL) | |
| 970 | linked_list_add(info, &step_list, node); | |
| 873 | if (task_node_list_ptr == NULL) | |
| 874 | linked_list_add(info, &step_list_ptr, node); | |
| 971 | 875 | else |
| 972 | linked_list_add(info, & | |
| 876 | linked_list_add(info, & | |
| 973 | 877 | } |
| 974 | 878 | |
| 975 | 879 | if (block->type == DSO_TASK_END) |
| 976 | 880 | { |
| 977 | | |
| 881 | | |
| 978 | 882 | } |
| 979 | 883 | |
| 980 | 884 | /* and register save state */ |
| 981 | if (node->node != NODE_SPECIAL) | |
| 982 | state_save_register_device_item_array(device, node->node, node->output); | |
| 885 | if (node->block->node != NODE_SPECIAL) | |
| 886 | state_save_register_device_item_array(device, node->block->node, node->output); | |
| 983 | 887 | } |
| 984 | 888 | |
| 985 | 889 | /* if no outputs, give an error */ |
| r5613 | r5614 | |
| 988 | 892 | } |
| 989 | 893 | |
| 990 | 894 | |
| 991 | ||
| 992 | 895 | /************************************* |
| 993 | 896 | * |
| 994 | 897 | * Find and attach all input nodes |
| r5613 | r5614 | |
| 1016 | 919 | { |
| 1017 | 920 | node_description *node_ref = info->indexed_node[NODE_INDEX(inputnode)]; |
| 1018 | 921 | if (!node_ref) |
| 1019 | fatalerror("discrete_start - NODE_%02d referenced a non existent node NODE_%02d", NODE_INDEX( | |
| 922 | fatalerror("discrete_start - NODE_%02d referenced a non existent node NODE_%02d", NODE_BLOCKINDEX( | |
| 1020 | 923 | |
| 1021 | 924 | if (NODE_CHILD_NODE_NUM(inputnode) >= node_ref->module->num_output) |
| 1022 | fatalerror("discrete_start - NODE_%02d referenced non existent output %d on node NODE_%02d", NODE_INDEX( | |
| 925 | fatalerror("discrete_start - NODE_%02d referenced non existent output %d on node NODE_%02d", NODE_BLOCKINDEX( | |
| 1023 | 926 | |
| 1024 | 927 | node->input[inputnum] = &(node_ref->output[NODE_CHILD_NODE_NUM(inputnode)]); /* Link referenced node out to input */ |
| 1025 | 928 | node->input_is_node |= 1 << inputnum; /* Bit flag if input is node */ |
| r5613 | r5614 | |
| 1029 | 932 | /* warn if trying to use a node for an input that can only be static */ |
| 1030 | 933 | if IS_VALUE_A_NODE(block->initial[inputnum]) |
| 1031 | 934 | { |
| 1032 | discrete_log(info, "Warning - discrete_start - NODE_%02d trying to use a node on static input %d", NODE_INDEX( | |
| 935 | discrete_log(info, "Warning - discrete_start - NODE_%02d trying to use a node on static input %d", NODE_BLOCKINDEX( | |
| 1033 | 936 | /* also report it in the error log so it is not missed */ |
| 1034 | logerror("Warning - discrete_start - NODE_%02d trying to use a node on static input %d", NODE_INDEX( | |
| 937 | logerror("Warning - discrete_start - NODE_%02d trying to use a node on static input %d", NODE_BLOCKINDEX( | |
| 1035 | 938 | } |
| 939 | else | |
| 940 | { | |
| 941 | node->input[inputnum] = &(block->initial[inputnum]); | |
| 942 | } | |
| 1036 | 943 | } |
| 1037 | 944 | } |
| 1038 | } | |
| 1039 | } | |
| 1040 | ||
| 1041 | ||
| 1042 | /************************************* | |
| 1043 | * | |
| 1044 | * Set up the logs | |
| 1045 | * | |
| 1046 | *************************************/ | |
| 1047 | ||
| 1048 | static void setup_disc_logs(discrete_info *info) | |
| 1049 | { | |
| 1050 | int log_num, node_num; | |
| 1051 | char name[32]; | |
| 1052 | ||
| 1053 | for (log_num = 0; log_num < info->num_csvlogs; log_num++) | |
| 1054 | { | |
| 1055 | sprintf(name, "discrete%s_%d.csv", info->device->tag, log_num); | |
| 1056 | info->disc_csv_file[log_num] = fopen(name, "w"); | |
| 1057 | /* Output some header info */ | |
| 1058 | fprintf(info->disc_csv_file[log_num], "\"MAME Discrete System Node Log\"\n"); | |
| 1059 | fprintf(info->disc_csv_file[log_num], "\"Log Version\", 1.0\n"); | |
| 1060 | fprintf(info->disc_csv_file[log_num], "\"Sample Rate\", %d\n", info->sample_rate); | |
| 1061 | fprintf(info->disc_csv_file[log_num], "\n"); | |
| 1062 | fprintf(info->disc_csv_file[log_num], "\"Sample\""); | |
| 1063 | for (node_num = 0; node_num < info->csvlog_node[log_num]->active_inputs; node_num++) | |
| 945 | for (inputnum = node->active_inputs; inputnum < DISCRETE_MAX_INPUTS; inputnum++) | |
| 1064 | 946 | { |
| 1065 | fprintf(info->disc_csv_file[log_num], ", \"NODE_%2d\"", NODE_INDEX(info->csvlog_node[log_num]->block->input_node[node_num])); | |
| 947 | //FIXME: Check that no nodes follow ! | |
| 948 | node->input[inputnum] = &(block->initial[inputnum]); | |
| 1066 | 949 | } |
| 1067 | fprintf(info->disc_csv_file[log_num], "\n"); | |
| 1068 | 950 | } |
| 1069 | ||
| 1070 | for (log_num = 0; log_num < info->num_wavelogs; log_num++) | |
| 1071 | { | |
| 1072 | sprintf(name, "discrete%s_%d.wav", info->device->tag, log_num); | |
| 1073 | info->disc_wav_file[log_num] = wav_open(name, info->sample_rate, info->wavelog_node[log_num]->active_inputs/2); | |
| 1074 | } | |
| 1075 | 951 | } |
| 1076 | 952 | |
| 1077 | ||
| 1078 | ||
| 1079 | 953 | /************************************************************************** |
| 1080 | 954 | * Generic get_info |
| 1081 | 955 | **************************************************************************/ |
| r5613 | r5614 | |
|---|---|---|
| 3338 | 3338 | *************************************/ |
| 3339 | 3339 | |
| 3340 | 3340 | /* calculate charge exponent using discrete sample time */ |
| 3341 | #define RC_CHARGE_EXP(rc) (1.0 - exp(node->info->neg_sample_time / (rc))) | |
| 3341 | #define RC_CHARGE_EXP(_node, rc) (1.0 - exp((_node)->info->neg_sample_time / (rc))) | |
| 3342 | 3342 | /* calculate charge exponent using given sample time */ |
| 3343 | 3343 | #define RC_CHARGE_EXP_DT(rc, dt) (1.0 - exp(-(dt) / (rc))) |
| 3344 | 3344 | #define RC_CHARGE_NEG_EXP_DT(rc, dt) (1.0 - exp((dt) / (rc))) |
| 3345 | 3345 | |
| 3346 | 3346 | /* calculate discharge exponent using discrete sample time */ |
| 3347 | #define RC_DISCHARGE_EXP(rc) (exp(node->info->neg_sample_time / (rc))) | |
| 3347 | #define RC_DISCHARGE_EXP(_node, rc) (exp((_node)->info->neg_sample_time / (rc))) | |
| 3348 | 3348 | /* calculate discharge exponent using given sample time */ |
| 3349 | 3349 | #define RC_DISCHARGE_EXP_DT(rc, dt) (exp(-(dt) / (rc))) |
| 3350 | 3350 | #define RC_DISCHARGE_NEG_EXP_DT(rc, dt) (exp((dt) / (rc))) |
| r5613 | r5614 | |
| 3357 | 3357 | |
| 3358 | 3358 | #define DISCRETE_STEP_NAME( _func ) _func ## _step |
| 3359 | 3359 | #define DISCRETE_RESET_NAME( _func ) _func ## _reset |
| 3360 | #define DISCRETE_START_NAME( _func ) _func ## _start | |
| 3361 | #define DISCRETE_STOP_NAME( _func ) _func ## _stop | |
| 3360 | 3362 | |
| 3361 | #define DISCRETE_STEP(_func) void DISCRETE_STEP_NAME(_func) (node_description *node) | |
| 3362 | #define DISCRETE_RESET(_func) void DISCRETE_RESET_NAME(_func) (node_description *node) | |
| 3363 | #define DISCRETE_FUNC(_func) void _func (node_description *node) | |
| 3363 | 3364 | |
| 3365 | #define DISCRETE_STEP(_func) DISCRETE_FUNC(DISCRETE_STEP_NAME(_func)) | |
| 3366 | #define DISCRETE_RESET(_func) DISCRETE_FUNC(DISCRETE_RESET_NAME(_func)) | |
| 3367 | #define DISCRETE_START(_func) DISCRETE_FUNC(DISCRETE_START_NAME(_func)) | |
| 3368 | #define DISCRETE_STOP(_func) DISCRETE_FUNC(DISCRETE_STOP_NAME(_func)) | |
| 3369 | ||
| 3364 | 3370 | #define DISCRETE_STEP_CALL(_func) DISCRETE_STEP_NAME(_func) (node) |
| 3365 | 3371 | #define DISCRETE_RESET_CALL(_func) DISCRETE_RESET_NAME(_func) (node) |
| 3372 | #define DISCRETE_START_CALL(_func) DISCRETE_START_NAME(_func) (node) | |
| 3373 | #define DISCRETE_STOP_CALL(_func) DISCRETE_STOP_NAME(_func) (node) | |
| 3366 | 3374 | |
| 3367 | 3375 | #define DISCRETE_CUSTOM_MODULE(_basename, _context_type) \ |
| 3368 | 3376 | { DST_CUSTOM, "CUSTOM", 1, sizeof(_context_type), DISCRETE_RESET_NAME(_basename), DISCRETE_STEP_NAME(_basename) } |
| r5613 | r5614 | |
| 3377 | 3385 | |
| 3378 | 3386 | #define DISCRETE_MAX_NODES 300 |
| 3379 | 3387 | #define DISCRETE_MAX_INPUTS 10 |
| 3380 | #define DISCRETE_MAX_WAVELOGS 10 | |
| 3381 | #define DISCRETE_MAX_CSVLOGS 10 | |
| 3382 | 3388 | #define DISCRETE_MAX_OUTPUTS 8 |
| 3389 | #define DISCRETE_MAX_TASK_OUTPUTS 8 | |
| 3383 | 3390 | |
| 3384 | 3391 | |
| 3385 | 3392 | /************************************* |
| r5613 | r5614 | |
| 3616 | 3623 | const char * name; |
| 3617 | 3624 | int num_output; /* Total number of output nodes, i.e. Master node + 1 */ |
| 3618 | 3625 | size_t contextsize; |
| 3619 | void (*reset)(node_description *node); /* Called to reset a node after creation or system reset */ | |
| 3620 | void (*step)(node_description *node); /* Called to execute one time delta of output update */ | |
| 3626 | DISCRETE_FUNC((*reset)); /* Called to reset a node after creation or system reset */ | |
| 3627 | DISCRETE_FUNC((*step)); /* Called to execute one time delta of output update */ | |
| 3628 | DISCRETE_FUNC((*start)); /* Called to execute at device start */ | |
| 3629 | DISCRETE_FUNC((*stop)); /* Called to execute at device stop */ | |
| 3621 | 3630 | }; |
| 3622 | 3631 | |
| 3623 | 3632 | |
| r5613 | r5614 | |
| 3629 | 3638 | |
| 3630 | 3639 | struct _node_description |
| 3631 | 3640 | { |
| 3632 | int node; /* The node's index number in the node list */ | |
| 3633 | 3641 | double output[DISCRETE_MAX_OUTPUTS]; /* The node's last output value */ |
| 3634 | 3642 | |
| 3635 | 3643 | int active_inputs; /* Number of active inputs on this node type */ |
| r5613 | r5614 | |
| 3660 | 3668 | typedef struct _linked_list_entry linked_list_entry; |
| 3661 | 3669 | struct _linked_list_entry |
| 3662 | 3670 | { |
| 3663 | void *ptr; | |
| 3671 | const void *ptr; | |
| 3664 | 3672 | linked_list_entry *next; |
| 3665 | 3673 | }; |
| 3666 | 3674 | |
| 3667 | 3675 | typedef struct _discrete_task_context discrete_task_context; |
| 3668 | 3676 | struct _discrete_task_context |
| 3669 | 3677 | { |
| 3670 | linked_list_entry *list; | |
| 3678 | const linked_list_entry *list; | |
| 3671 | 3679 | |
| 3672 | int numbuffered; | |
| 3673 | double *ptr[5]; | |
| 3674 | double node_buf[5][2048]; | |
| 3675 | double **dest[5]; | |
| 3680 | int numbuffered; | |
| 3681 | double *ptr[DISCRETE_MAX_TASK_OUTPUTS]; | |
| 3682 | double *node_buf[DISCRETE_MAX_TASK_OUTPUTS]; | |
| 3683 | node_description *nodes[DISCRETE_MAX_TASK_OUTPUTS]; | |
| 3684 | double **dest[DISCRETE_MAX_TASK_OUTPUTS]; | |
| 3685 | ||
| 3676 | 3686 | }; |
| 3677 | 3687 | |
| 3678 | 3688 | struct _discrete_info |
| r5613 | r5614 | |
| 3708 | 3718 | /* the output stream */ |
| 3709 | 3719 | sound_stream *discrete_stream; |
| 3710 | 3720 | |
| 3711 | /* debugging statics */ | |
| 3721 | /* debugging statistics */ | |
| 3712 | 3722 | FILE *disclogfile; |
| 3713 | 3723 | |
| 3714 | /* csvlog tracking */ | |
| 3715 | int num_csvlogs; | |
| 3716 | FILE *disc_csv_file[DISCRETE_MAX_CSVLOGS]; | |
| 3717 | node_description *csvlog_node[DISCRETE_MAX_CSVLOGS]; | |
| 3718 | INT64 sample_num; | |
| 3719 | ||
| 3720 | /* wavelog tracking */ | |
| 3721 | int num_wavelogs; | |
| 3722 | wav_file *disc_wav_file[DISCRETE_MAX_WAVELOGS]; | |
| 3723 | node_description *wavelog_node[DISCRETE_MAX_WAVELOGS]; | |
| 3724 | ||
| 3725 | 3724 | /* parallel tasks */ |
| 3726 | ||
| 3727 | 3725 | osd_work_queue *queue; |
| 3728 | 3726 | |
| 3729 | 3727 | /* profiling */ |
| 3730 | int total_samples; | |
| 3728 | UINT64 total_samples; | |
| 3729 | UINT64 total_stream_updates; | |
| 3731 | 3730 | }; |
| 3732 | 3731 | |
| 3733 | 3732 | |
| r5613 | r5614 | |
| 4080 | 4079 | #error "DISCRETE_MAX_OUTPUTS != 8" |
| 4081 | 4080 | #endif |
| 4082 | 4081 | |
| 4082 | #define NODE_BLOCKINDEX(_node) NODE_INDEX((_node)->block->node) | |
| 4083 | ||
| 4083 | 4084 | #define NODE_RELATIVE(_x, _y) (NODE(NODE_INDEX(_x) + (_y))) |
| 4084 | 4085 | |
| 4085 | 4086 | #define NODE_NC NODE_00 |
| r5613 | r5614 | |
| 4117 | 4118 | DSS_INPUT_NOT, /* Input node */ |
| 4118 | 4119 | DSS_INPUT_PULSE, /* Input node, single pulsed version */ |
| 4119 | 4120 | DSS_INPUT_STREAM, /* Stream Input */ |
| 4121 | DSS_INPUT_BUFFER, /* Buffer Input node, for high freq inputs like DAC */ | |
| 4120 | 4122 | |
| 4121 | 4123 | /* from disc_wav.c */ |
| 4122 | 4124 | /* generic modules */ |
| r5613 | r5614 | |
| 4256 | 4258 | #define DISCRETE_INPUT_NOT(NODE) { NODE, DSS_INPUT_NOT , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,0 }, NULL, "DISCRETE_INPUT_NOT" }, |
| 4257 | 4259 | #define DISCRETE_INPUTX_NOT(NODE,GAIN,OFFSET,INIT) { NODE, DSS_INPUT_NOT , 3, { NODE_NC,NODE_NC,NODE_NC }, { GAIN,OFFSET,INIT }, NULL, "DISCRETE_INPUTX_NOT" }, |
| 4258 | 4260 | #define DISCRETE_INPUT_PULSE(NODE,INIT) { NODE, DSS_INPUT_PULSE , 3, { NODE_NC,NODE_NC,NODE_NC }, { 1,0,INIT }, NULL, "DISCRETE_INPUT_PULSE" }, |
| 4261 | ||
| 4259 | 4262 | #define DISCRETE_INPUT_STREAM(NODE, NUM) { NODE, DSS_INPUT_STREAM, 3, { NUM,NODE_NC,NODE_NC }, { NUM,1,0 }, NULL, "DISCRETE_INPUT_STREAM" }, |
| 4260 | 4263 | #define DISCRETE_INPUTX_STREAM(NODE, NUM, GAIN,OFFSET) { NODE, DSS_INPUT_STREAM, 3, { NUM,NODE_NC,NODE_NC }, { NUM,GAIN,OFFSET }, NULL, "DISCRETE_INPUTX_STREAM" }, |
| 4261 | 4264 | |
| 4265 | #define DISCRETE_INPUT_BUFFER(NODE, NUM) { NODE, DSS_INPUT_BUFFER, 3, { NUM,NODE_NC,NODE_NC }, { NUM,1,0 }, NULL, "DISCRETE_INPUT_BUFFER" }, | |
| 4266 | ||
| 4262 | 4267 | /* from disc_wav.c */ |
| 4263 | 4268 | /* generic modules */ |
| 4264 | 4269 | #define DISCRETE_COUNTER(NODE,ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE) { NODE, DSS_COUNTER , 7, { ENAB,RESET,CLK,NODE_NC,DIR,INIT0,NODE_NC }, { ENAB,RESET,CLK,MAX,DIR,INIT0,CLKTYPE }, NULL, "DISCRETE_COUNTER" }, |
| r5613 | r5614 | |
| 4411 | 4416 | |
| 4412 | 4417 | /* parallel tasks */ |
| 4413 | 4418 | |
| 4414 | #define DISCRETE_TASK_START() { NODE_SPECIAL, DSO_TASK_START, 0, { 0 }, { 0 }, NULL, "DISCRETE_TASK_START" }, | |
| 4415 | #define DISCRETE_TASK_END(BNODE1) { NODE_SPECIAL, DSO_TASK_END , 1, { BNODE1 }, { BNODE1 }, NULL, "DISCRETE_TASK_END" }, | |
| 4416 | #define DISCRETE_TASK_END2(BNODE1,BNODE2) { NODE_SPECIAL, DSO_TASK_END , 2, { BNODE1,BNODE2 }, { BNODE1,BNODE2 }, NULL, "DISCRETE_TASK_END2" }, | |
| 4417 | #define DISCRETE_TASK_END3(BNODE1,BNODE2,BNODE3) { NODE_SPECIAL, DSO_TASK_END , 3, { BNODE1,BNODE2,BNODE3 }, { BNODE1,BNODE2,BNODE3 }, NULL, "DISCRETE_TASK_END3" }, | |
| 4418 | #define DISCRETE_TASK_END4(BNODE1,BNODE2,BNODE3,BNODE4) { NODE_SPECIAL, DSO_TASK_END , 4, { BNODE1,BNODE2,BNODE3,BNODE4 }, { BNODE1,BNODE2,BNODE3,BNODE4 }, NULL, "DISCRETE_TASK_END4" }, | |
| 4419 | #define DISCRETE_TASK_END5(BNODE1,BNODE2,BNODE3,BNODE4,BNODE5) { NODE_SPECIAL, DSO_TASK_END , 5, { BNODE1,BNODE2,BNODE3,BNODE4,BNODE5 }, { BNODE1,BNODE2,BNODE3,BNODE4,BNODE5 }, NULL, "DISCRETE_TASK_END5" }, | |
| 4419 | #define DISCRETE_TASK_START() { NODE_SPECIAL, DSO_TASK_START,0, { 0 }, { 0 }, NULL, "DISCRETE_TASK_START" }, | |
| 4420 | #define DISCRETE_TASK_END() { NODE_SPECIAL, DSO_TASK_END , 1, { 0 }, { 0 }, NULL, "DISCRETE_TASK_END" }, | |
| 4420 | 4421 | //#define DISCRETE_TASK_SYNC() { NODE_SPECIAL, DSO_TASK_SYNC, 0, { 0 }, { 0 }, NULL, "DISCRETE_TASK_SYNC" }, |
| 4421 | 4422 | |
| 4422 | 4423 | /* output */ |
| r5613 | r5614 | |
|---|---|---|
| 255 | 255 | context->t_rc_bleed = DSD_555_ASTBL_T_RC_BLEED; |
| 256 | 256 | context->t_rc_charge = DSD_555_ASTBL_T_RC_CHARGE; |
| 257 | 257 | context->t_rc_discharge = DSD_555_ASTBL_T_RC_DISCHARGE; |
| 258 | context->exp_bleed = RC_CHARGE_EXP(context->t_rc_bleed); | |
| 259 | context->exp_charge = RC_CHARGE_EXP(context->t_rc_charge); | |
| 260 | context->exp_discharge = RC_CHARGE_EXP(context->t_rc_discharge); | |
| 258 | context->exp_bleed = RC_CHARGE_EXP(node, context->t_rc_bleed); | |
| 259 | context->exp_charge = RC_CHARGE_EXP(node, context->t_rc_charge); | |
| 260 | context->exp_discharge = RC_CHARGE_EXP(node, context->t_rc_discharge); | |
| 261 | 261 | context->last_r1 = DSD_555_ASTBL__R1; |
| 262 | 262 | context->last_r2 = DSD_555_ASTBL__R2; |
| 263 | 263 | context->last_c = DSD_555_ASTBL__C; |
| r5613 | r5614 | |
| 418 | 418 | else |
| 419 | 419 | { |
| 420 | 420 | context->t_rc_bleed = DSD_555_ASTBL_T_RC_BLEED; |
| 421 | context->exp_bleed = RC_CHARGE_EXP(context->t_rc_bleed); | |
| 421 | context->exp_bleed = RC_CHARGE_EXP(node, context->t_rc_bleed); | |
| 422 | 422 | context->t_rc_charge = DSD_555_ASTBL_T_RC_CHARGE; |
| 423 | context->exp_charge = RC_CHARGE_EXP(context->t_rc_charge); | |
| 423 | context->exp_charge = RC_CHARGE_EXP(node, context->t_rc_charge); | |
| 424 | 424 | context->t_rc_discharge = DSD_555_ASTBL_T_RC_DISCHARGE; |
| 425 | context->exp_discharge = RC_CHARGE_EXP(context->t_rc_discharge); | |
| 425 | context->exp_discharge = RC_CHARGE_EXP(node, context->t_rc_discharge); | |
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | context->output_is_ac = info->options & DISC_555_OUT_AC; |
| r5613 | r5614 | |
| 506 | 506 | else |
| 507 | 507 | { |
| 508 | 508 | /* Charging */ |
| 509 | v_cap_next = v_cap + ((info->v_pos - v_cap) * RC_CHARGE_EXP(DSD_555_MSTBL__R * DSD_555_MSTBL__C)); | |
| 509 | v_cap_next = v_cap + ((info->v_pos - v_cap) * RC_CHARGE_EXP(node, DSD_555_MSTBL__R * DSD_555_MSTBL__C)); | |
| 510 | 510 | |
| 511 | 511 | /* Has it charged past upper limit? */ |
| 512 | 512 | /* If trigger is still enabled, then we keep charging, |
| r5613 | r5614 | |
| 548 | 548 | context->output_type = info->options & DISC_555_OUT_MASK; |
| 549 | 549 | if ((context->output_type == DISC_555_OUT_COUNT_F) || (context->output_type == DISC_555_OUT_COUNT_R)) |
| 550 | 550 | { |
| 551 | discrete_log(node->info, "Invalid Output type in NODE_%d.\n", | |
| 551 | discrete_log(node->info, "Invalid Output type in NODE_%d.\n", | |
| 552 | 552 | context->output_type = DISC_555_OUT_SQW; |
| 553 | 553 | } |
| 554 | 554 | |
| r5613 | r5614 | |
| 994 | 994 | break; |
| 995 | 995 | } |
| 996 | 996 | |
| 997 | context->exp_bleed = RC_CHARGE_EXP(DSD_555_CC_T_RC_BLEED); | |
| 997 | context->exp_bleed = RC_CHARGE_EXP(node, DSD_555_CC_T_RC_BLEED); | |
| 998 | 998 | context->t_rc_discharge_01 = DSD_555_CC_T_RC_DISCHARGE_01; |
| 999 | context->exp_discharge_01 = RC_CHARGE_EXP(context->t_rc_discharge_01); | |
| 999 | context->exp_discharge_01 = RC_CHARGE_EXP(node, context->t_rc_discharge_01); | |
| 1000 | 1000 | context->t_rc_discharge_no_i = DSD_555_CC_T_RC_DISCHARGE_NO_I; |
| 1001 | context->exp_discharge_no_i = RC_CHARGE_EXP(context->t_rc_discharge_no_i); | |
| 1001 | context->exp_discharge_no_i = RC_CHARGE_EXP(node, context->t_rc_discharge_no_i); | |
| 1002 | 1002 | context->t_rc_charge = DSD_555_CC_T_RC_CHARGE; |
| 1003 | context->exp_charge = RC_CHARGE_EXP(context->t_rc_charge); | |
| 1003 | context->exp_charge = RC_CHARGE_EXP(node, context->t_rc_charge); | |
| 1004 | 1004 | context->t_rc_discharge = DSD_555_CC_T_RC_DISCHARGE; |
| 1005 | context->exp_discharge = RC_CHARGE_EXP(context->t_rc_discharge); | |
| 1005 | context->exp_discharge = RC_CHARGE_EXP(node, context->t_rc_discharge); | |
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | /* Step to set the output */ |
| r5613 | r5614 | |
| 1522 | 1522 | context->error = 0; |
| 1523 | 1523 | if (info->v_neg >= info->v_pos) |
| 1524 | 1524 | { |
| 1525 | logerror("[v_neg >= v_pos] - NODE_%d DISABLED!\n", | |
| 1525 | logerror("[v_neg >= v_pos] - NODE_%d DISABLED!\n", | |
| 1526 | 1526 | context->error = 1; |
| 1527 | 1527 | return; |
| 1528 | 1528 | } |
| r5613 | r5614 | |
|---|---|---|
| 500 | 500 | context->out_lfsr_reg = (lfsr_desc->flags & DISC_LFSR_FLAG_OUTPUT_SR_SN1) ? 1 : 0; |
| 501 | 501 | |
| 502 | 502 | if ((lfsr_desc->clock_type < DISC_CLK_ON_F_EDGE) || (lfsr_desc->clock_type > DISC_CLK_IS_FREQ)) |
| 503 | discrete_log(node->info, "Invalid clock type passed in NODE_%d\n", NODE_INDEX( | |
| 503 | discrete_log(node->info, "Invalid clock type passed in NODE_%d\n", NODE_BLOCKINDEX( | |
| 504 | 504 | |
| 505 | 505 | context->last = (DSS_COUNTER__CLOCK != 0); |
| 506 | 506 | if (lfsr_desc->clock_type == DISC_CLK_IS_FREQ) context->t_clock = 1.0 / DSS_LFSR_NOISE__CLOCK; |
| r5613 | r5614 | |
| 1207 | 1207 | * So use this for the RC charge constant. */ |
| 1208 | 1208 | rSource = 1.0 / ((1.0 / info->rIn) + (1.0 / info->rFeedback)); |
| 1209 | 1209 | context->rc = rSource * info->c; |
| 1210 | context->exponent = RC_CHARGE_EXP(context->rc); | |
| 1210 | context->exponent = RC_CHARGE_EXP(node, context->rc); | |
| 1211 | 1211 | |
| 1212 | 1212 | /* Cap is at 0V on power up. Causing output to be high. */ |
| 1213 | 1213 | context->v_cap = 0; |
| r5613 | r5614 | |
| 1508 | 1508 | #define DSS_INVERTER_OSC__C DISCRETE_INPUT(4) |
| 1509 | 1509 | #define DSS_INVERTER_OSC__R2 DISCRETE_INPUT(5) |
| 1510 | 1510 | |
| 1511 | INLINE double dss_inverter_tftab(node_description *node, double x) | |
| 1511 | INLINE double dss_inverter_tftab(const node_description *node, double x) | |
| 1512 | 1512 | { |
| 1513 | 1513 | const discrete_inverter_osc_desc *info = (const discrete_inverter_osc_desc *)node->custom; |
| 1514 | 1514 | struct dss_inverter_osc_context *context = (struct dss_inverter_osc_context *)node->context; |
| r5613 | r5614 | |
| 1520 | 1520 | return info->vB; |
| 1521 | 1521 | } |
| 1522 | 1522 | |
| 1523 | INLINE double dss_inverter_tf(node_description *node, double x) | |
| 1523 | INLINE double dss_inverter_tf(const node_description *node, double x) | |
| 1524 | 1524 | { |
| 1525 | 1525 | const discrete_inverter_osc_desc *info = (const discrete_inverter_osc_desc *)node->custom; |
| 1526 | 1526 | struct dss_inverter_osc_context *context = (struct dss_inverter_osc_context *)node->context; |
| r5613 | r5614 | |
| 1569 | 1569 | vG2 = dss_inverter_tf(node,vG3); |
| 1570 | 1570 | break; |
| 1571 | 1571 | default: |
| 1572 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1572 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1573 | 1573 | } |
| 1574 | 1574 | switch (info->options & DISC_OSC_INVERTER_TYPE_MASK) |
| 1575 | 1575 | { |
| r5613 | r5614 | |
| 1628 | 1628 | diff = diff - diff * exp(-node->info->sample_time/(context->c * rMix)); |
| 1629 | 1629 | break; |
| 1630 | 1630 | default: |
| 1631 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1631 | fatalerror("DISCRETE_INVERTER_OSC - Wrong type on NODE_%02d", | |
| 1632 | 1632 | } |
| 1633 | 1633 | context->v_cap += diff; |
| 1634 | 1634 | context->v_g2_old = vG2; |
| r5613 | r5614 | |
|---|---|---|
| 78 | 78 | $(SOUNDOBJ)/discrete.o: $(SOUNDSRC)/discrete.c \ |
| 79 | 79 | $(SOUNDSRC)/discrete.h \ |
| 80 | 80 | $(SOUNDSRC)/disc_dev.c \ |
| 81 | $(SOUNDSRC)/disc_sys.c \ | |
| 81 | 82 | $(SOUNDSRC)/disc_flt.c \ |
| 82 | 83 | $(SOUNDSRC)/disc_inp.c \ |
| 83 | 84 | $(SOUNDSRC)/disc_mth.c \ |
| r5613 | r5614 | |
|---|---|---|
| 107 | 107 | double exp0; /* fast case bit 0 */ |
| 108 | 108 | double exp1; /* fast case bit 1 */ |
| 109 | 109 | double factor; /* fast case */ |
| 110 | double f1[16]; | |
| 111 | double f2[16]; | |
| 110 | 112 | }; |
| 111 | 113 | |
| 112 | 114 | struct dst_rcintegrate_context |
| r5613 | r5614 | |
| 160 | 162 | { |
| 161 | 163 | struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context; |
| 162 | 164 | |
| 163 | context->exponent = RC_CHARGE_EXP(DST_CRFILTER__R * DST_CRFILTER__C); | |
| 165 | context->exponent = RC_CHARGE_EXP(node, DST_CRFILTER__R * DST_CRFILTER__C); | |
| 164 | 166 | context->vCap = 0; |
| 165 | 167 | node->output[0] = DST_CRFILTER__IN; |
| 166 | 168 | } |
| r5613 | r5614 | |
| 489 | 491 | { |
| 490 | 492 | case DISC_OP_AMP_FILTER_IS_LOW_PASS_1: |
| 491 | 493 | case DISC_OP_AMP_FILTER_IS_LOW_PASS_1M: |
| 492 | context->exponentC1 = RC_CHARGE_EXP(info->rF * info->c1); | |
| 494 | context->exponentC1 = RC_CHARGE_EXP(node, info->rF * info->c1); | |
| 493 | 495 | context->exponentC2 = 0; |
| 494 | 496 | break; |
| 495 | 497 | case DISC_OP_AMP_FILTER_IS_HIGH_PASS_1: |
| 496 | context->exponentC1 = RC_CHARGE_EXP(context->rTotal * info->c1); | |
| 498 | context->exponentC1 = RC_CHARGE_EXP(node, context->rTotal * info->c1); | |
| 497 | 499 | context->exponentC2 = 0; |
| 498 | 500 | break; |
| 499 | 501 | case DISC_OP_AMP_FILTER_IS_BAND_PASS_1: |
| 500 | context->exponentC1 = RC_CHARGE_EXP(info->rF * info->c1); | |
| 501 | context->exponentC2 = RC_CHARGE_EXP(context->rTotal * info->c2); | |
| 502 | context->exponentC1 = RC_CHARGE_EXP(node, info->rF * info->c1); | |
| 503 | context->exponentC2 = RC_CHARGE_EXP(node, context->rTotal * info->c2); | |
| 502 | 504 | break; |
| 503 | 505 | case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M | DISC_OP_AMP_IS_NORTON: |
| 504 | 506 | context->rTotal = 1.0 / (1.0 / info->r1 + 1.0 / info->r2); |
| r5613 | r5614 | |
| 523 | 525 | break; |
| 524 | 526 | } |
| 525 | 527 | case DISC_OP_AMP_FILTER_IS_BAND_PASS_0 | DISC_OP_AMP_IS_NORTON: |
| 526 | context->exponentC1 = RC_CHARGE_EXP(RES_2_PARALLEL(info->r1, info->r2 + info->r3 + info->r4) * info->c1); | |
| 527 | context->exponentC2 = RC_CHARGE_EXP(RES_2_PARALLEL(info->r1 + info->r2, info->r3 + info->r4) * info->c2); | |
| 528 | context->exponentC3 = RC_CHARGE_EXP((info->r1 + info->r2 + info->r3 + info->r4) * info->c3); | |
| 528 | context->exponentC1 = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r1, info->r2 + info->r3 + info->r4) * info->c1); | |
| 529 | context->exponentC2 = RC_CHARGE_EXP(node, RES_2_PARALLEL(info->r1 + info->r2, info->r3 + info->r4) * info->c2); | |
| 530 | context->exponentC3 = RC_CHARGE_EXP(node, (info->r1 + info->r2 + info->r3 + info->r4) * info->c3); | |
| 529 | 531 | break; |
| 530 | 532 | case DISC_OP_AMP_FILTER_IS_HIGH_PASS_0 | DISC_OP_AMP_IS_NORTON: |
| 531 | context->exponentC1 = RC_CHARGE_EXP(info->r1 * info->c1); | |
| 533 | context->exponentC1 = RC_CHARGE_EXP(node, info->r1 * info->c1); | |
| 532 | 534 | break; |
| 533 | 535 | } |
| 534 | 536 | |
| r5613 | r5614 | |
| 639 | 641 | |
| 640 | 642 | context->state = 0; |
| 641 | 643 | context->t = 0; |
| 642 | context->exponent0 = RC_DISCHARGE_EXP(DST_RCDISC2__R0 * DST_RCDISC2__C); | |
| 643 | context->exponent1 = RC_DISCHARGE_EXP(DST_RCDISC2__R1 * DST_RCDISC2__C); | |
| 644 | context->exponent0 = RC_DISCHARGE_EXP(node, DST_RCDISC2__R0 * DST_RCDISC2__C); | |
| 645 | context->exponent1 = RC_DISCHARGE_EXP(node, DST_RCDISC2__R1 * DST_RCDISC2__C); | |
| 644 | 646 | } |
| 645 | 647 | |
| 646 | 648 | /************************************************************************ |
| r5613 | r5614 | |
| 661 | 663 | #define DST_RCDISC3__R1 DISCRETE_INPUT(2) |
| 662 | 664 | #define DST_RCDISC3__R2 DISCRETE_INPUT(3) |
| 663 | 665 | #define DST_RCDISC3__C DISCRETE_INPUT(4) |
| 664 | #define DST_RCDISC3__DJV DISCRETE_INPUT( | |
| 666 | #define DST_RCDISC3__DJV DISCRETE_INPUT(5) | |
| 665 | 667 | |
| 666 | 668 | static DISCRETE_STEP(dst_rcdisc3) |
| 667 | 669 | { |
| r5613 | r5614 | |
| 676 | 678 | diff = DST_RCDISC3__IN - node->output[0]; |
| 677 | 679 | if (context->v_diode > 0) |
| 678 | 680 | { |
| 679 | if | |
| 681 | if | |
| 680 | 682 | { |
| 681 | diff = diff - (diff * context->exponent0); | |
| 682 | } else if( diff < 0) | |
| 683 | diff = diff * context->exponent0; | |
| 684 | } | |
| 685 | else if (diff < -context->v_diode) | |
| 683 | 686 | { |
| 684 | if(diff < -context->v_diode) | |
| 685 | diff = diff - (diff * context->exponent1); | |
| 686 | else | |
| 687 | diff = diff - (diff * context->exponent0); | |
| 687 | diff = diff * context->exponent1; | |
| 688 | 688 | } |
| 689 | else | |
| 690 | { | |
| 691 | diff = diff * context->exponent0; | |
| 692 | } | |
| 689 | 693 | } |
| 690 | 694 | else |
| 691 | 695 | { |
| 692 | if | |
| 696 | if | |
| 693 | 697 | { |
| 694 | diff = diff - (diff * context->exponent0); | |
| 695 | } else if( diff > 0) | |
| 698 | diff = diff * context->exponent0; | |
| 699 | } | |
| 700 | else if (diff > -context->v_diode) | |
| 696 | 701 | { |
| 697 | if(diff > -context->v_diode) | |
| 698 | diff = diff - (diff * context->exponent1); | |
| 699 | else | |
| 700 | diff = diff - (diff * context->exponent0); | |
| 702 | diff = diff * context->exponent1; | |
| 701 | 703 | } |
| 704 | else | |
| 705 | { | |
| 706 | diff = diff * context->exponent0; | |
| 707 | } | |
| 702 | 708 | } |
| 703 | 709 | node->output[0] += diff; |
| 704 | 710 | } |
| r5613 | r5614 | |
| 717 | 723 | context->state = 0; |
| 718 | 724 | context->t = 0; |
| 719 | 725 | context->v_diode = DST_RCDISC3__DJV; |
| 720 | context->exponent0 = RC_CHARGE_EXP(DST_RCDISC3__R1 * DST_RCDISC3__C); | |
| 721 | context->exponent1 = RC_CHARGE_EXP(RES_2_PARALLEL(DST_RCDISC3__R1, DST_RCDISC3__R2) * DST_RCDISC3__C); | |
| 726 | context->exponent0 = RC_CHARGE_EXP(node, DST_RCDISC3__R1 * DST_RCDISC3__C); | |
| 727 | context->exponent1 = RC_CHARGE_EXP(node, RES_2_PARALLEL(DST_RCDISC3__R1, DST_RCDISC3__R2) * DST_RCDISC3__C); | |
| 722 | 728 | } |
| 723 | 729 | |
| 724 | 730 | |
| r5613 | r5614 | |
| 780 | 786 | /* some error checking. */ |
| 781 | 787 | if (DST_RCDISC4__R1 <= 0 || DST_RCDISC4__R2 <= 0 || DST_RCDISC4__C1 <= 0 || (DST_RCDISC4__R3 <= 0 && context->type == 1)) |
| 782 | 788 | { |
| 783 | discrete_log(node->info, "Invalid component values in NODE_%d.\n", | |
| 789 | discrete_log(node->info, "Invalid component values in NODE_%d.\n", | |
| 784 | 790 | return; |
| 785 | 791 | } |
| 786 | 792 | if (DST_RCDISC4__VP < 3) |
| 787 | 793 | { |
| 788 | discrete_log(node->info, "vP must be >= 3V in NODE_%d.\n", | |
| 794 | discrete_log(node->info, "vP must be >= 3V in NODE_%d.\n", | |
| 789 | 795 | return; |
| 790 | 796 | } |
| 791 | 797 | if (DST_RCDISC4__TYPE < 1 || DST_RCDISC4__TYPE > 3) |
| 792 | 798 | { |
| 793 | discrete_log(node->info, "Invalid circuit type in NODE_%d.\n", | |
| 799 | discrete_log(node->info, "Invalid circuit type in NODE_%d.\n", | |
| 794 | 800 | return; |
| 795 | 801 | } |
| 796 | 802 | |
| r5613 | r5614 | |
| 814 | 820 | i = v / rT; |
| 815 | 821 | context->v[1] = i * r + .5; |
| 816 | 822 | rT = RES_2_PARALLEL(DST_RCDISC4__R2, r); |
| 817 | context->exp[1] = RC_CHARGE_EXP(rT * DST_RCDISC4__C1); | |
| 823 | context->exp[1] = RC_CHARGE_EXP(node, rT * DST_RCDISC4__C1); | |
| 818 | 824 | |
| 819 | 825 | /* When the input is 0, R1 is out of circuit. */ |
| 820 | 826 | rT = DST_RCDISC4__R2 + DST_RCDISC4__R3; |
| 821 | 827 | i = v / rT; |
| 822 | 828 | context->v[0] = i * DST_RCDISC4__R3 + .5; |
| 823 | 829 | rT = RES_2_PARALLEL(DST_RCDISC4__R2, DST_RCDISC4__R3); |
| 824 | context->exp[0] = RC_CHARGE_EXP(rT * DST_RCDISC4__C1); | |
| 830 | context->exp[0] = RC_CHARGE_EXP(node, rT * DST_RCDISC4__C1); | |
| 825 | 831 | break; |
| 826 | 832 | |
| 827 | 833 | case 3: |
| r5613 | r5614 | |
| 832 | 838 | r = 500.0 + DST_RCDISC4__R1; |
| 833 | 839 | context->v[1] = RES_VOLTAGE_DIVIDER(r, DST_RCDISC4__R2) * (5.0 - 0.5); |
| 834 | 840 | rT = RES_2_PARALLEL(r, DST_RCDISC4__R2); |
| 835 | context->exp[1] = RC_CHARGE_EXP(rT * DST_RCDISC4__C1); | |
| 841 | context->exp[1] = RC_CHARGE_EXP(node, rT * DST_RCDISC4__C1); | |
| 836 | 842 | |
| 837 | 843 | /* When the input is 0, R1 is out of circuit. */ |
| 838 | 844 | context->v[0] = 0; |
| 839 | context->exp[0] = RC_CHARGE_EXP(DST_RCDISC4__R2 * DST_RCDISC4__C1); | |
| 845 | context->exp[0] = RC_CHARGE_EXP(node, DST_RCDISC4__R2 * DST_RCDISC4__C1); | |
| 840 | 846 | break; |
| 841 | 847 | } |
| 842 | 848 | } |
| r5613 | r5614 | |
| 896 | 902 | context->state = 0; |
| 897 | 903 | context->t = 0; |
| 898 | 904 | context->v_cap = 0; |
| 899 | context->exponent0 = RC_CHARGE_EXP(DST_RCDISC5__R * DST_RCDISC5__C); | |
| 905 | context->exponent0 = RC_CHARGE_EXP(node, DST_RCDISC5__R * DST_RCDISC5__C); | |
| 900 | 906 | } |
| 901 | 907 | |
| 902 | 908 | |
| r5613 | r5614 | |
| 969 | 975 | /* DST_RCDISC_MOD__IN1 <= 0.5 */ |
| 970 | 976 | rc[0] = DST_RCDISC_MOD__R1 + DST_RCDISC_MOD__R2; |
| 971 | 977 | if (rc[0] < 1) rc[0] = 1; |
| 972 | context->exp_low[0] = RC_DISCHARGE_EXP(DST_RCDISC_MOD__C * rc[0]); | |
| 978 | context->exp_low[0] = RC_DISCHARGE_EXP(node, DST_RCDISC_MOD__C * rc[0]); | |
| 973 | 979 | context->gain[0] = RES_VOLTAGE_DIVIDER(rc[0], DST_RCDISC_MOD__R4); |
| 974 | 980 | /* DST_RCDISC_MOD__IN1 > 0.5 */ |
| 975 | 981 | rc[1] = DST_RCDISC_MOD__R2; |
| 976 | 982 | if (rc[1] < 1) rc[1] = 1; |
| 977 | context->exp_low[1] = RC_DISCHARGE_EXP(DST_RCDISC_MOD__C * rc[1]); | |
| 983 | context->exp_low[1] = RC_DISCHARGE_EXP(node, DST_RCDISC_MOD__C * rc[1]); | |
| 978 | 984 | context->gain[1] = RES_VOLTAGE_DIVIDER(rc[1], DST_RCDISC_MOD__R4); |
| 979 | 985 | /* DST_RCDISC_MOD__IN2 <= 0.6 */ |
| 980 | 986 | rc2[0] = DST_RCDISC_MOD__R4; |
| 981 | 987 | /* DST_RCDISC_MOD__IN2 > 0.6 */ |
| 982 | 988 | rc2[1] = RES_2_PARALLEL(DST_RCDISC_MOD__R3, DST_RCDISC_MOD__R4); |
| 983 | 989 | /* DST_RCDISC_MOD__IN1 <= 0.5 && DST_RCDISC_MOD__IN2 <= 0.6 */ |
| 984 | context->exp_high[0] = RC_DISCHARGE_EXP(DST_RCDISC_MOD__C * (rc[0] + rc2[0])); | |
| 990 | context->exp_high[0] = RC_DISCHARGE_EXP(node, DST_RCDISC_MOD__C * (rc[0] + rc2[0])); | |
| 985 | 991 | context->vd_gain[0] = RES_VOLTAGE_DIVIDER(rc[0], rc2[0]); |
| 986 | 992 | /* DST_RCDISC_MOD__IN1 > 0.5 && DST_RCDISC_MOD__IN2 <= 0.6 */ |
| 987 | context->exp_high[1] = RC_DISCHARGE_EXP(DST_RCDISC_MOD__C * (rc[1] + rc2[0])); | |
| 993 | context->exp_high[1] = RC_DISCHARGE_EXP(node, DST_RCDISC_MOD__C * (rc[1] + rc2[0])); | |
| 988 | 994 | context->vd_gain[1] = RES_VOLTAGE_DIVIDER(rc[1], rc2[0]); |
| 989 | 995 | /* DST_RCDISC_MOD__IN1 <= 0.5 && DST_RCDISC_MOD__IN2 > 0.6 */ |
| 990 | context->exp_high[2] = RC_DISCHARGE_EXP(DST_RCDISC_MOD__C * (rc[0] + rc2[1])); | |
| 996 | context->exp_high[2] = RC_DISCHARGE_EXP(node, DST_RCDISC_MOD__C * (rc[0] + rc2[1])); | |
| 991 | 997 | context->vd_gain[2] = RES_VOLTAGE_DIVIDER(rc[0], rc2[1]); |
| 992 | 998 | /* DST_RCDISC_MOD__IN1 > 0.5 && DST_RCDISC_MOD__IN2 > 0.6 */ |
| 993 | context->exp_high[3] = RC_DISCHARGE_EXP(DST_RCDISC_MOD__C * (rc[1] + rc2[1])); | |
| 999 | context->exp_high[3] = RC_DISCHARGE_EXP(node, DST_RCDISC_MOD__C * (rc[1] + rc2[1])); | |
| 994 | 1000 | context->vd_gain[3] = RES_VOLTAGE_DIVIDER(rc[1], rc2[1]); |
| 995 | 1001 | |
| 996 | 1002 | context->v_cap = 0; |
| r5613 | r5614 | |
| 1037 | 1043 | { |
| 1038 | 1044 | struct dst_rcfilter_context *context = (struct dst_rcfilter_context *)node->context; |
| 1039 | 1045 | |
| 1040 | context->exponent = RC_CHARGE_EXP(DST_RCFILTER__R * DST_RCFILTER__C); | |
| 1046 | context->exponent = RC_CHARGE_EXP(node, DST_RCFILTER__R * DST_RCFILTER__C); | |
| 1041 | 1047 | context->vCap = 0; |
| 1042 | 1048 | node->output[0] = 0; |
| 1043 | 1049 | } |
| r5613 | r5614 | |
| 1059 | 1065 | #define DST_RCFILTER_SW__R DISCRETE_INPUT(3) |
| 1060 | 1066 | #define DST_RCFILTER_SW__C(x) DISCRETE_INPUT(4+x) |
| 1061 | 1067 | |
| 1062 | #define CD4066_ON_RES 270 | |
| 1063 | #define DST_RCFILTER_SW_ITERATIONS (10) | |
| 1068 | /* 74HC4066 : 15 | |
| 1069 | * 74VHC4066 : 15 | |
| 1070 | * UTC4066 : 270 @ 5VCC, 80 @ 15VCC | |
| 1071 | * CD4066BC : 270 (Fairchild) | |
| 1072 | * | |
| 1073 | * The choice below makes scramble sound about "right". For future error reports, | |
| 1074 | * we need the exact type of switch and at which voltage (5, 12?) it is operated. | |
| 1075 | */ | |
| 1076 | #define CD4066_ON_RES (40) | |
| 1064 | 1077 | |
| 1065 | 1078 | // FIXME: This needs optimization ! |
| 1066 | 1079 | static DISCRETE_STEP(dst_rcfilter_sw) |
| 1067 | 1080 | { |
| 1068 | 1081 | struct dst_rcfilter_sw_context *context = (struct dst_rcfilter_sw_context *)node->context; |
| 1069 | 1082 | |
| 1070 | int i | |
| 1083 | int i | |
| 1071 | 1084 | int bits = (int)DST_RCFILTER_SW__SWITCH; |
| 1072 | double us = 0, rs = 0; | |
| 1073 | double vd; | |
| 1074 | double rt; | |
| 1085 | double us = 0; | |
| 1075 | 1086 | |
| 1076 | 1087 | if (DST_RCFILTER_SW__ENABLE) |
| 1077 | 1088 | { |
| r5613 | r5614 | |
| 1088 | 1099 | context->vCap[1] += (DST_RCFILTER_SW__VIN - context->vCap[1]) * context->exp1; |
| 1089 | 1100 | node->output[0] = context->vCap[1] + (DST_RCFILTER_SW__VIN - context->vCap[1]) * context->factor; |
| 1090 | 1101 | break; |
| 1091 | case 3: | |
| 1092 | rs = 2 * DST_RCFILTER_SW__R; | |
| 1093 | vd = RES_VOLTAGE_DIVIDER(rs, CD4066_ON_RES) * DST_RCFILTER_SW__VIN; | |
| 1094 | rt = DST_RCFILTER_SW__R / (CD4066_ON_RES + rs); | |
| 1095 | ||
| 1096 | for (j = 0; j < DST_RCFILTER_SW_ITERATIONS; j++) | |
| 1097 | { | |
| 1098 | node->output[0] = vd + rt * (context->vCap[0] + context->vCap[1]); | |
| 1099 | context->vCap[0] += (node->output[0] - context->vCap[0]) * context->exp[0]; | |
| 1100 | context->vCap[1] += (node->output[0] - context->vCap[1]) * context->exp[1]; | |
| 1101 | } | |
| 1102 | break; | |
| 1103 | 1102 | default: |
| 1104 | rs = 0; | |
| 1105 | ||
| 1106 | 1103 | for (i = 0; i < 4; i++) |
| 1107 | 1104 | { |
| 1108 | 1105 | if (( bits & (1 << i)) != 0) |
| 1109 | { | |
| 1110 | rs += DST_RCFILTER_SW__R; | |
| 1111 | } | |
| 1106 | us += context->vCap[i]; | |
| 1112 | 1107 | } |
| 1113 | ||
| 1114 | vd = RES_VOLTAGE_DIVIDER(rs, CD4066_ON_RES) * DST_RCFILTER_SW__VIN; | |
| 1115 | rt = DST_RCFILTER_SW__R / (CD4066_ON_RES + rs); | |
| 1116 | ||
| 1117 | for (j = 0; j < DST_RCFILTER_SW_ITERATIONS; j++) | |
| 1108 | node->output[0] = context->f1[bits] * DST_RCFILTER_SW__VIN + context->f2[bits] * us; | |
| 1109 | for (i = 0; i < 4; i++) | |
| 1118 | 1110 | { |
| 1119 | us = 0; | |
| 1120 | for (i = 0; i < 4; i++) | |
| 1121 | { | |
| 1122 | if (( bits & (1 << i)) != 0) | |
| 1123 | { | |
| 1124 | us += context->vCap[i]; | |
| 1125 | } | |
| 1126 | } | |
| 1127 | node->output[0] = vd + rt * us; | |
| 1128 | for (i = 0; i < 4; i++) | |
| 1129 | { | |
| 1130 | if (( bits & (1 << i)) != 0) | |
| 1131 | { | |
| 1132 | context->vCap[i] += (node->output[0] - context->vCap[i]) * context->exp[i]; | |
| 1133 | } | |
| 1134 | } | |
| 1111 | if (( bits & (1 << i)) != 0) | |
| 1112 | context->vCap[i] += (node->output[0] - context->vCap[i]) * context->exp[i]; | |
| 1135 | 1113 | } |
| 1136 | 1114 | } |
| 1137 | 1115 | } |
| r5613 | r5614 | |
| 1145 | 1123 | { |
| 1146 | 1124 | struct dst_rcfilter_sw_context *context = (struct dst_rcfilter_sw_context *)node->context; |
| 1147 | 1125 | |
| 1148 | int i; | |
| 1126 | int i, bits; | |
| 1149 | 1127 | |
| 1150 | 1128 | for (i = 0; i < 4; i++) |
| 1151 | 1129 | { |
| 1152 | 1130 | context->vCap[i] = 0; |
| 1153 | context->exp[i] = RC_CHARGE_EXP( | |
| 1131 | context->exp[i] = RC_CHARGE_EXP(n | |
| 1154 | 1132 | } |
| 1133 | ||
| 1134 | for (bits=0; bits < 15; bits++) | |
| 1135 | { | |
| 1136 | double rs = 0; | |
| 1137 | ||
| 1138 | for (i = 0; i < 4; i++) | |
| 1139 | { | |
| 1140 | if (( bits & (1 << i)) != 0) | |
| 1141 | rs += DST_RCFILTER_SW__R; | |
| 1142 | } | |
| 1143 | context->f1[bits] = RES_VOLTAGE_DIVIDER(rs, CD4066_ON_RES); | |
| 1144 | context->f2[bits] = DST_RCFILTER_SW__R / (CD4066_ON_RES + rs); | |
| 1145 | } | |
| 1146 | ||
| 1147 | ||
| 1155 | 1148 | /* fast cases */ |
| 1156 | context->exp0 = RC_CHARGE_EXP((CD4066_ON_RES + DST_RCFILTER_SW__R) * DST_RCFILTER_SW__C(0)); | |
| 1157 | context->exp1 = RC_CHARGE_EXP((CD4066_ON_RES + DST_RCFILTER_SW__R) * DST_RCFILTER_SW__C(1)); | |
| 1149 | context->exp0 = RC_CHARGE_EXP(node, (CD4066_ON_RES + DST_RCFILTER_SW__R) * DST_RCFILTER_SW__C(0)); | |
| 1150 | context->exp1 = RC_CHARGE_EXP(node, (CD4066_ON_RES + DST_RCFILTER_SW__R) * DST_RCFILTER_SW__C(1)); | |
| 1158 | 1151 | context->factor = RES_VOLTAGE_DIVIDER(DST_RCFILTER_SW__R, CD4066_ON_RES); |
| 1152 | ||
| 1159 | 1153 | node->output[0] = 0; |
| 1160 | 1154 | } |
| 1161 | 1155 |
| r5613 | r5614 | |
|---|---|---|
| 1995 | 1995 | #if TEST_MODE |
| 1996 | 1996 | static int recursing = 0; /* we need to prevent recursion since enable_w calls stream_update */ |
| 1997 | 1997 | |
| 1998 | if (input_code_pressed_once(KEYCODE_SPACE) && !recursing) | |
| 1998 | if (input_code_pressed_once(device->machine, KEYCODE_SPACE) && !recursing) | |
| 1999 | 1999 | { |
| 2000 | 2000 | recursing = 1; |
| 2001 | 2001 | |
| 2002 | sound_global_enable(1); | |
| 2002 | sound_global_enable(device->machine, 1); | |
| 2003 | 2003 | SN76477_test_enable_w(sn, !sn->enable); |
| 2004 | 2004 | } |
| 2005 | 2005 |
| r5613 | r5614 | |
|---|---|---|
| 133 | 133 | sequence of switch inputs is "pressed" |
| 134 | 134 | -------------------------------------------------*/ |
| 135 | 135 | |
| 136 | int input_seq_pressed(const input_seq *seq) | |
| 136 | int input_seq_pressed(running_machine *machine, const input_seq *seq) | |
| 137 | 137 | { |
| 138 | 138 | int result = FALSE; |
| 139 | 139 | int invert = FALSE; |
| r5613 | r5614 | |
| 167 | 167 | { |
| 168 | 168 | /* if this is the first in the sequence, result is set equal */ |
| 169 | 169 | if (first) |
| 170 | result = input_code_pressed(code) ^ invert; | |
| 170 | result = input_code_pressed(machine, code) ^ invert; | |
| 171 | 171 | |
| 172 | 172 | /* further values are ANDed */ |
| 173 | 173 | else if (result) |
| 174 | result &= input_code_pressed(code) ^ invert; | |
| 174 | result &= input_code_pressed(machine, code) ^ invert; | |
| 175 | 175 | |
| 176 | 176 | /* no longer first, and clear the invert flag */ |
| 177 | 177 | first = invert = FALSE; |
| r5613 | r5614 | |
| 188 | 188 | axis defined in an input sequence |
| 189 | 189 | -------------------------------------------------*/ |
| 190 | 190 | |
| 191 | INT32 input_seq_axis_value(const input_seq *seq, input_item_class *itemclass_ptr) | |
| 191 | INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr) | |
| 192 | 192 | { |
| 193 | 193 | input_item_class itemclasszero = ITEM_CLASS_ABSOLUTE; |
| 194 | 194 | input_item_class itemclass = ITEM_CLASS_INVALID; |
| r5613 | r5614 | |
| 227 | 227 | { |
| 228 | 228 | /* AND against previous digital codes */ |
| 229 | 229 | if (enable) |
| 230 | enable &= input_code_pressed(code) ^ invert; | |
| 230 | enable &= input_code_pressed(machine, code) ^ invert; | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /* non-switch codes are analog values */ |
| 234 | 234 | else |
| 235 | 235 | { |
| 236 | INT32 value = input_code_value(code); | |
| 236 | INT32 value = input_code_value(machine, code); | |
| 237 | 237 | |
| 238 | 238 | /* if we got a 0 value, don't do anything except remember the first type */ |
| 239 | 239 | if (value == 0) |
| r5613 | r5614 | |
| 279 | 279 | new sequence of the given itemclass |
| 280 | 280 | -------------------------------------------------*/ |
| 281 | 281 | |
| 282 | void input_seq_poll_start(input_item_class itemclass, const input_seq *startseq) | |
| 282 | void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq) | |
| 283 | 283 | { |
| 284 | 284 | input_code dummycode; |
| 285 | 285 | |
| r5613 | r5614 | |
| 300 | 300 | input_seq_append(&record_seq, SEQCODE_OR); |
| 301 | 301 | |
| 302 | 302 | /* flush out any goobers */ |
| 303 | dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(TRUE) : input_code_poll_axes(TRUE); | |
| 303 | dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(machine, TRUE) : input_code_poll_axes(machine, TRUE); | |
| 304 | 304 | while (dummycode != INPUT_CODE_INVALID) |
| 305 | dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(FALSE) : input_code_poll_axes(FALSE); | |
| 305 | dummycode = (record_class == ITEM_CLASS_SWITCH) ? input_code_poll_switches(machine, FALSE) : input_code_poll_axes(machine, FALSE); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | |
| r5613 | r5614 | |
| 310 | 310 | input_seq_poll - continue polling |
| 311 | 311 | -------------------------------------------------*/ |
| 312 | 312 | |
| 313 | int input_seq_poll(input_seq *finalseq) | |
| 313 | int input_seq_poll(running_machine *machine, input_seq *finalseq) | |
| 314 | 314 | { |
| 315 | 315 | input_code lastcode = input_seq_get_last(&record_seq); |
| 316 | 316 | int has_or = FALSE; |
| r5613 | r5614 | |
| 319 | 319 | /* switch case: see if we have a new code to process */ |
| 320 | 320 | if (record_class == ITEM_CLASS_SWITCH) |
| 321 | 321 | { |
| 322 | newcode = input_code_poll_switches(FALSE); | |
| 322 | newcode = input_code_poll_switches(machine, FALSE); | |
| 323 | 323 | if (newcode != INPUT_CODE_INVALID) |
| 324 | 324 | { |
| 325 | 325 | /* if code is duplicate, toggle the NOT state on the code */ |
| r5613 | r5614 | |
| 345 | 345 | lastcode = input_seq_get_last_but_one(&record_seq); |
| 346 | 346 | has_or = TRUE; |
| 347 | 347 | } |
| 348 | newcode = input_code_poll_axes(FALSE); | |
| 348 | newcode = input_code_poll_axes(machine, FALSE); | |
| 349 | 349 | |
| 350 | 350 | /* if the last code doesn't match absolute/relative of this code, ignore the new one */ |
| 351 | 351 | if ((INPUT_CODE_ITEMCLASS(lastcode) == ITEM_CLASS_ABSOLUTE && INPUT_CODE_ITEMCLASS(newcode) != ITEM_CLASS_ABSOLUTE) || |
| r5613 | r5614 | |
| 407 | 407 | of a sequence |
| 408 | 408 | -------------------------------------------------*/ |
| 409 | 409 | |
| 410 | astring *input_seq_name(astring *string, const input_seq *seq) | |
| 410 | astring *input_seq_name(running_machine *machine, astring *string, const input_seq *seq) | |
| 411 | 411 | { |
| 412 | 412 | astring *codestr = astring_alloc(); |
| 413 | 413 | int codenum, copycodenum; |
| r5613 | r5614 | |
| 419 | 419 | input_code code = seq->code[codenum]; |
| 420 | 420 | |
| 421 | 421 | /* if this is a code item which is not valid, don't copy it and remove any preceding ORs/NOTs */ |
| 422 | if (!INPUT_CODE_IS_INTERNAL(code) && astring_len(input_code_name(codestr, code)) == 0) | |
| 422 | if (!INPUT_CODE_IS_INTERNAL(code) && astring_len(input_code_name(machine, codestr, code)) == 0) | |
| 423 | 423 | { |
| 424 | 424 | while (copycodenum > 0 && INPUT_CODE_IS_INTERNAL(seqcopy.code[copycodenum - 1])) |
| 425 | 425 | copycodenum--; |
| r5613 | r5614 | |
| 456 | 456 | |
| 457 | 457 | /* otherwise, assume it is an input code and ask the input system to generate it */ |
| 458 | 458 | else |
| 459 | astring_cat(string, input_code_name(codestr, code)); | |
| 459 | astring_cat(string, input_code_name(machine, codestr, code)); | |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | astring_free(codestr); |
| r5613 | r5614 | |
| 469 | 469 | form of a sequence |
| 470 | 470 | -------------------------------------------------*/ |
| 471 | 471 | |
| 472 | astring *input_seq_to_tokens(astring *string, const input_seq *seq) | |
| 472 | astring *input_seq_to_tokens(running_machine *machine, astring *string, const input_seq *seq) | |
| 473 | 473 | { |
| 474 | 474 | astring *codestr = astring_alloc(); |
| 475 | 475 | int codenum; |
| r5613 | r5614 | |
| 496 | 496 | |
| 497 | 497 | /* otherwise, assume it is an input code and ask the input system to generate it */ |
| 498 | 498 | else |
| 499 | astring_cat(string, input_code_to_token(codestr, code)); | |
| 499 | astring_cat(string, input_code_to_token(machine, codestr, code)); | |
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | astring_free(codestr); |
| r5613 | r5614 | |
| 509 | 509 | form of a sequence |
| 510 | 510 | -------------------------------------------------*/ |
| 511 | 511 | |
| 512 | int input_seq_from_tokens(const char *string, input_seq *seq) | |
| 512 | int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq) | |
| 513 | 513 | { |
| 514 | 514 | char *strcopy = alloc_array_or_die(char, strlen(string) + 1); |
| 515 | 515 | char *str = strcopy; |
| r5613 | r5614 | |
| 551 | 551 | else if (strcmp(str, "DEFAULT") == 0) |
| 552 | 552 | code = SEQCODE_DEFAULT; |
| 553 | 553 | else |
| 554 | code = input_code_from_token(str); | |
| 554 | code = input_code_from_token(machine, str); | |
| 555 | 555 | |
| 556 | 556 | /* translate and add to the sequence */ |
| 557 | 557 | input_seq_append(seq, code); |
| r5613 | r5614 | |
|---|---|---|
| 69 | 69 | /* ----- state queries ----- */ |
| 70 | 70 | |
| 71 | 71 | /* return TRUE if the given switch sequence has been pressed */ |
| 72 | int input_seq_pressed(const input_seq *seq); | |
| 72 | int input_seq_pressed(running_machine *machine, const input_seq *seq); | |
| 73 | 73 | |
| 74 | 74 | /* return the value of an axis sequence */ |
| 75 | INT32 input_seq_axis_value(const input_seq *seq, input_item_class *itemclass_ptr); | |
| 75 | INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr); | |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | /* ----- sequence polling ----- */ |
| 80 | 80 | |
| 81 | 81 | /* begin polling for a new sequence of the given itemclass */ |
| 82 | void input_seq_poll_start(input_item_class itemclass, const input_seq *startseq); | |
| 82 | void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq); | |
| 83 | 83 | |
| 84 | 84 | /* continue polling for a sequence */ |
| 85 | int input_seq_poll(input_seq *finalseq); | |
| 85 | int input_seq_poll(running_machine *machine, input_seq *finalseq); | |
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | /* ----- strings and tokenization ----- */ |
| 90 | 90 | |
| 91 | 91 | /* generate the friendly name of an input sequence */ |
| 92 | astring *input_seq_name(astring *string, const input_seq *seq); | |
| 92 | astring *input_seq_name(running_machine *machine, astring *string, const input_seq *seq); | |
| 93 | 93 | |
| 94 | 94 | /* convert an input sequence to tokens, returning the length */ |
| 95 | astring *input_seq_to_tokens(astring *string, const input_seq *seq); | |
| 95 | astring *input_seq_to_tokens(running_machine *machine, astring *string, const input_seq *seq); | |
| 96 | 96 | |
| 97 | 97 | /* convert a set of tokens back to an input sequence */ |
| 98 | int input_seq_from_tokens(const char *string, input_seq *seq); | |
| 98 | int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq); | |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 |
| r5613 | r5614 | |
|---|---|---|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /* clear the input memory */ |
| 301 | input_code_poll_switches(TRUE); | |
| 302 | while (input_code_poll_switches(FALSE) != INPUT_CODE_INVALID) ; | |
| 301 | input_code_poll_switches(machine, TRUE); | |
| 302 | while (input_code_poll_switches(machine, FALSE) != INPUT_CODE_INVALID) ; | |
| 303 | 303 | |
| 304 | 304 | /* loop while we have a handler */ |
| 305 | 305 | while (ui_handler_callback != handler_ingame && !mame_is_scheduled_event_pending(machine) && !ui_menu_is_force_game_select()) |
| r5613 | r5614 | |
| 1104 | 1104 | ui_draw_text_box(astring_c(messagebox_text), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor); |
| 1105 | 1105 | |
| 1106 | 1106 | /* an 'O' or left joystick kicks us to the next state */ |
| 1107 | if (state == 0 && (input_code_pressed_once(KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT))) | |
| 1107 | if (state == 0 && (input_code_pressed_once(machine, KEYCODE_O) || ui_input_pressed(machine, IPT_UI_LEFT))) | |
| 1108 | 1108 | state++; |
| 1109 | 1109 | |
| 1110 | 1110 | /* a 'K' or right joystick exits the state */ |
| 1111 | else if (state == 1 && (input_code_pressed_once(KEYCODE_K) || ui_input_pressed(machine, IPT_UI_RIGHT))) | |
| 1111 | else if (state == 1 && (input_code_pressed_once(machine, KEYCODE_K) || ui_input_pressed(machine, IPT_UI_RIGHT))) | |
| 1112 | 1112 | state = UI_HANDLER_CANCEL; |
| 1113 | 1113 | |
| 1114 | 1114 | /* if the user cancels, exit out completely */ |
| r5613 | r5614 | |
| 1141 | 1141 | } |
| 1142 | 1142 | |
| 1143 | 1143 | /* if any key is pressed, just exit */ |
| 1144 | else if (input_code_poll_switches(FALSE) != INPUT_CODE_INVALID) | |
| 1144 | else if (input_code_poll_switches(machine, FALSE) != INPUT_CODE_INVALID) | |
| 1145 | 1145 | state = UI_HANDLER_CANCEL; |
| 1146 | 1146 | |
| 1147 | 1147 | return state; |
| r5613 | r5614 | |
| 1234 | 1234 | if (ui_input_pressed(machine, IPT_UI_PAUSE)) |
| 1235 | 1235 | { |
| 1236 | 1236 | /* with a shift key, it is single step */ |
| 1237 | if (is_paused && (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT))) | |
| 1237 | if (is_paused && (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT))) | |
| 1238 | 1238 | { |
| 1239 | 1239 | single_step = TRUE; |
| 1240 | 1240 | mame_pause(machine, FALSE); |
| r5613 | r5614 | |
| 1346 | 1346 | |
| 1347 | 1347 | /* check for A-Z or 0-9 */ |
| 1348 | 1348 | for (code = KEYCODE_A; code <= (input_code)KEYCODE_Z; code++) |
| 1349 | if (input_code_pressed_once(code)) | |
| 1349 | if (input_code_pressed_once(machine, code)) | |
| 1350 | 1350 | file = code - KEYCODE_A + 'a'; |
| 1351 | 1351 | if (file == 0) |
| 1352 | 1352 | for (code = KEYCODE_0; code <= (input_code)KEYCODE_9; code++) |
| 1353 | if (input_code_pressed_once(code)) | |
| 1353 | if (input_code_pressed_once(machine, code)) | |
| 1354 | 1354 | file = code - KEYCODE_0 + '0'; |
| 1355 | 1355 | if (file == 0) |
| 1356 | 1356 | for (code = KEYCODE_0_PAD; code <= (input_code)KEYCODE_9_PAD; code++) |
| 1357 | if (input_code_pressed_once(code)) | |
| 1357 | if (input_code_pressed_once(machine, code)) | |
| 1358 | 1358 | file = code - KEYCODE_0_PAD + '0'; |
| 1359 | 1359 | if (file == 0) |
| 1360 | 1360 | return state; |
| r5613 | r5614 | |
| 1583 | 1583 | static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval) |
| 1584 | 1584 | { |
| 1585 | 1585 | if (newval != SLIDER_NOCHANGE) |
| 1586 | sound_set_attenuation(newval); | |
| 1586 | sound_set_attenuation(machine, newval); | |
| 1587 | 1587 | if (string != NULL) |
| 1588 | astring_printf(string, "%3ddB", sound_get_attenuation()); | |
| 1589 | return sound_get_attenuation(); | |
| 1588 | astring_printf(string, "%3ddB", sound_get_attenuation(machine)); | |
| 1589 | return sound_get_attenuation(machine); | |
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 |
| r5613 | r5614 | |
|---|---|---|
| 333 | 333 | { |
| 334 | 334 | int player; |
| 335 | 335 | |
| 336 | /* only animate once per frame, when vblank_state is 1 */ | |
| 337 | if (!vblank_state) | |
| 338 | return; | |
| 339 | ||
| 336 | 340 | /* increment animation counter */ |
| 337 | global.animation_counter += 0x0 | |
| 341 | global.animation_counter += 0x08; | |
| 338 | 342 | |
| 339 | 343 | /* compute a fade factor from the current animation value */ |
| 340 | 344 | if (global.animation_counter < 0x80) |
| r5613 | r5614 | |
| 362 | 366 | else |
| 363 | 367 | { |
| 364 | 368 | /* see if the player has been motionless for time specified */ |
| 365 | /* note that the animate() routine is called twice per frame */ | |
| 366 | 369 | /* slightly confusing formula, but the effect is: */ |
| 367 | 370 | /* auto_time = 0 makes the crosshair barely visible while moved */ |
| 368 | 371 | /* every increment in auto_time is about .2s at 60Hz */ |
| 369 | if (global.time[player] > global.auto_time * 2 | |
| 372 | if (global.time[player] > global.auto_time * 12 | |
| 370 | 373 | /* time exceeded so turn crosshair invisible */ |
| 371 | 374 | global.visible[player] = FALSE; |
| 372 | 375 |
| r5613 | r5614 | |
|---|---|---|
| 48 | 48 | void _profiler_mark_start(int type) |
| 49 | 49 | { |
| 50 | 50 | profiler_data *data = &global_profiler.data[global_profiler.dataindex]; |
| 51 | osd_ticks_t curticks = | |
| 51 | osd_ticks_t curticks = get_profile | |
| 52 | 52 | profiler_filo_entry *entry; |
| 53 | 53 | int index; |
| 54 | 54 | |
| r5613 | r5614 | |
| 85 | 85 | void _profiler_mark_end(void) |
| 86 | 86 | { |
| 87 | 87 | profiler_data *data = &global_profiler.data[global_profiler.dataindex]; |
| 88 | osd_ticks_t curticks = | |
| 88 | osd_ticks_t curticks = get_profile | |
| 89 | 89 | |
| 90 | 90 | /* we're ending an existing bucket, update the time */ |
| 91 | 91 | if (global_profiler.filoindex > 0) |
| r5613 | r5614 | |
|---|---|---|
| 80 | 80 | #endif |
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | struct _sound_private | |
| 84 | { | |
| 85 | emu_timer *update_timer; | |
| 83 | 86 | |
| 87 | int totalsnd; | |
| 84 | 88 | |
| 85 | /*************************************************************************** | |
| 86 | GLOBAL VARIABLES | |
| 87 | ***************************************************************************/ | |
| 89 | UINT32 finalmix_leftover; | |
| 90 | INT16 *finalmix; | |
| 91 | INT32 *leftmix; | |
| 92 | INT32 *rightmix; | |
| 88 | 93 | |
| 89 | static emu_timer *sound_update_timer; | |
| 94 | int muted; | |
| 95 | int attenuation; | |
| 96 | int enabled; | |
| 97 | int nosound_mode; | |
| 90 | 98 | |
| 91 | static int totalsnd; | |
| 99 | wav_file *wavfile; | |
| 100 | }; | |
| 92 | 101 | |
| 93 | static INT16 *finalmix; | |
| 94 | static UINT32 finalmix_leftover; | |
| 95 | static INT32 *leftmix, *rightmix; | |
| 96 | 102 | |
| 97 | static int sound_muted; | |
| 98 | static int sound_attenuation; | |
| 99 | static int global_sound_enabled; | |
| 100 | static int nosound_mode; | |
| 101 | 103 | |
| 102 | static wav_file *wavfile; | |
| 103 | ||
| 104 | ||
| 105 | ||
| 106 | 104 | /*************************************************************************** |
| 107 | 105 | FUNCTION PROTOTYPES |
| 108 | 106 | ***************************************************************************/ |
| r5613 | r5614 | |
| 191 | 189 | |
| 192 | 190 | void sound_init(running_machine *machine) |
| 193 | 191 | { |
| 192 | sound_private *global; | |
| 194 | 193 | const char *filename; |
| 195 | 194 | |
| 195 | machine->sound_data = global = auto_alloc_clear(machine, sound_private); | |
| 196 | ||
| 196 | 197 | /* handle -nosound */ |
| 197 | nosound_mode = !options_get_bool(mame_options(), OPTION_SOUND); | |
| 198 | if (nosound_mode) | |
| 198 | global->nosound_mode = !options_get_bool(mame_options(), OPTION_SOUND); | |
| 199 | if (global->nosound_mode) | |
| 199 | 200 | machine->sample_rate = 11025; |
| 200 | 201 | |
| 201 | 202 | /* count the speakers */ |
| 202 | 203 | VPRINTF(("total speakers = %d\n", speaker_output_count(machine->config))); |
| 203 | 204 | |
| 204 | 205 | /* allocate memory for mix buffers */ |
| 205 | leftmix = auto_alloc_array(machine, INT32, machine->sample_rate); | |
| 206 | rightmix = auto_alloc_array(machine, INT32, machine->sample_rate); | |
| 207 | finalmix = auto_alloc_array(machine, INT16, machine->sample_rate); | |
| 206 | global->leftmix = auto_alloc_array(machine, INT32, machine->sample_rate); | |
| 207 | global->rightmix = auto_alloc_array(machine, INT32, machine->sample_rate); | |
| 208 | global->finalmix = auto_alloc_array(machine, INT16, machine->sample_rate); | |
| 208 | 209 | |
| 209 | 210 | /* allocate a global timer for sound timing */ |
| 210 | sound_update_timer = timer_alloc(machine, sound_update, NULL); | |
| 211 | timer_adjust_periodic(sound_update_timer, STREAMS_UPDATE_FREQUENCY, 0, STREAMS_UPDATE_FREQUENCY); | |
| 211 | global->update_timer = timer_alloc(machine, sound_update, NULL); | |
| 212 | timer_adjust_periodic(global->update_timer, STREAMS_UPDATE_FREQUENCY, 0, STREAMS_UPDATE_FREQUENCY); | |
| 212 | 213 | |
| 213 | 214 | /* finally, do all the routing */ |
| 214 | 215 | VPRINTF(("route_sound\n")); |
| r5613 | r5614 | |
| 217 | 218 | /* open the output WAV file if specified */ |
| 218 | 219 | filename = options_get_string(mame_options(), OPTION_WAVWRITE); |
| 219 | 220 | if (filename[0] != 0) |
| 220 | wavfile = wav_open(filename, machine->sample_rate, 2); | |
| 221 | global->wavfile = wav_open(filename, machine->sample_rate, 2); | |
| 221 | 222 | |
| 222 | 223 | /* enable sound by default */ |
| 223 | global_sound_enabled = TRUE; | |
| 224 | sound_muted = FALSE; | |
| 225 | sound_set_attenuation(options_get_int(mame_options(), OPTION_VOLUME)); | |
| 224 | global->enabled = TRUE; | |
| 225 | global->muted = FALSE; | |
| 226 | sound_set_attenuation(machine, options_get_int(mame_options(), OPTION_VOLUME)); | |
| 226 | 227 | |
| 227 | 228 | /* register callbacks */ |
| 228 | 229 | config_register(machine, "mixer", sound_load, sound_save); |
| r5613 | r5614 | |
| 238 | 239 | |
| 239 | 240 | static void sound_exit(running_machine *machine) |
| 240 | 241 | { |
| 242 | sound_private *global = machine->sound_data; | |
| 243 | ||
| 241 | 244 | /* close any open WAV file */ |
| 242 | if (wavfile != NULL) | |
| 243 | wav_close(wavfile); | |
| 245 | if (global->wavfile != NULL) | |
| 246 | wav_close(global->wavfile); | |
| 247 | global->wavfile = NULL; | |
| 244 | 248 | |
| 245 | 249 | /* reset variables */ |
| 246 | totalsnd = 0; | |
| 250 | global->totalsnd = 0; | |
| 247 | 251 | } |
| 248 | 252 | |
| 249 | 253 | |
| r5613 | r5614 | |
| 541 | 545 | |
| 542 | 546 | static void sound_pause(running_machine *machine, int pause) |
| 543 | 547 | { |
| 548 | sound_private *global = machine->sound_data; | |
| 549 | ||
| 544 | 550 | if (pause) |
| 545 | | |
| 551 | global->muted |= 0x02; | |
| 546 | 552 | else |
| 547 | sound_muted &= ~0x02; | |
| 548 | osd_set_mastervolume(sound_muted ? -32 : sound_attenuation); | |
| 553 | global->muted &= ~0x02; | |
| 554 | osd_set_mastervolume(global->muted ? -32 : global->attenuation); | |
| 549 | 555 | } |
| 550 | 556 | |
| 551 | 557 | |
| 552 | 558 | /*------------------------------------------------- |
| 553 | sound_ | |
| 559 | sound_m | |
| 554 | 560 | -------------------------------------------------*/ |
| 555 | 561 | |
| 556 | void sound_mute(int mute) | |
| 562 | void sound_mute(running_machine *machine, int mute) | |
| 557 | 563 | { |
| 564 | sound_private *global = machine->sound_data; | |
| 565 | ||
| 558 | 566 | if (mute) |
| 559 | | |
| 567 | global->muted |= 0x01; | |
| 560 | 568 | else |
| 561 | sound_muted &= ~0x01; | |
| 562 | osd_set_mastervolume(sound_muted ? -32 : sound_attenuation); | |
| 569 | global->muted &= ~0x01; | |
| 570 | osd_set_mastervolume(global->muted ? -32 : global->attenuation); | |
| 563 | 571 | } |
| 564 | 572 | |
| 565 | 573 | |
| r5613 | r5614 | |
| 567 | 575 | sound_set_attenuation - set the global volume |
| 568 | 576 | -------------------------------------------------*/ |
| 569 | 577 | |
| 570 | void sound_set_attenuation(int attenuation) | |
| 578 | void sound_set_attenuation(running_machine *machine, int attenuation) | |
| 571 | 579 | { |
| 572 | sound_attenuation = attenuation; | |
| 573 | osd_set_mastervolume(sound_muted ? -32 : sound_attenuation); | |
| 580 | sound_private *global = machine->sound_data; | |
| 581 | global->attenuation = attenuation; | |
| 582 | osd_set_mastervolume(global->muted ? -32 : global->attenuation); | |
| 574 | 583 | } |
| 575 | 584 | |
| 576 | 585 | |
| r5613 | r5614 | |
| 579 | 588 | volume |
| 580 | 589 | -------------------------------------------------*/ |
| 581 | 590 | |
| 582 | int sound_get_attenuation( | |
| 591 | int sound_get_attenuation(running_machine *machine) | |
| 583 | 592 | { |
| 584 | return sound_attenuation; | |
| 593 | sound_private *global = machine->sound_data; | |
| 594 | return global->attenuation; | |
| 585 | 595 | } |
| 586 | 596 | |
| 587 | 597 | |
| r5613 | r5614 | |
| 590 | 600 | globally |
| 591 | 601 | -------------------------------------------------*/ |
| 592 | 602 | |
| 593 | void sound_global_enable(int enable) | |
| 603 | void sound_global_enable(running_machine *machine, int enable) | |
| 594 | 604 | { |
| 595 | global_sound_enabled = enable; | |
| 605 | sound_private *global = machine->sound_data; | |
| 606 | global->enabled = enable; | |
| 596 | 607 | } |
| 597 | 608 | |
| 598 | 609 | |
| r5613 | r5614 | |
| 684 | 695 | const device_config *curspeak; |
| 685 | 696 | int samples_this_update = 0; |
| 686 | 697 | int sample; |
| 698 | sound_private *global = machine->sound_data; | |
| 699 | INT16 *finalmix; | |
| 700 | INT32 *leftmix, *rightmix; | |
| 687 | 701 | |
| 688 | 702 | VPRINTF(("sound_update\n")); |
| 689 | 703 | |
| 690 | 704 | profiler_mark_start(PROFILER_SOUND); |
| 691 | 705 | |
| 706 | leftmix = global->leftmix; | |
| 707 | rightmix = global->rightmix; | |
| 708 | finalmix = global->finalmix; | |
| 709 | ||
| 692 | 710 | /* force all the speaker streams to generate the proper number of samples */ |
| 693 | 711 | for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) |
| 694 | 712 | { |
| r5613 | r5614 | |
| 729 | 747 | #endif |
| 730 | 748 | |
| 731 | 749 | /* mix if sound is enabled */ |
| 732 | if (global | |
| 750 | if (global-> | |
| 733 | 751 | { |
| 734 | 752 | /* if the speaker is centered, send to both left and right */ |
| 735 | 753 | if (spk->speaker->x == 0) |
| r5613 | r5614 | |
| 755 | 773 | /* now downmix the final result */ |
| 756 | 774 | finalmix_step = video_get_speed_factor(); |
| 757 | 775 | finalmix_offset = 0; |
| 758 | for (sample = finalmix_leftover; sample < samples_this_update * 100; sample += finalmix_step) | |
| 776 | for (sample = global->finalmix_leftover; sample < samples_this_update * 100; sample += finalmix_step) | |
| 759 | 777 | { |
| 760 | 778 | int sampindex = sample / 100; |
| 761 | 779 | INT32 samp; |
| r5613 | r5614 | |
| 776 | 794 | samp = 32767; |
| 777 | 795 | finalmix[finalmix_offset++] = samp; |
| 778 | 796 | } |
| 779 | finalmix_leftover = sample - samples_this_update * 100; | |
| 797 | global->finalmix_leftover = sample - samples_this_update * 100; | |
| 780 | 798 | |
| 781 | 799 | /* play the result */ |
| 782 | 800 | if (finalmix_offset > 0) |
| 783 | 801 | { |
| 784 | 802 | osd_update_audio_stream(machine, finalmix, finalmix_offset / 2); |
| 785 | 803 | video_avi_add_sound(machine, finalmix, finalmix_offset / 2); |
| 786 | if (wavfile != NULL) | |
| 787 | wav_add_data_16(wavfile, finalmix, finalmix_offset); | |
| 804 | if (global->wavfile != NULL) | |
| 805 | wav_add_data_16(global->wavfile, finalmix, finalmix_offset); | |
| 788 | 806 | } |
| 789 | 807 | |
| 790 | 808 | /* update the streamer */ |
| r5613 | r5614 | |
|---|---|---|
| 156 | 156 | |
| 157 | 157 | |
| 158 | 158 | /* global sound controls */ |
| 159 | void sound_mute(int mute); | |
| 160 | void sound_set_attenuation(int attenuation); | |
| 161 | int sound_get_attenuation(void); | |
| 162 | void sound_global_enable(int enable); | |
| 159 | void sound_mute(running_machine *machine, int mute); | |
| 160 | void sound_set_attenuation(running_machine *machine, int attenuation); | |
| 161 | int sound_get_attenuation(running_machine *machine); | |
| 162 | void sound_global_enable(running_machine *machine, int enable); | |
| 163 | 163 | |
| 164 | 164 | /* user gain controls on speaker inputs for mixing */ |
| 165 | 165 | int sound_get_user_gain_count(running_machine *machine); |
| r5613 | r5614 | |
|---|---|---|
| 115 | 115 | }; |
| 116 | 116 | |
| 117 | 117 | |
| 118 | struct _input_private | |
| 119 | { | |
| 120 | /* array of devices for each class */ | |
| 121 | input_device_list device_list[DEVICE_CLASS_MAXIMUM]; | |
| 122 | input_code code_pressed_memory[MAX_PRESSED_SWITCHES]; | |
| 118 | 123 | |
| 124 | /* device configuration */ | |
| 125 | UINT8 steadykey_enabled; | |
| 126 | UINT8 lightgun_reload_button; | |
| 127 | const char * joystick_map_default; | |
| 128 | INT32 joystick_deadzone; | |
| 129 | INT32 joystick_saturation; | |
| 130 | }; | |
| 131 | ||
| 132 | ||
| 119 | 133 | /*************************************************************************** |
| 120 | 134 | TOKEN/STRING TABLES |
| 121 | 135 | ***************************************************************************/ |
| r5613 | r5614 | |
| 392 | 406 | GLOBAL VARIABLES |
| 393 | 407 | ***************************************************************************/ |
| 394 | 408 | |
| 395 | /* array of devices for each class */ | |
| 396 | static input_device_list device_list[DEVICE_CLASS_MAXIMUM]; | |
| 397 | static input_code code_pressed_memory[MAX_PRESSED_SWITCHES]; | |
| 398 | ||
| 399 | /* device configuration */ | |
| 400 | static UINT8 steadykey_enabled; | |
| 401 | static UINT8 lightgun_reload_button; | |
| 402 | static const char * joystick_map_default; | |
| 403 | static INT32 joystick_deadzone; | |
| 404 | static INT32 joystick_saturation; | |
| 405 | ||
| 406 | 409 | /* standard joystick mappings */ |
| 407 | 410 | const char joystick_map_8way[] = "7778...4445"; |
| 408 | 411 | const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445"; |
| r5613 | r5614 | |
| 415 | 418 | ***************************************************************************/ |
| 416 | 419 | |
| 417 | 420 | static void input_frame(running_machine *machine); |
| 418 | static input_device_item *input_code_item(input_code code); | |
| 419 | static INT32 convert_absolute_value(input_code code, input_device_item *item); | |
| 421 | static input_device_item *input_code_item(running_machine *machine, input_code code); | |
| 422 | static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item); | |
| 420 | 423 | static INT32 convert_relative_value(input_code code, input_device_item *item); |
| 421 | static INT32 convert_switch_value(input_code code, input_device_item *item); | |
| 422 | static INT32 apply_deadzone_and_saturation(input_code code, INT32 result); | |
| 424 | static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item); | |
| 425 | static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result); | |
| 423 | 426 | static int joystick_map_parse(const char *mapstring, joystick_map *map); |
| 424 | 427 | static void joystick_map_print(const char *header, const char *origstring, const joystick_map *map); |
| 425 | static void input_code_reset_axes(void); | |
| 426 | static int input_code_check_axis(input_device_item *item, input_code code); | |
| 428 | static void input_code_reset_axes(running_machine *machine); | |
| 429 | static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code); | |
| 427 | 430 | |
| 428 | 431 | |
| 429 | 432 | |
| r5613 | r5614 | |
| 436 | 439 | a pointer to the associated device |
| 437 | 440 | -------------------------------------------------*/ |
| 438 | 441 | |
| 439 | INLINE input_device *input_code_device(input_code code) | |
| 442 | INLINE input_device *input_code_device(running_machine *machine, input_code code) | |
| 440 | 443 | { |
| 441 | 444 | /* if the class is valid... */ |
| 442 | 445 | input_device_class devclass = INPUT_CODE_DEVCLASS(code); |
| 443 | 446 | if (devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM) |
| 444 | 447 | { |
| 448 | input_device_list *device_list = machine->input_data->device_list; | |
| 449 | ||
| 445 | 450 | /* ...and the index is valid for that class, return a pointer to the device */ |
| 446 | 451 | int devindex = INPUT_CODE_DEVINDEX(code); |
| 447 | 452 | if (devindex < device_list[devclass].count) |
| r5613 | r5614 | |
| 462 | 467 | { |
| 463 | 468 | int devindex = device->devindex; |
| 464 | 469 | |
| 465 | assert(devindex < device_list[device->devclass].count); | |
| 470 | assert(devindex < device->machine->input_data->device_list[device->devclass].count); | |
| 466 | 471 | assert(itemid < ITEM_ID_ABSOLUTE_MAXIMUM); |
| 467 | 472 | assert(device->item[itemid] != NULL); |
| 468 | 473 | |
| r5613 | r5614 | |
| 496 | 501 | of an input item |
| 497 | 502 | -------------------------------------------------*/ |
| 498 | 503 | |
| 499 | INLINE void input_item_update_value(input_device_item *item) | |
| 504 | INLINE void input_item_update_value(running_machine *machine, input_device_item *item) | |
| 500 | 505 | { |
| 506 | input_device_list *device_list = machine->input_data->device_list; | |
| 507 | ||
| 501 | 508 | item->current = (*item->getstate)(device_list[item->devclass].list[item->devindex].internal, item->internal); |
| 502 | 509 | } |
| 503 | 510 | |
| r5613 | r5614 | |
| 507 | 514 | of memory for pressed switches |
| 508 | 515 | -------------------------------------------------*/ |
| 509 | 516 | |
| 510 | INLINE void code_pressed_memory_reset( | |
| 517 | INLINE void code_pressed_memory_reset(running_machine *machine) | |
| 511 | 518 | { |
| 519 | input_code *code_pressed_memory = machine->input_data->code_pressed_memory; | |
| 512 | 520 | int memnum; |
| 521 | ||
| 513 | 522 | for (memnum = 0; memnum < MAX_PRESSED_SWITCHES; memnum++) |
| 514 | 523 | code_pressed_memory[memnum] = INPUT_CODE_INVALID; |
| 515 | 524 | } |
| r5613 | r5614 | |
| 561 | 570 | void input_init(running_machine *machine) |
| 562 | 571 | { |
| 563 | 572 | joystick_map map; |
| 573 | input_private *state; | |
| 574 | input_device_list *device_list; | |
| 564 | 575 | |
| 576 | /* allocate private memory */ | |
| 577 | machine->input_data = state = auto_alloc_clear(machine, input_private); | |
| 578 | device_list = state->device_list; | |
| 579 | ||
| 565 | 580 | /* reset the device lists */ |
| 566 | 581 | memset(device_list, 0, sizeof(device_list)); |
| 567 | 582 | |
| 568 | 583 | /* reset code memory */ |
| 569 | code_pressed_memory_reset(); | |
| 584 | code_pressed_memory_reset(machine); | |
| 570 | 585 | |
| 571 | 586 | /* request a per-frame callback for bookkeeping */ |
| 572 | 587 | add_frame_callback(machine, input_frame); |
| r5613 | r5614 | |
| 584 | 599 | device_list[DEVICE_CLASS_JOYSTICK].multi = TRUE; |
| 585 | 600 | |
| 586 | 601 | /* read other input options */ |
| 587 | steadykey_enabled = options_get_bool(mame_options(), OPTION_STEADYKEY); | |
| 588 | lightgun_reload_button = options_get_bool(mame_options(), OPTION_OFFSCREEN_RELOAD); | |
| 589 | joystick_deadzone = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_DEADZONE) * INPUT_ABSOLUTE_MAX); | |
| 590 | joystick_saturation = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_SATURATION) * INPUT_ABSOLUTE_MAX); | |
| 602 | state->steadykey_enabled = options_get_bool(mame_options(), OPTION_STEADYKEY); | |
| 603 | state->lightgun_reload_button = options_get_bool(mame_options(), OPTION_OFFSCREEN_RELOAD); | |
| 604 | state->joystick_deadzone = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_DEADZONE) * INPUT_ABSOLUTE_MAX); | |
| 605 | state->joystick_saturation = (INT32)(options_get_float(mame_options(), OPTION_JOYSTICK_SATURATION) * INPUT_ABSOLUTE_MAX); | |
| 591 | 606 | |
| 592 | 607 | /* get the default joystick map */ |
| 593 | joystick_map_default = options_get_string(mame_options(), OPTION_JOYSTICK_MAP); | |
| 594 | if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0) | |
| 595 | joystick_map_default = joystick_map_8way; | |
| 596 | if (!joystick_map_parse(joystick_map_default, &map)) | |
| 597 | mame_printf_error("Invalid joystick map: %s\n", joystick_map_default); | |
| 598 | else if (joystick_map_default != joystick_map_8way) | |
| 599 | joystick_map_print("Input: Default joystick map", joystick_map_default, &map); | |
| 608 | state->joystick_map_default = options_get_string(mame_options(), OPTION_JOYSTICK_MAP); | |
| 609 | if (state->joystick_map_default[0] == 0 || strcmp(state->joystick_map_default, "auto") == 0) | |
| 610 | state->joystick_map_default = joystick_map_8way; | |
| 611 | if (!joystick_map_parse(state->joystick_map_default, &map)) | |
| 612 | mame_printf_error("Invalid joystick map: %s\n", state->joystick_map_default); | |
| 613 | else if (state->joystick_map_default != joystick_map_8way) | |
| 614 | joystick_map_print("Input: Default joystick map", state->joystick_map_default, &map); | |
| 600 | 615 | } |
| 601 | 616 | |
| 602 | 617 | |
| r5613 | r5614 | |
| 605 | 620 | a device class |
| 606 | 621 | -------------------------------------------------*/ |
| 607 | 622 | |
| 608 | void input_device_class_enable(input_device_class devclass, UINT8 enable) | |
| 623 | void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable) | |
| 609 | 624 | { |
| 625 | input_device_list *device_list = machine->input_data->device_list; | |
| 626 | ||
| 610 | 627 | assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM); |
| 611 | 628 | device_list[devclass].enabled = enable; |
| 612 | 629 | } |
| r5613 | r5614 | |
| 617 | 634 | enabled? |
| 618 | 635 | -------------------------------------------------*/ |
| 619 | 636 | |
| 620 | UINT8 input_device_class_enabled(input_device_class devclass) | |
| 637 | UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass) | |
| 621 | 638 | { |
| 639 | input_device_list *device_list = machine->input_data->device_list; | |
| 640 | ||
| 622 | 641 | assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM); |
| 623 | 642 | return device_list[devclass].enabled; |
| 624 | 643 | } |
| r5613 | r5614 | |
| 629 | 648 | joystick map for a device |
| 630 | 649 | -------------------------------------------------*/ |
| 631 | 650 | |
| 632 | int input_device_set_joystick_map(int devindex, const char *mapstring) | |
| 651 | int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring) | |
| 633 | 652 | { |
| 653 | input_device_list *device_list = machine->input_data->device_list; | |
| 634 | 654 | int startindex = devindex; |
| 635 | 655 | int stopindex = devindex; |
| 636 | 656 | joystick_map map; |
| r5613 | r5614 | |
| 666 | 686 | |
| 667 | 687 | static void input_frame(running_machine *machine) |
| 668 | 688 | { |
| 689 | input_private *state = machine->input_data; | |
| 690 | ||
| 669 | 691 | /* if steadykey is enabled, do processing here */ |
| 670 | if (steadykey_enabled) | |
| 692 | if (state->steadykey_enabled) | |
| 671 | 693 | { |
| 694 | input_device_list *device_list = state->device_list; | |
| 672 | 695 | int devnum; |
| 673 | 696 | |
| 674 | 697 | /* iterate over keyboards */ |
| r5613 | r5614 | |
| 684 | 707 | input_device_item *item = device->item[itemid]; |
| 685 | 708 | if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) |
| 686 | 709 | { |
| 687 | input_item_update_value(item); | |
| 710 | input_item_update_value(machine, item); | |
| 688 | 711 | if ((item->current ^ item->oldkey) & 1) |
| 689 | 712 | { |
| 690 | 713 | changed = TRUE; |
| r5613 | r5614 | |
| 723 | 746 | |
| 724 | 747 | input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal) |
| 725 | 748 | { |
| 726 | input_device_list *devlist = &device_list[devclass]; | |
| 749 | input_private *state = machine->input_data; | |
| 750 | input_device_list *devlist = &state->device_list[devclass]; | |
| 727 | 751 | input_device *device; |
| 728 | 752 | |
| 729 | 753 | assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call input_device_add at init time!"); |
| r5613 | r5614 | |
| 745 | 769 | /* default to 8-way map for joysticks */ |
| 746 | 770 | if (devclass == DEVICE_CLASS_JOYSTICK) |
| 747 | 771 | { |
| 748 | joystick_map_parse(joystick_map_default, &device->joymap); | |
| 772 | joystick_map_parse(state->joystick_map_default, &device->joymap); | |
| 749 | 773 | device->lastmap = JOYSTICK_MAP_NEUTRAL; |
| 750 | 774 | } |
| 751 | 775 | |
| r5613 | r5614 | |
| 821 | 845 | given input code |
| 822 | 846 | -------------------------------------------------*/ |
| 823 | 847 | |
| 824 | INT32 input_code_value(input_code code) | |
| 848 | INT32 input_code_value(running_machine *machine, input_code code) | |
| 825 | 849 | { |
| 850 | input_device_list *device_list = machine->input_data->device_list; | |
| 826 | 851 | input_device_class devclass = INPUT_CODE_DEVCLASS(code); |
| 827 | 852 | int startindex = INPUT_CODE_DEVINDEX(code); |
| 828 | 853 | int stopindex = startindex; |
| r5613 | r5614 | |
| 852 | 877 | for (curindex = startindex; curindex <= stopindex; curindex++) |
| 853 | 878 | { |
| 854 | 879 | /* lookup the item for the appropriate index */ |
| 855 | input_device_item *item = input_code_item(INPUT_CODE_SET_DEVINDEX(code, curindex)); | |
| 880 | input_device_item *item = input_code_item(machine, INPUT_CODE_SET_DEVINDEX(code, curindex)); | |
| 856 | 881 | if (item == NULL) |
| 857 | 882 | continue; |
| 858 | 883 | |
| 859 | 884 | /* update the value of this item */ |
| 860 | input_item_update_value(item); | |
| 885 | input_item_update_value(machine, item); | |
| 861 | 886 | |
| 862 | 887 | /* process items according to their native type */ |
| 863 | 888 | switch (item->itemclass) |
| 864 | 889 | { |
| 865 | 890 | case ITEM_CLASS_ABSOLUTE: |
| 866 | result = convert_absolute_value(code, item); | |
| 891 | result = convert_absolute_value(machine, code, item); | |
| 867 | 892 | break; |
| 868 | 893 | |
| 869 | 894 | case ITEM_CLASS_RELATIVE: |
| r5613 | r5614 | |
| 871 | 896 | break; |
| 872 | 897 | |
| 873 | 898 | case ITEM_CLASS_SWITCH: |
| 874 | result |= convert_switch_value(code, item); | |
| 899 | result |= convert_switch_value(machine, code, item); | |
| 875 | 900 | break; |
| 876 | 901 | |
| 877 | 902 | default: |
| r5613 | r5614 | |
| 890 | 915 | given input code has been pressed |
| 891 | 916 | -------------------------------------------------*/ |
| 892 | 917 | |
| 893 | int input_code_pressed(input_code code) | |
| 918 | int input_code_pressed(running_machine *machine, input_code code) | |
| 894 | 919 | { |
| 895 | return (input_code_value(code) != 0); | |
| 920 | return (input_code_value(machine, code) != 0); | |
| 896 | 921 | } |
| 897 | 922 | |
| 898 | 923 | |
| r5613 | r5614 | |
| 902 | 927 | on since the last call |
| 903 | 928 | -------------------------------------------------*/ |
| 904 | 929 | |
| 905 | int input_code_pressed_once(input_code code) | |
| 930 | int input_code_pressed_once(running_machine *machine, input_code code) | |
| 906 | 931 | { |
| 907 | int curvalue = input_code_pressed(code); | |
| 932 | input_code *code_pressed_memory = machine->input_data->code_pressed_memory; | |
| 933 | int curvalue = input_code_pressed(machine, code); | |
| 908 | 934 | int memnum, empty = -1; |
| 909 | 935 | |
| 910 | 936 | /* look for the code in the memory */ |
| r5613 | r5614 | |
| 943 | 969 | an input_item_id to an input_code |
| 944 | 970 | -------------------------------------------------*/ |
| 945 | 971 | |
| 946 | input_code input_code_from_input_item_id(input_item_id itemid) | |
| 972 | input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid) | |
| 947 | 973 | { |
| 974 | input_device_list *device_list = machine->input_data->device_list; | |
| 948 | 975 | input_device_class devclass; |
| 949 | 976 | |
| 950 | 977 | /* iterate over device classes and devices */ |
| r5613 | r5614 | |
| 969 | 996 | input_code_poll_switches - poll for any input |
| 970 | 997 | -------------------------------------------------*/ |
| 971 | 998 | |
| 972 | input_code input_code_poll_switches(int reset) | |
| 999 | input_code input_code_poll_switches(running_machine *machine, int reset) | |
| 973 | 1000 | { |
| 1001 | input_device_list *device_list = machine->input_data->device_list; | |
| 974 | 1002 | input_device_class devclass; |
| 975 | 1003 | |
| 976 | 1004 | /* if resetting memory, do it now */ |
| 977 | 1005 | if (reset) |
| 978 | 1006 | { |
| 979 | code_pressed_memory_reset(); | |
| 980 | input_code_reset_axes(); | |
| 1007 | code_pressed_memory_reset(machine); | |
| 1008 | input_code_reset_axes(machine); | |
| 981 | 1009 | } |
| 982 | 1010 | |
| 983 | 1011 | /* iterate over device classes and devices */ |
| r5613 | r5614 | |
| 1003 | 1031 | /* if the item is natively a switch, poll it */ |
| 1004 | 1032 | if (item->itemclass == ITEM_CLASS_SWITCH) |
| 1005 | 1033 | { |
| 1006 | if (input_code_pressed_once(code)) | |
| 1034 | if (input_code_pressed_once(machine, code)) | |
| 1007 | 1035 | return code; |
| 1008 | 1036 | else |
| 1009 | 1037 | continue; |
| 1010 | 1038 | } |
| 1011 | 1039 | |
| 1012 | 1040 | /* skip if there is not enough axis movement */ |
| 1013 | if (!input_code_check_axis(item, code)) | |
| 1041 | if (!input_code_check_axis(machine, item, code)) | |
| 1014 | 1042 | continue; |
| 1015 | 1043 | |
| 1016 | 1044 | /* otherwise, poll axes digitally */ |
| r5613 | r5614 | |
| 1020 | 1048 | if (devclass == DEVICE_CLASS_JOYSTICK && INPUT_CODE_ITEMID(code) == ITEM_ID_XAXIS) |
| 1021 | 1049 | { |
| 1022 | 1050 | code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_LEFT); |
| 1023 | if (input_code_pressed_once(code)) | |
| 1051 | if (input_code_pressed_once(machine, code)) | |
| 1024 | 1052 | return code; |
| 1025 | 1053 | code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_RIGHT); |
| 1026 | if (input_code_pressed_once(code)) | |
| 1054 | if (input_code_pressed_once(machine, code)) | |
| 1027 | 1055 | return code; |
| 1028 | 1056 | } |
| 1029 | 1057 | |
| r5613 | r5614 | |
| 1031 | 1059 | else if (devclass == DEVICE_CLASS_JOYSTICK && INPUT_CODE_ITEMID(code) == ITEM_ID_YAXIS) |
| 1032 | 1060 | { |
| 1033 | 1061 | code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_UP); |
| 1034 | if (input_code_pressed_once(code)) | |
| 1062 | if (input_code_pressed_once(machine, code)) | |
| 1035 | 1063 | return code; |
| 1036 | 1064 | code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_DOWN); |
| 1037 | if (input_code_pressed_once(code)) | |
| 1065 | if (input_code_pressed_once(machine, code)) | |
| 1038 | 1066 | return code; |
| 1039 | 1067 | } |
| 1040 | 1068 | |
| r5613 | r5614 | |
| 1042 | 1070 | else |
| 1043 | 1071 | { |
| 1044 | 1072 | code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_POS); |
| 1045 | if (input_code_pressed_once(code)) | |
| 1073 | if (input_code_pressed_once(machine, code)) | |
| 1046 | 1074 | return code; |
| 1047 | 1075 | code = INPUT_CODE_SET_MODIFIER(code, ITEM_MODIFIER_NEG); |
| 1048 | if (input_code_pressed_once(code)) | |
| 1076 | if (input_code_pressed_once(machine, code)) | |
| 1049 | 1077 | return code; |
| 1050 | 1078 | } |
| 1051 | 1079 | } |
| r5613 | r5614 | |
| 1063 | 1091 | any keyboard-specific input |
| 1064 | 1092 | -------------------------------------------------*/ |
| 1065 | 1093 | |
| 1066 | input_code input_code_poll_keyboard_switches(int reset) | |
| 1094 | input_code input_code_poll_keyboard_switches(running_machine *machine, int reset) | |
| 1067 | 1095 | { |
| 1068 | input_device_list *devlist = &device_list[DEVICE_CLASS_KEYBOARD]; | |
| 1096 | input_device_list *devlist = &machine->input_data->device_list[DEVICE_CLASS_KEYBOARD]; | |
| 1069 | 1097 | int devnum; |
| 1070 | 1098 | |
| 1071 | 1099 | /* if resetting memory, do it now */ |
| 1072 | 1100 | if (reset) |
| 1073 | code_pressed_memory_reset(); | |
| 1101 | code_pressed_memory_reset(machine); | |
| 1074 | 1102 | |
| 1075 | 1103 | /* iterate over devices within each class */ |
| 1076 | 1104 | for (devnum = 0; devnum < devlist->count; devnum++) |
| r5613 | r5614 | |
| 1085 | 1113 | if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) |
| 1086 | 1114 | { |
| 1087 | 1115 | input_code code = device_item_to_code(device, itemid); |
| 1088 | if (input_code_pressed_once(code)) | |
| 1116 | if (input_code_pressed_once(machine, code)) | |
| 1089 | 1117 | return code; |
| 1090 | 1118 | } |
| 1091 | 1119 | } |
| r5613 | r5614 | |
| 1101 | 1129 | move far enough |
| 1102 | 1130 | -------------------------------------------------*/ |
| 1103 | 1131 | |
| 1104 | static int input_code_check_axis(input_device_item *item, input_code code) | |
| 1132 | static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code) | |
| 1105 | 1133 | { |
| 1106 | 1134 | INT32 curval, diff; |
| 1107 | 1135 | |
| 1108 | 1136 | /* poll the current value */ |
| 1109 | curval = input_code_value(code); | |
| 1137 | curval = input_code_value(machine, code); | |
| 1110 | 1138 | |
| 1111 | 1139 | /* if we've already reported this one, don't bother */ |
| 1112 | 1140 | if (item->memory == INVALID_AXIS_VALUE) |
| r5613 | r5614 | |
| 1146 | 1174 | input_code_reset_axes - reset axes memory |
| 1147 | 1175 | -------------------------------------------------*/ |
| 1148 | 1176 | |
| 1149 | static void input_code_reset_axes( | |
| 1177 | static void input_code_reset_axes(running_machine *machine) | |
| 1150 | 1178 | { |
| 1179 | input_device_list *device_list = machine->input_data->device_list; | |
| 1151 | 1180 | input_device_class devclass; |
| 1152 | 1181 | |
| 1153 | 1182 | /* iterate over device classes and devices */ |
| r5613 | r5614 | |
| 1175 | 1204 | continue; |
| 1176 | 1205 | |
| 1177 | 1206 | /* poll the current value and reset the memory */ |
| 1178 | item->memory = input_code_value(code); | |
| 1207 | item->memory = input_code_value(machine, code); | |
| 1179 | 1208 | } |
| 1180 | 1209 | } |
| 1181 | 1210 | } |
| r5613 | r5614 | |
| 1187 | 1216 | input_code_poll_axes - poll for any input |
| 1188 | 1217 | -------------------------------------------------*/ |
| 1189 | 1218 | |
| 1190 | input_code input_code_poll_axes(int reset) | |
| 1219 | input_code input_code_poll_axes(running_machine *machine, int reset) | |
| 1191 | 1220 | { |
| 1221 | input_device_list *device_list = machine->input_data->device_list; | |
| 1192 | 1222 | input_device_class devclass; |
| 1193 | 1223 | |
| 1194 | 1224 | /* if resetting memory, do it now */ |
| 1195 | 1225 | if (reset) |
| 1196 | input_code_reset_axes(); | |
| 1226 | input_code_reset_axes(machine); | |
| 1197 | 1227 | |
| 1198 | 1228 | /* iterate over device classes and devices */ |
| 1199 | 1229 | for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++) |
| r5613 | r5614 | |
| 1220 | 1250 | continue; |
| 1221 | 1251 | |
| 1222 | 1252 | /* check if there is enough axis movement */ |
| 1223 | if (input_code_check_axis(item, code)) | |
| 1253 | if (input_code_check_axis(machine, item, code)) | |
| 1224 | 1254 | return code; |
| 1225 | 1255 | } |
| 1226 | 1256 | } |
| r5613 | r5614 | |
| 1242 | 1272 | a friendly name |
| 1243 | 1273 | -------------------------------------------------*/ |
| 1244 | 1274 | |
| 1245 | astring *input_code_name(astring *string, input_code code) | |
| 1275 | astring *input_code_name(running_machine *machine, astring *string, input_code code) | |
| 1246 | 1276 | { |
| 1247 | input_device_item *item = input_code_item(code); | |
| 1277 | input_device_list *device_list = machine->input_data->device_list; | |
| 1278 | input_device_item *item = input_code_item(machine, code); | |
| 1248 | 1279 | const char *devclass; |
| 1249 | 1280 | const char *devcode; |
| 1250 | 1281 | const char *modifier; |
| r5613 | r5614 | |
| 1301 | 1332 | a given code |
| 1302 | 1333 | -------------------------------------------------*/ |
| 1303 | 1334 | |
| 1304 | astring *input_code_to_token(astring *string, input_code code) | |
| 1335 | astring *input_code_to_token(running_machine *machine, astring *string, input_code code) | |
| 1305 | 1336 | { |
| 1306 | input_device_item *item = input_code_item(code); | |
| 1337 | input_device_item *item = input_code_item(machine, code); | |
| 1307 | 1338 | const char *devclass; |
| 1308 | 1339 | const char *devcode; |
| 1309 | 1340 | const char *itemclass; |
| r5613 | r5614 | |
| 1353 | 1384 | code from a token |
| 1354 | 1385 | -------------------------------------------------*/ |
| 1355 | 1386 | |
| 1356 | input_code input_code_from_token(const char *_token) | |
| 1387 | input_code input_code_from_token(running_machine *machine, const char *_token) | |
| 1357 | 1388 | { |
| 1358 | 1389 | UINT32 devclass, itemid, devindex, modifier, standard; |
| 1359 | 1390 | UINT32 itemclass = ITEM_CLASS_INVALID; |
| r5613 | r5614 | |
| 1402 | 1433 | else |
| 1403 | 1434 | { |
| 1404 | 1435 | input_device *device; |
| 1436 | input_device_list *device_list = machine->input_data->device_list; | |
| 1405 | 1437 | |
| 1406 | 1438 | /* if this is an invalid device, we have nothing to look up */ |
| 1407 | 1439 | if (devindex >= device_list[devclass].count) |
| r5613 | r5614 | |
| 1473 | 1505 | from the code |
| 1474 | 1506 | -------------------------------------------------*/ |
| 1475 | 1507 | |
| 1476 | static input_device_item *input_code_item(input_code code) | |
| 1508 | static input_device_item *input_code_item(running_machine *machine, input_code code) | |
| 1477 | 1509 | { |
| 1478 | input_device *device = input_code_device(code); | |
| 1510 | input_device *device = input_code_device(machine, code); | |
| 1479 | 1511 | input_item_id itemid; |
| 1480 | 1512 | |
| 1481 | 1513 | /* if no device, we fail */ |
| r5613 | r5614 | |
| 1497 | 1529 | value into the class specified by code |
| 1498 | 1530 | -------------------------------------------------*/ |
| 1499 | 1531 | |
| 1500 | static INT32 convert_absolute_value(input_code code, input_device_item *item) | |
| 1532 | static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item) | |
| 1501 | 1533 | { |
| 1534 | input_private *state = machine->input_data; | |
| 1535 | ||
| 1502 | 1536 | /* make sure values are valid */ |
| 1503 | 1537 | assert(item->current >= INPUT_ABSOLUTE_MIN && item->current <= INPUT_ABSOLUTE_MAX); |
| 1504 | 1538 | |
| r5613 | r5614 | |
| 1510 | 1544 | else if (INPUT_CODE_ITEMCLASS(code) == ITEM_CLASS_ABSOLUTE) |
| 1511 | 1545 | { |
| 1512 | 1546 | input_item_modifier modifier = INPUT_CODE_MODIFIER(code); |
| 1513 | INT32 result = apply_deadzone_and_saturation(code, item->current); | |
| 1547 | INT32 result = apply_deadzone_and_saturation(machine, code, item->current); | |
| 1514 | 1548 | |
| 1515 | 1549 | /* if we're doing a lightgun reload hack, override the value */ |
| 1516 | if (lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) | |
| 1550 | if (state->lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) | |
| 1517 | 1551 | { |
| 1518 | input_device_item *button2_item = device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; | |
| 1552 | input_device_item *button2_item = state->device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; | |
| 1519 | 1553 | if (button2_item != NULL) |
| 1520 | 1554 | { |
| 1521 | 1555 | /* if it is pressed, return (min,max) */ |
| 1522 | input_item_update_value(button2_item); | |
| 1556 | input_item_update_value(machine, button2_item); | |
| 1523 | 1557 | if (button2_item->current) |
| 1524 | 1558 | result = (INPUT_CODE_ITEMID(code) == ITEM_ID_XAXIS) ? INPUT_ABSOLUTE_MIN : INPUT_ABSOLUTE_MAX; |
| 1525 | 1559 | } |
| r5613 | r5614 | |
| 1544 | 1578 | /* left/right/up/down: if this is a joystick, fetch the paired X/Y axis values and convert */ |
| 1545 | 1579 | if (modifier >= ITEM_MODIFIER_LEFT && modifier <= ITEM_MODIFIER_DOWN && item->devclass == DEVICE_CLASS_JOYSTICK) |
| 1546 | 1580 | { |
| 1547 | input_device *device = &device_list[item->devclass].list[item->devindex]; | |
| 1581 | input_device *device = &state->device_list[item->devclass].list[item->devindex]; | |
| 1548 | 1582 | input_device_item *xaxis_item = device->item[ITEM_ID_XAXIS]; |
| 1549 | 1583 | input_device_item *yaxis_item = device->item[ITEM_ID_YAXIS]; |
| 1550 | 1584 | if (xaxis_item != NULL && yaxis_item != NULL) |
| r5613 | r5614 | |
| 1554 | 1588 | |
| 1555 | 1589 | /* determine which item we didn't update, and update it */ |
| 1556 | 1590 | assert(item == xaxis_item || item == yaxis_item); |
| 1557 | input_item_update_value((item == xaxis_item) ? yaxis_item : xaxis_item); | |
| 1591 | input_item_update_value(machine, (item == xaxis_item) ? yaxis_item : xaxis_item); | |
| 1558 | 1592 | |
| 1559 | 1593 | /* now map the X and Y axes to a 9x9 grid */ |
| 1560 | 1594 | xaxisval = ((xaxis_item->current - INPUT_ABSOLUTE_MIN) * 9) / (INPUT_ABSOLUTE_MAX - INPUT_ABSOLUTE_MIN + 1); |
| r5613 | r5614 | |
| 1574 | 1608 | |
| 1575 | 1609 | /* positive/negative: TRUE if past the deadzone in either direction */ |
| 1576 | 1610 | if (modifier == ITEM_MODIFIER_POS || modifier == ITEM_MODIFIER_RIGHT || modifier == ITEM_MODIFIER_DOWN) |
| 1577 | return (apply_deadzone_and_saturation(code, item->current) > 0); | |
| 1611 | return (apply_deadzone_and_saturation(machine, code, item->current) > 0); | |
| 1578 | 1612 | else if (modifier == ITEM_MODIFIER_NEG || modifier == ITEM_MODIFIER_LEFT || modifier == ITEM_MODIFIER_UP) |
| 1579 | return (apply_deadzone_and_saturation(code, item->current) < 0); | |
| 1613 | return (apply_deadzone_and_saturation(machine, code, item->current) < 0); | |
| 1580 | 1614 | } |
| 1581 | 1615 | |
| 1582 | 1616 | return 0; |
| r5613 | r5614 | |
| 1619 | 1653 | value into the class specified by code |
| 1620 | 1654 | -------------------------------------------------*/ |
| 1621 | 1655 | |
| 1622 | static INT32 convert_switch_value(input_code code, input_device_item *item) | |
| 1656 | static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item) | |
| 1623 | 1657 | { |
| 1658 | input_private *state = machine->input_data; | |
| 1659 | ||
| 1624 | 1660 | /* only a switch is supported */ |
| 1625 | 1661 | if (INPUT_CODE_ITEMCLASS(code) == ITEM_CLASS_SWITCH) |
| 1626 | 1662 | { |
| 1627 | 1663 | /* if we're doing a lightgun reload hack, button 1 and 2 operate differently */ |
| 1628 | if (lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) | |
| 1664 | if (state->lightgun_reload_button && item->devclass == DEVICE_CLASS_LIGHTGUN) | |
| 1629 | 1665 | { |
| 1630 | 1666 | /* button 1 is pressed if either button 1 or 2 are active */ |
| 1631 | 1667 | if (INPUT_CODE_ITEMID(code) == ITEM_ID_BUTTON1) |
| 1632 | 1668 | { |
| 1633 | input_device_item *button2_item = device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; | |
| 1669 | input_device_item *button2_item = state->device_list[item->devclass].list[item->devindex].item[ITEM_ID_BUTTON2]; | |
| 1634 | 1670 | if (button2_item != NULL) |
| 1635 | 1671 | { |
| 1636 | input_item_update_value(button2_item); | |
| 1672 | input_item_update_value(machine, button2_item); | |
| 1637 | 1673 | return item->current | button2_item->current; |
| 1638 | 1674 | } |
| 1639 | 1675 | } |
| r5613 | r5614 | |
| 1644 | 1680 | } |
| 1645 | 1681 | |
| 1646 | 1682 | /* steadykey for keyboards */ |
| 1647 | if (steadykey_enabled && item->devclass == DEVICE_CLASS_KEYBOARD) | |
| 1683 | if (state->steadykey_enabled && item->devclass == DEVICE_CLASS_KEYBOARD) | |
| 1648 | 1684 | return item->steadykey; |
| 1649 | 1685 | |
| 1650 | 1686 | /* everything else is just the current value as-is */ |
| r5613 | r5614 | |
| 1661 | 1697 | absolute value |
| 1662 | 1698 | -------------------------------------------------*/ |
| 1663 | 1699 | |
| 1664 | static INT32 apply_deadzone_and_saturation(input_code code, INT32 result) | |
| 1700 | static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result) | |
| 1665 | 1701 | { |
| 1702 | input_private *state = machine->input_data; | |
| 1666 | 1703 | int negative = FALSE; |
| 1667 | 1704 | |
| 1668 | 1705 | /* ignore if not a joystick */ |
| r5613 | r5614 | |
| 1677 | 1714 | } |
| 1678 | 1715 | |
| 1679 | 1716 | /* if in the deadzone, return 0 */ |
| 1680 | if (result < joystick_deadzone) | |
| 1717 | if (result < state->joystick_deadzone) | |
| 1681 | 1718 | result = 0; |
| 1682 | 1719 | |
| 1683 | 1720 | /* if saturated, return the max */ |
| 1684 | else if (result > joystick_saturation) | |
| 1721 | else if (result > state->joystick_saturation) | |
| 1685 | 1722 | result = INPUT_ABSOLUTE_MAX; |
| 1686 | 1723 | |
| 1687 | 1724 | /* otherwise, scale */ |
| 1688 | 1725 | else |
| 1689 | result = (INT64)(result - joystick_deadzone) * (INT64)INPUT_ABSOLUTE_MAX / (INT64)(joystick_saturation - joystick_deadzone); | |
| 1726 | result = (INT64)(result - state->joystick_deadzone) * (INT64)INPUT_ABSOLUTE_MAX / (INT64)(state->joystick_saturation - state->joystick_deadzone); | |
| 1690 | 1727 | |
| 1691 | 1728 | /* apply sign and return */ |
| 1692 | 1729 | return negative ? -result : result; |
| r5613 | r5614 | |
|---|---|---|
| 584 | 584 | void input_init(running_machine *machine); |
| 585 | 585 | |
| 586 | 586 | /* enable or disable a device class */ |
| 587 | void input_device_class_enable(input_device_class devclass, UINT8 enable); | |
| 587 | void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable); | |
| 588 | 588 | |
| 589 | 589 | /* is a device class enabled? */ |
| 590 | UINT8 input_device_class_enabled(input_device_class devclass); | |
| 590 | UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass); | |
| 591 | 591 | |
| 592 | 592 | /* configure default joystick maps */ |
| 593 | int input_device_set_joystick_map(int devindex, const char *mapstring); | |
| 593 | int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring); | |
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | /* ----- OSD configuration and access ----- */ |
| r5613 | r5614 | |
| 606 | 606 | /* ----- state queries ----- */ |
| 607 | 607 | |
| 608 | 608 | /* return the value of a particular input code */ |
| 609 | INT32 input_code_value(input_code code); | |
| 609 | INT32 input_code_value(running_machine *machine, input_code code); | |
| 610 | 610 | |
| 611 | 611 | /* return TRUE if the given input code has been pressed */ |
| 612 | INT32 input_code_pressed(input_code code); | |
| 612 | INT32 input_code_pressed(running_machine *machine, input_code code); | |
| 613 | 613 | |
| 614 | 614 | /* same as above, but returns TRUE only on the first call after an off->on transition */ |
| 615 | INT32 input_code_pressed_once(input_code code); | |
| 615 | INT32 input_code_pressed_once(running_machine *machine, input_code code); | |
| 616 | 616 | |
| 617 | 617 | /* translates an input_item_id to an input_code */ |
| 618 | input_code input_code_from_input_item_id(input_item_id itemid); | |
| 618 | input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid); | |
| 619 | 619 | |
| 620 | 620 | /* poll for any switch input, optionally resetting internal memory */ |
| 621 | input_code input_code_poll_switches(int reset); | |
| 621 | input_code input_code_poll_switches(running_machine *machine, int reset); | |
| 622 | 622 | |
| 623 | 623 | /* poll for any keyboard switch input, optionally resetting internal memory */ |
| 624 | input_code input_code_poll_keyboard_switches(int reset); | |
| 624 | input_code input_code_poll_keyboard_switches(running_machine *machine, int reset); | |
| 625 | 625 | |
| 626 | 626 | /* poll for any axis input, optionally resetting internal memory */ |
| 627 | input_code input_code_poll_axes(int reset); | |
| 627 | input_code input_code_poll_axes(running_machine *machine, int reset); | |
| 628 | 628 | |
| 629 | 629 | |
| 630 | 630 | |
| 631 | 631 | /* ----- strings and tokenization ----- */ |
| 632 | 632 | |
| 633 | 633 | /* generate the friendly name of an input code, returning the length (buffer can be NULL) */ |
| 634 | astring *input_code_name(astring *buffer, input_code code); | |
| 634 | astring *input_code_name(running_machine *machine, astring *buffer, input_code code); | |
| 635 | 635 | |
| 636 | 636 | /* convert an input code to a token, returning the length (buffer can be NULL) */ |
| 637 | astring *input_code_to_token(astring *buffer, input_code code); | |
| 637 | astring *input_code_to_token(running_machine *machine, astring *buffer, input_code code); | |
| 638 | 638 | |
| 639 | 639 | /* convert a token back to an input code */ |
| 640 | input_code input_code_from_token(const char *_token); | |
| 640 | input_code input_code_from_token(running_machine *machine, const char *_token); | |
| 641 | 641 | |
| 642 | 642 | |
| 643 | 643 | #endif /* __INPUT_H__ */ |
| r5613 | r5614 | |
|---|---|---|
| 38 | 38 | TYPE DEFINITIONS |
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | |
| 41 | typedef struct _path_iterator path_iterator; | |
| 42 | struct _path_iterator | |
| 43 | { | |
| 44 | const char * base; | |
| 45 | const char * cur; | |
| 46 | int index; | |
| 47 | }; | |
| 48 | ||
| 49 | ||
| 41 | 50 | /* typedef struct _mame_file mame_file -- declared in fileio.h */ |
| 42 | 51 | struct _mame_file |
| 43 | 52 | { |
| r5613 | r5614 | |
| 46 | 55 | #endif |
| 47 | 56 | astring * filename; /* full filename */ |
| 48 | 57 | core_file * file; /* core file pointer */ |
| 58 | path_iterator iterator; /* iterator for paths */ | |
| 49 | 59 | UINT32 openflags; /* flags we used for the open */ |
| 50 | 60 | char hash[HASH_BUF_SIZE]; /* hash data for the file */ |
| 51 | 61 | zip_file * zipfile; /* ZIP file pointer */ |
| r5613 | r5614 | |
| 54 | 64 | }; |
| 55 | 65 | |
| 56 | 66 | |
| 57 | typedef struct _path_iterator path_iterator; | |
| 58 | struct _path_iterator | |
| 59 | { | |
| 60 | const char * base; | |
| 61 | const char * cur; | |
| 62 | int index; | |
| 63 | }; | |
| 64 | ||
| 65 | ||
| 66 | 67 | /* typedef struct _mame_path mame_path -- declared in fileio.h */ |
| 67 | 68 | struct _mame_path |
| 68 | 69 | { |
| r5613 | r5614 | |
| 82 | 83 | static void fileio_exit(running_machine *machine); |
| 83 | 84 | |
| 84 | 85 | /* file open/close */ |
| 85 | static file_error fopen_internal(core_options *opts, | |
| 86 | static file_error fopen_internal(core_options *opts, pa | |
| 86 | 87 | static file_error fopen_attempt_zipped(astring *fullname, UINT32 crc, UINT32 openflags, mame_file *file); |
| 87 | 88 | |
| 88 | 89 | /* path iteration */ |
| r5613 | r5614 | |
| 134 | 135 | |
| 135 | 136 | file_error mame_fopen(const char *searchpath, const char *filename, UINT32 openflags, mame_file **file) |
| 136 | 137 | { |
| 137 | return fopen_internal(mame_options(), searchpath, filename, 0, openflags, file); | |
| 138 | path_iterator iterator; | |
| 139 | path_iterator_init(&iterator, mame_options(), searchpath); | |
| 140 | return fopen_internal(mame_options(), &iterator, filename, 0, openflags, file); | |
| 138 | 141 | } |
| 139 | 142 | |
| 140 | 143 | |
| r5613 | r5614 | |
| 145 | 148 | |
| 146 | 149 | file_error mame_fopen_crc(const char *searchpath, const char *filename, UINT32 crc, UINT32 openflags, mame_file **file) |
| 147 | 150 | { |
| 151 | path_iterator iterator; | |
| 152 | path_iterator_init(&iterator, mame_options(), searchpath); | |
| 148 | 153 | return mame_fopen_crc_options(mame_options(), searchpath, filename, crc, openflags, file); |
| 149 | 154 | } |
| 150 | 155 | |
| r5613 | r5614 | |
| 156 | 161 | |
| 157 | 162 | file_error mame_fopen_options(core_options *opts, const char *searchpath, const char *filename, UINT32 openflags, mame_file **file) |
| 158 | 163 | { |
| 159 | return fopen_internal(opts, searchpath, filename, 0, openflags, file); | |
| 164 | path_iterator iterator; | |
| 165 | path_iterator_init(&iterator, opts, searchpath); | |
| 166 | return fopen_internal(opts, &iterator, filename, 0, openflags, file); | |
| 160 | 167 | } |
| 161 | 168 | |
| 162 | 169 | |
| r5613 | r5614 | |
| 167 | 174 | |
| 168 | 175 | file_error mame_fopen_crc_options(core_options *opts, const char *searchpath, const char *filename, UINT32 crc, UINT32 openflags, mame_file **file) |
| 169 | 176 | { |
| 170 | return fopen_internal(opts, searchpath, filename, crc, openflags | OPEN_FLAG_HAS_CRC, file); | |
| 177 | path_iterator iterator; | |
| 178 | path_iterator_init(&iterator, opts, searchpath); | |
| 179 | return fopen_internal(opts, &iterator, filename, crc, openflags | OPEN_FLAG_HAS_CRC, file); | |
| 171 | 180 | } |
| 172 | 181 | |
| 173 | 182 | |
| r5613 | r5614 | |
| 212 | 221 | fopen_internal - open a file |
| 213 | 222 | -------------------------------------------------*/ |
| 214 | 223 | |
| 215 | static file_error fopen_internal(core_options *opts, | |
| 224 | static file_error fopen_internal(core_options *opts, pa | |
| 216 | 225 | { |
| 217 | 226 | file_error filerr = FILERR_NOT_FOUND; |
| 218 | path_iterator iterator; | |
| 219 | 227 | |
| 220 | 228 | /* can either have a hash or open for write, but not both */ |
| 221 | 229 | if ((openflags & OPEN_FLAG_HAS_CRC) && (openflags & OPEN_FLAG_WRITE)) |
| r5613 | r5614 | |
| 233 | 241 | (*file)->debug_cookie = DEBUG_COOKIE; |
| 234 | 242 | #endif |
| 235 | 243 | |
| 236 | /* if the path is absolute, null out the search path */ | |
| 237 | if (searchpath != NULL && osd_is_absolute_path(searchpath)) | |
| 238 | searchpath = NULL; | |
| 239 | ||
| 240 | /* determine the maximum length of a composed filename, plus some extra space for .zip extensions */ | |
| 241 | path_iterator_init(&iterator, opts, searchpath); | |
| 242 | ||
| 243 | 244 | /* loop over paths */ |
| 244 | 245 | (*file)->filename = astring_alloc(); |
| 245 | while (path_iterator_get_next( | |
| 246 | while (path_iterator_get_next( | |
| 246 | 247 | { |
| 247 | 248 | /* compute the full pathname */ |
| 248 | 249 | if (astring_len((*file)->filename) > 0) |
| r5613 | r5614 | |
| 263 | 264 | } |
| 264 | 265 | } |
| 265 | 266 | |
| 267 | /* if we succeeded, save the iterator */ | |
| 268 | if (filerr == FILERR_NONE) | |
| 269 | (*file)->iterator = *iterator; | |
| 270 | ||
| 266 | 271 | /* handle errors and return */ |
| 267 | | |
| 272 | e | |
| 268 | 273 | { |
| 269 | 274 | mame_fclose(*file); |
| 270 | 275 | *file = NULL; |
| r5613 | r5614 | |
| 389 | 394 | |
| 390 | 395 | |
| 391 | 396 | /*------------------------------------------------- |
| 397 | mame_fclose_and_open_next - close an open | |
| 398 | file, and open the next entry in the original | |
| 399 | searchpath | |
| 400 | -------------------------------------------------*/ | |
| 401 | ||
| 402 | file_error mame_fclose_and_open_next(mame_file **file, const char *filename, UINT32 openflags) | |
| 403 | { | |
| 404 | path_iterator iterator = (*file)->iterator; | |
| 405 | mame_fclose(*file); | |
| 406 | *file = NULL; | |
| 407 | return fopen_internal(mame_options(), &iterator, filename, 0, openflags, file); | |
| 408 | } | |
| 409 | ||
| 410 | ||
| 411 | /*------------------------------------------------- | |
| 392 | 412 | mame_fcompress - enable/disable streaming file |
| 393 | 413 | compression via zlib; level is 0 to disable |
| 394 | 414 | compression, or up to 9 for max compression |
| r5613 | r5614 | |
| 803 | 823 | { |
| 804 | 824 | /* reset the structure */ |
| 805 | 825 | memset(iterator, 0, sizeof(*iterator)); |
| 806 | iterator->base = (searchpath != NULL) ? options_get_string(opts, searchpath) : ""; | |
| 826 | iterator->base = (searchpath != NULL && !osd_is_absolute_path(searchpath)) ? options_get_string(opts, searchpath) : ""; | |
| 807 | 827 | iterator->cur = iterator->base; |
| 808 | 828 | } |
| 809 | 829 |
| r5613 | r5614 | |
|---|---|---|
| 99 | 99 | /* close an open file */ |
| 100 | 100 | void mame_fclose(mame_file *file); |
| 101 | 101 | |
| 102 | /* close an open file, and open the next entry in the original searchpath*/ | |
| 103 | file_error mame_fclose_and_open_next(mame_file **file, const char *filename, UINT32 openflags); | |
| 104 | ||
| 102 | 105 | /* enable/disable streaming file compression via zlib; level is 0 to disable compression, or up to 9 for max compression */ |
| 103 | 106 | file_error mame_fcompress(mame_file *file, int compress); |
| 104 | 107 |
| r5613 | r5614 | |
|---|---|---|
| 77 | 77 | #include "xmlfile.h" |
| 78 | 78 | #include "ui.h" |
| 79 | 79 | #include "uimenu.h" |
| 80 | #include "cheat.h" | |
| 80 | 81 | #include "debug/debugcpu.h" |
| 81 | 82 | #include "debug/express.h" |
| 82 | 83 | |
| r5613 | r5614 | |
| 92 | 93 | CONSTANTS |
| 93 | 94 | ***************************************************************************/ |
| 94 | 95 | |
| 96 | /* turn this on to enable removing duplicate cheats; not sure if we should */ | |
| 97 | #define REMOVE_DUPLICATE_CHEATS 0 | |
| 98 | ||
| 95 | 99 | #define CHEAT_VERSION 1 |
| 96 | 100 | |
| 97 | 101 | #define DEFAULT_TEMP_VARIABLES 10 |
| r5613 | r5614 | |
| 378 | 382 | cheatinfo = auto_alloc_clear(machine, cheat_private); |
| 379 | 383 | machine->cheat_data = cheatinfo; |
| 380 | 384 | |
| 385 | /* load the cheats */ | |
| 386 | cheat_reload(machine); | |
| 387 | ||
| 388 | /* we rely on the debugger expression callbacks; if the debugger isn't | |
| 389 | enabled, we must jumpstart them manually */ | |
| 390 | if ((machine->debug_flags & DEBUG_FLAG_ENABLED) == 0) | |
| 391 | debug_cpu_init(machine); | |
| 392 | } | |
| 393 | ||
| 394 | ||
| 395 | /*------------------------------------------------- | |
| 396 | cheat_reload - re-initialize the cheat engine, | |
| 397 | and reload the cheat file(s) | |
| 398 | -------------------------------------------------*/ | |
| 399 | ||
| 400 | void cheat_reload(running_machine *machine) | |
| 401 | { | |
| 402 | cheat_private *cheatinfo = machine->cheat_data; | |
| 403 | ||
| 404 | /* free everything */ | |
| 405 | cheat_exit(machine); | |
| 406 | ||
| 407 | /* reset our memory */ | |
| 408 | memset(cheatinfo, 0, sizeof(*cheatinfo)); | |
| 409 | ||
| 381 | 410 | /* load the cheat file, MESS will load a crc32.xml ( eg. 01234567.xml ) |
| 382 | 411 | and MAME will load gamename.xml */ |
| 383 | 412 | #ifdef MESS |
| r5613 | r5614 | |
| 394 | 423 | /* temporary: save the file back out as output.xml for comparison */ |
| 395 | 424 | if (cheatinfo->cheatlist != NULL) |
| 396 | 425 | cheat_list_save("output", cheatinfo->cheatlist); |
| 397 | ||
| 398 | /* we rely on the debugger expression callbacks; if the debugger isn't | |
| 399 | enabled, we must jumpstart them manually */ | |
| 400 | if ((machine->debug_flags & DEBUG_FLAG_ENABLED) == 0) | |
| 401 | debug_cpu_init(machine); | |
| 402 | 426 | } |
| 403 | 427 | |
| 404 | 428 | |
| r5613 | r5614 | |
| 791 | 815 | } |
| 792 | 816 | |
| 793 | 817 | |
| 818 | /*------------------------------------------------- | |
| 819 | cheat_get_comment - called by the UI system | |
| 820 | to help render displayable comments | |
| 821 | -------------------------------------------------*/ | |
| 794 | 822 | |
| 823 | astring *cheat_get_comment(void *entry) | |
| 824 | { | |
| 825 | cheat_entry *cheat = (cheat_entry *)entry; | |
| 826 | return cheat->comment; | |
| 827 | } | |
| 828 | ||
| 829 | ||
| 830 | ||
| 795 | 831 | /*************************************************************************** |
| 796 | 832 | CHEAT EXECUTION |
| 797 | 833 | ***************************************************************************/ |
| r5613 | r5614 | |
| 926 | 962 | |
| 927 | 963 | static cheat_entry *cheat_list_load(running_machine *machine, const char *filename) |
| 928 | 964 | { |
| 929 | xml_data_node *rootnode | |
| 965 | xml_data_node *rootnode | |
| 930 | 966 | cheat_entry *cheatlist = NULL; |
| 931 | cheat_entry **cheattailptr; | |
| 932 | xml_parse_options options; | |
| 933 | xml_parse_error error; | |
| 934 | mame_file *cheatfile; | |
| 967 | cheat_entry **cheattailptr = &cheatlist; | |
| 968 | mame_file *cheatfile = NULL; | |
| 935 | 969 | file_error filerr; |
| 936 | 970 | astring *fname; |
| 937 | int version; | |
| 938 | 971 | |
| 939 | 972 | /* open the file with the proper name */ |
| 940 | 973 | fname = astring_assemble_2(astring_alloc(), filename, ".xml"); |
| 941 | 974 | filerr = mame_fopen(SEARCHPATH_CHEAT, astring_c(fname), OPEN_FLAG_READ, &cheatfile); |
| 942 | astring_free(fname); | |
| 943 | 975 | |
| 944 | /* if that failed, return nothing */ | |
| 945 | if (filerr != FILERR_NONE) | |
| 946 | return NULL; | |
| 976 | /* loop over all instrances of the files found in our search paths */ | |
| 977 | while (filerr == FILERR_NONE) | |
| 978 | { | |
| 979 | xml_data_node *mamecheatnode, *cheatnode; | |
| 980 | xml_parse_options options; | |
| 981 | xml_parse_error error; | |
| 982 | cheat_entry *scannode; | |
| 983 | int version; | |
| 947 | 984 | |
| 948 | /* read the XML file into internal data structures */ | |
| 949 | memset(&options, 0, sizeof(options)); | |
| 950 | options.error = &error; | |
| 951 | rootnode = xml_file_read(mame_core_file(cheatfile), &options); | |
| 952 | mame_fclose(cheatfile); | |
| 985 | mame_printf_verbose("Loading cheats file from %s\n", mame_file_full_name(cheatfile)); | |
| 953 | 986 | |
| 954 | /* if unable to parse the file, just bail */ | |
| 955 | if (rootnode == NULL) | |
| 956 | { | |
| 957 | mame_printf_error("%s.xml(%d): error parsing XML (%s)\n", filename, error.error_line, error.error_message); | |
| 958 | return NULL; | |
| 959 | } | |
| 987 | /* read the XML file into internal data structures */ | |
| 988 | memset(&options, 0, sizeof(options)); | |
| 989 | options.error = &error; | |
| 990 | rootnode = xml_file_read(mame_core_file(cheatfile), &options); | |
| 960 | 991 | |
| 961 | /* find the layout node */ | |
| 962 | mamecheatnode = xml_get_sibling(rootnode->child, "mamecheat"); | |
| 963 | if (mamecheatnode == NULL) | |
| 964 | { | |
| 965 | mame_printf_error("%s.xml: missing mamecheatnode node", filename); | |
| 966 | goto error; | |
| 967 | } | |
| 992 | /* if unable to parse the file, just bail */ | |
| 993 | if (rootnode == NULL) | |
| 994 | { | |
| 995 | mame_printf_error("%s.xml(%d): error parsing XML (%s)\n", filename, error.error_line, error.error_message); | |
| 996 | goto error; | |
| 997 | } | |
| 968 | 998 | |
| 969 | /* validate the config data version */ | |
| 970 | version = xml_get_attribute_int(mamecheatnode, "version", 0); | |
| 971 | if (version != CHEAT_VERSION) | |
| 972 | { | |
| 973 | mame_printf_error("%s.xml(%d): Invalid cheat XML file: unsupported version", filename, mamecheatnode->line); | |
| 974 | goto error; | |
| 975 | } | |
| 999 | /* find the layout node */ | |
| 1000 | mamecheatnode = xml_get_sibling(rootnode->child, "mamecheat"); | |
| 1001 | if (mamecheatnode == NULL) | |
| 1002 | { | |
| 1003 | mame_printf_error("%s.xml: missing mamecheatnode node", filename); | |
| 1004 | goto error; | |
| 1005 | } | |
| 976 | 1006 | |
| 977 | /* parse all the elements */ | |
| 978 | cheatlist = NULL; | |
| 979 | cheattailptr = &cheatlist; | |
| 980 | for (cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != NULL; cheatnode = xml_get_sibling(cheatnode->next, "cheat")) | |
| 981 | { | |
| 982 | /* load this entry */ | |
| 983 | cheat_entry *curcheat = cheat_entry_load(machine, filename, cheatnode); | |
| 984 | if (curcheat == NULL) | |
| 1007 | /* validate the config data version */ | |
| 1008 | version = xml_get_attribute_int(mamecheatnode, "version", 0); | |
| 1009 | if (version != CHEAT_VERSION) | |
| 1010 | { | |
| 1011 | mame_printf_error("%s.xml(%d): Invalid cheat XML file: unsupported version", filename, mamecheatnode->line); | |
| 985 | 1012 | goto error; |
| 1013 | } | |
| 986 | 1014 | |
| 987 | /* add to the end of the list */ | |
| 988 | *cheattailptr = curcheat; | |
| 989 | cheattailptr = &curcheat->next; | |
| 1015 | /* parse all the elements */ | |
| 1016 | for (cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != NULL; cheatnode = xml_get_sibling(cheatnode->next, "cheat")) | |
| 1017 | { | |
| 1018 | /* load this entry */ | |
| 1019 | cheat_entry *curcheat = cheat_entry_load(machine, filename, cheatnode); | |
| 1020 | if (curcheat == NULL) | |
| 1021 | goto error; | |
| 1022 | ||
| 1023 | /* make sure we're not a duplicate */ | |
| 1024 | scannode = NULL; | |
| 1025 | if (REMOVE_DUPLICATE_CHEATS) | |
| 1026 | for (scannode = cheatlist; scannode != NULL; scannode = scannode->next) | |
| 1027 | if (astring_cmp(scannode->description, curcheat->description) == 0) | |
| 1028 | { | |
| 1029 | mame_printf_verbose("Ignoring duplicate cheat '%s' from file %s\n", astring_c(curcheat->description), mame_file_full_name(cheatfile)); | |
| 1030 | break; | |
| 1031 | } | |
| 1032 | ||
| 1033 | /* add to the end of the list */ | |
| 1034 | if (scannode == NULL) | |
| 1035 | { | |
| 1036 | *cheattailptr = curcheat; | |
| 1037 | cheattailptr = &curcheat->next; | |
| 1038 | } | |
| 1039 | } | |
| 1040 | ||
| 1041 | /* free the file and loop for the next one */ | |
| 1042 | xml_file_free(rootnode); | |
| 1043 | ||
| 1044 | /* open the next file in sequence */ | |
| 1045 | filerr = mame_fclose_and_open_next(&cheatfile, astring_c(fname), OPEN_FLAG_READ); | |
| 990 | 1046 | } |
| 991 | 1047 | |
| 992 | /* free the file and exit */ | |
| 993 | xml_file_free(rootnode); | |
| 1048 | /* release memory and return the cheat list */ | |
| 1049 | astring_free(fname); | |
| 994 | 1050 | return cheatlist; |
| 995 | 1051 | |
| 996 | 1052 | error: |
| 997 | 1053 | cheat_list_free(cheatlist); |
| 998 | 1054 | xml_file_free(rootnode); |
| 1055 | if (cheatfile != NULL) | |
| 1056 | mame_fclose(cheatfile); | |
| 1057 | astring_free(fname); | |
| 999 | 1058 | return NULL; |
| 1000 | 1059 | } |
| 1001 | 1060 |
| r5613 | r5614 | |
|---|---|---|
| 1648 | 1648 | |
| 1649 | 1649 | init_resource_tracking(); |
| 1650 | 1650 | begin_resource_tracking(); |
| 1651 | | |
| 1651 | get_profile | |
| 1652 | 1652 | |
| 1653 | 1653 | /* prepare by pre-scanning all the drivers and adding their info to hash tables */ |
| 1654 | prep -= | |
| 1654 | prep -= get_profile | |
| 1655 | 1655 | quark_tables_create(&tables); |
| 1656 | prep += | |
| 1656 | prep += get_profile | |
| 1657 | 1657 | |
| 1658 | 1658 | /* iterate over all drivers */ |
| 1659 | 1659 | for (drivnum = 0; drivers[drivnum]; drivnum++) |
| r5613 | r5614 | |
| 1670 | 1670 | memset(&rgninfo, 0, sizeof(rgninfo)); |
| 1671 | 1671 | |
| 1672 | 1672 | /* expand the machine driver */ |
| 1673 | expansion -= | |
| 1673 | expansion -= get_profile | |
| 1674 | 1674 | config = machine_config_alloc(driver->machine_config); |
| 1675 | expansion += | |
| 1675 | expansion += get_profile | |
| 1676 | 1676 | |
| 1677 | 1677 | /* validate the driver entry */ |
| 1678 | driver_checks -= | |
| 1678 | driver_checks -= get_profile | |
| 1679 | 1679 | error = validate_driver(drivnum, config, &tables) || error; |
| 1680 | driver_checks += | |
| 1680 | driver_checks += get_profile | |
| 1681 | 1681 | |
| 1682 | 1682 | /* validate the ROM information */ |
| 1683 | rom_checks -= | |
| 1683 | rom_checks -= get_profile | |
| 1684 | 1684 | error = validate_roms(drivnum, config, &rgninfo) || error; |
| 1685 | rom_checks += | |
| 1685 | rom_checks += get_profile | |
| 1686 | 1686 | |
| 1687 | 1687 | /* validate input ports */ |
| 1688 | input_checks -= | |
| 1688 | input_checks -= get_profile | |
| 1689 | 1689 | error = validate_inputs(drivnum, config, tables.defstr, &portlist) || error; |
| 1690 | input_checks += | |
| 1690 | input_checks += get_profile | |
| 1691 | 1691 | |
| 1692 | 1692 | /* validate the CPU information */ |
| 1693 | cpu_checks -= | |
| 1693 | cpu_checks -= get_profile | |
| 1694 | 1694 | error = validate_cpu(drivnum, config) || error; |
| 1695 | cpu_checks += | |
| 1695 | cpu_checks += get_profile | |
| 1696 | 1696 | |
| 1697 | 1697 | /* validate the display */ |
| 1698 | display_checks -= | |
| 1698 | display_checks -= get_profile | |
| 1699 | 1699 | error = validate_display(drivnum, config) || error; |
| 1700 | display_checks += | |
| 1700 | display_checks += get_profile | |
| 1701 | 1701 | |
| 1702 | 1702 | /* validate the graphics decoding */ |
| 1703 | gfx_checks -= | |
| 1703 | gfx_checks -= get_profile | |
| 1704 | 1704 | error = validate_gfx(drivnum, config, &rgninfo) || error; |
| 1705 | gfx_checks += | |
| 1705 | gfx_checks += get_profile | |
| 1706 | 1706 | |
| 1707 | 1707 | /* validate sounds and speakers */ |
| 1708 | sound_checks -= | |
| 1708 | sound_checks -= get_profile | |
| 1709 | 1709 | error = validate_sound(drivnum, config) || error; |
| 1710 | sound_checks += | |
| 1710 | sound_checks += get_profile | |
| 1711 | 1711 | |
| 1712 | 1712 | /* validate devices */ |
| 1713 | device_checks -= | |
| 1713 | device_checks -= get_profile | |
| 1714 | 1714 | error = validate_devices(drivnum, config, portlist, &rgninfo) || error; |
| 1715 | device_checks += | |
| 1715 | device_checks += get_profile | |
| 1716 | 1716 | |
| 1717 | 1717 | for (rgnnum = 0; rgnnum < ARRAY_LENGTH(rgninfo.entries); rgnnum++) |
| 1718 | 1718 | if (rgninfo.entries[rgnnum].tag != NULL) |
| r5613 | r5614 | |
| 1723 | 1723 | } |
| 1724 | 1724 | |
| 1725 | 1725 | #ifdef MESS |
| 1726 | mess_checks -= | |
| 1726 | mess_checks -= get_profile | |
| 1727 | 1727 | if (mess_validitychecks()) |
| 1728 | 1728 | error = TRUE; |
| 1729 | mess_checks += | |
| 1729 | mess_checks += get_profile | |
| 1730 | 1730 | #endif /* MESS */ |
| 1731 | 1731 | |
| 1732 | 1732 | #if (REPORT_TIMES) |
| r5613 | r5614 | |
|---|---|---|
| 28 | 28 | /* initialize the cheat system, loading any cheat files */ |
| 29 | 29 | void cheat_init(running_machine *machine); |
| 30 | 30 | |
| 31 | /* re-initialize the cheat system, reloading any cheat files */ | |
| 32 | void cheat_reload(running_machine *machine); | |
| 31 | 33 | |
| 32 | 34 | |
| 35 | ||
| 33 | 36 | /* ----- cheat UI helpers ----- */ |
| 34 | 37 | |
| 35 | 38 | /* render any text overlays */ |
| r5613 | r5614 | |
| 50 | 53 | /* select the next menu state */ |
| 51 | 54 | int cheat_select_next_state(running_machine *machine, void *entry); |
| 52 | 55 | |
| 56 | /* return the displayable comment of the current cheat */ | |
| 57 | astring *cheat_get_comment(void *entry); | |
| 53 | 58 | |
| 59 | ||
| 54 | 60 | #endif /* __CHEAT_H__ */ |
| r5613 | r5614 | |
|---|---|---|
| 125 | 125 | { |
| 126 | 126 | /* identify this keycode */ |
| 127 | 127 | itemid = non_char_keys[i]; |
| 128 | code = input_code_from_input_item_id(itemid); | |
| 128 | code = input_code_from_input_item_id(machine, itemid); | |
| 129 | 129 | |
| 130 | 130 | /* ...and determine if it is pressed */ |
| 131 | pressed = input_code_pressed(code); | |
| 131 | pressed = input_code_pressed(machine, code); | |
| 132 | 132 | |
| 133 | 133 | /* figure out whey we are in the key_down map */ |
| 134 | 134 | key_down_ptr = &machine->ui_mess_data->non_char_keys_down[i / 8]; |
| r5613 | r5614 | |
|---|---|---|
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | /* Debugging commands and handlers. */ |
| 91 | static | |
| 91 | static CPU | |
| 92 | 92 | static void execute_beta_dat_log(running_machine *machine, int ref, int params, const char *param[]); |
| 93 | 93 | static void execute_beta_key_dump(running_machine *machine, int ref, int params, const char *param[]); |
| 94 | 94 | |
| r5613 | r5614 | |
| 1120 | 1120 | { |
| 1121 | 1121 | dgnbeta_init_video(machine); |
| 1122 | 1122 | |
| 1123 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), dgnbeta_dasm_override); | |
| 1123 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), CPU_DISASSEMBLE_NAME(dgnbeta_dasm_override)); | |
| 1124 | 1124 | |
| 1125 | 1125 | add_reset_callback(machine, dgnbeta_reset); |
| 1126 | 1126 | dgnbeta_reset(machine); |
| r5613 | r5614 | |
| 1290 | 1290 | }; |
| 1291 | 1291 | |
| 1292 | 1292 | |
| 1293 | static | |
| 1293 | static CPU | |
| 1294 | 1294 | { |
| 1295 | 1295 | unsigned call; |
| 1296 | 1296 | unsigned result = 0; |
| r5613 | r5614 | |
|---|---|---|
| 207 | 207 | |
| 208 | 208 | #define GIME_TYPE_1987 0 |
| 209 | 209 | |
| 210 | static | |
| 210 | static CPU | |
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | /* ----------------------------------------------------------------------- */ |
| r5613 | r5614 | |
| 2893 | 2893 | /* setup printer output callback */ |
| 2894 | 2894 | printer_out = init->printer_out_; |
| 2895 | 2895 | |
| 2896 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), coco_dasm_override); | |
| 2896 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), CPU_DISASSEMBLE_NAME(coco_dasm_override)); | |
| 2897 | 2897 | |
| 2898 | 2898 | state_save_register_global(machine, mux_sel1); |
| 2899 | 2899 | state_save_register_global(machine, mux_sel2); |
| r5613 | r5614 | |
| 3217 | 3217 | }; |
| 3218 | 3218 | |
| 3219 | 3219 | |
| 3220 | static | |
| 3220 | static CPU | |
| 3221 | 3221 | { |
| 3222 | 3222 | unsigned call; |
| 3223 | 3223 | unsigned result = 0; |
| 3224 | 3224 | |
| 3225 | /* check for SWI2 instruction */ | |
| 3225 | 3226 | if ((oprom[0] == 0x10) && (oprom[1] == 0x3F)) |
| 3226 | 3227 | { |
| 3227 | 3228 | call = oprom[2]; |
| r5613 | r5614 | |
|---|---|---|
| 130 | 130 | static WRITE8_DEVICE_HANDLER(mac_via2_out_b); |
| 131 | 131 | static void mac_via_irq(const device_config *device, int state); |
| 132 | 132 | static void mac_via2_irq(const device_config *device, int state); |
| 133 | static | |
| 133 | static CPU | |
| 134 | 134 | |
| 135 | 135 | const via6522_interface mac_via6522_intf = |
| 136 | 136 | { |
| r5613 | r5614 | |
| 1969 | 1969 | |
| 1970 | 1970 | inquiry_timeout = timer_alloc(machine, inquiry_timeout_func, NULL); |
| 1971 | 1971 | |
| 1972 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), mac_dasm_override); | |
| 1972 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), CPU_DISASSEMBLE_NAME(mac_dasm_override)); | |
| 1973 | 1973 | |
| 1974 | 1974 | /* save state stuff */ |
| 1975 | 1975 | state_save_register_global(machine, mac_overlay); |
| r5613 | r5614 | |
| 2925 | 2925 | |
| 2926 | 2926 | |
| 2927 | 2927 | |
| 2928 | static | |
| 2928 | static CPU | |
| 2929 | 2929 | { |
| 2930 | 2930 | UINT16 opcode; |
| 2931 | 2931 | unsigned result = 0; |
| r5613 | r5614 | |
|---|---|---|
| 406 | 406 | given code; used for logging and debugging |
| 407 | 407 | -------------------------------------------------*/ |
| 408 | 408 | |
| 409 | static const char *code_point_string(unicode_char ch) | |
| 409 | static const char *code_point_string(running_machine *machine, unicode_char ch) | |
| 410 | 410 | { |
| 411 | 411 | static char buf[16]; |
| 412 | 412 | const char *result = buf; |
| r5613 | r5614 | |
| 430 | 430 | { |
| 431 | 431 | /* try to obtain a codename with input_code_name(); this can result in an empty string */ |
| 432 | 432 | astring *astr = astring_alloc(); |
| 433 | input_code_name(astr, (input_code) ch - UCHAR_MAMEKEY_BEGIN); | |
| 433 | input_code_name(machine, astr, (input_code) ch - UCHAR_MAMEKEY_BEGIN); | |
| 434 | 434 | snprintf(buf, ARRAY_LENGTH(buf), "%s", astring_c(astr)); |
| 435 | 435 | astring_free(astr); |
| 436 | 436 | } |
| r5613 | r5614 | |
| 472 | 472 | sets up natural keyboard input mapping |
| 473 | 473 | -------------------------------------------------*/ |
| 474 | 474 | |
| 475 | static int scan_keys(const input_port_config *portconfig, mess_input_code *codes, input_port_config_c *ports, input_field_config_c *shift_ports, int keys, int shift) | |
| 475 | static int scan_keys(running_machine *machine, const input_port_config *portconfig, mess_input_code *codes, input_port_config_c *ports, input_field_config_c *shift_ports, int keys, int shift) | |
| 476 | 476 | { |
| 477 | 477 | int code_count = 0; |
| 478 | 478 | const input_port_config *port; |
| r5613 | r5614 | |
| 494 | 494 | if ((code >= UCHAR_SHIFT_BEGIN) && (code <= UCHAR_SHIFT_END)) |
| 495 | 495 | { |
| 496 | 496 | shift_ports[keys] = field; |
| 497 | code_count += scan_keys(portconfig, | |
| 497 | code_count += scan_keys(machine, | |
| 498 | portconfig, | |
| 498 | 499 | codes ? &codes[code_count] : NULL, |
| 499 | 500 | ports, |
| 500 | 501 | shift_ports, |
| r5613 | r5614 | |
| 516 | 517 | code_count++; |
| 517 | 518 | |
| 518 | 519 | if (LOG_INPUTX) |
| 519 | logerror("inputx: code=%i (%s) port=%p field->name='%s'\n", (int) code, code_point_string(code), port, field->name); | |
| 520 | logerror("inputx: code=%i (%s) port=%p field->name='%s'\n", (int) code, code_point_string(machine, code), port, field->name); | |
| 520 | 521 | } |
| 521 | 522 | } |
| 522 | 523 | } |
| r5613 | r5614 | |
| 541 | 542 | int code_count; |
| 542 | 543 | |
| 543 | 544 | /* first count the number of codes */ |
| 544 | code_count = scan_keys(portconfig, NULL, ports, fields, 0, 0); | |
| 545 | code_count = scan_keys(machine, portconfig, NULL, ports, fields, 0, 0); | |
| 545 | 546 | if (code_count > 0) |
| 546 | 547 | { |
| 547 | 548 | /* allocate the codes */ |
| 548 | 549 | codes = auto_alloc_array_clear(machine, mess_input_code, code_count + 1); |
| 549 | 550 | |
| 550 | 551 | /* and populate them */ |
| 551 | scan_keys(portconfig, codes, ports, fields, 0, 0); | |
| 552 | scan_keys(machine, portconfig, codes, ports, fields, 0, 0); | |
| 552 | 553 | } |
| 553 | 554 | return codes; |
| 554 | 555 | } |
| r5613 | r5614 | |
| 856 | 857 | if (LOG_INPUTX) |
| 857 | 858 | { |
| 858 | 859 | code = find_code(ch); |
| 859 | logerror("inputx_postn(): code=%i (%s) field->name='%s'\n", (int) ch, code_point_string(ch), (code && code->field[0]) ? code->field[0]->name : "<null>"); | |
| 860 | logerror("inputx_postn(): code=%i (%s) field->name='%s'\n", (int) ch, code_point_string(machine, ch), (code && code->field[0]) ? code->field[0]->name : "<null>"); | |
| 860 | 861 | } |
| 861 | 862 | |
| 862 | 863 | if (can_post_key_directly(ch)) |
| r5613 | r5614 | |
| 1554 | 1555 | /* describe the character code */ |
| 1555 | 1556 | pos += snprintf(&buffer[pos], ARRAY_LENGTH(buffer) - pos, "%08X (%s) ", |
| 1556 | 1557 | code->ch, |
| 1557 | code_point_string(code->ch)); | |
| 1558 | code_point_string(machine, code->ch)); | |
| 1558 | 1559 | |
| 1559 | 1560 | /* pad with spaces */ |
| 1560 | 1561 | while(pos < left_column_width) |
| r5613 | r5614 | |
|---|---|---|
| 1071 | 1071 | |
| 1072 | 1072 | // retrieve the seq name |
| 1073 | 1073 | seqstring = astring_alloc(); |
| 1074 | input_seq_name(seqstring, stuff->code); | |
| 1074 | input_seq_name(Machine, seqstring, stuff->code); | |
| 1075 | 1075 | |
| 1076 | 1076 | // change the text - avoid calls to SetWindowText() if we can |
| 1077 | 1077 | win_get_window_text_utf8(editwnd, buffer, ARRAY_LENGTH(buffer)); |
| r5613 | r5614 | |
| 1132 | 1132 | win_window_list = &fake_window_info; |
| 1133 | 1133 | |
| 1134 | 1134 | // start the polling |
| 1135 | input_seq_poll_start(stuff->is_analog ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, NULL); | |
| 1135 | input_seq_poll_start(Machine, stuff->is_analog ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, NULL); | |
| 1136 | 1136 | |
| 1137 | 1137 | while(stuff->poll_state == SEQSELECT_STATE_POLLING) |
| 1138 | 1138 | { |
| 1139 | 1139 | // poll |
| 1140 | /*ret = */input_seq_poll(stuff->code); | |
| 1140 | /*ret = */input_seq_poll(Machine, stuff->code); | |
| 1141 | 1141 | seqselect_settext(editwnd); |
| 1142 | 1142 | } |
| 1143 | 1143 |
| r5613 | r5614 | |
|---|---|---|
| 16 | 16 | #include "debugger.h" |
| 17 | 17 | |
| 18 | 18 | |
| 19 | static | |
| 19 | static CPU | |
| 20 | 20 | |
| 21 | 21 | static UINT8 port_f_latch; |
| 22 | 22 | static UINT16 spim_data; |
| r5613 | r5614 | |
| 137 | 137 | |
| 138 | 138 | static DRIVER_INIT( palm ) |
| 139 | 139 | { |
| 140 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), palm_dasm_override); | |
| 140 | debug_cpu_set_dasm_override(cputag_get_cpu(machine, "maincpu"), CPU_DISASSEMBLE_NAME(palm_dasm_override)); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | static const mc68328_interface palm_dragonball_iface = |
| r5613 | r5614 | |
| 1639 | 1639 | return NULL; |
| 1640 | 1640 | } |
| 1641 | 1641 | |
| 1642 | static | |
| 1642 | static CPU | |
| 1643 | 1643 | { |
| 1644 | 1644 | UINT16 opcode; |
| 1645 | 1645 | unsigned result = 0; |
| r5613 | r5614 | |
|---|---|---|
| 77 | 77 | |
| 78 | 78 | Source Changes: |
| 79 | 79 | ---------------- |
| 80 | - The core is based on MAME 0.133u | |
| 80 | - The core is based on MAME 0.133u5. This incorporates all features of the | |
| 81 | 81 | update to this core. [MAME team] |
| 82 | 82 | |
| 83 | 83 |
| Previous | 15994 Revisions | Next |