Previous 15994 Revisions Next

r4058 Monday 5th January, 2009 at 02:08:25 UTC by Nathan Woods
Updated to MAME 0.129 core
[ROOT]whatsnew.txt
[docs]messnew.txt
[src/emu]audit.c clifront.c clifront.h cpuexec.c cpuexec.h cpuintrf.h devconv.h emu.mak info.c inptport.c input.c mame.c mame.h mamecore.h memconv.h memory.c memory.h profiler.c profiler.h restrack.c romload.c romload.h streams.c tilemap.c timer.c timer.h ui.c uimenu.c
[src/emu/cpu]cpu.mak
[src/emu/cpu/adsp2100]adsp2100.c
[src/emu/cpu/arm7]arm7.c
[src/emu/cpu/asap]asap.c
[src/emu/cpu/ccpu]ccpu.c
[src/emu/cpu/cdp1802]cdp1802.c
[src/emu/cpu/cop400]cop410.c cop420.c cop440.c
[src/emu/cpu/cp1610]cp1610.h
[src/emu/cpu/esrip]esrip.c* esrip.h*
[src/emu/cpu/h83002]h8_16.c h8_8.c
[src/emu/cpu/hd6309]hd6309.c
[src/emu/cpu/i386]i386ops.c
[src/emu/cpu/i86]i286.c i86.c instr86.c
[src/emu/cpu/i860]i860.c* i860.h* i860dasm.c*
[src/emu/cpu/i960]i960.c
[src/emu/cpu/jaguar]jaguar.c
[src/emu/cpu/m6502]m4510.c m6502.c m6502.h m6509.c m65ce02.c ops02.h
[src/emu/cpu/m6800]m6800.c
[src/emu/cpu/m68000]m68000.h m68k_in.c m68kcpu.c m68kcpu.h m68kfpu.c
[src/emu/cpu/m6809]m6809.c
[src/emu/cpu/mb88xx]mb88xx.c
[src/emu/cpu/mcs48]mcs48.c mcs48.h mcs48dsm.c
[src/emu/cpu/mcs51]mcs51.c
[src/emu/cpu/mips]psx.c
[src/emu/cpu/powerpc]drc_ops.c ppc.c ppc.h ppc603.c ppc_dasm.c ppc_mem.c ppc_ops.c ppccom.h ppcdrc.c ppcfe.c
[src/emu/cpu/sh2]sh2.c sh2.h sh2comn.c sh2drc.c
[src/emu/cpu/sh4]sh4.c sh4.h
[src/emu/cpu/tlcs90]tlcs90.c
[src/emu/cpu/tms32031]tms32031.c
[src/emu/cpu/tms34010]tms34010.c
[src/emu/cpu/v60]v60.c
[src/emu/cpu/v810]v810.c
[src/emu/cpu/z80]z80.c
[src/emu/debug]debugcmd.c debugcmt.c debugcpu.c debugcpu.h debugvw.c
[src/emu/drivers]xtal.h
[src/emu/machine]6850acia.c 74148.c 74148.h 74153.c 7474.c at28c16.c generic.c i8243.c* i8243.h* laserdsc.h ldcore.c
[src/emu/sound]2151intf.h 2203intf.h 2413intf.h 2608intf.h 2610intf.h 2612intf.h 262intf.h 3812intf.c 3812intf.h 5110intf.h 5220intf.h aica.c aica.h astrocde.c astrocde.h ay8910.c ay8910.h beep.h bsmt2000.h c140.h c352.h c6280.h cdda.h cdp1869.h cem3394.h custom.h dac.h discrete.h dmadac.h es5503.h es5506.h es8712.h flt_rc.h flt_vol.h gaelco.h hc55516.h ics2115.h iremga20.h k005289.h k007232.h k051649.h k053260.h k054539.h msm5205.h msm5232.h multipcm.h n63701x.h namco.h namco52.h nes_apu.h nile.h okim6258.h okim6295.h pokey.c pokey.h psx.h qsound.h rf5c400.h rf5c68.h s14001a.h saa1099.h samples.h scsp.c scsp.h segapcm.h sid.h sid6581.h sn76477.h sn76496.h snkwave.h sp0250.c sp0250.h sp0256.h speaker.h st0016.h tiaintf.h tms3615.h tms36xx.h upd7759.h vlm5030.h votrax.c votrax.h* vrender0.h wave.h x1_010.h ym2151.c ymf271.c ymf271.h ymf278b.h ymz280b.c ymz280b.h
[src/ldplayer]ldplayer.c ldplayer.mak
[src/lib/util]coreutil.c
[src/mame]mame.mak mamedriv.c
[src/mame/audio]exidy.c gottlieb.c segag80r.c tx1.c
[src/mame/drivers]1943.c 2mindril.c 40love.c 4enraya.c 4roses.c 88games.c ajax.c aliens.c astrocorp.c atarisy1.c balsente.c bingoc.c* bishjan.c btime.c calomega.c carpolo.c carrera.c cb2001.c cchance.c* centiped.c chinagat.c circus.c coinmstr.c coolpool.c cps3.c cubeqst.c ddenlovr.c ddragon.c ddragon3.c decocass.c dkong.c dmndrby.c docastle.c drw80pkr.c dynax.c esripsys.c* exidy.c fruit.c* funworld.c galaga.c galaxian.c galaxold.c galdrvr.c gamecstl.c goldnpkr.c goldstar.c goodejan.c gottlieb.c gridlee.c gstream.c igs009.c igs017.c* igs_blit.c igs_m68.c jack.c jangou.c janshi.c jokrwild.c jongkyo.c konamim2.c ksys573.c laserbat.c liberate.c luckgrln.c* m72.c magicard.c* magicfly.c malzak.c megatech.c merit.c midwunit.c miniboy7.c model1.c mpoker.c* mrdo.c ms32.c murogem.c namcofl.c namcoic.c namcos12.c namcos21.c naomi.c nbmj8688.c nbmj8891.c nbmj8991.c neodrvr.c nightgal.c* nmk16.c polepos.c popeye.c progolf.c psikyosh.c qix.c raiden2.c realbrk.c rockola.c rocnrope.c route16.c royalmah.c scobra.c scramble.c seattle.c segas16a.c segas18.c seta.c seta2.c shadfrce.c slotcarn.c* statriv2.c subsino.c suna16.c suna8.c taito_z.c taitoair.c taitopjc.c* taitotz.c* thunderj.c tmnt.c tnzs.c toaplan2.c tutankhm.c tx1.c usgames.c vamphalf.c vball.c vcombat.c videopkr.c wc90b.c wwfsstar.c wwfwfest.c xain.c zn.c zr107.c
[src/mame/includes]btime.h docastle.h esripsys.h* nb1413m3.h tx1.h vball.h
[src/mame/layout]polepos.lay*
[src/mame/machine]carpolo.c decocass.c decocass.h decoprot.c docastle.c leland.c segaic16.c tnzs.c vertigo.c
[src/mame/video]1943.c 40love.c 88games.c btime.c carpolo.c circus.c decocass.c esripsys.c* exidy.c goodejan.c gridlee.c gticlub.c jack.c mrdo.c nmk16.c polepos.c popeye.c segaic16.c segas18.c tx1.c vball.c
[src/mess]mess.mak
[src/mess/machine]apple3.c c128.c c16.c c64.c coco.c dgn_beta.c mac.c
[src/osd/windows]debugwin.c drawd3d.c window.c winmain.c winmain.h
[src/osd/winui]mui_util.c
[src/tools]ldverify.c

src/mame/audio/tx1.c
r4057r4058
147147    7: Engine 0 gain #7         7: /Skid 1 enable
148148
149149***************************************************************************/
150
150151WRITE8_HANDLER( tx1_ay8910_a_w )
151152{
152153   stream_update(stream);
r4057r4058
320321static int noise_lfsrc;
321322static int noise_lfsrd;
322323static int noise_counter;
323static UINT8 ym_outputa;
324static UINT8 ym_outputb;
324static UINT8 ym1_outputa;
325static UINT8 ym2_outputa;
326static UINT8 ym2_outputb;
325327static UINT16 buggyboy_eng_voltages[16];
326328
327329static const double bb_engine_gains[16] =
r4057r4058
353355    Port A                      Port B
354356    =======                     ======
355357
356    0: Engine 1 gain (FR) #0    0: Coin Counter 1
357    1: Engine 1 gain (FR) #1    1: Coin Counter 2
358    2: Engine 1 gain (FR) #2    2: Coin Counter 3 (Unused)
359    3: Engine 1 gain (FR) #3    3: Engine 0 gain
358    0: Engine 1 gain (FR) #0    0: *Coin Counter 1
359    1: Engine 1 gain (FR) #1    1: *Coin Counter 2
360    2: Engine 1 gain (FR) #2    2: *Coin Counter 3 (Unused)
361    3: Engine 1 gain (FR) #3    3: *Engine 0 gain
360362    4: Engine 1 gain (FL) #0    4: Skid 0 enable
361363    5: Engine 1 gain (FL) #1    5: Skid 1 enable
362364    6: Engine 1 gain (FL) #2    6: Enable YM IC24 output on RR
363365    7: Engine 1 gain (FL) #3    7: Enable YM IC19 output on RL
364366
367    (* Buggy Boy Junior only)
365368
366369    The engine sounds are generated by an 8253. There are two channels.
367370
r4057r4058
385388WRITE8_HANDLER( bb_ym1_a_w )
386389{
387390   stream_update(stream);
391   ym1_outputa = data ^ 0xff;
392}
388393
389   ym_outputa = data ^ 0xff;
394WRITE8_HANDLER( bb_ym2_a_w )
395{
396   stream_update(stream);
397   ym2_outputa = data ^ 0xff;
390398}
391399
392WRITE8_HANDLER( bb_ym1_b_w )
400WRITE8_HANDLER( bb_ym2_b_w )
393401{
394402   double gain;
395403
396404   stream_update(stream);
397405
398   ym_outputb = data ^ 0xff;
406   ym2_outputb = data ^ 0xff;
399407
400    coin_counter_w(0, data & 0x01);
401    coin_counter_w(1, data & 0x02);
408   if (!strcmp(space->machine->gamedrv->name, "buggybjr"))
409   {
410      coin_counter_w(0, data & 0x01);
411      coin_counter_w(1, data & 0x02);
412   }
402413
403414   /* Until we support > 2 speakers, double the gain of the front speakers */
404415
r4057r4058
433444   step_0 = pit8253.counts[0].val ? (BUGGYBOY_PIT_CLOCK / pit8253.counts[0].val) * freq_to_step : 0;
434445   step_1 = pit8253.counts[1].val ? (BUGGYBOY_PIT_CLOCK / pit8253.counts[1].val) * freq_to_step : 0;
435446
436   gain0 = BIT(ym_outputb, 3) ? 1.0 : 2.0;
437   n1_en = BIT(ym_outputb, 4);
438   n2_en = BIT(ym_outputb, 5);
447   if (!strcmp(device->machine->gamedrv->name, "buggybjr"))
448      gain0 = BIT(ym2_outputb, 3) ? 1.0 : 2.0;
449   else
450      gain0 = BIT(ym1_outputa, 3) ? 1.0 : 2.0;
439451
440   gain1_l = bb_engine_gains[ym_outputa >> 4] * 5;
441   gain1_r = bb_engine_gains[ym_outputa & 0xf] * 5;
452   n1_en = BIT(ym2_outputb, 4);
453   n2_en = BIT(ym2_outputb, 5);
442454
455   gain1_l = bb_engine_gains[ym2_outputa >> 4] * 5;
456   gain1_r = bb_engine_gains[ym2_outputa & 0xf] * 5;
457
443458   while (samples--)
444459   {
445460      int i;
src/mame/audio/segag80r.c
r4057r4058
1212#include "cpu/mcs48/mcs48.h"
1313#include "segag80r.h"
1414#include "machine/8255ppi.h"
15#include "machine/i8243.h"
1516#include "sound/samples.h"
1617#include "sound/tms36xx.h"
1718#include "sound/dac.h"
r4057r4058
753754static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w );
754755static READ8_DEVICE_HANDLER( n7751_status_r );
755756static WRITE8_DEVICE_HANDLER( n7751_command_w );
756static WRITE8_HANDLER( n7751_rom_offset_w );
757static WRITE8_HANDLER( n7751_rom_select_w );
757static WRITE8_DEVICE_HANDLER( n7751_rom_control_w );
758758static READ8_HANDLER( n7751_rom_r );
759759static READ8_HANDLER( n7751_command_r );
760static WRITE8_HANDLER( n7751_busy_w );
760static WRITE8_DEVICE_HANDLER( n7751_p2_w );
761761static READ8_HANDLER( n7751_t1_r );
762762
763763/*
r4057r4058
802802 *************************************/
803803
804804static ADDRESS_MAP_START( monsterb_7751_portmap, ADDRESS_SPACE_IO, 8 )
805   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(n7751_t1_r)
806   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READ(n7751_command_r)
807   AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(n7751_rom_r)
808   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
809   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(n7751_busy_w)
810   AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P6) AM_WRITE(n7751_rom_offset_w)
811   AM_RANGE(MCS48_PORT_P7, MCS48_PORT_P7) AM_WRITE(n7751_rom_select_w)
805   AM_RANGE(MCS48_PORT_T1,   MCS48_PORT_T1) AM_READ(n7751_t1_r)
806   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2) AM_READ(n7751_command_r)
807   AM_RANGE(MCS48_PORT_BUS,  MCS48_PORT_BUS) AM_READ(n7751_rom_r)
808   AM_RANGE(MCS48_PORT_P1,   MCS48_PORT_P1) AM_WRITE(dac_0_data_w)
809   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2) AM_DEVWRITE(I8243, "audio_8243", n7751_p2_w)
810   AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE(I8243, "audio_8243", i8243_prog_w)
812811ADDRESS_MAP_END
813812
814813
r4057r4058
838837   MDRV_CPU_ADD("audio", N7751, 6000000)
839838   MDRV_CPU_IO_MAP(monsterb_7751_portmap,0)
840839
840   MDRV_I8243_ADD("audio_8243", NULL, n7751_rom_control_w)
841
841842   /* sound hardware */
842843   MDRV_SOUND_START(monsterb)
843844
r4057r4058
939940}
940941
941942
942static WRITE8_HANDLER( n7751_rom_offset_w )
943static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
943944{
944945   /* P4 - address lines 0-3 */
945946   /* P5 - address lines 4-7 */
946947   /* P6 - address lines 8-11 */
947   int mask = (0xf << (4 * offset)) & 0x3fff;
948   int newdata = (data << (4 * offset)) & mask;
949   sound_addr = (sound_addr & ~mask) | newdata;
950}
948   /* P7 - ROM selects */
949   switch (offset)
950   {
951      case 0:
952         sound_addr = (sound_addr & ~0x00f) | ((data & 0x0f) << 0);
953         break;
951954
955      case 1:
956         sound_addr = (sound_addr & ~0x0f0) | ((data & 0x0f) << 4);
957         break;
952958
953static WRITE8_HANDLER( n7751_rom_select_w )
954{
955   /* P7 - ROM selects */
956   int numroms = memory_region_length(space->machine, "n7751") / 0x1000;
957   sound_addr &= 0xfff;
958   if (!(data & 0x01) && numroms >= 1) sound_addr |= 0x0000;
959   if (!(data & 0x02) && numroms >= 2) sound_addr |= 0x1000;
960   if (!(data & 0x04) && numroms >= 3) sound_addr |= 0x2000;
961   if (!(data & 0x08) && numroms >= 4) sound_addr |= 0x3000;
959      case 2:
960         sound_addr = (sound_addr & ~0xf00) | ((data & 0x0f) << 8);
961         break;
962
963      case 3:
964         sound_addr &= 0xfff;
965         {
966            int numroms = memory_region_length(device->machine, "n7751") / 0x1000;
967            if (!(data & 0x01) && numroms >= 1) sound_addr |= 0x0000;
968            if (!(data & 0x02) && numroms >= 2) sound_addr |= 0x1000;
969            if (!(data & 0x04) && numroms >= 3) sound_addr |= 0x2000;
970            if (!(data & 0x08) && numroms >= 4) sound_addr |= 0x3000;
971         }
972         break;
973   }
962974}
963975
964976
r4057r4058
977989}
978990
979991
980static WRITE8_HANDLER( n7751_busy_w )
992static WRITE8_DEVICE_HANDLER( n7751_p2_w )
981993{
982   /* write to P2 */
994   /* write to P2; low 4 bits go to 8243 */
995   i8243_p2_w(device, offset, data & 0x0f);
996
983997   /* output of bit $80 indicates we are ready (1) or busy (0) */
984998   /* no other outputs are used */
985999   n7751_busy = data >> 7;
src/mame/audio/gottlieb.c
r4057r4058
66***************************************************************************/
77
88#include "driver.h"
9#include "debugger.h"
910#include "cpu/m6502/m6502.h"
1011#include "machine/6532riot.h"
1112#include "sound/samples.h"
r4057r4058
3031static UINT8 nmi_state;
3132
3233static UINT8 speech_control;
33static UINT8 sp0250_drq;
3434static UINT8 last_command;
3535
3636static UINT8 *dac_data;
r4057r4058
470470 *
471471 *************************************/
472472
473static void sp0250_drq_callback(int level)
474{
475   sp0250_drq = (level == ASSERT_LINE) ? 1 : 0;
476}
477
478
479473static CUSTOM_INPUT( speech_drq_custom_r )
480474{
481   /* this is reflected by a bit in the input port */
482   return sp0250_drq;
475   return sp0250_drq_r();
483476}
484477
485478
r4057r4058
554547   state_save_register_global(machine, nmi_rate);
555548   state_save_register_global(machine, nmi_state);
556549   state_save_register_global(machine, speech_control);
557   state_save_register_global(machine, sp0250_drq);
558550   state_save_register_global(machine, last_command);
559551}
560552
r4057r4058
590582
591583/*************************************
592584 *
593 *  Rev. 2 sound interfaces
594 *
595 *************************************/
596
597static const struct sp0250_interface sp0250_interface =
598{
599   sp0250_drq_callback
600};
601
602
603
604/*************************************
605 *
606585 *  Rev. 2 machine driver
607586 *
608587 *************************************/
r4057r4058
631610   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
632611
633612   MDRV_SOUND_ADD("sp", SP0250, SOUND2_SPEECH_CLOCK)
634   MDRV_SOUND_CONFIG(sp0250_interface)
635613   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
636614MACHINE_DRIVER_END
637615
src/mame/audio/exidy.c
r4057r4058
218218
219219/*************************************
220220 *
221 *  6840 state saving
222 *
223 *************************************/
224
225static void sh6840_register_state_globals(running_machine *machine)
226{
227    state_save_register_global_array(machine, sh6840_volume);
228    state_save_register_global(machine, sh6840_MSB);
229    state_save_register_global(machine, sh6840_LFSR_oldxor);
230    state_save_register_global(machine, sh6840_LFSR_0);
231    state_save_register_global(machine, sh6840_LFSR_1);
232    state_save_register_global(machine, sh6840_LFSR_2);
233    state_save_register_global(machine, sh6840_LFSR_3);
234    state_save_register_global(machine, sh6840_clock_count);
235    state_save_register_global(machine, exidy_sfxctrl);
236    state_save_register_global(machine, sh6840_timer[0].cr);
237    state_save_register_global(machine, sh6840_timer[0].state);
238    state_save_register_global(machine, sh6840_timer[0].leftovers);
239    state_save_register_global(machine, sh6840_timer[0].timer);
240    state_save_register_global(machine, sh6840_timer[0].clocks);
241    state_save_register_global(machine, sh6840_timer[0].counter.w);
242    state_save_register_global(machine, sh6840_timer[1].cr);
243    state_save_register_global(machine, sh6840_timer[1].state);
244    state_save_register_global(machine, sh6840_timer[1].leftovers);
245    state_save_register_global(machine, sh6840_timer[1].timer);
246    state_save_register_global(machine, sh6840_timer[1].clocks);
247    state_save_register_global(machine, sh6840_timer[1].counter.w);
248    state_save_register_global(machine, sh6840_timer[2].cr);
249    state_save_register_global(machine, sh6840_timer[2].state);
250    state_save_register_global(machine, sh6840_timer[2].leftovers);
251    state_save_register_global(machine, sh6840_timer[2].timer);
252    state_save_register_global(machine, sh6840_timer[2].clocks);
253    state_save_register_global(machine, sh6840_timer[2].counter.w);
254}
255
256
257
258/*************************************
259 *
221260 *  Core sound generation
222261 *
223262 *************************************/
r4057r4058
347386   /* allocate the stream */
348387   exidy_stream = stream_create(device, 0, 1, sample_rate, NULL, exidy_stream_update);
349388
389    sh6840_register_state_globals(device->machine);
390
350391   return auto_malloc(1);
351392}
352393
r4057r4058
376417   sh6840_volume[0] = 0;
377418   sh6840_volume[1] = 0;
378419   sh6840_volume[2] = 0;
420    sh6840_clock_count = 0;
379421   exidy_sfxctrl = 0;
380422
381423   /* LFSR */
r4057r4058
456498
457499
458500
501/*************************************
502 *
503 *  8253 state saving
504 *
505 *************************************/
459506
507
508static void sh8253_register_state_globals(running_machine *machine)
509{
510    state_save_register_global(machine, sh8253_timer[0].clstate);
511    state_save_register_global(machine, sh8253_timer[0].enable);
512    state_save_register_global(machine, sh8253_timer[0].count);
513    state_save_register_global(machine, sh8253_timer[0].step);
514    state_save_register_global(machine, sh8253_timer[0].fraction);
515    state_save_register_global(machine, sh8253_timer[1].clstate);
516    state_save_register_global(machine, sh8253_timer[1].enable);
517    state_save_register_global(machine, sh8253_timer[1].count);
518    state_save_register_global(machine, sh8253_timer[1].step);
519    state_save_register_global(machine, sh8253_timer[1].fraction);
520    state_save_register_global(machine, sh8253_timer[2].clstate);
521    state_save_register_global(machine, sh8253_timer[2].enable);
522    state_save_register_global(machine, sh8253_timer[2].count);
523    state_save_register_global(machine, sh8253_timer[2].step);
524    state_save_register_global(machine, sh8253_timer[2].fraction);
525}
526
460527/*************************************
461528 *
462529 *  8253 timer handlers
r4057r4058
659726   /* 8253 */
660727   freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK;
661728
729    state_save_register_global(machine, riot_irq_state);
730    sh8253_register_state_globals(device->machine);
731
662732   return ret;
663733}
664734
src/mame/machine/docastle.c
r4057r4058
1010#include "driver.h"
1111#include "cpu/z80/z80.h"
1212#include "includes/docastle.h"
13#include "state.h"
1314
14
15
1615static UINT8 buffer0[9],buffer1[9];
1716
17void docastle_shared_state_register(running_machine *machine)
18{
19    state_save_register_global_array(machine, buffer0);
20    state_save_register_global_array(machine, buffer1);
21}
1822
19
2023/*
2124Communication between the two CPUs happens through a single bidirectional latch.
2225Whenever CPU 0 reads or writes it, its WAIT input is asserted. It is implicitly
src/mame/machine/tnzs.c
r4057r4058
1313***************************************************************************/
1414
1515#include "driver.h"
16#include "cpu/i8x41/i8x41.h"
16#include "cpu/mcs48/mcs48.h"
1717#include "includes/tnzs.h"
1818
1919static int mcu_type;
r4057r4058
4444{
4545   UINT8 data;
4646
47   if (offset == 0)
48   {
49      data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
50      cpu_yield(space->cpu);
51   }
52   else
53   {
54      data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
55      cpu_yield(space->cpu);
56   }
47   data = upi41_master_r(space->machine->cpu[2], offset & 1);
48   cpu_yield(space->cpu);
5749
5850//  logerror("PC %04x: read %02x from mcu $c00%01x\n", cpu_get_previouspc(space->cpu), data, offset);
5951
r4057r4058
6456{
6557//  logerror("PC %04x: write %02x to mcu $c00%01x\n", cpu_get_previouspc(space->cpu), data, offset);
6658
67   if (offset == 0)
68      cpu_set_reg(space->machine->cpu[2], I8X41_DATA, data);
69   else
70      cpu_set_reg(space->machine->cpu[2], I8X41_CMND, data);
59   upi41_master_w(space->machine->cpu[2], offset & 1, data);
7160}
7261
7362
src/mame/machine/decocass.c
r4057r4058
66
77#include "driver.h"
88#include "cpu/m6502/m6502.h"
9#include "cpu/i8x41/i8x41.h"
9#include "cpu/mcs48/mcs48.h"
1010#include "machine/decocass.h"
1111
12/* tape direction, speed and timing (used also in video/decocass.c) */
13INT32 tape_dir;
14INT32 tape_speed;
15attotime tape_time0;
16emu_timer *tape_timer;
12#define LOG_CASSETTE_STATE      0
13static const device_config *cassette_device;
1714
1815static INT32 firsttime;
19static INT32 tape_present;
20static INT32 tape_blocks;
21static INT32 tape_length;
22static INT32 tape_bot_eot;
23static UINT8 crc16_lsb;
24static UINT8 crc16_msb;
2516static UINT8 latch1;
2617
27/* pre-calculated crc16 of the tape blocks */
28static UINT8 tape_crc16_lsb[256];
29static UINT8 tape_crc16_msb[256];
30
3118static read8_space_func decocass_dongle_r;
3219static write8_space_func decocass_dongle_w;
3320
r4057r4058
9582
9683/* sound latches, ACK status bits and NMI timer */
9784static UINT8 decocass_sound_ack;
98static emu_timer *decocass_sound_timer;
85static UINT8 audio_nmi_enabled;
86static UINT8 audio_nmi_state;
9987
88static UINT8 tape_get_status_bits(const device_config *device);
89static UINT8 tape_is_present(const device_config *device);
90static void tape_change_speed(const device_config *device, INT8 newspeed);
91
92
93
94
10095WRITE8_HANDLER( decocass_coin_counter_w )
10196{
10297}
r4057r4058
141136   return data;
142137}
143138
144static TIMER_CALLBACK( decocass_sound_nmi_pulse )
139TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen )
145140{
146   cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
141   int scanline = param;
142   audio_nmi_state = scanline & 8;
143   cpu_set_input_line(timer->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
147144}
148145
149146WRITE8_HANDLER( decocass_sound_nmi_enable_w )
150147{
151   LOG(2,("CPU %s sound NMI enb -> $%02x\n", space->cpu->tag, data));
152   timer_adjust_periodic(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2));
148   audio_nmi_enabled = 1;
149   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
153150}
154151
155152READ8_HANDLER( decocass_sound_nmi_enable_r )
156153{
157   UINT8 data = 0xff;
158   LOG(2,("CPU %s sound NMI enb <- $%02x\n", space->cpu->tag, data));
159   timer_adjust_periodic(decocass_sound_timer, ATTOTIME_IN_HZ(256 * 57 / 8 / 2), 0, ATTOTIME_IN_HZ(256 * 57 / 8 / 2));
160   return data;
154   audio_nmi_enabled = 1;
155   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
156   return 0xff;
161157}
162158
163159READ8_HANDLER( decocass_sound_data_ack_reset_r )
r4057r4058
232228 * D6 -
233229 * D7 - cassette present
234230 */
235/* Note on a tapes leader-BOT-data-EOT-trailer format:
236 * A cassette has a transparent piece of tape on both ends,
237 * leader and trailer. And data tapes also have BOT and EOT
238 * holes, shortly before the the leader and trailer.
239 * The holes and clear tape are detected using a photo-resitor.
240 * When rewinding, the BOT/EOT signal will show a short
241 * pulse and if rewind continues a constant high signal later.
242 * The specs say the holes are "> 2ms" in length.
243 */
244231
245#define TAPE_CLOCKRATE   4800   /* clock pulses per second */
246
247/* duration of the clear LEADER (and trailer) of the tape */
248#define TAPE_LEADER    TAPE_CLOCKRATE      /* 1s */
249/* duration of the GAP between leader and BOT/EOT */
250#define TAPE_GAP      TAPE_CLOCKRATE*3/2   /* 1.5s */
251/* duration of BOT/EOT holes */
252#define TAPE_HOLE      TAPE_CLOCKRATE/400   /* 0.0025s */
253
254/* byte offset of the tape chunks (8 clocks per byte = 16 samples) */
255/* 300 ms GAP between BOT and first data block (doesn't work.. thus /2) */
256#define TAPE_PRE_GAP   34
257#define TAPE_LEADIN    (TAPE_PRE_GAP + 1)
258#define TAPE_HEADER    (TAPE_LEADIN + 1)
259#define TAPE_BLOCK      (TAPE_HEADER + 256)
260#define TAPE_CRC16_MSB   (TAPE_BLOCK + 1)
261#define TAPE_CRC16_LSB   (TAPE_CRC16_MSB + 1)
262#define TAPE_TRAILER   (TAPE_CRC16_LSB + 1)
263#define TAPE_LEADOUT   (TAPE_TRAILER + 1)
264#define TAPE_LONGCLOCK   (TAPE_LEADOUT + 1)
265#define TAPE_POST_GAP   (TAPE_LONGCLOCK + 34)
266
267/* size of a tape chunk (block) including gaps */
268#define TAPE_CHUNK      TAPE_POST_GAP
269
270232#define E5XX_MASK   0x02   /* use 0x0e for old style board */
271233
272234#define BIT0(x) ((x)&1)
r4057r4058
280242
281243WRITE8_HANDLER( decocass_reset_w )
282244{
283   LOG(1,("%9.7f 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
245   LOG(1,("%10s 6502-PC: %04x decocass_reset_w(%02x): $%02x\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
284246   decocass_reset = data;
285247
286   /* CPU #1 active hight reset */
287   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, data & 0x01 );
248   /* CPU #1 active high reset */
249   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, data & 0x01);
288250
289   /* on reset also remove the sound timer */
251   /* on reset also disable audio NMI */
290252   if (data & 1)
291      timer_adjust_oneshot(decocass_sound_timer, attotime_never, 0);
292
293   /* 8041 active low reset */
294   cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, (data & 0x08) ^ 0x08 );
295}
296
297static const char *dirnm(int speed)
298{
299   if (speed <  -1) return "fast rewind";
300   if (speed == -1) return "rewind";
301   if (speed ==  0) return "stop";
302   if (speed ==  1) return "forward";
303   return "fast forward";
304}
305
306static void tape_crc16(UINT8 data)
307{
308   UINT8 c0, c1;
309   UINT8 old_lsb = crc16_lsb;
310   UINT8 old_msb = crc16_msb;
311   UINT8 feedback;
312
313   feedback = ((data >> 7) ^ crc16_msb) & 1;
314
315   /* rotate 16 bits */
316   c0 = crc16_lsb & 1;
317   c1 = crc16_msb & 1;
318   crc16_msb = (crc16_msb >> 1) | (c0 << 7);
319   crc16_lsb = (crc16_lsb >> 1) | (c1 << 7);
320
321   /* feedback into bit 7 */
322   if (feedback)
323      crc16_lsb |= 0x80;
324   else
325      crc16_lsb &= ~0x80;
326
327   /* feedback to bit 6 into bit 5 */
328   if (((old_lsb >> 6) ^ feedback) & 1)
329      crc16_lsb |= 0x20;
330   else
331      crc16_lsb &= ~0x20;
332
333   /* feedback to bit 1 into bit 0 */
334   if (((old_msb >> 1) ^ feedback) & 1)
335      crc16_msb |= 0x01;
336   else
337      crc16_msb &= ~0x01;
338}
339
340
341attotime decocass_adjust_tape_time(attotime tape_time)
342{
343   attotime ret = tape_time;
344
345   if (tape_timer)
346253   {
347      attotime elapsed = timer_timeelapsed(tape_timer);
348
349      if (tape_dir > 0)
350      {
351         ret = attotime_add(tape_time, elapsed);
352
353         if (attotime_compare(ret, ATTOTIME_IN_MSEC(999900)) > 0)
354            ret = ATTOTIME_IN_MSEC(999900);
355      }
356
357      if (tape_dir < 0)
358      {
359         if (attotime_compare(tape_time, elapsed) > 0)
360            ret = attotime_sub(tape_time, elapsed);
361         else
362            ret = attotime_zero;
363      }
254      audio_nmi_enabled = 0;
255      cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
364256   }
365257
366   return ret;
258   /* 8041 active low reset */
259   cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, (data & 0x08) ^ 0x08);
367260}
368261
369262
370static void tape_update(running_machine *machine)
371{
372   static int last_byte;
373   int offset, rclk, rdata, tape_bit, tape_byte, tape_block;
374
375   attotime tape_time = decocass_adjust_tape_time(tape_time0);
376
377   offset = (int)(attotime_to_double(attotime_mul(tape_time, TAPE_CLOCKRATE)) + 0.499995);
378
379   /* reset RCLK and RDATA inputs */
380   rclk = 0;
381   rdata = 0;
382
383   if (offset < TAPE_LEADER)
384   {
385      if (offset < 0)
386         offset = 0;
387      /* LEADER area */
388      if (0 == tape_bot_eot)
389      {
390         tape_bot_eot = 1;
391         set_led_status(1, 1);
392         LOG(5,("tape %5.4fs: %s found LEADER\n", attotime_to_double(tape_time), dirnm(tape_dir)));
393      }
394   }
395   else
396   if (offset < TAPE_LEADER + TAPE_GAP)
397   {
398      /* GAP between LEADER and BOT hole */
399      if (1 == tape_bot_eot)
400      {
401         tape_bot_eot = 0;
402         set_led_status(1, 0);
403         LOG(5,("tape %5.4fs: %s between BOT + LEADER\n", attotime_to_double(tape_time), dirnm(tape_dir)));
404      }
405   }
406   else
407   if (offset < TAPE_LEADER + TAPE_GAP + TAPE_HOLE)
408   {
409      /* during BOT hole */
410      if (0 == tape_bot_eot)
411      {
412         tape_bot_eot = 1;
413         set_led_status(1, 1);
414         LOG(5,("tape %5.4fs: %s found BOT\n", attotime_to_double(tape_time), dirnm(tape_dir)));
415      }
416   }
417   else
418   if (offset < tape_length - TAPE_LEADER - TAPE_GAP - TAPE_HOLE)
419   {
420      offset -= TAPE_LEADER + TAPE_GAP + TAPE_HOLE;
421
422      /* data area */
423      if (1 == tape_bot_eot)
424      {
425         tape_bot_eot = 0;
426         set_led_status(1, 0);
427         LOG(5,("tape %5.4fs: %s data area\n", attotime_to_double(tape_time), dirnm(tape_dir)));
428      }
429      rclk = (offset ^ 1) & 1;
430      tape_bit = (offset / 2) % 8;
431      tape_byte = (offset / 16) % TAPE_CHUNK;
432      tape_block = offset / 16 / TAPE_CHUNK;
433
434      if (tape_byte < TAPE_PRE_GAP)
435      {
436         rclk = 0;
437         rdata = 0;
438      }
439      else
440      if (tape_byte < TAPE_LEADIN)
441      {
442         rdata = (0x00 >> tape_bit) & 1;
443         if (tape_byte != last_byte)
444         {
445            LOG(5,("tape %5.4fs: LEADIN $00\n", attotime_to_double(tape_time)));
446            set_led_status(2, 1);
447         }
448      }
449      else
450      if (tape_byte < TAPE_HEADER)
451      {
452         rdata = (0xaa >> tape_bit) & 1;
453         if (tape_byte != last_byte)
454            LOG(5,("tape %5.4fs: HEADER $aa\n", attotime_to_double(tape_time)));
455      }
456      else
457      if (tape_byte < TAPE_BLOCK)
458      {
459         UINT8 *ptr = memory_region(machine, "user2") + tape_block * 256 + tape_byte - TAPE_HEADER;
460         rdata = (*ptr >> tape_bit) & 1;
461         if (tape_byte != last_byte)
462            LOG(4,("tape %5.4fs: DATA(%02x) $%02x\n", attotime_to_double(tape_time), tape_byte - TAPE_HEADER, *ptr));
463      }
464      else
465      if (tape_byte < TAPE_CRC16_MSB)
466      {
467         rdata = (tape_crc16_msb[tape_block] >> tape_bit) & 1;
468         if (tape_byte != last_byte)
469            LOG(4,("tape %5.4fs: CRC16 MSB $%02x\n", attotime_to_double(tape_time), tape_crc16_msb[tape_block]));
470      }
471      else
472      if (tape_byte < TAPE_CRC16_LSB)
473      {
474         rdata = (tape_crc16_lsb[tape_block] >> tape_bit) & 1;
475         if (tape_byte != last_byte)
476            LOG(4,("tape %5.4fs: CRC16 LSB $%02x\n", attotime_to_double(tape_time), tape_crc16_lsb[tape_block]));
477      }
478      else
479      if (tape_byte < TAPE_TRAILER)
480      {
481         rdata = (0xaa >> tape_bit) & 1;
482         if (tape_byte != last_byte)
483            LOG(4,("tape %5.4fs: TRAILER $aa\n", attotime_to_double(tape_time)));
484      }
485      else
486      if (tape_byte < TAPE_LEADOUT)
487      {
488         rdata = (0x00 >> tape_bit) & 1;
489         if (tape_byte != last_byte)
490            LOG(4,("tape %5.4fs: LEADOUT $00\n", attotime_to_double(tape_time)));
491      }
492      else
493      if (tape_byte < TAPE_LONGCLOCK)
494      {
495         if (tape_byte != last_byte)
496         {
497            LOG(4,("tape %5.4fs: LONG CLOCK\n", attotime_to_double(tape_time)));
498            set_led_status(2, 0);
499         }
500         rclk = 1;
501         rdata = 0;
502      }
503      last_byte = tape_byte;
504   }
505   else
506   if (offset < tape_length - TAPE_LEADER - TAPE_GAP)
507   {
508      /* during EOT hole */
509      if (0 == tape_bot_eot)
510      {
511         tape_bot_eot = 1;
512         set_led_status(1, 1);
513         LOG(5,("tape %5.4fs: %s found EOT\n", attotime_to_double(tape_time), dirnm(tape_dir)));
514      }
515   }
516   else
517   if (offset < tape_length - TAPE_LEADER)
518   {
519      /* GAP between EOT and trailer */
520      if (1 == tape_bot_eot)
521      {
522         tape_bot_eot = 0;
523         set_led_status(1, 0);
524         LOG(5,("tape %5.4fs: %s EOT and TRAILER\n", attotime_to_double(tape_time), dirnm(tape_dir)));
525      }
526   }
527   else
528   {
529      /* TRAILER area */
530      if (0 == tape_bot_eot)
531      {
532         tape_bot_eot = 1;
533         set_led_status(1, 1);
534         LOG(5,("tape %5.4fs: %s found TRAILER\n", attotime_to_double(tape_time), dirnm(tape_dir)));
535      }
536      offset = tape_length - 1;
537   }
538
539   i8041_p2 = (i8041_p2 & ~0xe0) | (tape_bot_eot << 5) | (rclk << 6) | (rdata << 7);
540}
541
542263#ifdef MAME_DEBUG
543264static void decocass_fno(offs_t offset, UINT8 data)
544265{
r4057r4058
593314   if (1 == (offset & 1))
594315   {
595316      if (0 == (offset & E5XX_MASK))
596         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
317         data = upi41_master_r(space->machine->cpu[2], 1);
597318      else
598319         data = 0xff;
599320
600321      data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c;
601      LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
602         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data,
322      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
323         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data,
603324         (data & 1) ? "OBF" : "-",
604325         (data & 2) ? "IBF" : "-"));
605326   }
r4057r4058
607328   {
608329      offs_t promaddr;
609330      UINT8 save;
610      UINT8 *prom = memory_region(space->machine, "user1");
331      UINT8 *prom = memory_region(space->machine, "dongle");
611332
612333      if (firsttime)
613334      {
r4057r4058
623344      }
624345
625346      if (0 == (offset & E5XX_MASK))
626         data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
347         data = upi41_master_r(space->machine->cpu[2], 0);
627348      else
628349         data = 0xff;
629350
r4057r4058
646367         (((latch1 >> MAP6(type1_inmap)) & 1)      << MAP6(type1_outmap)) |
647368         (((prom[promaddr] >> 4) & 1)            << MAP7(type1_outmap));
648369
649      LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n",
650         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
370      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_3_inv_2_r(%02x): $%02x\n",
371         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
651372
652373      latch1 = save;      /* latch the data for the next A0 == 0 read */
653374   }
r4057r4058
672393   if (1 == (offset & 1))
673394   {
674395      if (0 == (offset & E5XX_MASK))
675         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
396         data = upi41_master_r(space->machine->cpu[2], 1);
676397      else
677398         data = 0xff;
678399
679400      data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c;
680      LOG(4,("%9.7f 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n",
681         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data,
401      LOG(4,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x <- (%s %s)\n",
402         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data,
682403         (data & 1) ? "OBF" : "-",
683404         (data & 2) ? "IBF" : "-"));
684405   }
r4057r4058
686407   {
687408      offs_t promaddr;
688409      UINT8 save;
689      UINT8 *prom = memory_region(space->machine, "user1");
410      UINT8 *prom = memory_region(space->machine, "dongle");
690411
691412      if (firsttime)
692413      {
r4057r4058
702423      }
703424
704425      if (0 == (offset & E5XX_MASK))
705         data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
426         data = upi41_master_r(space->machine->cpu[2], 0);
706427      else
707428         data = 0xff;
708429
r4057r4058
725446         (((data >> MAP6(type1_inmap)) & 1)          << MAP6(type1_outmap)) |
726447         (((prom[promaddr] >> 4) & 1)            << MAP7(type1_outmap));
727448
728      LOG(3,("%9.7f 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n",
729         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
449      LOG(3,("%10s 6502-PC: %04x decocass_type1_pass_136_r(%02x): $%02x\n",
450         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
730451
731452      latch1 = save;      /* latch the data for the next A0 == 0 read */
732453   }
r4057r4058
751472   if (1 == (offset & 1))
752473   {
753474      if (0 == (offset & E5XX_MASK))
754         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
475         data = upi41_master_r(space->machine->cpu[2], 1);
755476      else
756477         data = 0xff;
757478
758479      data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c;
759      LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
760         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data,
480      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x <- (%s %s)\n",
481         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data,
761482         (data & 1) ? "OBF" : "-",
762483         (data & 2) ? "IBF" : "-"));
763484   }
r4057r4058
765486   {
766487      offs_t promaddr;
767488      UINT8 save;
768      UINT8 *prom = memory_region(space->machine, "user1");
489      UINT8 *prom = memory_region(space->machine, "dongle");
769490
770491      if (firsttime)
771492      {
r4057r4058
781502      }
782503
783504      if (0 == (offset & E5XX_MASK))
784         data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
505         data = upi41_master_r(space->machine->cpu[2], 0);
785506      else
786507         data = 0xff;
787508
r4057r4058
804525         (((prom[promaddr] >> 4) & 1)            << MAP6(type1_outmap)) |
805526         (((latch1 >> MAP7(type1_inmap)) & 1)      << MAP7(type1_outmap));
806527
807      LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n",
808         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
528      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_27_pass_3_inv_2_r(%02x): $%02x\n",
529         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
809530
810531      latch1 = save;      /* latch the data for the next A0 == 0 read */
811532   }
r4057r4058
830551   if (1 == (offset & 1))
831552   {
832553      if (0 == (offset & E5XX_MASK))
833         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
554         data = upi41_master_r(space->machine->cpu[2], 1);
834555      else
835556         data = 0xff;
836557
837558      data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c;
838      LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n",
839         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data,
559      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x <- (%s %s)\n",
560         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data,
840561         (data & 1) ? "OBF" : "-",
841562         (data & 2) ? "IBF" : "-"));
842563   }
r4057r4058
844565   {
845566      offs_t promaddr;
846567      UINT8 save;
847      UINT8 *prom = memory_region(space->machine, "user1");
568      UINT8 *prom = memory_region(space->machine, "dongle");
848569
849570      if (firsttime)
850571      {
r4057r4058
860581      }
861582
862583      if (0 == (offset & E5XX_MASK))
863         data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
584         data = upi41_master_r(space->machine->cpu[2], 0);
864585      else
865586         data = 0xff;
866587
r4057r4058
883604         (((latch1 >> MAP6(type1_inmap)) & 1)         << MAP6(type1_outmap)) |
884605         (((prom[promaddr] >> 4) & 1)            << MAP7(type1_outmap));
885606
886      LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n",
887         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
607      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_26_pass_5_inv_2_r(%02x): $%02x\n",
608         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
888609
889610      latch1 = save;      /* latch the data for the next A0 == 0 read */
890611   }
r4057r4058
911632   if (1 == (offset & 1))
912633   {
913634      if (0 == (offset & E5XX_MASK))
914         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
635         data = upi41_master_r(space->machine->cpu[2], 1);
915636      else
916637         data = 0xff;
917638
918639      data = (BIT0(data) << 0) | (BIT1(data) << 1) | 0x7c;
919      LOG(4,("%9.7f 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n",
920         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data,
640      LOG(4,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x <- (%s %s)\n",
641         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data,
921642         (data & 1) ? "OBF" : "-",
922643         (data & 2) ? "IBF" : "-"));
923644   }
r4057r4058
925646   {
926647      offs_t promaddr;
927648      UINT8 save;
928      UINT8 *prom = memory_region(space->machine, "user1");
649      UINT8 *prom = memory_region(space->machine, "dongle");
929650
930651      if (firsttime)
931652      {
r4057r4058
941662      }
942663
943664      if (0 == (offset & E5XX_MASK))
944         data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
665         data = upi41_master_r(space->machine->cpu[2], 0);
945666      else
946667         data = 0xff;
947668
r4057r4058
964685         (((latch1 >> MAP6(type1_inmap)) & 1)      << MAP6(type1_outmap)) |
965686         (((prom[promaddr] >> 4) & 1)            << MAP7(type1_outmap));
966687
967      LOG(3,("%9.7f 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n",
968         attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
688      LOG(3,("%10s 6502-PC: %04x decocass_type1_latch_16_pass_3_inv_1_r(%02x): $%02x\n",
689         attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
969690
970691      latch1 = save;      /* latch the data for the next A0 == 0 read */
971692   }
r4057r4058
992713   {
993714      if (1 == (offset & 1))
994715      {
995         UINT8 *prom = memory_region(space->machine, "user1");
716         UINT8 *prom = memory_region(space->machine, "dongle");
996717         data = prom[256 * type2_d2_latch + type2_promaddr];
997         LOG(3,("%9.7f 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, 256 * type2_d2_latch + type2_promaddr));
718         LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- prom[%03x]\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, 256 * type2_d2_latch + type2_promaddr));
998719      }
999720      else
1000721      {
r4057r4058
1004725   else
1005726   {
1006727      if (0 == (offset & E5XX_MASK))
1007         data = cpu_get_reg(space->machine->cpu[2], offset & 1 ? I8X41_STAT : I8X41_DATA);
728         data = upi41_master_r(space->machine->cpu[2], offset);
1008729      else
1009730         data = offset & 0xff;
1010731
1011      LOG(3,("%9.7f 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "STATUS" : "DATA"));
732      LOG(3,("%10s 6502-PC: %04x decocass_type2_r(%02x): $%02x <- 8041-%s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "STATUS" : "DATA"));
1012733   }
1013734   return data;
1014735}
r4057r4058
1019740   {
1020741      if (1 == (offset & 1))
1021742      {
1022         LOG(4,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
743         LOG(4,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM+D2 latch", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
1023744      }
1024745      else
1025746      {
1026747         type2_promaddr = data;
1027         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, type2_promaddr));
748         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> set PROM addr $%02x\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, type2_promaddr));
1028749         return;
1029750      }
1030751   }
1031752   else
1032753   {
1033      LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA"));
754      LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s ", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041 DATA"));
1034755   }
1035756   if (1 == (offset & 1))
1036757   {
r4057r4058
1041762         LOG(3,("PROM:%s D2:%d", type2_xx_latch ? "on" : "off", type2_d2_latch));
1042763      }
1043764   }
1044   cpu_set_reg(space->machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data);
765   upi41_master_w(space->machine->cpu[2], offset & 1, data);
1045766
1046767#ifdef MAME_DEBUG
1047768   decocass_fno(offset, data);
r4057r4058
1072793   {
1073794      if (1 == type3_pal_19)
1074795      {
1075         UINT8 *prom = memory_region(space->machine, "user1");
796         UINT8 *prom = memory_region(space->machine, "dongle");
1076797         data = prom[type3_ctrs];
1077         LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, type3_ctrs));
798         LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- prom[$%03x]\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, type3_ctrs));
1078799         if (++type3_ctrs == 4096)
1079800            type3_ctrs = 0;
1080801      }
r4057r4058
1082803      {
1083804         if (0 == (offset & E5XX_MASK))
1084805         {
1085            data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
1086            LOG(4,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
806            data = upi41_master_r(space->machine->cpu[2], 1);
807            LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- 8041 STATUS\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
1087808         }
1088809         else
1089810         {
1090811            data = 0xff;   /* open data bus? */
1091            LOG(4,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
812            LOG(4,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
1092813         }
1093814      }
1094815   }
r4057r4058
1097818      if (1 == type3_pal_19)
1098819      {
1099820         save = data = 0xff;    /* open data bus? */
1100         LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
821         LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x <- open bus", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
1101822      }
1102823      else
1103824      {
1104825         if (0 == (offset & E5XX_MASK))
1105826         {
1106            save = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
827            save = upi41_master_r(space->machine->cpu[2], 0);
1107828            switch (type3_swap)
1108829            {
1109830            case TYPE3_SWAP_01:
r4057r4058
1228949                  (BIT7(save) << 7);
1229950            }
1230951            type3_d0_latch = save & 1;
1231            LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
952            LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- 8041-DATA\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
1232953         }
1233954         else
1234955         {
r4057r4058
1242963               (BIT5(save) << 5) |
1243964               (BIT6(save) << 7) |
1244965               (BIT7(save) << 6);
1245            LOG(3,("%9.7f 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
966            LOG(3,("%10s 6502-PC: %04x decocass_type3_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
1246967            type3_d0_latch = save & 1;
1247968         }
1248969      }
r4057r4058
1258979      if (1 == type3_pal_19)
1259980      {
1260981         type3_ctrs = data << 4;
1261         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, "LDCTRS"));
982         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, "LDCTRS"));
1262983         return;
1263984      }
1264985      else
r4057r4058
1270991      if (1 == type3_pal_19)
1271992      {
1272993         /* write nowhere?? */
1273         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
994         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
1274995         return;
1275996      }
1276997   }
1277   LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1278   cpu_set_reg(space->machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data);
998   LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
999   upi41_master_w(space->machine->cpu[2], offset, data);
12791000}
12801001
12811002/***************************************************************************
r4057r4058
12981019   {
12991020      if (0 == (offset & E5XX_MASK))
13001021      {
1301         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
1302         LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1022         data = upi41_master_r(space->machine->cpu[2], 1);
1023         LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- 8041 STATUS\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
13031024      }
13041025      else
13051026      {
13061027         data = 0xff;   /* open data bus? */
1307         LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1028         LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
13081029      }
13091030   }
13101031   else
13111032   {
13121033      if (type4_latch)
13131034      {
1314         UINT8 *prom = memory_region(space->machine, "user1");
1035         UINT8 *prom = memory_region(space->machine, "dongle");
13151036
13161037         data = prom[type4_ctrs];
1317         LOG(3,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.', type4_ctrs));
1038         LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- PROM[%04x]\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.', type4_ctrs));
13181039         type4_ctrs = (type4_ctrs+1) & 0x7fff;
13191040      }
13201041      else
13211042      {
13221043         if (0 == (offset & E5XX_MASK))
13231044         {
1324            data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
1325            LOG(3,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
1045            data = upi41_master_r(space->machine->cpu[2], 0);
1046            LOG(3,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
13261047         }
13271048         else
13281049         {
13291050            data = 0xff;   /* open data bus? */
1330            LOG(4,("%9.7f 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1051            LOG(4,("%10s 6502-PC: %04x decocass_type4_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
13311052         }
13321053      }
13331054   }
r4057r4058
13421063      if (1 == type4_latch)
13431064      {
13441065         type4_ctrs = (type4_ctrs & 0x00ff) | ((data & 0x7f) << 8);
1345         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, type4_ctrs));
1066         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS MSB (%04x)\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, type4_ctrs));
13461067         return;
13471068      }
13481069      else
r4057r4058
13561077      if (type4_latch)
13571078      {
13581079         type4_ctrs = (type4_ctrs & 0xff00) | data;
1359         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, type4_ctrs));
1080         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> CTRS LSB (%04x)\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, type4_ctrs));
13601081         return;
13611082      }
13621083   }
1363   LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1364   cpu_set_reg(space->machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data);
1084   LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1085   upi41_master_w(space->machine->cpu[2], offset, data);
13651086}
13661087
13671088/***************************************************************************
r4057r4058
13811102   {
13821103      if (0 == (offset & E5XX_MASK))
13831104      {
1384         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
1385         LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1105         data = upi41_master_r(space->machine->cpu[2], 1);
1106         LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- 8041 STATUS\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
13861107      }
13871108      else
13881109      {
13891110         data = 0xff;   /* open data bus? */
1390         LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1111         LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
13911112      }
13921113   }
13931114   else
r4057r4058
13951116      if (type5_latch)
13961117      {
13971118         data = 0x55;   /* Only a fixed value? It looks like this is all we need to do */
1398         LOG(3,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
1119         LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- fixed value???\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
13991120      }
14001121      else
14011122      {
14021123         if (0 == (offset & E5XX_MASK))
14031124         {
1404            data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
1405            LOG(3,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
1125            data = upi41_master_r(space->machine->cpu[2], 0);
1126            LOG(3,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
14061127         }
14071128         else
14081129         {
14091130            data = 0xff;   /* open data bus? */
1410            LOG(4,("%9.7f 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1131            LOG(4,("%10s 6502-PC: %04x decocass_type5_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
14111132         }
14121133      }
14131134   }
r4057r4058
14211142   {
14221143      if (1 == type5_latch)
14231144      {
1424         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, "latch #2??"));
1145         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, "latch #2??"));
14251146         return;
14261147      }
14271148      else
r4057r4058
14331154      if (type5_latch)
14341155      {
14351156         /* write nowhere?? */
1436         LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
1157         LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, "nowhere?"));
14371158         return;
14381159      }
14391160   }
1440   LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1441   cpu_set_reg(space->machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data);
1161   LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1162   upi41_master_w(space->machine->cpu[2], offset, data);
14421163}
14431164
14441165/***************************************************************************
r4057r4058
14571178   {
14581179      if (0 == (offset & E5XX_MASK))
14591180      {
1460         data = cpu_get_reg(space->machine->cpu[2], I8X41_STAT);
1461         LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1181         data = upi41_master_r(space->machine->cpu[2], 1);
1182         LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- 8041 STATUS\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
14621183      }
14631184      else
14641185      {
14651186         data = 0xff;   /* open data bus? */
1466         LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1187         LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
14671188      }
14681189   }
14691190   else
14701191   {
14711192      if (0 == (offset & E5XX_MASK))
14721193      {
1473         data = cpu_get_reg(space->machine->cpu[2], I8X41_DATA);
1474         LOG(3,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
1194         data = upi41_master_r(space->machine->cpu[2], 0);
1195         LOG(3,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x '%c' <- open bus (D0 replaced with latch)\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, (data >= 32) ? data : '.'));
14751196      }
14761197      else
14771198      {
14781199         data = 0xff;   /* open data bus? */
1479         LOG(4,("%9.7f 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1200         LOG(4,("%10s 6502-PC: %04x decocass_nodong_r(%02x): $%02x <- open bus\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
14801201      }
14811202   }
14821203
r4057r4058
14961217   /* E5x2-E5x3 and mirrors */
14971218   if (2 == (offset & E5XX_MASK))
14981219   {
1220      UINT8 bot_eot = (tape_get_status_bits(cassette_device) >> 5) & 1;
1221
14991222      data =
15001223         (BIT7(i8041_p1)      << 0) |   /* D0 = P17 - REQ/ */
15011224         (BIT0(i8041_p2)      << 1) |   /* D1 = P20 - FNO/ */
15021225         (BIT1(i8041_p2)      << 2) |   /* D2 = P21 - EOT/ */
15031226         (BIT2(i8041_p2)      << 3) |   /* D3 = P22 - ERR/ */
1504         ((tape_bot_eot)      << 4) |   /* D4 = BOT/EOT (direct from drive) */
1227         ((bot_eot)              << 4) |   /* D4 = BOT/EOT (direct from drive) */
15051228         (1                 << 5) |   /* D5 floating input */
15061229         (1                 << 6) |   /* D6 floating input */
1507         ((1 - tape_present)  << 7);   /* D7 = cassette present */
1230         (!tape_is_present(cassette_device) << 7);   /* D7 = cassette present */
15081231
1509      LOG(4,("%9.7f 6502-PC: %04x decocass_e5xx_r(%02x): $%02x <- STATUS (%s%s%s%s%s%s%s%s)\n",
1510         attotime_to_double(timer_get_time(space->machine)),
1232      LOG(4,("%10s 6502-PC: %04x decocass_e5xx_r(%02x): $%02x <- STATUS (%s%s%s%s%s%s%s%s)\n",
1233         attotime_string(timer_get_time(space->machine), 6),
15111234         cpu_get_previouspc(space->cpu),
15121235         offset, data,
15131236         data & 0x01 ? "" : "REQ/",
r4057r4058
15391262
15401263   if (0 == (offset & E5XX_MASK))
15411264   {
1542      LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1543      cpu_set_reg(space->machine->cpu[2], offset & 1 ? I8X41_CMND : I8X41_DATA, data);
1265      LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> %s\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data, offset & 1 ? "8041-CMND" : "8041-DATA"));
1266      upi41_master_w(space->machine->cpu[2], offset & 1, data);
15441267#ifdef MAME_DEBUG
15451268      decocass_fno(offset, data);
15461269#endif
15471270   }
15481271   else
15491272   {
1550      LOG(3,("%9.7f 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", attotime_to_double(timer_get_time(space->machine)), cpu_get_previouspc(space->cpu), offset, data));
1273      LOG(3,("%10s 6502-PC: %04x decocass_e5xx_w(%02x): $%02x -> dongle\n", attotime_string(timer_get_time(space->machine), 6), cpu_get_previouspc(space->cpu), offset, data));
15511274   }
15521275}
15531276
r4057r4058
15861309 *  state save setup
15871310 *
15881311 ***************************************************************************/
1589static STATE_POSTLOAD( decocass_state_save_postload )
1590{
1591#if 0
1592   /* fix me - this won't work anymore */
1593   int A;
1594   UINT8 *mem = memory_region(machine, REGION_CPU1);
1595   int diff = memory_region_length(machine, REGION_CPU1) / 2;
1596
1597   memory_set_opcode_base(0, mem + diff);
1598
1599   for (A = 0;A < 0x10000; A++)
1600      decocass_w(A, mem[A]);
1601   /* restart the timer if the tape was playing */
1602   if (0 != tape_dir)
1603      timer_adjust_oneshot(tape_timer, attotime_never, 0);
1604#endif
1605}
1606
16071312/* To be called once from driver_init, i.e. decocass_init */
16081313void decocass_machine_state_save_init(running_machine *machine)
16091314{
1610   state_save_register_postload(machine, decocass_state_save_postload, NULL);
1611   state_save_register_global(machine, tape_dir);
1612   state_save_register_global(machine, tape_speed);
1613   state_save_register_global(machine, tape_time0.seconds);
1614   state_save_register_global(machine, tape_time0.attoseconds);
16151315   state_save_register_global(machine, firsttime);
1616   state_save_register_global(machine, tape_present);
1617   state_save_register_global(machine, tape_blocks);
1618   state_save_register_global(machine, tape_length);
1619   state_save_register_global(machine, tape_bot_eot);
1620   state_save_register_global(machine, crc16_lsb);
1621   state_save_register_global(machine, crc16_msb);
1622   state_save_register_global_array(machine, tape_crc16_lsb);
1623   state_save_register_global_array(machine, tape_crc16_msb);
16241316   state_save_register_global(machine, decocass_reset);
16251317   state_save_register_global(machine, i8041_p1);
16261318   state_save_register_global(machine, i8041_p2);
r4057r4058
16461338 *
16471339 ***************************************************************************/
16481340
1649static void decocass_init_common(running_machine *machine)
1341MACHINE_START( decocass )
16501342{
1651   UINT8 *image = memory_region(machine, "user2");
1652   int i, offs;
1343   cassette_device = devtag_get_device(machine, DECOCASS_TAPE, "cassette");
1344}
16531345
1654   tape_dir = 0;
1655   tape_speed = 0;
1656   tape_timer = timer_alloc(machine, NULL, NULL);
1657
1346static void decocass_reset_common(running_machine *machine)
1347{
16581348   firsttime = 1;
16591349   latch1 = 0;
1660   tape_present = 1;
1661   tape_blocks = 0;
1662   for (i = memory_region_length(machine, "user2") / 256 - 1; !tape_blocks && i > 0; i--)
1663      for (offs = 256 * i; !tape_blocks && offs < 256 * i + 256; offs++)
1664         if (image[offs])
1665            tape_blocks = i+1;
1666   for (i = 0; i < tape_blocks; i++)
1667   {
1668      crc16_lsb = 0;
1669      crc16_msb = 0;
1670      for (offs = 256 * i; offs < 256 * i + 256; offs++)
1671      {
1672         tape_crc16(image[offs] << 7);
1673         tape_crc16(image[offs] << 6);
1674         tape_crc16(image[offs] << 5);
1675         tape_crc16(image[offs] << 4);
1676         tape_crc16(image[offs] << 3);
1677         tape_crc16(image[offs] << 2);
1678         tape_crc16(image[offs] << 1);
1679         tape_crc16(image[offs] << 0);
1680      }
1681      tape_crc16_lsb[i] = crc16_lsb;
1682      tape_crc16_msb[i] = crc16_msb;
1683   }
16841350
1685   tape_length = tape_blocks * TAPE_CHUNK * 8 * 2 + 2 * (TAPE_LEADER + TAPE_GAP + TAPE_HOLE);
1686   tape_time0 = attotime_mul(ATTOTIME_IN_HZ(TAPE_CLOCKRATE), TAPE_LEADER + TAPE_GAP - TAPE_HOLE);
1687   LOG(0,("tape: %d blocks\n", tape_blocks));
1688   tape_bot_eot = 0;
1689
16901351   decocass_dongle_r = NULL;
16911352   decocass_dongle_w = NULL;
16921353
r4057r4058
17081369
17091370   memset(decocass_quadrature_decoder, 0, sizeof(decocass_quadrature_decoder));
17101371   decocass_sound_ack = 0;
1711   decocass_sound_timer = timer_alloc(machine, decocass_sound_nmi_pulse, NULL);
1372
1373   audio_nmi_enabled = 0;
1374   audio_nmi_state = 0;
17121375}
17131376
17141377MACHINE_RESET( decocass )
17151378{
1716   decocass_init_common(machine);
1379   decocass_reset_common(machine);
17171380}
17181381
17191382MACHINE_RESET( ctsttape )
17201383{
1721   decocass_init_common(machine);
1384   decocass_reset_common(machine);
17221385   LOG(0,("dongle type #1 (DE-0061)\n"));
17231386   decocass_dongle_r = decocass_type1_pass_136_r;
17241387}
17251388
17261389MACHINE_RESET( chwy )
17271390{
1728   decocass_init_common(machine);
1391   decocass_reset_common(machine);
17291392   LOG(0,("dongle type #1 (DE-0061 own PROM)\n"));
17301393   decocass_dongle_r = decocass_type1_latch_27_pass_3_inv_2_r;
17311394}
17321395
17331396MACHINE_RESET( clocknch )
17341397{
1735   decocass_init_common(machine);
1398   decocass_reset_common(machine);
17361399   LOG(0,("dongle type #1 (DE-0061 flip 2-3)\n"));
17371400   decocass_dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
17381401   type1_inmap = MAKE_MAP(0,1,3,2,4,5,6,7);
r4057r4058
17411404
17421405MACHINE_RESET( ctisland )
17431406{
1744   decocass_init_common(machine);
1407   decocass_reset_common(machine);
17451408   LOG(0,("dongle type #1 (DE-0061 flip 0-2)\n"));
17461409   decocass_dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
17471410   type1_inmap = MAKE_MAP(2,1,0,3,4,5,6,7);
r4057r4058
17501413
17511414MACHINE_RESET( csuperas )
17521415{
1753   decocass_init_common(machine);
1416   decocass_reset_common(machine);
17541417   LOG(0,("dongle type #1 (DE-0061 flip 4-5)\n"));
17551418   decocass_dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
17561419   type1_inmap = MAKE_MAP(0,1,2,3,5,4,6,7);
r4057r4058
17591422
17601423MACHINE_RESET( castfant )
17611424{
1762   decocass_init_common(machine);
1425   decocass_reset_common(machine);
17631426   LOG(0,("dongle type #1 (DE-0061)\n"));
17641427   decocass_dongle_r = decocass_type1_latch_16_pass_3_inv_1_r;
17651428}
17661429
17671430MACHINE_RESET( cluckypo )
17681431{
1769   decocass_init_common(machine);
1432   decocass_reset_common(machine);
17701433   LOG(0,("dongle type #1 (DE-0061 flip 1-3)\n"));
17711434   decocass_dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
17721435   type1_inmap = MAKE_MAP(0,3,2,1,4,5,6,7);
r4057r4058
17751438
17761439MACHINE_RESET( cterrani )
17771440{
1778   decocass_init_common(machine);
1441   decocass_reset_common(machine);
17791442   LOG(0,("dongle type #1 (DE-0061 straight)\n"));
17801443   decocass_dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
17811444   type1_inmap = MAKE_MAP(0,1,2,3,4,5,6,7);
r4057r4058
17841447
17851448MACHINE_RESET( cexplore )
17861449{
1787   decocass_init_common(machine);
1450   decocass_reset_common(machine);
17881451   LOG(0,("dongle type #1 (DE-0061 own PROM)\n"));
17891452   decocass_dongle_r = decocass_type1_latch_26_pass_5_inv_2_r;
17901453}
17911454
17921455MACHINE_RESET( cprogolf )
17931456{
1794   decocass_init_common(machine);
1457   decocass_reset_common(machine);
17951458   LOG(0,("dongle type #1 (DE-0061 flip 0-1)\n"));
17961459   decocass_dongle_r = decocass_type1_latch_26_pass_3_inv_2_r;
17971460   type1_inmap = MAKE_MAP(1,0,2,3,4,5,6,7);
r4057r4058
18001463
18011464MACHINE_RESET( cmissnx )
18021465{
1803   decocass_init_common(machine);
1466   decocass_reset_common(machine);
18041467   LOG(0,("dongle type #2 (CS82-007)\n"));
18051468   decocass_dongle_r = decocass_type2_r;
18061469   decocass_dongle_w = decocass_type2_w;
r4057r4058
18081471
18091472MACHINE_RESET( cdiscon1 )
18101473{
1811   decocass_init_common(machine);
1474   decocass_reset_common(machine);
18121475   LOG(0,("dongle type #2 (CS82-007)\n"));
18131476   decocass_dongle_r = decocass_type2_r;
18141477   decocass_dongle_w = decocass_type2_w;
r4057r4058
18161479
18171480MACHINE_RESET( cptennis )
18181481{
1819   decocass_init_common(machine);
1482   decocass_reset_common(machine);
18201483   LOG(0,("dongle type #2 (CS82-007)\n"));
18211484   decocass_dongle_r = decocass_type2_r;
18221485   decocass_dongle_w = decocass_type2_w;
r4057r4058
18241487
18251488MACHINE_RESET( ctornado )
18261489{
1827   decocass_init_common(machine);
1490   decocass_reset_common(machine);
18281491   LOG(0,("dongle type #2 (CS82-007)\n"));
18291492   decocass_dongle_r = decocass_type2_r;
18301493   decocass_dongle_w = decocass_type2_w;
r4057r4058
18321495
18331496MACHINE_RESET( cbnj )
18341497{
1835   decocass_init_common(machine);
1498   decocass_reset_common(machine);
18361499   LOG(0,("dongle type #3 (PAL)\n"));
18371500   decocass_dongle_r = decocass_type3_r;
18381501   decocass_dongle_w = decocass_type3_w;
r4057r4058
18411504
18421505MACHINE_RESET( cburnrub )
18431506{
1844   decocass_init_common(machine);
1507   decocass_reset_common(machine);
18451508   LOG(0,("dongle type #3 (PAL)\n"));
18461509   decocass_dongle_r = decocass_type3_r;
18471510   decocass_dongle_w = decocass_type3_w;
r4057r4058
18501513
18511514MACHINE_RESET( cbtime )
18521515{
1853   decocass_init_common(machine);
1516   decocass_reset_common(machine);
18541517   LOG(0,("dongle type #3 (PAL)\n"));
18551518   decocass_dongle_r = decocass_type3_r;
18561519   decocass_dongle_w = decocass_type3_w;
r4057r4058
18591522
18601523MACHINE_RESET( cgraplop )
18611524{
1862   decocass_init_common(machine);
1525   decocass_reset_common(machine);
18631526   LOG(0,("dongle type #3 (PAL)\n"));
18641527   decocass_dongle_r = decocass_type3_r;
18651528   decocass_dongle_w = decocass_type3_w;
r4057r4058
18681531
18691532MACHINE_RESET( cgraplp2 )
18701533{
1871   decocass_init_common(machine);
1534   decocass_reset_common(machine);
18721535   LOG(0,("dongle type #3 (PAL)\n"));
18731536   decocass_dongle_r = decocass_type3_r;
18741537   decocass_dongle_w = decocass_type3_w;
r4057r4058
18771540
18781541MACHINE_RESET( clapapa )
18791542{
1880   decocass_init_common(machine);
1543   decocass_reset_common(machine);
18811544   LOG(0,("dongle type #3 (PAL)\n"));
18821545   decocass_dongle_r = decocass_type3_r;
18831546   decocass_dongle_w = decocass_type3_w;
r4057r4058
18861549
18871550MACHINE_RESET( cfghtice )
18881551{
1889   decocass_init_common(machine);
1552   decocass_reset_common(machine);
18901553   LOG(0,("dongle type #3 (PAL)\n"));
18911554   decocass_dongle_r = decocass_type3_r;
18921555   decocass_dongle_w = decocass_type3_w;
r4057r4058
18951558
18961559MACHINE_RESET( cprobowl )
18971560{
1898   decocass_init_common(machine);
1561   decocass_reset_common(machine);
18991562   LOG(0,("dongle type #3 (PAL)\n"));
19001563   decocass_dongle_r = decocass_type3_r;
19011564   decocass_dongle_w = decocass_type3_w;
r4057r4058
19041567
19051568MACHINE_RESET( cnightst )
19061569{
1907   decocass_init_common(machine);
1570   decocass_reset_common(machine);
19081571   LOG(0,("dongle type #3 (PAL)\n"));
19091572   decocass_dongle_r = decocass_type3_r;
19101573   decocass_dongle_w = decocass_type3_w;
r4057r4058
19131576
19141577MACHINE_RESET( cprosocc )
19151578{
1916   decocass_init_common(machine);
1579   decocass_reset_common(machine);
19171580   LOG(0,("dongle type #3 (PAL)\n"));
19181581   decocass_dongle_r = decocass_type3_r;
19191582   decocass_dongle_w = decocass_type3_w;
r4057r4058
19221585
19231586MACHINE_RESET( cppicf )
19241587{
1925   decocass_init_common(machine);
1588   decocass_reset_common(machine);
19261589   LOG(0,("dongle type #3 (PAL)\n"));
19271590   decocass_dongle_r = decocass_type3_r;
19281591   decocass_dongle_w = decocass_type3_w;
r4057r4058
19311594
19321595MACHINE_RESET( cscrtry )
19331596{
1934   decocass_init_common(machine);
1597   decocass_reset_common(machine);
19351598   LOG(0,("dongle type #4 (32K ROM)\n"));
19361599   decocass_dongle_r = decocass_type4_r;
19371600   decocass_dongle_w = decocass_type4_w;
r4057r4058
19391602
19401603MACHINE_RESET( cbdash )
19411604{
1942   decocass_init_common(machine);
1605   decocass_reset_common(machine);
19431606   LOG(0,("dongle type #5 (NOP)\n"));
19441607   decocass_dongle_r = decocass_type5_r;
19451608   decocass_dongle_w = decocass_type5_w;
r4057r4058
19471610
19481611MACHINE_RESET( cflyball )
19491612{
1950   decocass_init_common(machine);
1613   decocass_reset_common(machine);
19511614   LOG(0,("no dongle\n"));
19521615   decocass_dongle_r = decocass_nodong_r;
19531616}
19541617
19551618MACHINE_RESET( czeroize )
19561619{
1957   UINT8 *mem = memory_region(machine, "user1");
1958   decocass_init_common(machine);
1620   UINT8 *mem = memory_region(machine, "dongle");
1621   decocass_reset_common(machine);
19591622   LOG(0,("dongle type #3 (PAL)\n"));
19601623   decocass_dongle_r = decocass_type3_r;
19611624   decocass_dongle_w = decocass_type3_w;
r4057r4058
19781641 *
19791642 ***************************************************************************/
19801643
1981static void tape_stop(void)
1982{
1983   /* remember time */
1984   tape_time0 = decocass_adjust_tape_time(tape_time0);
1985
1986   timer_adjust_oneshot(tape_timer, attotime_never, 0);
1987}
1988
1989
19901644WRITE8_HANDLER( i8041_p1_w )
19911645{
19921646   static int i8041_p1_old;
19931647
19941648   if (data != i8041_p1_old)
19951649   {
1996      LOG(4,("%9.7f 8041-PC: %03x i8041_p1_w: $%02x (%s%s%s%s%s%s%s%s)\n",
1997         attotime_to_double(timer_get_time(space->machine)),
1650      LOG(4,("%10s 8041-PC: %03x i8041_p1_w: $%02x (%s%s%s%s%s%s%s%s)\n",
1651         attotime_string(timer_get_time(space->machine), 6),
19981652         cpu_get_previouspc(space->cpu),
19991653         data,
20001654         data & 0x01 ? "" : "DATA-WRT",
r4057r4058
20081662      i8041_p1_old = data;
20091663   }
20101664
2011   /* change in REW signal ? */
2012   if ((data ^ i8041_p1) & 0x10)
1665   /* change in FAST/REW/FWD signals? */
1666   if ((data ^ i8041_p1) & 0x34)
20131667   {
2014      tape_stop();
2015      if (0 == (data & 0x10))
2016      {
2017         LOG(2,("tape %5.4fs: rewind\n", attotime_to_double(tape_time0)));
2018         tape_dir = -1;
2019         timer_adjust_oneshot(tape_timer, attotime_never, 0);
2020         set_led_status(0, 1);
2021      }
2022      else
2023      {
2024         tape_dir = 0;
2025         tape_speed = 0;
2026         LOG(2,("tape %5.4fs: stopped\n", attotime_to_double(tape_time0)));
2027#if TAPE_UI_DISPLAY
2028         popmessage("   [%05.1fs]   ", attotime_to_double(tape_time0));
2029#endif
2030         set_led_status(0, 0);
2031      }
2032   }
1668      int newspeed = 0;
20331669
2034   /* change in FWD signal ? */
2035   if ((data ^ i8041_p1) & 0x20)
2036   {
2037      tape_stop();
2038      if (0 == (data & 0x20))
2039      {
2040         LOG(2,("tape %5.4fs: forward\n", attotime_to_double(tape_time0)));
2041         tape_dir = +1;
2042         timer_adjust_oneshot(tape_timer, attotime_never, 0);
2043         set_led_status(0, 1);
2044      }
2045      else
2046      {
2047         tape_dir = 0;
2048         tape_speed = 0;
2049         LOG(2,("tape %5.4fs: stopped\n", attotime_to_double(tape_time0)));
2050#if TAPE_UI_DISPLAY
2051         popmessage("   [%05.1fs]   ", attotime_to_double(tape_time0));
2052#endif
2053         set_led_status(0, 0);
2054      }
1670      if ((data & 0x30) == 0x20)
1671         newspeed = (data & 0x04) ? -1 : -7;
1672      else if ((data & 0x30) == 0x10)
1673         newspeed = (data & 0x04) ? 1 : 7;
1674      tape_change_speed(cassette_device, newspeed);
20551675   }
20561676
2057   /* change in FAST signal ? */
2058   if (tape_timer && (data ^ i8041_p1) & 0x04)
2059   {
2060      tape_stop();
2061      tape_speed = (0 == (data & 0x04)) ? 1 : 0;
2062
2063      if (tape_dir < 0)
2064      {
2065         LOG(2,("tape: fast rewind %s\n", (0 == (data & 0x04)) ? "on" : "off"));
2066         tape_dir = (tape_speed) ? -7 : -1;
2067         timer_adjust_oneshot(tape_timer, attotime_never, 0);
2068      }
2069      else
2070      if (tape_dir > 0)
2071      {
2072         LOG(2,("tape: fast forward %s\n", (0 == (data & 0x04)) ? "on" : "off"));
2073         tape_dir = (tape_speed) ? +7 : +1;
2074         timer_adjust_oneshot(tape_timer, attotime_never, 0);
2075      }
2076   }
2077
20781677   i8041_p1 = data;
20791678}
20801679
r4057r4058
20851684
20861685   if (data != i8041_p1_old)
20871686   {
2088      LOG(4,("%9.7f 8041-PC: %03x i8041_p1_r: $%02x (%s%s%s%s%s%s%s%s)\n",
2089         attotime_to_double(timer_get_time(space->machine)),
1687      LOG(4,("%10s 8041-PC: %03x i8041_p1_r: $%02x (%s%s%s%s%s%s%s%s)\n",
1688         attotime_string(timer_get_time(space->machine), 6),
20901689         cpu_get_previouspc(space->cpu),
20911690         data,
20921691         data & 0x01 ? "" : "DATA-WRT",
r4057r4058
21081707
21091708   if (data != i8041_p2_old)
21101709   {
2111      LOG(4,("%9.7f 8041-PC: %03x i8041_p2_w: $%02x (%s%s%s%s%s%s%s%s)\n",
2112         attotime_to_double(timer_get_time(space->machine)),
1710      LOG(4,("%10s 8041-PC: %03x i8041_p2_w: $%02x (%s%s%s%s%s%s%s%s)\n",
1711         attotime_string(timer_get_time(space->machine), 6),
21131712         cpu_get_previouspc(space->cpu),
21141713         data,
21151714         data & 0x01 ? "" : "FNO/",
r4057r4058
21221721         data & 0x80 ? " [RDATA]" : ""));
21231722      i8041_p2_old = data;
21241723   }
2125   i8041_p2 = data;
1724   i8041_p2 = (i8041_p2 & 0xe0) | (data & ~0xe0);
21261725}
21271726
21281727READ8_HANDLER( i8041_p2_r )
r4057r4058
21301729   UINT8 data;
21311730   static int i8041_p2_old;
21321731
2133   tape_update(space->machine);
1732   data = (i8041_p2 & ~0xe0) | tape_get_status_bits(cassette_device);
21341733
2135   data = i8041_p2;
2136
21371734   if (data != i8041_p2_old)
21381735   {
2139      LOG(4,("%9.7f 8041-PC: %03x i8041_p2_r: $%02x (%s%s%s%s%s%s%s%s)\n",
2140         attotime_to_double(timer_get_time(space->machine)),
1736      LOG(4,("%10s 8041-PC: %03x i8041_p2_r: $%02x (%s%s%s%s%s%s%s%s)\n",
1737         attotime_string(timer_get_time(space->machine), 6),
21411738         cpu_get_previouspc(space->cpu),
21421739         data,
21431740         data & 0x01 ? "" : "FNO/",
r4057r4058
21541751}
21551752
21561753
1754
1755/***************************************************************************
1756    CASSETTE DEVICE INTERFACE
1757***************************************************************************/
1758
1759/* regions within the virtual tape */
1760enum _tape_region
1761{
1762   REGION_LEADER,            /* in clear leader section */
1763   REGION_LEADER_GAP,         /* in gap between leader and BOT */
1764   REGION_BOT,               /* in BOT hole */
1765   REGION_BOT_GAP,            /* in gap between BOT hole and data */
1766   REGION_DATA_BLOCK_0,      /* in data block 0 */
1767   REGION_DATA_BLOCK_255 = REGION_DATA_BLOCK_0 + 255,
1768   REGION_EOT_GAP,            /* in gap between data and EOT hole */
1769   REGION_EOT,               /* in EOT hole */
1770   REGION_TRAILER_GAP,         /* in gap between trailer and EOT */
1771   REGION_TRAILER            /* in clear trailer section */
1772};
1773typedef enum _tape_region tape_region;
1774
1775
1776/* bytes within a data block on a virtual tape */
1777enum _tape_byte
1778{
1779   BYTE_PRE_GAP_0,            /* 34 bytes of gap, clock held to 0, no data */
1780   BYTE_PRE_GAP_33 = BYTE_PRE_GAP_0 + 33,
1781   BYTE_LEADIN,            /* 1 leadin byte, clocked value 0x00 */
1782   BYTE_HEADER,            /* 1 header byte, clocked value 0xAA */
1783   BYTE_DATA_0,            /* 256 bytes of data, clocked */
1784   BYTE_DATA_255 = BYTE_DATA_0 + 255,
1785   BYTE_CRC16_MSB,            /* 2 bytes of CRC, clocked MSB first, then LSB */
1786   BYTE_CRC16_LSB,
1787   BYTE_TRAILER,            /* 1 trailer byte, clocked value 0xAA */
1788   BYTE_LEADOUT,            /* 1 leadout byte, clocked value 0x00 */
1789   BYTE_LONGCLOCK,            /* 1 longclock byte, clock held to 1, no data */
1790   BYTE_POSTGAP_0,            /* 34 bytes of gap, no clock, no data */
1791   BYTE_POSTGAP_33 = BYTE_POSTGAP_0 + 33,
1792   BYTE_BLOCK_TOTAL         /* total number of bytes in block */
1793};
1794typedef enum _tape_byte tape_byte;
1795
1796
1797/* state of the tape */
1798typedef struct _tape_state tape_state;
1799struct _tape_state
1800{
1801   running_machine *   machine;         /* pointer back to the machine */
1802   emu_timer *         timer;            /* timer for running the tape */
1803   INT8            speed;            /* speed: <-1=fast rewind, -1=reverse, 0=stopped, 1=normal, >1=fast forward */
1804   tape_region         region;            /* current region */
1805   tape_byte         bytenum;         /* byte number within a datablock */
1806   UINT8            bitnum;            /* bit number within a byte */
1807   UINT32            clockpos;         /* the current clock position of the tape */
1808   UINT32            numclocks;         /* total number of clocks on the entire tape */
1809   UINT16            crc16[256];         /* CRC16 for each block */
1810};
1811
1812
1813/* number of tape clock pulses per second */
1814#define TAPE_CLOCKRATE               4800
1815#define TAPE_CLOCKS_PER_BIT            2
1816#define TAPE_CLOCKS_PER_BYTE         (8 * TAPE_CLOCKS_PER_BIT)
1817#define TAPE_MSEC_TO_CLOCKS(x)         ((x) * TAPE_CLOCKRATE / 1000)
1818
1819
1820/* Note on a tapes leader-BOT-data-EOT-trailer format:
1821 * A cassette has a transparent piece of tape on both ends,
1822 * leader and trailer. And data tapes also have BOT and EOT
1823 * holes, shortly before the the leader and trailer.
1824 * The holes and clear tape are detected using a photo-resitor.
1825 * When rewinding, the BOT/EOT signal will show a short
1826 * pulse and if rewind continues a constant high signal later.
1827 * The specs say the holes are "> 2ms" in length.
1828 */
1829
1830/* duration of the clear LEADER (and trailer) of the tape */
1831#define REGION_LEADER_START_CLOCK      0
1832#define REGION_LEADER_LEN_CLOCKS      TAPE_MSEC_TO_CLOCKS(1000)   /* 1s */
1833#define REGION_LEADER_END_CLOCK         (REGION_LEADER_START_CLOCK+REGION_LEADER_LEN_CLOCKS)
1834
1835/* duration of the GAP between leader and BOT/EOT */
1836#define REGION_LEADER_GAP_START_CLOCK   REGION_LEADER_END_CLOCK
1837#define REGION_LEADER_GAP_LEN_CLOCKS   TAPE_MSEC_TO_CLOCKS(1500)   /* 1.5s */
1838#define REGION_LEADER_GAP_END_CLOCK      (REGION_LEADER_GAP_START_CLOCK+REGION_LEADER_GAP_LEN_CLOCKS)
1839
1840/* duration of BOT/EOT holes */
1841#define REGION_BOT_START_CLOCK         REGION_LEADER_GAP_END_CLOCK
1842#define REGION_BOT_LEN_CLOCKS         TAPE_MSEC_TO_CLOCKS(2.5)   /* 0.0025s */
1843#define REGION_BOT_END_CLOCK         (REGION_BOT_START_CLOCK+REGION_BOT_LEN_CLOCKS)
1844
1845/* gap between BOT/EOT and first/last data block */
1846#define REGION_BOT_GAP_START_CLOCK      REGION_BOT_END_CLOCK
1847#define REGION_BOT_GAP_LEN_CLOCKS      TAPE_MSEC_TO_CLOCKS(300)   /* 300ms */
1848#define REGION_BOT_GAP_END_CLOCK      (REGION_BOT_GAP_START_CLOCK+REGION_BOT_GAP_LEN_CLOCKS)
1849
1850
1851/*-------------------------------------------------
1852    get_safe_token - makes sure that the passed
1853    in device is, in fact, an IDE controller
1854-------------------------------------------------*/
1855
1856INLINE tape_state *get_safe_token(const device_config *device)
1857{
1858   assert(device != NULL);
1859   assert(device->token != NULL);
1860   assert(device->type == DECOCASS_TAPE);
1861
1862   return (tape_state *)device->token;
1863}
1864
1865
1866/*-------------------------------------------------
1867    tape_crc16_byte - accumulate 8 bits worth of
1868    CRC data
1869-------------------------------------------------*/
1870
1871static UINT16 tape_crc16_byte(UINT16 crc, UINT8 data)
1872{
1873   int bit;
1874
1875   for (bit = 0; bit < 8; bit++)
1876   {
1877      crc = (crc >> 1) | (crc << 15);
1878      crc ^= (data << 7) & 0x80;
1879      if (crc & 0x80)
1880         crc ^= 0x0120;
1881      data >>= 1;
1882   }
1883   return crc;
1884}
1885
1886
1887/*-------------------------------------------------
1888    tape_describe_state - create a string that
1889    describes the state of the tape
1890-------------------------------------------------*/
1891
1892static const char *tape_describe_state(tape_state *tape)
1893{
1894   static char buffer[40];
1895   char temprname[40];
1896   const char *rname = temprname;
1897
1898   if (tape->region == REGION_LEADER)
1899      rname = "LEAD";
1900   else if (tape->region == REGION_LEADER_GAP)
1901      rname = "LGAP";
1902   else if (tape->region == REGION_BOT)
1903      rname = "BOT ";
1904   else if (tape->region == REGION_BOT_GAP)
1905      rname = "BGAP";
1906   else if (tape->region == REGION_TRAILER)
1907      rname = "TRLR";
1908   else if (tape->region == REGION_TRAILER_GAP)
1909      rname = "TGAP";
1910   else if (tape->region == REGION_EOT)
1911      rname = "EOT ";
1912   else if (tape->region == REGION_EOT_GAP)
1913      rname = "EGAP";
1914   else
1915   {
1916      char tempbname[40];
1917      const char *bname = tempbname;
1918      int clk;
1919
1920      if (tape->bytenum <= BYTE_PRE_GAP_33)
1921         sprintf(tempbname, "PR%02d", tape->bytenum - BYTE_PRE_GAP_0);
1922      else if (tape->bytenum == BYTE_LEADIN)
1923         bname = "LDIN";
1924      else if (tape->bytenum == BYTE_HEADER)
1925         bname = "HEAD";
1926      else if (tape->bytenum <= BYTE_DATA_255)
1927         sprintf(tempbname, "BY%02X", tape->bytenum - BYTE_DATA_0);
1928      else if (tape->bytenum == BYTE_CRC16_MSB)
1929         bname = "CRCM";
1930      else if (tape->bytenum == BYTE_CRC16_LSB)
1931         bname = "CRCL";
1932      else if (tape->bytenum == BYTE_TRAILER)
1933         bname = "TRLR";
1934      else if (tape->bytenum == BYTE_LEADOUT)
1935         bname = "LOUT";
1936      else if (tape->bytenum == BYTE_LONGCLOCK)
1937         bname = "LONG";
1938      else
1939         sprintf(tempbname, "PO%02d", tape->bytenum - BYTE_POSTGAP_0);
1940
1941      /* in the main data area, the clock alternates at the clock rate */
1942      if (tape->bytenum >= BYTE_LEADIN && tape->bytenum <= BYTE_LEADOUT)
1943         clk = ((UINT32)(tape->clockpos - REGION_BOT_GAP_END_CLOCK) & 1) ? 0 : 1;
1944      else if (tape->bytenum == BYTE_LONGCLOCK)
1945         clk = 1;
1946      else
1947         clk = 0;
1948
1949      sprintf(temprname, "BL%02X.%4s.%d.%d", tape->region - REGION_DATA_BLOCK_0, bname, tape->bitnum, clk);
1950   }
1951
1952   sprintf(buffer, "{%9d=%s}", tape->clockpos, rname);
1953   return buffer;
1954}
1955
1956
1957/*-------------------------------------------------
1958    tape_clock_callback - called once per clock
1959    to increment/decrement the tape location
1960-------------------------------------------------*/
1961
1962static TIMER_CALLBACK( tape_clock_callback )
1963{
1964   const device_config *device = ptr;
1965   tape_state *tape = get_safe_token(device);
1966
1967   /* advance by one clock in the desired direction */
1968   if (tape->speed < 0 && tape->clockpos > 0)
1969      tape->clockpos--;
1970   else if (tape->speed > 0 && tape->clockpos < tape->numclocks)
1971      tape->clockpos++;
1972
1973   /* look for states before the start of data */
1974   if (tape->clockpos < REGION_LEADER_END_CLOCK)
1975      tape->region = REGION_LEADER;
1976   else if (tape->clockpos < REGION_LEADER_GAP_END_CLOCK)
1977      tape->region = REGION_LEADER_GAP;
1978   else if (tape->clockpos < REGION_BOT_END_CLOCK)
1979      tape->region = REGION_BOT;
1980   else if (tape->clockpos < REGION_BOT_GAP_END_CLOCK)
1981      tape->region = REGION_BOT_GAP;
1982
1983   /* look for states after the end of data */
1984   else if (tape->clockpos >= tape->numclocks - REGION_LEADER_END_CLOCK)
1985      tape->region = REGION_TRAILER;
1986   else if (tape->clockpos >= tape->numclocks - REGION_LEADER_GAP_END_CLOCK)
1987      tape->region = REGION_TRAILER_GAP;
1988   else if (tape->clockpos >= tape->numclocks - REGION_BOT_END_CLOCK)
1989      tape->region = REGION_EOT;
1990   else if (tape->clockpos >= tape->numclocks - REGION_BOT_GAP_END_CLOCK)
1991      tape->region = REGION_EOT_GAP;
1992
1993   /* everything else is data */
1994   else
1995   {
1996      UINT32 dataclock = tape->clockpos - REGION_BOT_GAP_END_CLOCK;
1997
1998      /* compute the block number */
1999      tape->region = REGION_DATA_BLOCK_0 + dataclock / (TAPE_CLOCKS_PER_BYTE * BYTE_BLOCK_TOTAL);
2000      dataclock -= (tape->region - REGION_DATA_BLOCK_0) * TAPE_CLOCKS_PER_BYTE * BYTE_BLOCK_TOTAL;
2001
2002      /* compute the byte within the block */
2003      tape->bytenum = dataclock / TAPE_CLOCKS_PER_BYTE;
2004      dataclock -= tape->bytenum * TAPE_CLOCKS_PER_BYTE;
2005
2006      /* compute the bit within the byte */
2007      tape->bitnum = dataclock / TAPE_CLOCKS_PER_BIT;
2008   }
2009
2010   /* log */
2011   if (LOG_CASSETTE_STATE)
2012      tape_describe_state(tape);
2013}
2014
2015
2016/*-------------------------------------------------
2017    tape_get_status_bits - return the 3 status
2018    bits from the tape
2019-------------------------------------------------*/
2020
2021static UINT8 tape_get_status_bits(const device_config *device)
2022{
2023   tape_state *tape = get_safe_token(device);
2024   UINT8 tape_bits = 0;
2025
2026   /* bit 0x20 is the BOT/EOT signal, which is also set in the leader/trailer area */
2027   if (tape->region == REGION_LEADER || tape->region == REGION_BOT || tape->region == REGION_EOT || tape->region == REGION_TRAILER)
2028      tape_bits |= 0x20;
2029
2030   /* bit 0x40 is the clock, which is only valid in some areas of the data block */
2031   /* bit 0x80 is the data, which is only valid in some areas of the data block */
2032   if (tape->region >= REGION_DATA_BLOCK_0 && tape->region <= REGION_DATA_BLOCK_255)
2033   {
2034      int blocknum = tape->region - REGION_DATA_BLOCK_0;
2035      UINT8 byteval = 0x00;
2036
2037      /* in the main data area, the clock alternates at the clock rate */
2038      if (tape->bytenum >= BYTE_LEADIN && tape->bytenum <= BYTE_LEADOUT)
2039         tape_bits |= ((UINT32)(tape->clockpos - REGION_BOT_GAP_END_CLOCK) & 1) ? 0x00 : 0x40;
2040
2041      /* in the longclock area, the clock holds high */
2042      else if (tape->bytenum == BYTE_LONGCLOCK)
2043         tape_bits |= 0x40;
2044
2045      /* everywhere else, the clock holds to 0 */
2046      else
2047         ;
2048
2049      /* lead-in and lead-out bytes are 0xAA */
2050      if (tape->bytenum == BYTE_HEADER || tape->bytenum == BYTE_TRAILER)
2051         byteval = 0xaa;
2052
2053      /* data block bytes are data */
2054      else if (tape->bytenum >= BYTE_DATA_0 && tape->bytenum <= BYTE_DATA_255)
2055         byteval = device->region[blocknum * 256 + (tape->bytenum - BYTE_DATA_0)];
2056
2057      /* CRC MSB */
2058      else if (tape->bytenum == BYTE_CRC16_MSB)
2059         byteval = tape->crc16[blocknum] >> 8;
2060
2061      /* CRC LSB */
2062      else if (tape->bytenum == BYTE_CRC16_LSB)
2063         byteval = tape->crc16[blocknum];
2064
2065      /* select the appropriate bit from the byte and move to the upper bit */
2066      if ((byteval >> tape->bitnum) & 1)
2067         tape_bits |= 0x80;
2068   }
2069   return tape_bits;
2070}
2071
2072
2073/*-------------------------------------------------
2074    tape_is_present - return TRUE if the tape is
2075    present
2076-------------------------------------------------*/
2077
2078static UINT8 tape_is_present(const device_config *device)
2079{
2080   return device->region != NULL;
2081}
2082
2083
2084/*-------------------------------------------------
2085    tape_change_speed - alter the speed of tape
2086    playback
2087-------------------------------------------------*/
2088
2089static void tape_change_speed(const device_config *device, INT8 newspeed)
2090{
2091   tape_state *tape = get_safe_token(device);
2092   attotime newperiod;
2093   INT8 absnewspeed;
2094
2095   /* do nothing if speed has not changed */
2096   if (tape->speed == newspeed)
2097      return;
2098
2099   /* compute how fast to run the tape timer */
2100   absnewspeed = (newspeed < 0) ? -newspeed : newspeed;
2101   if (newspeed == 0)
2102      newperiod = attotime_never;
2103   else
2104      newperiod = ATTOTIME_IN_HZ(TAPE_CLOCKRATE * absnewspeed);
2105
2106   /* set the new speed */
2107   timer_adjust_periodic(tape->timer, newperiod, 0, newperiod);
2108   tape->speed = newspeed;
2109}
2110
2111
2112/*-------------------------------------------------
2113    device start callback
2114-------------------------------------------------*/
2115
2116static DEVICE_START( decocass_tape )
2117{
2118   tape_state *tape = get_safe_token(device);
2119   int curblock, offs, numblocks;
2120
2121   /* validate some basic stuff */
2122   assert(device != NULL);
2123   assert(device->static_config == NULL);
2124   assert(device->inline_config == NULL);
2125   assert(device->machine != NULL);
2126   assert(device->machine->config != NULL);
2127
2128   /* fetch the data pointer */
2129   tape->timer = timer_alloc(device->machine, tape_clock_callback, (void *)device);
2130   if (device->region == NULL)
2131      return DEVICE_START_OK;
2132
2133   /* scan for the first non-empty block in the image */
2134   for (offs = device->regionbytes - 1; offs >= 0; offs--)
2135      if (device->region[offs] != 0)
2136         break;
2137   numblocks = ((offs | 0xff) + 1) / 256;
2138   assert(numblocks < ARRAY_LENGTH(tape->crc16));
2139
2140   /* compute the total length */
2141   tape->numclocks = REGION_BOT_GAP_END_CLOCK + numblocks * BYTE_BLOCK_TOTAL * 16 + REGION_BOT_GAP_END_CLOCK;
2142
2143   /* compute CRCs for each block */
2144   for (curblock = 0; curblock < numblocks; curblock++)
2145   {
2146      UINT16 crc = 0;
2147      int testval;
2148
2149      /* first CRC the 256 bytes of data */
2150      for (offs = 256 * curblock; offs < 256 * curblock + 256; offs++)
2151         crc = tape_crc16_byte(crc, device->region[offs]);
2152
2153      /* then find a pair of bytes that will bring the CRC to 0 (any better way than brute force?) */
2154      for (testval = 0; testval < 0x10000; testval++)
2155         if (tape_crc16_byte(tape_crc16_byte(crc, testval >> 8), testval) == 0)
2156            break;
2157      tape->crc16[curblock] = testval;
2158   }
2159
2160   /* register states */
2161   state_save_register_device_item(device, 0, tape->speed);
2162   state_save_register_device_item(device, 0, tape->bitnum);
2163   state_save_register_device_item(device, 0, tape->clockpos);
2164
2165   return DEVICE_START_OK;
2166}
2167
2168
2169/*-------------------------------------------------
2170    device reset callback
2171-------------------------------------------------*/
2172
2173static DEVICE_RESET( decocass_tape )
2174{
2175   /* turn the tape off */
2176   tape_change_speed(device, 0);
2177}
2178
2179
2180/*-------------------------------------------------
2181    device get info callback
2182-------------------------------------------------*/
2183
2184DEVICE_GET_INFO( decocass_tape )
2185{
2186   switch (state)
2187   {
2188      /* --- the following bits of info are returned as 64-bit signed integers --- */
2189      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(tape_state);         break;
2190      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;      break;
2191
2192      /* --- the following bits of info are returned as pointers to data or functions --- */
2193      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(decocass_tape); break;
2194      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(decocass_tape);break;
2195
2196      /* --- the following bits of info are returned as NULL-terminated strings --- */
2197      case DEVINFO_STR_NAME:               strcpy(info->s, "DECO Cassette Tape");   break;
2198      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Tape Controller");      break;
2199      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");               break;
2200      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);            break;
2201      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
2202   }
2203}
src/mame/machine/decocass.h
r4057r4058
1/* Set this to 1 to display current tape position */
2#define TAPE_UI_DISPLAY 0
3
41#ifdef MAME_DEBUG
5#define LOGLEVEL  3
2#define LOGLEVEL  5
63#else
74#define LOGLEVEL  0
85#endif
96#define LOG(n,x)  do { if (LOGLEVEL >= n) logerror x; } while (0)
107
8
9#define DECOCASS_TAPE DEVICE_GET_INFO_NAME(decocass_tape)
10DEVICE_GET_INFO( decocass_tape );
11
12#define MDRV_DECOCASS_TAPE_ADD(_tag) \
13   MDRV_DEVICE_ADD(_tag, DECOCASS_TAPE, 0)
14
15
1116extern WRITE8_HANDLER( decocass_coin_counter_w );
1217extern WRITE8_HANDLER( decocass_sound_command_w );
1318extern READ8_HANDLER( decocass_sound_data_r );
1419extern READ8_HANDLER( decocass_sound_ack_r );
1520extern WRITE8_HANDLER( decocass_sound_data_w );
1621extern READ8_HANDLER( decocass_sound_command_r );
22extern TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen );
1723extern WRITE8_HANDLER( decocass_sound_nmi_enable_w );
1824extern READ8_HANDLER( decocass_sound_nmi_enable_r );
1925extern READ8_HANDLER( decocass_sound_data_ack_reset_r );
r4057r4058
2228extern WRITE8_HANDLER( decocass_quadrature_decoder_reset_w );
2329extern WRITE8_HANDLER( decocass_adc_w );
2430extern READ8_HANDLER( decocass_input_r );
25extern int tape_dir;
26extern int tape_speed;
27extern attotime tape_time0;
28extern emu_timer *tape_timer;
29attotime decocass_adjust_tape_time(attotime tape_time);
3031
3132extern WRITE8_HANDLER( decocass_reset_w );
3233
r4057r4058
3536extern WRITE8_HANDLER( decocass_de0091_w );
3637extern WRITE8_HANDLER( decocass_e900_w );
3738
39extern MACHINE_START( decocass );
3840extern MACHINE_RESET( decocass );
3941extern MACHINE_RESET( ctsttape );
4042extern MACHINE_RESET( chwy );
src/mame/machine/leland.c
r4057r4058
410410      memory_set_bankptr(machine, 3, &slave_base[0x10000]);
411411
412412   /* if we have an I80186 CPU, reset it */
413   if (cpu_get_type(machine->cpu[2]) == CPU_I80186)
413   if (machine->cpu[2] != NULL && cpu_get_type(machine->cpu[2]) == CPU_I80186)
414414      leland_80186_sound_init();
415415}
416416
src/mame/machine/carpolo.c
r4057r4058
514514   /* set up the PIA's */
515515   pia_config(machine, 0, &pia_0_intf);
516516   pia_config(machine, 1, &pia_1_intf);
517
518    state_save_register_global(machine, ball_screen_collision_cause);
519    state_save_register_global(machine, car_ball_collision_x);
520    state_save_register_global(machine, car_ball_collision_y);
521    state_save_register_global(machine, car_car_collision_cause);
522    state_save_register_global(machine, car_goal_collision_cause);
523    state_save_register_global(machine, car_ball_collision_cause);
524    state_save_register_global(machine, car_border_collision_cause);
525    state_save_register_global(machine, priority_0_extension);
526    state_save_register_global_array(machine, last_wheel_value);
517527}
518528
519529MACHINE_RESET( carpolo )
520530{
521531   /* set up the priority encoder */
522   TTL74148_config(TTL74148_3S, &TTL74148_3S_intf);
532   TTL74148_config(machine, TTL74148_3S, &TTL74148_3S_intf);
523533   TTL74148_enable_input_w(TTL74148_3S, 0);   /* always enabled */
524534
525535
src/mame/machine/segaic16.c
r4057r4058
215215         /*   03 - maybe controls halt and reset lines together? */
216216         if ((oldval ^ chip->regs[offset]) & 3)
217217         {
218            cpu_set_input_line(chip->cpu, INPUT_LINE_RESET, (chip->regs[offset] & 3) == 3 ? ASSERT_LINE : CLEAR_LINE);
219218            if ((chip->regs[offset] & 3) == 3)
220219               fd1094_machine_init(space->machine->cpu[0]);
220
221            /* fd1094_machine_init calls device_reset on the CPU, so we must do this afterwards */
222            cpu_set_input_line(chip->cpu, INPUT_LINE_RESET, (chip->regs[offset] & 3) == 3 ? ASSERT_LINE : CLEAR_LINE);
221223         }
222224         break;
223225
r4057r4058
229231      case 0x04:
230232         /* controls IRQ lines to 68000, negative logic -- write $B to signal IRQ4 */
231233         if ((chip->regs[offset] & 7) != 7)
232            cpu_set_input_line(chip->cpu, (~chip->regs[offset] & 7), HOLD_LINE);
234         {
235            int irqnum;
236            for (irqnum = 0; irqnum < 8; irqnum++)
237               cpu_set_input_line(chip->cpu, irqnum, (irqnum == (~chip->regs[offset] & 7)) ? HOLD_LINE : CLEAR_LINE);
238         }
233239         break;
234240
235241      case 0x05:
src/mame/machine/vertigo.c
r4057r4058
211211{
212212   int i;
213213
214   TTL74148_config(0, &irq_encoder);
214   TTL74148_config(machine, 0, &irq_encoder);
215215   TTL74148_enable_input_w(0, 0);
216216
217217   for (i = 0; i < 8; i++)
src/mame/machine/decoprot.c
r4057r4058
748748   }
749749
750750   if (cpu_get_pc(space->cpu)!=0xc0ea)
751      logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(space->cpu), offset<<1, input_port_read(space->machine, "P1"));
751      logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n", cpu_get_pc(space->cpu), offset<<1, input_port_read(space->machine, "INPUTS"));
752752
753753   return 0;
754754}
src/mame/mamedriv.c
r4057r4058
415415   /* Jangou Night   *//* (c) 1983 */
416416   DRIVER( jngolady )  /* (c) 1984 */
417417   DRIVER( cntrygrl )  /* (c) 1984 Royal Denshi */
418   DRIVER( nightgal )  /* (c) 1984 */
419   DRIVER( ngtbunny )  /* (c) 1984 */
420   DRIVER( royalngt )  /* (c) 1984 Royal Denshi */
421   DRIVER( sexygal  )  /* (c) 1985 */
422   DRIVER( sweetgal )  /* (c) 1985 */
423   DRIVER( ngalsumr )  /* (c) 1985 */
418424
419425   DRIVER( pastelg )   /* (c) 1985 */
420426   DRIVER( 3ds )       /* (c) 1985 */
r4057r4058
426432   DRIVER( mcitylov )   /* (c) 1986 */
427433   DRIVER( apparel )   /* (c) 1986 Central Denshi */
428434   DRIVER( secolove )   /* (c) 1986 */
435   DRIVER( barline )   /* (c) 1986?*/
429436   DRIVER( housemnq )   /* (c) 1987 */
430437   DRIVER( housemn2 )   /* (c) 1987 */
431438   DRIVER( livegal )   /* (c) 1987 */
432439   DRIVER( seiha )      /* (c) 1987 */
433440   DRIVER( seiham )   /* (c) 1987 */
441   DRIVER( mjgaiden )   /* (c) 1987 Central Denshi */
434442   DRIVER( bijokkoy )   /* (c) 1987 */
435443   DRIVER( iemoto )   /* (c) 1987 */
436444   DRIVER( iemotom )   /* (c) 1987 */
r4057r4058
484492   DRIVER( chinmoku )   /* (c) 1990 */
485493   DRIVER( maiko )      /* (c) 1990 */
486494   DRIVER( mmaiko )   /* (c) 1990 */
495   DRIVER( hnageman )   /* (c) 1990 Nichibutsu/AV Japan */
496   DRIVER( hnxmasev )   /* (c) 1990 Nichibutsu/AV Japan */
487497   DRIVER( club90s )   /* (c) 1990 */
488498   DRIVER( club90sa )   /* (c) 1990 */
489499   DRIVER( lovehous )   /* (c) 1990 */
r4057r4058
952962   DRIVER( dkongjp )   /* (c) 1981 Nintendo */
953963   DRIVER( dkongjo )   /* (c) 1981 Nintendo */
954964   DRIVER( dkongjo1 )   /* (c) 1981 Nintendo */
965   DRIVER( dkongf )   /* hack from Jeff's Romhack */
955966   DRIVER( dkongjr )   /* (c) 1982 Nintendo of America */
956967   DRIVER( dkongjrj )   /* (c) 1982 Nintendo */
957968   DRIVER( dkngjnrj )   /* (c) 1982 Nintendo */
r4057r4058
14191430   DRIVER( rtypej )   /* (c) 1987 (Japan) */
14201431   DRIVER( rtypejp )   /* (c) 1987 (Japan) */
14211432   DRIVER( rtypeu )   /* (c) 1987 + Nintendo USA license (US) */
1433   DRIVER( rtypeb )      /* bootleg  */
14221434   DRIVER( bchopper )   /* (c) 1987 */
14231435   DRIVER( mrheli )   /* (c) 1987 (Japan) */
14241436   DRIVER( nspirit )   /* (c) 1988 */
r4057r4058
17881800   DRIVER( tnzsjo )   /* B53 (c) 1988 Taito Corporation (Japan) (new logo) */
17891801   DRIVER( tnzso )      /* B53?(c) 1988 Taito Corporation Japan (World) (old logo) */
17901802   DRIVER( insectx )   /* B97 (c) 1989 Taito Corporation Japan (World) */
1803   DRIVER( cchance )   /* (c)1987 Taito? */
17911804   DRIVER( champbwl )   /* (c)1989 Romstar.  not Taito, but the same Seta video chips */
17921805
17931806   /* Taito L-System games */
r4057r4058
20512064   /* Taito "Wolf" System */
20522065   DRIVER( pf2012 )   /* E59 (c) 1997 Taito */
20532066
2067   /* Taito PPC JC System */
2068   DRIVER( optiger )   /* E63 (c) 1998 Taito */
2069
2070   /* Taito Type-Zero System */
2071   DRIVER( landhigh )   /* E68 (c) 1999 Taito */
2072
20542073   /* Toaplan games */
20552074   DRIVER( perfrman )   /* (c) 1985 Data East Corporation (Japan) */
20562075   DRIVER( perfrmau )   /* (c) 1985 Data East USA (US) */
r4057r4058
21362155   DRIVER( ghox )      /* TP-021 (c) 1991 Toaplan */
21372156   DRIVER( ghoxj )      /* TP-021 (c) 1991 Toaplan */
21382157   DRIVER( dogyuun )   /* TP-022 (c) 1992 Toaplan */
2158   DRIVER( dogyuunk )   /* TP-022 (c) 1992 Toaplan */
21392159   DRIVER( kbash )      /* TP-023 (c) 1993 Toaplan */
21402160   DRIVER( kbash2 )   /* bootleg */
21412161   DRIVER( truxton2 )   /* TP-024 (c) 1992 Toaplan */
r4057r4058
27912811   DRIVER( sfiiij )   /* 04/02/1997 (c) 1997 Capcom */
27922812   DRIVER( sfiii2 )   /* 30/09/1997 (c) 1997 Capcom */
27932813   DRIVER( sfiii2j )   /* 30/09/1997 (c) 1997 Capcom */
2794   DRIVER( sfiii3 )   /* 12/05/1999 (c) 1999 Capcom */
2795   DRIVER( sfiii3a )   /* 08/06/1999 (c) 1999 Capcom */
2796   DRIVER( jojo )      /* 02/12/1998 (c) 1998 Capcom */
2797   DRIVER( jojoalt )   /* 08/01/1998 (c) 1998 Capcom */
2814   DRIVER( sfiii3 )   /* 08/06/1999 (c) 1999 Capcom */
2815   DRIVER( sfiii3a )   /* 12/05/1999 (c) 1999 Capcom */
2816   DRIVER( jojo )      /* 08/01/1999 (c) 1998 Capcom */
2817   DRIVER( jojoa )      /* 02/12/1998 (c) 1998 Capcom */
27982818   DRIVER( jojoba )   /* 13/09/1999 (c) 1999 Capcom */
27992819   DRIVER( redearth )   /* 21/11/1996 (c) 1996 Capcom */
28002820   DRIVER( warzard )   /* 21/11/1996 (c) 1996 Capcom */
28012821
28022822   DRIVER( sfiiin )   /* 04/02/1997 (c) 1997 Capcom */
28032823   DRIVER( sfiii2n )   /* 30/09/1997 (c) 1997 Capcom */
2804   DRIVER( sfiii3n )   /* 12/05/1999 (c) 1999 Capcom */
2805   DRIVER( sfiii3an )   /* 08/06/1999 (c) 1999 Capcom */
2806   DRIVER( jojon )      /* 02/12/1998 (c) 1998 Capcom */
2807   DRIVER( jojoaltn )   /* 08/01/1998 (c) 1998 Capcom */
2824   DRIVER( sfiii3n )   /* 08/06/1999 (c) 1999 Capcom */
2825   DRIVER( sfiii3an )   /* 12/05/1999 (c) 1999 Capcom */
2826   DRIVER( jojon )      /* 08/01/1999 (c) 1998 Capcom */
2827   DRIVER( jojoan )   /* 02/12/1998 (c) 1998 Capcom */
28082828   DRIVER( jojoban )   /* 13/09/1999 (c) 1999 Capcom */
28092829   DRIVER( jojobane )   /* 13/09/1999 (c) 1999 Capcom */
28102830   DRIVER( redeartn )   /* 21/11/1996 (c) 1996 Capcom */
r4057r4058
30433063   DRIVER( drmn2mpu )   /* 1999 - DrumMania 2nd Mix Session Power Up Kit (GE912 VER. JAB) */
30443064   DRIVER( dncfrks )   /* 2000 - Dance Freaks (G*874 VER. KAA) */
30453065   DRIVER( dmx )      /* 2000 - Dance Maniax (G*874 VER. JAA) */
3066   DRIVER( dsem )      /* 2000 - Dancing Stage Euro Mix (G*936 VER. EAA) */
30463067   DRIVER( gtrfrk3m )   /* 2000 - Guitar Freaks 3rd Mix (GE949 VER. JAC) */
30473068   DRIVER( gtfrk3ma )   /* 2000 - Guitar Freaks 3rd Mix (GE949 VER. JAB) */
30483069   DRIVER( gtfrk3mb )   /* 2000 - Guitar Freaks 3rd Mix - security cassette versionup (949JAZ02) */
r4057r4058
34693490   DRIVER( calorie )   /* (c) 1986 Sega */
34703491   DRIVER( calorieb )   /* (c) 1986 Sega (but bootleg) */
34713492
3493   /* Bingo-based games */
3494   DRIVER( bingoc )    /* (c) 1989 Sega */
3495   /* Bingo Fantasy  *//* (c) 19?? Sega */
3496   /* Bingo Star     *//* (c) 19?? Sega */
3497   /* Bingo Party    *//* (c) 1993 Sega */
3498   /* BP Phoenix     *//* (c) 1998 Sega */
3499   /* BP Special     *//* (c) 2000 Sega */
3500   /* BP Multicards  *//* (c) 2002 Sega */
3501   /* BP Splash      *//* (c) 2002 Sega */
3502   /* Bingo Planet   *//* (c) 1997 Sega */
3503
34723504   /* Enduro Racer / Space Harrier / Hang On */
34733505   DRIVER( enduror )   /* (c) 1985 (FD1089B, decrypted) */
34743506   DRIVER( enduror1 )   /* (c) 1985 (FD1089B, decrypted) */
r4057r4058
48584890   DRIVER( gijoe )      /* GX069 (c) 1991 (World) */
48594891   DRIVER( gijoeu )   /* GX069 (c) 1991 (US) */
48604892   DRIVER( gijoej )   /* GX069 (c) 1991 (Japan) */
4861   DRIVER( thndrx2 )   /* GX073 (c) 1991 (Japan) */
4893   DRIVER( thndrx2 )   /* GX073 (c) 1991 (World) */
48624894   DRIVER( thndrx2a )   /* GX073 (c) 1991 (Asia) */
4895   DRIVER( thndrx2j )   /* GX073 (c) 1991 (Japan) */
48634896   DRIVER( prmrsocr )   /* GX101 (c) 1993 (Europe) */
48644897   DRIVER( prmrsocj )   /* GX101 (c) 1993 (Japan) */
48654898   DRIVER( qgakumon )   /* GX248 (c) 1993 (Japan) */
r4057r4058
51835216   DRIVER( centipd2 )   /* 136001           (c) 1980 */
51845217   DRIVER( centtime )   /* 136001           (c) 1980 */
51855218   DRIVER( centipdb )   /* (bootleg) */
5219   DRIVER( centipdd )   /* hack by Two Bit Score */
51865220   DRIVER( caterplr )   /* (bootleg) */
51875221   DRIVER( millpac )   /* Valadon */
51885222   DRIVER( magworm )   /* (bootleg) */
51895223   DRIVER( mazeinv )    /* (proto)          (c) 1982 */
51905224   DRIVER( milliped )   /* 136013           (c) 1982 */
5225   DRIVER( millipdd )   /* hack by Two Bit Score */
51915226   DRIVER( qwak )       /* (proto)          (c) 1982 */
51925227   DRIVER( runaway )   /* (proto)          (c) 1982 */
51935228   DRIVER( bullsdrt )   /* (c) 1985 Shinkai */
r4057r4058
58825917   DRIVER( samsh5sh )   /* 0272 (c) 2003 Playmore */
58835918   DRIVER( samsh5sn )   /* 0272 (c) 2003 Playmore */
58845919
5885   /* The BreezaSoft games don't have proper ID codes */
5920   /* The BrezzaSoft games don't have proper ID codes */
58865921   DRIVER( jockeygp )
58875922   DRIVER( vliner )
58885923   DRIVER( vlinero )
r4057r4058
64266461   DRIVER( zeroteab )   /* (c) 1993 Seibu Kaihatsu */
64276462   DRIVER( zerotsel )   /* (c) 1993 Seibu Kaihatsu */
64286463   DRIVER( nzerotea )   /* (c) 1993 Seibu Kaihatsu */
6464   DRIVER( xsedae )   /* (c) 1995 Dream Island */
64296465
64306466   /* Newer V33 PCB with COP3 protection */
64316467   DRIVER( r2dx_v33 )   /* (c) 1996 Seibu Kaihatsu */
r4057r4058
66916727   DRIVER( gunbird2 )   /* (c) 1998 */
66926728   DRIVER( s1945iii )   /* (c) 1999 */
66936729   DRIVER( dragnblz )   /* (c) 2000 */
6694   /* tgm2  (c) 2000 -- removed at Arika's request */
6695   /* tgm2p (c) 2000 -- removed at Arika's request */
6730   DRIVER( tgm2 )      /* (c) 2000 */
6731   DRIVER( tgm2p )      /* (c) 2000 */
66966732   DRIVER( gnbarich )   /* (c) 2001 */
66976733   DRIVER( mjgtaste )   /* (c) 2002 */
66986734   DRIVER( hotgmck )   /* (c) 1997 */
r4057r4058
68816917   DRIVER( twineagl )   /* UA-2 (c) 1988 + Taito license */
68826918   DRIVER( downtown )   /* UD-2 (c) 1989 + Romstar or Taito license (DSW) */
68836919   DRIVER( downtow2 )   /* UD-2 (c) 1989 + Romstar or Taito license (DSW) */
6920   DRIVER( downtowj )   /* UD-2 (c) 1989 + Romstar or Taito license (DSW) */
68846921   DRIVER( downtowp )   /* UD-2 (c) 1989 + Romstar or Taito license (DSW) */
68856922   DRIVER( usclssic )   /* UE   (c) 1989 + Romstar or Taito license (DSW) */
68866923   DRIVER( calibr50 )   /* UH   (c) 1989 + Romstar or Taito license (DSW) */
r4057r4058
70197056   DRIVER( stratvox )   /* [1980 Sun Electronics] Taito */
70207057   DRIVER( stratvob )   /* bootleg */
70217058   DRIVER( spacecho )   /* bootleg */
7059   DRIVER( spacech2 )   /* bootleg */
70227060   DRIVER( route16 )   /* (c) 1981 Tehkan/Sun + Centuri license */
70237061   DRIVER( route16a )   /* (c) 1981 Tehkan/Sun + Centuri license */
70247062   DRIVER( route16b )   /* bootleg */
r4057r4058
72977335   DRIVER( openmj )   /* (c) 1982 Nichibutsu */
72987336   DRIVER( royalmah )   /* Falcon bootleg */
72997337   DRIVER( janyoup2 )   /* Falcon bootleg */
7300   DRIVER( janoh )      /* (c) 1982 Toaplan */
7338   DRIVER( janoh )      /* (c) 1984 Toaplan */
7339   DRIVER( janoha )   /* (c) 1984 Toaplan */
7340   DRIVER( mjsiyoub )   /* (c) 1986 Visco */
7341   DRIVER( mjsenka )   /* (c) 1986 Visco */
7342   DRIVER( mjyarou )   /* (c) 1986 Visco / Video System */
73017343   DRIVER( suzume )   /*  ??  (c) 1986 Dyna Electronics */
73027344   DRIVER( hnayayoi )   /* "02" (c) 1987 Dyna Electronics */
73037345   DRIVER( dondenmj )   /* "03" (c) 1986 Dyna Electronics */
r4057r4058
73637405   DRIVER( mjtensin )   /* "100" 1995 Dynax */
73647406   DRIVER( nettoqc )   /* "103" (c) 1995 Nakanihon */
73657407   DRIVER( majrjhdx )   /* "105" 1996 Dynax */
7366   DRIVER( ddenlvrj )   /* "113" (c) 1996 Dynax */
7408   DRIVER( ddenlvrj )   /* "113" (c) 1995 Dynax */
7409   DRIVER( ddenlvrk )   /* "113" (c) 1995 Dynax */
73677410   DRIVER( ddenlovr )   /* "113" (c) 1996 Dynax */
73687411   DRIVER( ddenlovb )   /* bootleg */
73697412   DRIVER( hanakanz )   /* "507" 1996 Dynax */
r4057r4058
73767419   DRIVER( dai2kaku )   /* "522" DaiDaiKakumei (Japan)*/
73777420   DRIVER( mjchuuka )   /* "???" (c) 1998 Dynax */
73787421   DRIVER( mjreach1 )   /* "526" Mahjong Reach Ippatsu 1998 Nihon System/Dynax */
7422   DRIVER( cafebrk )   /* "528" Mahjong Cafe Break (C) 1999 Nakanihon / Dynax */
7423   DRIVER( jongtei )   /* "532" Mahjong Jong-Tei (C) 1999 Dynax */
73797424
73807425   DRIVER( pkgnsh )   /* "505" Pachinko Gindama Shoubu 1998 (Japan) */
73817426   DRIVER( pkgnshdx )   /* "522" Pachinko Gindama Shoubu DX 1998 (Japan) */
r4057r4058
74027447   DRIVER( goldstbl )   /* (c) 198? IGS */
74037448   DRIVER( moonlght )   /* bootleg */
74047449   DRIVER( chry10 )   /* bootleg */
7405   DRIVER( chryigld )   /* bootleg */
7406   DRIVER( ncb3 )      /* (c) 19?? Dyna/bootleg? */
7407   DRIVER( cb3 )      /* (c) 19?? Dyna/bootleg? */
7408   DRIVER( cmv801 )   /* (c) 198? Corsica */
7409   DRIVER( cmaster )   /* (c) 1991 Dyna */
7410   DRIVER( cmasterb )   /* (c) 1991 Dyna */
7411   DRIVER( lucky8 )   /* (c) 1989 Wing Co.Ltd */
7450   DRIVER( chrygld )   /* bootleg */
74127451    DRIVER( cpoker )   /* (c) 1993? IGS */
74137452    DRIVER( cpokert )   /* (c) 1993? Tuning */
74147453   DRIVER( csk227it )   /* (c) 198? IGS */
r4057r4058
79057944   DRIVER( 9ballsht )   /* (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games" */
79067945   DRIVER( 9ballsh2 )   /* (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games" */
79077946   DRIVER( 9ballsh3 )   /* (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games" */
7947   DRIVER( 9ballshc )   /* (c) 1993 E-Scape EnterMedia + "marketed by Bundra Games" */
79087948   DRIVER( gumbo )      /* (c) 1994 Min Corp. */
79097949   DRIVER( mspuzzlg )   /* (c) 1994 Min Corp. */
79107950   DRIVER( mspuzzle )   /* (c) 1994 Min Corp. */
r4057r4058
79127952   DRIVER( msbingo )   /* (C) 1994 Min Corp. */
79137953   DRIVER( dblpoint )   /* (c) 1995 Min Corp. */
79147954   DRIVER( dblpoind )   /* (c) 1995 Dong Bang Electron */
7955   DRIVER( statusbj )   /* (c) 1981 Status Games */
79157956   DRIVER( hangman )   /* (c) 1984 Status Games */
79167957   DRIVER( trivquiz )   /* (c) 1984 Status Games */
79177958   DRIVER( statriv2 )   /* (c) 1984 Status Games */
r4057r4058
79618002   DRIVER( puzlbang )   /* (c) 1999 Omega System */
79628003   DRIVER( suplup )   /* (c) 1999 Omega System */
79638004   DRIVER( vamphalf )   /* (c) 1999 DanBi & F2 System */
8005   DRIVER( vamphafk )   /* (c) 1999 DanBi & F2 System */
79648006   DRIVER( dquizgo2 )   /* (c) 2000 Semicom */
79658007   DRIVER( misncrft )   /* (c) 2000 Sun */
79668008   DRIVER( hidnctch )   /* (c) 1998 Eolith */
r4057r4058
80308072   DRIVER( cardline )   /* (c) 199? Veltmeijer */
80318073   DRIVER( bmcbowl )   /* (c) 1994 BMC */
80328074   DRIVER( koftball )  /* (c) 1995 BMC */
8075   DRIVER( mpoker )   /* (c) 1983 Merit */
80338076   DRIVER( pitboss )   /* (c) 1983 Merit */
8077   DRIVER( pitbossa )   /* (c) 1983 Merit */
80348078   DRIVER( casino5 )   /* (c) 1983 Merit */
80358079   DRIVER( trvwzh )   /* (c) 1985 Merit */
80368080   DRIVER( trvwzha )   /* (c) 1985 Merit */
8081   DRIVER( trvwzhb )   /* (c) 1985 Merit */
80378082   DRIVER( trvwzv )   /* (c) 1985 Merit */
80388083   DRIVER( trvwzva )   /* (c) 1985 Merit */
80398084   DRIVER( trvwz2 )   /* (c) 1985 Merit */
8085   DRIVER( trvwz2a )   /* (c) 1985 Merit */
80408086   DRIVER( trvwz3h )   /* (c) 1985 Merit */
8087   DRIVER( trvwz3ha )   /* (c) 1985 Merit */
80418088   DRIVER( trvwz3v )   /* (c) 1985 Merit */
80428089   DRIVER( trvwz4 )   /* (c) 1985 Merit */
8090   DRIVER( trvwz4a )   /* (c) 1985 Merit */
80438091   DRIVER( tictac )   /* (c) 1985 Merit */
80448092   DRIVER( phrcraze )   /* (c) 1986 Merit */
8093   DRIVER( phrcraza )  /* (c) 1986 Merit */
80458094   DRIVER( phrcrazs )   /* (c) 1986 Merit */
80468095   DRIVER( bigappg )   /* (c) 1986 Merit */
80478096   DRIVER( dodge )      /* (c) 1986 Merit */
r4057r4058
80828131   DRIVER( laserbas )   /* (c) 1981 Amstar/HOEI */
80838132   DRIVER( laserbsa )   /* (c) 1981 Amstar/HOEI */
80848133   DRIVER( futflash )   /* (c) 19?? HOEI */
8085   DRIVER( turbosub )   /* (c) 1986 Entertainment Sciences */
8134   DRIVER( turbosub )   /* (c) 1985 Entertainment Sciences */
8135   DRIVER( turbosba )   /* (c) 1985 Entertainment Sciences */
80868136   DRIVER( pipeline )   /* (c) 1990 Daehyun Electronics */
80878137   DRIVER( ttchamp )
80888138   DRIVER( ttchampa )
r4057r4058
80918141   DRIVER( cubeqst )   /* (c) 1983 Simutrek Inc. */
80928142   DRIVER( pkscram )   /* (c) 1993 Cosmo Electronics Corporation */
80938143
8144   /* Impera */
8145   DRIVER( magicard )   /* (c) 199? */
8146   DRIVER( magicrda )   /* (c) 199? */
8147
80948148   /* Funworld */
80958149   DRIVER( jollycrd )   /* (c) 1985 TAB-Austria */
80968150   DRIVER( jolyc3x3 )   /* (c) 1985 TAB-Austria */
r4057r4058
81468200
81478201   DRIVER( vroulet )   /* (c) 1989 World Game */
81488202   DRIVER( rcasino )   /* (c) 1984 Dyna Electronics */
8149   DRIVER( cm2v841 )   /* (c) 198? Dyna Electronics */
8150   DRIVER( cm2841a )   /* (c) 198? Dyna Electronics */
81518203   DRIVER( ampoker2 )   /* (c) 1990 Novomatic */
81528204   DRIVER( ampkr2b1 )   /* 1990 bootleg */
81538205   DRIVER( ampkr2b2 )   /* 1990 bootleg */
r4057r4058
81698221   DRIVER( quizmstr )   /* (c) 1985 Coinmaster */
81708222   DRIVER( trailblz )   /* (c) 1987 Coinmaster */
81718223   DRIVER( supnudg2 )   /* (c) 1989 Coinmaster */
8224   DRIVER( fruit )     /* (c) 1987? Coinmaster? */
81728225   DRIVER( egghunt )   /* (c) 1995 Invi Image */
81738226   DRIVER( magic10 )   /* (c) 1995 A.W.P. Games */
81748227   DRIVER( magic10a )   /* (c) 1995 A.W.P. Games */
r4057r4058
81918244   DRIVER( rbmk )      /* (c) 1995 GMS */
81928245   DRIVER( go2000 )   /* (c) 2000 SA */
81938246   DRIVER( mirax )      /* (c) 1985 Current Technologies */
8247
81948248   DRIVER( victor5 )   /* (c) 1990 Subsino */
81958249   DRIVER( victor21 )   /* (c) 1990 Subsino */
8250   DRIVER( crsbingo )   /* (c) 1991 Subsino */
81968251   DRIVER( sharkpy )   /* (c) 1993 Subsino */
81978252   DRIVER( sharkpya )   /* (c) 1993 Subsino */
81988253   DRIVER( smoto20 )   /* (c) 1996 Subsino */
81998254   DRIVER( smoto16 )   /* (c) 1996 Subsino */
8255   DRIVER( saklove )   /* (c) 1998 Subsino */
8256   DRIVER( bishjan )   /* (c) 1999 Subsino */
82008257   DRIVER( lastfght )   /* (c) 2000 Subsino */
8201   DRIVER( bishjan )   /* (c) 1999 Subsino */
8258
82028259   DRIVER( sliver )   /* (c) 1996 Hollow Corp */
82038260   DRIVER( intrscti )   /* ???? */
82048261   DRIVER( pasha2 )   /* (c) 1998 Dong Sung */
r4057r4058
83178374   DRIVER( leader )   /* Bootleg? */
83188375   DRIVER( livequiz )   /* (c) 1999 Andamiro */
83198376   DRIVER( cowrace )   /* (c) 19?? unknown */
8320   DRIVER( mjsiyoub )   /* (c) 1986 Visco */
83218377   DRIVER( discoboy )   /* (c) 1993 Soft Art Co. */
83228378   DRIVER( steaser )
83238379   DRIVER( pangofun )   /* (c) 1995 InfoCube */
r4057r4058
83728428   DRIVER( vcombat )   /* (c) 1993 VR8 Inc. */
83738429   DRIVER( shadfgtr )   /* (c) 1989 Sega? */
83748430   DRIVER( blackt96 )   /* (c) 1996 D.G.R.M. of Korea */
8375   DRIVER( lucky74 )   /* (c) 1988 Wing Co., Ltd */
8376   DRIVER( lucky74a )   /* (c) 1988 Wing Co., Ltd */
83778431   DRIVER( magictg )   /* (c) 199? Acclaim */
83788432   DRIVER( magictga )   /* (c) 199? Acclaim */
83798433   DRIVER( re900 )      /* (c) 1993 Entretenimientos GEMINIS */
r4057r4058
84308484
84318485   /* Astro Corp. */
84328486   DRIVER( showhand )   /* (c) 1999? Astro Corp. */
8487   DRIVER( showhanc )   /* (c) 1999? Astro Corp. */
84338488
84348489   /* Dyna */
8435   DRIVER ( cb2001 )
8490   DRIVER( cb2001 )   /* (c) Dyna */
8491   DRIVER( ncb3 )      /* (c) 199? Dyna/bootleg? */
8492   DRIVER( cb3a )      /* (c) 199? Dyna/bootleg? */
8493   DRIVER( cb3 )      /* (c) 199? Dyna/bootleg? */
8494   DRIVER( cmv801 )   /* (c) 198? Corsica */
8495   DRIVER( cmv4 )      /* (c) 1992 Dyna */
8496   DRIVER( cmaster )   /* (c) 1991 Dyna */
8497   DRIVER( cm2v841 )   /* (c) 198? Dyna Electronics */
8498   DRIVER( cm2841a )   /* (c) 198? Dyna Electronics */
8499   DRIVER( cmast91 )   /* (c) 1991 Dyna */
84368500
84378501   /* STG? */
84388502   DRIVER ( queen )
r4057r4058
84438507   /* Eagle */
84448508   DRIVER ( janshi )
84458509
8510   /* Wing */
8511   DRIVER( slotcarn )   /* (c) 1985 Wing Co. Ltd */
8512   DRIVER( lucky74 )   /* (c) 1988 Wing Co. Ltd */
8513   DRIVER( lucky74a )   /* (c) 1988 Wing Co. Ltd */
8514   DRIVER( lucky8 )   /* (c) 1989 Wing Co. Ltd */
8515   DRIVER( lucky8a )   /* (c) 1989 Wing Co. Ltd */
8516   DRIVER( luckgrln )   /* (c) 1991 Wing Co. Ltd */
8517
84468518#endif   /* DRIVER_RECURSIVE */
src/mame/includes/docastle.h
r4057r4058
66WRITE8_HANDLER( docastle_shared1_w );
77WRITE8_HANDLER( docastle_nmitrigger_w );
88
9void docastle_shared_state_register(running_machine *machine);
910
1011/*----------- defined in video/docastle.c -----------*/
1112
src/mame/includes/vball.h
r4057r4058
77extern int vb_scrolly_hi;
88extern int vb_scrollx_lo;
99extern int vball_gfxset;
10extern int scrollx[256];
1011
1112VIDEO_START( vb );
1213VIDEO_UPDATE( vb );
r4057r4058
1516WRITE8_HANDLER( vb_attrib_w );
1617WRITE8_HANDLER( vb_videoram_w );
1718void vb_mark_all_dirty(void);
18
19INTERRUPT_GEN( vball_interrupt );
src/mame/includes/esripsys.h
r0r4058
1/*************************************************************************
2
3    Entertainment Sciences RIP System hardware
4
5*************************************************************************/
6
7/* TODO */
8#define ESRIPSYS_PIXEL_CLOCK   (XTAL_25MHz / 2)
9#define ESRIPSYS_HTOTAL         (512 + 141)
10#define ESRIPSYS_HBLANK_START   (512)
11#define ESRIPSYS_HBLANK_END      (0)
12#define ESRIPSYS_VTOTAL         (384 + 20)
13#define ESRIPSYS_VBLANK_START   (384)
14#define ESRIPSYS_VBLANK_END      (0)
15
16#define CMOS_RAM_SIZE         (2048)
17#define FDT_RAM_SIZE         (2048 * sizeof(UINT16))
18
19enum
20{
21   ESRIPSYS_GAME_CPU  = 0,
22   ESRIPSYS_FRAME_CPU = 1,
23   ESRIPSYS_VIDEO_CPU = 2,
24   ESRIPSYS_SOUND_CPU = 3,
25};
26
27/*----------- defined in video/esripsys.c -----------*/
28
29extern UINT8 *esripsys_pal_ram;
30extern int esripsys_frame_vbl;
31extern int esripsys__12sel;
32extern int esripsys_video_firq_en;
33
34VIDEO_START( esripsys );
35VIDEO_UPDATE( esripsys );
36
37WRITE8_HANDLER( esripsys_bg_intensity_w );
38INTERRUPT_GEN( esripsys_vblank_irq );
39
40int esripsys_draw(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int line_latch);
src/mame/includes/tx1.h
r4057r4058
66#include "machine/8255ppi.h"
77#include "sound/custom.h"
88
9#define TX1_PIXEL_CLOCK      6000000
9#define TX1_PIXEL_CLOCK      (XTAL_18MHz / 3)
1010#define TX1_HBSTART         256
1111#define TX1_HBEND         0
1212#define TX1_HTOTAL         384
r4057r4058
1414#define TX1_VBEND         0
1515#define TX1_VTOTAL         264
1616
17#define BB_PIXEL_CLOCK      6000000
17#define BB_PIXEL_CLOCK      (XTAL_18MHz / 3)
1818#define BB_HBSTART         256
1919#define BB_HBEND         0
2020#define BB_HTOTAL         384
r4057r4058
2222#define BB_VBEND         0
2323#define BB_VTOTAL         288
2424
25/* Buggy Boy PCBs could use 8086s or V30s */
26#define BUGGYBOY_CPU_TYPE   I8086
27#define BUGGYBOY_ZCLK      7500000
25#define CPU_MASTER_CLOCK   (XTAL_15MHz)
26#define BUGGYBOY_ZCLK      (CPU_MASTER_CLOCK / 2)
2827
2928
3029/*----------- defined in drivers/tx1.c -----------*/
r4057r4058
5554WRITE8_HANDLER( tx1_pit8253_w );
5655
5756WRITE8_HANDLER( bb_ym1_a_w );
58WRITE8_HANDLER( bb_ym1_b_w );
57WRITE8_HANDLER( bb_ym2_a_w );
58WRITE8_HANDLER( bb_ym2_b_w );
5959CUSTOM_START( buggyboy_sh_start );
6060CUSTOM_RESET( buggyboy_sh_reset );
6161
src/mame/includes/btime.h
r4057r4058
4848WRITE8_HANDLER( zoar_video_control_w );
4949WRITE8_HANDLER( btime_video_control_w );
5050WRITE8_HANDLER( bnj_video_control_w );
51WRITE8_HANDLER( lnc_video_control_w );
5251WRITE8_HANDLER( disco_video_control_w );
53
54INTERRUPT_GEN( lnc_sound_interrupt );
src/mame/includes/nb1413m3.h
r4057r4058
3030   NB1413M3_CITYLOVE,
3131   NB1413M3_MCITYLOV,
3232   NB1413M3_SECOLOVE,
33   NB1413M3_BARLINE,
3334   NB1413M3_HOUSEMNQ,
3435   NB1413M3_HOUSEMN2,
3536   NB1413M3_LIVEGAL,
src/mame/mame.mak
r4057r4058
6666CPUS += V35
6767CPUS += V60
6868CPUS += V70
69CPUS += I8035
70CPUS += I8041
71CPUS += I8048
72CPUS += I8648
73CPUS += I8748
74CPUS += MB8884
75CPUS += I8039
76CPUS += I8049
77CPUS += I8749
78CPUS += N7751
79CPUS += M58715
80CPUS += I8041
81CPUS += I8741
82CPUS += I8042
83CPUS += I8242
84CPUS += I8742
69CPUS += MCS48
8570CPUS += I8031
8671CPUS += I8032
8772CPUS += I8051
r4057r4058
143128CPUS += ARM7
144129CPUS += JAGUAR
145130CPUS += CUBEQCPU
131CPUS += ESRIP
146132CPUS += R3000
147133CPUS += R3041
148134CPUS += R4600
r4057r4058
176162CPUS += GMS30C2132
177163CPUS += GMS30C2216
178164CPUS += GMS30C2232
165CPUS += I860
179166CPUS += I960
180167CPUS += H83002
181168CPUS += H83334
182169CPUS += V810
183170CPUS += M37702
184171CPUS += M37710
185CPUS += PPC403GA
186CPUS += PPC403GCX
187CPUS += PPC601
188CPUS += PPC602
189CPUS += PPC603
190CPUS += PPC603E
191CPUS += PPC603R
192CPUS += PPC604
193CPUS += MPC8240
172CPUS += POWERPC
194173CPUS += SE3208
195174CPUS += MC68HC11
196175CPUS += ADSP21062
r4057r4058
353332   $(MAMEOBJ)/atlus.a \
354333   $(MAMEOBJ)/barcrest.a \
355334   $(MAMEOBJ)/bfm.a \
335   $(MAMEOBJ)/bmc.a \
356336   $(MAMEOBJ)/capcom.a \
357337   $(MAMEOBJ)/cinemat.a \
358338   $(MAMEOBJ)/comad.a \
r4057r4058
584564   $(DRIVERS)/bfm_sc2.o $(VIDEO)/bfm_adr2.o \
585565   $(MACHINE)/bfm_bd1.o \
586566
567$(MAMEOBJ)/bmc.a: \
568   $(DRIVERS)/bmcbowl.o \
569   $(DRIVERS)/koftball.o \
570
587571$(MAMEOBJ)/capcom.a: \
588572   $(DRIVERS)/1942.o $(VIDEO)/1942.o \
589573   $(DRIVERS)/1943.o $(VIDEO)/1943.o \
r4057r4058
693677   $(DRIVERS)/gundealr.o $(VIDEO)/gundealr.o \
694678
695679$(MAMEOBJ)/dynax.a: \
696   $(DRIVERS)/cherrym2.o \
697680   $(DRIVERS)/ddenlovr.o \
698681   $(DRIVERS)/dynax.o $(VIDEO)/dynax.o \
699682   $(DRIVERS)/hnayayoi.o $(VIDEO)/hnayayoi.o \
r4057r4058
778761   $(DRIVERS)/goldstar.o $(VIDEO)/goldstar.o \
779762   $(DRIVERS)/igs009.o \
780763   $(DRIVERS)/igs_blit.o \
781   $(DRIVERS)/igs_180.o \
764   $(DRIVERS)/igs017.o \
782765   $(DRIVERS)/igs_m027.o \
783766   $(DRIVERS)/igs_m68.o \
784767   $(DRIVERS)/iqblock.o $(VIDEO)/iqblock.o \
r4057r4058
948931   $(DRIVERS)/meadows.o $(AUDIO)/meadows.o $(VIDEO)/meadows.o \
949932
950933$(MAMEOBJ)/merit.a: \
934   $(DRIVERS)/mpoker.o \
951935   $(DRIVERS)/merit.o \
952936   $(DRIVERS)/meritm.o \
953937
r4057r4058
10631047   $(DRIVERS)/nbmj8891.o $(VIDEO)/nbmj8891.o \
10641048   $(DRIVERS)/nbmj8991.o $(VIDEO)/nbmj8991.o \
10651049   $(DRIVERS)/nbmj9195.o $(VIDEO)/nbmj9195.o \
1050   $(DRIVERS)/nightgal.o \
10661051   $(DRIVERS)/niyanpai.o $(MACHINE)/m68kfmly.o $(VIDEO)/niyanpai.o \
10671052   $(DRIVERS)/pastelg.o $(VIDEO)/pastelg.o \
10681053   $(DRIVERS)/seicross.o $(VIDEO)/seicross.o \
r4057r4058
11751160$(MAMEOBJ)/sega.a: \
11761161   $(DRIVERS)/aladbl.o \
11771162   $(DRIVERS)/angelkds.o $(VIDEO)/angelkds.o \
1163   $(DRIVERS)/bingoc.o \
11781164   $(DRIVERS)/blockade.o $(AUDIO)/blockade.o $(VIDEO)/blockade.o \
11791165   $(DRIVERS)/calorie.o \
11801166   $(DRIVERS)/coolridr.o \
r4057r4058
13271313   $(DRIVERS)/bking.o $(VIDEO)/bking.o \
13281314   $(DRIVERS)/bublbobl.o $(MACHINE)/bublbobl.o $(VIDEO)/bublbobl.o \
13291315   $(DRIVERS)/buggychl.o $(MACHINE)/buggychl.o $(VIDEO)/buggychl.o \
1316   $(DRIVERS)/cchance.o \
13301317   $(DRIVERS)/chaknpop.o $(MACHINE)/chaknpop.o $(VIDEO)/chaknpop.o \
13311318   $(DRIVERS)/champbwl.o \
13321319   $(DRIVERS)/changela.o $(VIDEO)/changela.o \
r4057r4058
13791366   $(DRIVERS)/taito_z.o $(VIDEO)/taito_z.o \
13801367   $(DRIVERS)/taitoair.o $(VIDEO)/taitoair.o \
13811368   $(DRIVERS)/taitojc.o $(VIDEO)/taitojc.o \
1369   $(DRIVERS)/taitopjc.o $\
13821370   $(DRIVERS)/taitosj.o $(MACHINE)/taitosj.o $(VIDEO)/taitosj.o \
1371   $(DRIVERS)/taitotz.o \
13831372   $(DRIVERS)/taitowlf.o \
13841373   $(DRIVERS)/tnzs.o $(MACHINE)/tnzs.o $(VIDEO)/tnzs.o \
13851374   $(DRIVERS)/topspeed.o $(VIDEO)/topspeed.o \
r4057r4058
15461535   $(DRIVERS)/aztarac.o $(AUDIO)/aztarac.o $(VIDEO)/aztarac.o \
15471536   $(DRIVERS)/beaminv.o \
15481537   $(DRIVERS)/blackt96.o \
1549   $(DRIVERS)/bmcbowl.o \
15501538   $(DRIVERS)/brasil.o \
1551   $(DRIVERS)/koftball.o \
15521539   $(DRIVERS)/calomega.o $(VIDEO)/calomega.o \
15531540   $(DRIVERS)/carrera.o \
15541541   $(DRIVERS)/caswin.o \
r4057r4058
15751562   $(DRIVERS)/ertictac.o \
15761563   $(DRIVERS)/esd16.o $(VIDEO)/esd16.o \
15771564   $(DRIVERS)/esh.o \
1565   $(DRIVERS)/esripsys.o $(VIDEO)/esripsys.o \
15781566   $(DRIVERS)/ettrivia.o \
15791567   $(DRIVERS)/filetto.o \
15801568   $(DRIVERS)/flower.o $(AUDIO)/flower.o $(VIDEO)/flower.o \
15811569   $(DRIVERS)/fortecar.o \
15821570   $(DRIVERS)/freekick.o $(VIDEO)/freekick.o \
1571   $(DRIVERS)/fruit.o \
15831572   $(DRIVERS)/funworld.o $(VIDEO)/funworld.o \
15841573   $(DRIVERS)/galaxi.o \
15851574   $(DRIVERS)/gamecstl.o \
r4057r4058
16141603   $(DRIVERS)/limenko.o \
16151604   $(DRIVERS)/ltcasino.o \
16161605   $(DRIVERS)/lucky74.o $(VIDEO)/lucky74.o \
1606   $(DRIVERS)/luckgrln.o \
16171607   $(DRIVERS)/magic10.o \
1608   $(DRIVERS)/magicard.o \
16181609   $(DRIVERS)/magicfly.o \
16191610   $(DRIVERS)/magictg.o \
16201611   $(DRIVERS)/malzak.o $(VIDEO)/malzak.o \
r4057r4058
16251616   $(DRIVERS)/miniboy7.o \
16261617   $(DRIVERS)/mirage.o \
16271618   $(DRIVERS)/mirax.o \
1628   $(DRIVERS)/mjsiyoub.o \
16291619   $(DRIVERS)/mole.o $(VIDEO)/mole.o \
16301620   $(DRIVERS)/mosaic.o $(VIDEO)/mosaic.o \
16311621   $(DRIVERS)/mrjong.o $(VIDEO)/mrjong.o \
r4057r4058
16531643   $(DRIVERS)/skyarmy.o \
16541644   $(DRIVERS)/skylncr.o \
16551645   $(DRIVERS)/sliver.o \
1646   $(DRIVERS)/slotcarn.o \
16561647   $(DRIVERS)/smstrv.o \
16571648   $(DRIVERS)/snookr10.o $(VIDEO)/snookr10.o \
16581649   $(DRIVERS)/spool99.o \
r4057r4058
16771668   $(DRIVERS)/trvquest.o \
16781669   $(DRIVERS)/ttchamp.o \
16791670   $(DRIVERS)/tugboat.o \
1680   $(DRIVERS)/turbosub.o \
16811671   $(DRIVERS)/usgames.o $(VIDEO)/usgames.o \
16821672   $(DRIVERS)/vamphalf.o \
16831673   $(DRIVERS)/vcombat.o \
r4057r4058
17831773                  $(LAYOUT)/pe_keno.lh \
17841774                  $(LAYOUT)/pe_slots.lh
17851775
1776$(DRIVERS)/polepos.o:   $(LAYOUT)/polepos.lh
1777
17861778$(DRIVERS)/qix.o:      $(LAYOUT)/elecyoyo.lh
17871779
17881780$(DRIVERS)/re900.o:   $(LAYOUT)/re900.lh
src/mame/video/carpolo.c
r4057r4058
169169   sprite_goal_collision_bitmap2 = auto_bitmap_alloc(SPRITE_WIDTH+GOAL_WIDTH, SPRITE_HEIGHT+GOAL_HEIGHT, format);
170170
171171   sprite_border_collision_bitmap = auto_bitmap_alloc(SPRITE_WIDTH, SPRITE_HEIGHT, format);
172
173    state_save_register_global_bitmap(machine, sprite_sprite_collision_bitmap1);
174    state_save_register_global_bitmap(machine, sprite_sprite_collision_bitmap2);
175    state_save_register_global_bitmap(machine, sprite_goal_collision_bitmap1);
176    state_save_register_global_bitmap(machine, sprite_goal_collision_bitmap2);
177    state_save_register_global_bitmap(machine, sprite_border_collision_bitmap);
172178}
173179
174180
src/mame/video/goodejan.c
r4057r4058
22
33static tilemap *bg_tilemap, *tx_tilemap;
44UINT16 *goodejan_bgvram,*goodejan_txvram;
5static UINT16 goodejan_layer_en;
56
67WRITE16_HANDLER( goodejan_bgvram_w )
78{
r4057r4058
1516   tilemap_mark_tile_dirty(tx_tilemap,offset);
1617}
1718
19WRITE16_HANDLER( goodejan_layer_en_w )
20{
21   /*---- ---- ---x ---- enable sprites*/
22   /*---- ---- ---- xxxx enable layers*/
23   goodejan_layer_en = data;
24}
25
1826static TILE_GET_INFO( goodejan_bg_tile_info )
1927{
2028   int tile = goodejan_bgvram[tile_index]&0x0fff;
2129   int color = (goodejan_bgvram[tile_index]&0xf000)>>12;
2230
2331   // WRONG!
24   if ((goodejan_bgvram[tile_index]&0x8000)==0x0000) tile+=0x1000;
32   tile|= (goodejan_bgvram[tile_index]&0x8000)>>3;
33//  if ((goodejan_bgvram[tile_index]&0x8000)==0x0000) tile+=0x1000;
2534
2635   SET_TILE_INFO(1, tile, color, 0);
2736}
r4057r4058
4857      y = spriteram16[offs+3];//&0x1ff;
4958      x = spriteram16[offs+2];//&0x1ff;
5059
51      if (spriteram16[offs+2]&0x8000) x=0x10000-x;
52      if (spriteram16[offs+3]&0x8000) y=0x10000-y;
60      if (x&0x8000) x=0-(0x200-(x&0x1ff));
61      //else x&=0x1ff;
62      if (y&0x8000) y=0-(0x200-(y&0x1ff));
63      //else y&=0x1ff;
5364
5465      color = spriteram16[offs+0]&0x3f;
55      fx = spriteram16[offs+0]&0x40;
66      fx = spriteram16[offs+0]&0x4000;
5667      fy = 0; /* To do - probably 0x2000 */
5768      dy = ((spriteram16[offs+0]&0x0380)>>7) + 1;
5869      dx = ((spriteram16[offs+0]&0x1c00)>>10) + 1;
r4057r4058
8697
8798VIDEO_START( goodejan )
8899{
89   bg_tilemap = tilemap_create(machine, goodejan_bg_tile_info,tilemap_scan_rows,     16,16,32,32);
100   bg_tilemap = tilemap_create(machine, goodejan_bg_tile_info,tilemap_scan_rows, 16,16,32,32);
90101   tx_tilemap = tilemap_create(machine, goodejan_tx_tile_info,tilemap_scan_rows, 8, 8,32,32);
91102   tilemap_set_transparent_pen(tx_tilemap,15);
92103}
93104
94105VIDEO_UPDATE( goodejan )
95106{
96   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
97   draw_sprites(screen->machine, bitmap,cliprect, 2);
98   draw_sprites(screen->machine, bitmap,cliprect, 1);
99   draw_sprites(screen->machine, bitmap,cliprect, 0);
100   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
101   draw_sprites(screen->machine, bitmap,cliprect, 3);
107   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); //black pen,likely to be selectable by a crt register
102108
109   if(!(goodejan_layer_en & 1))    { tilemap_draw(bitmap,cliprect,bg_tilemap,0,0); }
110   if(!(goodejan_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 2); }
111   if(!(goodejan_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 1); }
112   if(!(goodejan_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 0); }
113   if(!(goodejan_layer_en & 8))    { tilemap_draw(bitmap,cliprect,tx_tilemap,0,0); }
114   if(!(goodejan_layer_en & 0x10)) { draw_sprites(screen->machine, bitmap,cliprect, 3); }
115
103116   return 0;
104117}
src/mame/video/gticlub.c
r4057r4058
193193static poly_vertex prev_v[4];
194194static int prev_poly_type;
195195
196static UINT8 *gfxrom;
196197
198
197199void K001005_swap_buffers(running_machine *machine);
198200
199201static void K001005_exit(running_machine *machine)
r4057r4058
209211   int height = video_screen_get_height(machine->primary_screen);
210212   K001005_zbuffer = auto_bitmap_alloc(width, height, BITMAP_FORMAT_INDEXED32);
211213
214   gfxrom = memory_region(machine, "gfx1");
215
212216   K001005_bitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
213217   K001005_bitmap[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
214218
r4057r4058
481485   }
482486}
483487
484static UINT8 *gfxrom;
485
486488static void draw_scanline_tex(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
487489{
488490   const poly_extra_data *extra = extradata;
r4057r4058
979981   tick = 0;
980982   debug_tex_page = 0;
981983   debug_tex_palette = 0;
982   gfxrom = memory_region(machine, "gfx1");
983984
984985   K001006_init(machine);
985986   K001005_init(machine);
src/mame/video/88games.c
r4057r4058
6464   K052109_vh_start(machine,"gfx1",NORMAL_PLANE_ORDER,tile_callback);
6565   K051960_vh_start(machine,"gfx2",NORMAL_PLANE_ORDER,sprite_callback);
6666   K051316_vh_start_0(machine,"gfx3",4,FALSE,0,zoom_callback);
67
68    state_save_register_global_array(machine, layer_colorbase);
69    state_save_register_global(machine, k88games_priority);
70    state_save_register_global(machine, sprite_colorbase);
71    state_save_register_global(machine, zoom_colorbase);
6772}
6873
6974
src/mame/video/polepos.c
r4057r4058
515515   draw_road(screen->machine, bitmap);
516516   draw_sprites(screen->machine, bitmap,cliprect);
517517   tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
518/* following code should be enabled only in a debug build */
519/* original arcade doesn't work in this way */
520#ifdef MAME_DEBUG
521   {
522      int in = input_port_read(screen->machine, "IN0");
523      static int lastin;
524
525      if ((in ^ lastin) & polepos_gear_bit)
526         popmessage((in & polepos_gear_bit) ? "LO" : "HI");
527
528      lastin = in;
529   }
530#endif
531518   return 0;
532519}
src/mame/video/btime.c
r4057r4058
2121UINT8 *deco_charram;
2222size_t bnj_backgroundram_size;
2323
24static int sprite_dirty[256];
25static int char_dirty[1024];
26
2724static UINT8 btime_palette = 0;
2825static UINT8 bnj_scroll1 = 0;
2926static UINT8 bnj_scroll2 = 0;
3027static bitmap_t *background_bitmap;
31static UINT8 lnc_sound_interrupt_enabled = 0;
3228
29static UINT8 *sprite_dirty, *char_dirty;
30
3331/***************************************************************************
3432
3533    Burger Time doesn't have a color PROM. It uses RAM to dynamically
r4057r4058
142140    bnj_scroll1 = 0;
143141    bnj_scroll2 = 0;
144142    btime_palette = 0;
143
144   sprite_dirty = auto_malloc(256 * sizeof(*sprite_dirty));
145   memset(sprite_dirty, 1, 256 * sizeof(*sprite_dirty));
146
147   char_dirty = auto_malloc(1024 * sizeof(*char_dirty));
148   memset(char_dirty, 1, 1024 * sizeof(*char_dirty));
145149}
146150
147151
148152VIDEO_START( bnj )
149153{
150154    /* the background area is twice as wide as the screen */
151    int width = video_screen_get_width(machine->primary_screen);
152    int height = video_screen_get_height(machine->primary_screen);
155    int width = 256;
156    int height = 256;
153157    bitmap_format format = video_screen_get_format(machine->primary_screen);
154158    background_bitmap = auto_bitmap_alloc(2*width, height, format);
155159
r4057r4058
297301        btime_video_control_w(space, offset, data);
298302}
299303
300WRITE8_HANDLER( lnc_video_control_w )
301{
302    // I have a feeling that this only works by coincidence. I couldn't
303    // figure out how NMI's are disabled by the sound processor
304    lnc_sound_interrupt_enabled = data & 0x08;
305
306    bnj_video_control_w(space, offset, data & 0x01);
307}
308
309304WRITE8_HANDLER( disco_video_control_w )
310305{
311306   btime_palette = (data >> 2) & 0x03;
r4057r4058
317312}
318313
319314
320INTERRUPT_GEN( lnc_sound_interrupt )
321{
322    if (lnc_sound_interrupt_enabled)
323       cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
324}
325
326
327315static void draw_chars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT8 transparency, UINT8 color, int priority)
328316{
329317    offs_t offs;
r4057r4058
341329        if (flip_screen_get(machine))
342330        {
343331            x = 31 - x;
344            y = 31 - y;
332            y = 33 - y;
345333        }
346334
347335        drawgfx(bitmap,machine->gfx[0],
r4057r4058
377365        if (flip_screen_get(machine))
378366        {
379367            x = 240 - x;
380            y = 240 - y + sprite_y_adjust_flip_screen;
368            y = 256 - y + sprite_y_adjust_flip_screen;
381369
382370            flipx = !flipx;
383371            flipy = !flipy;
r4057r4058
429417            if (flip_screen_get(machine))
430418            {
431419                x = 240 - x;
432                y = 240 - y;
420                y = 256 - y;
433421            }
434422
435423            drawgfx(bitmap, machine->gfx[2],
r4057r4058
565553            if (flip_screen_get(screen->machine))
566554            {
567555                sx = 496 - sx;
568                sy = 240 - sy;
556                sy = 256 - sy;
569557            }
570558
571559            drawgfx(background_bitmap, screen->machine->gfx[2],
r4057r4058
612600        if (flip_screen_get(screen->machine))
613601        {
614602            sx = 31 - sx;
615            sy = 31 - sy;
603            sy = 33 - sy;
616604        }
617605
618606        drawgfx(bitmap, screen->machine->gfx[2],
src/mame/video/popeye.c
r4057r4058
1414static const size_t popeye_bitmapram_size = 0x2000;
1515
1616static bitmap_t *tmpbitmap2;
17static int invertmask;
18static int bitmap_type;
17static UINT8 invertmask;
18static UINT8 bitmap_type;
1919enum { TYPE_SKYSKIPR, TYPE_POPEYE };
2020
2121static tilemap *fg_tilemap;
2222
23static UINT8 lastflip;
2324
2425/***************************************************************************
2526
r4057r4058
250251
251252   fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
252253   tilemap_set_transparent_pen(fg_tilemap, 0);
254
255    lastflip = 0;
256
257    state_save_register_global(machine, lastflip);
258    state_save_register_global_bitmap(machine, tmpbitmap2);
259    state_save_register_global_pointer(machine, popeye_bitmapram, popeye_bitmapram_size);
253260}
254261
255262VIDEO_START( popeye )
r4057r4058
261268
262269   fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
263270   tilemap_set_transparent_pen(fg_tilemap, 0);
271
272    lastflip = 0;
273
274    state_save_register_global(machine, lastflip);
275    state_save_register_global_bitmap(machine, tmpbitmap2);
276    state_save_register_global_pointer(machine, popeye_bitmapram, popeye_bitmapram_size);
264277}
265278
266279static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
267280{
268281   int offs;
269   static int lastflip = 0;
270282   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
271283
272284   if (lastflip != flip_screen_get(machine))
src/mame/video/segaic16.c
r4057r4058
19781978      {                                                   \
19791979         /* shadow/hilight mode? */                              \
19801980         if (color == info->colorbase + (0x3f << 4))                  \
1981            dest[x] += (paletteram16[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries;   \
1981         {                                                \
1982            /* we have to check this for System 18 so that we don't */  \
1983            /* attempt to shadow VDP pixels */                     \
1984            if (dest[x] < palette.entries)                        \
1985               dest[x] += (paletteram16[dest[x]] & 0x8000) ? palette.entries*2 : palette.entries; \
1986         }                                                \
19821987                                                         \
19831988         /* regular draw */                                    \
19841989         else                                             \
src/mame/video/vball.c
r4057r4058
1414int vb_scrollx_hi=0;
1515int vb_scrollx_lo=0;
1616int vb_scrolly_hi=0;
17int scrollx[256];
1718
1819UINT8 *vb_scrolly_lo;
1920UINT8 *vb_videoram;
r4057r4058
2324static int vb_spprombank=0xff;
2425
2526static tilemap *bg_tilemap;
26static int scrollx[32];
2727
2828/***************************************************************************
2929
r4057r4058
168168   tilemap_set_scrolly(bg_tilemap,0,vb_scrolly_hi + *vb_scrolly_lo);
169169
170170   /*To get linescrolling to work properly, we must ignore the 1st two scroll values, no idea why! -SJE */
171   for (i = 2;i < 32;i++) {
171   for (i = 2; i < 256; i++) {
172172      tilemap_set_scrollx(bg_tilemap,i,scrollx[i-2]);
173173      //logerror("scrollx[%d] = %d\n",i,scrollx[i]);
174174   }
r4057r4058
176176   draw_sprites(screen->machine,bitmap,cliprect);
177177   return 0;
178178}
179
180
181/*I don't really understand what the proper timing of this should be,
182  but after TONS of testing, the tilemap individual line scrolling works as long as flip screen is not set -SJE
183*/
184INTERRUPT_GEN( vball_interrupt )
185{
186   int line = 31 - cpu_getiloops(device);
187   if (line < 13)
188      cpu_set_input_line(device, M6502_IRQ_LINE, HOLD_LINE);
189   else if (line == 13)
190      cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
191   //save the scroll x register value
192   if(line<32) scrollx[31-line] = (vb_scrollx_hi + vb_scrollx_lo+4);
193}
src/mame/video/gridlee.c
r4057r4058
5656
5757/*************************************
5858 *
59 *  Video system restart
60 *
61 *************************************/
62
63static STATE_POSTLOAD( expand_pixels )
64{
65    int offset = 0;
66
67    for(offset = 0; offset < 0x77ff; offset++)
68    {
69        local_videoram[offset * 2 + 0] = videoram[offset] >> 4;
70        local_videoram[offset * 2 + 1] = videoram[offset] & 15;
71    }
72}
73
74
75
76/*************************************
77 *
5978 *  Video system start
6079 *
6180 *************************************/
r4057r4058
6887
6988   /* reset the palette */
7089   palettebank_vis = 0;
90
91    state_save_register_global(machine, gridlee_cocktail_flip);
92    state_save_register_global(machine, palettebank_vis);
93    state_save_register_postload(machine, expand_pixels, NULL);
7194}
7295
7396
src/mame/video/mrdo.c
r4057r4058
171171
172172   tilemap_set_transparent_pen(bg_tilemap,0);
173173   tilemap_set_transparent_pen(fg_tilemap,0);
174
175   tilemap_set_scrolldx(bg_tilemap, 0, 56);
176   tilemap_set_scrolldx(fg_tilemap, 0, 56);
177   tilemap_set_scrolldy(bg_tilemap, 0, 6);
178   tilemap_set_scrolldy(fg_tilemap, 0, 6);
179
180    state_save_register_global(machine, flipscreen);
174181}
175182
176183
src/mame/video/40love.c
r4057r4058
2323
2424int fortyl_pix_color[4];
2525
26static int pixram_sel;
27
2628/*
2729*   color prom decoding
2830*/
r4057r4058
98100
99101/***************************************************************************
100102
103  State-related callbacks
104
105***************************************************************************/
106
107static STATE_POSTLOAD( redraw_pixels )
108{
109    fortyl_pix_redraw = 1;
110    tilemap_mark_all_tiles_dirty(background);
111}
112
113
114/***************************************************************************
115
101116  Start the video hardware emulation.
102117
103118***************************************************************************/
r4057r4058
116131
117132   tilemap_set_scroll_rows(background,32);
118133   tilemap_set_transparent_pen(background,0);
134
135    state_save_register_global(machine, fortyl_flipscreen);
136    state_save_register_global_array(machine, fortyl_pix_color);
137    state_save_register_global_pointer(machine, fortyl_pixram1, 0x4000);
138    state_save_register_global_pointer(machine, fortyl_pixram2, 0x4000);
139    state_save_register_global_bitmap(machine, pixel_bitmap1);
140    state_save_register_global_bitmap(machine, pixel_bitmap2);
141    state_save_register_global(machine, pixram_sel);
142    state_save_register_postload(machine, redraw_pixels, NULL);
119143}
120144
121145
r4057r4058
125149
126150***************************************************************************/
127151
128static int pixram_sel;
129
130152static void fortyl_set_scroll_x(int offset)
131153{
132154   int   i = offset & ~1;
src/mame/video/1943.c
r4057r4058
220220
221221   colortable_configure_tilemap_groups(machine->colortable, bg_tilemap, machine->gfx[1], 0x0f);
222222   tilemap_set_transparent_pen(fg_tilemap, 0);
223
224    state_save_register_global(machine, chon);
225    state_save_register_global(machine, objon);
226    state_save_register_global(machine, sc1on);
227    state_save_register_global(machine, sc2on);
223228}
224229
225230static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
src/mame/video/jack.c
r4057r4058
4444   int code = videoram[tile_index] + ((colorram[tile_index] & 0x18) << 5);
4545   int color = colorram[tile_index] & 0x07;
4646
47   // striv: colorram[tile_index] & 0x80 ???
48
4749   SET_TILE_INFO(0, code, color, 0);
4850}
4951
src/mame/video/esripsys.c
r0r4058
1/***************************************************************************
2
3    Entertainment Sciences Real-Time Image Processor (RIP) video hardware
4
5****************************************************************************/
6
7#include "driver.h"
8#include "cpu/m6809/m6809.h"
9#include "esripsys.h"
10
11typedef struct _pixel_
12{
13   UINT8 colour;
14   UINT8 intensity;
15   UINT8 priority;
16} pixel;
17
18static emu_timer *hblank_end_timer;
19static emu_timer *hblank_start_timer;
20
21static UINT8 *fig_scale_table;
22static UINT8 *scale_table;
23static pixel *line_buffer_1;
24static pixel *line_buffer_2;
25
26static int vcount;
27static int video_firq;
28static UINT8 bg_intensity;
29
30int esripsys_video_firq_en;
31int esripsys_frame_vbl;
32int esripsys__12sel;
33UINT8 *esripsys_pal_ram;
34
35
36INTERRUPT_GEN( esripsys_vblank_irq )
37{
38   cpu_set_input_line(device->machine->cpu[ESRIPSYS_GAME_CPU], M6809_IRQ_LINE, ASSERT_LINE);
39   esripsys_frame_vbl = 0;
40}
41
42static TIMER_CALLBACK( hblank_start_callback )
43{
44   int v = vcount;
45
46   if (video_firq)
47   {
48      video_firq = 0;
49      cpu_set_input_line(machine->cpu[ESRIPSYS_GAME_CPU], M6809_FIRQ_LINE, CLEAR_LINE);
50   }
51
52   if (!(vcount % 6) && vcount && esripsys_video_firq_en && vcount < ESRIPSYS_VBLANK_START)
53   {
54      video_firq = 1;
55      cpu_set_input_line(machine->cpu[ESRIPSYS_GAME_CPU], M6809_FIRQ_LINE, ASSERT_LINE);
56   }
57
58   /* Adjust for next scanline */
59   if (++vcount >= ESRIPSYS_VTOTAL)
60      vcount = 0;
61
62   /* Set end of HBLANK timer */
63   timer_adjust_oneshot(hblank_end_timer, video_screen_get_time_until_pos(machine->primary_screen, v, ESRIPSYS_HTOTAL-1), v);
64}
65
66static TIMER_CALLBACK( hblank_end_callback )
67{
68   video_screen_update_partial(machine->primary_screen, param);
69
70   esripsys__12sel ^= 1;
71   timer_adjust_oneshot(hblank_start_timer, video_screen_get_time_until_pos(machine->primary_screen, vcount, ESRIPSYS_HBLANK_START), 0);
72}
73
74VIDEO_START( esripsys )
75{
76   int i;
77
78   /* Allocate memory for the two 512-pixel line buffers */
79   line_buffer_1 = auto_malloc(512 * sizeof(pixel));
80   line_buffer_2 = auto_malloc(512 * sizeof(pixel));
81
82   /* Create and initialise the HBLANK timers */
83   hblank_start_timer = timer_alloc(machine, hblank_start_callback, NULL);
84   hblank_end_timer = timer_alloc(machine, hblank_end_callback, NULL);
85   timer_adjust_oneshot(hblank_start_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, ESRIPSYS_HBLANK_START), 0);
86
87   /* Create the sprite scaling table */
88   scale_table = auto_malloc(64 * 64);
89
90   for (i = 0; i < 64; ++i)
91   {
92      int j;
93
94      for (j = 1; j < 65; ++j)
95      {
96         int p0 = 0;
97         int p1 = 0;
98         int p2 = 0;
99         int p3 = 0;
100         int p4 = 0;
101         int p5 = 0;
102
103         if (i & 0x1)
104            p0 = BIT(j, 5) && !BIT(j, 4) && !BIT(j,3) && !BIT(j, 2) && !BIT(j, 1) && !BIT(j, 0);
105         if (i & 0x2)
106            p1 = BIT(j, 4) && !BIT(j, 3) && !BIT(j, 2) && !BIT(j, 1) && !BIT(j, 0);
107         if (i & 0x4)
108            p2 = BIT(j,3) && !BIT(j, 2) && !BIT(j, 1) && !BIT(j, 0);
109         if (i & 0x8)
110            p3 = BIT(j, 2) && !BIT(j,1) && !BIT(j,0);
111         if (i & 0x10)
112            p4 = BIT(j, 1) && !BIT(j, 0);
113         if (i & 0x20)
114            p5 = BIT(j, 0);
115
116         scale_table[i * 64 + j - 1] = p0 | p1 | p2 | p3 | p4 | p5;
117      }
118   }
119
120   /* Now create a lookup table for scaling the sprite 'fig' value */
121   fig_scale_table = auto_malloc(1024 * 64);
122
123   for (i = 0; i < 1024; ++i)
124   {
125      int scale;
126
127      for (scale = 0; scale < 64; ++scale)
128      {
129         int input_pixels = i + 1;
130         int scaled_pixels = 0;
131
132         while (input_pixels)
133         {
134            if (scale_table[scale * 64 + (scaled_pixels & 0x3f)] == 0)
135               input_pixels--;
136
137            scaled_pixels++;
138         }
139
140         fig_scale_table[i * 64 + scale] = scaled_pixels - 1;
141      }
142   }
143}
144
145VIDEO_UPDATE( esripsys )
146{
147   int x;
148   int y;
149   pixel *src;
150
151   /* Select line buffer to scan out */
152   if (esripsys__12sel)
153      src = line_buffer_2;
154   else
155      src = line_buffer_1;
156
157   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
158   {
159      UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
160
161      for (x = cliprect->min_x; x <= cliprect->max_x; ++x)
162      {
163         int idx = src[x].colour;
164         int r = (esripsys_pal_ram[idx] & 0xf);
165         int g = (esripsys_pal_ram[256 + idx] & 0xf);
166         int b = (esripsys_pal_ram[512 + idx] & 0xf);
167         int i = src[x].intensity;
168
169         *dest++ = MAKE_RGB(r*i, g*i, b*i);
170
171         /* Clear the line buffer as we scan out */
172         src[x].colour = 0xff;
173         src[x].intensity = bg_intensity;
174         src[x].priority = 0;
175      }
176   }
177
178   return 0;
179}
180
181WRITE8_HANDLER( esripsys_bg_intensity_w )
182{
183   bg_intensity = data & 0xf;
184}
185
186/* Draw graphics to a line buffer */
187int esripsys_draw(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int line_latch)
188{
189   pixel *dst;
190   UINT8 pri = attr & 0xff;
191   UINT8 iny = (attr >> 8) & 0xf;
192   UINT8 pal = col << 4;
193   int x_flip = x_scale & 0x80;
194   int xs_typ = x_scale & 0x40;
195   int xs_val = x_scale & 0x3f;
196
197   /* Fig is the number of pixels to draw / 2 - 1 */
198   if (xs_typ)
199      fig = fig_scale_table[fig * 64 + xs_val];
200
201   if (esripsys__12sel)
202      dst = line_buffer_1;
203   else
204      dst = line_buffer_2;
205
206   /* 8bpp case */
207   if (attr & 0x8000)
208   {
209      int ptr = 0;
210      int cnt;
211      UINT8 *rom_l;
212      UINT8 *rom_r;
213      UINT32 lpos = l;
214      UINT32 rpos = r;
215
216      if (x_flip)
217      {
218         rom_l = memory_region(machine, "8bpp_r");
219         rom_r = memory_region(machine, "8bpp_l");
220      }
221      else
222      {
223         rom_l = memory_region(machine, "8bpp_l");
224         rom_r = memory_region(machine, "8bpp_r");
225      }
226
227      for (cnt = 0; cnt <= fig; cnt++)
228      {
229         UINT32 rom_addr = (ptr * 0x10000) + addr;
230         UINT8 pix1 = rom_l[rom_addr];
231         UINT8 pix2 = rom_r[rom_addr];
232
233         if ((UINT32)lpos < 512)
234         {
235            if ((pri > dst[lpos].priority) && pix1 != 0xff)
236            {
237               dst[lpos].colour = pix1;
238               dst[lpos].priority = pri;
239               dst[lpos].intensity = iny;
240            }
241         }
242
243         if ((UINT32)rpos < 512)
244         {
245            if ((pri > dst[rpos].priority) && pix2 != 0xff)
246            {
247               dst[rpos].colour = pix2;
248               dst[rpos].priority = pri;
249               dst[rpos].intensity = iny;
250            }
251         }
252
253         /* Shrink */
254         if (!xs_typ)
255         {
256            if (scale_table[xs_val * 64 + (cnt & 0x3f)])
257            {
258               --lpos;
259               ++rpos;
260            }
261
262            if (++ptr == 4)
263            {
264               ++addr;
265               ptr = 0;
266            }
267         }
268         else
269         {
270            if (!scale_table[xs_val * 64 + (cnt & 0x3f)])
271            {
272               if (++ptr == 4)
273               {
274                  ++addr;
275                  ptr = 0;
276               }
277            }
278
279            lpos--;
280            rpos++;
281         }
282      }
283   }
284   /* 4bpp case */
285   else
286   {
287      const UINT8* const rom = memory_region(machine, "4bpp");
288      int ptr = 0;
289      int cnt;
290      UINT32 lpos = l;
291      UINT32 rpos = r;
292
293      for (cnt = 0; cnt <= fig; cnt++)
294      {
295         UINT8 px8 = rom[(ptr * 0x10000) + addr];
296         UINT8 px1;
297         UINT8 px2;
298
299         if (x_flip)
300         {
301            px1 = px8 & 0xf;
302            px2 = (px8 >> 4) & 0xf;
303         }
304         else
305         {
306            px2 = px8 & 0xf;
307            px1 = (px8 >> 4) & 0xf;
308         }
309
310         if ((UINT32)lpos < 512)
311         {
312            if ((pri > dst[lpos].priority) && px1 != 0xf)
313            {
314               dst[lpos].colour = pal | px1;
315               dst[lpos].priority = pri;
316               dst[lpos].intensity = iny;
317            }
318         }
319
320         if ((UINT32)rpos < 512)
321         {
322            if (pri > dst[rpos].priority && px2 != 0xf)
323            {
324               dst[rpos].colour = pal | px2;
325               dst[rpos].priority = pri;
326               dst[rpos].intensity = iny;
327            }
328         }
329
330         /* Shrink */
331         if (!xs_typ)
332         {
333            if (scale_table[xs_val * 64 + (cnt & 0x3f)])
334            {
335               lpos--;
336               rpos++;
337            }
338
339            if (++ptr == 4)
340            {
341               addr++;
342               ptr = 0;
343            }
344         }
345         else
346         {
347            if (!scale_table[xs_val * 64 + (cnt & 0x3f)])
348            {
349               if (++ptr == 4)
350               {
351                  addr++;
352                  ptr = 0;
353               }
354            }
355            lpos--;
356            rpos++;
357         }
358      }
359   }
360
361   return fig + 1;
362}
src/mame/video/tx1.c
r4057r4058
11771177   const device_config *centre_screen = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "center");
11781178   const device_config *right_screen  = device_list_find_by_tag(screen->machine->config->devicelist, VIDEO_SCREEN, "right");
11791179
1180   if ( screen == left_screen )
1180   if (screen == left_screen)
11811181   {
11821182      memset(tx1_obj_bmp, 0, 768*240);
11831183
r4057r4058
13331333   if (wide)
13341334   {
13351335      scroll_y = (buggyboy_vram[0xfff] >> 10) & 0x3f;
1336      scroll_x = buggyboy_vram[0xfff] & 0x1ff;
1336      scroll_x = buggyboy_vram[0xfff] & 0x3ff;
13371337      total_width = 768;
13381338      x_mask = 0x3ff;
13391339   }
r4057r4058
24502450   if (screen == left_screen)
24512451   {
24522452      memset(bb_obj_bmp, 0, 768*240);
2453      memset(bb_rod_bmp, 0, 768*240);
24532454
24542455      buggyboy_draw_char(screen->machine, bb_chr_bmp, 1);
24552456//      buggyboy_draw_road(screen->machine, bb_rod_bmp, 1);
src/mame/video/decocass.c
r4057r4058
213213
214214WRITE8_HANDLER( decocass_charram_w )
215215{
216   if (data == decocass_charram[offset])
217      return;
218216   decocass_charram[offset] = data;
219217   /* dirty sprite */
220218   sprite_dirty[(offset >> 5) & 255] = 1;
r4057r4058
245243
246244WRITE8_HANDLER( decocass_tileram_w )
247245{
248   if (data == decocass_tileram[offset])
249      return;
250246   decocass_tileram[offset] = data;
251247   /* dirty tile (64 bytes per tile) */
252248   tile_dirty[(offset / 64) & 15] = 1;
r4057r4058
257253
258254WRITE8_HANDLER( decocass_objectram_w )
259255{
260   if (data == decocass_objectram[offset])
261      return;
262256   decocass_objectram[offset] = data;
263257   /* dirty the object */
264258   object_dirty = 1;
r4057r4058
266260
267261WRITE8_HANDLER( decocass_bgvideoram_w )
268262{
269   if (data == decocass_bgvideoram[offset])
270      return;
271263   decocass_bgvideoram[offset] = data;
272264   mark_bg_tile_dirty( offset );
273265}
r4057r4058
592584   tilemap_set_transparent_pen( fg_tilemap, 0 );
593585
594586   bg_tilemap_l_clip = *video_screen_get_visible_area(machine->primary_screen);
595   bg_tilemap_l_clip.max_y = video_screen_get_height(machine->primary_screen) / 2;
587   bg_tilemap_l_clip.max_y = 256 / 2;
596588
597589   bg_tilemap_r_clip = *video_screen_get_visible_area(machine->primary_screen);
598   bg_tilemap_r_clip.min_y = video_screen_get_height(machine->primary_screen) / 2;
590   bg_tilemap_r_clip.min_y = 256 / 2;
599591
600592   /* background videroam bits D0-D3 are shared with the tileram */
601593   decocass_bgvideoram = decocass_tileram;
r4057r4058
615607   else if (watchdog_count-- > 0)
616608      watchdog_reset(screen->machine);
617609
618#if TAPE_UI_DISPLAY
619   if (tape_timer)
620   {
621      attotime tape_time = decocass_adjust_tape_time(tape_time0);
622      popmessage("%c%c [%05.1fs] %c%c",
623         (tape_dir < 0 && tape_speed) ? '<' : ' ',
624         (tape_dir < 0) ? '<' : ' ',
625         attotime_to_double(tape_time),
626         (tape_dir > 0) ? '>' : ' ',
627         (tape_dir > 0 && tape_speed) ? '>' : ' ');
628   }
629#endif
630610#ifdef MAME_DEBUG
631611   {
632612      static int showmsg;
src/mame/video/exidy.c
r4057r4058
6060   motion_object_1_vid = auto_bitmap_alloc(16, 16, format);
6161   motion_object_2_vid = auto_bitmap_alloc(16, 16, format);
6262   motion_object_2_clip = auto_bitmap_alloc(16, 16, format);
63
64    state_save_register_global(machine, collision_mask);
65    state_save_register_global(machine, collision_invert);
66    state_save_register_global(machine, is_2bpp);
67    state_save_register_global(machine, int_condition);
68    state_save_register_global_bitmap(machine, background_bitmap);
69    state_save_register_global_bitmap(machine, motion_object_1_vid);
70    state_save_register_global_bitmap(machine, motion_object_2_vid);
71    state_save_register_global_bitmap(machine, motion_object_2_clip);
6372}
6473
6574
src/mame/video/circus.c
r4057r4058
4949{
5050   bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
5151       8, 8, 32, 32);
52
53    state_save_register_global(machine, clown_x);
54    state_save_register_global(machine, clown_y);
55    state_save_register_global(machine, clown_z);
5256}
5357
5458static void draw_line(bitmap_t *bitmap, const rectangle *cliprect, int x1, int y1, int x2, int y2, int dotted)
src/mame/video/segas18.c
r4057r4058
218218
219219   /* draw background opaquely first, not setting any priorities */
220220   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0 | TILEMAP_DRAW_OPAQUE, 0x00);
221{
222   int x,y;
223   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
224      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
225         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("0: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
226}
221227   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1 | TILEMAP_DRAW_OPAQUE, 0x00);
228{
229   int x,y;
230   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
231      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
232         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("1: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
233}
222234   if (vdp_enable && vdplayer == 0) draw_vdp(bitmap, cliprect, vdppri);
235{
236   int x,y;
237   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
238      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
239         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("2: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
240}
223241
224242   /* draw background again to draw non-transparent pixels over the VDP and set the priority */
225243   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
244{
245   int x,y;
246   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
247      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
248         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("3: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
249}
226250   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);
251{
252   int x,y;
253   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
254      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
255         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("4: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
256}
227257   if (vdp_enable && vdplayer == 1) draw_vdp(bitmap, cliprect, vdppri);
258{
259   int x,y;
260   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
261      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
262         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("5: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
263}
228264
229265   /* draw foreground */
230266   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
267{
268   int x,y;
269   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
270      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
271         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("6: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
272}
231273   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);
274{
275   int x,y;
276   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
277      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
278         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("7: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
279}
232280   if (vdp_enable && vdplayer == 2) draw_vdp(bitmap, cliprect, vdppri);
281{
282   int x,y;
283   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
284      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
285         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("8: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
286}
233287
234288   /* text layer */
235289   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
290{
291   int x,y;
292   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
293      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
294         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("9: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
295}
236296   segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);
297{
298   int x,y;
299   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
300      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
301         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("A: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
302}
237303   if (vdp_enable && vdplayer == 3) draw_vdp(bitmap, cliprect, vdppri);
304{
305   int x,y;
306   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
307      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
308         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("B: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
309}
238310
239311   /* draw the sprites */
240312   segaic16_sprites_draw(screen, bitmap, cliprect, 0);
313{
314   int x,y;
315   for (y = cliprect->min_y; y <= cliprect->max_y; y++)
316      for (x = cliprect->min_x; x <= cliprect->max_x; x++)
317         if (*BITMAP_ADDR16(bitmap, y, x) >= 0x2000) printf("C: pix=%04X\n", *BITMAP_ADDR16(bitmap, y, x));
318}
241319
242320#if DEBUG_VDP
243321   if (vdp_enable && input_code_pressed(KEYCODE_V))
src/mame/video/nmk16.c
r4057r4058
543543   return 0;
544544}
545545
546/*coin setting MCU simulation*/
547static void mcu_run(running_machine *machine, UINT8 dsw_setting)
548{
549   static UINT8 read_coin;
550   static UINT8 old_value;
551   static UINT8 coina,coinb;
552   UINT8 dsw_a,dsw_b;
553   /*needed because of the uncompatibility of the dsw settings.*/
554   if(dsw_setting)
555   {
556      dsw_a = (input_port_read(machine, "DSW2") & 0x7);
557      dsw_b = (input_port_read(machine, "DSW2") & 0x38) >> 3;
558   }
559   else
560   {
561      dsw_a = (input_port_read(machine, "DSW1") & 0x0700) >> 8;
562      dsw_b = (input_port_read(machine, "DSW1") & 0x3800) >> 11;
563   }
564
565   read_coin = old_value;
566   old_value = input_port_read(machine, "IN0");
567
568   if(dsw_a == 0 || dsw_b == 0)
569      nmk16_mainram[0x9000/2]|=0x4000; //free_play
570
571   if(read_coin != old_value)
572   {
573      if(!(input_port_read(machine, "IN0") & 0x01))//COIN1
574      {
575         switch(dsw_a & 7)
576         {
577            case 1: nmk16_mainram[0xef00/2]+=4; break;
578            case 2: nmk16_mainram[0xef00/2]+=3; break;
579            case 3: nmk16_mainram[0xef00/2]+=2; break;
580            case 4:
581            coina++;
582            if(coina >= 4)
583            {
584               coina = 0;
585               nmk16_mainram[0xef00/2]++;
586            }
587            break;
588            case 5:
589            coina++;
590            if(coina >= 3)
591            {
592               coina = 0;
593               nmk16_mainram[0xef00/2]++;
594            }
595            break;
596            case 6:
597            coina++;
598            if(coina >= 2)
599            {
600               coina = 0;
601               nmk16_mainram[0xef00/2]++;
602            }
603            break;
604            case 7: nmk16_mainram[0xef00/2]++; break;
605         }
606      }
607
608      if(!(input_port_read(machine, "IN0") & 0x02))//COIN2
609      {
610         switch(dsw_b & 7)
611         {
612            case 1: nmk16_mainram[0xef00/2]+=4; break;
613            case 2: nmk16_mainram[0xef00/2]+=3; break;
614            case 3: nmk16_mainram[0xef00/2]+=2; break;
615            case 4:
616            coinb++;
617            if(coinb >= 4)
618            {
619               coinb = 0;
620               nmk16_mainram[0xef00/2]++;
621            }
622            break;
623            case 5:
624            coinb++;
625            if(coinb >= 3)
626            {
627               coinb = 0;
628               nmk16_mainram[0xef00/2]++;
629            }
630            break;
631            case 6:
632            coinb++;
633            if(coinb >= 2)
634            {
635               coinb = 0;
636               nmk16_mainram[0xef00/2]++;
637            }
638            break;
639            case 7: nmk16_mainram[0xef00/2]++; break;
640         }
641      }
642
643      if(!(input_port_read(machine, "IN0") & 0x04))   //SERVICE_COIN
644         nmk16_mainram[0xef00/2]++;
645
646      if(nmk16_mainram[0xef00/2] >= 1 && (nmk16_mainram[0x9000/2] & 0x8000))/*enable start button*/
647      {
648         /*Start a 1-player game,but don't decrement if the player 1 is already playing*/
649         if((!(input_port_read(machine, "IN0") & 0x08)) /*START1*/
650         && (!(nmk16_mainram[0x9000/2] & 0x0200)) /*PLAYER-1 playing*/
651         )
652            nmk16_mainram[0xef00/2]--;
653
654         /*Start a 2-players game,but don't decrement if the player 2 is already playing*/
655         if((!(input_port_read(machine, "IN0") & 0x10))
656         && (!(nmk16_mainram[0x9000/2] & 0x0100))
657         )
658         {
659            if(!(nmk16_mainram[0x9000/2] & 0x0200) && nmk16_mainram[0xef00/2] >= 2)
660               nmk16_mainram[0xef00/2]-=2;
661            else
662               nmk16_mainram[0xef00/2]--;
663         }
664      }
665
666      if(nmk16_mainram[0xef00/2] > 99) nmk16_mainram[0xef00/2] = 99;
667   }
668}
669
670546VIDEO_UPDATE( tdragon )
671547{
672   mcu_run(screen->machine, 1);
548//  mcu_run(screen->machine, 1);
673549
674550   tilemap_set_scrollx(tx_tilemap,0,-videoshift);
675551
r4057r4058
686562
687563VIDEO_UPDATE( hachamf )
688564{
689   mcu_run(screen->machine, 0);
565//  mcu_run(screen->machine, 0);
690566
691567   tilemap_set_scrollx(tx_tilemap,0,-videoshift);
692568
src/mame/layout/polepos.lay
r0r4058
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="shifter" defstate="0">
4      <rect>
5         <bounds left="5" top="0" right="35" bottom="40" />
6         <color red="0.0" green="0.0" blue="0.0" />
7      </rect>
8
9      <disk>
10         <bounds left="18" right="22" top="9" bottom="11" />
11         <color red="0.25" green="0.25" blue="0.25" />
12      </disk>
13      <rect>
14         <bounds left="18" right="22" top="10" bottom="30" />
15         <color red="0.25" green="0.25" blue="0.25" />
16      </rect>
17      <disk>
18         <bounds left="18" right="22" top="29" bottom="31" />
19         <color red="0.25" green="0.25" blue="0.25" />
20      </disk>
21
22      <text string="L">
23         <bounds left="15" right="25" top="2" bottom="8" />
24         <color red="1" green="1" blue="1" />
25      </text>
26      <text string="H">
27         <bounds left="15" right="25" top="32" bottom="38" />
28         <color red="1" green="1" blue="1" />
29      </text>
30
31      <rect state="0">
32         <bounds left="10" right="30" top="10" bottom="15" />
33         <color red="0.75" green="0.0" blue="0.0" />
34      </rect>
35      <disk state="0">
36         <bounds left="7.5" right="12.5" top="10" bottom="15" />
37         <color red="0.75" green="0.0" blue="0.0" />
38      </disk>
39      <disk state="0">
40         <bounds left="27.5" right="32.5" top="10" bottom="15" />
41         <color red="0.75" green="0.0" blue="0.0" />
42      </disk>
43
44      <rect state="1">
45         <bounds left="10" right="30" top="25" bottom="30" />
46         <color red="0.75" green="0.0" blue="0.0" />
47      </rect>
48      <disk state="1">
49         <bounds left="7.5" right="12.5" top="25" bottom="30" />
50         <color red="0.75" green="0.0" blue="0.0" />
51      </disk>
52      <disk state="1">
53         <bounds left="27.5" right="32.5" top="25" bottom="30" />
54         <color red="0.75" green="0.0" blue="0.0" />
55      </disk>
56   </element>
57   
58   <view name="Shifter">
59      <screen index="0">
60         <bounds left="0" top="0" right="4" bottom="3" />
61      </screen>
62     
63      <bezel element="shifter" inputtag="IN0" inputmask="0x02">
64         <bounds x="3.7" y="2.45" width="0.25" height="0.5" />
65         <color alpha="0.9" />
66      </bezel>
67   </view>   
68</mamelayout>
src/mame/drivers/rocnrope.c
r4057r4058
248248
249249***************************************************************************/
250250
251/*
252    Roc'n Rope
253
254    CPU/Video Board: KT-A207-1C
255    Sound Board:     KT-2207-2A
256*/
257
251258ROM_START( rocnrope )
252259   ROM_REGION( 0x10000, "main", 0 )
253260   ROM_LOAD( "rr1.1h",       0x6000, 0x2000, CRC(83093134) SHA1(c9509cfb9f9043cd6c226cc84dbc2e2b744488f6) )
r4057r4058
274281   ROM_LOAD( "a17_prom.bin", 0x0000, 0x0020, CRC(22ad2c3e) SHA1(1c2198b286c75aa9e78d000432795b1ce86ad6b9) )
275282   ROM_LOAD( "b16_prom.bin", 0x0020, 0x0100, CRC(750a9677) SHA1(7a5b4aed5f87180850657b8852bb3f3138d58b5b) )
276283   ROM_LOAD( "rocnrope.pr3", 0x0120, 0x0100, CRC(b5c75a27) SHA1(923d6ccf015fd7458494416cc05426cc922a9238) )
284
285    ROM_REGION( 0x0001, "pal_cpuvidbd", 0 ) /* PAL located on the cpu/video board */
286    ROM_LOAD( "h100.6g",      0x0000, 0x0001, NO_DUMP ) /* 20 Pin chip.  Appears to be a PAL.  Schematics obsfucated. */
277287ROM_END
278288
279289ROM_START( rocnropk )
r4057r4058
302312   ROM_LOAD( "a17_prom.bin", 0x0000, 0x0020, CRC(22ad2c3e) SHA1(1c2198b286c75aa9e78d000432795b1ce86ad6b9) )
303313   ROM_LOAD( "b16_prom.bin", 0x0020, 0x0100, CRC(750a9677) SHA1(7a5b4aed5f87180850657b8852bb3f3138d58b5b) )
304314   ROM_LOAD( "rocnrope.pr3", 0x0120, 0x0100, CRC(b5c75a27) SHA1(923d6ccf015fd7458494416cc05426cc922a9238) )
315
316    ROM_REGION( 0x0001, "pal_cpuvidbd", 0 ) /* PAL located on the cpu/video board */
317    ROM_LOAD( "h100.6g",      0x0000, 0x0001, NO_DUMP ) /* 20 Pin chip.  Appears to be a PAL.  Schematics obsfucated. */
305318ROM_END
306319
307320
src/mame/drivers/coinmstr.c
r4057r4058
140140   AM_RANGE(0x50, 0x53) AM_READNOP
141141   AM_RANGE(0x50, 0x53) AM_WRITENOP
142142   AM_RANGE(0x58, 0x5b) AM_READWRITE(pia_2_r, pia_2_w)
143   AM_RANGE(0x70, 0x70) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
144   AM_RANGE(0x71, 0x71) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
143   AM_RANGE(0x70, 0x70) AM_DEVWRITE(H46505, "crtc", mc6845_address_w)
144   AM_RANGE(0x71, 0x71) AM_DEVWRITE(H46505, "crtc", mc6845_register_w)
145145   AM_RANGE(0xc0, 0xc3) AM_READNOP
146146   AM_RANGE(0xc0, 0xc3) AM_WRITENOP
147147ADDRESS_MAP_END
r4057r4058
150150   ADDRESS_MAP_GLOBAL_MASK(0xff)
151151   AM_RANGE(0x00, 0x00) AM_READ(question_r)
152152   AM_RANGE(0x00, 0x03) AM_WRITE(question_w)
153   AM_RANGE(0x40, 0x40) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
154   AM_RANGE(0x41, 0x41) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
153   AM_RANGE(0x40, 0x40) AM_DEVWRITE(H46505, "crtc", mc6845_address_w)
154   AM_RANGE(0x41, 0x41) AM_DEVWRITE(H46505, "crtc", mc6845_register_w)
155155   AM_RANGE(0x48, 0x48) AM_WRITE(ay8910_control_port_0_w)
156156   AM_RANGE(0x49, 0x49) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
157157   AM_RANGE(0x50, 0x53) AM_READWRITE(pia_0_r, pia_0_w) //?
r4057r4058
168168   AM_RANGE(0x40, 0x41) AM_READNOP
169169   AM_RANGE(0x40, 0x43) AM_WRITENOP
170170   AM_RANGE(0x43, 0x43) AM_READNOP
171   AM_RANGE(0x48, 0x48) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
172   AM_RANGE(0x49, 0x49) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
171   AM_RANGE(0x48, 0x48) AM_DEVWRITE(H46505, "crtc", mc6845_address_w)
172   AM_RANGE(0x49, 0x49) AM_DEVWRITE(H46505, "crtc", mc6845_register_w)
173173   AM_RANGE(0x50, 0x51) AM_READNOP
174174   AM_RANGE(0x50, 0x53) AM_WRITENOP
175175   AM_RANGE(0x53, 0x53) AM_READNOP
r4057r4058
630630   NULL
631631};
632632
633static const mc6845_interface h46505_intf =
634{
635   "main",      /* screen we are acting on */
636   8,         /* number of pixels per video memory address */
637   NULL,      /* before pixel update callback */
638   NULL,      /* row update callback */
639   NULL,      /* after pixel update callback */
640   NULL,      /* callback for display state changes */
641   NULL,      /* HSYNC callback */
642   NULL      /* VSYNC callback */
643};
644
645
633646static MACHINE_DRIVER_START( coinmstr )
634647   MDRV_CPU_ADD("cpu",Z80,8000000) // ?
635648   MDRV_CPU_PROGRAM_MAP(coinmstr_map,0)
r4057r4058
649662   MDRV_VIDEO_START(coinmstr)
650663   MDRV_VIDEO_UPDATE(coinmstr)
651664
652   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
665   MDRV_MC6845_ADD("crtc", H46505, 14000000 / 16, h46505_intf)
653666
654667   /* sound hardware */
655668   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/docastle.c
r4057r4058
580580   adpcm_status = 0;
581581}
582582
583static MACHINE_START( docastle )
584{
585    state_save_register_global(machine, adpcm_pos);
586    state_save_register_global(machine, adpcm_data);
587    state_save_register_global(machine, adpcm_idle);
588    state_save_register_global(machine, adpcm_status);
589    docastle_shared_state_register(machine);
590}
583591
584592static MACHINE_DRIVER_START( docastle )
585593   // basic machine hardware
r4057r4058
614622   MDRV_VIDEO_UPDATE(docastle)
615623
616624   MDRV_MACHINE_RESET( docastle )
625    MDRV_MACHINE_START( docastle )
617626
618627   // sound hardware
619628   MDRV_SPEAKER_STANDARD_MONO("mono")
r4057r4058
783792   ROM_LOAD( "rev-0-2.n7",   0x0000, 0x4000, CRC(6dac2fa3) SHA1(cd583f379f01788ce20f611f17689105d32ef97a) )
784793
785794   ROM_REGION( 0x10000, "cpu3", 0 )
786   ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
795   ROM_LOAD( "bprom2.bin",   0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
787796
788797   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
789798   ROM_LOAD( "rev-0-5.a3",   0x0000, 0x4000, CRC(e20795b7) SHA1(ae4366d2c45580f3e60ae36f81a5fc912d1eb899) )
r4057r4058
809818   ROM_LOAD( "rev-0-2.n7",   0x0000, 0x4000, CRC(6dac2fa3) SHA1(cd583f379f01788ce20f611f17689105d32ef97a) )
810819
811820   ROM_REGION( 0x10000, "cpu3", 0 )
812   ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
821   ROM_LOAD( "bprom2.bin",   0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
813822
814823   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
815824   ROM_LOAD( "rev-0-5.a3",   0x0000, 0x4000, CRC(e20795b7) SHA1(ae4366d2c45580f3e60ae36f81a5fc912d1eb899) )
r4057r4058
835844   ROM_LOAD( "27128.p7",     0x0000, 0x4000, CRC(8b06d461) SHA1(2434478810c6301197997be76505f5fc6beba5d3) )
836845
837846   ROM_REGION( 0x10000, "cpu3", 0 )
838   ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
847   ROM_LOAD( "bprom2.bin",   0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
839848
840849   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
841850   ROM_LOAD( "27128.a3",     0x0000, 0x4000, CRC(4be96dcf) SHA1(f9b45e6297cbbc4d1ee2df7ac377c5daf5181b0f) )
r4057r4058
861870   ROM_LOAD( "27128.p7",     0x0000, 0x4000, CRC(8b06d461) SHA1(2434478810c6301197997be76505f5fc6beba5d3) )
862871
863872   ROM_REGION( 0x10000, "cpu3", 0 )
864   ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
873   ROM_LOAD( "bprom2.bin",   0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
865874
866875   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
867876   ROM_LOAD( "27128.a3",     0x0000, 0x4000, CRC(4be96dcf) SHA1(f9b45e6297cbbc4d1ee2df7ac377c5daf5181b0f) )
r4057r4058
887896   ROM_LOAD( "27128.p7",     0x0000, 0x4000, CRC(8b06d461) SHA1(2434478810c6301197997be76505f5fc6beba5d3) )
888897
889898   ROM_REGION( 0x10000, "cpu3", 0 )
890   ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
899   ROM_LOAD( "bprom2.bin",   0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
891900
892901   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
893902   ROM_LOAD( "sp5.bin",      0x0000, 0x4000, CRC(1b704bb0) SHA1(db3b2f120d632b5f897c47aee115916ec6c52a69) )
r4057r4058
939948   ROM_LOAD( "j0.bin",       0x0000, 0x4000, CRC(ab042f04) SHA1(06412dbdc43ebd6d376a811f240a4c9ec43ca6e7) )
940949
941950   ROM_REGION( 0x10000, "cpu3", 0 )
942   ROM_LOAD( "bprom2.bin",   0x0200, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
951   ROM_LOAD( "bprom2.bin",   0x0000, 0x0200, CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) )
943952
944953   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
945954   ROM_LOAD( "j5.bin",       0x0000, 0x4000, CRC(75038ff9) SHA1(2a92e0d0adb1abd029c5ee6e350a859fed3f0ae9) )
r4057r4058
10131022
10141023/* Game Drivers */
10151024
1016GAME( 1983, docastle, 0,        docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (set 1)", 0 )
1017GAME( 1983, docastl2, docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (set 2)", 0 )
1018GAME( 1983, docastlo, docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (older)", 0 )
1019GAME( 1983, douni,    docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do vs. Unicorns", 0 )
1020GAME( 1984, dorunrun, 0,        dorunrun, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (set 1)", 0 )
1021GAME( 1984, dorunru2, dorunrun, dorunrun, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (set 2)", 0 )
1022GAME( 1984, dorunruc, dorunrun, docastle, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (Do's Castle hardware, set 1)", 0 )
1023GAME( 1984, dorunrca, dorunrun, docastle, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (Do's Castle hardware, set 2)", 0 )
1024GAME( 1987, spiero,   dorunrun, dorunrun, dorunrun, 0, ROT0,   "Universal", "Super Pierrot (Japan)", 0 )
1025GAME( 1984, dowild,   0,        dorunrun, dowild,   0, ROT0,   "Universal", "Mr. Do's Wild Ride", 0 )
1026GAME( 1984, jjack,    0,        dorunrun, jjack,    0, ROT270, "Universal", "Jumping Jack", 0 )
1027GAME( 1984, kickridr, 0,        dorunrun, kickridr, 0, ROT0,   "Universal", "Kick Rider", 0 )
1028GAME( 1985, idsoccer, 0,        idsoccer, idsoccer, 0, ROT0,   "Universal", "Indoor Soccer", GAME_NO_COCKTAIL )
1025GAME( 1983, docastle, 0,        docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (set 1)", GAME_SUPPORTS_SAVE )
1026GAME( 1983, docastl2, docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (set 2)", GAME_SUPPORTS_SAVE )
1027GAME( 1983, docastlo, docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do's Castle (older)", GAME_SUPPORTS_SAVE )
1028GAME( 1983, douni,    docastle, docastle, docastle, 0, ROT270, "Universal", "Mr. Do vs. Unicorns", GAME_SUPPORTS_SAVE )
1029GAME( 1984, dorunrun, 0,        dorunrun, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (set 1)", GAME_SUPPORTS_SAVE )
1030GAME( 1984, dorunru2, dorunrun, dorunrun, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (set 2)", GAME_SUPPORTS_SAVE )
1031GAME( 1984, dorunruc, dorunrun, docastle, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (Do's Castle hardware, set 1)", GAME_SUPPORTS_SAVE )
1032GAME( 1984, dorunrca, dorunrun, docastle, dorunrun, 0, ROT0,   "Universal", "Do! Run Run (Do's Castle hardware, set 2)", GAME_SUPPORTS_SAVE )
1033GAME( 1987, spiero,   dorunrun, dorunrun, dorunrun, 0, ROT0,   "Universal", "Super Pierrot (Japan)", GAME_SUPPORTS_SAVE )
1034GAME( 1984, dowild,   0,        dorunrun, dowild,   0, ROT0,   "Universal", "Mr. Do's Wild Ride", GAME_SUPPORTS_SAVE )
1035GAME( 1984, jjack,    0,        dorunrun, jjack,    0, ROT270, "Universal", "Jumping Jack", GAME_SUPPORTS_SAVE )
1036GAME( 1984, kickridr, 0,        dorunrun, kickridr, 0, ROT0,   "Universal", "Kick Rider", GAME_SUPPORTS_SAVE )
1037GAME( 1985, idsoccer, 0,        idsoccer, idsoccer, 0, ROT0,   "Universal", "Indoor Soccer", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL )
src/mame/drivers/magicard.c
r0r4058
1/******************************************************************************
2
3
4    MAGIC CARD - IMPERA
5    -------------------
6
7    Preliminary driver by Roberto Fresca, David Haywood & Angelo Salese
8
9
10    Games running on this hardware:
11
12    * Magic Card (set 1),  Impera, 199?
13    * Magic Card (set 2),  Impera, 199?
14
15*******************************************************************************
16
17
18    *** Hardware Notes ***
19
20    (All ICs on this board are surface scratched, so we're guessing...)
21
22    Identified:
23
24    - CPU:  1x Philips SCC 68070 CCA84 (16 bits Microprocessor, PLCC) @ 15 MHz
25    - VSC:  1x Philips SCC 66470 CAB (Video and System Controller, QFP)
26
27    - Protection: 1x Dallas TimeKey DS1207-1 (for book-keeping protection)
28
29    - Crystals:   1x 30.0000 MHz.
30                  1x 19.6608 MHz.
31
32    - PLDs:       1x PAL16L8ACN
33                  1x PALCE18V8H-25
34
35
36*******************************************************************************
37
38
39    *** General Notes ***
40
41    Impera released "Magic Card" in a custom 16-bits PCB.
42    The hardware was so expensive and they never have reached the expected sales,
43    so... they ported the game to Impera/Funworld 8bits boards, losing part of
44    graphics and sound/music quality. The new product was named "Magic Card II".
45
46*******************************************************************************
47
48TODO:
49
50-Understand these two things:
51 -bpset 1a2a82
52  do pc=1a2a92 ;tests the 260000-27ffff region
53  After the boot screen (the angel with torch),will come a screen with a circle
54  and a counter in the middle like a warning screen.I think is checksuming
55  something -RF
56
57 -bpset 75600
58  do pc=75648 ;there are various tests/tight hangs while testing the 2005 area
59  Chances are that the inputs are located in a RAM-based fashion,similar of the
60  way used by spool99 (probably the latter copied from this one). -AS
61
62-Fix properly the starting vectors;
63
64-Colors;
65
66-Inputs;
67
68-Sound;
69
70-Visible Area;
71
72-Clone romset magicrda not checked at all;
73
74*******************************************************************************/
75
76
77#define CLOCK_A   XTAL_30MHz
78#define CLOCK_B   XTAL_19_6608MHz
79
80#include "driver.h"
81#include "cpu/m68000/m68000.h"
82
83static UINT16 *magicram;
84static UINT16 *blit_ram;
85
86/*************************
87*     Video Hardware     *
88*************************/
89
90static VIDEO_START(magicard)
91{
92
93}
94
95static VIDEO_UPDATE(magicard)
96{
97   int x,y,count;
98
99   count = (0/2);
100
101   for(y=0;y<300;y++)
102   {
103      for(x=0;x<168;x++)
104      {
105         UINT32 color;
106
107         color = ((blit_ram[count]) & 0x00ff)>>0;
108
109         if((x*2)<video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
110            *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine->pens[color];
111
112         color = ((blit_ram[count]) & 0xff00)>>8;
113
114         if(((x*2)+1)<video_screen_get_visible_area(screen)->max_x && ((y)+0)<video_screen_get_visible_area(screen)->max_y)
115            *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine->pens[color];
116
117         count++;
118      }
119   }
120   return 0;
121}
122
123
124/*************************
125* Memory map information *
126*************************/
127
128static READ16_HANDLER( test_r )
129{
130   return mame_rand(space->machine);
131}
132
133static ADDRESS_MAP_START( magicard_mem, ADDRESS_SPACE_PROGRAM, 16 )
134   AM_RANGE(0x000000, 0x01ffff) AM_RAM AM_BASE(&magicram)
135   AM_RANGE(0x020000, 0x020001) AM_READ(test_r)
136   AM_RANGE(0x020002, 0x020003) AM_READ(test_r)
137   AM_RANGE(0x040000, 0x05ffff) AM_RAM
138   AM_RANGE(0x060000, 0x07ffff) AM_RAM AM_BASE(&blit_ram)
139//  AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_REGION("main", 0)
140   AM_RANGE(0x180000, 0x1ffbff) AM_ROM AM_REGION("main", 0)
141   AM_RANGE(0x1ffc00, 0x1fffff) AM_RAM
142   AM_RANGE(0x260000, 0x27ffff) AM_RAM /*???*/
143ADDRESS_MAP_END
144
145
146/*************************
147*      Input ports       *
148*************************/
149
150static INPUT_PORTS_START( magicard )
151INPUT_PORTS_END
152
153
154MACHINE_RESET( magicard )
155{
156   UINT16 *src    = (UINT16*)memory_region( machine, "main" );
157   UINT16 *dst    = magicram;
158   memcpy (dst, src, 0x20000);
159}
160
161static PALETTE_INIT( magicard )
162{
163/*  int bit0, bit1, bit2 , r, g, b;
164    int i;
165
166    for (i = 0; i < 0x100; ++i)
167    {
168        bit0 = (color_prom[0] >> 0) & 0x01;
169        bit1 = (color_prom[0] >> 1) & 0x01;
170        bit2 = (color_prom[0] >> 2) & 0x01;
171        r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
172        bit0 = (color_prom[0] >> 3) & 0x01;
173        bit1 = (color_prom[0] >> 4) & 0x01;
174        bit2 = (color_prom[0] >> 5) & 0x01;
175        g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
176        bit0 = 0;
177        bit1 = (color_prom[0] >> 6) & 0x01;
178        bit2 = (color_prom[0] >> 7) & 0x01;
179        b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
180
181        palette_set_color(machine, i, MAKE_RGB(r, g, b));
182        color_prom++;
183    }*/
184}
185
186/*************************
187*    Graphics Layouts    *
188*************************/
189
190static const gfx_layout mca_charlayout =
191{
192/* text layer is only 1bpp??
193   there are 2 charsets, but very different
194*/
195   8, 10,
196   190,
197   1,      /* 1bpp? */
198   { 0 },
199   { 0, 1, 2, 3, 4, 5, 6, 7 },
200   { 1*8, 0*8, 3*8, 2*8, 5*8, 4*8, 7*8, 6*8, 9*8, 8*8 },
201   8*10
202
203};
204
205static const gfx_layout mca_tilelayout =
206{
207/* this is only to see the GFX and find
208   a proper way to decode
209*/
210   8, 8,
211   0x8000,
212   1,      /* just for testing */
213   { 0 },
214   { 0, 1, 2, 3, 4, 5, 6, 7 },
215   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
216   8*8
217};
218
219
220/******************************
221* Graphics Decode Information *
222******************************/
223
224static GFXDECODE_START( magicard )
225   GFXDECODE_ENTRY( "main", 0x21562, mca_charlayout,  0, 32 )
226   GFXDECODE_ENTRY( "main", 0x16470, mca_tilelayout,  0, 32 )
227//  GFXDECODE_ENTRY( "main", 0x22efa, mca_tilelayout,  0, 32 )
228GFXDECODE_END
229
230static GFXDECODE_START( magicrda )
231   GFXDECODE_ENTRY( "main", 0x21562 + 0x792, mca_charlayout,  0, 32 )
232   GFXDECODE_ENTRY( "main", 0x16470, mca_tilelayout,  0, 32 )
233//  GFXDECODE_ENTRY( "main", 0x22efa, mca_tilelayout,  0, 32 )
234GFXDECODE_END
235
236
237/*************************
238*    Machine Drivers     *
239*************************/
240
241#if 0
242/*Probably there's a mask somewhere if it REALLY uses irqs at all...irq vectors dynamically changes after some time.*/
243static INTERRUPT_GEN( magicard_irq )
244{
245   if(input_code_pressed(KEYCODE_Z))
246      cpu_set_input_line(device->machine->cpu[0], 1, HOLD_LINE);
247}
248#endif
249
250static MACHINE_DRIVER_START( magicard )
251   MDRV_CPU_ADD("main", M68000, CLOCK_A/2)   /* SCC-68070 CCA84 datasheet */
252   MDRV_CPU_PROGRAM_MAP(magicard_mem,0)
253//  MDRV_CPU_VBLANK_INT("main", magicard_irq) /* no interrupts? (it erases the vectors..) */
254
255   MDRV_SCREEN_ADD("main", RASTER)
256   MDRV_SCREEN_REFRESH_RATE(60)
257   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
258   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
259   MDRV_SCREEN_SIZE(400, 300)
260   MDRV_SCREEN_VISIBLE_AREA(0, 400-1, 0, 300-1)
261   MDRV_PALETTE_INIT(magicard)
262
263   MDRV_PALETTE_LENGTH(0x20000/2)
264   MDRV_GFXDECODE(magicard)
265
266   MDRV_VIDEO_START(magicard)
267   MDRV_VIDEO_UPDATE(magicard)
268
269   MDRV_MACHINE_RESET(magicard)
270
271MACHINE_DRIVER_END
272
273static MACHINE_DRIVER_START( magicrda )
274   MDRV_IMPORT_FROM(magicard)
275   MDRV_CPU_MODIFY("main")
276
277   MDRV_GFXDECODE(magicrda)
278
279MACHINE_DRIVER_END
280
281
282/*************************
283*        Rom Load        *
284*************************/
285
286ROM_START( magicard )
287   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code & GFX */
288   ROM_LOAD16_WORD_SWAP( "magicorg.bin", 0x000000, 0x80000, CRC(810edf9f) SHA1(0f1638a789a4be7413aa019b4e198353ba9c12d9) )
289
290//  ROM_REGION( 0x400, "boot_prg", 0 )
291//  ROM_COPY( "main", 0x00000, 0x00000, 0x400)
292
293   ROM_REGION( 0x0100, "proms", 0 ) /* Color PROM?? */
294   ROM_LOAD16_WORD_SWAP("mgorigee.bin",   0x0000,   0x0100, CRC(73522889) SHA1(3e10d6c1585c3a63cff717a0b950528d5373c781) )
295ROM_END
296
297ROM_START( magicrda )
298   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code & GFX */
299   ROM_LOAD16_WORD_SWAP( "mcorigg2.bin", 0x00000, 0x20000, CRC(48546aa9) SHA1(23099a5e4c9f2c3386496f6d7f5bb7d435a6fb16) )
300   ROM_LOAD16_WORD_SWAP( "mcorigg1.bin", 0x20000, 0x20000, CRC(c9e4a38d) SHA1(812e5826b27c7ad98142a0f52fbdb6b61a2e31d7) )
301
302//  ROM_REGION( 0x400, "boot_prg", 0 )
303//  ROM_COPY( "main", 0x00000, 0x00000, 0x400)
304
305   ROM_REGION( 0x0100, "proms", 0 ) /* Color PROM?? */
306   ROM_LOAD("mgorigee.bin",   0x0000,   0x0100, CRC(73522889) SHA1(3e10d6c1585c3a63cff717a0b950528d5373c781) )
307ROM_END
308
309
310/*************************
311*      Game Drivers      *
312*************************/
313
314static DRIVER_INIT( magicard )
315{
316   UINT16 *src    = (UINT16*)memory_region( machine, "main" );
317   UINT16 *dst    = magicram;
318   memcpy (dst, src, 0x20000);
319}
320
321/*    YEAR  NAME      PARENT MACHINE   INPUT  INIT  ROT    COMPANY   FULLNAME             FLAGS... */
322
323GAME( 199?, magicard, 0,     magicard, 0,     magicard,    ROT0, "Impera", "Magic Card (set 1)", GAME_NO_SOUND | GAME_NOT_WORKING )
324GAME( 199?, magicrda, 0,     magicrda, 0,     magicard,    ROT0, "Impera", "Magic Card (set 2)", GAME_NO_SOUND | GAME_NOT_WORKING )
src/mame/drivers/murogem.c
r4057r4058
192192   return 0;
193193}
194194
195static const mc6845_interface mc6845_intf =
196{
197   "main",      /* screen we are acting on */
198   8,         /* number of pixels per video memory address */
199   NULL,      /* before pixel update callback */
200   NULL,      /* row update callback */
201   NULL,      /* after pixel update callback */
202   NULL,      /* callback for display state changes */
203   NULL,      /* HSYNC callback */
204   NULL      /* VSYNC callback */
205};
195206
207
196208static MACHINE_DRIVER_START( murogem )
197209   /* basic machine hardware */
198210   MDRV_CPU_ADD("main", M6802,8000000)       /* ? MHz */
r4057r4058
213225   MDRV_PALETTE_INIT(murogem)
214226   MDRV_VIDEO_UPDATE(murogem)
215227
216   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
228   MDRV_MC6845_ADD("crtc", MC6845, 750000, mc6845_intf) /* ? MHz */
217229MACHINE_DRIVER_END
218230
219231
src/mame/drivers/ddragon3.c
r4057r4058
592592   /* An interrupt is generated every 16 scanlines */
593593   if (scanline % 16 == 0)
594594   {
595      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
595      if (scanline > 0)
596         video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
596597      cpu_set_input_line(timer->machine->cpu[0], 5, ASSERT_LINE);
597598   }
598599
r4057r4058
602603      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
603604      cpu_set_input_line(timer->machine->cpu[0], 6, ASSERT_LINE);
604605   }
605
606   /* Adjust for next scanline */
607   if (++scanline >= video_screen_get_height(timer->machine->primary_screen))
608   {
609      scanline = 0;
610   }
611606}
612607
613608/*************************************
r4057r4058
754749   ROM_LOAD( "30a13-0.ic43",   0x00000, 0x10000, CRC(1e974d9b) SHA1(8e54ff747efe587a2e971c15e729445c4e232f0f) )
755750
756751   ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE )   /* Background */
757   ROM_LOAD( "14.ic45",   0x000000, 0x20000, CRC(b036a27b) SHA1(c13589c3882bb86f14a3b0143f2d9a4474350ddd) )
758   ROM_LOAD( "15.ic46",   0x020000, 0x20000, CRC(24d0bf41) SHA1(2e9c26c8078d17323af6ba378c7ceaed9045d3f7) )
759   ROM_LOAD( "30.ic13",   0x040000, 0x20000, CRC(72fe2b16) SHA1(92f02381c0216cf5cfede6813e4dcb814a040091) )
760   ROM_LOAD( "31.ic14",   0x060000, 0x20000, CRC(ab48a0c8) SHA1(b908f601a621697ad3b5067d26b6fb1713c4af39) )
761   ROM_LOAD( "23.ic29",   0x080000, 0x20000, CRC(0768fedd) SHA1(757c4378f53b4b8cc024b4c5a74d19ab653e886e) )
762   ROM_LOAD( "24.ic30",   0x0a0000, 0x20000, CRC(ec9db18a) SHA1(7e4085ba4c0e20ec00f392a2bf9cdb81be53b97f) )
763   ROM_LOAD( "21.ic25",   0x0c0000, 0x20000, CRC(902744b9) SHA1(eea623ce013bc270b1611982dd2f9388b205dbb3) )
764   ROM_LOAD( "22.ic26",   0x0e0000, 0x20000, CRC(5b142d4d) SHA1(88e22e102efa35449c0d9f6139eb0718528a9d72) )
752   ROM_LOAD( "14.ic45",      0x000000, 0x20000, CRC(b036a27b) SHA1(c13589c3882bb86f14a3b0143f2d9a4474350ddd) )
753   ROM_LOAD( "15.ic46",      0x020000, 0x20000, CRC(24d0bf41) SHA1(2e9c26c8078d17323af6ba378c7ceaed9045d3f7) )
754   ROM_LOAD( "30.ic13",      0x040000, 0x20000, CRC(72fe2b16) SHA1(92f02381c0216cf5cfede6813e4dcb814a040091) )
755   ROM_LOAD( "31.ic14",      0x060000, 0x20000, CRC(ab48a0c8) SHA1(b908f601a621697ad3b5067d26b6fb1713c4af39) )
756   ROM_LOAD( "23.ic29",      0x080000, 0x20000, CRC(0768fedd) SHA1(757c4378f53b4b8cc024b4c5a74d19ab653e886e) )
757   ROM_LOAD( "24.ic30",      0x0a0000, 0x20000, CRC(ec9db18a) SHA1(7e4085ba4c0e20ec00f392a2bf9cdb81be53b97f) )
758   ROM_LOAD( "21.ic25",      0x0c0000, 0x20000, CRC(902744b9) SHA1(eea623ce013bc270b1611982dd2f9388b205dbb3) )
759   ROM_LOAD( "22.ic26",      0x0e0000, 0x20000, CRC(5b142d4d) SHA1(88e22e102efa35449c0d9f6139eb0718528a9d72) )
765760
766   ROM_REGION( 0x480000, "gfx2", ROMREGION_DISPOSE )   /* Sprites */
767   ROM_LOAD( "9.ic39",    0x000000, 0x20000, CRC(726c49b7) SHA1(dbafad47bb6b717c409fdc5d81c413f1282f2bbb) )
768   ROM_LOAD( "10.ic40",   0x020000, 0x20000, CRC(37a1c335) SHA1(de70ba51788b601591c3aff71cb94aae349b272d) )
769   ROM_LOAD( "11.ic41",   0x040000, 0x20000, CRC(2bcfe63c) SHA1(678ef0e7cc38e4df1e1d1e3f5cba6601aa520ec6) )
770   ROM_LOAD( "12.ic42",   0x060000, 0x20000, CRC(b864cf17) SHA1(39a5155f40ba500bf201acca6f7d230cb0ea8309) )
771   ROM_COPY( "gfx2",  0x400000, 0x080000, 0x10000 )
772   ROM_LOAD( "4.ic33",    0x100000, 0x20000, CRC(8c71eb06) SHA1(e47acf9e2d5eeec0cff9654210a43c690a45d447) )
773   ROM_LOAD( "5.ic34",    0x120000, 0x20000, CRC(3e134be9) SHA1(0a75b56353bed2743f7ce8f3f74379fc9f0d3cb9) )
774   ROM_LOAD( "6.ic35",    0x140000, 0x20000, CRC(b4115ef0) SHA1(d90943f75051c7590a0effcc30fa813890c9ad11) )
775   ROM_LOAD( "7.ic36",    0x160000, 0x20000, CRC(4639333d) SHA1(8e3c982d6fa38cbec42e8de780f165547b5b0271) )
776   ROM_COPY( "gfx2",  0x420000, 0x180000, 0x10000 )
777   ROM_LOAD( "16.ic19",   0x200000, 0x20000, CRC(04420cc8) SHA1(ed148c52374bbd0d29c12070ea1499333fc04449) )
778   ROM_LOAD( "17.ic20",   0x220000, 0x20000, CRC(33f97b2f) SHA1(40dc5357caa17ed6673588422332966ee97752b7) )
779   ROM_LOAD( "18.ic21",   0x240000, 0x20000, CRC(0f9a8f2a) SHA1(d7e46d32067d3f8b3bacbf96ea313645a9a48410) )
780   ROM_LOAD( "19.ic22",   0x260000, 0x20000, CRC(15c91772) SHA1(8578b6c501e3af64863bd6b28ef59c6884dfe028) )
781   ROM_COPY( "gfx2",  0x440000, 0x280000, 0x10000 )
782   ROM_LOAD( "25.ic3",    0x300000, 0x20000, CRC(894734b3) SHA1(46fa174a303e85f439254976252835626c4b2ddc) )
783   ROM_LOAD( "26.ic4",    0x320000, 0x20000, CRC(cd504584) SHA1(674481b524853dbfcb7d173d58250b1be8464313) )
784   ROM_LOAD( "27.ic5",    0x340000, 0x20000, CRC(38e8a9ad) SHA1(1c66acde8f72fa7c6415a7aadc2dbf4300446c88) )
785   ROM_LOAD( "28.ic6",    0x360000, 0x20000, CRC(80c1cb74) SHA1(5558fa36b238cff1bee9df921e77d7de2062bf15) )
786   ROM_COPY( "gfx2",  0x460000, 0x380000, 0x10000 )
761   ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE )   /* Sprites */
762   ROM_LOAD( "9.ic39",       0x000000, 0x20000, CRC(726c49b7) SHA1(dbafad47bb6b717c409fdc5d81c413f1282f2bbb) )
763   ROM_LOAD( "10.ic40",      0x020000, 0x20000, CRC(37a1c335) SHA1(de70ba51788b601591c3aff71cb94aae349b272d) )
764   ROM_LOAD( "11.ic41",      0x040000, 0x20000, CRC(2bcfe63c) SHA1(678ef0e7cc38e4df1e1d1e3f5cba6601aa520ec6) )
765   ROM_LOAD( "12.ic42",      0x060000, 0x20000, CRC(b864cf17) SHA1(39a5155f40ba500bf201acca6f7d230cb0ea8309) )
766   ROM_LOAD( "30a12-0.ic43", 0x080000, 0x20000, CRC(91da004c) SHA1(d61c8545e622de6872ce1f1487dd0342fd81572c) )
787767
788   /* These ROMs are 128kB but only the lower 64kB is addressed */
789   ROM_LOAD( "30a12-0.ic43",  0x400000, 0x20000, CRC(91da004c) SHA1(d61c8545e622de6872ce1f1487dd0342fd81572c) )
790   ROM_LOAD( "30a11-0.ic37",  0x420000, 0x20000, CRC(5f419232) SHA1(86a883d7f0dfdfcc34c90e54f0b65b23b5822c16) )
791   ROM_LOAD( "30a10-0.ic23",  0x440000, 0x20000, CRC(12f641ba) SHA1(1e197a584bcc0b2f3b97e1a8ec61864b279ab951) )
792   ROM_LOAD( "30a9-0.ic7",    0x460000, 0x20000, CRC(9199a77b) SHA1(35b9a2a707ffd7dd2cfc2bea0c78f02f3639d1bd) )
768   ROM_LOAD( "4.ic33",       0x100000, 0x20000, CRC(8c71eb06) SHA1(e47acf9e2d5eeec0cff9654210a43c690a45d447) )
769   ROM_LOAD( "5.ic34",       0x120000, 0x20000, CRC(3e134be9) SHA1(0a75b56353bed2743f7ce8f3f74379fc9f0d3cb9) )
770   ROM_LOAD( "6.ic35",       0x140000, 0x20000, CRC(b4115ef0) SHA1(d90943f75051c7590a0effcc30fa813890c9ad11) )
771   ROM_LOAD( "7.ic36",       0x160000, 0x20000, CRC(4639333d) SHA1(8e3c982d6fa38cbec42e8de780f165547b5b0271) )
772   ROM_LOAD( "30a11-0.ic37", 0x180000, 0x20000, CRC(5f419232) SHA1(86a883d7f0dfdfcc34c90e54f0b65b23b5822c16) )
793773
774   ROM_LOAD( "16.ic19",      0x200000, 0x20000, CRC(04420cc8) SHA1(ed148c52374bbd0d29c12070ea1499333fc04449) )
775   ROM_LOAD( "17.ic20",      0x220000, 0x20000, CRC(33f97b2f) SHA1(40dc5357caa17ed6673588422332966ee97752b7) )
776   ROM_LOAD( "18.ic21",      0x240000, 0x20000, CRC(0f9a8f2a) SHA1(d7e46d32067d3f8b3bacbf96ea313645a9a48410) )
777   ROM_LOAD( "19.ic22",      0x260000, 0x20000, CRC(15c91772) SHA1(8578b6c501e3af64863bd6b28ef59c6884dfe028) )
778   ROM_LOAD( "30a10-0.ic23", 0x280000, 0x20000, CRC(12f641ba) SHA1(1e197a584bcc0b2f3b97e1a8ec61864b279ab951) )
779
780   ROM_LOAD( "25.ic3",       0x300000, 0x20000, CRC(894734b3) SHA1(46fa174a303e85f439254976252835626c4b2ddc) )
781   ROM_LOAD( "26.ic4",       0x320000, 0x20000, CRC(cd504584) SHA1(674481b524853dbfcb7d173d58250b1be8464313) )
782   ROM_LOAD( "27.ic5",       0x340000, 0x20000, CRC(38e8a9ad) SHA1(1c66acde8f72fa7c6415a7aadc2dbf4300446c88) )
783   ROM_LOAD( "28.ic6",       0x360000, 0x20000, CRC(80c1cb74) SHA1(5558fa36b238cff1bee9df921e77d7de2062bf15) )
784   ROM_LOAD( "30a9-0.ic7",   0x380000, 0x20000, CRC(9199a77b) SHA1(35b9a2a707ffd7dd2cfc2bea0c78f02f3639d1bd) )
785
794786   ROM_REGION( 0x080000, "oki", 0 )   /* ADPCM Samples */
795787   ROM_LOAD( "2.ic73",   0x000000, 0x40000, CRC(3af21dbe) SHA1(295d0b7f33c55ef37a71382a22edd8fc97fa5353) )
796788   ROM_LOAD( "3.ic74",   0x040000, 0x40000, CRC(c28b53cd) SHA1(93d29669ec899fd5852f61b1d91d0a90cc30e192) )
src/mame/drivers/coolpool.c
r4057r4058
924924   ROM_LOAD( "u53",          0x80000, 0x80000, CRC(d401805d) SHA1(f4bcb2bdc45c3bc5ca423e518cdea8b3a7e8d60e) )
925925ROM_END
926926
927/* If you use the roms from the other set this will boot as 9 Ball Shootout Championship, it looks however like the TMS32026 data
928   should differ at least (the correct data in the bad dump is very different to the other dumps) */
929ROM_START( 9ballshc )
930   ROM_REGION16_LE( 0x80000, "user1", 0 )   /* 34010 code */
931   ROM_LOAD16_BYTE( "escape.112",  0x00000, 0x40000, CRC(7ba2749a) SHA1(e2ddc2600234dbebbb423f201cc4061fd0b9911a) )
932   ROM_LOAD16_BYTE( "escape.113",  0x00001, 0x40000, CRC(1e0f3c62) SHA1(3c24a38dcb553fd84b0b44a5a8d93a14435e22b0) )
927933
934   ROM_REGION16_LE( 0x100000, "gfx1", 0 )   /* gfx data read by main CPU */
935   ROM_LOAD16_BYTE( "escape.110",  0x00000, 0x80000, BAD_DUMP CRC(1da8da18) SHA1(63455a7cccb21dc5afeb860e17527cd443f542eb) ) // xx1xxxxxxxxxxxxxxxx = 0x00
936   ROM_LOAD16_BYTE( "escape.111",  0x00001, 0x80000, BAD_DUMP CRC(65dea5e8) SHA1(291232dd19240b150e54a4ed300bcfd40bf5d1f2) ) // xx1xxxxxxxxxxxxxxxx = 0x00
928937
938   ROM_REGION( 0x40000, "dsp", 0 )   /* TMS320C26 */
939   ROM_LOAD16_BYTE( "u34",          0x00000, 0x08000, CRC(dc1df70b) SHA1(e42fa7e34e50e0bd2aaeea5c55d750ed3286610d) )
940   ROM_LOAD16_BYTE( "u35",          0x00001, 0x08000, CRC(ac999431) SHA1(7e4c2dcaedcb7e7c67072a179e4b8488d2bbdac7) )
941
942   ROM_REGION( 0x100000, "user2", 0 )   /* TMS32026 data */
943   ROM_LOAD( "escape.54",          0x00000, 0x80000, BAD_DUMP CRC(28b4dec6) SHA1(10e47105abb48b572da38709128cba961299d88e) ) // xx1xxxxxxxxxxxxxxxx = 0x00
944   ROM_LOAD( "escape.53",          0x80000, 0x80000, CRC(28f4dd51) SHA1(67ea5bf3dacc17ef4fcc999e4ae0857759fac838) )
945ROM_END
946
947
948
949
929950/*************************************
930951 *
931952 *  Driver init
r4057r4058
9931014GAME( 1993, 9ballsht, 0,        9ballsht, 9ballsht, 9ballsht, ROT0, "E-Scape EnterMedia (Bundra license)", "9-Ball Shootout (set 1)", 0 )
9941015GAME( 1993, 9ballsh2, 9ballsht, 9ballsht, 9ballsht, 9ballsht, ROT0, "E-Scape EnterMedia (Bundra license)", "9-Ball Shootout (set 2)", 0 )
9951016GAME( 1993, 9ballsh3, 9ballsht, 9ballsht, 9ballsht, 9ballsht, ROT0, "E-Scape EnterMedia (Bundra license)", "9-Ball Shootout (set 3)", 0 )
1017GAME( 1993, 9ballshc, 9ballsht, 9ballsht, 9ballsht, 9ballsht, ROT0, "E-Scape EnterMedia (Bundra license)", "9-Ball Shootout Championship", GAME_NOT_WORKING )
src/mame/drivers/carpolo.c
r4057r4058
323323      ROM[i] ^= 0x0f;
324324}
325325
326GAME( 1977, carpolo, 0, carpolo, carpolo, carpolo, ROT0, "Exidy", "Car Polo", GAME_NO_SOUND)
326GAME( 1977, carpolo, 0, carpolo, carpolo, carpolo, ROT0, "Exidy", "Car Polo", GAME_SUPPORTS_SAVE | GAME_NO_SOUND )
src/mame/drivers/seta2.c
r4057r4058
18261826   MDRV_SCREEN_VISIBLE_AREA(0x40, 0x1c0-1, 0x80, 0x170-1)
18271827
18281828   MDRV_GFXDECODE(seta2)
1829   MDRV_PALETTE_LENGTH(0x8000)
1829   MDRV_PALETTE_LENGTH(0x8000+0xf0)   /* extra 0xf0 because we might draw 256-color object with 16-color granularity */
18301830
18311831   MDRV_VIDEO_START(seta2)
18321832   MDRV_VIDEO_UPDATE(seta2)
src/mame/drivers/namcofl.c
r4057r4058
448448
449449   ROM_REGION( 0x400000, "c352", 0 ) // Samples
450450   ROM_LOAD("se1_voi.23s",   0x000000, 0x400000, CRC(b95e2ffb) SHA1(7669232d772caa9afa4c7593d018e8b6e534114a) )
451
452    ROM_REGION( 0x000005, "pals", 0) /* PAL's */
453    ROM_LOAD( "sysfl-1.bin",  0x000000, 0x000001, NO_DUMP ) /* PAL16L8BCN at 2S */
454    ROM_LOAD( "sysfl-2.bin",  0x000000, 0x000001, NO_DUMP ) /* PAL16L8BCN at 3L */
455    ROM_LOAD( "sysfl-3.bin",  0x000000, 0x000001, NO_DUMP ) /* PALCE16V8H-15PC/4 at 12S */
456    ROM_LOAD( "sysfl-4.bin",  0x000000, 0x000001, NO_DUMP ) /* PAL20L8BCNS at 20N */
457    ROM_LOAD( "sysfl-5.bin",  0x000000, 0x000001, NO_DUMP ) /* PALCE16V8H-15PC/4 at 19D */
451458ROM_END
452459
453460ROM_START( finalapb )
src/mame/drivers/luckgrln.c
r0r4058
1/*
2
3 Lucky Girl (newer 1991 version on different hardware?)
4  -- there is an early 'Lucky Girl' which appears to be running on Nichibutsu like hardware.
5
6 The program rom extracted from the Z180 also refers to this as Lucky 74..
7
8
9
10
11
12 Lucky Girl
13 Wing 1991
14
15 PCB labels
16
17 "DREW'S UNDER WARRANTY IF REMOVED N3357"
18 "No.A 120307 LICENSE WING SEAL"
19 "EAGLE No.A 120307"
20
21 ROMs
22
23 1C - EAGLE 1       27C010 equiv. mask ROM
24 1E - EAGLE 2       27C010 equiv. mask ROM
25 1H - EAGLE 3       27C010 equiv. mask ROM
26 1L - FALCON 4      27C010 equiv. mask ROM
27 1N - FALCON 5      27C010 equiv. mask ROM
28 1P - FALCON 6      27C010 equiv. mask ROM
29 1T - FALCON 13     27C010 EPROM
30
31 * ROMs 1-6 may need redumping, they could be half size.
32
33 RAMs
34
35 2x LH5186D-01L     28-pin PDIP     Video RAM and work RAM (battery backed)
36 2x CY7C128A-25PC   24-pin PDIP     Probably color RAM
37
38 Customs
39
40 2x 06B53P          28-pin PDIP     Unknown
41 1x 06B30P          40-pin PDIP     Unknown
42 1x 101810P         64-pin SDIP     Unknown
43 1x HG62E11B10P     64-pin SDIP     Hitachi gate array (custom)
44 1x CPU module      90-pin SDIP
45
46 Others
47
48 1x HD6845SP        40-pin PDIP     CRTC
49 1x MB3771           8-pin PDIP     Reset generator
50 1x Oki M62X428     18-pin PDIP     Real-time clock
51
52 CPU module
53
54 Text on label:
55
56 [2] 9015 1994.12
57     LUCKY GIRL DREW'S
58
59 Text underneath label
60
61 WE 300B 1H2
62
63 Looks like Hitachi part markings to me.
64
65 Other notes
66
67 Has some optocouplers, high voltage drivers, and what looks like additional
68 I/O conenctors.
69
70 Reset switch cuts power supply going to Video/Work RAM.
71
72
73*/
74
75
76#include "driver.h"
77#include "cpu/z180/z180.h"
78
79
80static ADDRESS_MAP_START( mainmap, ADDRESS_SPACE_PROGRAM, 8 )
81   AM_RANGE(0x00000, 0x03fff) AM_ROM
82   AM_RANGE(0x10000, 0x1ffff) AM_READ(SMH_BANK1)
83   AM_RANGE(0x0d800, 0x0dfff) AM_RAM
84   AM_RANGE(0x0f000, 0x0ffff) AM_RAM
85   AM_RANGE(0xf0000, 0xfffff) AM_RAM
86ADDRESS_MAP_END
87
88static ADDRESS_MAP_START( portmap, ADDRESS_SPACE_IO, 8 )
89   ADDRESS_MAP_GLOBAL_MASK(0xff) // i think
90   AM_RANGE( 0x0000, 0x003f ) AM_RAM // Z180 internal regs
91ADDRESS_MAP_END
92
93
94static INPUT_PORTS_START( luckgrln )
95INPUT_PORTS_END
96
97
98static const gfx_layout tiles8x8_layout =
99{
100   8,8,
101   RGN_FRAC(1,6),
102   6,
103   { RGN_FRAC(0,6),RGN_FRAC(1,6),RGN_FRAC(2,6),RGN_FRAC(3,6),RGN_FRAC(4,6),RGN_FRAC(5,6) },
104   { 0,1,2,3,4,5,6,7 },
105   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8},
106   8*8
107};
108static GFXDECODE_START( luckgrln )
109   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 )
110   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 16 )
111GFXDECODE_END
112
113static VIDEO_START(luckgrln)
114{
115
116}
117
118static VIDEO_UPDATE(luckgrln)
119{
120   return 0;
121}
122
123static MACHINE_DRIVER_START( luckgrln )
124   MDRV_CPU_ADD("main", Z180,8000000)
125   MDRV_CPU_PROGRAM_MAP(mainmap,0)
126   MDRV_CPU_IO_MAP(portmap,0)
127   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
128
129   MDRV_SCREEN_ADD("main", RASTER)
130   MDRV_SCREEN_REFRESH_RATE(60)
131   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
132   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
133   MDRV_SCREEN_SIZE(256, 256)
134   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 16, 256-16-1)
135
136   MDRV_GFXDECODE(luckgrln)
137   MDRV_PALETTE_LENGTH(0x100)
138
139   MDRV_VIDEO_START(luckgrln)
140   MDRV_VIDEO_UPDATE(luckgrln)
141MACHINE_DRIVER_END
142
143DRIVER_INIT( luckgrln )
144{
145   int i;
146   UINT8 x,v;
147   UINT8* rom = memory_region(machine,"user1");
148
149   for (i=0;i<0x20000;i++)
150   {
151      x = rom[i];
152      v = 0xfe + (i & 0xf)*0x3b + ((i >> 4) & 0xf)*0x9c + ((i >> 8) & 0xf)*0xe1 + ((i >> 12) & 0x7)*0x10;
153      v += ((((i >> 4) & 0xf) + ((i >> 2) & 3)) >> 2) * 0x50;
154      x ^= ~v;
155      x = (x << (i & 7)) | (x >> (8-(i & 7)));
156      rom[i] = x;
157   }
158
159   #if 0
160   {
161      FILE *fp;
162      char filename[256];
163      sprintf(filename,"decrypted_%s", machine->gamedrv->name);
164      fp=fopen(filename, "w+b");
165      if (fp)
166      {
167         fwrite(rom, 0x20000, 1, fp);
168         fclose(fp);
169      }
170   }
171   #endif
172
173   // ??
174   memory_set_bankptr(machine, 1,&rom[0x010000]);
175}
176
177ROM_START( luckgrln )
178   ROM_REGION( 0x4000, "main", 0 ) // internal Z180 rom
179   ROM_LOAD( "lucky74.bin",  0x00000, 0x4000, CRC(fa128e05) SHA1(97a9534b8414f984159271db48b153b0724d22f9) )
180
181   ROM_REGION( 0x20000, "user1", 0 ) // external data / cpu rom
182   ROM_LOAD( "falcon.13",  0x00000, 0x20000, CRC(f7a717fd) SHA1(49a39b84620876ee2faf73aaa405a1e17cab2da2) )
183
184   ROM_REGION( 0x60000, "gfx1", 0 )
185   ROM_LOAD( "eagle.1", 0x00000, 0x20000, CRC(37209082) SHA1(ffb30da5920886f37c6b97e03f5a8ec3b6265e68) )
186   ROM_LOAD( "eagle.2", 0x20000, 0x20000, CRC(bdb2d694) SHA1(3e58fe3f6b447181e3a85f0fc2a0c996231bc8e8) )
187   ROM_LOAD( "eagle.3", 0x40000, 0x20000, CRC(2c765389) SHA1(d5697c73cc939aa46f36c2dd87e90bba2536e347))
188
189   ROM_REGION( 0x60000, "gfx2", 0 ) // luckgrlns - 3bpp
190   ROM_LOAD( "falcon.4", 0x00000, 0x20000, CRC(369eaddf) SHA1(52387ea63e5c8fb0c27b796026152a06b68467af) )
191   ROM_LOAD( "falcon.5", 0x20000, 0x20000, CRC(c9ac1fe7) SHA1(fc027002754b90cc49ca74fac5240a99a194c0b3))
192   ROM_LOAD( "falcon.6", 0x40000, 0x20000, CRC(bfb02c87) SHA1(1b5ca562ed76eb3f1b4a52d379a6af07e79b6ee5))
193ROM_END
194
195GAME( 1991, luckgrln,  0,    luckgrln, luckgrln,  luckgrln, ROT0, "Wing", "Lucky Girl (newer Z180 based hardware)", GAME_NOT_WORKING|GAME_NO_SOUND )
196
src/mame/drivers/dynax.c
r4057r4058
47134713***************************************************************************/
47144714
47154715ROM_START( hanayara )
4716   ROM_REGION( 0x50000, "main", 0 )   // Z80 Code
4716   ROM_REGION( 0x10000 + 0x1d*0x8000, "main", 0 )   // Z80 Code
47174717   ROM_LOAD( "5501h.2d", 0x00000, 0x20000, CRC(124860b7) SHA1(205459d95f876433a9ca329fe31cfe9b08023baf) )
47184718   ROM_RELOAD(           0x10000, 0x20000 )
47194719   ROM_LOAD( "5502h.4d", 0x30000, 0x20000, CRC(93407801) SHA1(63dc3419f97d86221dbdd67b5be41d713364496b) )
src/mame/drivers/zn.c
r4057r4058
42754275
42764276   ROM_REGION32_LE( 0x1800000, "user2", 0 )
42774277   ROM_LOAD( "flash0.021",      0x0000000, 0x200000, CRC(fa7602e1) SHA1(6fb6af09656fbb86d2abda35804b2ed4a4cd7461) )
4278   ROM_LOAD( "flash1.024",      0x0200000, 0x200000, BAD_DUMP CRC(4866dce3) SHA1(484e659a8f0ca40b29d7f5e57788e8a9f6957cbc) )
4278   ROM_LOAD( "flash1.024",      0x0200000, 0x200000, CRC(59a2e367) SHA1(484fd5a4515a8391f1d2fa95ac681d9bcf52406d) )
42794279   ROM_LOAD( "rom-1a.028",      0x0800000, 0x400000, CRC(0e711461) SHA1(1d0bd80e6885432ef0623babde28e5760b714bfa) )
42804280   ROM_LOAD( "rom-1b.29",       0x0c00000, 0x400000, CRC(0cf153f9) SHA1(53bb9f8642079f56d8e925792b069362df666819) )
42814281   ROM_LOAD( "rom-2a.026",      0x1000000, 0x400000, CRC(b71d955d) SHA1(49fce452c70ceafc8a149fa9ff073589b7261882) )
r4057r4058
45534553/* A dummy driver, so that the bios can be debugged, and to serve as */
45544554/* parent for the coh-3002t.353 file, so that we do not have to include */
45554555/* it in every zip file */
4556GAME( 1997, taitogn,  0,        coh3002t, zn, coh3002t, ROT0, "Sony/Taito", "Taito GNET", 0 )
4556GAME( 1997, taitogn,  0,        coh3002t, zn, coh3002t, ROT0, "Sony/Taito", "Taito GNET", GAME_IS_BIOS_ROOT )
45574557
45584558/* Eighting/Raizing */
45594559
src/mame/drivers/balsente.c
r4057r4058
3939        * CEM3394 emulation is not perfect
4040        * Shrike Avenger doesn't work properly
4141
42    Other:
43        * Some of the cartridge types are unknown
44        * Do any of the remaining unknown cartridge types contain a PAL
45          that needs to be dumped?
46
4247****************************************************************************
4348
4449    Memory map
r4057r4058
12581263 *
12591264 *************************************/
12601265
1266#define MOTHERBOARD_PALS \
1267    ROM_REGION( 0x00001, "motherbrd_pals", 0) /* Motherboard PAL's */ \
1268    ROM_LOAD( "u01508001100b.u20f", 0x00000, 0x00001, NO_DUMP ) /* PAL16L8 */
1269
1270
12611271ROM_START( sentetst )
12621272   ROM_REGION( 0x40000, "main", 0 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
12631273   ROM_LOAD( "sdiagef.bin",  0x2e000, 0x2000, CRC(2a39fc53) SHA1(04ea68bfad455cc928e57390eba5597c38bbab69) )
r4057r4058
12671277
12681278   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
12691279   ROM_LOAD( "sdiaggr0.bin", 0x00000, 0x2000, CRC(5e0ff62a) SHA1(3f0ebebb2f58530af7fac57a4780dfb37ef1ee1d) )
1280
1281    MOTHERBOARD_PALS
12701282ROM_END
12711283
12721284
r4057r4058
12901302   ROM_LOAD( "cs-gr2.bin", 0x04000, 0x2000, CRC(1784f939) SHA1(ff7f43451580e3b314c24b00a66765c0b395ddf6) )
12911303   ROM_LOAD( "cs-gr3.bin", 0x06000, 0x2000, CRC(b43916a2) SHA1(8d42fb6ae7cf8b2d94eb0c14e00bb115f8ef01b4) )
12921304   ROM_LOAD( "cs-gr4.bin", 0x08000, 0x2000, CRC(a94cd35b) SHA1(0ca0497a1b055ff1ae6b7bc36ae45749dff50caa) )
1305
1306    MOTHERBOARD_PALS
12931307ROM_END
12941308
12951309
r4057r4058
13141328   ROM_LOAD( "ggh-gr3.bin", 0x06000, 0x2000, CRC(dd7e25d0) SHA1(cc6402835d1b46d160869ba1d1cad54f24d3fe86) )
13151329   ROM_LOAD( "ggh-gr4.bin", 0x08000, 0x2000, CRC(b4293435) SHA1(5e2b96c19c4f5c63a5afa2de504d29fe64a4c908) )
13161330   ROM_LOAD( "ggh-gr5.bin", 0x0a000, 0x2000, CRC(d3da0093) SHA1(7474901b089ea62abad0a2f657fd8c4a1be09bf0) )
1331
1332    MOTHERBOARD_PALS
13171333ROM_END
13181334
13191335
1336/*
1337    The Hat Trick cartridge does not have any PAL's.
1338*/
1339
13201340ROM_START( hattrick )
13211341   ROM_REGION( 0x40000, "main", 0 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
13221342   ROM_LOAD( "rom-ab0.u9a", 0x10000, 0x2000, CRC(f25c1b99) SHA1(43b2334be7cfb8091eea963e10547295362372d3) )
r4057r4058
13311351   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
13321352   ROM_LOAD( "rom-gr0.u9b", 0x00000, 0x2000, CRC(9f41baba) SHA1(fa817a8e4d2f7b86a2294132e3991f7b6d8cb11a) )
13331353   ROM_LOAD( "rom-gr1.u8b", 0x02000, 0x2000, CRC(951f08c9) SHA1(059a575dd35cd8e822e12ac2606b47b6272bbb41) )
1354
1355    MOTHERBOARD_PALS
13341356ROM_END
13351357
13361358
r4057r4058
13551377   ROM_LOAD( "otw-gr3.bin", 0x06000, 0x2000, CRC(6b17e4a9) SHA1(f9c57da863d613a456ee056569a87a9552ad3874) )
13561378   ROM_LOAD( "otw-gr4.bin", 0x08000, 0x2000, CRC(15985c8c) SHA1(94f21c348bfbe4db6d0cfa5b5e35d2df4b8f936d) )
13571379   ROM_LOAD( "otw-gr5.bin", 0x0a000, 0x2000, CRC(448f7e3c) SHA1(505724e90f17b05ccf0137dbed0d33e39db1d5ab) )
1380
1381    MOTHERBOARD_PALS
13581382ROM_END
13591383
13601384
r4057r4058
13791403   ROM_LOAD( "spit-gr3.bin", 0x06000, 0x2000, CRC(c6703ec2) SHA1(0f5d7c17ee508f8fea316b7f92cdd7cc174b155f) )
13801404   ROM_LOAD( "spit-gr4.bin", 0x08000, 0x2000, CRC(b4293435) SHA1(5e2b96c19c4f5c63a5afa2de504d29fe64a4c908) )
13811405   ROM_LOAD( "spit-gr5.bin", 0x0a000, 0x2000, CRC(dc27c970) SHA1(291ef10a8c330ef8e47622246b6301d2e5171df7) )
1406
1407    MOTHERBOARD_PALS
13821408ROM_END
13831409
13841410
r4057r4058
14031429   ROM_LOAD( "rom-gr3.u6b", 0x06000, 0x2000, CRC(b6602be8) SHA1(c5bc95e0116fb2cf86a694561dc2c21612ba4434) )
14041430   ROM_LOAD( "rom-gr4.u5b", 0x08000, 0x2000, CRC(3fbfa686) SHA1(6c137d177c7aa2701497ac3ac922fdb8cd9f52b3) )
14051431   ROM_LOAD( "rom-gr5.u4b", 0x0a000, 0x2000, CRC(345f94fb) SHA1(0af24f4e1a797efe5272f64b8a34483fe6002436) )
1432
1433    MOTHERBOARD_PALS
14061434ROM_END
14071435
14081436
r4057r4058
14231451   ROM_LOAD( "stkr-gr1.bin", 0x02000, 0x2000, CRC(4a5cc00b) SHA1(9ce46ed94e715a5997998aee6377baf2869ab3a6) )
14241452   ROM_LOAD( "stkr-gr2.bin", 0x04000, 0x2000, CRC(70002382) SHA1(c151ad3df2714a2f9f8b047894e7585ca16bd29e) )
14251453   ROM_LOAD( "stkr-gr3.bin", 0x06000, 0x2000, CRC(68c862d8) SHA1(302ce10e23d17af9aa7fa13d18c602656a262eaa) )
1454
1455    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1456    ROM_LOAD( "pal10l8.u1c", 0x0000, 0x0001, NO_DUMP ) /* PAL10L8CN */
1457
1458    MOTHERBOARD_PALS
14261459ROM_END
14271460
14281461
r4057r4058
14471480   ROM_LOAD( "tpg1-gr3.bin", 0x06000, 0x2000, CRC(323a8640) SHA1(7ec6f8f9bcfa5de442dce4f6e81e697da34dbab8) )
14481481   ROM_LOAD( "tpg1-gr4.bin", 0x08000, 0x2000, CRC(673acf42) SHA1(7b36a86441732ba14576f9c1dd14fe0da575d4bf) )
14491482   ROM_LOAD( "tpg1-gr5.bin", 0x0a000, 0x2000, CRC(067bfd66) SHA1(32f5973f2f0aed67c8f9b5886f52b9dc516a611e) )
1483
1484    MOTHERBOARD_PALS
14501485ROM_END
14511486
14521487ROM_START( trivia12 )
r4057r4058
14701505   ROM_LOAD( "gr3.u6b", 0x06000, 0x2000, CRC(323a8640) SHA1(7ec6f8f9bcfa5de442dce4f6e81e697da34dbab8) )
14711506   ROM_LOAD( "gr4.u5b", 0x08000, 0x2000, CRC(673acf42) SHA1(7b36a86441732ba14576f9c1dd14fe0da575d4bf) )
14721507   ROM_LOAD( "gr5.u4b", 0x0a000, 0x2000, CRC(d17d5431) SHA1(b92741f6eda01f2e360e73a9f4df728fc44d7e1b) )
1508
1509    MOTHERBOARD_PALS
14731510ROM_END
14741511
14751512
r4057r4058
14891526   ROM_LOAD( "gr01.bin",  0x00000, 0x4000, CRC(6829de8e) SHA1(4ec494883ba358f2ac7ce8d5a623a2f34b5bc843) )
14901527   ROM_LOAD( "gr23.bin",  0x04000, 0x4000, CRC(89398700) SHA1(771ee04baa9a31d435a6234490105878713e7845) )
14911528   ROM_LOAD( "gr45.bin",  0x08000, 0x4000, CRC(1e870293) SHA1(32149c9c8047854f2b2ad8844c4bd00a8ded588e) )
1529
1530    MOTHERBOARD_PALS
14921531ROM_END
14931532
14941533
r4057r4058
15081547   ROM_LOAD( "gr01.bin",    0x00000, 0x4000, CRC(6829de8e) SHA1(4ec494883ba358f2ac7ce8d5a623a2f34b5bc843) )
15091548   ROM_LOAD( "gr23.bin",    0x04000, 0x4000, CRC(89398700) SHA1(771ee04baa9a31d435a6234490105878713e7845) )
15101549   ROM_LOAD( "allsport.3b", 0x08000, 0x4000, CRC(7415a7fc) SHA1(93d832434f359ce7b02aef276c89456b16438979) )
1550
1551    MOTHERBOARD_PALS
15111552ROM_END
15121553
15131554
r4057r4058
15271568   ROM_LOAD( "gr01.bin", 0x00000, 0x4000, CRC(6829de8e) SHA1(4ec494883ba358f2ac7ce8d5a623a2f34b5bc843) )
15281569   ROM_LOAD( "gr23.bin", 0x04000, 0x4000, CRC(89398700) SHA1(771ee04baa9a31d435a6234490105878713e7845) )
15291570   ROM_LOAD( "gr45.bin", 0x08000, 0x4000, CRC(1242033e) SHA1(1a3fe186bb261e2c7d9fbbb2a3103b39bf029b35) )
1571
1572    MOTHERBOARD_PALS
15301573ROM_END
15311574
15321575
r4057r4058
15461589   ROM_LOAD( "gr01.bin", 0x00000, 0x4000, CRC(6829de8e) SHA1(4ec494883ba358f2ac7ce8d5a623a2f34b5bc843) )
15471590   ROM_LOAD( "gr23.bin", 0x04000, 0x4000, CRC(89398700) SHA1(771ee04baa9a31d435a6234490105878713e7845) )
15481591   ROM_LOAD( "gr45.bin", 0x08000, 0x4000, CRC(92fb6fb1) SHA1(1a322bd3cfacdf82d4fcc4b4d47f78a701411919) )
1592
1593    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1594    ROM_LOAD( "pal10l8.u1c", 0x0000, 0x0001, NO_DUMP ) /* PAL10L8CN */
1595
1596    MOTHERBOARD_PALS
15491597ROM_END
15501598
15511599ROM_START( triviaes )
r4057r4058
15661614   ROM_LOAD( "tp_gr3.bin", 0x00000, 0x4000, CRC(6829de8e) SHA1(4ec494883ba358f2ac7ce8d5a623a2f34b5bc843) )
15671615   ROM_LOAD( "tp_gr2.bin", 0x04000, 0x4000, CRC(89398700) SHA1(771ee04baa9a31d435a6234490105878713e7845) )
15681616   ROM_LOAD( "tp_gr1.bin", 0x08000, 0x4000, CRC(1242033e) SHA1(1a3fe186bb261e2c7d9fbbb2a3103b39bf029b35) )
1617
1618    MOTHERBOARD_PALS
15691619ROM_END
15701620
15711621
r4057r4058
15821632   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
15831633   ROM_LOAD( "gr01.u6b", 0x00000, 0x4000, CRC(e3cdc476) SHA1(2f17c3f84767850d45192dfb507dd2716ecadc20) )
15841634   ROM_LOAD( "gr23.u5b", 0x04000, 0x4000, CRC(0555d9c0) SHA1(da0d1f207ad056b2d82a5ad6382372066883d161) )
1635
1636    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1637    ROM_LOAD( "pal10l8.u1c", 0x0000, 0x0001, NO_DUMP ) /* PAL10L8CN */
1638
1639    MOTHERBOARD_PALS
15851640ROM_END
15861641
15871642
r4057r4058
16001655   ROM_LOAD( "gr01.u6b", 0x00000, 0x4000, CRC(8e24d594) SHA1(d35329fb78f90ec478418917aa1ef06d0967e6f8) )
16011656   ROM_LOAD( "gr23.u5b", 0x04000, 0x4000, CRC(3bf355ef) SHA1(691df25b35b00e21ad09d17a21fe98a353aa3dda) )
16021657   ROM_LOAD( "gr45.u4b", 0x08000, 0x4000, CRC(8eb14921) SHA1(fda8b8f8e801360310f7cb1aa4c6aea1fa0a4b25) )
1658
1659    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1660    ROM_LOAD( "pal10l8.u1c", 0x0000, 0x0001, NO_DUMP ) /* PAL10L8CN */
1661
1662    MOTHERBOARD_PALS
16031663ROM_END
16041664
16051665
r4057r4058
16191679   ROM_LOAD( "gr01.u6b", 0x00000, 0x4000, CRC(8e24d594) SHA1(d35329fb78f90ec478418917aa1ef06d0967e6f8) )
16201680   ROM_LOAD( "gr23.u5b", 0x04000, 0x4000, CRC(3bf355ef) SHA1(691df25b35b00e21ad09d17a21fe98a353aa3dda) )
16211681   ROM_LOAD( "gr45.u4b", 0x08000, 0x4000, CRC(8eb14921) SHA1(fda8b8f8e801360310f7cb1aa4c6aea1fa0a4b25) )
1682
1683    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1684    ROM_LOAD( "pal10l8.u1c", 0x0000, 0x0001, NO_DUMP ) /* PAL10L8CN */
1685
1686    MOTHERBOARD_PALS
16221687ROM_END
16231688
16241689
r4057r4058
16391704   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
16401705   ROM_LOAD( "tgle-gr0.bin", 0x00000, 0x2000, CRC(0e0e5d0e) SHA1(363858ce08767f8a9b8eaec56405377cdd74b178) )
16411706   ROM_LOAD( "tgle-gr1.bin", 0x02000, 0x2000, CRC(3b141ad2) SHA1(72430fd616adbc72d86a5f10672572a31bed0b5d) )
1707
1708    MOTHERBOARD_PALS
16421709ROM_END
16431710
16441711
r4057r4058
16661733
16671734   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
16681735   ROM_LOAD( "nttgr0.bin",  0x00000, 0x8000, CRC(6b75bb4b) SHA1(e7131d112fb0b36985c5b6383700f55728a1c4fd) )
1736
1737    MOTHERBOARD_PALS
16691738ROM_END
16701739
16711740
1741/*
1742    Night Stocker
1743
1744    This game utilizes the standard motherboard and sound board, but in addition it
1745    also uses a Gun Interface Board (Board: 006-8032-01-0B) and video interface? board.
1746*/
1747
16721748ROM_START( nstocker )
16731749   ROM_REGION( 0x40000, "main", 0 )     /* 64k for code for the first CPU, plus 128k of banked ROMs */
16741750   ROM_LOAD( "ab01.u8a",  0x10000, 0x4000, CRC(a635f973) SHA1(edb12469818a3114fb97d21e11c63eb37678a07b) )
r4057r4058
16881764   ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(35d4433e) SHA1(399d04c2a29d993f77d0d5c2d62915081d4a85dd) )
16891765   ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(734b858a) SHA1(71763789807021938b840a88af34aad7f4751298) )
16901766   ROM_LOAD( "gr67.u1c", 0x0c000, 0x4000, CRC(3311f9c0) SHA1(63b185c761b258113c31cc269ce0b1462bf37f40) )
1767
1768    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1769    ROM_LOAD( "pal16r8.u7c", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8 */
1770
1771    ROM_REGION( 0x00004, "gun_io_bd_pals", 0) /* Gun I/O Board PALs */
1772    ROM_LOAD( "pal16r8acn.u6", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8 */
1773    ROM_LOAD( "pal16r8acn.u7", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8 */
1774    ROM_LOAD( "pal16r8acn.u8", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8 */
1775    ROM_LOAD( "pal16r8acn.u9", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8 */
1776
1777    MOTHERBOARD_PALS
16911778ROM_END
16921779
16931780ROM_START( nstockr2 )
r4057r4058
17091796   ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(35d4433e) SHA1(399d04c2a29d993f77d0d5c2d62915081d4a85dd) )
17101797   ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(734b858a) SHA1(71763789807021938b840a88af34aad7f4751298) )
17111798   ROM_LOAD( "gr67.u1c", 0x0c000, 0x4000, CRC(3311f9c0) SHA1(63b185c761b258113c31cc269ce0b1462bf37f40) )
1799
1800    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1801    ROM_LOAD( "pal16r8.u7c", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8 */
1802
1803    ROM_REGION( 0x00004, "gun_io_bd_pals", 0) /* Gun I/O Board PALs */
1804    ROM_LOAD( "pal16r8acn.u6", 0x0000, 0x0001, NO_DUMP )
1805    ROM_LOAD( "pal16r8acn.u7", 0x0000, 0x0001, NO_DUMP )
1806    ROM_LOAD( "pal16r8acn.u8", 0x0000, 0x0001, NO_DUMP )
1807    ROM_LOAD( "pal16r8acn.u9", 0x0000, 0x0001, NO_DUMP )
1808
1809    MOTHERBOARD_PALS
17121810ROM_END
17131811
17141812
r4057r4058
17271825   ROM_LOAD( "sfbgr23.bin", 0x04000, 0x4000, CRC(5c5af726) SHA1(04cdd476e6689d17273659fb1fe0ca642edbe5a8) )
17281826   ROM_LOAD( "sfbgr45.bin", 0x08000, 0x4000, CRC(e767251e) SHA1(3c05295317a673fb1de5924f27de276d2846d805) )
17291827   ROM_LOAD( "sfbgr67.bin", 0x0c000, 0x4000, CRC(42452a7a) SHA1(37479d6e9071ac775215a6815dbaf280b3c6a57f) )
1828
1829    ROM_REGION( 0x00001, "cart_pals", 0) /* PAL's located on the cartridge */
1830    ROM_LOAD( "pal16r8.u7c", 0x0000, 0x0001, NO_DUMP ) /* PAL16R8ANC */
1831
1832    MOTHERBOARD_PALS
17301833ROM_END
17311834
17321835
r4057r4058
17431846   ROM_LOAD( "gr01.u4c", 0x00000, 0x4000, CRC(0caa6e3e) SHA1(ce6765d44e444d24129ec99f04a41a866a32eee2) )
17441847   ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(970c81f6) SHA1(f22189e172a795d115597feb48ccbc04be3859b9) )
17451848   ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(90ddd737) SHA1(8e1dde2f42e9bf755dedeef218745d1fc54faac7) )
1849
1850    MOTHERBOARD_PALS
17461851ROM_END
17471852
17481853
r4057r4058
17631868   ROM_LOAD( "gr23.u3c", 0x04000, 0x4000, CRC(761abb80) SHA1(a1278e93a4fa66cc4d347954dd45121120da568d) )
17641869   ROM_LOAD( "gr45.u2c", 0x08000, 0x4000, CRC(0d2cf2e6) SHA1(beccb1342127e79a845c4b6b20f20052097ebb98) )
17651870   ROM_LOAD( "gr67.u2c", 0x0c000, 0x4000, CRC(2bab2784) SHA1(a4020fd8f5ca2fdb37efd37cbccf86cae0468eb0) )
1871
1872    MOTHERBOARD_PALS
17661873ROM_END
17671874
17681875
r4057r4058
17791886   ROM_REGION( 0x10000, "gfx1", 0 )      /* up to 64k of sprites */
17801887   ROM_LOAD( "gr0.a5",    0x00000, 0x8000, CRC(e0dfc133) SHA1(0b120b4410098d8db26b5819043d4fe7c426b948) )
17811888   ROM_LOAD( "gr4.a7",    0x08000, 0x8000, CRC(952ade30) SHA1(f065368f645616d6d84be469ba45a9afa8788eda) )
1889
1890    MOTHERBOARD_PALS
17821891ROM_END
17831892
17841893
r4057r4058
18101919
18111920   ROM_REGION( 0x8000, "gfx1", 0 )      /* up to 64k of sprites */
18121921   ROM_LOAD( "grudge.gr0", 0x00000, 0x8000, CRC(b9681f53) SHA1(bb0c516408f1769e018f0ec8707786d4d1e9ef7e) )
1922
1923    MOTHERBOARD_PALS
18131924ROM_END
18141925
18151926
r4057r4058
20092120 *
20102121 *************************************/
20112122
2123/* Board: Unknown */
20122124GAME( 1984, sentetst, 0,        balsente, sentetst, sentetst, ROT0, "Bally/Sente",  "Sente Diagnostic Cartridge", GAME_SUPPORTS_SAVE )
20132125GAME( 1984, cshift,   0,        balsente, cshift,   cshift,   ROT0, "Bally/Sente",  "Chicken Shift", GAME_SUPPORTS_SAVE )
20142126GAME( 1984, gghost,   0,        balsente, gghost,   gghost,   ROT0, "Bally/Sente",  "Goalie Ghost", GAME_SUPPORTS_SAVE )
2127
2128/* Board: 006-8003-01-0D Rev D */
20152129GAME( 1984, hattrick, 0,        balsente, hattrick, hattrick, ROT0, "Bally/Sente",  "Hat Trick", GAME_SUPPORTS_SAVE )
2130
2131/* Board: Unknown */
20162132GAME( 1984, otwalls,  0,        balsente, otwalls,  otwalls,  ROT0, "Bally/Sente",  "Off the Wall (Sente)", GAME_SUPPORTS_SAVE )
20172133GAME( 1984, snakepit, 0,        balsente, sentetst, snakepit, ROT0, "Bally/Sente",  "Snake Pit", GAME_SUPPORTS_SAVE )
20182134GAME( 1984, snakjack, 0,        balsente, snakjack, snakjack, ROT0, "Bally/Sente",  "Snacks'n Jaxson", GAME_SUPPORTS_SAVE )
2135
2136/* Board: 006-8025-01-0B Rev B */
20192137GAME( 1984, stocker,  0,        balsente, stocker,  stocker,  ROT0, "Bally/Sente",  "Stocker", GAME_SUPPORTS_SAVE )
2138GAME( 1985, gimeabrk, 0,        balsente, gimeabrk, gimeabrk, ROT0, "Bally/Sente",  "Gimme A Break", GAME_SUPPORTS_SAVE )
2139GAME( 1985, minigolf, 0,        balsente, minigolf, minigolf, ROT0, "Bally/Sente",  "Mini Golf (set 1)", GAME_SUPPORTS_SAVE )
2140GAME( 1985, minigol2, minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente",  "Mini Golf (set 2)", GAME_SUPPORTS_SAVE )
2141
2142/* Board: Unknown (Baby Boomer Edition uses 006-8025-01-0B Rev B board.  Do the rest use it too? */
20202143GAME( 1984, triviag1, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente",  "Trivial Pursuit (Genus I) (set 1)", GAME_SUPPORTS_SAVE )
20212144GAME( 1984, trivia12, 0,        balsente, triviag1, triviag1, ROT0, "Bally/Sente",  "Trivial Pursuit (Genus I) (set 2)", GAME_SUPPORTS_SAVE )
20222145GAME( 1984, triviag2, 0,        balsente, triviag1, triviag2, ROT0, "Bally/Sente",  "Trivial Pursuit (Genus II)", GAME_SUPPORTS_SAVE )
r4057r4058
20242147GAME( 1984, triviayp, 0,        balsente, triviag1, triviag2, ROT0, "Bally/Sente",  "Trivial Pursuit (Young Players Edition)", GAME_SUPPORTS_SAVE )
20252148GAME( 1984, triviabb, 0,        balsente, triviag1, triviag2, ROT0, "Bally/Sente",  "Trivial Pursuit (Baby Boomer Edition)", GAME_SUPPORTS_SAVE )
20262149GAME( 1987, triviaes, 0,        balsente, triviaes, triviaes, ROT0, "Bally/Sente",  "Trivial Pursuit (Spanish Edition)", GAME_SUPPORTS_SAVE )
2027GAME( 1985, gimeabrk, 0,        balsente, gimeabrk, gimeabrk, ROT0, "Bally/Sente",  "Gimme A Break", GAME_SUPPORTS_SAVE )
2028GAME( 1985, minigolf, 0,        balsente, minigolf, minigolf, ROT0, "Bally/Sente",  "Mini Golf (set 1)", GAME_SUPPORTS_SAVE )
2029GAME( 1985, minigol2, minigolf, balsente, minigol2, minigol2, ROT0, "Bally/Sente",  "Mini Golf (set 2)", GAME_SUPPORTS_SAVE )
20302150GAME( 1985, toggle,   0,        balsente, toggle,   toggle,   ROT0, "Bally/Sente",  "Toggle (prototype)", GAME_SUPPORTS_SAVE )
20312151GAME( 1986, nametune, 0,        balsente, nametune, nametune, ROT0, "Bally/Sente",  "Name That Tune", GAME_SUPPORTS_SAVE )
2152
2153/* Board: 006-8027-01-0B Rev B */
20322154GAME( 1986, nstocker, 0,        balsente, nstocker, nstocker, ROT0, "Bally/Sente",  "Night Stocker (set 1)", GAME_SUPPORTS_SAVE )
20332155GAME( 1986, nstockr2, nstocker, balsente, nstocker, nstocker, ROT0, "Bally/Sente",  "Night Stocker (set 2)", GAME_SUPPORTS_SAVE )
20342156GAME( 1986, sfootbal, 0,        balsente, sfootbal, sfootbal, ROT0, "Bally/Sente",  "Street Football", GAME_SUPPORTS_SAVE )
2157
2158/* Board: Unknown */
20352159GAME( 1986, spiker,   0,        balsente, spiker,   spiker,   ROT0, "Bally/Sente",  "Spiker", GAME_SUPPORTS_SAVE )
20362160GAME( 1986, stompin,  0,        balsente, stompin,  stompin,  ROT0, "Bally/Sente",  "Stompin'", GAME_SUPPORTS_SAVE )
20372161GAME( 1987, rescraid, 0,        balsente, rescraid, rescraid, ROT0, "Bally/Midway", "Rescue Raider", GAME_SUPPORTS_SAVE )
src/mame/drivers/malzak.c
r4057r4058
171171//  Bits 1-3 are all set high upon death, until the game continues
172172//  Bit 6 is used only in Malzak II, and is set high after checking
173173//        the selected version
174//  logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n",cpu_get_physical_pc_byte(space->machine->cpu[0]),data);
174//  logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n",cpu_get_pc(space->machine->cpu[0]),data);
175175   if(data & 0x40)
176176      malzak_bank1 = 1;
177177   else
src/mame/drivers/drw80pkr.c
r4057r4058
3232
3333static tilemap *bg_tilemap;
3434
35static UINT8 p1, p2, p4, bus;
35static UINT8 p1, p2, prog, bus;
3636
3737static UINT8 *pkr_cmos_ram;
3838
r4057r4058
5151   p2 = data;
5252}
5353
54static WRITE8_HANDLER( p4_w )
54static WRITE8_HANDLER( prog_w )
5555{
56   p4 = data;
56   /* this is written via an out to port 4, but unless there is an 8243 port expander,
57       it is more likely that the port 4 output is used to toggle the PROG line; see
58       videopkr */
59   prog = data;
5760}
5861
5962static WRITE8_HANDLER( bus_w )
r4057r4058
199202
200203static ADDRESS_MAP_START( drw80pkr_io_map, ADDRESS_SPACE_IO, 8 )
201204   AM_RANGE(0x00, 0xff) AM_READWRITE(drw80pkr_cmos_r, drw80pkr_cmos_w) AM_BASE(&pkr_cmos_ram)
202   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_RAM
203   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w)
204   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(p2_r, p2_w)
205    AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P4) AM_RAM_WRITE(p4_w)
206    AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READWRITE(bus_r, bus_w)
205   AM_RANGE(MCS48_PORT_T1,   MCS48_PORT_T1) AM_RAM
206   AM_RANGE(MCS48_PORT_P1,   MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w)
207   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2) AM_READWRITE(p2_r, p2_w)
208    AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_RAM_WRITE(prog_w)
209    AM_RANGE(MCS48_PORT_BUS,  MCS48_PORT_BUS) AM_READWRITE(bus_r, bus_w)
207210ADDRESS_MAP_END
208211
209212/*************************
src/mame/drivers/goodejan.c
r4057r4058
6868WRITE16_HANDLER( goodejan_txvram_w );
6969WRITE16_HANDLER( goodejan_bg_scrollx_w );
7070WRITE16_HANDLER( goodejan_bg_scrolly_w );
71WRITE16_HANDLER( goodejan_layer_en_w );
7172
7273VIDEO_START( goodejan );
7374VIDEO_UPDATE( goodejan );
r4057r4058
9596   goodejan_mux_data = data;
9697}
9798
98static READ16_HANDLER( goodejan_read_ff )
99{
100   return 0xff;
101}
102
10399static ADDRESS_MAP_START( goodejan_map, ADDRESS_SPACE_PROGRAM, 16 )
104100   AM_RANGE(0x00000, 0x0afff) AM_RAM
105101   AM_RANGE(0x0c000, 0x0c7ff) AM_RAM_WRITE(goodejan_bgvram_w) AM_BASE(&goodejan_bgvram)
r4057r4058
109105   AM_RANGE(0xc0000, 0xfffff) AM_ROM
110106ADDRESS_MAP_END
111107
112
108/*totmejan CRT is at 8000-804f,goodejan is at 8040-807f(808f but not tested)*/
113109static ADDRESS_MAP_START( goodejan_io_map, ADDRESS_SPACE_IO, 16 )
110   AM_RANGE(0x801c, 0x801d) AM_WRITE(goodejan_layer_en_w )
114111
112   AM_RANGE(0x805c, 0x805d) AM_WRITE(goodejan_layer_en_w )
115113   AM_RANGE(0x8060, 0x8061) AM_WRITE(goodejan_bg_scrollx_w )
116114   AM_RANGE(0x8062, 0x8063) AM_WRITE(goodejan_bg_scrolly_w )
117115
118116   AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w)
119117
120   AM_RANGE(0xc000, 0xc001) AM_READ(goodejan_read_ff)
118   AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1")
121119   AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r)
120   AM_RANGE(0xc004, 0xc005) AM_READ_PORT("DSW2") // maybe it's a seibu_main_word mirror?
122121//  AM_RANGE(0xc004, 0xc005) AM_READ(random_reading)
123122
124123   AM_RANGE(0xd000, 0xd00f) AM_READWRITE(seibu_main_word_r, seibu_main_word_w)
r4057r4058
177176   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
178177   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
179178
180   PORT_START("DSW")
181   PORT_DIPNAME( 0x0001, 0x0001, "4" )
179   PORT_START("DSW1")
180   PORT_DIPNAME( 0x0001, 0x0001, "0" )
182181   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
183182   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
184183   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
r4057r4058
190189   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
191190   PORT_DIPSETTING(     0x0008, DEF_STR( Off ) )
192191   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
193   PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )  // Freezes if off?
192   PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) )
194193   PORT_DIPSETTING(     0x0010, DEF_STR( Off ) )
195194   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
196195   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
197196   PORT_DIPSETTING(     0x0020, DEF_STR( Off ) )
198197   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
198   PORT_DIPNAME( 0x0040, 0x0040, "Cross Hatch Test" )
199   PORT_DIPSETTING(     0x0040, DEF_STR( Off ) )
200   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
201   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
202   PORT_DIPSETTING(     0x0080, DEF_STR( Off ) )
203   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
204   PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) )
205   PORT_DIPSETTING(     0x0100, DEF_STR( Off ) )
206   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
207   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) )
208   PORT_DIPSETTING(     0x0200, DEF_STR( Off ) )
209   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
210   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )
211   PORT_DIPSETTING(     0x0400, DEF_STR( Off ) )
212   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
213   PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) )
214   PORT_DIPSETTING(     0x0800, DEF_STR( Off ) )
215   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
216   PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Unknown ) )
217   PORT_DIPSETTING(     0x1000, DEF_STR( Off ) )
218   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
219   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Unknown ) )
220   PORT_DIPSETTING(     0x2000, DEF_STR( Off ) )
221   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
222   PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) )
223   PORT_DIPSETTING(     0x4000, DEF_STR( Off ) )
224   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
225   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Unknown ) )
226   PORT_DIPSETTING(     0x8000, DEF_STR( Off ) )
227   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
228   PORT_START("DSW2")
229   PORT_DIPNAME( 0x0001, 0x0001, "1" )
230   PORT_DIPSETTING(     0x0001, DEF_STR( Off ) )
231   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
232   PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) )
233   PORT_DIPSETTING(     0x0002, DEF_STR( Off ) )
234   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
235   PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) )
236   PORT_DIPSETTING(     0x0004, DEF_STR( Off ) )
237   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
238   PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) )
239   PORT_DIPSETTING(     0x0008, DEF_STR( Off ) )
240   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
241   PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) )
242   PORT_DIPSETTING(     0x0010, DEF_STR( Off ) )
243   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
244   PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) )
245   PORT_DIPSETTING(     0x0020, DEF_STR( Off ) )
246   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
199247   PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) )
200248   PORT_DIPSETTING(     0x0040, DEF_STR( Off ) )
201249   PORT_DIPSETTING(     0x0000, DEF_STR( On ) )
r4057r4058
318366   ROM_LOAD16_BYTE( "4.061",  0x00001, 0x10000, CRC(29fb6ad2) SHA1(8a9c4625472daefca7fb73a9ef3717e86c3d632f) )
319367
320368   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )
321   ROM_LOAD( "e-jan.064", 0x080000, 0x080000, CRC(5f6185ee) SHA1(599e4a574672cd1571032e879b3032d06b70e4e2) )
322   ROM_CONTINUE(0x00000,0x80000)
369   ROM_LOAD( "e-jan.064", 0x000000, 0x100000, CRC(5f6185ee) SHA1(599e4a574672cd1571032e879b3032d06b70e4e2) )
323370
324371   ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE )
325372   ROM_LOAD( "e-jan.078", 0x000000, 0x080000, CRC(ff9ee9d8) SHA1(5e49e9a666630ca9867ee96b9d2b8d6f503b25df) )
r4057r4058
346393   ROM_LOAD16_BYTE( "4.061",  0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) )
347394
348395   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )
349   ROM_LOAD( "e_jan2scr.064", 0x000000, 0x100000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
396   ROM_LOAD( "e_jan2scr.064", 0x080000, 0x080000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
397   ROM_CONTINUE(             0x000000, 0x080000 )
350398
351399   ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE )
352400   ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) )
r4057r4058
373421   ROM_LOAD16_BYTE( "4.061",  0x00001, 0x10000, CRC(5bdf7225) SHA1(a8eded9dc5be1db20cddbed1ae8c22de1674de2a) )
374422
375423   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )
376   ROM_LOAD( "e_jan2scr.064", 0x000000, 0x100000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
424   ROM_LOAD( "e_jan2scr.064", 0x080000, 0x080000, CRC(71654822) SHA1(fe2a128413999085e321e455aeebda0360d38cb8) )
425   ROM_CONTINUE(             0x000000, 0x080000 )
377426
378427   ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE )
379428   ROM_LOAD( "e_jan2obj.078", 0x000000, 0x080000, CRC(0f892ef2) SHA1(188ae43db1c48fb6870aa45c64718e901831499b) )
src/mame/drivers/videopkr.c
r4057r4058
672672   return t0_latch;
673673}
674674
675static WRITE8_HANDLER(p4_w)
675static WRITE8_HANDLER( prog_w )
676676{
677   cputag_set_input_line(space->machine, "main", 0, CLEAR_LINE);   /* clear interrupt FF */
677   if (!data)
678      cputag_set_input_line(space->machine, "main", 0, CLEAR_LINE);   /* clear interrupt FF */
678679}
679680
680681/*************************
r4057r4058
877878ADDRESS_MAP_END
878879
879880static ADDRESS_MAP_START( i8039_io_port, ADDRESS_SPACE_IO, 8 )
880   AM_RANGE(0x00         , 0xff         ) AM_READWRITE(videopkr_io_r, videopkr_io_w)
881   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(videopkr_p1_data_r, videopkr_p1_data_w)
882   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(videopkr_p2_data_r, videopkr_p2_data_w)
883   AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P4) AM_WRITE(p4_w)
884   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(videopkr_t0_latch)
881   AM_RANGE(0x00,            0xff           ) AM_READWRITE(videopkr_io_r, videopkr_io_w)
882   AM_RANGE(MCS48_PORT_P1,   MCS48_PORT_P1  ) AM_READWRITE(videopkr_p1_data_r, videopkr_p1_data_w)
883   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2  ) AM_READWRITE(videopkr_p2_data_r, videopkr_p2_data_w)
884   AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_WRITE(prog_w)
885   AM_RANGE(MCS48_PORT_T0,   MCS48_PORT_T0  ) AM_READ(videopkr_t0_latch)
885886ADDRESS_MAP_END
886887
887888static ADDRESS_MAP_START( i8039_sound_mem, ADDRESS_SPACE_PROGRAM, 8 )
src/mame/drivers/dkong.c
r4057r4058
19811981   ROM_LOAD( "c-2k.bpr",     0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */
19821982   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
19831983   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
1984ROM_END
19841985
1986ROM_START( dkongf ) /* Donkey Kong Foundry (hack) from Jeff's Romhack */
1987   ROM_REGION( 0x10000, "main", 0 )
1988   ROM_LOAD( "dk_f.5et",  0x0000, 0x1000, CRC(00b7efaf) SHA1(97ed5930eb5d0cb98a9008b1d329ba7f3b8b8dbf) )
1989   ROM_LOAD( "dk_f.5ct",  0x1000, 0x1000, CRC(88af9b69) SHA1(c5621dd8198c333b3fa32fdece60ee5a3d8b2276) )
1990   ROM_LOAD( "dk_f.5bt",  0x2000, 0x1000, CRC(de74ad91) SHA1(c80227361bdbc565e9f5764e6364b52d40ca778a) )
1991   ROM_LOAD( "dk_f.5at",  0x3000, 0x1000, CRC(6a6bd420) SHA1(f012e2d21d906a2993af9cf8b2912ea6c928e94b) )
1992   /* space for diagnostic ROM */
1993
1994   ROM_REGION( 0x1800, "sound", 0 )   /* sound */
1995   ROM_LOAD( "s_3i_b.bin",   0x0000, 0x0800, CRC(45a4ed06) SHA1(144d24464c1f9f01894eb12f846952290e6e32ef) )
1996   ROM_RELOAD(               0x0800, 0x0800 )
1997   ROM_LOAD( "s_3j_b.bin",   0x1000, 0x0800, CRC(4743fe92) SHA1(6c82b57637c0212a580591397e6a5a1718f19fd2) )
1998
1999   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2000   ROM_LOAD( "v_5h_b.bin",   0x0000, 0x0800, CRC(12c8c95d) SHA1(a57ff5a231c45252a63b354137c920a1379b70a3) )
2001   ROM_LOAD( "v_3pt.bin",    0x0800, 0x0800, CRC(15e9c5e9) SHA1(976eb1e18c74018193a35aa86cff482ebfc5cc4e) )
2002
2003   ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
2004   ROM_LOAD( "l_4m_b.bin",   0x0000, 0x0800, CRC(59f8054d) SHA1(793dba9bf5a5fe76328acdfb90815c243d2a65f1) )
2005   ROM_LOAD( "l_4n_b.bin",   0x0800, 0x0800, CRC(672e4714) SHA1(92e5d379f4838ac1fa44d448ce7d142dae42102f) )
2006   ROM_LOAD( "l_4r_b.bin",   0x1000, 0x0800, CRC(feaa59ee) SHA1(ecf95db5a20098804fc8bd59232c66e2e0ed3db4) )
2007   ROM_LOAD( "l_4s_b.bin",   0x1800, 0x0800, CRC(20f2ef7e) SHA1(3bc482a38bf579033f50082748ee95205b0f673d) )
2008
2009   ROM_REGION( 0x0300, "proms", 0 )
2010   ROM_LOAD( "c-2k.bpr",     0x0000, 0x0100, CRC(e273ede5) SHA1(b50ec9e1837c00c20fb2a4369ec7dd0358321127) ) /* palette low 4 bits (inverted) */
2011   ROM_LOAD( "c-2j.bpr",     0x0100, 0x0100, CRC(d6412358) SHA1(f9c872da2fe8e800574ae3bf483fb3ccacc92eb3) ) /* palette high 4 bits (inverted) */
2012   ROM_LOAD( "v-5e.bpr",     0x0200, 0x0100, CRC(b869b8f5) SHA1(c2bdccbf2654b64ea55cd589fd21323a9178a660) ) /* character color codes on a per-column basis */
19852013ROM_END
19862014
19872015ROM_START( dkongjr )
r4057r4058
29142942GAME( 1981, dkongjp,  dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 1)", GAME_SUPPORTS_SAVE )
29152943GAME( 1981, dkongjo,  dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 2)", GAME_SUPPORTS_SAVE )
29162944GAME( 1981, dkongjo1, dkong,    dkong2b,  dkong,          0,  ROT90, "Nintendo", "Donkey Kong (Japan set 3) (bad dump?)", GAME_SUPPORTS_SAVE )
2945GAME( 1981, dkongf,   dkong,    dkong2b,  dkong,          0,  ROT90, "hack", "Donkey Kong Foundry (hack)", GAME_SUPPORTS_SAVE ) /* from Jeff's Romhack */
29172946
29182947GAME( 1982, dkongjr,  0,        dkongjr,  dkongjr,        0,  ROT90, "Nintendo of America", "Donkey Kong Junior (US)", GAME_SUPPORTS_SAVE )
29192948GAME( 1982, dkongjrj, dkongjr,  dkongjr,  dkongjr,        0,  ROT90, "Nintendo", "Donkey Kong Jr. (Japan)", GAME_SUPPORTS_SAVE )
r4057r4058
29312960/* 2650 based */
29322961GAME( 1984, herbiedk, huncholy, s2650,    herbiedk,       0,  ROT90, "CVS", "Herbie at the Olympics (DK conversion)", GAME_SUPPORTS_SAVE )
29332962GAME( 1983, hunchbkd, hunchbak, s2650,    hunchbkd,       0,  ROT90, "Century Electronics", "Hunchback (DK conversion)", GAME_SUPPORTS_SAVE )
2934GAME( 1984, sbdk,     superbik,   s2650,    sbdk,            0,  ROT90, "Century Electronics", "Super Bike (DK conversion)", GAME_SUPPORTS_SAVE )
2963GAME( 1984, sbdk,     superbik, s2650,    sbdk,           0,  ROT90, "Century Electronics", "Super Bike (DK conversion)", GAME_SUPPORTS_SAVE )
29352964GAME( 1984, herodk,   hero,     s2650,    herodk,    herodk,  ROT90, "Seatongrove Ltd (Crown license)", "Hero in the Castle of Doom (DK conversion)", GAME_SUPPORTS_SAVE )
29362965GAME( 1984, herodku,  hero,     s2650,    herodk,         0,  ROT90, "Seatongrove Ltd (Crown license)", "Hero in the Castle of Doom (DK conversion not encrypted)", GAME_SUPPORTS_SAVE )
29372966GAME( 1984, 8ballact, 0,       s2650,    8ballact,       0,  ROT90, "Seatongrove Ltd (Magic Eletronics USA licence)", "Eight Ball Action (DK conversion)", GAME_SUPPORTS_SAVE )
src/mame/drivers/aliens.c
r4057r4058
285285
286286ROM_START( aliens )
287287   ROM_REGION( 0x38000, "main", 0 ) /* code + banked roms */
288   ROM_LOAD( "e24_j02.bin", 0x10000, 0x08000, CRC(56c20971) SHA1(af272e146705e97342466a208c64d823ebc83d83) )
288   ROM_LOAD( "875_j02.e24", 0x10000, 0x08000, CRC(56c20971) SHA1(af272e146705e97342466a208c64d823ebc83d83) )
289289   ROM_CONTINUE(            0x08000, 0x08000 )
290   ROM_LOAD( "c24_j01.bin", 0x18000, 0x20000, CRC(6a529cd6) SHA1(bff6dee33141d8ed2b2c28813cf49f52dceac364) )
290   ROM_LOAD( "875_j01.c24", 0x18000, 0x20000, CRC(6a529cd6) SHA1(bff6dee33141d8ed2b2c28813cf49f52dceac364) )
291291
292292   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for the sound CPU */
293   ROM_LOAD( "g04_b03.bin", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
293   ROM_LOAD( "875_b03.g04", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
294294
295295   ROM_REGION( 0x200000, "gfx1", 0 ) /* graphics */
296   ROM_LOAD( "k13_b11.bin", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
297   ROM_LOAD( "j13_b07.bin", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
296   ROM_LOAD( "875b11.k13", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
297   ROM_LOAD( "875b07.j13", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
298298   /* second half empty */
299   ROM_LOAD( "k19_b12.bin", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
300   ROM_LOAD( "j19_b08.bin", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
299   ROM_LOAD( "875b12.k19", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
300   ROM_LOAD( "875b08.j19", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
301301   /* second half empty */
302302
303303   ROM_REGION( 0x200000, "gfx2", 0 ) /* graphics */
304   ROM_LOAD( "k08_b10.bin", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
305   ROM_LOAD( "j08_b06.bin", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
304   ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
305   ROM_LOAD( "875b06.j08", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
306306   /* second half empty */
307   ROM_LOAD( "k02_b09.bin", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
308   ROM_LOAD( "j02_b05.bin", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
307   ROM_LOAD( "875b09.k02", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
308   ROM_LOAD( "875b05.j02", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
309309   /* second half empty */
310310
311311   ROM_REGION( 0x0100, "proms", 0 )
312312   ROM_LOAD( "821a08.h14",  0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
313313
314314   ROM_REGION( 0x40000, "konami", 0 ) /* samples for 007232 */
315   ROM_LOAD( "875b04.bin",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
315   ROM_LOAD( "875b04.e05",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
316316ROM_END
317317
318318ROM_START( aliens2 )
319319   ROM_REGION( 0x38000, "main", 0 ) /* code + banked roms */
320   ROM_LOAD( "e24_p02.bin", 0x10000, 0x08000, CRC(4edd707d) SHA1(02b39068e5fd99ecb5b35a586335b65a20fde490) )
320   ROM_LOAD( "875_p02.e24", 0x10000, 0x08000, CRC(4edd707d) SHA1(02b39068e5fd99ecb5b35a586335b65a20fde490) )
321321   ROM_CONTINUE(            0x08000, 0x08000 )
322   ROM_LOAD( "c24_n01.bin", 0x18000, 0x20000, CRC(106cf59c) SHA1(78622adc02055d31cd587c83b23a6cde30c9bc22) )
322   ROM_LOAD( "875_n01.c24", 0x18000, 0x20000, CRC(106cf59c) SHA1(78622adc02055d31cd587c83b23a6cde30c9bc22) )
323323
324324   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for the sound CPU */
325   ROM_LOAD( "g04_b03.bin", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
325   ROM_LOAD( "875_b03.g04", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
326326
327327   ROM_REGION( 0x200000, "gfx1", 0 ) /* graphics */
328   ROM_LOAD( "k13_b11.bin", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
329   ROM_LOAD( "j13_b07.bin", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
328   ROM_LOAD( "875b11.k13", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
329   ROM_LOAD( "875b07.j13", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
330330   /* second half empty */
331   ROM_LOAD( "k19_b12.bin", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
332   ROM_LOAD( "j19_b08.bin", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
331   ROM_LOAD( "875b12.k19", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
332   ROM_LOAD( "875b08.j19", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
333333   /* second half empty */
334334
335335   ROM_REGION( 0x200000, "gfx2", 0 ) /* graphics */
336   ROM_LOAD( "k08_b10.bin", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
337   ROM_LOAD( "j08_b06.bin", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
336   ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
337   ROM_LOAD( "875b06.j08", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
338338   /* second half empty */
339   ROM_LOAD( "k02_b09.bin", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
340   ROM_LOAD( "j02_b05.bin", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
339   ROM_LOAD( "875b09.k02", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
340   ROM_LOAD( "875b05.j02", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
341341   /* second half empty */
342342
343343   ROM_REGION( 0x0100, "proms", 0 )
344344   ROM_LOAD( "821a08.h14",  0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
345345
346346   ROM_REGION( 0x40000, "konami", 0 ) /* samples for 007232 */
347   ROM_LOAD( "875b04.bin",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
347   ROM_LOAD( "875b04.e05",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
348348ROM_END
349349
350350ROM_START( aliens3 )
351351   ROM_REGION( 0x38000, "main", 0 ) /* code + banked roms */
352   ROM_LOAD( "875_w3_2.e24", 0x10000, 0x08000, CRC(f917f7b5) SHA1(ab95ad40c82f11572bbaa03d76dae35f76bacf0c) )
353   ROM_CONTINUE(            0x08000, 0x08000 )
354   ROM_LOAD( "875_w3_1.c24", 0x18000, 0x20000, CRC(3c0006fb) SHA1(e8730d50c358e7321dd676c74368fe44b9bbe5b2) )
352   ROM_LOAD( "875_w3_2.e24", 0x10000, 0x08000, CRC(f917f7b5) SHA1(ab95ad40c82f11572bbaa03d76dae35f76bacf0c) ) /* Needs correct rom label */
353   ROM_CONTINUE(             0x08000, 0x08000 )
354   ROM_LOAD( "875_w3_1.c24", 0x18000, 0x20000, CRC(3c0006fb) SHA1(e8730d50c358e7321dd676c74368fe44b9bbe5b2) ) /* Needs correct rom label */
355355
356356   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for the sound CPU */
357   ROM_LOAD( "g04_b03.bin", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
357   ROM_LOAD( "875_b03.g04", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
358358
359359   ROM_REGION( 0x200000, "gfx1", 0 ) /* graphics */
360   ROM_LOAD( "k13_b11.bin", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
361   ROM_LOAD( "j13_b07.bin", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
360   ROM_LOAD( "875b11.k13", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
361   ROM_LOAD( "875b07.j13", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
362362   /* second half empty */
363   ROM_LOAD( "k19_b12.bin", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
364   ROM_LOAD( "j19_b08.bin", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
363   ROM_LOAD( "875b12.k19", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
364   ROM_LOAD( "875b08.j19", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
365365   /* second half empty */
366366
367367   ROM_REGION( 0x200000, "gfx2", 0 ) /* graphics */
368   ROM_LOAD( "k08_b10.bin", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
369   ROM_LOAD( "j08_b06.bin", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
368   ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
369   ROM_LOAD( "875b06.j08", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
370370   /* second half empty */
371   ROM_LOAD( "k02_b09.bin", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
372   ROM_LOAD( "j02_b05.bin", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
371   ROM_LOAD( "875b09.k02", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
372   ROM_LOAD( "875b05.j02", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
373373   /* second half empty */
374374
375375   ROM_REGION( 0x0100, "proms", 0 )
376   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
376   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
377377
378378   ROM_REGION( 0x40000, "konami", 0 ) /* samples for 007232 */
379   ROM_LOAD( "875b04.bin",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
379   ROM_LOAD( "875b04.e05",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
380380ROM_END
381381
382382ROM_START( aliensu )
383383   ROM_REGION( 0x38000, "main", 0 ) /* code + banked roms */
384   ROM_LOAD( "e24_n02.bin", 0x10000, 0x08000, CRC(24dd612e) SHA1(35bceb3045cd0bd9d107312b371fb60dcf3f1272) )
384   ROM_LOAD( "875_n02.e24", 0x10000, 0x08000, CRC(24dd612e) SHA1(35bceb3045cd0bd9d107312b371fb60dcf3f1272) )
385385   ROM_CONTINUE(            0x08000, 0x08000 )
386   ROM_LOAD( "c24_n01.bin", 0x18000, 0x20000, CRC(106cf59c) SHA1(78622adc02055d31cd587c83b23a6cde30c9bc22) )
386   ROM_LOAD( "875_n01.c24", 0x18000, 0x20000, CRC(106cf59c) SHA1(78622adc02055d31cd587c83b23a6cde30c9bc22) )
387387
388388   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for the sound CPU */
389   ROM_LOAD( "g04_b03.bin", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
389   ROM_LOAD( "875_b03.g04", 0x00000, 0x08000, CRC(1ac4d283) SHA1(2253f1f39c7edb6cef438b3d97f3af67a1f491ff) )
390390
391391   ROM_REGION( 0x200000, "gfx1", 0 ) /* graphics */
392   ROM_LOAD( "k13_b11.bin", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
393   ROM_LOAD( "j13_b07.bin", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
392   ROM_LOAD( "875b11.k13", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
393   ROM_LOAD( "875b07.j13", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
394394   /* second half empty */
395   ROM_LOAD( "k19_b12.bin", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
396   ROM_LOAD( "j19_b08.bin", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
395   ROM_LOAD( "875b12.k19", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
396   ROM_LOAD( "875b08.j19", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
397397   /* second half empty */
398398
399399   ROM_REGION( 0x200000, "gfx2", 0 ) /* graphics */
400   ROM_LOAD( "k08_b10.bin", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
401   ROM_LOAD( "j08_b06.bin", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
400   ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
401   ROM_LOAD( "875b06.j08", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
402402   /* second half empty */
403   ROM_LOAD( "k02_b09.bin", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
404   ROM_LOAD( "j02_b05.bin", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
403   ROM_LOAD( "875b09.k02", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
404   ROM_LOAD( "875b05.j02", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
405405   /* second half empty */
406406
407407   ROM_REGION( 0x0100, "proms", 0 )
408   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
408   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
409409
410410   ROM_REGION( 0x40000, "konami", 0 ) /* samples for 007232 */
411   ROM_LOAD( "875b04.bin",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
411   ROM_LOAD( "875b04.e05",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
412412ROM_END
413413
414414ROM_START( aliensj )
415415   ROM_REGION( 0x38000, "main", 0 ) /* code + banked roms */
416   ROM_LOAD( "875m02.e24",  0x10000, 0x08000, CRC(54a774e5) SHA1(b6413b2199f863cae1c6fcef766989162cd4b95e) )
417   ROM_CONTINUE(            0x08000, 0x08000 )
418   ROM_LOAD( "875m01.c24",  0x18000, 0x20000, CRC(1663d3dc) SHA1(706bdf3daa3bda372d94263f3405d67a7ef8dc69) )
416   ROM_LOAD( "875_m02.e24",  0x10000, 0x08000, CRC(54a774e5) SHA1(b6413b2199f863cae1c6fcef766989162cd4b95e) )
417   ROM_CONTINUE(             0x08000, 0x08000 )
418   ROM_LOAD( "875_m01.c24",  0x18000, 0x20000, CRC(1663d3dc) SHA1(706bdf3daa3bda372d94263f3405d67a7ef8dc69) )
419419
420420   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for the sound CPU */
421   ROM_LOAD( "875k03.g4",  0x00000, 0x08000, CRC(bd86264d) SHA1(345fd666daf8a29ef314b14306c1a976cb159bed) )
421   ROM_LOAD( "875_k03.g04", 0x00000, 0x08000, CRC(bd86264d) SHA1(345fd666daf8a29ef314b14306c1a976cb159bed) )
422422
423423   ROM_REGION( 0x200000, "gfx1", 0 ) /* graphics */
424   ROM_LOAD( "k13_b11.bin", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
425   ROM_LOAD( "j13_b07.bin", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
424   ROM_LOAD( "875b11.k13", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
425   ROM_LOAD( "875b07.j13", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
426426   /* second half empty */
427   ROM_LOAD( "k19_b12.bin", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
428   ROM_LOAD( "j19_b08.bin", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
427   ROM_LOAD( "875b12.k19", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
428   ROM_LOAD( "875b08.j19", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
429429   /* second half empty */
430430
431431   ROM_REGION( 0x200000, "gfx2", 0 ) /* graphics */
432   ROM_LOAD( "k08_b10.bin", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
433   ROM_LOAD( "j08_b06.bin", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
432   ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
433   ROM_LOAD( "875b06.j08", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
434434   /* second half empty */
435   ROM_LOAD( "k02_b09.bin", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
436   ROM_LOAD( "j02_b05.bin", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
435   ROM_LOAD( "875b09.k02", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
436   ROM_LOAD( "875b05.j02", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
437437   /* second half empty */
438438
439439   ROM_REGION( 0x0100, "proms", 0 )
440   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
440   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
441441
442442   ROM_REGION( 0x40000, "konami", 0 ) /* samples for 007232 */
443   ROM_LOAD( "875b04.bin",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
443   ROM_LOAD( "875b04.e05",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
444444ROM_END
445445
446446ROM_START( aliensj2 )
447447   ROM_REGION( 0x38000, "main", 0 ) /* code + banked roms */
448   ROM_LOAD( "875_j2_2.e24",  0x10000, 0x08000, CRC(4bb84952) SHA1(ca40a7181f11d6c34c26b65f8d4a1d1df2c7fb48) )
449   ROM_CONTINUE(            0x08000, 0x08000 )
450   ROM_LOAD( "875m01.c24",  0x18000, 0x20000, CRC(1663d3dc) SHA1(706bdf3daa3bda372d94263f3405d67a7ef8dc69) )
448   ROM_LOAD( "875_j2_2.e24", 0x10000, 0x08000, CRC(4bb84952) SHA1(ca40a7181f11d6c34c26b65f8d4a1d1df2c7fb48) ) /* Needs correct rom label */
449   ROM_CONTINUE(             0x08000, 0x08000 )
450   ROM_LOAD( "875_m01.c24",  0x18000, 0x20000, CRC(1663d3dc) SHA1(706bdf3daa3bda372d94263f3405d67a7ef8dc69) )
451451
452452   ROM_REGION( 0x10000, "audio", 0 ) /* 64k for the sound CPU */
453   ROM_LOAD( "875k03.g4",  0x00000, 0x08000, CRC(bd86264d) SHA1(345fd666daf8a29ef314b14306c1a976cb159bed) )
453   ROM_LOAD( "875_k03.g04", 0x00000, 0x08000, CRC(bd86264d) SHA1(345fd666daf8a29ef314b14306c1a976cb159bed) )
454454
455455   ROM_REGION( 0x200000, "gfx1", 0 ) /* graphics */
456   ROM_LOAD( "k13_b11.bin", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
457   ROM_LOAD( "j13_b07.bin", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
456   ROM_LOAD( "875b11.k13", 0x000000, 0x80000, CRC(89c5c885) SHA1(02a1581579b6ef816e04bec312a7b3ae7c7e84f8) )   /* characters (set 1) */
457   ROM_LOAD( "875b07.j13", 0x080000, 0x40000, CRC(e9c56d66) SHA1(1f58949d5391aef002a6e1ee7034e57bf99cee61) )   /* characters (set 2) */
458458   /* second half empty */
459   ROM_LOAD( "k19_b12.bin", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
460   ROM_LOAD( "j19_b08.bin", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
459   ROM_LOAD( "875b12.k19", 0x100000, 0x80000, CRC(ea6bdc17) SHA1(a7c22370f8adc5b479283f1ff831f493df78282f) )   /* characters (set 1) */
460   ROM_LOAD( "875b08.j19", 0x180000, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) )   /* characters (set 2) */
461461   /* second half empty */
462462
463463   ROM_REGION( 0x200000, "gfx2", 0 ) /* graphics */
464   ROM_LOAD( "k08_b10.bin", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
465   ROM_LOAD( "j08_b06.bin", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
464   ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) )   /* sprites (set 1) */
465   ROM_LOAD( "875b06.j08", 0x080000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) )   /* sprites (set 2) */
466466   /* second half empty */
467   ROM_LOAD( "k02_b09.bin", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
468   ROM_LOAD( "j02_b05.bin", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
467   ROM_LOAD( "875b09.k02", 0x100000, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) )   /* sprites (set 1) */
468   ROM_LOAD( "875b05.j02", 0x180000, 0x40000, CRC(19a261f2) SHA1(b0518fad833b3e613e0201d5d9cab73dc5e78e1d) )   /* sprites (set 2) */
469469   /* second half empty */
470470
471471   ROM_REGION( 0x0100, "proms", 0 )
472   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
472   ROM_LOAD( "821a08.h14", 0x0000, 0x0100, CRC(7da55800) SHA1(3826f73569c8ae0431510a355bdfa082152b74a5) )   /* priority encoder (not used) */
473473
474474   ROM_REGION( 0x40000, "konami", 0 ) /* samples for 007232 */
475   ROM_LOAD( "875b04.bin",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
475   ROM_LOAD( "875b04.e05",  0x00000, 0x40000, CRC(4e209ac8) SHA1(09d9eaae61bfd04bf318555ccd44d7371571d86d) )
476476ROM_END
477477
478478/***************************************************************************
src/mame/drivers/88games.c
r4057r4058
1313
1414
1515static MACHINE_RESET( 88games );
16static MACHINE_START( 88games );
1617static KONAMI_SETLINES_CALLBACK( k88games_banking );
1718
1819static UINT8 *ram;
r4057r4058
282283   MDRV_VIDEO_START(88games)
283284   MDRV_VIDEO_UPDATE(88games)
284285
286    MDRV_MACHINE_START(88games)
287
285288   /* sound hardware */
286289   MDRV_SPEAKER_STANDARD_MONO("mono")
287290
r4057r4058
514517   paletteram = &memory_region(machine, "main")[0x20000];
515518}
516519
520static MACHINE_START( 88games )
521{
522    state_save_register_global(machine, videobank);
523    state_save_register_global(machine, zoomreadroms);
524    state_save_register_global(machine, speech_chip);
525}
517526
518
519527static DRIVER_INIT( 88games )
520528{
521529   konami_rom_deinterleave_2(machine, "gfx1");
r4057r4058
524532
525533
526534
527GAME( 1988, 88games,  0,       88games, 88games, 88games, ROT0, "Konami", "'88 Games", 0 )
528GAME( 1988, konami88, 88games, 88games, 88games, 88games, ROT0, "Konami", "Konami '88", 0 )
529GAME( 1988, hypsptsp, 88games, 88games, 88games, 88games, ROT0, "Konami", "Hyper Sports Special (Japan)", 0 )
535GAME( 1988, 88games,  0,       88games, 88games, 88games, ROT0, "Konami", "'88 Games", GAME_SUPPORTS_SAVE )
536GAME( 1988, konami88, 88games, 88games, 88games, 88games, ROT0, "Konami", "Konami '88", GAME_SUPPORTS_SAVE )
537GAME( 1988, hypsptsp, 88games, 88games, 88games, 88games, ROT0, "Konami", "Hyper Sports Special (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/ddenlovr.c
r4057r4058
363363
364364static int blit_draw(running_machine *machine, int src,int sx)
365365{
366   UINT8 *src_data = memory_region(machine, "gfx1");
367   int src_len = memory_region_length(machine, "gfx1");
366   UINT8 *src_data = memory_region(machine, "blitter");
367   int src_len = memory_region_length(machine, "blitter");
368368   int bit_addr = (src & 0xffffff) * ddenlovr_blit_rom_bits;   /* convert to bit address */
369369   int pen_size, arg_size, cmd;
370370   int x;
r4057r4058
595595INLINE void log_blit(running_machine *machine, int data)
596596{
597597#if 1
598   logerror("%s: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
598   logerror("%s: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x flip %02x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
599599         cpuexec_describe_context(machine),
600600         ddenlovr_blit_address,ddenlovr_blit_x,ddenlovr_blit_y,data,
601         ddenlovr_dest_layer,ddenlovr_blit_pen,ddenlovr_blit_pen_mode,ddenlovr_rect_width,ddenlovr_rect_height,ddenlovr_line_length,
601         ddenlovr_dest_layer,ddenlovr_blit_pen,ddenlovr_blit_pen_mode,ddenlovr_rect_width,ddenlovr_rect_height,ddenlovr_line_length,ddenlovr_blit_flip,
602602         ddenlovr_clip_ctrl,ddenlovr_clip_x,ddenlovr_clip_y, ddenlovr_clip_width,ddenlovr_clip_height   );
603603#endif
604604}
r4057r4058
11501150
11511151static READ8_HANDLER( rongrong_gfxrom_r )
11521152{
1153   UINT8 *rom   =   memory_region( space->machine, "gfx1" );
1154   size_t size   =   memory_region_length( space->machine, "gfx1" );
1153   UINT8 *rom   =   memory_region( space->machine, "blitter" );
1154   size_t size   =   memory_region_length( space->machine, "blitter" );
11551155   int address   =   ddenlovr_blit_address;
11561156
11571157   if (address >= size)
r4057r4058
12221222
12231223#if 0
12241224   static int base = 0x0;
1225   const UINT8 *gfx = memory_region(screen->machine, "gfx1");
1225   const UINT8 *gfx = memory_region(screen->machine, "blitter");
12261226   int next;
12271227   memset(ddenlovr_pixmap[0],0,512*512);
12281228   memset(ddenlovr_pixmap[1],0,512*512);
r4057r4058
16801680ADDRESS_MAP_END
16811681
16821682
1683static UINT16 *ddenlvrk_protection1, *ddenlvrk_protection2;
1684static READ16_HANDLER( ddenlvrk_protection1_r )
1685{
1686   switch(*ddenlvrk_protection1)
1687   {
1688      case 0x007e:   return 0x00aa;
1689   }
1690   return *ddenlvrk_protection1;
1691}
1692
1693static READ16_HANDLER( ddenlvrk_protection2_r )
1694{
1695   switch(*ddenlvrk_protection1)
1696   {
1697      case 0x0000:   return *ddenlvrk_protection2;
1698   }
1699   return 0x80;
1700}
1701static WRITE16_HANDLER( ddenlvrk_protection2_w )
1702{
1703   COMBINE_DATA( ddenlvrk_protection2 );
1704   okim6295_set_bank_base(0, ((*ddenlvrk_protection2)&0x7) * 0x40000);
1705}
1706
1707static ADDRESS_MAP_START( ddenlvrk_readmem, ADDRESS_SPACE_PROGRAM, 16 )
1708   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)               // ROM
1709   AM_RANGE(0xe00086, 0xe00087) AM_READ(ddenlovr_gfxrom_r)         // Video Chip
1710   AM_RANGE(0xe00070, 0xe00071) AM_READNOP
1711   AM_RANGE(0xe00100, 0xe00101) AM_READ_PORT("P1")
1712   AM_RANGE(0xe00102, 0xe00103) AM_READ_PORT("P2")
1713   AM_RANGE(0xe00104, 0xe00105) AM_READ_PORT("SYSTEM")
1714   AM_RANGE(0xe00200, 0xe00201) AM_READ_PORT("DSW")
1715   AM_RANGE(0xe00500, 0xe0051f) AM_DEVREAD8(MSM6242, "rtc", msm6242_r,   0x00ff)   // 6242RTC
1716   AM_RANGE(0xe00604, 0xe00605) AM_READ(ay8910_read_port_0_lsb_r)
1717   AM_RANGE(0xe00700, 0xe00701) AM_READ(okim6295_status_0_lsb_r)   // Sound
1718   AM_RANGE(0xff0000, 0xffffff) AM_READ(SMH_RAM)               // RAM
1719ADDRESS_MAP_END
1720
1721static ADDRESS_MAP_START( ddenlvrk_writemem, ADDRESS_SPACE_PROGRAM, 16 )
1722   AM_RANGE(0x000000, 0x07ffff) AM_WRITE(SMH_ROM)                  // ROM
1723
1724   AM_RANGE(0x100000, 0x100001) AM_READWRITE(ddenlvrk_protection1_r, SMH_RAM)               AM_BASE(&ddenlvrk_protection1)
1725   AM_RANGE(0x200000, 0x200001) AM_READWRITE(ddenlvrk_protection2_r, ddenlvrk_protection2_w)   AM_BASE(&ddenlvrk_protection2)
1726
1727   AM_RANGE(0xd00000, 0xd003ff) AM_WRITE(ddenlovr_palette_w)         // Palette
1728//  AM_RANGE(0xd01000, 0xd017ff) SMH_RAM)                               // ? B0 on startup, then 00
1729   AM_RANGE(0xe00040, 0xe00047) AM_WRITE(ddenlovr16_palette_base_w)
1730   AM_RANGE(0xe00048, 0xe0004f) AM_WRITE(ddenlovr16_palette_mask_w)
1731   AM_RANGE(0xe00050, 0xe00057) AM_WRITE(ddenlovr16_transparency_pen_w)
1732   AM_RANGE(0xe00058, 0xe0005f) AM_WRITE(ddenlovr16_transparency_mask_w)
1733   AM_RANGE(0xe00068, 0xe00069) AM_WRITE(ddenlovr16_bgcolor_w)
1734   AM_RANGE(0xe0006a, 0xe0006b) AM_WRITE(ddenlovr16_priority_w)
1735   AM_RANGE(0xe0006c, 0xe0006d) AM_WRITE(ddenlovr16_layer_enable_w)
1736   AM_RANGE(0xe00080, 0xe00083) AM_WRITE(ddenlovr_blitter_w)
1737   AM_RANGE(0xe00302, 0xe00303) AM_WRITE(ddenlovr_blitter_irq_ack_w)   // Blitter irq acknowledge
1738   AM_RANGE(0xe00308, 0xe00309) AM_WRITE(ddenlovr_coincounter_0_w)      // Coin Counters
1739   AM_RANGE(0xe0030c, 0xe0030d) AM_WRITE(ddenlovr_coincounter_1_w)      //
1740   AM_RANGE(0xe00400, 0xe00401) AM_WRITE(ym2413_register_port_0_lsb_w)
1741   AM_RANGE(0xe00402, 0xe00403) AM_WRITE(ym2413_data_port_0_lsb_w)
1742   AM_RANGE(0xe00500, 0xe0051f) AM_DEVWRITE8(MSM6242, "rtc", msm6242_w, 0x00ff)   // 6242RTC
1743//  AM_RANGE(0xe00302, 0xe00303) AM_WRITE(SMH_NOP)                      // ?
1744   AM_RANGE(0xe00600, 0xe00601) AM_WRITE(ay8910_control_port_0_lsb_w)
1745   AM_RANGE(0xe00602, 0xe00603) AM_WRITE(ay8910_write_port_0_lsb_w)
1746   AM_RANGE(0xe00700, 0xe00701) AM_WRITE(okim6295_data_0_lsb_w)
1747   AM_RANGE(0xff0000, 0xffffff) AM_WRITE(SMH_RAM)                  // RAM
1748ADDRESS_MAP_END
1749
1750
1751
1752
16831753static ADDRESS_MAP_START( ddenlovr_readmem, ADDRESS_SPACE_PROGRAM, 16 )
16841754   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)               // ROM
16851755   AM_RANGE(0xe00086, 0xe00087) AM_READ(ddenlovr_gfxrom_r)         // Video Chip
r4057r4058
22992369
23002370static READ8_HANDLER( hanakanz_gfxrom_r )
23012371{
2302   UINT8 *rom   =   memory_region( space->machine, "gfx1" );
2303   size_t size      =   memory_region_length( space->machine, "gfx1" );
2372   UINT8 *rom   =   memory_region( space->machine, "blitter" );
2373   size_t size      =   memory_region_length( space->machine, "blitter" );
23042374   int address      =   (ddenlovr_blit_address & 0xffffff) * 2;
23052375
23062376   static UINT8 romdata[2];
r4057r4058
24982568
24992569static void mjchuuka_get_romdata(running_machine *machine)
25002570{
2501   UINT8 *rom   =   memory_region( machine, "gfx1" );
2502   size_t size      =   memory_region_length( machine, "gfx1" );
2571   UINT8 *rom   =   memory_region( machine, "blitter" );
2572   size_t size      =   memory_region_length( machine, "blitter" );
25032573   int address      =   (ddenlovr_blit_address & 0xffffff) * 2;
25042574
25052575   if (address >= size)
r4057r4058
33643434   AM_RANGE(0x0380, 0x0380) AM_WRITE(okim6295_data_0_w)
33653435ADDRESS_MAP_END
33663436
3437/***************************************************************************
3438                          Mahjong Jong-Tei
3439***************************************************************************/
33673440
3441static WRITE8_HANDLER( jongtei_okibank_w )
3442{
3443   okim6295_set_bank_base(0, ((data >> 4) & 0x07) * 0x40000);
3444}
3445
3446static WRITE8_HANDLER( jongtei_dsw_keyb_w )
3447{
3448   dsw = data;
3449   keyb = data;
3450}
3451
3452static READ8_HANDLER( jongtei_busy_r )
3453{
3454   return 0x04;   // !bit 2 = blitter busy
3455}
3456
3457static ADDRESS_MAP_START( jongtei_readport, ADDRESS_SPACE_IO, 8 )   ADDRESS_MAP_GLOBAL_MASK(0xff)
3458   AM_RANGE(0x2c, 0x2c) AM_READ(jongtei_busy_r)
3459   AM_RANGE(0x32, 0x32) AM_READ(hanakanz_dsw_r)
3460   AM_RANGE(0x40, 0x40) AM_READ_PORT("SYSTEM")
3461   AM_RANGE(0x41, 0x42) AM_READ(hanakanz_keyb_r)
3462   AM_RANGE(0x46, 0x46) AM_READ(hanakanz_rand_r)
3463   AM_RANGE(0x63, 0x64) AM_READ(hanakanz_gfxrom_r)
3464   AM_RANGE(0xa0, 0xa0) AM_READ(okim6295_status_0_r)
3465   AM_RANGE(0xc0, 0xcf) AM_DEVREAD(MSM6242, "rtc", msm6242_r)   // 6242RTC
3466ADDRESS_MAP_END
3467static ADDRESS_MAP_START( jongtei_writeport, ADDRESS_SPACE_IO, 8 )   ADDRESS_MAP_GLOBAL_MASK(0xff)
3468   AM_RANGE(0x2c, 0x2c) AM_WRITE(jongtei_okibank_w)
3469   AM_RANGE(0x2e, 0x2e) AM_WRITE(hanakanz_blitter_reg_w)
3470   AM_RANGE(0x30, 0x30) AM_WRITE(hanakanz_rombank_w)
3471   AM_RANGE(0x31, 0x31) AM_WRITE(jongtei_dsw_keyb_w)
3472   AM_RANGE(0x43, 0x43) AM_WRITE(hanakanz_coincounter_w)
3473   AM_RANGE(0x60, 0x60) AM_WRITE(hanakanz_blitter_data_w)
3474   AM_RANGE(0x61, 0x61) AM_WRITE(hanakanz_palette_w)
3475   AM_RANGE(0x80, 0x80) AM_WRITE(ym2413_register_port_0_w)
3476   AM_RANGE(0x81, 0x81) AM_WRITE(ym2413_data_port_0_w)
3477   AM_RANGE(0xa0, 0xa0) AM_WRITE(okim6295_data_0_w)
3478   AM_RANGE(0xc0, 0xcf) AM_DEVWRITE(MSM6242, "rtc", msm6242_w)   // 6242RTC
3479ADDRESS_MAP_END
3480
3481
3482
33683483static INPUT_PORTS_START( ddenlvrj )
33693484   PORT_START("P1")
33703485   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r4057r4058
47774892INPUT_PORTS_END
47784893
47794894
4895static INPUT_PORTS_START( jongtei )
4896
4897   PORT_START("SYSTEM")
4898   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 )   // medal out
4899   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
4900   PORT_SERVICE(0x04, IP_ACTIVE_LOW)
4901   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )   // analyzer
4902   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 )   // data clear
4903   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )   // note
4904   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1)
4905   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
4906
4907   PORT_START("KEY0")
4908   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)   // A
4909   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)   // E
4910   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)   // I
4911   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)   // M
4912   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)   // Kan
4913   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )   // Start 2
4914
4915   PORT_START("KEY1")
4916   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)   // B
4917   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)   // F
4918   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)   // J
4919   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)   // N
4920   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)   // Reach
4921   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2)   // BET
4922
4923   PORT_START("KEY2")
4924   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)   // C
4925   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)   // G
4926   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)   // K
4927   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)   // Chi
4928   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)   // Ron
4929   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // nothing
4930
4931   PORT_START("KEY3")
4932   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)   // D
4933   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)   // H
4934   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)   // L
4935   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)   // Pon
4936   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   // nothing
4937   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // nothing
4938
4939   PORT_START("KEY4")
4940   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)   // "l"
4941   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2)   // "t"
4942   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2)   // "w"
4943   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)   // Flip Flop
4944   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG    ) PORT_PLAYER(2)   // "b"
4945   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2)   // "s"
4946
4947   PORT_START("KEY5")
4948   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )   // A
4949   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )   // E
4950   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )   // I
4951   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )   // M
4952   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )   // Kan
4953   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )   // Start 1
4954
4955   PORT_START("KEY6")
4956   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )   // B
4957   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )   // F
4958   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )   // J
4959   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )   // N
4960   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )   // Reach
4961   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )   // BET
4962
4963   PORT_START("KEY7")
4964   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )   // C
4965   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )   // G
4966   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )   // K
4967   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )   // Chi
4968   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )   // Ron
4969   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // nothing
4970
4971   PORT_START("KEY8")
4972   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )   // D
4973   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )   // H
4974   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )   // L
4975   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )   // Pon
4976   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )   // nothing
4977   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   // nothing
4978
4979   PORT_START("KEY9")
4980   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )   // "l"
4981   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )   // "t"
4982   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )   // "w"
4983   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )   // Flip Flop
4984   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )   // "b"
4985   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )   // "s"
4986
4987   PORT_START("DSW1")
4988   PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate (%)" )
4989   PORT_DIPSETTING(    0x00, "50" )
4990   PORT_DIPSETTING(    0x01, "53" )
4991   PORT_DIPSETTING(    0x02, "56" )
4992   PORT_DIPSETTING(    0x03, "59" )
4993   PORT_DIPSETTING(    0x04, "62" )
4994   PORT_DIPSETTING(    0x05, "65" )
4995   PORT_DIPSETTING(    0x06, "68" )
4996   PORT_DIPSETTING(    0x07, "71" )
4997   PORT_DIPSETTING(    0x08, "75" )
4998   PORT_DIPSETTING(    0x09, "78" )
4999   PORT_DIPSETTING(    0x0a, "81" )
5000   PORT_DIPSETTING(    0x0b, "84" )
5001   PORT_DIPSETTING(    0x0c, "87" )
5002   PORT_DIPSETTING(    0x0d, "90" )
5003   PORT_DIPSETTING(    0x0e, "93" )
5004   PORT_DIPSETTING(    0x0f, "96" )
5005   PORT_DIPNAME( 0x30, 0x30, "Odds Rate" )
5006   PORT_DIPSETTING(    0x30, "1 2 4 8 12 16 24 32" )
5007   PORT_DIPSETTING(    0x00, "1 2 3 5 8 15 30 50" )
5008   PORT_DIPSETTING(    0x20, "2 3 6 8 12 15 30 50" )
5009   PORT_DIPSETTING(    0x10, "1 2 3 5 10 25 50 100" )
5010   PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
5011   PORT_DIPSETTING(    0xc0, "1" )
5012   PORT_DIPSETTING(    0x80, "5" )
5013   PORT_DIPSETTING(    0x40, "10" )
5014   PORT_DIPSETTING(    0x00, "20" )
5015
5016   PORT_START("DSW2")
5017   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
5018   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
5019   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
5020   PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ) )
5021   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
5022   PORT_DIPNAME( 0x0c, 0x0c, "Min Credits To Start" )
5023   PORT_DIPSETTING(    0x0c, "1" )
5024//  PORT_DIPSETTING(    0x08, "2" ) // ? these don't let you start a game
5025//  PORT_DIPSETTING(    0x04, "3" )
5026//  PORT_DIPSETTING(    0x00, "5" )
5027   PORT_DIPNAME( 0x30, 0x30, "Payout" )
5028   PORT_DIPSETTING(    0x30, "300" )
5029   PORT_DIPSETTING(    0x20, "500" )
5030   PORT_DIPSETTING(    0x10, "700" )
5031   PORT_DIPSETTING(    0x00, "1000" )
5032   PORT_DIPNAME( 0x40, 0x40, "W-BET" )
5033   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5034   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5035   PORT_DIPNAME( 0x80, 0x80, "Last Chance" )
5036   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5037   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5038
5039   PORT_START("DSW3")
5040   PORT_DIPNAME( 0x07, 0x07, "YAKUMAN Bonus" )
5041   PORT_DIPSETTING(    0x07, "Cut" )
5042   PORT_DIPSETTING(    0x06, "1 T" )
5043   PORT_DIPSETTING(    0x05, "300" )
5044   PORT_DIPSETTING(    0x04, "500" )
5045   PORT_DIPSETTING(    0x03, "700" )
5046   PORT_DIPSETTING(    0x02, "1000" )
5047   PORT_DIPSETTING(    0x01, "1500" )
5048   PORT_DIPSETTING(    0x00, "2000" )
5049   PORT_DIPNAME( 0x18, 0x18, "YAKUMAN Times" )
5050//  PORT_DIPSETTING(    0x00, "1" )
5051   PORT_DIPSETTING(    0x18, "1" )
5052   PORT_DIPSETTING(    0x10, "2" )
5053   PORT_DIPSETTING(    0x08, "3" )
5054   PORT_DIPNAME( 0x20, 0x20, "3 BAI In YAKUMAN Bonus Chance" )
5055   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5056   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5057   PORT_DIPNAME( 0x40, 0x40, "Auto Tsumo" )
5058   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5059   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5060   PORT_DIPNAME( 0x80, 0x80, "Credit Timing" )
5061   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5062   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5063
5064   PORT_START("DSW4")
5065   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
5066   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5067   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5068   PORT_DIPNAME( 0x02, 0x00, "In Game Music" )
5069   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5070   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5071   PORT_DIPNAME( 0x04, 0x00, "Girls" )
5072   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
5073   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5074   PORT_DIPNAME( 0x08, 0x08, "Girls Show After 3 Renso" )
5075   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5076   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5077   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
5078   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
5079   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5080   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
5081   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5082   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5083   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
5084   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5085   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5086   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
5087   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5088   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5089
5090   PORT_START("DSW5")
5091   PORT_DIPNAME( 0x01, 0x01, "Credits Per Note" )
5092   PORT_DIPSETTING(    0x01, "5" )
5093   PORT_DIPSETTING(    0x00, "10" )
5094   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
5095   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
5096   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5097   PORT_DIPNAME( 0x0c, 0x0c, "Computer Strength" )
5098   PORT_DIPSETTING(    0x0c, "Weak" )
5099   PORT_DIPSETTING(    0x08, DEF_STR( Normal ))
5100   PORT_DIPSETTING(    0x04, "Strong" )
5101   PORT_DIPSETTING(    0x00, "Very Strong" )
5102   PORT_DIPNAME( 0x10, 0x10, "Game Style" )
5103   PORT_DIPSETTING(    0x10, "Credit" )
5104   PORT_DIPSETTING(    0x00, "Credit Time" )
5105   PORT_DIPNAME( 0x20, 0x20, "Start Method (Credit Time)" )
5106   PORT_DIPSETTING(    0x20, "?" )
5107   PORT_DIPSETTING(    0x00, "Rate" )
5108   PORT_DIPNAME( 0x40, 0x40, "Unknown 4-8" )
5109   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5110   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5111   PORT_DIPNAME( 0x80, 0x80, "Unknown 4-9" )
5112   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
5113   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5114
5115   PORT_START("BET")
5116   PORT_DIPNAME( 0x40, 0x40, "Bets?" )
5117   PORT_DIPSETTING(    0x40, "0" )
5118   PORT_DIPSETTING(    0x00, "1" )
5119
5120   PORT_START("HOPPER")
5121   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
5122   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
5123   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
5124
5125INPUT_PORTS_END
5126
5127
47805128static INPUT_PORTS_START( mjchuuka )
47815129
47825130   PORT_START("SYSTEM")
r4057r4058
64956843static MACHINE_DRIVER_START( ddenlovr )
64966844
64976845   /* basic machine hardware */
6498   MDRV_CPU_ADD("main",M68000,24000000 / 2)
6846   MDRV_CPU_ADD("main",M68000, XTAL_24MHz / 2)
64996847   MDRV_CPU_PROGRAM_MAP(ddenlovr_readmem,ddenlovr_writemem)
65006848   MDRV_CPU_VBLANK_INT("main", irq1_line_hold)
65016849
r4057r4058
65166864   /* sound hardware */
65176865   MDRV_SPEAKER_STANDARD_MONO("mono")
65186866
6519   MDRV_SOUND_ADD("ym", YM2413, 3579545)
6867   MDRV_SOUND_ADD("ym", YM2413, XTAL_28_63636MHz / 8)
65206868   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
65216869
6522   MDRV_SOUND_ADD("ay8910", AY8910, 1789772)
6870   MDRV_SOUND_ADD("ay8910", AY8910, XTAL_28_63636MHz / 16)   // or /8 ?
65236871   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
65246872
6525   MDRV_SOUND_ADD("oki", OKIM6295, 1022720)
6526   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
6873   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_28_63636MHz / 28)
6874   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
65276875   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
65286876
65296877   /* devices */
r4057r4058
65386886   MDRV_CPU_PROGRAM_MAP(ddenlvrj_readmem,ddenlvrj_writemem)
65396887MACHINE_DRIVER_END
65406888
6889static MACHINE_DRIVER_START( ddenlvrk )
6890   MDRV_IMPORT_FROM(ddenlovr)
6891   MDRV_CPU_MODIFY("main")
6892   MDRV_CPU_PROGRAM_MAP(ddenlvrk_readmem,ddenlvrk_writemem)
6893MACHINE_DRIVER_END
6894
65416895static MACHINE_DRIVER_START( akamaru )
65426896
65436897   /* basic machine hardware */
r4057r4058
70637417   MDRV_CPU_VBLANK_INT("main", hparadis_irq)
70647418MACHINE_DRIVER_END
70657419
7420static MACHINE_DRIVER_START( jongtei )
70667421
7422   /* basic machine hardware */
7423   MDRV_CPU_ADD("main",Z80, XTAL_20MHz / 2)   // ?
7424   MDRV_CPU_PROGRAM_MAP(hanakanz_readmem,hanakanz_writemem)
7425   MDRV_CPU_IO_MAP(jongtei_readport,jongtei_writeport)
7426   MDRV_CPU_VBLANK_INT("main", hanakanz_irq)
7427
7428   /* video hardware */
7429   MDRV_SCREEN_ADD("main", RASTER)
7430   MDRV_SCREEN_REFRESH_RATE(60)
7431   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
7432   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
7433   MDRV_SCREEN_SIZE(336, 256)
7434   MDRV_SCREEN_VISIBLE_AREA(0, 336-1, 5, 256-11-1)
7435
7436   MDRV_PALETTE_LENGTH(0x200)
7437
7438   MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
7439   MDRV_VIDEO_START(hanakanz)   // blitter commands in the roms are shuffled around
7440   MDRV_VIDEO_UPDATE(ddenlovr)
7441
7442   /* sound hardware */
7443   MDRV_SPEAKER_STANDARD_MONO("mono")
7444
7445   MDRV_SOUND_ADD("ym", YM2413, XTAL_28_63636MHz / 8)
7446   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
7447
7448   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_28_63636MHz / 28)
7449   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
7450   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
7451
7452   /* devices */
7453   MDRV_MSM6242_ADD("rtc")
7454MACHINE_DRIVER_END
7455
7456
70677457/***************************************************************************
70687458
70697459Monkey Mole Panic
r4057r4058
71057495   ROM_REGION( 0x20000, "sound", 0 )   /* Z80 Code */
71067496   ROM_LOAD( "nwc7003",      0x00000, 0x20000, CRC(4f02ce44) SHA1(9a3abd9c555d5863a2110d84d1a3f582ba9d56b9) )   // 1xxxxxxxxxxxxxxxx = 0xFF
71077497
7108   ROM_REGION( 0x280000, "gfx1", 0 )   /* blitter data */
7498   ROM_REGION( 0x280000, "blitter", 0 )   /* blitter data */
71097499   ROM_LOAD( "nwc7004",      0x000000, 0x100000, CRC(5b4ad8c5) SHA1(a92a0bef01c71e745597ec96e7b8aa0ec26dc59d) )
71107500   ROM_LOAD( "nwc7005",      0x100000, 0x100000, CRC(9ec41956) SHA1(5a92d725cee7052e1c3cd671b58795125c6a4ea9) )
71117501   ROM_LOAD( "nwc7006a",     0x200000, 0x080000, CRC(9099c571) SHA1(9762612f41384602d545d2ec6dabd5f077d5fe21) )
r4057r4058
71807570   ROM_REGION( 0x20000, "sound", 0 )   /* Z80 Code */
71817571   ROM_LOAD( "7503s.8e",     0x00000, 0x20000, CRC(d1fac899) SHA1(dde2824d73b13c18b83e4c4b63fe7835bce87ea4) )   // 1xxxxxxxxxxxxxxxx = 0xFF
71827572
7183   ROM_REGION( 0x200000, "gfx1", 0 )   /* blitter data */
7573   ROM_REGION( 0x200000, "blitter", 0 )   /* blitter data */
71847574   ROM_LOAD( "7504.17b",     0x000000, 0x100000, CRC(b62de6a3) SHA1(62abf09b52844d3b3325e8931cb572c15581964f) )
71857575   ROM_LOAD( "7505.17d",     0x100000, 0x080000, CRC(729b073f) SHA1(8e41fafc47adbe76452e92ab1459536a5a46784d) )
71867576   ROM_LOAD( "7506s.17f",    0x180000, 0x080000, CRC(1be1ae17) SHA1(57bf9bcd9df49cdbb1311ec9e850cb1a141e5069) )
r4057r4058
72217611   ROM_RELOAD(               0x10000, 0x80000 )
72227612   ROM_LOAD( "nwc7303.4e",   0x90000, 0x80000, CRC(ffc77601) SHA1(b25c4a027e1fa4397dd86299dfe9251022b0d174) )
72237613
7224   ROM_REGION( 0x320000, "gfx1", 0 )   /* blitter data */
7614   ROM_REGION( 0x320000, "blitter", 0 )   /* blitter data */
72257615   ROM_LOAD( "nwc7307.s4b",  0x000000, 0x80000, CRC(a09d1dbe) SHA1(f17af24293eea803ebb5c758bffb4519dcad3a71) )
72267616   ROM_LOAD( "nwc7306.s3b",  0x080000, 0x80000, CRC(52d27aac) SHA1(3c38278a5ce757ca0c4a22e4de6052132edd7cbc) )
72277617   ROM_LOAD( "nwc7305.s2b",  0x100000, 0x80000, CRC(5f50914e) SHA1(1fe5df146e028995c53a5aca896546898d7b5914) )
r4057r4058
72407630   ROM_RELOAD(               0x10000, 0x80000 )
72417631   ROM_LOAD( "3.rom",        0x90000, 0x80000, CRC(6028198f) SHA1(f78c3cfc0663b44655cb75928941a5ec4a57c8ba) )
72427632
7243   ROM_REGION( 0x420000, "gfx1", 0 )   /* blitter data */
7633   ROM_REGION( 0x420000, "blitter", 0 )   /* blitter data */
72447634   ROM_LOAD( "4.rom",        0x000000, 0x80000, CRC(e6bdea31) SHA1(cb39d1d5e367ad2623c2bd0b2966541aa41bbb9b) )
72457635   ROM_LOAD( "5.rom",        0x080000, 0x80000, CRC(c243f10a) SHA1(22366a9441b8317780e85065accfa59fe1cd8258) )
72467636   ROM_LOAD( "11.rom",       0x100000, 0x80000, CRC(c9ae5880) SHA1(1bbda7293178132797dd017d71b24aba5ce57022) )
r4057r4058
72647654   ROM_LOAD16_BYTE( "7803.3b",  0x100000, 0x040000, CRC(10d315b1) SHA1(9f1bb57ba32152cca3b88fc3f841451b2b506a74) )
72657655   ROM_LOAD16_BYTE( "7802.3d",  0x100001, 0x040000, CRC(6616caa3) SHA1(3b3fda61fa62c10b4d9e07e898018ffc9fab0f91) )
72667656
7267   ROM_REGION( 0x380000, "gfx1", 0 )   /* blitter data */
7657   ROM_REGION( 0x380000, "blitter", 0 )   /* blitter data */
72687658   ROM_LOAD( "7810.14b", 0x000000, 0x100000, CRC(4b1a4984) SHA1(581ee032b396d65cd604f39846153a4dcb296aad) )
72697659   ROM_LOAD( "7809.13b", 0x100000, 0x100000, CRC(139d52ab) SHA1(08d705301379fcb952cbb1add0e16a148e611bbb) )
72707660   ROM_LOAD( "7808.12b", 0x200000, 0x080000, CRC(a09fd4a4) SHA1(016ecbf1d27a4890dee01e1966ec5efff6eb3afe) )
r4057r4058
72847674   ROM_LOAD16_BYTE( "7803.rom", 0x100000, 0x040000, CRC(5b7a78d3) SHA1(6ade16df301b57e4a7309834a47ca72300f50ffa) )
72857675   ROM_LOAD16_BYTE( "7802.rom", 0x100001, 0x040000, CRC(c3238a9d) SHA1(6b4b2ab1315fc9e2667b4f8f394e00a27923f926) )
72867676
7287   ROM_REGION( 0x400000, "gfx1", 0 )   /* blitter data */
7677   ROM_REGION( 0x400000, "blitter", 0 )   /* blitter data */
72887678   ROM_LOAD( "7810.rom", 0x000000, 0x100000, CRC(4b1a4984) SHA1(581ee032b396d65cd604f39846153a4dcb296aad) )
72897679   ROM_LOAD( "7809.rom", 0x100000, 0x100000, CRC(139d52ab) SHA1(08d705301379fcb952cbb1add0e16a148e611bbb) )
72907680   ROM_LOAD( "7808.rom", 0x200000, 0x080000, CRC(a09fd4a4) SHA1(016ecbf1d27a4890dee01e1966ec5efff6eb3afe) )
r4057r4058
73187708   ROM_RELOAD(               0x10000, 0x80000 )
73197709   /* 90000-10ffff empty */
73207710
7321   ROM_REGION( 0x280000, "gfx1", 0 )   /* blitter data */
7711   ROM_REGION( 0x280000, "blitter", 0 )   /* blitter data */
73227712   ROM_LOAD( "8003.8c",      0x000000, 0x80000, CRC(f57192e5) SHA1(e33f5243028520492cd876be3e4b6a76a9b20d46) )
73237713   ROM_LOAD( "8004.9c",      0x080000, 0x80000, CRC(c8c0b5cb) SHA1(d0c99908022b7d5d484e6d1990c00f15f7d8665a) )
73247714   ROM_LOAD( "8005e.10c",    0x100000, 0x80000, CRC(11c7a23c) SHA1(96d6b82db2555f7d0df661367a7a09bd4eaecba9) )
r4057r4058
73667756   ROM_RELOAD(               0x10000, 0x80000 )
73677757   /* 90000-10ffff empty */
73687758
7369   ROM_REGION( 0x280000, "gfx1", 0 )   /* blitter data */
7759   ROM_REGION( 0x280000, "blitter", 0 )   /* blitter data */
73707760   ROM_LOAD( "rr_8003.rom",  0x000000, 0x80000, CRC(f57192e5) SHA1(e33f5243028520492cd876be3e4b6a76a9b20d46) )
73717761   ROM_LOAD( "rr_8004.rom",  0x080000, 0x80000, CRC(c8c0b5cb) SHA1(d0c99908022b7d5d484e6d1990c00f15f7d8665a) )
73727762   ROM_LOAD( "rr_8005g.rom", 0x100000, 0x80000, CRC(11c7a23c) SHA1(96d6b82db2555f7d0df661367a7a09bd4eaecba9) )
r4057r4058
74117801   ROM_RELOAD(          0x10000, 0x80000 )
74127802   /* 90000-10ffff empty */
74137803
7414   ROM_REGION( 0x240000, "gfx1", 0 )   /* blitter data */
7804   ROM_REGION( 0x240000, "blitter", 0 )   /* blitter data */
74157805   ROM_LOAD( "8003.8c",  0x000000, 0x80000, CRC(f57192e5) SHA1(e33f5243028520492cd876be3e4b6a76a9b20d46) )
74167806   ROM_LOAD( "8004.9c",  0x080000, 0x80000, CRC(c8c0b5cb) SHA1(d0c99908022b7d5d484e6d1990c00f15f7d8665a) )
74177807   ROM_LOAD( "8005.10c", 0x100000, 0x80000, CRC(d1e5f74c) SHA1(808b37a4992f27768b85eea24fd868d5c9b1e1c0) )
r4057r4058
74447834   ROM_LOAD16_BYTE( "10304.rom", 0x100001, 0x040000, CRC(da1f56e5) SHA1(76c865927ee8392dd77476a248816e04e60c784a) )
74457835   ROM_CONTINUE(                 0x100001, 0x040000 )   // 1ST AND 2ND HALF IDENTICAL
74467836
7447   ROM_REGION( 0x400000, "gfx1", 0 )   /* blitter data */
7837   ROM_REGION( 0x400000, "blitter", 0 )   /* blitter data */
74487838   ROM_LOAD( "10307.rom", 0x000000, 0x100000, CRC(c7a3b05f) SHA1(c931670c5d14f8446404ad00d785fa73d97dedfc) )
74497839   ROM_LOAD( "10308.rom", 0x100000, 0x100000, CRC(416807a1) SHA1(bccf746ddc9750e3956299fec5b3737a53b24c36) )
74507840   ROM_LOAD( "10309.rom", 0x200000, 0x100000, CRC(81841272) SHA1(659c009c41ae54d330da41922c8afd1fb293d854) )
r4057r4058
74927882   ROM_LOAD16_BYTE( "1124.2d", 0x000000, 0x040000, CRC(6a9ec557) SHA1(e1512601910a9d06e16a20e10ab7acc96a0819bd) )
74937883   ROM_LOAD16_BYTE( "1123.2h", 0x000001, 0x040000, CRC(d41cbed0) SHA1(5c80f6a6cf15518120f664a0446355e80eeb2a0f) )
74947884
7495   ROM_REGION( 0xe80000, "gfx1", 0 )   /* blitter data */
7885   ROM_REGION( 0xe80000, "blitter", 0 )   /* blitter data */
74967886   /* 000000-bfffff empty */
74977887   ROM_LOAD( "1125.2b", 0xc00000, 0x080000, CRC(0181f53c) SHA1(64a6a2f00f81f7181700b83912033a6ee8bbf73a) )
74987888   ROM_LOAD( "1126.2a", 0xc80000, 0x080000, CRC(17ff2df4) SHA1(7b6723e0a0f471698735a31aa19dc4ebabe35e8c) )
r4057r4058
75087898
75097899/***************************************************************************
75107900
7901Don Den Lover (Korea)
7902Dynax, 1995
7903
7904PCB Layout
7905----------
7906
7907Top Board
7908
7909N113SUB
7910|-----------------|
7911|     PLCC44      |
7912|1F 1E       1B 1A|
7913|                 |
7914|                 |
7915|                 |
7916|   2E 2D 2C 2B 2A|
7917|                 |
7918|-----------------|
7919Notes:
7920      PLCC44 - Actel A1010B CPLD
7921
7922Bottom Board
7923
7924|-------------------------------------|
7925|UPC1241  BATTERY                     |
7926|LM358 LM358   M28    6264     68000  |
7927|YM2413    72421      6264            |
7928|ULN2003  95105           PAL         |
7929|J                              24MHz |
7930|A                           M514262  |
7931|M                           M514262  |
7932|M          28.63636MHz      M514262  |
7933|A          62256            M514262  |
7934|                                     |
7935|                      NL-005         |
7936|DSW1(8)                              |
7937|-------------------------------------|
7938Notes:
7939      68000 - clock 12.000MHz [24/2]
7940      M28   - M6295 clock 1.022727143MHz [28.63636/28]. Pin7 HIGH
7941      95105 - unknown DIP40 chip
7942      72421 - RTC IC
7943      YM2413- clock 3.579545MHz [28.63636/8]
7944      VSync - 60.8516Hz
7945      HSync - 15.2782kHz
7946
7947Hardware info by Guru
7948
7949***************************************************************************/
7950
7951ROM_START( ddenlvrk )
7952   ROM_REGION( 0x080000, "main", 0 )      /* 68000 Code */
7953   ROM_LOAD16_BYTE( "rom.1a", 0x000000, 0x40000, CRC(868c45f8) SHA1(023ceaa30cfa03470ef005c8b739a85ae9764e15) )
7954   ROM_LOAD16_BYTE( "rom.1b", 0x000001, 0x40000, CRC(4fab3c90) SHA1(61a756a3ccae39f3a649371116b9d940d3b1b852) )
7955
7956   ROM_REGION( 0x280000, "blitter", 0 )   /* blitter data */
7957   ROM_LOAD( "rom.2a", 0x000000, 0x80000, CRC(ee143d8e) SHA1(61a36c64d450209071e996b418adf416dfa68fd9) )
7958   ROM_LOAD( "rom.2b", 0x080000, 0x80000, CRC(58a662be) SHA1(3e2fc167bdee74ebfa63c3b1b0d822e3d898c30c) )
7959   ROM_LOAD( "rom.2c", 0x100000, 0x80000, CRC(f96e0708) SHA1(e910970a4203b9b1943c853e3d869dd43cdfbc2d) )
7960   ROM_LOAD( "rom.2d", 0x180000, 0x80000, CRC(b47e27ec) SHA1(5a36e68eb7c868ce8ca9d11bd9bcaa7f101ee64f) )
7961   ROM_LOAD( "rom.2e", 0x200000, 0x80000, CRC(7c7beef6) SHA1(f8631aaec7cc01cc6478f3fc95fdac51c5b5d226) )
7962
7963   ROM_REGION( 0x200000, "oki", ROMREGION_ERASE )   /* Samples */
7964   ROM_LOAD( "rom.1e", 0x080000, 0x40000, CRC(a49318df) SHA1(d952cab857a21e7710fad5b4977b11ff3794ac4d) )   // bank 2
7965   ROM_CONTINUE(       0x180000, 0x40000 )                                                   // bank 6
7966   ROM_LOAD( "rom.1f", 0x040000, 0x40000, CRC(9df4f029) SHA1(a8da9905f60910437756dede66a21c8653d98ca6) )   // bank 1
7967   ROM_CONTINUE(       0x140000, 0x40000 )                                                   // bank 5
7968ROM_END
7969
7970
7971/***************************************************************************
7972
75117973Don Den Lover Vol 1
75127974(C) Dynax Inc 1995
75137975
r4057r4058
75317993   ROM_LOAD16_BYTE( "1134h.1a", 0x000000, 0x040000, CRC(43accdff) SHA1(3023d4a071fc877f8e4325e95e586739077ccb02) )
75327994   ROM_LOAD16_BYTE( "1133h.1c", 0x000001, 0x040000, CRC(361bf7b6) SHA1(1727112284cd1dcc1ed17ccba214cb0f8993650a) )
75337995
7534   ROM_REGION( 0x480000, "gfx1", 0 )   /* blitter data */
7996   ROM_REGION( 0x480000, "blitter", 0 )   /* blitter data */
75357997   /* 000000-1fffff empty */
75367998   ROM_LOAD( "1135h.3h", 0x200000, 0x080000, CRC(ee143d8e) SHA1(61a36c64d450209071e996b418adf416dfa68fd9) )
75377999   ROM_LOAD( "1136h.3f", 0x280000, 0x080000, CRC(58a662be) SHA1(3e2fc167bdee74ebfa63c3b1b0d822e3d898c30c) )
r4057r4058
75798041   ROM_LOAD16_BYTE( "rom2", 0x000000, 0x040000, CRC(cabdf78f) SHA1(789d4754c7b84964ee317b8a618f26a417f50bcc) )
75808042   ROM_LOAD16_BYTE( "rom3", 0x000001, 0x040000, CRC(36f8d05e) SHA1(78f75175541ebf377f5375ea30d80ea91f380971) )
75818043
7582   ROM_REGION( 0x480000, "gfx1", 0 )   /* blitter data */
8044   ROM_REGION( 0x280000, "blitter", 0 )   /* blitter data */
75838045   ROM_LOAD( "rom4", 0x000000, 0x080000, CRC(ee143d8e) SHA1(61a36c64d450209071e996b418adf416dfa68fd9) )
75848046   ROM_LOAD( "rom5", 0x080000, 0x080000, CRC(58a662be) SHA1(3e2fc167bdee74ebfa63c3b1b0d822e3d898c30c) )
75858047   ROM_LOAD( "rom6", 0x100000, 0x080000, CRC(f96e0708) SHA1(e910970a4203b9b1943c853e3d869dd43cdfbc2d) )
r4057r4058
75878049   ROM_LOAD( "rom8", 0x200000, 0x080000, CRC(7c7beef6) SHA1(f8631aaec7cc01cc6478f3fc95fdac51c5b5d226) )
75888050
75898051   ROM_REGION( 0x200000, "oki", 0 )   /* Samples */
7590   ROM_LOAD( "rom1", 0x100000, 0x080000, CRC(ba4723e8) SHA1(fd32b33bd43773fed083990b59a3994f4a631b04) )
8052   ROM_LOAD( "rom1", 0x000000, 0x080000, CRC(ba4723e8) SHA1(fd32b33bd43773fed083990b59a3994f4a631b04) )
75918053ROM_END
75928054
75938055static DRIVER_INIT( rongrong )
r4057r4058
76238085   ROM_LOAD( "50720.5b",     0x00000, 0x80000, CRC(dc40fcfc) SHA1(32c8b3d23039ac47504c881552572f2c22afa585) )
76248086   ROM_RELOAD(               0x10000, 0x80000 )
76258087
7626   ROM_REGION( 0x300000, "gfx1", 0 )   /* blitter data */
8088   ROM_REGION( 0x300000, "blitter", 0 )   /* blitter data */
76278089   ROM_LOAD16_BYTE( "50740.8b",     0x000000, 0x80000, CRC(999e70ce) SHA1(421c137b43522fbf9f3f5aa86692dc563af86880) )
76288090   ROM_LOAD16_BYTE( "50730.8c",     0x000001, 0x80000, CRC(54e1731d) SHA1(c3f60c4412665b379b4b630ead576691d7b2a598) )
76298091   ROM_LOAD16_BYTE( "50760.10b",    0x100000, 0x80000, CRC(8fcb5da3) SHA1(86bd4f89e860cd476a026c21a87f34b7a208c539) )
r4057r4058
76708132   ROM_LOAD( "nm5102.5b",    0x00000, 0x80000, CRC(c56c0856) SHA1(9b3c17c80498c9fa0ea91aa876aa4853c95ebb8c) )
76718133   ROM_RELOAD(               0x10000, 0x80000 )
76728134
7673   ROM_REGION( 0xe80000, "gfx1", 0 )   /* blitter data */
8135   ROM_REGION( 0xe80000, "blitter", 0 )   /* blitter data */
76748136
76758137   ROM_LOAD16_BYTE( "nm5104.8b",    0xc00000, 0x080000, CRC(e91dd92b) SHA1(a4eb8a6237e63639da5fc1bc504c8dc2aee99ff5) )
76768138   ROM_LOAD16_BYTE( "nm5103.8c",    0xc00001, 0x080000, CRC(4d4e248b) SHA1(f981ba8a05bac59c665fb0fd201ea8ff3bd87a3c) )
r4057r4058
77208182   ROM_LOAD( "52602-n.5b",   0x00000, 0x80000, CRC(6bef7978) SHA1(56e38448fb03e868094d75e5b7de4e4f4a4e850a) )
77218183   ROM_RELOAD(               0x10000, 0x80000 )
77228184
7723   ROM_REGION( 0x500000, "gfx1", 0 )   /* blitter data */
8185   ROM_REGION( 0x500000, "blitter", 0 )   /* blitter data */
77248186   ROM_LOAD16_BYTE( "52604.8b",     0x000000, 0x100000, CRC(6ce01bb4) SHA1(800043d8203ab5560ed0b24e0a4e01c14b6a3ac0) )
77258187   ROM_LOAD16_BYTE( "52603.8c",     0x000001, 0x100000, CRC(16d2c169) SHA1(3e50b1109c86d0e8f931ce5a3abf20d807ebabba) )
77268188   ROM_LOAD16_BYTE( "52606.10b",    0x200000, 0x100000, CRC(07fe5dae) SHA1(221ec21c2d84497af5b769d7409f8775be933783) )
r4057r4058
77778239   ROM_LOAD( "d12102.5b", 0x00000, 0x80000, CRC(585a0a8e) SHA1(94b3eede36117fe0a34b61454484c72cd7f0ce6a) )
77788240   ROM_RELOAD(            0x10000, 0x80000 )
77798241
7780   ROM_REGION( 0x300000, "gfx1", ROMREGION_ERASEFF )   /* blitter data */
8242   ROM_REGION( 0x300000, "blitter", ROMREGION_ERASEFF )   /* blitter data */
77818243   ROM_LOAD16_BYTE( "d12103.11c", 0x000000, 0x080000, CRC(83bfc841) SHA1(36547e737244f95004c598adeb46cebce9ab3231) )
77828244   ROM_LOAD16_BYTE( "d12104.11a", 0x000001, 0x080000, CRC(1bf6220a) SHA1(ea18fdf6e1298a3b4c91fbf6219b1edcfecaeca3) )
77838245   ROM_LOAD16_BYTE( "d12105.12c", 0x100000, 0x080000, CRC(3424c8ac) SHA1(ee48622b478d39c6bdb5a18cab204e14f7d54f7a) )
r4057r4058
78588320   ROM_LOAD( "2.5b", 0x00000, 0x80000, CRC(7957b4e7) SHA1(8b76c15694e42ff0b2ec5aeae059bf342f6bf476) )
78598321   ROM_RELOAD(       0x10000, 0x80000 )
78608322
7861   ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF )   /* blitter data */
8323   ROM_REGION( 0x100000, "blitter", ROMREGION_ERASEFF )   /* blitter data */
78628324   ROM_LOAD16_BYTE( "3.11c", 0x000000, 0x080000, CRC(c66553c3) SHA1(6e5380fdb97cc8b52986f3a3a8cac43c0f38cf54) )
78638325   ROM_LOAD16_BYTE( "4.11a", 0x000001, 0x080000, CRC(972852fb) SHA1(157f0a772bf060efc39033b10e63a6cb1022edf6) )
78648326
r4057r4058
79178379   ROM_REGION( 0x20000, "sound", 0 )   /* Z80 Code */
79188380   ROM_LOAD( "7401.1h",      0x00000, 0x20000, CRC(0f47d785) SHA1(d57733db6dcfb4c2cdaad04b5d3f0f569a0e7461) )   // 1xxxxxxxxxxxxxxxx = 0xFF
79198381
7920ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )   /* blitter data */
8382ROM_REGION( 0x500000, "blitter", ROMREGION_ERASE00 )   /* blitter data */
79218383   ROM_LOAD( "7404.8b",      0x000000, 0x080000, CRC(aa4ddf32) SHA1(864890795a238ab34a85ca55a387d7e5efafccee) )         // \ 7e6f +
79228384   ROM_LOAD( "7405.9b",      0x080000, 0x080000, CRC(fc125bd8) SHA1(150578f67d89be59eeeb811c159a789e5e9c993e) )         // / 35bb = b42a OK
79238385   ROM_LOAD( "7406.10b",     0x100000, 0x080000, BAD_DUMP CRC(04a214b1) SHA1(af3e652377f5652377c7dedfad7c2677695eaf46) )   // \ af08 +
r4057r4058
79648426   ROM_LOAD( "77t2.c3", 0x00000, 0x40000, CRC(b1427cce) SHA1(1640f5bb6275cce92e38cf3e0c788b4e65606459) )
79658427   ROM_RELOAD(          0x10000, 0x40000 )
79668428
7967   ROM_REGION( 0x1a0000, "gfx1", ROMREGION_ERASE00 )   /* blitter data */
8429   ROM_REGION( 0x1a0000, "blitter", ROMREGION_ERASE00 )   /* blitter data */
79688430   ROM_LOAD( "77t6.b12", 0x000000, 0x080000, CRC(a287589a) SHA1(58659dd7e019d1d32efeaec548c84a7ded637c50) )
79698431   ROM_LOAD( "77t5.b11", 0x080000, 0x080000, CRC(a3475059) SHA1(ec86dcea3314b65d391a970680c021899c16449e) )
79708432   ROM_LOAD( "77t4.b10", 0x100000, 0x080000, CRC(f45c24d6) SHA1(0eca68f2ca5722717f27ac0839359966daa2715b) )
r4057r4058
80288490   ROM_LOAD( "2.3d", 0x00000, 0x40000, CRC(a1ff31fa) SHA1(f132aaf59570cbbd2c4eff3ee7bd4cec26ce2fbb) )
80298491   ROM_RELOAD(       0x10000, 0x40000 )
80308492
8031   ROM_REGION( 0x1a0000, "gfx1", ROMREGION_ERASE00 )   /* blitter data */
8493   ROM_REGION( 0x1a0000, "blitter", ROMREGION_ERASE00 )   /* blitter data */
80328494   ROM_LOAD( "5.12b", 0x000000, 0x100000, CRC(a1f26722) SHA1(604780c1df622a1fb05ea8175acfa774cbe9f6e1) )
80338495   ROM_LOAD( "4.11b", 0x100000, 0x080000, CRC(f45c24d6) SHA1(0eca68f2ca5722717f27ac0839359966daa2715b) )
80348496   ROM_LOAD( "3.10b", 0x180000, 0x020000, CRC(8671165b) SHA1(23fad112909e82ac9d25dbb69bf6334f30fa6540) )
r4057r4058
80938555   ROM_LOAD( "8101.2b", 0x00000, 0x40000, CRC(77a64b71) SHA1(3426998746c834435ff10a8d1c6502ea64a5f2e2) )
80948556   ROM_RELOAD(          0x10000, 0x40000 )
80958557
8096   ROM_REGION( 0x180000, "gfx1", ROMREGION_ERASEFF )   /* blitter data */
8558   ROM_REGION( 0x180000, "blitter", ROMREGION_ERASEFF )   /* blitter data */
80978559   ROM_LOAD( "8102.9a",  0x000000, 0x80000, CRC(0074af23) SHA1(39cd978bcc34b27fc896094cf2dd3b7d4596ab00) )
80988560   ROM_LOAD( "8103.10a", 0x080000, 0x80000, CRC(a3a4ecb5) SHA1(08264cf131fd4c02d8b5925564cf8daa56e0bbc2) )
80998561   ROM_LOAD( "8104.11a", 0x100000, 0x20000, CRC(24513af9) SHA1(ee1f440b64c1f8c1efc6f0c60e25cab257407865) )
r4057r4058
81558617   ROM_LOAD( "7102.3d", 0x00000, 0x40000, CRC(058f779b) SHA1(97253a86b2600c295f67e566ee3c0aa693ed117e) )
81568618   ROM_RELOAD(          0x10000, 0x40000 )
81578619
8158   ROM_REGION( 0x1a0000, "gfx1", 0 )   /* blitter data */
8620   ROM_REGION( 0x1a0000, "blitter", 0 )   /* blitter data */
81598621   ROM_LOAD( "7105.12b", 0x000000, 0x100000, CRC(35ca0079) SHA1(41b950b6fb9b216671d55dc399acb058ec80391f) )
81608622   ROM_LOAD( "7104.11b", 0x100000, 0x080000, CRC(6d0fd29a) SHA1(9b31668acf1790d9aecd1f8e8c0cb52a7a625d2d) )
81618623   ROM_LOAD( "7103.10b", 0x180000, 0x020000, CRC(88511487) SHA1(eae3008ecfcfa9aed667e69742b91d8e9f7302ec) )
r4057r4058
82178679   ROM_LOAD( "2.3d", 0x00000, 0x40000, CRC(3284d714) SHA1(be2d5c5129ba9d689e030cb53bc30ed01c941703) )
82188680   ROM_RELOAD(       0x10000, 0x40000 )
82198681
8220   ROM_REGION( 0x600000, "gfx1", 0 )   /* blitter data */
8682   ROM_REGION( 0x600000, "blitter", 0 )   /* blitter data */
82218683   // gap
82228684   ROM_LOAD( "5.11b", 0x400000, 0x80000, CRC(a287589a) SHA1(58659dd7e019d1d32efeaec548c84a7ded637c50) )
82238685   ROM_LOAD( "6.12b", 0x480000, 0x80000, CRC(a3475059) SHA1(ec86dcea3314b65d391a970680c021899c16449e) )
r4057r4058
82658727   ROM_LOAD16_BYTE( "50108.1a", 0x100000, 0x080000, CRC(1520ecad) SHA1(eaf44511148252eac0c7a7aab9bd689f87e5a40f) )
82668728   ROM_LOAD16_BYTE( "50106.1c", 0x100001, 0x080000, CRC(8e081747) SHA1(ef7fb469455671ca7982c2455e8cb113c2750e30) )
82678729
8268   ROM_REGION( 0x480000, "gfx1", 0 )   /* blitter data */
8730   ROM_REGION( 0x480000, "blitter", 0 )   /* blitter data */
82698731   ROM_LOAD( "50109.2h", 0x000000, 0x100000, CRC(cdff154d) SHA1(d9cdf159cd55fef0dd1abe07c2f19f05f63b2d1e) )
82708732   ROM_LOAD( "50112.2d", 0x100000, 0x100000, CRC(7fdd9853) SHA1(d4ada01fa49b2932d02df5eb3d3e7eaad535df0b) )
82718733   ROM_LOAD( "50110.3h", 0x200000, 0x100000, CRC(06ca4d87) SHA1(c80708df3613d36950ba5cc98d36336533ee7699) )
r4057r4058
83588820   ROM_LOAD( "50004.2e", 0x00000, 0x80000, CRC(20afcdec) SHA1(b3e7d6083dab812a497b69a501e9d993a8ca86e7) )
83598821   ROM_RELOAD(           0x10000, 0x80000 )
83608822
8361   ROM_REGION( 0x3c0000, "gfx1", 0 )   /* blitter data */
8823   ROM_REGION( 0x3c0000, "blitter", 0 )   /* blitter data */
83628824   ROM_LOAD( "50005.2d", 0x000000, 0x80000, CRC(6494d5ad) SHA1(2313ee2f897320715c3de9a0de5c66e06b763a5f) )
83638825   ROM_LOAD( "50006.2c", 0x080000, 0x80000, CRC(a1d61eb7) SHA1(4755c3843890f4682d5e5804153baba3d98ac2cc) )
83648826   ROM_LOAD( "50007.2b", 0x100000, 0x80000, CRC(d79ea2f5) SHA1(9c783ee8fe1f646ad2402676c3b924678955a964) )
r4057r4058
84608922   ROM_LOAD( "1012.3e", 0x00000, 0x40000, CRC(bd3a3a8f) SHA1(35d70c2869a93192de7041b5c90b8a8a5e910946) )
84618923   ROM_RELOAD(          0x10000, 0x40000 )
84628924
8463   ROM_REGION( 0x600000, "gfx1", 0 )   /* blitter data */
8925   ROM_REGION( 0x600000, "blitter", 0 )   /* blitter data */
84648926   // unused
84658927   ROM_LOAD( "1015.3a", 0x400000, 0x80000, CRC(ea7b282e) SHA1(4fb33f3a8fe0dd792bcdd90894b90f1ac09ef6a5) )
84668928   ROM_LOAD( "1014.2a", 0x480000, 0x80000, CRC(5f057c13) SHA1(d17211c3b697b48012018b738cff22fc4743d607) )
r4057r4058
85288990   ROM_LOAD( "1082b.2b", 0x00000, 0x40000, CRC(e33bc5a5) SHA1(cb723cc81b914b45f89236812492c105c93c4e0b) )
85298991   ROM_RELOAD(           0x10000, 0x40000 )
85308992
8531   ROM_REGION( 0x200000, "gfx1", 0 )   /* blitter data */
8993   ROM_REGION( 0x200000, "blitter", 0 )   /* blitter data */
85328994   // unused
85338995   ROM_LOAD( "1083.9a",  0x100000, 0x80000, CRC(054200c3) SHA1(7db457fa1f8639d15a6faa3e1e05d4302e7dd281) )
85348996   ROM_LOAD( "1084.10a", 0x180000, 0x80000, CRC(49f657e8) SHA1(077c553f88a76f826495ad516350a53ce361c6da) )
r4057r4058
85378999   ROM_LOAD( "1081.2d",  0x00000, 0x40000, CRC(74dede40) SHA1(d148f9ab9223b4c0b2f457a6f0e7fa3d173ab12b) )
85389000ROM_END
85399001
9002/***************************************************************************
85409003
8541GAME( 1992, mmpanic,  0,        mmpanic,  mmpanic,  0,        ROT0, "Nakanihon + East Technology (Taito license)", "Monkey Mole Panic (USA)",                            GAME_NO_COCKTAIL )
8542GAME( 1993, funkyfig, 0,        funkyfig, funkyfig, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "The First Funky Fighter",                            GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )   // scrolling, priority?
8543GAME( 1993, quizchq,  0,        quizchq,  quizchq,  0,        ROT0, "Nakanihon",                                   "Quiz Channel Question (Ver 1.00) (Japan)",           GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
8544GAME( 1993, quizchql, quizchq,  quizchq,  quizchq,  0,        ROT0, "Nakanihon (Laxan license)",                   "Quiz Channel Question (Ver 1.23) (Taiwan?)",         GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
8545GAME( 1993, animaljr, 0,        mmpanic,  animaljr, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "Animalandia Jr.",                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
8546GAME( 1994, hginga,   0,        hginga,   hginga,   0,        ROT0, "Dynax",                                       "Hanafuda Hana Ginga",                                GAME_NO_COCKTAIL )
8547GAME( 1994, mjmyster, 0,        mjmyster, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 1)",               GAME_NO_COCKTAIL )
8548GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 2)",               GAME_NO_COCKTAIL )
8549GAME( 1994, mjmyornt, 0,        mjmyornt, mjmyornt, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Orient",                      GAME_NO_COCKTAIL )
8550GAME( 1994, mjmyuniv, 0,        mjmyuniv, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Universe",                    GAME_NO_COCKTAIL )
8551GAME( 1994, quiz365,  0,        quiz365,  quiz365,  0,        ROT0, "Nakanihon",                                   "Quiz 365 (Japan)",                                   GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
8552GAME( 1994, quiz365t, quiz365,  quiz365,  quiz365,  0,        ROT0, "Nakanihon + Taito",                           "Quiz 365 (Hong Kong & Taiwan)",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
8553GAME( 1994, rongrong, 0,        rongrong, rongrong, rongrong, ROT0, "Nakanihon (Activision licence)",              "Puzzle Game Rong Rong (Europe)",                     GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
8554GAME( 1994, rongrngj, rongrong, rongrong, rongrong, rongrong, ROT0, "Nakanihon (Activision licence)",              "Puzzle Game Rong Rong (Japan)",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
8555GAME( 1994, rongrngg, rongrong, rongrong, rongrong, rongrong, ROT0, "Nakanihon (Activision licence)",              "Puzzle Game Rong Rong (Germany)",                    GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
8556GAME( 1994, hparadis, 0,        hparadis, hparadis, 0,        ROT0, "Dynax",                                       "Super Hana Paradise (Japan)",                        GAME_NO_COCKTAIL )
8557GAME( 1995, hgokou,   0,        hgokou,   hgokou,   0,        ROT0, "Dynax (Alba licence)",                      "Hanafuda Hana Gokou (Japan)",                        GAME_NO_COCKTAIL )
8558GAME( 1995, mjdchuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, v. D111)",        GAME_NO_COCKTAIL )
8559GAME( 1995, nettoqc,  0,        nettoqc,  nettoqc,  0,        ROT0, "Nakanihon",                                   "Nettoh Quiz Champion (Japan)",                       GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
8560GAME( 1995, ddenlvrj, 0,        ddenlvrj, ddenlvrj, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Shiro Kuro Tsukeyo! (Japan)", GAME_NO_COCKTAIL )
8561GAME( 1996, ddenlovr, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 (Hong Kong)",                   GAME_NO_COCKTAIL )
8562GAME( 1996, ddenlovb, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "[Dynax] (bootleg)",                           "Don Den Lover Vol. 1 (Korea, bootleg)",              GAME_NO_COCKTAIL )
8563GAME( 1996, hanakanz, 0,        hanakanz, hanakanz, 0,        ROT0, "Dynax",                                       "Hana Kanzashi (Japan)",                              GAME_NO_COCKTAIL )
8564GAME( 1996, akamaru,  0,        akamaru,  akamaru,  0,        ROT0, "Dynax (Nakanihon licence)",                   "Panel & Variety Akamaru Q Jousyou Dont-R",           GAME_NO_COCKTAIL )
8565GAME( 1996, mjflove,  0,        mjflove,  mjflove,  0,        ROT0, "Nakanihon",                                   "Mahjong Fantasic Love (Japan)",                      GAME_NO_COCKTAIL )
8566GAME( 1997, hkagerou, 0,        hkagerou, hkagerou, 0,        ROT0, "Nakanihon + Dynax",                           "Hana Kagerou [BET] (Japan)",                         GAME_NO_COCKTAIL )
8567GAME( 1998, mjchuuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong Chuukanejyo (China)",                        GAME_NO_COCKTAIL )
8568GAME( 1998, mjreach1, 0,        mjreach1, mjreach1, 0,        ROT0, "Nihon System",                                "Mahjong Reach Ippatsu (Japan)",                      GAME_NO_COCKTAIL )
9004Mahjong Jong-Tei
9005Dynax 1999
9006
9007PCB Layout
9008----------
9009
9010NM532-9902
9011|-----------------------------------------|
9012| TA7252        LM358  LM358  PST532 BATT |
9013|         VOL            M6295   32.768kHz|
9014|  DSW5(4)                        53201   |
9015|M                    YM2413 20MHz   M6242|
9016|A                                        |
9017|H            DSW1(10)       QFP100 62256 |
9018|J  ACTEL     DSW2(10)                    |
9019|O  A1010     DSW3(10)              53202 |
9020|N            DSW4(10)                    |
9021|G             28.63636MHz          53203 |
9022|                                         |
9023|                                   53204 |
9024|           M514262   4L10FXXXX           |
9025|           M524262                 53205 |
9026|           M514262                       |
9027|           M514262                 53206 |
9028|-----------------------------------------|
9029Notes:
9030      4L10FXXXX - Dynax graphics chip, surface scratch, but
9031                  it will be one of the usual ones
9032      QFP100    - Main CPU, surface scratched. Clock input 20.00MHz
9033      M6295     - Clock 1.022727143MHz [28.63636/28]. Pin 7 HIGH
9034      YM2413    - Clock 3.579545MHz [28.63636/8]
9035      VSync     - 60.7194Hz
9036      HSync     - 15.2443kHz
9037
9038***************************************************************************/
9039
9040ROM_START( jongtei )
9041   ROM_REGION( 0x90000+16*0x1000, "main", 0 )   /* Z80 Code */
9042   ROM_LOAD( "53202.5b", 0x00000, 0x80000, CRC(fa95a7f2) SHA1(bb67d74acb8908c222acdc92ee13d4a644358aef) )
9043   ROM_RELOAD(           0x10000, 0x80000 )
9044
9045   ROM_REGION( 0x800000, "blitter", 0 )   /* blitter data */
9046   ROM_LOAD( "53203.7b",  0x000000, 0x200000, CRC(55d6522a) SHA1(47996be70481a98ead10211645566613d20b5880) )
9047   ROM_LOAD( "53204.8b",  0x200000, 0x200000, CRC(4f58a303) SHA1(2893e6b47c3098cb878cf5fa5957e9652559e420) )
9048   ROM_LOAD( "53205.10b", 0x400000, 0x200000, CRC(d69e0355) SHA1(f67688eaf7954619785040204368d2cb5fc64e6e) )
9049   ROM_LOAD( "53206.12b", 0x600000, 0x200000, CRC(f0652395) SHA1(286683728836c452b71c3b8c48bd0f7159b2a10c) )
9050
9051   ROM_REGION( 0x200000, "oki", 0 )   /* Samples */
9052   ROM_LOAD( "53201.2a", 0x000000, 0x200000, CRC(c53d840c) SHA1(5a935320f48bdc8f3b9ed105dcdd0c6e33c3c38c) )
9053ROM_END
9054
9055
9056GAME( 1992, mmpanic,  0,        mmpanic,  mmpanic,  0,        ROT0, "Nakanihon + East Technology (Taito license)", "Monkey Mole Panic (USA)",                                         GAME_NO_COCKTAIL )
9057GAME( 1993, funkyfig, 0,        funkyfig, funkyfig, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "The First Funky Fighter",                                         GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS ) // scrolling, priority?
9058GAME( 1993, quizchq,  0,        quizchq,  quizchq,  0,        ROT0, "Nakanihon",                                   "Quiz Channel Question (Ver 1.00) (Japan)",                        GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
9059GAME( 1993, quizchql, quizchq,  quizchq,  quizchq,  0,        ROT0, "Nakanihon (Laxan license)",                   "Quiz Channel Question (Ver 1.23) (Taiwan?)",                      GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
9060GAME( 1993, animaljr, 0,        mmpanic,  animaljr, 0,        ROT0, "Nakanihon + East Technology (Taito license)", "Animalandia Jr.",                                                 GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
9061GAME( 1994, hginga,   0,        hginga,   hginga,   0,        ROT0, "Dynax",                                       "Hanafuda Hana Ginga",                                             GAME_NO_COCKTAIL )
9062GAME( 1994, mjmyster, 0,        mjmyster, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 1)",                            GAME_NO_COCKTAIL )
9063GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious World (set 2)",                            GAME_NO_COCKTAIL )
9064GAME( 1994, mjmyornt, 0,        mjmyornt, mjmyornt, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Orient",                                   GAME_NO_COCKTAIL )
9065GAME( 1994, mjmyuniv, 0,        mjmyuniv, mjmyster, 0,        ROT0, "Dynax",                                       "Mahjong The Mysterious Universe",                                 GAME_NO_COCKTAIL )
9066GAME( 1994, quiz365,  0,        quiz365,  quiz365,  0,        ROT0, "Nakanihon",                                   "Quiz 365 (Japan)",                                                GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
9067GAME( 1994, quiz365t, quiz365,  quiz365,  quiz365,  0,        ROT0, "Nakanihon + Taito",                           "Quiz 365 (Hong Kong & Taiwan)",                                   GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
9068GAME( 1994, rongrong, 0,        rongrong, rongrong, rongrong, ROT0, "Nakanihon (Activision licence)",              "Puzzle Game Rong Rong (Europe)",                                  GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
9069GAME( 1994, rongrngj, rongrong, rongrong, rongrong, rongrong, ROT0, "Nakanihon (Activision licence)",              "Puzzle Game Rong Rong (Japan)",                                   GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
9070GAME( 1994, rongrngg, rongrong, rongrong, rongrong, rongrong, ROT0, "Nakanihon (Activision licence)",              "Puzzle Game Rong Rong (Germany)",                                 GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
9071GAME( 1994, hparadis, 0,        hparadis, hparadis, 0,        ROT0, "Dynax",                                       "Super Hana Paradise (Japan)",                                     GAME_NO_COCKTAIL )
9072GAME( 1995, hgokou,   0,        hgokou,   hgokou,   0,        ROT0, "Dynax (Alba licence)",                      "Hanafuda Hana Gokou (Japan)",                                     GAME_NO_COCKTAIL )
9073GAME( 1995, mjdchuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong The Dai Chuuka Ken (China, v. D111)",                     GAME_NO_COCKTAIL )
9074GAME( 1995, nettoqc,  0,        nettoqc,  nettoqc,  0,        ROT0, "Nakanihon",                                   "Nettoh Quiz Champion (Japan)",                                    GAME_NO_COCKTAIL | GAME_IMPERFECT_COLORS )
9075GAME( 1995, ddenlvrj, 0,        ddenlvrj, ddenlvrj, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Shiro Kuro Tsukeyo! (Japan)",              GAME_NO_COCKTAIL )
9076GAME( 1995, ddenlvrk, ddenlvrj, ddenlvrk, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 - Heukbaeg-euro Jeonghaja (Korea)",          GAME_NO_COCKTAIL )
9077GAME( 1995, ddenlovb, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "[Dynax] (bootleg)",                           "Don Den Lover Vol. 1 - Heukbaeg-euro Jeonghaja (Korea, bootleg)", GAME_NO_COCKTAIL )
9078GAME( 1996, ddenlovr, ddenlvrj, ddenlovr, ddenlovr, 0,        ROT0, "Dynax",                                       "Don Den Lover Vol. 1 (Hong Kong)",                                GAME_NO_COCKTAIL )
9079GAME( 1996, hanakanz, 0,        hanakanz, hanakanz, 0,        ROT0, "Dynax",                                       "Hana Kanzashi (Japan)",                                           GAME_NO_COCKTAIL )
9080GAME( 1996, akamaru,  0,        akamaru,  akamaru,  0,        ROT0, "Dynax (Nakanihon licence)",                   "Panel & Variety Akamaru Q Jousyou Dont-R",                        GAME_NO_COCKTAIL )
9081GAME( 1996, mjflove,  0,        mjflove,  mjflove,  0,        ROT0, "Nakanihon",                                   "Mahjong Fantasic Love (Japan)",                                   GAME_NO_COCKTAIL )
9082GAME( 1997, hkagerou, 0,        hkagerou, hkagerou, 0,        ROT0, "Nakanihon + Dynax",                           "Hana Kagerou [BET] (Japan)",                                      GAME_NO_COCKTAIL )
9083GAME( 1998, mjchuuka, 0,        mjchuuka, mjchuuka, 0,        ROT0, "Dynax",                                       "Mahjong Chuukanejyo (China)",                                     GAME_NO_COCKTAIL )
9084GAME( 1998, mjreach1, 0,        mjreach1, mjreach1, 0,        ROT0, "Nihon System",                                "Mahjong Reach Ippatsu (Japan)",                                   GAME_NO_COCKTAIL )
9085GAME( 1999, jongtei,  0,        jongtei,  jongtei,  0,        ROT0, "Dynax",                                       "Mahjong Jong-Tei (Japan, ver. NM532-01)",                         GAME_NO_COCKTAIL )
src/mame/drivers/chinagat.c
r4057r4058
7979#include "sound/okim6295.h"
8080#include "sound/msm5205.h"
8181
82#define MAIN_CLOCK      XTAL_12MHz
83#define PIXEL_CLOCK      MAIN_CLOCK / 2
84
8285/**************** Video stuff ******************/
8386
8487WRITE8_HANDLER( ddragon_bgvideoram_w );
r4057r4058
107110
108111
109112
110static MACHINE_RESET( chinagat )
113/*
114    Based on the Solar Warrior schematics, vertical timing counts as follows:
115
116        08,09,0A,0B,...,FC,FD,FE,FF,E8,E9,EA,EB,...,FC,FD,FE,FF,
117        08,09,....
118
119    Thus, it counts from 08 to FF, then resets to E8 and counts to FF again.
120    This gives (256 - 8) + (256 - 232) = 248 + 24 = 272 total scanlines.
121
122    VBLK is signalled starting when the counter hits F8, and continues through
123    the reset to E8 and through until the next reset to 08 again.
124
125    Since MAME's video timing is 0-based, we need to convert this.
126*/
127/* based on ddragon.c driver */
128INLINE int scanline_to_vcount(int scanline)
111129{
112   technos_video_hw = 1;
113   sprite_irq = M6809_IRQ_LINE;
114   sound_irq = INPUT_LINE_NMI;
130   int vcount = scanline + 8;
131   if (vcount < 0x100)
132      return vcount;
133   else
134      return (vcount - 0x18) | 0x100;
115135}
116136
137static TIMER_DEVICE_CALLBACK( chinagat_scanline )
138{
139   int scanline = param;
140   int screen_height = video_screen_get_height(timer->machine->primary_screen);
141   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
142   int vcount = scanline_to_vcount(scanline);
143
144   /* update to the current point */
145   if (scanline > 0)
146   {
147      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
148   }
149
150   /* on the rising edge of VBLK (vcount == F8), signal an NMI */
151   if (vcount == 0xf8)
152   {
153      cpu_set_input_line(timer->machine->cpu[0], INPUT_LINE_NMI, ASSERT_LINE);
154   }
155
156   /* set 1ms signal on rising edge of vcount & 8 */
157   if (!(vcount_old & 8) && (vcount & 8))
158   {
159      cpu_set_input_line(timer->machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE);
160   }
161
162   /* adjust for next scanline */
163   if (++scanline >= screen_height)
164   {
165      scanline = 0;
166   }
167}
168
169static WRITE8_HANDLER( chinagat_interrupt_w )
170{
171   switch (offset)
172   {
173      case 0: /* 3e00 - SND irq */
174         soundlatch_w( space, 0, data );
175         cpu_set_input_line(space->machine->cpu[2], sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
176         break;
177
178      case 1: /* 3e01 - NMI ack */
179         cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE);
180         break;
181
182      case 2: /* 3e02 - FIRQ ack */
183         cpu_set_input_line(space->machine->cpu[0], M6809_FIRQ_LINE, CLEAR_LINE);
184         break;
185
186      case 3: /* 3e03 - IRQ ack */
187         cpu_set_input_line(space->machine->cpu[0], M6809_IRQ_LINE, CLEAR_LINE);
188         break;
189
190      case 4: /* 3e04 - sub CPU IRQ ack */
191         cpu_set_input_line(space->machine->cpu[1], sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
192         break;
193   }
194}
195
117196static WRITE8_HANDLER( chinagat_video_ctrl_w )
118197{
119198   /***************************
r4057r4058
141220   memory_set_bankptr(space->machine,  4,&RAM[ 0x10000 + (0x4000 * (data & 7)) ] );
142221}
143222
144static WRITE8_HANDLER( chinagat_sub_IRQ_w )
145{
146   cpu_set_input_line(space->machine->cpu[1], sprite_irq, (sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
147}
148
149static WRITE8_HANDLER( chinagat_cpu_sound_cmd_w )
150{
151   soundlatch_w( space, offset, data );
152   cpu_set_input_line(space->machine->cpu[2], sound_irq, (sound_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE );
153}
154
155223static READ8_HANDLER( saiyugb1_mcu_command_r )
156224{
157225#if 0
r4057r4058
270338   AM_RANGE(0x3000, 0x317f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram)
271339   AM_RANGE(0x3400, 0x357f) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2)
272340   AM_RANGE(0x3800, 0x397f) AM_WRITE(SMH_BANK3) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
273   AM_RANGE(0x3e00, 0x3e00) AM_WRITE(chinagat_cpu_sound_cmd_w)
274//  AM_RANGE(0x3e01, 0x3e01) AM_WRITE(SMH_NOP)
275//  AM_RANGE(0x3e02, 0x3e02) AM_WRITE(SMH_NOP)
276//  AM_RANGE(0x3e03, 0x3e03) AM_WRITE(SMH_NOP)
277   AM_RANGE(0x3e04, 0x3e04) AM_WRITE(chinagat_sub_IRQ_w)
341   AM_RANGE(0x3e00, 0x3e04) AM_WRITE(chinagat_interrupt_w)
278342   AM_RANGE(0x3e06, 0x3e06) AM_WRITE(SMH_RAM) AM_BASE(&ddragon_scrolly_lo)
279343   AM_RANGE(0x3e07, 0x3e07) AM_WRITE(SMH_RAM) AM_BASE(&ddragon_scrollx_lo)
280344   AM_RANGE(0x3f00, 0x3f00) AM_WRITE(chinagat_video_ctrl_w)
r4057r4058
458522   GFXDECODE_ENTRY( "gfx3", 0, tilelayout, 256, 8 )   /* 16x16 background tiles */
459523GFXDECODE_END
460524
525
461526static void chinagat_irq_handler(running_machine *machine, int irq)
462527{
463528   cpu_set_input_line(machine->cpu[2], 0, irq ? ASSERT_LINE : CLEAR_LINE );
r4057r4058
468533   chinagat_irq_handler
469534};
470535
471
472536/* This on the bootleg board, instead of the m6295 */
473537static const msm5205_interface msm5205_config =
474538{
r4057r4058
476540   MSM5205_S64_4B         /* vclk input mode (6030Hz, 4-bit) */
477541};
478542
479static INTERRUPT_GEN( chinagat_interrupt )
480{
481   cpu_set_input_line(device, 1, HOLD_LINE);   /* hold the FIRQ line */
482   cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);   /* pulse the NMI line */
483}
484
485543/* This is only on the second bootleg board */
486544static const ym2203_interface ym2203_config =
487545{
r4057r4058
496554static MACHINE_DRIVER_START( chinagat )
497555
498556   /* basic machine hardware */
499   MDRV_CPU_ADD("main", HD6309,12000000/2)      /* 1.5 MHz (12MHz oscillator ???) */
557   MDRV_CPU_ADD("main", HD6309, MAIN_CLOCK / 2)      /* 1.5 MHz (12MHz oscillator / 4 internally) */
500558   MDRV_CPU_PROGRAM_MAP(main_map,0)
501   MDRV_CPU_VBLANK_INT("main", chinagat_interrupt)
559   MDRV_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "main", 0, 1)
502560
503   MDRV_CPU_ADD("sub", HD6309,12000000/2)      /* 1.5 MHz (12MHz oscillator ???) */
561   MDRV_CPU_ADD("sub", HD6309, MAIN_CLOCK / 2)      /* 1.5 MHz (12MHz oscillator / 4 internally) */
504562   MDRV_CPU_PROGRAM_MAP(sub_map,0)
505563
506   MDRV_CPU_ADD("audio", Z80, 3579545)   /* 3.579545 MHz */
564   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz)      /* 3.579545 MHz */
507565   MDRV_CPU_PROGRAM_MAP(sound_map,0)
508566
509567   MDRV_QUANTUM_TIME(HZ(6000)) /* heavy interleaving to sync up sprite<->main cpu's */
510568
511   MDRV_MACHINE_RESET(chinagat)
512
513569   /* video hardware */
514570   MDRV_SCREEN_ADD("main", RASTER)
515   MDRV_SCREEN_REFRESH_RATE(56)
516   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
517571   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
518   MDRV_SCREEN_SIZE(32*8, 32*8)
519   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 29*8-1)
572   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 0, 240)   /* based on ddragon driver */
520573
521574   MDRV_GFXDECODE(chinagat)
522575   MDRV_PALETTE_LENGTH(384)
r4057r4058
540593static MACHINE_DRIVER_START( saiyugb1 )
541594
542595   /* basic machine hardware */
543   MDRV_CPU_ADD("main", M6809,12000000/8)      /* 68B09EP 1.5 MHz (12MHz oscillator) */
596   MDRV_CPU_ADD("main", M6809, MAIN_CLOCK / 8)      /* 68B09EP 1.5 MHz (12MHz oscillator) */
544597   MDRV_CPU_PROGRAM_MAP(main_map,0)
545   MDRV_CPU_VBLANK_INT("main", chinagat_interrupt)
598   MDRV_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "main", 0, 1)
546599
547   MDRV_CPU_ADD("sub", M6809,12000000/8)      /* 68B09EP 1.5 MHz (12MHz oscillator) */
600   MDRV_CPU_ADD("sub", M6809, MAIN_CLOCK / 8)      /* 68B09EP 1.5 MHz (12MHz oscillator) */
548601   MDRV_CPU_PROGRAM_MAP(sub_map,0)
549602
550   MDRV_CPU_ADD("audio", Z80, 3579545)      /* 3.579545 MHz oscillator */
603   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz)      /* 3.579545 MHz oscillator */
551604   MDRV_CPU_PROGRAM_MAP(saiyugb1_sound_map,0)
552605
553606   MDRV_CPU_ADD("mcu", I8748, 9263750)      /* 9.263750 MHz oscillator, divided by 3*5 internally */
r4057r4058
556609
557610   MDRV_QUANTUM_TIME(HZ(6000))   /* heavy interleaving to sync up sprite<->main cpu's */
558611
559   MDRV_MACHINE_RESET(chinagat)
560
561612   /* video hardware */
562613   MDRV_SCREEN_ADD("main", RASTER)
563   MDRV_SCREEN_REFRESH_RATE(56)
564   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
565614   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
566   MDRV_SCREEN_SIZE(32*8, 32*8)
567   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 29*8-1)
615   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 0, 240)   /* based on ddragon driver */
568616
569617   MDRV_GFXDECODE(chinagat)
570618   MDRV_PALETTE_LENGTH(384)
r4057r4058
588636static MACHINE_DRIVER_START( saiyugb2 )
589637
590638   /* basic machine hardware */
591   MDRV_CPU_ADD("main", M6809,12000000/8)      /* 1.5 MHz (12MHz oscillator) */
639   MDRV_CPU_ADD("main", M6809, MAIN_CLOCK / 8)      /* 1.5 MHz (12MHz oscillator) */
592640   MDRV_CPU_PROGRAM_MAP(main_map,0)
593   MDRV_CPU_VBLANK_INT("main", chinagat_interrupt)
641   MDRV_TIMER_ADD_SCANLINE("scantimer", chinagat_scanline, "main", 0, 1)
594642
595   MDRV_CPU_ADD("sub", M6809,12000000/8)      /* 1.5 MHz (12MHz oscillator) */
643   MDRV_CPU_ADD("sub", M6809, MAIN_CLOCK / 8)      /* 1.5 MHz (12MHz oscillator) */
596644   MDRV_CPU_PROGRAM_MAP(sub_map,0)
597645
598   MDRV_CPU_ADD("audio", Z80, 3579545)      /* 3.579545 MHz oscillator */
646   MDRV_CPU_ADD("audio", Z80, XTAL_3_579545MHz)      /* 3.579545 MHz oscillator */
599647   MDRV_CPU_PROGRAM_MAP(ym2203c_sound_map,0)
600648
601649   MDRV_QUANTUM_TIME(HZ(6000)) /* heavy interleaving to sync up sprite<->main cpu's */
602650
603   MDRV_MACHINE_RESET(chinagat)
604
605651   /* video hardware */
606652   MDRV_SCREEN_ADD("main", RASTER)
607   MDRV_SCREEN_REFRESH_RATE(56)
608   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
609653   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
610   MDRV_SCREEN_SIZE(32*8, 32*8)
611   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 29*8-1)
654   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 0, 240)   /* based on ddragon driver */
612655
613656   MDRV_GFXDECODE(chinagat)
614657   MDRV_PALETTE_LENGTH(384)
r4057r4058
844887ROM_END
845888
846889
890static DRIVER_INIT( chinagat )
891{
892   technos_video_hw = 1;
893   sprite_irq = M6809_IRQ_LINE;
894   sound_irq = INPUT_LINE_NMI;
895}
847896
897
848898/*   ( YEAR  NAME      PARENT    MACHINE   INPUT     INIT    MONITOR COMPANY    FULLNAME     FLAGS ) */
849GAME( 1988, chinagat, 0,        chinagat, chinagat, 0     , ROT0, "[Technos] (Taito Romstar license)", "China Gate (US)", 0 )
850GAME( 1988, saiyugou, chinagat, chinagat, chinagat, 0     , ROT0, "Technos", "Sai Yu Gou Ma Roku (Japan)", 0 )
851GAME( 1988, saiyugb1, chinagat, saiyugb1, chinagat, 0     , ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 1)", GAME_IMPERFECT_SOUND )
852GAME( 1988, saiyugb2, chinagat, saiyugb2, chinagat, 0     , ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 2)", 0 )
899GAME( 1988, chinagat, 0,        chinagat, chinagat, chinagat, ROT0, "[Technos] (Taito Romstar license)", "China Gate (US)", 0 )
900GAME( 1988, saiyugou, chinagat, chinagat, chinagat, chinagat, ROT0, "Technos", "Sai Yu Gou Ma Roku (Japan)", 0 )
901GAME( 1988, saiyugb1, chinagat, saiyugb1, chinagat, chinagat, ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 1)", GAME_IMPERFECT_SOUND )
902GAME( 1988, saiyugb2, chinagat, saiyugb2, chinagat, chinagat, ROT0, "bootleg", "Sai Yu Gou Ma Roku (Japan bootleg 2)", 0 )
src/mame/drivers/goldstar.c
r4057r4058
11/***************************************************************************
22
3Golden Star
4Cherry Master
3  Golden Star
4  Cherry Master
5  Lucky 8 Lines
56
6Golden Star and Cherry Master seem to be almost the same thing, running on
7different hardware.  There are also various bootlegs / hacks, it isn't clear
8exactly what hardware each runs on, some appear to have no OKI for example.
7  Golden Star and Cherry Master seem to be almost the same thing, running on
8  different hardware.  There are also various bootlegs / hacks, it isn't clear
9  exactly what hardware each runs on, some appear to have no OKI for example.
910
10Driver by Mirko Buffoni.
11Additional Work: David Haywood, Roberto Fresca.
11  Driver by Mirko Buffoni.
12  Additional Work: David Haywood & Roberto Fresca.
1213
14
15****************************************************************************
16
17  Game notes:
18  -----------
19
20  * New Lucky 8 Lines:
21
22  Sometimes the game boots with a "Coin Jam" message. Just reset the game to normalize.
23  There are 2 sets of controls. Press the BIG key to switch between them.
24
25  Press 9 to enter settings, press START to exit.
26  Press 0 to enter stats, press START to exit.
27  Keeping pressed 9 + 0 + RESET (F3), will enter the test mode. Press RESET to exit.
28
29  New Lucky 8 Lines has two sets of controls than can be switched through each 'BIG' button.
30  Even you can switch controls in middle of the game. When a set of controls are in use,
31  the other set is blocked till 'BIG' button is pressed.
32
33
34  * Cherry Bonus III:
35
36  If a hopper status error appear when the player try to take score,
37  pressing Key Out (W) will discharge the credits won.
38
39  Cherry Bonus III has two sets of controls than can be switched through each 'BIG' button.
40  Even you can switch controls in middle of the game. When a set of controls are in use,
41  the other set is blocked till 'BIG' button is pressed.
42
43  Controls Set2 is using reels stop buttons from Controls Set1.
44
45
1346***************************************************************************/
1447
1548#include "driver.h"
r4057r4058
2659extern UINT8 *goldstar_reel1_scroll, *goldstar_reel2_scroll, *goldstar_reel3_scroll;
2760
2861
29
3062extern UINT8 *goldstar_reel1_ram;
3163extern WRITE8_HANDLER( goldstar_reel1_ram_w );
3264extern UINT8 *goldstar_reel2_ram;
r4057r4058
5991}
6092
6193
62
6394static WRITE8_HANDLER( protection_w )
6495{
6596   if (data == 0x2a)
r4057r4058
111142ADDRESS_MAP_END
112143
113144
145
114146static ADDRESS_MAP_START( ncb3_map, ADDRESS_SPACE_PROGRAM, 8 )
115147   AM_RANGE(0x0000, 0xb7ff) AM_ROM
116148   AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
r4057r4058
129161   AM_RANGE(0xf820, 0xf823) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w)   /* Input/Output Ports */
130162   AM_RANGE(0xf830, 0xf830) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w)
131163   AM_RANGE(0xf840, 0xf840) AM_WRITE(ay8910_control_port_0_w)
164//  AM_RANGE(0xf850, 0xf850) AM_WRITE(ncb3_p1_flip_w)   // need flip?
165//  AM_RANGE(0xf860, 0xf860) AM_WRITE(ncb3_p2_flip_w)   // need flip?
132166   AM_RANGE(0xf870, 0xf870) AM_WRITE(sn76496_0_w)   /* guess... device is initialized, but doesn't seems to be used.*/
133167ADDRESS_MAP_END
134168
135169static ADDRESS_MAP_START( ncb3_readwriteport, ADDRESS_SPACE_IO, 8 )
136170   ADDRESS_MAP_GLOBAL_MASK(0xff)
137//   AM_RANGE(0x00, 0x0f) ---> writes.
171//  AM_RANGE(0x00, 0x00) AM_READ(ncb3_unkread_r)    // read from 0x00 when controls set1 is used...
172//  AM_RANGE(0x02, 0x02) AM_READ(ncb3_unkread_r)    // read from 0x02 when controls set2 is used...
173//  AM_RANGE(0x06, 0x06) AM_READ(ncb3_unkread_r)    // unknown...
174//  AM_RANGE(0x08, 0x08) AM_READ(ncb3_unkread_r)    // unknown...
175   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW5")   /* confirmed for ncb3 */
176//  AM_RANGE(0x81, 0x81) ---> large writes.
177
138178ADDRESS_MAP_END
139179
140180/* ncb3 findings...
r4057r4058
150190
151191  I/O
152192
153  00 = RW
193  00 = RW  (chrygld, ncb3 in ctrl set1)
194  02 = RW  (ncb3 in ctrl set2)
154195  06 = RW
155196  08 = RW
156197  81 =  W
157198
199  00-0f = initial seq. writes
200
201  Controls Set1 = write to f850 (0x1a), read from 0002.
202  Controls Set2 = write to f860 (0x1a), read from 0000.
203
204  Controls Set2 is using reels stop buttons from Controls Set1.
205
158206*/
159207
160208
209static WRITE8_HANDLER( cm_outport0_w )
210{
211   /* lamps? */
212}
213
214static WRITE8_HANDLER( cm_outport1_w )
215{
216   /* quick extended writes */
217}
218
161219static ADDRESS_MAP_START( cm_map, ADDRESS_SPACE_PROGRAM, 8 )
162220   AM_RANGE(0x0000, 0xbfff) AM_ROM AM_WRITENOP
163221
164   AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size) // not here..
165222   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram)
166223   AM_RANGE(0xe800, 0xefff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram)
167224
168   AM_RANGE(0xd000, 0xd7ff) AM_RAM // main?
169   AM_RANGE(0xd800, 0xdfff) AM_RAM
225   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
170226
171227   AM_RANGE(0xf000, 0xf1ff) AM_RAM AM_WRITE( goldstar_reel1_ram_w ) AM_BASE(&goldstar_reel1_ram)
172228   AM_RANGE(0xf200, 0xf3ff) AM_RAM AM_WRITE( goldstar_reel2_ram_w ) AM_BASE(&goldstar_reel2_ram)
r4057r4058
186242   AM_RANGE(0x01, 0x01) AM_READ(ay8910_read_port_0_r)
187243   AM_RANGE(0x02, 0x02) AM_WRITE(ay8910_write_port_0_w)
188244   AM_RANGE(0x03, 0x03) AM_WRITE(ay8910_control_port_0_w)
189   AM_RANGE(0x04, 0x04) AM_READ_PORT("PLAYER")
190   AM_RANGE(0x05, 0x05) AM_READ_PORT("COIN")
191   AM_RANGE(0x06, 0x06) AM_READ_PORT("TEST")
192   AM_RANGE(0x07, 0x07) AM_WRITENOP
193   AM_RANGE(0x08, 0x08) AM_READ_PORT("DSW1")
194   AM_RANGE(0x09, 0x09) AM_READ_PORT("DSW2")
195   AM_RANGE(0x0a, 0x0a) AM_READ_PORT("DSW3")
196   AM_RANGE(0x0b, 0x0b) AM_WRITENOP
197   AM_RANGE(0x10, 0x10) AM_WRITENOP
245   AM_RANGE(0x04, 0x07) AM_DEVREADWRITE(PPI8255, "cm_ppi8255_0", ppi8255_r, ppi8255_w)   /* Input Ports */
246   AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE(PPI8255, "cm_ppi8255_1", ppi8255_r, ppi8255_w)   /* DIP switches */
247   AM_RANGE(0x10, 0x10) AM_WRITE (cm_outport0_w)   /* output port */
198248   AM_RANGE(0x11, 0x11) AM_WRITENOP
199   AM_RANGE(0x12, 0x12) AM_WRITENOP
200   AM_RANGE(0x13, 0x13) AM_WRITENOP
249   AM_RANGE(0x12, 0x12) AM_WRITE (cm_outport1_w)   /* output port */
250   AM_RANGE(0x13, 0x13) AM_WRITENOP   /* seems control for an extra PPI device */
201251ADDRESS_MAP_END
202252
253
254static READ8_HANDLER( cm91_r )
255{
256   return 0xff;
257}
258
259static ADDRESS_MAP_START( cmast91_portmap, ADDRESS_SPACE_IO, 8 )
260   ADDRESS_MAP_GLOBAL_MASK(0xff)
261   AM_RANGE(0x02, 0x02) AM_READ(cm91_r)
262   AM_RANGE(0x21, 0x21) AM_READ(ay8910_read_port_0_r)
263   AM_RANGE(0x22, 0x22) AM_WRITE(ay8910_write_port_0_w)
264   AM_RANGE(0x23, 0x23) AM_WRITE(ay8910_control_port_0_w)
265ADDRESS_MAP_END
266
267static WRITE8_HANDLER( lucky8_outport_w )
268{
269   /* lamps */
270}
271
272static ADDRESS_MAP_START( lucky8_map, ADDRESS_SPACE_PROGRAM, 8 )
273   AM_RANGE(0x0000, 0x7fff) AM_ROM
274   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
275   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram)
276   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram)
277   AM_RANGE(0x9800, 0x99ff) AM_RAM AM_WRITE(goldstar_reel1_ram_w) AM_BASE(&goldstar_reel1_ram)
278   AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_WRITE(goldstar_reel2_ram_w) AM_BASE(&goldstar_reel2_ram)
279   AM_RANGE(0xa800, 0xa9ff) AM_RAM AM_WRITE(goldstar_reel3_ram_w) AM_BASE(&goldstar_reel3_ram)
280   AM_RANGE(0xb040, 0xb07f) AM_RAM AM_BASE(&goldstar_reel1_scroll)
281   AM_RANGE(0xb080, 0xb0bf) AM_RAM AM_BASE(&goldstar_reel2_scroll)
282   AM_RANGE(0xb100, 0xb17f) AM_RAM AM_BASE(&goldstar_reel3_scroll)
283
284   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)   /* Input Ports */
285   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)   /* Input Ports */
286   AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w)   /* Input/Output Ports */
287   AM_RANGE(0xb830, 0xb830) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w)
288   AM_RANGE(0xb840, 0xb840) AM_WRITE(ay8910_control_port_0_w)   /* no sound... only use both ports for DSWs */
289   AM_RANGE(0xb850, 0xb850) AM_WRITE(lucky8_outport_w)
290   AM_RANGE(0xb870, 0xb870) AM_WRITE(sn76496_0_w)   /* sound */
291   AM_RANGE(0xf800, 0xffff) AM_RAM
292ADDRESS_MAP_END
293
294
203295static INPUT_PORTS_START( cmv801 )
204   PORT_START("PLAYER")
205   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 0") PORT_CODE(KEYCODE_Q)
206   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 1") PORT_CODE(KEYCODE_W)
207   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Big")
208   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Double Up")
209   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Stop / Take Score")
210   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Bet")
211   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Small")
212   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
296   PORT_START("IN0")
297   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
298   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
299   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 2 / Big")          PORT_CODE(KEYCODE_X)
300   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1 / D-UP")         PORT_CODE(KEYCODE_Z)
301   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stop All / Take")       PORT_CODE(KEYCODE_V)
302   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Bet")                   PORT_CODE(KEYCODE_B)
303   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 3 / Small / Info") PORT_CODE(KEYCODE_C)
304   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start")                 PORT_CODE(KEYCODE_N)
213305
214   PORT_START("COIN")
215   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 0") PORT_CODE(KEYCODE_A)
216   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 1") PORT_CODE(KEYCODE_S)
217   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
218   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 3") PORT_CODE(KEYCODE_F)
219   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) // PORT_NAME("Bit 4") PORT_CODE(KEYCODE_G)
220   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 ) // PORT_NAME("Bit 5") PORT_CODE(KEYCODE_H)
221   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )      // Key-In
222   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )      // 10 Credits
306   PORT_START("IN1")
307   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
308   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
309   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   /* Coin B */
310   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
311   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   /* Coin D */
312   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   /* Coin C */
313   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
314   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   /* Coin A */
223315
224   PORT_START("TEST")
225   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 0") PORT_CODE(KEYCODE_Z)
226   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 1") PORT_CODE(KEYCODE_X)
227   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 2") PORT_CODE(KEYCODE_C)
228   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Bit 3") PORT_CODE(KEYCODE_V)
229   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("Payout")
230   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Limit Over")
231   PORT_SERVICE( 0x40, IP_ACTIVE_LOW )
232   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F2) PORT_NAME("Analyzer")
316   PORT_START("IN2")
317   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
318   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
319   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
320   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
321   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W)
322   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
323   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
324   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
233325
234326   PORT_START("DSW1")
235   PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW1:!1" ) /* Listed as "Unused" */
236   PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" ) PORT_DIPLOCATION("SW1:!2")
237   PORT_DIPSETTING(    0x02, "Active High" )
238   PORT_DIPSETTING(    0x00, "Active Low" )
239   PORT_DIPNAME( 0x04, 0x00, "Type Of Payout" ) PORT_DIPLOCATION("SW1:!3")
240   PORT_DIPSETTING(    0x04, "Automatic" )
241   PORT_DIPSETTING(    0x00, "Payout SH" )
242   PORT_DIPNAME( 0x08, 0x00, "@ IN DoubleUp" ) PORT_DIPLOCATION("SW1:!4")
243   PORT_DIPSETTING(    0x08, "Even" )
244   PORT_DIPSETTING(    0x00, "LOST" )
245   PORT_DIPNAME( 0x10, 0x00, "DoubleUp Pay-Rate" ) PORT_DIPLOCATION("SW1:!5")
327   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:1")   /* OK */
328   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
329   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
330   PORT_DIPNAME( 0x02, 0x02, "Hopper Out Switch" )   PORT_DIPLOCATION("DSW1:2")   /* OK */
331   PORT_DIPSETTING(    0x02, "Active Low" )
332   PORT_DIPSETTING(    0x00, "Active High" )
333   PORT_DIPNAME( 0x04, 0x04, "Payout Mode" )      PORT_DIPLOCATION("DSW1:3")   /* OK */
334   PORT_DIPSETTING(    0x04, "Payout Switch" )
335   PORT_DIPSETTING(    0x00, "Automatic" )
336   PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" )         PORT_DIPLOCATION("DSW1:4")   /* not checked */
337   PORT_DIPSETTING(    0x08, "Loss" )
338   PORT_DIPSETTING(    0x00, "Even" )
339   PORT_DIPNAME( 0x10, 0x00, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")   /* OK */
246340   PORT_DIPSETTING(    0x00, "80%" )
247341   PORT_DIPSETTING(    0x10, "90%" )
248   PORT_DIPNAME( 0x20, 0x00, "DoubleUp" ) PORT_DIPLOCATION("SW1:!6")
342   PORT_DIPNAME( 0x20, 0x00, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")   /* OK */
249343   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
250344   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
251   PORT_DIPNAME( 0xc0, 0x00, "Bet Max" ) PORT_DIPLOCATION("SW1:!7,!8") /* Manual says 8/16/32/64 */
252   PORT_DIPSETTING(    0x00, "16 Bet" )
253   PORT_DIPSETTING(    0x40, "32 Bet" )
254   PORT_DIPSETTING(    0x80, "64 Bet" )
255   PORT_DIPSETTING(    0xc0, "96 Bet" )
345   PORT_DIPNAME( 0xc0, 0xc0, "Bet Max" )         PORT_DIPLOCATION("DSW1:7,8")   /* OK */
346   PORT_DIPSETTING(    0x00, "16" )
347   PORT_DIPSETTING(    0x40, "32" )
348   PORT_DIPSETTING(    0x80, "64" )
349   PORT_DIPSETTING(    0xc0, "96" )
256350
257351   PORT_START("DSW2")
258   PORT_DIPNAME( 0x07, 0x07, "Main Game Pay-Rate" ) PORT_DIPLOCATION("SW2:!1,!2,!3")
259   PORT_DIPSETTING(    0x07, "55 30% 45" ) /* Displays 35% */
260   PORT_DIPSETTING(    0x06, "60 38% 50" ) /* Displays 40% */
261   PORT_DIPSETTING(    0x05, "65 46% 55" ) /* Displays 45% */
262   PORT_DIPSETTING(    0x04, "70 54% 60" ) /* Displays 50% */
263   PORT_DIPSETTING(    0x03, "75 62% 65" ) /* Displays 55% */
264   PORT_DIPSETTING(    0x02, "80 70% 70" ) /* Displays 60% */
265   PORT_DIPSETTING(    0x01, "85 78% 75" ) /* Displays 65% */
266   PORT_DIPSETTING(    0x00, "90 86% 80" ) /* Displays 70% */
267   PORT_DIPNAME( 0x18, 0x18, "Hopper Limit" ) PORT_DIPLOCATION("SW2:!4,!5")
268   PORT_DIPSETTING(    0x00, "300" )
269   PORT_DIPSETTING(    0x08, "500" )
270   PORT_DIPSETTING(    0x10, "1000" )
271   PORT_DIPSETTING(    0x18, "Unlimited" )
272   PORT_DIPNAME( 0x20, 0x20, "Sound On/Off Odds Over 100" ) PORT_DIPLOCATION("SW2:!6")
352   PORT_DIPNAME( 0x07, 0x00, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")   /* OK */
353   PORT_DIPSETTING(    0x07, "35%" )
354   PORT_DIPSETTING(    0x06, "40%" )
355   PORT_DIPSETTING(    0x05, "45%" )
356   PORT_DIPSETTING(    0x04, "50%" )
357   PORT_DIPSETTING(    0x03, "55%" )
358   PORT_DIPSETTING(    0x02, "60%" )
359   PORT_DIPSETTING(    0x01, "65%" )
360   PORT_DIPSETTING(    0x00, "70%" )
361   PORT_DIPNAME( 0x18, 0x00, "Hopper Limit" )         PORT_DIPLOCATION("DSW2:4,5")   /* OK */
362   PORT_DIPSETTING(    0x18, "300" )
363   PORT_DIPSETTING(    0x10, "500" )
364   PORT_DIPSETTING(    0x08, "1000" )
365   PORT_DIPSETTING(    0x00, "Unlimited" )
366   PORT_DIPNAME( 0x20, 0x00, "100 Odds Sound" )      PORT_DIPLOCATION("DSW2:6")   /* not checked */
367   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
368   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
369   PORT_DIPNAME( 0x40, 0x40, "Key-In Type" )         PORT_DIPLOCATION("DSW2:7")   /* OK */
370   PORT_DIPSETTING(    0x40, "A-Type" )
371   PORT_DIPSETTING(    0x00, "B-Type" )
372   PORT_DIPNAME( 0x80, 0x00, "Center Super 7 Bet Limit" )   PORT_DIPLOCATION("DSW2:8")   /* related with DSW 4-6 */
373   PORT_DIPSETTING(    0x80, "Unlimited" )
374   PORT_DIPSETTING(    0x00, "Limited" )
375
376   PORT_START("DSW3")
377   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
378   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
379   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
380   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
381   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
382   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
383   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
384   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
385   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
386   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
387   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
388   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
389   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
390   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
391   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
392   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
393   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
394   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
395   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
396   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
397   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
398   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
399   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
400   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
401   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
402   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
403   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
404   PORT_DIPSETTING(    0xc0, "1 Coin/10 Credits" )
405
406   PORT_START("DSW4")
407   PORT_DIPNAME( 0x07, 0x07, "Credit Limit" )            PORT_DIPLOCATION("DSW4:1,2,3")   /* not checked */
408   PORT_DIPSETTING(    0x07, "5,000" )
409   PORT_DIPSETTING(    0x06, "10,000" )
410   PORT_DIPSETTING(    0x05, "20,000" )
411   PORT_DIPSETTING(    0x04, "30,000" )
412   PORT_DIPSETTING(    0x03, "40,000" )
413   PORT_DIPSETTING(    0x02, "50,000" )
414   PORT_DIPSETTING(    0x01, "100,000" )
415   PORT_DIPSETTING(    0x00, "Unlimited" )
416   PORT_DIPNAME( 0x08, 0x08, "Display Of Payout Limit" ) PORT_DIPLOCATION("DSW4:4") /* not working */
417   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
418   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
419   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" )          PORT_DIPLOCATION("DSW4:5")   /* OK */
420   PORT_DIPSETTING(    0x10, "C-Type" )
421   PORT_DIPSETTING(    0x00, "D-Type" )
422   PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW4:6")   /* OK */
423   PORT_DIPSETTING(    0x20, "16 Bet" )
424   PORT_DIPSETTING(    0x00, "8 Bet" )
425   PORT_DIPNAME( 0x40, 0x40, "Reel Speed" )              PORT_DIPLOCATION("DSW4:7")   /* OK */
426   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
427   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
428   PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" )    PORT_DIPLOCATION("DSW4:8")   /* not checked */
429   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
430   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
431
432   PORT_START("DSW5")
433   PORT_DIPNAME( 0x01, 0x01, "Display Of Doll On Demo" )          PORT_DIPLOCATION("DSW5:1")   /* not working */
434   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
435   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
436   PORT_DIPNAME( 0x06, 0x06, "Coin In Limit" )                    PORT_DIPLOCATION("DSW5:2,3")   /* not checked */
437   PORT_DIPSETTING(    0x06, "1,000" )
438   PORT_DIPSETTING(    0x04, "5,000" )
439   PORT_DIPSETTING(    0x02, "10,000" )
440   PORT_DIPSETTING(    0x00, "20,000" )
441   PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Kind Of Bonus" )    PORT_DIPLOCATION("DSW5:4,5")   /* not checked */
442   PORT_DIPSETTING(    0x18, "12-7-1" )
443   PORT_DIPSETTING(    0x10, "9-5-1" )
444   PORT_DIPSETTING(    0x08, "6-3-1" )
445   PORT_DIPSETTING(    0x00, "3-2-1" )
446   PORT_DIPNAME( 0x20, 0x20, "Display Of Doll At All Fr. Bonus" ) PORT_DIPLOCATION("DSW5:6")   /* not checked */
447   PORT_DIPSETTING(    0x20, DEF_STR( Low ) )
448   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
449   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )                 PORT_DIPLOCATION("DSW5:7")   /* listed as unused */
450   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
452   PORT_DIPNAME( 0x80, 0x80, "Test Mode For Disp. Of Doll" )      PORT_DIPLOCATION("DSW5:8")   /* not working */
453   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
454   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
455INPUT_PORTS_END
456
457static INPUT_PORTS_START( cmv4 )
458   PORT_START("IN0")
459   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
460   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
461   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 3 / Big")          PORT_CODE(KEYCODE_X)
462   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1 / D-UP")         PORT_CODE(KEYCODE_Z)
463   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stop All / Take")       PORT_CODE(KEYCODE_V)
464   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Bet")                   PORT_CODE(KEYCODE_B)
465   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 2 / Small / Info") PORT_CODE(KEYCODE_C)
466   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start")                 PORT_CODE(KEYCODE_N)
467
468   PORT_START("IN1")
469   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
470   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
471   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   /* Coin B */
472   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
473   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   /* Coin D */
474   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   /* Coin C */
475   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
476   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   /* Coin A */
477
478   PORT_START("IN2")
479   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
480   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
481   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
482   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
483   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W)
484   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
485   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
486   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
487
488   PORT_START("DSW1")
489   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:1")   /* OK */
490   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
491   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
492   PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" )   PORT_DIPLOCATION("DSW1:2")   /* OK */
493   PORT_DIPSETTING(    0x00, "Active Low" )
494   PORT_DIPSETTING(    0x02, "Active High" )
495   PORT_DIPNAME( 0x04, 0x00, "Payout Mode" )      PORT_DIPLOCATION("DSW1:3")   /* OK */
496   PORT_DIPSETTING(    0x00, "Payout Switch" )
497   PORT_DIPSETTING(    0x04, "Automatic" )
498   PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" )         PORT_DIPLOCATION("DSW1:4")   /* not checked */
499   PORT_DIPSETTING(    0x08, "Loss" )
500   PORT_DIPSETTING(    0x00, "Even" )
501   PORT_DIPNAME( 0x10, 0x10, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")   /* OK */
502   PORT_DIPSETTING(    0x00, "40%" )
503   PORT_DIPSETTING(    0x10, "60%" )
504   PORT_DIPNAME( 0x20, 0x00, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")   /* OK */
273505   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
274506   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
275   PORT_DIPNAME( 0x40, 0x40, "Type Of Key In" ) PORT_DIPLOCATION("SW2:!7") /* Manual says C-Type/D-Type probably a typo */
507   PORT_DIPNAME( 0xc0, 0xc0, "Bet Max" )         PORT_DIPLOCATION("DSW1:7,8")   /* OK */
508   PORT_DIPSETTING(    0x00, "8" )
509   PORT_DIPSETTING(    0x40, "16" )
510   PORT_DIPSETTING(    0x80, "32" )
511   PORT_DIPSETTING(    0xc0, "64" )
512
513   PORT_START("DSW2")
514   PORT_DIPNAME( 0x07, 0x04, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")   /* OK */
515   PORT_DIPSETTING(    0x07, "30%" )
516   PORT_DIPSETTING(    0x06, "38%" )
517   PORT_DIPSETTING(    0x05, "46%" )
518   PORT_DIPSETTING(    0x04, "54%" )
519   PORT_DIPSETTING(    0x03, "62%" )
520   PORT_DIPSETTING(    0x02, "70%" )
521   PORT_DIPSETTING(    0x01, "78%" )
522   PORT_DIPSETTING(    0x00, "86%" )
523   PORT_DIPNAME( 0x18, 0x00, "Hopper Limit" )         PORT_DIPLOCATION("DSW2:4,5")   /* OK */
524   PORT_DIPSETTING(    0x18, "300" )
525   PORT_DIPSETTING(    0x10, "500" )
526   PORT_DIPSETTING(    0x08, "1000" )
527   PORT_DIPSETTING(    0x00, "Unlimited" )
528   PORT_DIPNAME( 0x20, 0x00, "100 Odds Sound" )      PORT_DIPLOCATION("DSW2:6")   /* not checked */
529   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
530   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
531   PORT_DIPNAME( 0x40, 0x40, "Key-In Type" )         PORT_DIPLOCATION("DSW2:7")   /* OK */
276532   PORT_DIPSETTING(    0x40, "A-Type" )
277533   PORT_DIPSETTING(    0x00, "B-Type" )
278   PORT_DIPNAME( 0x80, 0x80, "Bet Limit For Center Super 7" ) PORT_DIPLOCATION("SW2:!8")
279   PORT_DIPSETTING(    0x00, "Unlimited" )
280   PORT_DIPSETTING(    0x80, "Limited" ) /* "Number is fixed by 4-6" */
534   PORT_DIPNAME( 0x80, 0x00, "Center Super 7 Bet Limit" )   PORT_DIPLOCATION("DSW2:8")   /* related with DSW 4-6 */
535   PORT_DIPSETTING(    0x80, "Unlimited" )
536   PORT_DIPSETTING(    0x00, "Limited" )
281537
282538   PORT_START("DSW3")
283   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("SW3:1,2")
284   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // A-Type
285   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
286   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
539   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
540   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
541   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
542   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
287543   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
288   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // B-Type
289   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
290   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
291   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
292   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("SW3:3,4")
544   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
545   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
546   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
547   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
548   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
293549   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
294550   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
295551   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
296552   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
297   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("SW3:5,6")
298   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // C-Type
553   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
554   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
555   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
556   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
557   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
558   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
299559   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
300560   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
301561   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
302   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // D-Type
303   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
304   PORT_DIPSETTING(    0x20, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
305   PORT_DIPSETTING(    0x30, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
306   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("SW3:7,8")
307   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
308   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
309   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
310   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
562   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
563   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
564   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
565   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
566   PORT_DIPSETTING(    0xc0, "1 Coin/10 Credits" )
311567
312568   PORT_START("DSW4")
313   PORT_DIPNAME( 0x07, 0x07, "Credit Limit" ) PORT_DIPLOCATION("SW4:1,2,3")
569   PORT_DIPNAME( 0x07, 0x06, "Credit Limit" )            PORT_DIPLOCATION("DSW4:1,2,3")   /* OK */
314570   PORT_DIPSETTING(    0x07, "5,000" )
315571   PORT_DIPSETTING(    0x06, "10,000" )
316572   PORT_DIPSETTING(    0x05, "20,000" )
r4057r4058
319575   PORT_DIPSETTING(    0x02, "50,000" )
320576   PORT_DIPSETTING(    0x01, "100,000" )
321577   PORT_DIPSETTING(    0x00, "Unlimited" )
322   PORT_DIPNAME( 0x08, 0x08, "Display Of Payout Limit" ) PORT_DIPLOCATION("SW4:4")
578   PORT_DIPNAME( 0x08, 0x00, "Display Of Payout Limit" ) PORT_DIPLOCATION("DSW4:4") /* OK */
323579   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
324580   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
325   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" ) PORT_DIPLOCATION("SW4:5")
581   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" )          PORT_DIPLOCATION("DSW4:5")   /* OK */
326582   PORT_DIPSETTING(    0x10, "C-Type" )
327583   PORT_DIPSETTING(    0x00, "D-Type" )
328   PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("SW4:6")
584   PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW4:6")   /* OK */
329585   PORT_DIPSETTING(    0x20, "16 Bet" )
330586   PORT_DIPSETTING(    0x00, "8 Bet" )
331   PORT_DIPNAME( 0x40, 0x40, "Reel Speed" ) PORT_DIPLOCATION("SW4:7")
332   PORT_DIPSETTING(    0x40, DEF_STR( High ) )
333   PORT_DIPSETTING(    0x00, DEF_STR( Low ) )
334   PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" ) PORT_DIPLOCATION("SW4:8")
587   PORT_DIPNAME( 0x40, 0x40, "Reel Speed" )              PORT_DIPLOCATION("DSW4:7")   /* OK */
588   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
589   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
590   PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" )    PORT_DIPLOCATION("DSW4:8")   /* not checked */
335591   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
336592   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
337593
338594   PORT_START("DSW5")
339   PORT_DIPNAME( 0x01, 0x01, "Display Of Doll On Demo" ) PORT_DIPLOCATION("SW5:1")
595   PORT_DIPNAME( 0x01, 0x01, "Flash 'Dyna - C.M.V.4' string in attract" ) PORT_DIPLOCATION("DSW5:1")   /* OK */
340596   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
341597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
342   PORT_DIPNAME( 0x06, 0x06, "Coin In Limit" ) PORT_DIPLOCATION("SW5:2,3")
598   PORT_DIPNAME( 0x06, 0x06, "Coin In Limit" )                    PORT_DIPLOCATION("DSW5:2,3")   /* not checked */
343599   PORT_DIPSETTING(    0x06, "1,000" )
344600   PORT_DIPSETTING(    0x04, "5,000" )
345601   PORT_DIPSETTING(    0x02, "10,000" )
346602   PORT_DIPSETTING(    0x00, "20,000" )
347   PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Kind Of Bonus" ) PORT_DIPLOCATION("SW5:4,5")
603   PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Kind Of Bonus" )    PORT_DIPLOCATION("DSW5:4,5")   /* not checked */
348604   PORT_DIPSETTING(    0x18, "12-7-1" )
349605   PORT_DIPSETTING(    0x10, "9-5-1" )
350606   PORT_DIPSETTING(    0x08, "6-3-1" )
351607   PORT_DIPSETTING(    0x00, "3-2-1" )
352   PORT_DIPNAME( 0x20, 0x20, "Display Of Doll At All Fr. Bonus" ) PORT_DIPLOCATION("SW5:6")
608   PORT_DIPNAME( 0x20, 0x20, "Display Of Doll At All Fr. Bonus" ) PORT_DIPLOCATION("DSW5:6")   /* not checked */
353609   PORT_DIPSETTING(    0x20, DEF_STR( Low ) )
354610   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
355   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW5:7" ) /* Listed as "Unused" */
356   PORT_DIPNAME( 0x80, 0x80, "Test Mode For Disp. Of Doll" ) PORT_DIPLOCATION("SW5:8")
611   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )                 PORT_DIPLOCATION("DSW5:7")   /* listed as unused */
612   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
613   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
614   PORT_DIPNAME( 0x80, 0x80, "Test Mode For Disp. Of Doll" )      PORT_DIPLOCATION("DSW5:8")   /* not working */
357615   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
358616   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
359617INPUT_PORTS_END
360618
361static ADDRESS_MAP_START( lucky8_map, ADDRESS_SPACE_PROGRAM, 8 )
362   AM_RANGE(0x0000, 0x7fff) AM_ROM
363   AM_RANGE(0x8000, 0x87ff) AM_RAM
364   AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
365   AM_RANGE(0x8800, 0x8fff) AM_RAM AM_WRITE(goldstar_fg_vidram_w) AM_BASE(&videoram)
366   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_WRITE(goldstar_fg_atrram_w) AM_BASE(&colorram)
367   AM_RANGE(0x9800, 0x99ff) AM_RAM AM_WRITE(goldstar_reel1_ram_w) AM_BASE(&goldstar_reel1_ram)
368   AM_RANGE(0xa000, 0xa1ff) AM_RAM AM_WRITE(goldstar_reel2_ram_w) AM_BASE(&goldstar_reel2_ram)
369   AM_RANGE(0xa800, 0xa9ff) AM_RAM AM_WRITE(goldstar_reel3_ram_w) AM_BASE(&goldstar_reel3_ram)
370   AM_RANGE(0xb040, 0xb07f) AM_RAM AM_BASE(&goldstar_reel1_scroll)
371   AM_RANGE(0xb080, 0xb0bf) AM_RAM AM_BASE(&goldstar_reel2_scroll)
372   AM_RANGE(0xb100, 0xb17f) AM_RAM AM_BASE(&goldstar_reel3_scroll)
619static INPUT_PORTS_START( cmaster )
620   PORT_START("IN0")
621   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
622   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
623   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 3 / Big")          PORT_CODE(KEYCODE_X)
624   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1 / D-UP")         PORT_CODE(KEYCODE_Z)
625   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take")                  PORT_CODE(KEYCODE_V)
626   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Bet / Stop All")        PORT_CODE(KEYCODE_B)
627   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 2 / Small / Info") PORT_CODE(KEYCODE_C)
628   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start")                 PORT_CODE(KEYCODE_N)
373629
374   /* none of the inputs are verified / tested */
375   AM_RANGE(0xb800, 0xb800) AM_READ_PORT("IN0")
376   AM_RANGE(0xb801, 0xb801) AM_READ_PORT("IN1")   /* Test Mode */
377   AM_RANGE(0xb802, 0xb802) AM_READ_PORT("DSW1")
378   //AM_RANGE(0xb803, 0xb803)
379   //AM_RANGE(0xb804, 0xb804)
380   AM_RANGE(0xb805, 0xb805) AM_READ_PORT("DSW4")   /* DSW 4 (also appears in 8910 port) */
381   AM_RANGE(0xb806, 0xb806) AM_READ_PORT("DSW7")   /* (don't know to which one of the */
382   AM_RANGE(0xb810, 0xb810) AM_READ_PORT("UNK1")
383   AM_RANGE(0xb811, 0xb811) AM_READ_PORT("UNK2")
384   AM_RANGE(0xb820, 0xb820) AM_READ_PORT("DSW2")
385  AM_RANGE(0xb830, 0xb830) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w)
386  AM_RANGE(0xb840, 0xb840) AM_WRITE(ay8910_control_port_0_w)
387//  AM_RANGE(0xba00, 0xba00) AM_WRITE(goldstar_fa00_w)
388//  AM_RANGE(0xbb00, 0xbb00) AM_READWRITE(okim6295_status_0_r,okim6295_data_0_w)
389//  AM_RANGE(0xbd00, 0xbdff) AM_READWRITE(SMH_RAM,paletteram_BBGGGRRR_w) AM_BASE(&paletteram)
390//  AM_RANGE(0xbe00, 0xbe00) AM_READWRITE(protection_r,protection_w)
391ADDRESS_MAP_END
630   PORT_START("IN1")
631   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
632   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
633   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   /* Coin B */
634   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
635   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   /* Coin D */
636   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   /* Coin C */
637   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
638   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   /* Coin A */
392639
640   PORT_START("IN2")
641   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
642   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
643   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
644   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
645   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W)
646   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
647   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
648   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
393649
650   PORT_START("DSW1")
651   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:1")   /* OK */
652   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
653   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
654   PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" )   PORT_DIPLOCATION("DSW1:2")   /* OK */
655   PORT_DIPSETTING(    0x00, "Active Low" )
656   PORT_DIPSETTING(    0x02, "Active High" )
657   PORT_DIPNAME( 0x04, 0x00, "Payout Mode" )      PORT_DIPLOCATION("DSW1:3")   /* OK */
658   PORT_DIPSETTING(    0x00, "Payout Switch" )
659   PORT_DIPSETTING(    0x04, "Automatic" )
660   PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" )         PORT_DIPLOCATION("DSW1:4")   /* not checked */
661   PORT_DIPSETTING(    0x08, "Loss" )
662   PORT_DIPSETTING(    0x00, "Even" )
663   PORT_DIPNAME( 0x10, 0x00, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")   /* OK */
664   PORT_DIPSETTING(    0x00, "60%" )
665   PORT_DIPSETTING(    0x10, "70%" )
666   PORT_DIPNAME( 0x20, 0x00, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")   /* OK */
667   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
668   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
669   PORT_DIPNAME( 0xc0, 0xc0, "Bet Max" )         PORT_DIPLOCATION("DSW1:7,8")   /* OK */
670   PORT_DIPSETTING(    0x00, "8" )
671   PORT_DIPSETTING(    0x40, "16" )
672   PORT_DIPSETTING(    0x80, "32" )
673   PORT_DIPSETTING(    0xc0, "64" )
674
675   PORT_START("DSW2")
676   PORT_DIPNAME( 0x07, 0x04, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")   /* OK */
677   PORT_DIPSETTING(    0x07, "45%" )
678   PORT_DIPSETTING(    0x06, "50%" )
679   PORT_DIPSETTING(    0x05, "55%" )
680   PORT_DIPSETTING(    0x04, "60%" )
681   PORT_DIPSETTING(    0x03, "65%" )
682   PORT_DIPSETTING(    0x02, "70%" )
683   PORT_DIPSETTING(    0x01, "75%" )
684   PORT_DIPSETTING(    0x00, "80%" )
685   PORT_DIPNAME( 0x18, 0x00, "Hopper Limit" )         PORT_DIPLOCATION("DSW2:4,5")   /* OK */
686   PORT_DIPSETTING(    0x18, "300" )
687   PORT_DIPSETTING(    0x10, "500" )
688   PORT_DIPSETTING(    0x08, "1000" )
689   PORT_DIPSETTING(    0x00, "Unlimited" )
690   PORT_DIPNAME( 0x20, 0x00, "100 Odds Sound" )      PORT_DIPLOCATION("DSW2:6")   /* not checked */
691   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
692   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
693   PORT_DIPNAME( 0x40, 0x40, "Key-In Type" )         PORT_DIPLOCATION("DSW2:7")   /* OK */
694   PORT_DIPSETTING(    0x40, "A-Type" )
695   PORT_DIPSETTING(    0x00, "B-Type" )
696   PORT_DIPNAME( 0x80, 0x00, "Center Super 7 Bet Limit" )   PORT_DIPLOCATION("DSW2:8")   /* related with DSW 4-6 */
697   PORT_DIPSETTING(    0x80, "Unlimited" )
698   PORT_DIPSETTING(    0x00, "Limited" )
699
700   PORT_START("DSW3")
701   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")   /* OK */
702   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) /* A-Type */
703   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
704   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
705   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" ) PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
706   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )     PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) /* B-Type */
707   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
708   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
709   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )  PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
710   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")   /* OK */
711   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
712   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
713   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
714   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
715   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")   /* OK */
716   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) /* C-Type */
717   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
718   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
719   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
720   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )    PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) /* D-Type */
721   PORT_DIPSETTING(    0x10, "1 Coin/10 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
722   PORT_DIPSETTING(    0x20, "1 Coin/25 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
723   PORT_DIPSETTING(    0x30, "1 Coin/50 Credits" ) PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
724   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")   /* OK */
725   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
726   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
727   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
728   PORT_DIPSETTING(    0xc0, "1 Coin/10 Credits" )
729
730   PORT_START("DSW4")
731   PORT_DIPNAME( 0x07, 0x06, "Credit Limit" )            PORT_DIPLOCATION("DSW4:1,2,3")   /* OK */
732   PORT_DIPSETTING(    0x07, "5,000" )
733   PORT_DIPSETTING(    0x06, "10,000" )
734   PORT_DIPSETTING(    0x05, "20,000" )
735   PORT_DIPSETTING(    0x04, "30,000" )
736   PORT_DIPSETTING(    0x03, "40,000" )
737   PORT_DIPSETTING(    0x02, "50,000" )
738   PORT_DIPSETTING(    0x01, "100,000" )
739   PORT_DIPSETTING(    0x00, "Unlimited" )
740   PORT_DIPNAME( 0x08, 0x00, "Display Of Payout Limit" ) PORT_DIPLOCATION("DSW4:4") /* OK */
741   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
742   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
743   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" )          PORT_DIPLOCATION("DSW4:5")   /* OK */
744   PORT_DIPSETTING(    0x10, "C-Type" )
745   PORT_DIPSETTING(    0x00, "D-Type" )
746   PORT_DIPNAME( 0x20, 0x20, "Min. Bet For Bonus Play" ) PORT_DIPLOCATION("DSW4:6")   /* OK */
747   PORT_DIPSETTING(    0x20, "16 Bet" )
748   PORT_DIPSETTING(    0x00, "8 Bet" )
749   PORT_DIPNAME( 0x40, 0x40, "Reel Speed" )              PORT_DIPLOCATION("DSW4:7")   /* OK */
750   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
751   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
752   PORT_DIPNAME( 0x80, 0x80, "Hopper Out By Coin A" )    PORT_DIPLOCATION("DSW4:8")   /* not checked */
753   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
754   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
755
756   PORT_START("DSW5")
757   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1")   /* not checked */
758   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
759   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
760   PORT_DIPNAME( 0x06, 0x06, "Coin In Limit" )                    PORT_DIPLOCATION("DSW5:2,3")   /* not checked */
761   PORT_DIPSETTING(    0x06, "1,000" )
762   PORT_DIPSETTING(    0x04, "5,000" )
763   PORT_DIPSETTING(    0x02, "10,000" )
764   PORT_DIPSETTING(    0x00, "20,000" )
765   PORT_DIPNAME( 0x18, 0x18, "Condition For 3 Kind Of Bonus" )    PORT_DIPLOCATION("DSW5:4,5")   /* not checked */
766   PORT_DIPSETTING(    0x18, "12-7-1" )
767   PORT_DIPSETTING(    0x10, "9-5-1" )
768   PORT_DIPSETTING(    0x08, "6-3-1" )
769   PORT_DIPSETTING(    0x00, "3-2-1" )
770   PORT_DIPNAME( 0x20, 0x20, "Display Of Doll At All Fr. Bonus" ) PORT_DIPLOCATION("DSW5:6")   /* not checked */
771   PORT_DIPSETTING(    0x20, DEF_STR( Low ) )
772   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
773   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )                 PORT_DIPLOCATION("DSW5:7")   /* listed as unused */
774   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
775   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
776   PORT_DIPNAME( 0x80, 0x80, "Test Mode For Disp. Of Doll" )      PORT_DIPLOCATION("DSW5:8")   /* not working */
777   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
778   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
779INPUT_PORTS_END
780
781
394782static INPUT_PORTS_START( goldstar )
395783   PORT_START("IN0")
396784   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r4057r4058
517905   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
518906INPUT_PORTS_END
519907
520static INPUT_PORTS_START( chryigld )
908static INPUT_PORTS_START( chrygld )
521909   PORT_START("IN0")
522910   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
523911   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
524   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 2 / Double-Up") PORT_CODE(KEYCODE_X)
525   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Blue Bet / Card 3")  PORT_CODE(KEYCODE_B)
526   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1")             PORT_CODE(KEYCODE_Z)
527   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Red Bet / Card 2")   PORT_CODE(KEYCODE_V)
528   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 3 / Info / Card 1")    PORT_CODE(KEYCODE_C)
529   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start / Stop All / Card 4") PORT_CODE(KEYCODE_N)
912   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 2 / Big / Bonus Game")      PORT_CODE(KEYCODE_X)
913   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Blue Bet / D-UP / Card 3")       PORT_CODE(KEYCODE_B)
914   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1 / Take")                  PORT_CODE(KEYCODE_Z)
915   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Red Bet / Card 2")               PORT_CODE(KEYCODE_V)
916   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 3 / Small / Info / Card 1") PORT_CODE(KEYCODE_C)
917   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start / Stop All / Card 4")      PORT_CODE(KEYCODE_N)
530918
531919   PORT_START("IN1")
532920   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
533921   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
534   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   // Coin1?
922   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   /* Coin B */
535923   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
536   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   // Coin2?
537   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   // Coin3?
924   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   /* Coin D */
925   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   /* Coin C */
538926   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
539   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   // Coin4?
927   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   /* Coin A */
540928
541929   PORT_START("IN2")
542930   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r4057r4058
548936   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
549937   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
550938
939   PORT_START("IN3")
940   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
941   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
942   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
943   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
944   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
945   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
946   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
947   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
948
551949   PORT_START("DSW1")
552   PORT_DIPNAME( 0x07, 0x04, "Main Game %" )
950   PORT_DIPNAME( 0x01, 0x01, "Game Style" )      PORT_DIPLOCATION("DSW1:1")
951   PORT_DIPSETTING(    0x01, "Tokens" )
952   PORT_DIPSETTING(    0x00, "Ticket" )
953   PORT_DIPNAME( 0x02, 0x02, "Hopper Out Switch" )   PORT_DIPLOCATION("DSW1:2")
954   PORT_DIPSETTING(    0x02, "Active Low" )
955   PORT_DIPSETTING(    0x00, "Active High" )
956   PORT_DIPNAME( 0x04, 0x04, "Payout Mode" )      PORT_DIPLOCATION("DSW1:3")
957   PORT_DIPSETTING(    0x04, "Payout Switch" )
958   PORT_DIPSETTING(    0x00, "Automatic" )
959   PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" )         PORT_DIPLOCATION("DSW1:4")
960   PORT_DIPSETTING(    0x08, "Loss" )
961   PORT_DIPSETTING(    0x00, "Even" )
962   PORT_DIPNAME( 0x10, 0x10, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")
963   PORT_DIPSETTING(    0x10, "80%" )
964   PORT_DIPSETTING(    0x00, "90%" )
965   PORT_DIPNAME( 0x20, 0x20, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")
966   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
967   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
968   PORT_DIPNAME( 0xc0, 0x00, "Bet Max" )         PORT_DIPLOCATION("DSW1:7,8")
969   PORT_DIPSETTING(    0xc0, "8" )
970   PORT_DIPSETTING(    0x80, "16" )
971   PORT_DIPSETTING(    0x40, "32" )
972   PORT_DIPSETTING(    0x00, "50" )
973
974   PORT_START("DSW2")
975   PORT_DIPNAME( 0x07, 0x00, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")
553976   PORT_DIPSETTING(    0x00, "55%" )
554977   PORT_DIPSETTING(    0x01, "60%" )
555978   PORT_DIPSETTING(    0x02, "65%" )
r4057r4058
558981   PORT_DIPSETTING(    0x05, "80%" )
559982   PORT_DIPSETTING(    0x06, "85%" )
560983   PORT_DIPSETTING(    0x07, "90%" )
561   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
984   PORT_DIPNAME( 0x18, 0x00, "Hopper Limit" )         PORT_DIPLOCATION("DSW2:4,5")
985   PORT_DIPSETTING(    0x18, "300" )
986   PORT_DIPSETTING(    0x10, "500" )
987   PORT_DIPSETTING(    0x08, "1000" )
988   PORT_DIPSETTING(    0x00, "Unlimited" )
989   PORT_DIPNAME( 0x20, 0x00, "100 Odds Sound" )      PORT_DIPLOCATION("DSW2:6")
990   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
991   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
992   PORT_DIPNAME( 0x40, 0x00, "Key-In Type" )         PORT_DIPLOCATION("DSW2:7")
993   PORT_DIPSETTING(    0x40, "B-Type" )
994   PORT_DIPSETTING(    0x00, "A-Type" )
995   PORT_DIPNAME( 0x80, 0x00, "Center Super 7 Bet Limit" )   PORT_DIPLOCATION("DSW2:8")   /* related with DSW 4-6 */
996   PORT_DIPSETTING(    0x80, "Unlimited" )
997   PORT_DIPSETTING(    0x00, "Limited" )
998
999   PORT_START("DSW3")   /* some of these are wrong */
1000   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
1001   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
1002   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1003   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1004   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1005   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
1006   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1007   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1008   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1009   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
1010   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )
1011   PORT_DIPSETTING(    0x04, "1 Coin/20 Credits" )
1012   PORT_DIPSETTING(    0x08, "1 Coin/50 Credits" )
1013   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
1014   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
1015   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
1016   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1017   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1018   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1019   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
1020   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1021   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1022   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1023   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
1024   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1025   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
1026   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
1027   PORT_DIPSETTING(    0xc0, "1 Coin/10 Credits" )
1028
1029   PORT_START("DSW4")
1030   PORT_DIPNAME( 0x07, 0x06, "Credit Limit" )            PORT_DIPLOCATION("DSW4:1,2,3")
1031   PORT_DIPSETTING(    0x07, "5,000" )
1032   PORT_DIPSETTING(    0x06, "10,000" )
1033   PORT_DIPSETTING(    0x05, "20,000" )
1034   PORT_DIPSETTING(    0x04, "30,000" )
1035   PORT_DIPSETTING(    0x03, "40,000" )
1036   PORT_DIPSETTING(    0x02, "50,000" )
1037   PORT_DIPSETTING(    0x01, "100,000" )
1038   PORT_DIPSETTING(    0x00, "Unlimited" )
1039   PORT_DIPNAME( 0x08, 0x00, "Display Of Credit Limit" )   PORT_DIPLOCATION("DSW4:4")
5621040   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5631041   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
564   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
565   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1042   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" )         PORT_DIPLOCATION("DSW4:5")
1043   PORT_DIPSETTING(    0x10, "D-Type (Tokens)" )
1044   PORT_DIPSETTING(    0x00, "C-Type (Ticket)" )
1045   PORT_DIPNAME( 0x20, 0x00, "Bonus Play Min.Bet" )      PORT_DIPLOCATION("DSW4:6")
1046   PORT_DIPSETTING(    0x20, "16 Bet" )
1047   PORT_DIPSETTING(    0x00, "8 Bet" )
1048   PORT_DIPNAME( 0x40, 0x00, "Reel Speed" )            PORT_DIPLOCATION("DSW4:7")
1049   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
1050   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
1051   PORT_DIPNAME( 0x80, 0x80, "Coin A Mode" )            PORT_DIPLOCATION("DSW4:8")
1052   PORT_DIPSETTING(    0x80, "Unexchange" )
1053   PORT_DIPSETTING(    0x00, "Exchange" )
1054
1055   /* DSW5 is not connected yet. Where the hell is connected? */
1056   PORT_START("DSW5")
1057   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )      PORT_DIPLOCATION("DSW5:1")
1058   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5661059   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
567   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1060   PORT_DIPNAME( 0x06, 0x00, "Coin In Limit" )         PORT_DIPLOCATION("DSW5:2,3")
1061   PORT_DIPSETTING(    0x06, "1000" )
1062   PORT_DIPSETTING(    0x04, "5000" )
1063   PORT_DIPSETTING(    0x02, "10000" )
1064   PORT_DIPSETTING(    0x00, "20000" )
1065   PORT_DIPNAME( 0x18, 0x10, "Coin Out Rate" )         PORT_DIPLOCATION("DSW5:4,5")
1066   PORT_DIPSETTING(    0x00, "100 Credits / 1 Pulse" )
1067   PORT_DIPSETTING(    0x08, "100 Credits / 5 Pulses" )
1068   PORT_DIPSETTING(    0x10, "100 Credits / 10 Pulses" )
1069   PORT_DIPSETTING(    0x18, "100 Credits / 100 Pulses" )
1070   PORT_DIPNAME( 0x20, 0x00, "W-UP Girl" )            PORT_DIPLOCATION("DSW5:6")
5681071   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5691072   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
570   PORT_DIPNAME( 0x40, 0x00, "Key-In Type" )
1073   PORT_DIPNAME( 0xc0, 0x40, "Coin In Rate" )         PORT_DIPLOCATION("DSW5:7,8")
1074   PORT_DIPSETTING(    0xc0, "100 Credits / 1 Pulse" )
1075   PORT_DIPSETTING(    0x40, "100 Credits / 5 Pulses" )
1076   PORT_DIPSETTING(    0x80, "100 Credits / 10 Pulses" )
1077   PORT_DIPSETTING(    0x00, "100 Credits / 100 Pulses" )
1078INPUT_PORTS_END
1079
1080static INPUT_PORTS_START( ncb3 )
1081   PORT_START("IN0")
1082   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1083   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1084   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 - Stop 2 / Big / Bonus Game / Switch Controls") PORT_CODE(KEYCODE_X)
1085   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 - Blue Bet / D-UP / Card 3")       PORT_CODE(KEYCODE_B)
1086   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 - Stop 1 / Take")                  PORT_CODE(KEYCODE_Z)
1087   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 - Red Bet / Card 2")               PORT_CODE(KEYCODE_V)
1088   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 - Stop 3 / Small / Info / Card 1") PORT_CODE(KEYCODE_C)
1089   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 - Start / Stop All / Card 4")      PORT_CODE(KEYCODE_N)
1090
1091   PORT_START("IN1")
1092   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1093   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1094   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   /* Coin B */
1095   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1096   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   /* Coin D */
1097   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   /* Coin C */
1098   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
1099   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   /* Coin A */
1100
1101   PORT_START("IN2")
1102   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1103   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1104   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1105   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1106   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W)
1107   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1108   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
1109   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
1110
1111   PORT_START("IN3")
1112   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1113   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1114   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON8 )  PORT_NAME("P2 - Stop 2 / Big / Bonus Game / Switch Controls") PORT_CODE(KEYCODE_S)
1115   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("P2 - Blue Bet / D-UP / Card 3")       PORT_CODE(KEYCODE_G)
1116   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 )  PORT_NAME("P2 - Stop 1 / Take")                  PORT_CODE(KEYCODE_A)
1117   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("P2 - Red Bet / Card 2")               PORT_CODE(KEYCODE_F)
1118   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON9 )  PORT_NAME("P2 - Stop 3 / Small / Info / Card 1") PORT_CODE(KEYCODE_D)
1119   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("P2 - Start / Stop All / Card 4")      PORT_CODE(KEYCODE_H)
1120
1121   /* to check DIP switches... */
1122   PORT_START("DSW1")
1123   PORT_DIPNAME( 0x01, 0x01, "Game Style" )      PORT_DIPLOCATION("DSW1:1")
1124   PORT_DIPSETTING(    0x01, "Tokens" )
1125   PORT_DIPSETTING(    0x00, "Ticket" )
1126   PORT_DIPNAME( 0x02, 0x02, "Hopper Out Switch" )   PORT_DIPLOCATION("DSW1:2")
1127   PORT_DIPSETTING(    0x02, "Active Low" )
1128   PORT_DIPSETTING(    0x00, "Active High" )
1129   PORT_DIPNAME( 0x04, 0x04, "Payout Mode" )      PORT_DIPLOCATION("DSW1:3")
1130   PORT_DIPSETTING(    0x04, "Payout Switch" )
1131   PORT_DIPSETTING(    0x00, "Automatic" )
1132   PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" )         PORT_DIPLOCATION("DSW1:4")
1133   PORT_DIPSETTING(    0x08, "Loss" )
1134   PORT_DIPSETTING(    0x00, "Even" )
1135   PORT_DIPNAME( 0x10, 0x10, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")
1136   PORT_DIPSETTING(    0x10, "80%" )
1137   PORT_DIPSETTING(    0x00, "90%" )
1138   PORT_DIPNAME( 0x20, 0x20, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")
1139   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1140   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1141   PORT_DIPNAME( 0xc0, 0x00, "Bet Max" )         PORT_DIPLOCATION("DSW1:7,8")
1142   PORT_DIPSETTING(    0xc0, "8" )
1143   PORT_DIPSETTING(    0x80, "16" )
1144   PORT_DIPSETTING(    0x40, "32" )
1145   PORT_DIPSETTING(    0x00, "64" )
1146
1147   PORT_START("DSW2")
1148   PORT_DIPNAME( 0x07, 0x00, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")
1149   PORT_DIPSETTING(    0x00, "55%" )
1150   PORT_DIPSETTING(    0x01, "60%" )
1151   PORT_DIPSETTING(    0x02, "65%" )
1152   PORT_DIPSETTING(    0x03, "70%" )
1153   PORT_DIPSETTING(    0x04, "75%" )
1154   PORT_DIPSETTING(    0x05, "80%" )
1155   PORT_DIPSETTING(    0x06, "85%" )
1156   PORT_DIPSETTING(    0x07, "90%" )
1157   PORT_DIPNAME( 0x18, 0x00, "Hopper Limit" )         PORT_DIPLOCATION("DSW2:4,5")
1158   PORT_DIPSETTING(    0x18, "300" )
1159   PORT_DIPSETTING(    0x10, "500" )
1160   PORT_DIPSETTING(    0x08, "1000" )
1161   PORT_DIPSETTING(    0x00, "Unlimited" )
1162   PORT_DIPNAME( 0x20, 0x00, "100 Odds Sound" )      PORT_DIPLOCATION("DSW2:6")
1163   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1164   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1165   PORT_DIPNAME( 0x40, 0x00, "Key-In Type" )         PORT_DIPLOCATION("DSW2:7")
5711166   PORT_DIPSETTING(    0x40, "B-Type" )
5721167   PORT_DIPSETTING(    0x00, "A-Type" )
573   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
574   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1168   PORT_DIPNAME( 0x80, 0x00, "Center Super 7 Bet Limit" )   PORT_DIPLOCATION("DSW2:8")   /* related with DSW 4-6 */
1169   PORT_DIPSETTING(    0x80, "Unlimited" )
1170   PORT_DIPSETTING(    0x00, "Limited" )
1171
1172   PORT_START("DSW3")   /* some of these are wrong */
1173   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
1174   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
1175   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1176   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1177   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1178   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
1179   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1180   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1181   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1182   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
1183   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1184   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1185   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
1186   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
1187   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
1188   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
1189   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1190   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1191   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1192   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
1193   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1194   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1195   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1196   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
1197   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1198   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
1199   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
1200   PORT_DIPSETTING(    0xc0, "1 Coin/10 Credits" )
1201
1202   PORT_START("DSW4")
1203   PORT_DIPNAME( 0x07, 0x06, "Credit Limit" )            PORT_DIPLOCATION("DSW4:1,2,3")
1204   PORT_DIPSETTING(    0x07, "5,000" )
1205   PORT_DIPSETTING(    0x06, "10,000" )
1206   PORT_DIPSETTING(    0x05, "20,000" )
1207   PORT_DIPSETTING(    0x04, "30,000" )
1208   PORT_DIPSETTING(    0x03, "40,000" )
1209   PORT_DIPSETTING(    0x02, "50,000" )
1210   PORT_DIPSETTING(    0x01, "100,000" )
1211   PORT_DIPSETTING(    0x00, "Unlimited" )
1212   PORT_DIPNAME( 0x08, 0x00, "Display Of Credit Limit" )   PORT_DIPLOCATION("DSW4:4")
1213   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5751214   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1215   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" )         PORT_DIPLOCATION("DSW4:5")
1216   PORT_DIPSETTING(    0x10, "D-Type (Tokens)" )
1217   PORT_DIPSETTING(    0x00, "C-Type (Ticket)" )
1218   PORT_DIPNAME( 0x20, 0x00, "Bonus Play Min.Bet" )      PORT_DIPLOCATION("DSW4:6")
1219   PORT_DIPSETTING(    0x20, "16 Bet" )
1220   PORT_DIPSETTING(    0x00, "8 Bet" )
1221   PORT_DIPNAME( 0x40, 0x00, "Reel Speed" )            PORT_DIPLOCATION("DSW4:7")
1222   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
1223   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
1224   PORT_DIPNAME( 0x80, 0x80, "Coin A Mode" )            PORT_DIPLOCATION("DSW4:8")
1225   PORT_DIPSETTING(    0x80, "Unexchange" )
1226   PORT_DIPSETTING(    0x00, "Exchange" )
5761227
577   PORT_START("DSW2")
578   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1228   PORT_START("DSW5")
1229   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )      PORT_DIPLOCATION("DSW5:1")
5791230   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5801231   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
581   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
582   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1232   PORT_DIPNAME( 0x06, 0x00, "Coin In Limit" )         PORT_DIPLOCATION("DSW5:2,3")
1233   PORT_DIPSETTING(    0x06, "1000" )
1234   PORT_DIPSETTING(    0x04, "5000" )
1235   PORT_DIPSETTING(    0x02, "10000" )
1236   PORT_DIPSETTING(    0x00, "20000" )
1237   PORT_DIPNAME( 0x18, 0x10, "Coin Out Rate" )         PORT_DIPLOCATION("DSW5:4,5")
1238   PORT_DIPSETTING(    0x00, "100 Credits / 1 Pulse" )
1239   PORT_DIPSETTING(    0x08, "100 Credits / 5 Pulses" )
1240   PORT_DIPSETTING(    0x10, "100 Credits / 10 Pulses" )
1241   PORT_DIPSETTING(    0x18, "100 Credits / 100 Pulses" )
1242   PORT_DIPNAME( 0x20, 0x00, "W-UP Girl" )            PORT_DIPLOCATION("DSW5:6")
1243   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5831244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
584   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
585   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
586   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
587   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1245   PORT_DIPNAME( 0xc0, 0x40, "Coin In Rate" )         PORT_DIPLOCATION("DSW5:7,8")
1246   PORT_DIPSETTING(    0xc0, "100 Credits / 1 Pulse" )
1247   PORT_DIPSETTING(    0x40, "100 Credits / 5 Pulses" )
1248   PORT_DIPSETTING(    0x80, "100 Credits / 10 Pulses" )
1249   PORT_DIPSETTING(    0x00, "100 Credits / 100 Pulses" )
1250INPUT_PORTS_END
1251
1252static INPUT_PORTS_START( cb3a )
1253   PORT_START("IN0")
1254   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1255   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1256   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 - Stop 2 / Big / Bonus Game / Switch Controls") PORT_CODE(KEYCODE_X)
1257   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 - Blue Bet / D-UP / Card 3")       PORT_CODE(KEYCODE_B)
1258   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 - Stop 1 / Take")                  PORT_CODE(KEYCODE_Z)
1259   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 - Red Bet / Card 2")               PORT_CODE(KEYCODE_V)
1260   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 - Stop 3 / Small / Info / Card 1") PORT_CODE(KEYCODE_C)
1261   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 - Start / Stop All / Card 4")      PORT_CODE(KEYCODE_N)
1262
1263   PORT_START("IN1")
1264   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1265   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1266   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   /* Coin B */
1267   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1268   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   /* Coin D */
1269   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   /* Coin C */
1270   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
1271   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   /* Coin A */
1272
1273   PORT_START("IN2")
1274   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1275   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1276   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1277   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1278   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W)
1279   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1280   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
1281   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
1282
1283   PORT_START("IN3")
1284   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1285   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1286   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON8 )  PORT_NAME("P2 - Stop 2 / Big / Bonus Game / Switch Controls") PORT_CODE(KEYCODE_S)
1287   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("P2 - Blue Bet / D-UP / Card 3")       PORT_CODE(KEYCODE_G)
1288   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON7 )  PORT_NAME("P2 - Stop 1 / Take")                  PORT_CODE(KEYCODE_A)
1289   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("P2 - Red Bet / Card 2")               PORT_CODE(KEYCODE_F)
1290   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON9 )  PORT_NAME("P2 - Stop 3 / Small / Info / Card 1") PORT_CODE(KEYCODE_D)
1291   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("P2 - Start / Stop All / Card 4")      PORT_CODE(KEYCODE_H)
1292
1293   /* to check DIP switches... */
1294   PORT_START("DSW1")
1295   PORT_DIPNAME( 0x01, 0x01, "Game Style" )      PORT_DIPLOCATION("DSW1:1")
1296   PORT_DIPSETTING(    0x01, "Tokens" )
1297   PORT_DIPSETTING(    0x00, "Ticket" )
1298   PORT_DIPNAME( 0x02, 0x02, "Hopper Out Switch" )   PORT_DIPLOCATION("DSW1:2")
1299   PORT_DIPSETTING(    0x02, "Active Low" )
1300   PORT_DIPSETTING(    0x00, "Active High" )
1301   PORT_DIPNAME( 0x04, 0x04, "Payout Mode" )      PORT_DIPLOCATION("DSW1:3")
1302   PORT_DIPSETTING(    0x04, "Payout Switch" )
1303   PORT_DIPSETTING(    0x00, "Automatic" )
1304   PORT_DIPNAME( 0x08, 0x00, "W-UP '7'" )         PORT_DIPLOCATION("DSW1:4")
1305   PORT_DIPSETTING(    0x08, "Loss" )
1306   PORT_DIPSETTING(    0x00, "Even" )
1307   PORT_DIPNAME( 0x10, 0x10, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")
1308   PORT_DIPSETTING(    0x00, "50%" )
1309   PORT_DIPSETTING(    0x10, "80%" )
1310   PORT_DIPNAME( 0x20, 0x20, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")
1311   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1312   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1313   PORT_DIPNAME( 0xc0, 0x00, "Bet Max" )         PORT_DIPLOCATION("DSW1:7,8")
1314   PORT_DIPSETTING(    0xc0, "8" )
1315   PORT_DIPSETTING(    0x80, "16" )
1316   PORT_DIPSETTING(    0x40, "32" )
1317   PORT_DIPSETTING(    0x00, "64" )
1318
1319   PORT_START("DSW2")
1320   PORT_DIPNAME( 0x07, 0x00, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")
1321   PORT_DIPSETTING(    0x00, "55%" )
1322   PORT_DIPSETTING(    0x01, "60%" )
1323   PORT_DIPSETTING(    0x02, "65%" )
1324   PORT_DIPSETTING(    0x03, "70%" )
1325   PORT_DIPSETTING(    0x04, "75%" )
1326   PORT_DIPSETTING(    0x05, "80%" )
1327   PORT_DIPSETTING(    0x06, "85%" )
1328   PORT_DIPSETTING(    0x07, "90%" )
1329   PORT_DIPNAME( 0x18, 0x00, "Hopper Limit" )         PORT_DIPLOCATION("DSW2:4,5")
1330   PORT_DIPSETTING(    0x18, "300" )
1331   PORT_DIPSETTING(    0x10, "500" )
1332   PORT_DIPSETTING(    0x08, "1000" )
1333   PORT_DIPSETTING(    0x00, "Unlimited" )
1334   PORT_DIPNAME( 0x20, 0x00, "100 Odds Sound" )      PORT_DIPLOCATION("DSW2:6")
1335   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1336   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1337   PORT_DIPNAME( 0x40, 0x00, "Key-In Type" )         PORT_DIPLOCATION("DSW2:7")
1338   PORT_DIPSETTING(    0x40, "B-Type" )
1339   PORT_DIPSETTING(    0x00, "A-Type" )
1340   PORT_DIPNAME( 0x80, 0x00, "Center Super 7 Bet Limit" )   PORT_DIPLOCATION("DSW2:8")   /* related with DSW 4-6 */
1341   PORT_DIPSETTING(    0x80, "Unlimited" )
1342   PORT_DIPSETTING(    0x00, "Limited" )
1343
1344   PORT_START("DSW3")   /* some of these are wrong */
1345   PORT_DIPNAME( 0x03, 0x03, "Key In Rate" ) PORT_DIPLOCATION("DSW3:1,2")
1346   PORT_DIPSETTING(    0x00, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00) // A-Type
1347   PORT_DIPSETTING(    0x01, "1 Coin/20 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1348   PORT_DIPSETTING(    0x02, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1349   PORT_DIPSETTING(    0x03, "1 Coin/100 Credits" )   PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x00)
1350   PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40) // B-Type
1351   PORT_DIPSETTING(    0x01, "1 Coin/10 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1352   PORT_DIPSETTING(    0x02, "1 Coin/25 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1353   PORT_DIPSETTING(    0x03, "1 Coin/50 Credits" )      PORT_CONDITION("DSW2",0x40,PORTCOND_EQUALS,0x40)
1354   PORT_DIPNAME( 0x0c, 0x0c, "Coin A Rate" ) PORT_DIPLOCATION("DSW3:3,4")
1355   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1356   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1357   PORT_DIPSETTING(    0x08, DEF_STR( 1C_5C ) )
1358   PORT_DIPSETTING(    0x0c, "1 Coin/10 Credits" )
1359   PORT_DIPNAME( 0x30, 0x30, "Coin D Rate" ) PORT_DIPLOCATION("DSW3:5,6")
1360   PORT_DIPSETTING(    0x30, DEF_STR( 5C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10) // C-Type
1361   PORT_DIPSETTING(    0x20, DEF_STR( 2C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1362   PORT_DIPSETTING(    0x10, DEF_STR( 1C_1C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1363   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )            PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x10)
1364   PORT_DIPSETTING(    0x30, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00) // D-Type
1365   PORT_DIPSETTING(    0x20, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1366   PORT_DIPSETTING(    0x10, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1367   PORT_DIPSETTING(    0x00, "1 Ticket/Coin / 100 Credits" )   PORT_CONDITION("DSW4",0x10,PORTCOND_EQUALS,0x00)
1368   PORT_DIPNAME( 0xc0, 0xc0, "Coin C Rate" ) PORT_DIPLOCATION("DSW3:7,8")
1369   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1370   PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
1371   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
1372   PORT_DIPSETTING(    0xc0, "1 Coin/10 Credits" )
1373
1374   PORT_START("DSW4")
1375   PORT_DIPNAME( 0x07, 0x06, "Credit Limit" )            PORT_DIPLOCATION("DSW4:1,2,3")
1376   PORT_DIPSETTING(    0x07, "5,000" )
1377   PORT_DIPSETTING(    0x06, "10,000" )
1378   PORT_DIPSETTING(    0x05, "20,000" )
1379   PORT_DIPSETTING(    0x04, "30,000" )
1380   PORT_DIPSETTING(    0x03, "40,000" )
1381   PORT_DIPSETTING(    0x02, "50,000" )
1382   PORT_DIPSETTING(    0x01, "100,000" )
1383   PORT_DIPSETTING(    0x00, "Unlimited" )
1384   PORT_DIPNAME( 0x08, 0x00, "Display Of Credit Limit" )   PORT_DIPLOCATION("DSW4:4")
5881385   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
5891386   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
590   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
591   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1387   PORT_DIPNAME( 0x10, 0x10, "Type Of Coin D" )         PORT_DIPLOCATION("DSW4:5")
1388   PORT_DIPSETTING(    0x10, "D-Type (Tokens)" )
1389   PORT_DIPSETTING(    0x00, "C-Type (Ticket)" )
1390   PORT_DIPNAME( 0x20, 0x00, "Bonus Play Min.Bet" )      PORT_DIPLOCATION("DSW4:6")
1391   PORT_DIPSETTING(    0x20, "16 Bet" )
1392   PORT_DIPSETTING(    0x00, "8 Bet" )
1393   PORT_DIPNAME( 0x40, 0x00, "Reel Speed" )            PORT_DIPLOCATION("DSW4:7")
1394   PORT_DIPSETTING(    0x40, DEF_STR( Low ) )
1395   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
1396   PORT_DIPNAME( 0x80, 0x80, "Coin A Mode" )            PORT_DIPLOCATION("DSW4:8")
1397   PORT_DIPSETTING(    0x80, "Unexchange" )
1398   PORT_DIPSETTING(    0x00, "Exchange" )
1399
1400   PORT_START("DSW5")
1401   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )      PORT_DIPLOCATION("DSW5:1")
1402   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
5921403   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
593   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1404   PORT_DIPNAME( 0x06, 0x00, "Coin In Limit" )         PORT_DIPLOCATION("DSW5:2,3")
1405   PORT_DIPSETTING(    0x06, "1000" )
1406   PORT_DIPSETTING(    0x04, "5000" )
1407   PORT_DIPSETTING(    0x02, "10000" )
1408   PORT_DIPSETTING(    0x00, "20000" )
1409   PORT_DIPNAME( 0x18, 0x10, "Coin Out Rate" )         PORT_DIPLOCATION("DSW5:4,5")
1410   PORT_DIPSETTING(    0x00, "100 Credits / 1 Pulse" )
1411   PORT_DIPSETTING(    0x08, "100 Credits / 5 Pulses" )
1412   PORT_DIPSETTING(    0x10, "100 Credits / 10 Pulses" )
1413   PORT_DIPSETTING(    0x18, "100 Credits / 100 Pulses" )
1414   PORT_DIPNAME( 0x20, 0x00, "W-UP Girl" )            PORT_DIPLOCATION("DSW5:6")
5941415   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
5951416   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
596   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
597   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
598   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
599   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
600   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
601   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1417   PORT_DIPNAME( 0xc0, 0x40, "Coin In Rate" )         PORT_DIPLOCATION("DSW5:7,8")
1418   PORT_DIPSETTING(    0xc0, "100 Credits / 1 Pulse" )
1419   PORT_DIPSETTING(    0x40, "100 Credits / 5 Pulses" )
1420   PORT_DIPSETTING(    0x80, "100 Credits / 10 Pulses" )
1421   PORT_DIPSETTING(    0x00, "100 Credits / 100 Pulses" )
1422INPUT_PORTS_END
6021423
603   PORT_START("DSW3")
604   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1424static INPUT_PORTS_START( lucky8 )
1425   PORT_START("IN0")   /* d800 */
1426   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1427   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1428   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 - Big / Switch Controls") PORT_CODE(KEYCODE_X)
1429   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 - Double-Up")             PORT_CODE(KEYCODE_B)
1430   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 - Take Score")            PORT_CODE(KEYCODE_Z)
1431   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 - Bet")                   PORT_CODE(KEYCODE_V)
1432   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 - Small / Info")          PORT_CODE(KEYCODE_C)
1433   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 - Start")                 PORT_CODE(KEYCODE_N)
1434
1435   PORT_START("IN1")   /* d801 */
1436   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1437   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1438   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("P2 - Big / Switch Controls") PORT_CODE(KEYCODE_S)
1439   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("P2 - Double-Up")             PORT_CODE(KEYCODE_G)
1440   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("P2 - Take Score")            PORT_CODE(KEYCODE_A)
1441   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("P2 - Bet")                   PORT_CODE(KEYCODE_F)
1442   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("P2 - Small / Info")          PORT_CODE(KEYCODE_D)
1443   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("P2 - Start")                 PORT_CODE(KEYCODE_H)
1444
1445   PORT_START("IN2")   /* d802 */
1446   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1447   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1448   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1449   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1450   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1451   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1452   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1453   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1454
1455   PORT_START("IN3")   /* d810 */
1456   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1457   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1458   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   // Coin1?
1459   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1460   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   // Coin2?
1461   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)   // Coin3?
1462   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
1463   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   // Coin4?
1464
1465   PORT_START("IN4")   /* d811 */
1466   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1467   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1468   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1469   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1470   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key Out / Attendant") PORT_CODE(KEYCODE_W)
1471   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1472   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
1473   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
1474
1475   PORT_START("DSW1")
1476   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:1")
6051477   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
6061478   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
607   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1479   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:2")
6081480   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
6091481   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
610   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1482   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:3")
6111483   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
6121484   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
613   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1485   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:4")
6141486   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
6151487   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
616   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1488   PORT_DIPNAME( 0x10, 0x10, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")
1489   PORT_DIPSETTING(    0x10, "80%" )
1490   PORT_DIPSETTING(    0x00, "90%" )
1491   PORT_DIPNAME( 0x20, 0x20, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")
1492   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1493   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1494   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:7")
1495   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1496   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1497   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:8")
1498   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1499   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1500
1501   PORT_START("DSW2")
1502   PORT_DIPNAME( 0x07, 0x07, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")
1503   PORT_DIPSETTING(    0x07, "80%" )
1504   PORT_DIPSETTING(    0x06, "83%" )
1505   PORT_DIPSETTING(    0x05, "86%" )
1506   PORT_DIPSETTING(    0x04, "89%" )
1507   PORT_DIPSETTING(    0x03, "92%" )
1508   PORT_DIPSETTING(    0x02, "95%" )
1509   PORT_DIPSETTING(    0x01, "98%" )
1510   PORT_DIPSETTING(    0x00, "101%" )
1511   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:4")
1512   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1513   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1514   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:5")
6171515   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6181516   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
619   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1517   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:6")
6201518   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6211519   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
622   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1520   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:7")
6231521   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6241522   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
625   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
626   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
627   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1523   PORT_DIPNAME( 0x80, 0x80, "W-UP Type" )   PORT_DIPLOCATION("DSW2:8")
1524   PORT_DIPSETTING(    0x80, "Reels (automatic)" )
1525   PORT_DIPSETTING(    0x00, "Cards (Big/Small)" )
6281526
629   PORT_START("DSW4")
630   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1527   PORT_START("DSW3")
1528   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:1")
6311529   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
6321530   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
633   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1531   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:2")
6341532   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
6351533   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
636   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1534   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:3")
6371535   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
6381536   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
639   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1537   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:4")
6401538   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
6411539   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
642   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1540   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:5")
6431541   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6441542   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
645   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1543   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:6")
6461544   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6471545   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
648   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1546   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:7")
6491547   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6501548   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
651   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1549   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:8")
6521550   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6531551   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6541552
655   PORT_START("DSW5")
656   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
657   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
658   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
659   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
660   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
661   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
662   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
663   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
664   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
665   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1553   PORT_START("DSW4")
1554   PORT_DIPNAME( 0x07, 0x07, "Key In" )         PORT_DIPLOCATION("DSW4:1,2,3")
1555   PORT_DIPSETTING(    0x00, "5" )
1556   PORT_DIPSETTING(    0x01, "10" )
1557   PORT_DIPSETTING(    0x02, "20" )
1558   PORT_DIPSETTING(    0x03, "25" )
1559   PORT_DIPSETTING(    0x04, "40" )
1560   PORT_DIPSETTING(    0x05, "50" )
1561   PORT_DIPSETTING(    0x06, "60" )
1562   PORT_DIPSETTING(    0x07, "100" )
1563   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:4")
6661564   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
6671565   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
668   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1566   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:5")
6691567   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
6701568   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
671   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1569   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:6")
6721570   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
6731571   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
674   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1572   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:7")
6751573   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
6761574   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
677   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1575   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:8")
6781576   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
6791577   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
6801578INPUT_PORTS_END
6811579
682static INPUT_PORTS_START( ncb3 )
683   PORT_START("IN0")
1580static INPUT_PORTS_START( lucky8a )
1581   PORT_START("IN0")   /* d800 */
6841582   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
6851583   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
686   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Stop 2 / Double-Up") PORT_CODE(KEYCODE_X)
687   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Blue Bet / Card 3")  PORT_CODE(KEYCODE_B)
688   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Stop 1")             PORT_CODE(KEYCODE_Z)
689   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Red Bet / Card 2")   PORT_CODE(KEYCODE_V)
690   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Stop 3 / Info / Card 1")    PORT_CODE(KEYCODE_C)
691   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Start / Stop All / Card 4") PORT_CODE(KEYCODE_N)
1584   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 - Big / Switch Controls") PORT_CODE(KEYCODE_X)
1585   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 - Double-Up")             PORT_CODE(KEYCODE_B)
1586   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 - Take Score")            PORT_CODE(KEYCODE_Z)
1587   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 - Bet")                   PORT_CODE(KEYCODE_V)
1588   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 - Small / Info")          PORT_CODE(KEYCODE_C)
1589   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 - Start")                 PORT_CODE(KEYCODE_N)
6921590
693   PORT_START("IN1")
1591   PORT_START("IN1")   /* d801 */
6941592   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
6951593   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1594   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("P2 - Big / Switch Controls") PORT_CODE(KEYCODE_S)
1595   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("P2 - Double-Up")             PORT_CODE(KEYCODE_G)
1596   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("P2 - Take Score")            PORT_CODE(KEYCODE_A)
1597   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("P2 - Bet")                   PORT_CODE(KEYCODE_F)
1598   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("P2 - Small / Info")          PORT_CODE(KEYCODE_D)
1599   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("P2 - Start")                 PORT_CODE(KEYCODE_H)
1600
1601   PORT_START("IN2")   /* d802 */
1602   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1603   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1604   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1605   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1606   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1607   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1608   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1609   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1610
1611   PORT_START("IN3")   /* d810 */
1612   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
1613   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
6961614   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)   // Coin1?
6971615   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
6981616   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)   // Coin2?
r4057r4058
7001618   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
7011619   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)   // Coin4?
7021620
703   PORT_START("IN2")
1621   PORT_START("IN4")   /* d811 */
7041622   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
7051623   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
7061624   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
r4057r4058
7111629   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
7121630
7131631   PORT_START("DSW1")
714   PORT_DIPNAME( 0x07, 0x04, "Main Game %" )
715   PORT_DIPSETTING(    0x00, "55%" )
716   PORT_DIPSETTING(    0x01, "60%" )
717   PORT_DIPSETTING(    0x02, "65%" )
718   PORT_DIPSETTING(    0x03, "70%" )
719   PORT_DIPSETTING(    0x04, "75%" )
720   PORT_DIPSETTING(    0x05, "80%" )
721   PORT_DIPSETTING(    0x06, "85%" )
722   PORT_DIPSETTING(    0x07, "90%" )
723   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
724   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
725   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
726   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
727   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
728   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
729   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
730   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
731   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
732   PORT_DIPNAME( 0x40, 0x00, "Key-In Type" )
733   PORT_DIPSETTING(    0x40, "B-Type" )
734   PORT_DIPSETTING(    0x00, "A-Type" )
735   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
736   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
737   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
738
739   PORT_START("DSW2")
740   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1632   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:1")
7411633   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
7421634   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
743   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1635   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:2")
7441636   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
7451637   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
746   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1638   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:3")
7471639   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
7481640   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
749   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1641   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:4")
7501642   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
7511643   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
752   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
753   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
754   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
755   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
756   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
757   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
758   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1644   PORT_DIPNAME( 0x10, 0x10, "W-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:5")
1645   PORT_DIPSETTING(    0x10, "80%" )
1646   PORT_DIPSETTING(    0x00, "90%" )
1647   PORT_DIPNAME( 0x20, 0x20, "W-UP Game" )         PORT_DIPLOCATION("DSW1:6")
1648   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1649   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1650   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:7")
7591651   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
7601652   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
761   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1653   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:8")
7621654   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
7631655   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
7641656
765   PORT_START("DSW3")
766   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
767   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
768   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
769   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
770   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
771   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
772   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
773   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
774   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
775   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1657   PORT_START("DSW2")
1658   PORT_DIPNAME( 0x07, 0x02, "Main Game Pay Rate" )   PORT_DIPLOCATION("DSW2:1,2,3")
1659   PORT_DIPSETTING(    0x07, "30%" )
1660   PORT_DIPSETTING(    0x06, "40%" )
1661   PORT_DIPSETTING(    0x05, "50%" )
1662   PORT_DIPSETTING(    0x04, "60%" )
1663   PORT_DIPSETTING(    0x03, "70%" )
1664   PORT_DIPSETTING(    0x02, "80%" )
1665   PORT_DIPSETTING(    0x01, "90%" )
1666   PORT_DIPSETTING(    0x00, "100%" )
1667   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:4")
7761668   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
7771669   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
778   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1670   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:5")
7791671   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
7801672   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
781   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1673   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:6")
7821674   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
7831675   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
784   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1676   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:7")
7851677   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
7861678   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
787   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
788   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
789   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1679   PORT_DIPNAME( 0x80, 0x80, "W-UP Type" )   PORT_DIPLOCATION("DSW2:8")
1680   PORT_DIPSETTING(    0x80, "Reels (automatic)" )
1681   PORT_DIPSETTING(    0x00, "Cards (Big/Small)" )
7901682
791   PORT_START("DSW4")
792   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1683   PORT_START("DSW3")
1684   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:1")
7931685   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
7941686   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
795   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1687   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:2")
7961688   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
7971689   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
798   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1690   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:3")
7991691   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
8001692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
801   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1693   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:4")
8021694   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
8031695   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
804   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1696   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:5")
8051697   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
8061698   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
807   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1699   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:6")
8081700   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
8091701   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
810   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1702   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:7")
8111703   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
8121704   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
813   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1705   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:8")
8141706   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
8151707   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
8161708
817   PORT_START("DSW5")
818   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
819   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
820   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
821   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
822   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
823   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
824   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
825   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
826   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
827   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1709   PORT_START("DSW4")
1710   PORT_DIPNAME( 0x07, 0x07, "Key In" )         PORT_DIPLOCATION("DSW4:1,2,3")
1711   PORT_DIPSETTING(    0x00, "5" )
1712   PORT_DIPSETTING(    0x01, "10" )
1713   PORT_DIPSETTING(    0x02, "20" )
1714   PORT_DIPSETTING(    0x03, "25" )
1715   PORT_DIPSETTING(    0x04, "40" )
1716   PORT_DIPSETTING(    0x05, "50" )
1717   PORT_DIPSETTING(    0x06, "60" )
1718   PORT_DIPSETTING(    0x07, "100" )
1719   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:4")
8281720   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
8291721   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
830   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1722   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:5")
8311723   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
8321724   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
833   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1725   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:6")
8341726   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
8351727   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
836   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1728   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:7")
8371729   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
8381730   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
839   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1731   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:8")
8401732   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
8411733   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
8421734INPUT_PORTS_END
r4057r4058
9371829   32*8
9381830};
9391831
1832#if 0 // decodes an extra plane for cmv4 / cmasterb, not sure if we need to
9401833static const gfx_layout tiles8x32x5_layout =
9411834{
9421835   8,32,
r4057r4058
9511844   },
9521845   32*8
9531846};
1847#endif
9541848
9551849static GFXDECODE_START( goldstar )
9561850   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 16 )
r4057r4058
9741868
9751869static GFXDECODE_START( ncb3 )
9761870   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 16 )
977   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128+64, 4 )
1871   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128, 4 )
9781872GFXDECODE_END
9791873
1874static GFXDECODE_START( cmv801 )
1875   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 16 )
1876   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4_layout, 128+64, 4 ) // or is there a register for the +64?
1877GFXDECODE_END
1878
1879#if 0 // decodes an extra plane for cmv4 / cmasterb, not sure if we need to
9801880static GFXDECODE_START( cmasterb )
9811881   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_layout, 0, 16 )
9821882   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x5_layout, 0, 4 )
9831883GFXDECODE_END
1884#endif
9841885
9851886
9861887/*************************************
9871888*      PPI 8255 (x3) Interfaces      *
9881889*************************************/
9891890
990static const ppi8255_interface ppi8255_intf[4] =
1891static const ppi8255_interface ncb3_ppi8255_intf[3] =
9911892{
9921893   {   /* A, B & C set as input */
993      DEVICE8_PORT("IN0"),   /* Port A read, IN0 */
994      NULL,               /* Port B read, IN1 */
1894      DEVICE8_PORT("IN0"),   /* Port A read */
1895      DEVICE8_PORT("IN3"),   /* Port B read */ //Player2 controls, confirmed.
9951896      NULL,               /* Port C read */
9961897      NULL,               /* Port A write */
9971898      NULL,               /* Port B write */
9981899      NULL               /* Port C write */
9991900   },
10001901   {   /* A, B & C set as input */
1001      DEVICE8_PORT("IN1"),   /* Port A read, IN2 */
1002      DEVICE8_PORT("IN2"),   /* Port B read, IN3 */
1902      DEVICE8_PORT("IN1"),   /* Port A read */
1903      DEVICE8_PORT("IN2"),   /* Port B read */
1904      DEVICE8_PORT("DSW1"),   /* Port C read */
1905      NULL,               /* Port A write */
1906      NULL,               /* Port B write */
1907      NULL               /* Port C write */
1908   },
1909   {   /* A set as input */
1910      DEVICE8_PORT("DSW2"),   /* Port A read */
1911      NULL,               /* Port B read */
10031912      NULL,               /* Port C read */
10041913      NULL,               /* Port A write */
10051914      NULL,               /* Port B write */
10061915      NULL               /* Port C write */
1916   }
1917};
1918
1919static const ppi8255_interface cm_ppi8255_intf[2] =
1920{
1921   {   /* A, B & C set as input */
1922      DEVICE8_PORT("IN0"),   /* Port A read */
1923      DEVICE8_PORT("IN1"),   /* Port B read */
1924      DEVICE8_PORT("IN2"),   /* Port C read */
1925      NULL,               /* Port A write */
1926      NULL,               /* Port B write */
1927      NULL               /* Port C write */
10071928   },
1929   {   /* A, B & C set as input */
1930      DEVICE8_PORT("DSW1"),   /* Port A read */
1931      DEVICE8_PORT("DSW2"),   /* Port B read */
1932      DEVICE8_PORT("DSW3"),   /* Port C read */
1933      NULL,               /* Port A write */
1934      NULL,               /* Port B write */
1935      NULL               /* Port C write */
1936   }
1937};
1938
1939static const ppi8255_interface lucky8_ppi8255_intf[3] =
1940{
1941   {   /* A, B & C set as input */
1942      DEVICE8_PORT("IN0"),   /* Port A read */
1943      DEVICE8_PORT("IN1"),   /* Port B read */
1944      DEVICE8_PORT("IN2"),   /* Port C read */
1945      NULL,               /* Port A write */
1946      NULL,               /* Port B write */
1947      NULL               /* Port C write */
1948   },
1949   {   /* A, B & C set as input */
1950      DEVICE8_PORT("IN3"),   /* Port A read */
1951      DEVICE8_PORT("IN4"),   /* Port B read */
1952      DEVICE8_PORT("DSW1"),   /* Port C read */
1953      NULL,               /* Port A write */
1954      NULL,               /* Port B write */
1955      NULL               /* Port C write */
1956   },
10081957   {   /* A set as input */
1009      DEVICE8_PORT("DSW1"),   /* Port A read, DSW4 */
1958      DEVICE8_PORT("DSW2"),   /* Port A read */
10101959      NULL,               /* Port B read */
10111960      NULL,               /* Port C read */
10121961      NULL,               /* Port A write */
r4057r4058
10251974   NULL
10261975};
10271976
1977static const ay8910_interface cm_ay8910_config =
1978{
1979   AY8910_LEGACY_OUTPUT,
1980   AY8910_DEFAULT_LOADS,
1981   input_port_6_r,   /* DSW 4 */
1982   input_port_7_r,   /* DSW 5 */
1983   NULL,
1984   NULL
1985};
1986
1987static const ay8910_interface lucky8_ay8910_config =
1988{
1989   AY8910_LEGACY_OUTPUT,
1990   AY8910_DEFAULT_LOADS,
1991   input_port_7_r,   /* DSW 3 */
1992   input_port_8_r,   /* DSW 4 */
1993   NULL,
1994   NULL
1995};
1996
10281997static MACHINE_DRIVER_START( goldstar )
10291998
10301999   /* basic machine hardware */
r4057r4058
11302099   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)//all sound goes to the 'mono' speaker, at 1.0 X maximum
11312100MACHINE_DRIVER_END
11322101
2102
11332103static PALETTE_INIT(cm)
11342104{
11352105   int i;
r4057r4058
11512121   }
11522122}
11532123
1154static MACHINE_DRIVER_START( chryigld )
2124static PALETTE_INIT(cmast91)
2125{
2126   int i;
2127   for (i=0;i<0x100;i++)
2128   {
2129      int r,g,b;
11552130
2131      UINT8*proms = memory_region(machine, "proms");
2132
2133      b = proms[0x000+i]<<4;
2134      g = proms[0x100+i]<<4;
2135      r = proms[0x200+i]<<4;
2136
2137      palette_set_color(machine, i, MAKE_RGB(r, g, b));
2138
2139   }
2140}
2141
2142static PALETTE_INIT(lucky8)
2143{
2144   int i;
2145   int r,g,b;
2146   UINT8 dat;
2147   UINT8 *proms;
2148
2149   proms = memory_region(machine, "proms");
2150   for (i=0;i<0x100;i++)
2151   {
2152
2153      dat = proms[0x000+i] | (proms[0x100+i]<<4);
2154
2155      r = (dat & 0x07) << 5;
2156      g = (dat & 0x38) << 2;
2157      b = (dat & 0xc0) << 0;
2158
2159      palette_set_color(machine, i, MAKE_RGB(r, g, b));
2160
2161   }
2162
2163   proms = memory_region(machine, "proms2");
2164   for (i=0;i<0x20;i++)
2165   {
2166      dat = proms[i];
2167
2168      r = (dat & 0x07) << 5;
2169      g = (dat & 0x38) << 2;
2170      b = (dat & 0xc0) << 0;
2171
2172      palette_set_color(machine, i+0x80, MAKE_RGB(r, g, b));
2173   }
2174
2175}
2176
2177
2178static MACHINE_DRIVER_START( chrygld )
2179
11562180   /* basic machine hardware */
11572181   MDRV_CPU_ADD("main", Z80, 3579545)//(4000000?)
11582182   MDRV_CPU_PROGRAM_MAP(ncb3_map,0)
r4057r4058
11602184   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
11612185
11622186   /* 3x 8255 */
1163   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
1164   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
1165   MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
2187   MDRV_PPI8255_ADD( "ppi8255_0", ncb3_ppi8255_intf[0] )
2188   MDRV_PPI8255_ADD( "ppi8255_1", ncb3_ppi8255_intf[1] )
2189   MDRV_PPI8255_ADD( "ppi8255_2", ncb3_ppi8255_intf[2] )
11662190
11672191   /* video hardware */
11682192   MDRV_SCREEN_ADD("main", RASTER)
r4057r4058
11932217
11942218
11952219
1196
11972220static MACHINE_DRIVER_START( ncb3 )
11982221
11992222   /* basic machine hardware */
r4057r4058
12032226   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
12042227
12052228   /* 3x 8255 */
1206   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
1207   MDRV_PPI8255_ADD( "ppi8255_1", ppi8255_intf[1] )
1208   MDRV_PPI8255_ADD( "ppi8255_2", ppi8255_intf[2] )
2229   MDRV_PPI8255_ADD( "ppi8255_0", ncb3_ppi8255_intf[0] )
2230   MDRV_PPI8255_ADD( "ppi8255_1", ncb3_ppi8255_intf[1] )
2231   MDRV_PPI8255_ADD( "ppi8255_2", ncb3_ppi8255_intf[2] )
12092232
12102233   /* video hardware */
12112234   MDRV_SCREEN_ADD("main", RASTER)
r4057r4058
12172240
12182241   MDRV_GFXDECODE(ncb3)
12192242   MDRV_PALETTE_LENGTH(256)
1220//  MDRV_PALETTE_INIT(cm)
2243   MDRV_PALETTE_INIT(cm)
12212244
12222245   MDRV_NVRAM_HANDLER(goldstar)
12232246
r4057r4058
12442267   MDRV_CPU_IO_MAP(cm_portmap,0)
12452268   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
12462269
2270   /* 2x 8255 */
2271   MDRV_PPI8255_ADD( "cm_ppi8255_0", cm_ppi8255_intf[0] )
2272   MDRV_PPI8255_ADD( "cm_ppi8255_1", cm_ppi8255_intf[1] )
2273
12472274   /* video hardware */
12482275   MDRV_SCREEN_ADD("main", RASTER)
12492276   MDRV_SCREEN_REFRESH_RATE(60)
r4057r4058
12522279   MDRV_SCREEN_SIZE(64*8, 32*8)
12532280   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
12542281
1255   MDRV_GFXDECODE(ncb3)
2282   MDRV_GFXDECODE(cmv801)
12562283   MDRV_PALETTE_LENGTH(256)
12572284   MDRV_PALETTE_INIT(cm)
1258//  MDRV_NVRAM_HANDLER(goldstar)
2285   MDRV_NVRAM_HANDLER(goldstar)
12592286
12602287   MDRV_VIDEO_START(cherrym)
12612288   MDRV_VIDEO_UPDATE(goldstar)
12622289
12632290   /* sound hardware */
2291   MDRV_SPEAKER_STANDARD_MONO("mono")
2292   MDRV_SOUND_ADD("ay", AY8910,1500000)
2293   MDRV_SOUND_CONFIG(cm_ay8910_config)
2294   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
2295MACHINE_DRIVER_END
2296
2297static MACHINE_DRIVER_START( cmast91 )
2298
2299   /* basic machine hardware */
2300   MDRV_CPU_ADD("main", Z80, 3000000)//(4000000?)
2301   MDRV_CPU_PROGRAM_MAP(cm_map,0)
2302   MDRV_CPU_IO_MAP(cmast91_portmap,0)
2303   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
2304
2305   /* 2x 8255 */
2306   MDRV_PPI8255_ADD( "cm_ppi8255_0", cm_ppi8255_intf[0] )
2307   MDRV_PPI8255_ADD( "cm_ppi8255_1", cm_ppi8255_intf[1] )
2308
2309   /* video hardware */
2310   MDRV_SCREEN_ADD("main", RASTER)
2311   MDRV_SCREEN_REFRESH_RATE(60)
2312//  MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
2313   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
2314   MDRV_SCREEN_SIZE(64*8, 32*8)
2315   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 1*8, 31*8-1)
2316
2317   MDRV_GFXDECODE(cmv801)
2318   MDRV_PALETTE_LENGTH(256)
2319   MDRV_PALETTE_INIT(cmast91)
2320   MDRV_NVRAM_HANDLER(goldstar)
2321
2322   MDRV_VIDEO_START(cherrym)
2323   MDRV_VIDEO_UPDATE(goldstar)
2324
2325   /* sound hardware */
12642326   MDRV_SPEAKER_STANDARD_MONO("mono")//set up a standard mono speaker called 'mono'
12652327   MDRV_SOUND_ADD("ay", AY8910,1500000)//1 AY8910, at clock 150000Hz
12662328   MDRV_SOUND_CONFIG(ay8910_config)//read extra data from interface
12672329   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)//all sound goes to the 'mono' speaker, at 0.50 X maximum
1268
1269   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)//clock
1270   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified //"oki"
1271   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)//all sound goes to the 'mono' speaker, at 1.0 X maximum
12722330MACHINE_DRIVER_END
12732331
2332#if 0 // not currently used, might be needed later
12742333static MACHINE_DRIVER_START( cmb )
12752334
12762335   /* basic machine hardware */
r4057r4058
13052364   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified //"oki"
13062365   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)//all sound goes to the 'mono' speaker, at 1.0 X maximum
13072366MACHINE_DRIVER_END
2367#endif
13082368
13092369
13102370static MACHINE_DRIVER_START( lucky8 )
r4057r4058
13152375   //MDRV_CPU_IO_MAP(goldstar_readport,0)
13162376   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
13172377
2378   /* 3x 8255 */
2379   MDRV_PPI8255_ADD( "ppi8255_0", lucky8_ppi8255_intf[0] )
2380   MDRV_PPI8255_ADD( "ppi8255_1", lucky8_ppi8255_intf[1] )
2381   MDRV_PPI8255_ADD( "ppi8255_2", lucky8_ppi8255_intf[2] )
2382
13182383   /* video hardware */
13192384   MDRV_SCREEN_ADD("main", RASTER)
13202385   MDRV_SCREEN_REFRESH_RATE(60)
r4057r4058
13222387   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
13232388   MDRV_SCREEN_SIZE(64*8, 32*8)
13242389   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
2390   MDRV_PALETTE_INIT(lucky8)
13252391
13262392   MDRV_GFXDECODE(ncb3)
13272393   MDRV_PALETTE_LENGTH(256)
r4057r4058
13322398
13332399   /* sound hardware */
13342400   MDRV_SPEAKER_STANDARD_MONO("mono")//set up a standard mono speaker called 'mono'
1335   MDRV_SOUND_ADD("ay", AY8910,1500000)//1 AY8910, at clock 150000Hz
1336   MDRV_SOUND_CONFIG(ay8910_config)//read extra data from interface
1337   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)//all sound goes to the 'mono' speaker, at 0.50 X maximum
2401
2402   MDRV_SOUND_ADD("sn1", SN76489, 3000000)   /* 3 MHz. */
2403   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
2404
2405   MDRV_SOUND_ADD("ay", AY8910,1500000)
2406   MDRV_SOUND_CONFIG(lucky8_ay8910_config)
2407   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
2408
13382409MACHINE_DRIVER_END
13392410
13402411
r4057r4058
14772548
14782549
14792550
1480ROM_START( chryigld )
2551ROM_START( chrygld )
14812552   ROM_REGION( 0x10000, "main", 0 )
14822553   ROM_LOAD( "ol-v9.u20",  0x00000, 0x10000, CRC(b61c0695) SHA1(63c44b20fd7f76bdb33331273d2610e8cfd31add) )
14832554
r4057r4058
15272598   ROM_LOAD( "main_7.256", 0x10000, 0x08000, CRC(dcf97517) SHA1(0a29696e0464c8878c499b1786a17080fd088a72) )
15282599
15292600   ROM_REGION( 0x8000, "gfx2", 0 )
1530   ROM_LOAD( "1.764", 0x00000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) )
1531   ROM_LOAD( "5.764", 0x02000, 0x02000, CRC(91162010) SHA1(3acc21e7074602b247f2f392eb181802092d2f21) )
1532   ROM_LOAD( "6.764", 0x04000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) )
1533   ROM_LOAD( "7.764", 0x06000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) )
2601   ROM_LOAD( "7.764", 0x00000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) )
2602   ROM_LOAD( "6.764", 0x02000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) )
2603   ROM_LOAD( "5.764", 0x04000, 0x02000, CRC(91162010) SHA1(3acc21e7074602b247f2f392eb181802092d2f21) )
2604   ROM_LOAD( "1.764", 0x06000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) )
15342605
1535   ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE )
1536   ROM_LOAD( "colour_proms", 0x000, 0x200, NO_DUMP )
1537
1538   ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 )
1539   /* no oki on this pcb? */
2606   ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE )   /* PROM from chrygld. need verification */
2607   ROM_LOAD( "82s147.u2",      0x00000, 0x0200, BAD_DUMP CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) )
15402608ROM_END
15412609
15422610/*
r4057r4058
15622630   ROM_LOAD( "main_7.256", 0x10000, 0x08000, CRC(dcf97517) SHA1(0a29696e0464c8878c499b1786a17080fd088a72) )
15632631
15642632   ROM_REGION( 0x8000, "gfx2", 0 )
1565   ROM_LOAD( "main_4.764", 0x00000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) )
1566   ROM_LOAD( "main_3.764", 0x02000, 0x02000, CRC(91162010) SHA1(3acc21e7074602b247f2f392eb181802092d2f21) )
1567   /* 2 roms missing - roms below taken from above set */
1568   ROM_LOAD( "6.764", 0x04000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) )
1569   ROM_LOAD( "7.764", 0x06000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) )
2633   /* 2 roms missing - the first 2 roms below taken from above set */
2634   ROM_LOAD( "7.764",      0x00000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) )
2635   ROM_LOAD( "6.764",      0x02000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) )
2636   ROM_LOAD( "main_3.764", 0x04000, 0x02000, CRC(91162010) SHA1(3acc21e7074602b247f2f392eb181802092d2f21) )
2637   ROM_LOAD( "main_4.764", 0x06000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) )
15702638
1571   ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE )
1572   ROM_LOAD( "colour_proms", 0x000, 0x200, NO_DUMP )
2639   ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE )   /* PROM from chrygld. need verification */
2640   ROM_LOAD( "82s147.u2",      0x00000, 0x0200, BAD_DUMP CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) )
2641ROM_END
15732642
1574   ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 )
1575   /* no oki on this pcb? */
2643/*
2644CB3A
2645Known differences with ncb3:
2646
2647- Double-Up rate: 50% and 80% instead of 80% and 90%.
2648
2649*/
2650
2651ROM_START( cb3a )
2652   ROM_REGION( 0x10000, "main", 0 )
2653   ROM_LOAD( "cb3a01.bin", 0x00000, 0x10000, CRC(53b099ab) SHA1(612d86d7f011a554903400e60e2c4a0d4f24e095) )
2654
2655   ROM_REGION( 0x18000, "gfx1", 0 )
2656   ROM_LOAD( "2.256", 0x00000, 0x08000, CRC(83650a94) SHA1(e79420ab559d3f74013708767ca3f238fd333fb7) )
2657   ROM_LOAD( "3.256", 0x08000, 0x08000, CRC(2f46a3f5) SHA1(3e6022ee8f84039e48f41aea5e68ee28aabdc556) )
2658   ROM_LOAD( "main_7.256", 0x10000, 0x08000, CRC(dcf97517) SHA1(0a29696e0464c8878c499b1786a17080fd088a72) )
2659
2660   ROM_REGION( 0x8000, "gfx2", 0 )
2661   ROM_LOAD( "7.764", 0x00000, 0x02000, CRC(7cc6d26b) SHA1(de33e8985affce7bd3ead89463117c9aaa93d5e4) )
2662   ROM_LOAD( "6.764", 0x02000, 0x02000, CRC(e73ea4e3) SHA1(c9fd56461f6986d6bc170403d298fcc408a524e9) )
2663   ROM_LOAD( "5.764", 0x04000, 0x02000, CRC(91162010) SHA1(3acc21e7074602b247f2f392eb181802092d2f21) )
2664   ROM_LOAD( "1.764", 0x06000, 0x02000, CRC(cbcc6bfb) SHA1(5bafc934fef1f50d8c182c39d3a7ce795c89d175) )
2665
2666   ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE )   /* PROM from chrygld. need verification */
2667   ROM_LOAD( "82s147.u2",      0x00000, 0x0200, BAD_DUMP CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) )
15762668ROM_END
15772669
15782670
r4057r4058
16002692   ROM_LOAD( "prom1.287", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
16012693ROM_END
16022694
1603// this is probably different hardware..
2695/*
26962764.u10                m4.64                   IDENTICAL
269727256.u11               m6.256                  IDENTICAL
26982764.u14                m1.64                   IDENTICAL
26992764.u15                m3.64                   IDENTICAL
270027256.u16               m5.256                  IDENTICAL
270127256.u4                m7.256                  IDENTICAL
270282s129.u46              prom1.287               IDENTICAL
270382s129.u70              prom3.287               IDENTICAL
270482s129.u84              prom2.287               IDENTICAL
27052764.u9                 m2.64                   IDENTICAL
270627512.u53               prg512                  4.640198%
270727256.u81                                       NO MATCH
2708
2709PCB Layout
2710----------
2711
2712|-----|  |------|  |---------------------------|
2713|     |--|      |--|  ROM.U4                   |
2714|                     ROM.U11  ROM.U10  ROM.U9 |
2715|_            DSW5(8) ROM.U16  ROM.U15  ROM.U14|
2716  |  WF19054  DSW4(8)                          |
2717 _|           DSW3(8) 6116                     |
2718|             DSW2(8) 6116         6116        |
2719|             DSW1(8)                          |
2720|    ?DIP40                        6116        |
2721|                                              |
2722|                     PROM.U46            12MHz|
2723|                                              |
2724|    8255                       PAL            |
2725|         ROM.U53                              |
2726|                                              |
2727|                                              |
2728|                                   PAL        |
2729|BATTERY  PROM.U70        PAL   PAL            |
2730|_        PROM.U84        6116  ROM.U81    Z80 |
2731  |--------------------------------------------|
2732Notes:
2733      Z80 @ 3.0MHz [12/4]
2734      WF19054 = AY-3-8910 @ 1.5MHz [12/8]
2735      ?DIP40 - Maybe another 8255 or HD6845 or something else?
2736*/
2737
2738ROM_START( cmv4 )
2739   ROM_REGION( 0x10000, "main", 0 )
2740   ROM_LOAD( "27256.u81",  0x0000, 0x1000, CRC(e27e98a3) SHA1(1eb03f6c770f25ff5e3c25a1f9b9294c6b3c61d9) )
2741   ROM_CONTINUE(0x3000,0x1000)
2742   ROM_CONTINUE(0x7000,0x1000)
2743   ROM_CONTINUE(0x5000,0x1000)
2744   ROM_CONTINUE(0x6000,0x1000)
2745   ROM_CONTINUE(0x2000,0x1000)
2746   ROM_CONTINUE(0x4000,0x1000)
2747   ROM_CONTINUE(0x1000,0x1000)
2748
2749   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
2750   ROM_LOAD( "27256.u16",  0x00000, 0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) )
2751   ROM_LOAD( "27256.u11",  0x08000, 0x8000, CRC(63b3df4e) SHA1(9bacd23da598805ec18ec5ad15cab95d71eb9262) )
2752   ROM_LOAD( "27256.u4",   0x10000, 0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) )
2753
2754   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
2755   ROM_LOAD( "2764.u15",   0x0000, 0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) )
2756   ROM_LOAD( "2764.u10",   0x2000, 0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) )
2757   ROM_LOAD( "2764.u14",   0x4000, 0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) )
2758   ROM_LOAD( "2764.u9",    0x6000, 0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) )
2759
2760   ROM_REGION( 0x10000, "user1", 0 )
2761   // contains a bitmap? and an extra plane for gfx2, should it be used?
2762   ROM_LOAD( "27512.u53",  0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
2763
2764   ROM_REGION( 0x200, "proms", 0 )
2765   ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) )
2766   ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) )
2767
2768   ROM_REGION( 0x100, "proms2", 0 )
2769   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
2770ROM_END
2771
2772
2773/* looks like a bootleg of cmv4 */
16042774ROM_START( cmaster )
16052775   ROM_REGION( 0x10000, "main", 0 )
1606   ROM_LOAD( "8.bin",   0x00000, 0x10000, CRC(31a16d9f) SHA1(f007148449d66954b780f12a9f910968a4052482) )
2776   ROM_LOAD( "3.bin",   0x00000, 0x1000, CRC(ccb64229) SHA1(532f4b59952702a3609ff20239acbbacaf71f38f) )
2777   ROM_CONTINUE(0x4000,0x1000)
2778   ROM_CONTINUE(0x3000,0x1000)
2779   ROM_CONTINUE(0x7000,0x1000)
2780   ROM_CONTINUE(0x1000,0x1000)
2781   ROM_CONTINUE(0x6000,0x1000)
2782   ROM_CONTINUE(0x2000,0x1000)
2783   ROM_CONTINUE(0x5000,0x1000)
2784   ROM_IGNORE(0x8000) // 2nd half is identical
16072785
1608   ROM_REGION( 0x40000, "user1", 0 )
2786   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE )
2787   ROM_LOAD( "6.bin",   0x00000, 0x10000, CRC(a98d610f) SHA1(d14b3bc8bd6dc9fe2d3fb05ec08224b1a9d52bee) )
2788   ROM_LOAD( "7.bin",   0x10000, 0x10000, CRC(a0ffd2d6) SHA1(e78d20d3ab578ccc880bc19678782cb1f8d3671e) )
2789   ROM_LOAD( "8.bin",   0x20000, 0x10000, CRC(4f67fca7) SHA1(808e84b9b1f67f137528bb76b0e8aac3dceba20c) )
2790
2791   // 4-9 all of these contain the same bitmap at 0x0000-0xe000
2792   // rom 9 matches the rom containing the bitmap in the cmv4 set, but also contains an extra gfx2 plane
2793   //  should that plane be used??
2794   ROM_REGION( 0x50000, "graphics", ROMREGION_DISPOSE )
2795   ROM_LOAD( "4.bin",   0x00000, 0x10000, CRC(52240e0f) SHA1(7b8375e1f91fdff2b4ccc2e81fbcf843f7ede292) )
2796   ROM_LOAD( "5.bin",    0x10000, 0x10000, CRC(763973c1) SHA1(b364f22041f1d678332554edb3c718cf0ad778b4) )
2797   ROM_LOAD( "1.bin",   0x20000, 0x10000, CRC(634fe2ad) SHA1(2284a09446c8928060270861d372a19c0c9d827a) )
2798   ROM_LOAD( "2.bin",   0x30000, 0x10000, CRC(a3d59f79) SHA1(588c45550cca673390a35af9617c68c853ff84ba) )
2799   ROM_LOAD( "9.bin",   0x40000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
2800
2801   // for now we don't copy the extra plane..
2802   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
2803   ROM_COPY( "graphics", 0x0e000, 0x00000, 0x2000 )
2804   ROM_COPY( "graphics", 0x1e000, 0x02000, 0x2000 )
2805   ROM_COPY( "graphics", 0x2e000, 0x04000, 0x2000 )
2806   ROM_COPY( "graphics", 0x3e000, 0x06000, 0x2000 )
2807
2808   // copy one of the versions of the bitmap
2809   ROM_REGION( 0x10000, "user1", ROMREGION_DISPOSE )
2810   ROM_COPY( "graphics", 0x40000, 0x00000, 0xe000 )
2811
2812   ROM_REGION( 0x200, "proms", 0 )
2813   ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) )
2814   ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) )
2815
2816   ROM_REGION( 0x100, "proms2", 0 )
2817   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
2818ROM_END
2819
2820
2821/* doesn't seem to have 'cherry master 2' anywhere on the screen.. */
2822/*
2823
2824    Cherry Master II ver 8.41
2825
2826    CPU : LH0080B Z80B CPU
2827
2828    RAM : MB8128-15 x2
2829
2830        MB8416-20 x2
2831
2832        HM6116
2833
2834    Sound : Winbond WF19054
2835
2836    Crystal : 12.000 Mhz
2837
2838    Dip SW :
2839
2840    4x8 dip + 1 Switch (main test ???)
2841*/
2842
2843ROM_START( cm2v841 )
2844   ROM_REGION( 0x10000, "main", 0 )
2845   ROM_LOAD( "u81.9",  0x0000,  0x1000, CRC(09e44314) SHA1(dbb7e9afc9a1dc0d4ce7b150324077f3f3579c02) )
2846   ROM_CONTINUE(0x4000,0x1000)
2847   ROM_CONTINUE(0x3000,0x1000)
2848   ROM_CONTINUE(0x7000,0x1000)
2849   ROM_CONTINUE(0x1000,0x1000)
2850   ROM_CONTINUE(0x6000,0x1000)
2851   ROM_CONTINUE(0x2000,0x1000)
2852   ROM_CONTINUE(0x5000,0x1000)
2853
2854   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
2855   ROM_LOAD( "u4.5",  0x10000,  0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) )
2856   ROM_LOAD( "u11.6", 0x08000,  0x8000, CRC(63b3df4e) SHA1(9bacd23da598805ec18ec5ad15cab95d71eb9262) )
2857   ROM_LOAD( "u16.7", 0x00000,  0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) )
2858
2859   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
2860   ROM_LOAD( "u15.4",  0x0000,  0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) )
2861   ROM_LOAD( "u10.3",  0x2000,  0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) )
2862   ROM_LOAD( "u14.2",  0x4000,  0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) )
2863   ROM_LOAD( "u9.1",   0x6000,  0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) )
2864
2865   ROM_REGION( 0x10000, "user1", ROMREGION_DISPOSE )
2866   ROM_LOAD( "u53.8",  0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
2867
2868   /* proms taken from cmv4, probably wrong  */
2869   ROM_REGION( 0x200, "proms", 0 )
2870   ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) )
2871   ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) )
2872
2873   ROM_REGION( 0x100, "proms2", 0 )
2874   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
2875ROM_END
2876
2877ROM_START( cm2841a )
2878   ROM_REGION( 0x10000, "main", 0 )
2879   ROM_LOAD( "msii841.u81",  0x3000,  0x1000, CRC(977db602) SHA1(0fd3d6781b654ac6befdc9278f84ca708d5d448c) )
2880   ROM_CONTINUE(0x2000,0x1000)
2881   ROM_CONTINUE(0x1000,0x1000)
2882   ROM_CONTINUE(0x0000,0x1000)
2883   ROM_CONTINUE(0x4000,0x1000)
2884   ROM_CONTINUE(0x5000,0x1000)
2885   ROM_CONTINUE(0x6000,0x1000)
2886   ROM_CONTINUE(0x7000,0x1000)
2887
2888   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
2889   ROM_LOAD( "msii841.u4",  0x10000,  0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) )
2890   ROM_LOAD( "msii841.u11", 0x08000,  0x8000, CRC(63b3df4e) SHA1(9bacd23da598805ec18ec5ad15cab95d71eb9262) )
2891   ROM_LOAD( "msii841.u16", 0x00000,  0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) )
2892
2893   /* these gfx are in a different format to usual */
2894   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
2895   ROM_LOAD( "msii841.u1",  0x0000,  0x4000, CRC(cf322ed2) SHA1(84df96229b7bdba0ab498e3bf9c77d7a7661f7b3) )
2896   ROM_LOAD( "msii841.u2",  0x4000,  0x4000, CRC(58c05653) SHA1(59454c07f4fe5b684d078cf97f2b1ee05b02f4ed) )
2897
2898   ROM_REGION( 0x10000, "user1", ROMREGION_DISPOSE )
2899   ROM_LOAD( "msii841.u53",  0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
2900
2901   /* proms taken from cmv4, probably wrong  */
2902   ROM_REGION( 0x200, "proms", 0 )
2903   ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) )
2904   ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) )
2905
2906   ROM_REGION( 0x100, "proms2", 0 )
2907   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
2908ROM_END
2909
2910
2911ROM_START( cmast91 )
2912   ROM_REGION( 0x10000, "main", 0 )
2913   ROM_LOAD( "8.bin",   0x00000, 0x01000, CRC(31a16d9f) SHA1(f007148449d66954b780f12a9f910968a4052482) )
2914   ROM_CONTINUE(0x1000,0x1000)
2915   ROM_CONTINUE(0x4000,0x1000)
2916   ROM_CONTINUE(0x5000,0x1000)
2917   ROM_CONTINUE(0x2000,0x1000)
2918   ROM_CONTINUE(0x3000,0x1000)
2919   ROM_CONTINUE(0x6000,0x1000)
2920   ROM_CONTINUE(0x7000,0x1000)
2921   ROM_CONTINUE(0x8000,0x1000)
2922   ROM_CONTINUE(0x9000,0x1000)
2923   ROM_CONTINUE(0xa000,0x1000)
2924   ROM_CONTINUE(0xb000,0x1000)
2925   ROM_CONTINUE(0xc000,0x1000)
2926   ROM_CONTINUE(0xd000,0x1000)
2927   ROM_CONTINUE(0xe000,0x1000)
2928   ROM_CONTINUE(0xf000,0x1000)
2929
2930   ROM_REGION( 0x40000, "user1", 0 ) // unknown, bitmaps, or sound?
16092931   ROM_LOAD( "9.bin",   0x00000, 0x40000, CRC(92342276) SHA1(f9436752f2ec67cf873fd01c729c7c113dc18be0) ) // ?
16102932
16112933   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
1612   ROM_LOAD( "5.bin",   0x00000, 0x8000, CRC(28ff88cc) SHA1(46bc0407be857e8348159735b60cfb660f047a56) )
2934   ROM_LOAD( "5.bin",   0x10000, 0x8000, CRC(28ff88cc) SHA1(46bc0407be857e8348159735b60cfb660f047a56) )
16132935   ROM_LOAD( "6.bin",   0x08000, 0x8000, CRC(13582e74) SHA1(27e318542606b8e8d38250749ba996402d314abd) )
1614   ROM_LOAD( "7.bin",   0x10000, 0x8000, CRC(1edf1f1d) SHA1(558fa01f1efd7f6541047d3930bdce0974bae5b0))
2936   ROM_LOAD( "7.bin",   0x00000, 0x8000, CRC(1edf1f1d) SHA1(558fa01f1efd7f6541047d3930bdce0974bae5b0))
16152937
16162938   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
16172939   ROM_LOAD( "1.bin",     0x0000, 0x8000, CRC(71bdab69) SHA1(d2c594ed88d6368df15b623c48eecc1c219b839e) )
r4057r4058
16192941   ROM_LOAD( "3.bin",     0x10000, 0x8000, CRC(dc77d04a) SHA1(d8656130cde54d4bb96307899f6d607867e49e6c) )
16202942   ROM_LOAD( "4.bin",      0x18000, 0x8000, CRC(0dbabaa2) SHA1(44235b19dac1c996e2166672b03f6e3888ecbefa) )
16212943
1622   ROM_REGION( 0x400, "proms", 0 )
2944   ROM_REGION( 0x300, "proms", 0 )
16232945   ROM_LOAD( "p1.bin", 0x0000, 0x0100, CRC(ac529f04) SHA1(5bc92e50c85bb23e609172cc15c430ddea7fdcb5) )
16242946   ROM_LOAD( "p2.bin", 0x0100, 0x0100, CRC(3febce95) SHA1(c7c0fec0fb024ebf7d7365a09d28ba3d0037b0b4) )
16252947   ROM_LOAD( "p3.bin", 0x0200, 0x0100, CRC(99dbdf19) SHA1(3680335406f63289f8d9a81b4cd163e4aa0c14d4) )
1626   ROM_LOAD( "p4.bin", 0x0300, 0x0100, CRC(72212427) SHA1(e87a91f28284313c706ebb8175a3586780636e31) )
1627ROM_END
16282948
1629ROM_START( cmasterb )
1630   ROM_REGION( 0x10000, "main", 0 )
1631   ROM_LOAD( "3.bin",   0x00000, 0x10000, CRC(ccb64229) SHA1(532f4b59952702a3609ff20239acbbacaf71f38f) )
1632
1633   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE )
1634   ROM_LOAD( "6.bin",   0x00000, 0x10000, CRC(a98d610f) SHA1(d14b3bc8bd6dc9fe2d3fb05ec08224b1a9d52bee) )
1635   ROM_LOAD( "7.bin",   0x10000, 0x10000, CRC(a0ffd2d6) SHA1(e78d20d3ab578ccc880bc19678782cb1f8d3671e) )
1636   ROM_LOAD( "8.bin",   0x20000, 0x10000, CRC(4f67fca7) SHA1(808e84b9b1f67f137528bb76b0e8aac3dceba20c) )
1637
1638   ROM_REGION( 0x50000, "gfx2", ROMREGION_DISPOSE )
1639   ROM_LOAD( "9.bin",   0x00000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
1640   ROM_LOAD( "1.bin",   0x10000, 0x10000, CRC(634fe2ad) SHA1(2284a09446c8928060270861d372a19c0c9d827a) )
1641   ROM_LOAD( "2.bin",   0x20000, 0x10000, CRC(a3d59f79) SHA1(588c45550cca673390a35af9617c68c853ff84ba) )
1642   ROM_LOAD( "4.bin",   0x30000, 0x10000, CRC(52240e0f) SHA1(7b8375e1f91fdff2b4ccc2e81fbcf843f7ede292) )
1643   ROM_LOAD( "5.bin",    0x40000, 0x10000, CRC(763973c1) SHA1(b364f22041f1d678332554edb3c718cf0ad778b4) )
1644
1645   ROM_REGION( 0x400, "proms", 0 )   // from cmaster
1646   ROM_LOAD( "p1.bin", 0x0000, 0x0100, CRC(ac529f04) SHA1(5bc92e50c85bb23e609172cc15c430ddea7fdcb5) )
1647   ROM_LOAD( "p2.bin", 0x0100, 0x0100, CRC(3febce95) SHA1(c7c0fec0fb024ebf7d7365a09d28ba3d0037b0b4) )
1648   ROM_LOAD( "p3.bin", 0x0200, 0x0100, CRC(99dbdf19) SHA1(3680335406f63289f8d9a81b4cd163e4aa0c14d4) )
1649   ROM_LOAD( "p4.bin", 0x0300, 0x0100, CRC(72212427) SHA1(e87a91f28284313c706ebb8175a3586780636e31) )
2949   ROM_REGION( 0x100, "proms2", 0 ) // screen layout?
2950   ROM_LOAD( "p4.bin", 0x0000, 0x0100, CRC(72212427) SHA1(e87a91f28284313c706ebb8175a3586780636e31) )
16502951ROM_END
16512952
16522953/*
r4057r4058
16822983   ROM_LOAD( "7",  0x10000, 0x8000, CRC(c415b9d0) SHA1(fd558fe8a116c33bbd712a639224d041447a45c1) )
16832984
16842985   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
1685   ROM_LOAD( "3",   0x0000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) )
1686   ROM_LOAD( "4",   0x2000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) )
1687   ROM_LOAD( "1",   0x4000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) )
1688   ROM_LOAD( "2",   0x6000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) )
2986   ROM_LOAD( "1",   0x0000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) )
2987   ROM_LOAD( "2",   0x2000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) )
2988   ROM_LOAD( "3",   0x4000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) )
2989   ROM_LOAD( "4",   0x6000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) )
16892990
16902991   ROM_REGION( 0x200, "proms", 0 )
1691   ROM_LOAD( "d12", 0x0100, 0x0100, CRC(23e81049) SHA1(78071dae70fad870e972d944642fb3a2374be5e4) )
2992   ROM_LOAD( "d12", 0x0000, 0x0100, CRC(23e81049) SHA1(78071dae70fad870e972d944642fb3a2374be5e4) )
2993   /* missing prom? - using one from other dump */
2994   ROM_LOAD( "prom4", 0x0100, 0x0100, CRC(526cf9d3) SHA1(eb779d70f2507d0f26d225ac8f5de8f2243599ca) )
2995
2996   ROM_REGION( 0x20, "proms2", 0 )
2997   ROM_LOAD( "d13", 0x0000, 0x0020, CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) )
2998
2999   ROM_REGION( 0x100, "unkprom", 0 )
16923000   ROM_LOAD( "g14", 0x0000, 0x0100, CRC(bd48de71) SHA1(e4fa1e774af1499bc568be5b2deabb859d8c8172) )
16933001
3002   ROM_REGION( 0x20, "unkprom2", 0 )
3003   ROM_LOAD( "g13", 0x0000, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
3004ROM_END
3005
3006/*
3007unknown koren or chinese bootleg of something?
3008
3009XTAL 12MHz
3010Z80 @ 3MHz
3011AY3-8910 @ 1.5MHz
30128255 x3
3013RAM 6116 x5
301476489 x1
30158-position DSW x4
3016
3017----
3018
301913 and 13 files
3020g14                                             FIXED BITS (0000xxxx)
3021g14                                             BADADDR                xxxxx---
3022g13                                             FIXED BITS (1x1xxxxx11xxxxxx)
3023d13                                             FIXED BITS (xxxxxx0xxxxxxxxx)
3024d13                                             1ST AND 2ND HALF IDENTICAL
3025d12                                             FIXED BITS (0000xxxx)
3026                        prom1                   FIXED BITS (xxxxxx0xxxxxxxxx)
3027                        prom1                   1ST AND 2ND HALF IDENTICAL
3028                        prom2                   FIXED BITS (1x11xxxx11x1xxxx)
3029                        prom3                   FIXED BITS (0000xxxx)
3030                        prom4                   FIXED BITS (0000xxxx)
3031                        prom5                   FIXED BITS (00001xxx)
3032                        prom5                   BADADDR                xxxxxxx-
3033d13                     prom1                   IDENTICAL
3034d12                     prom3                   IDENTICAL
30356                       7                       IDENTICAL
30365                       6                       IDENTICAL
30374                       5                       IDENTICAL
30383                       4                       IDENTICAL
30392                       3                       IDENTICAL
30401                       2                       IDENTICAL
30417                       8                       99.990845%
3042g13                     prom2                   90.625000%
3043g14                     prom4                   61.718750%
30449                                               NO MATCH
30458                                               NO MATCH
3046                        1                       NO MATCH
3047                        prom5                   NO MATCH
3048
3049There is a loop at 0x0010 that decrement (HL) when is pointing to ROM space.
3050This should be worked out or patched to allow boot the game.
3051Seems to be related to timing since once patched the game is very fast.
3052
3053*/
3054ROM_START( lucky8a )
3055   ROM_REGION( 0x8000, "main", 0 )
3056   // we have to patch this, it might be bad
3057   ROM_LOAD( "1",    0x0000, 0x8000, BAD_DUMP CRC(554cddff) SHA1(8a0678993c7010f70adc9e9443b51cf5929bf110) )
3058
3059   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
3060   ROM_LOAD( "6",  0x00000, 0x8000, CRC(59026af3) SHA1(3d7f7e78968ca26275635aeaa0e994468a3da575) )
3061   ROM_LOAD( "7",  0x08000, 0x8000, CRC(67a073c1) SHA1(36194d57d0dc0601fa1fdf2e6806f11b2ea6da36) )
3062   ROM_LOAD( "8",  0x10000, 0x8000, CRC(80b35f06) SHA1(561d257d7bc8976cfa08f36d84961f1263509b5b) )
3063
3064   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
3065   ROM_LOAD( "2",   0x0000, 0x2000, CRC(29d6f197) SHA1(1542ca457594f6b7fe8f28f7d78023edd7021bc8) )
3066   ROM_LOAD( "3",   0x2000, 0x2000, CRC(5f812e65) SHA1(70d9ea82f9337936bf21f82b6961768d436f3a6f) )
3067   ROM_LOAD( "4",   0x4000, 0x2000, CRC(898b9ed5) SHA1(11b7d1cfcf425d00d086c74e0dbcb72068dda9fe) )
3068   ROM_LOAD( "5",   0x6000, 0x2000, CRC(4f7cfb35) SHA1(0617cf4419be00d9bacc78724089cb8af4104d68) )
3069
3070   ROM_REGION( 0x200, "proms", 0 )
3071   ROM_LOAD( "prom3", 0x0000, 0x0100, CRC(23e81049) SHA1(78071dae70fad870e972d944642fb3a2374be5e4) )
3072   ROM_LOAD( "prom4", 0x0100, 0x0100, CRC(526cf9d3) SHA1(eb779d70f2507d0f26d225ac8f5de8f2243599ca) )
3073
16943074   ROM_REGION( 0x40, "proms2", 0 )
1695   ROM_LOAD( "d13", 0x0000, 0x0020, CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) )
1696   ROM_LOAD( "g13", 0x0020, 0x0020, CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
3075   ROM_LOAD( "prom1", 0x0000, 0x0020, CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) )
3076
3077   ROM_REGION( 0x100, "unkprom", 0 )
3078   ROM_LOAD( "prom5", 0x000, 0x0100, CRC(1d668d4a) SHA1(459117f78323ea264d3a29f1da2889bbabe9e4be) )
3079
3080   ROM_REGION( 0x40, "unkprom2", 0 )
3081   ROM_LOAD( "prom2", 0x0000, 0x0020, CRC(7b1a769f) SHA1(788b3573df17d398c74662fec4fd7693fc27e2ef) )
16973082ROM_END
16983083
16993084
r4057r4058
17113096   }
17123097}
17133098
1714static DRIVER_INIT( chry10 )
3099// this block swapping is the same for chry10, chrygld and cb3
3100//  the underlying bitswaps / xors are different however
3101static void do_blockswaps(UINT8* ROM)
17153102{
1716   // probably has the same block swapping as chryigld below, but data swap is different
1717}
1718
1719static DRIVER_INIT( chryigld )
1720{
17213103   int A;
1722   UINT8 *ROM = memory_region(machine, "main");
17233104   UINT8 *buffer;
17243105
17253106   static UINT16 cherry_swaptables[32] = {
r4057r4058
17283109      0x1800, 0x3000, 0x6800, 0x7000,
17293110      0x0000, 0x4800, 0x2000, 0x5000,
17303111      0x1000, 0x7800, 0x6000, 0x3800,
1731      /* bit below, I'm not sure, no exact match, but only the first ones matter? */
3112      /* bit below, I'm not sure, no exact match, but only the first ones matter,
3113           as the is just garbage */
17323114      0xc000, 0xc800, 0xd000, 0xd800,
17333115      0xe000, 0xe800, 0xf000, 0xf800,
17343116      0x8000, 0x8800, 0x9000, 0x9800,
r4057r4058
17363118   };
17373119
17383120   buffer = malloc(0x10000);
3121   memcpy(buffer,ROM,0x10000);
17393122
1740   // a data bitswap (this is correct for chryigld, not chry10)
1741   for (A = 0;A < 0x10000;A++)
1742   {
1743      UINT8 dat = ROM[A];
1744      dat =  BITSWAP8(dat,5,6,3,4,7,2,1,0);
1745      buffer[A] = dat;
1746   }
1747
17483123   // swap some 0x800 blocks around..
17493124   for (A =0;A<32; A++)
17503125   {
r4057r4058
17523127   }
17533128
17543129   free(buffer);
3130}
17553131
3132static void dump_to_file(running_machine* machine, UINT8* ROM)
3133{
17563134   #if 0
17573135   {
17583136      FILE *fp;
r4057r4058
17683146   #endif
17693147}
17703148
3149UINT8 decrypt(UINT8 cipherText, UINT16 address)
3150{
3151   int idx;
3152   UINT8 output;
3153   int rotation[8] = {1, 0, 0, 1, 0, 1, 1, 1};
3154   int sbox[8] = {0x08, 0x08, 0x28, 0x00, 0x20, 0x20, 0x88, 0x88};
17713155
3156   idx = BIT(cipherText, 1) | (BIT(address,0) << 1) | (BIT(address, 4) << 2);
3157
3158   if (rotation[idx] == 0)
3159      output = BITSWAP8(cipherText, 5, 6, 3, 4, 7, 2, 1, 0);   // rotates bit #3, #5 and #7 in one direction...
3160   else
3161      output = BITSWAP8(cipherText, 3, 6, 7, 4, 5, 2, 1, 0);   // ... or in the other
3162
3163   return output ^ sbox[idx];
3164}
3165
3166UINT8 chry10_decrypt(UINT8 cipherText)
3167{
3168   return cipherText ^ (BIT(cipherText, 4) << 3) ^ (BIT(cipherText, 1) << 5) ^ (BIT(cipherText, 6) << 7);
3169}
3170
3171static DRIVER_INIT( chry10 )
3172{
3173   UINT8 *ROM = memory_region(machine, "main");
3174   int size = memory_region_length(machine, "main");
3175   int start = 0;
3176
3177   UINT8 *buffer;
3178   int i;
3179
3180   for (i = start; i < size; i++)
3181   {
3182      ROM[i] = chry10_decrypt(ROM[i]);
3183   }
3184
3185   buffer = malloc_or_die(size);
3186   memcpy(buffer, ROM, size);
3187
3188   free(buffer);
3189
3190   do_blockswaps(ROM);
3191   dump_to_file(machine, ROM);
3192}
3193
3194static DRIVER_INIT( cb3 )
3195{
3196   UINT8 *ROM = memory_region(machine, "main");
3197   int size = memory_region_length(machine, "main");
3198   int start = 0;
3199
3200   UINT8 *buffer;
3201   int i;
3202
3203   for (i = start; i < size; i++)
3204   {
3205      ROM[i] = decrypt(ROM[i], i);
3206   }
3207
3208   buffer = malloc_or_die(size);
3209   memcpy(buffer, ROM, size);
3210
3211   free(buffer);
3212
3213   do_blockswaps(ROM);
3214   dump_to_file(machine, ROM);
3215}
3216
3217
3218static DRIVER_INIT( chrygld )
3219{
3220   int A;
3221   UINT8 *ROM = memory_region(machine, "main");
3222   do_blockswaps(ROM);
3223
3224   // a data bitswap
3225   for (A = 0;A < 0x10000;A++)
3226   {
3227      UINT8 dat = ROM[A];
3228      dat =  BITSWAP8(dat,5,6,3,4,7,2,1,0);
3229      ROM[A] = dat;
3230   }
3231
3232   dump_to_file(machine, ROM);
3233}
3234
3235static DRIVER_INIT(cm)
3236{
3237   UINT8 *ROM = memory_region(machine, "main");
3238
3239/*  forcing PPI mode 0 for all, and A, B & C as input.
3240    the mixed modes 2-0 are not working properly.
3241*/
3242   ROM[0x0021] = 0x9b;
3243   ROM[0x0025] = 0x9b;
3244}
3245
3246static DRIVER_INIT(cmv4)
3247{
3248   UINT8 *ROM = memory_region(machine, "main");
3249
3250/*  forcing PPI mode 0 for all, and A, B & C as input.
3251    the mixed modes 2-0 are not working properly.
3252*/
3253   ROM[0x0209] = 0x9b;
3254   ROM[0x020d] = 0x9b;
3255}
3256
3257static DRIVER_INIT(cmast91)
3258{
3259   UINT8 *ROM = memory_region(machine, "main");
3260
3261/*  forcing PPI mode 0 for all, and A, B & C as input.
3262    the mixed modes 2-0 are not working properly.
3263*/
3264   ROM[0x0070] = 0x9b;
3265   ROM[0x0a92] = 0x9b;
3266}
3267
3268static DRIVER_INIT(lucky8a)
3269{
3270   UINT8 *ROM = memory_region(machine, "main");
3271
3272   ROM[0x0010] = 0x21;
3273}
3274
3275
17723276/*********************************************
17733277*                Game Drivers                *
17743278**********************************************
17753279
1776      YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY       FULLNAME                                  FLAGS  */
1777GAME( 199?, goldstar, 0,        goldstar, goldstar, goldstar, ROT0, "IGS",         "Golden Star",                            0 )
1778GAME( 199?, goldstbl, goldstar, goldstbl, goldstar, 0,        ROT0, "IGS",         "Golden Star (Blue version)",             0 )
1779GAME( 199?, moonlght, goldstar, moonlght, goldstar, 0,        ROT0, "bootleg",     "Moon Light (bootleg of Golden Star)",    0 )
1780GAME( 199?, chryigld, goldstar, chryigld, chryigld, chryigld, ROT0, "bootleg",     "Cherry I Gold (bootleg of Golden Star)", 0 )
1781GAME( 199?, chry10,   goldstar, chryigld, goldstar, chry10,   ROT0, "bootleg",     "Cherry 10 (bootleg of Golden Star)",     GAME_NOT_WORKING )
3280      YEAR  NAME      PARENT    MACHINE   INPUT     INIT      ROT    COMPANY              FULLNAME                                 FLAGS  */
3281GAME( 199?, goldstar, 0,        goldstar, goldstar, goldstar, ROT0, "IGS",               "Golden Star",                            0 )
3282GAME( 199?, goldstbl, goldstar, goldstbl, goldstar, 0,        ROT0, "IGS",               "Golden Star (Blue version)",             0 )
3283GAME( 199?, moonlght, goldstar, moonlght, goldstar, 0,        ROT0, "bootleg",           "Moon Light (bootleg of Golden Star)",    0 )
3284GAME( 199?, chrygld,  0,        chrygld,  chrygld,  chrygld,  ROT0, "bootleg",           "Cherry Gold I",                          0 )
3285GAME( 199?, chry10,   0,        chrygld,  ncb3,     chry10,   ROT0, "bootleg",           "Cherry 10 (bootleg of Golden Star)",     GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
17823286
17833287// are these really dyna, or bootlegs?
1784GAME( 19??, ncb3,     goldstar, ncb3,     ncb3,     0,        ROT0, "Dyna",        "Cherry Bonus III (Version 1.40)",        GAME_NOT_WORKING | GAME_WRONG_COLORS ) // set was labeled 'new cherry bonus 3' but there is no 'new' in the gfx roms
1785GAME( 19??, cb3,      goldstar, ncb3,     goldstar, 0,        ROT0, "Dyna",        "Cherry Bonus III",                       GAME_NOT_WORKING | GAME_WRONG_COLORS | GAME_NO_SOUND )
3288GAME( 199?, ncb3,     0,        ncb3,     ncb3,     0,        ROT0, "Dyna",              "Cherry Bonus III (ver.1.40, set 1)",     0 )
3289GAME( 199?, cb3a,     ncb3,     ncb3,     cb3a,     0,        ROT0, "Dyna",              "Cherry Bonus III (ver.1.40, set 2)",     0 )
3290GAME( 199?, cb3,      ncb3,     ncb3,     ncb3,     cb3,      ROT0, "Dyna",              "Cherry Bonus III (ver.1.40, encrypted)", 0 )
17863291
17873292// cherry master hardware has a rather different mem map, but is basically the same
1788GAME( 198?, cmv801,   0,        cm,       cmv801,   0,        ROT0, "Corsica",     "Cherry Master (Corsica, v8.01)",         GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) // says ED-96 where the manufacturer is on some games..
1789GAME( 1991, cmaster,  0,        cm,       cmv801,   0,        ROT0, "Dyna",        "Cherry Master 91?",                      GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING ) // different HW? closer to cherry master 2?
1790GAME( 1991, cmasterb, cmaster,  cmb,      cmv801,   0,        ROT0, "Dyna",        "Cherry Master I (v1.01)",                 GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING )
1791GAME( 1989, lucky8,   0,        lucky8,   goldstar, 0,        ROT0, "Wing Co.Ltd", "New Lucky 8 Lines",                      GAME_NOT_WORKING )
3293GAME( 198?, cmv801,   0,        cm,       cmv801,   cm,       ROT0, "Corsica",           "Cherry Master (Corsica, ver.8.01)",      0 ) /* says ED-96 where the manufacturer is on some games.. */
3294
3295GAME( 1992, cmv4,     0,        cm,       cmv4,     cmv4,     ROT0, "Dyna",              "Cherry Master (ver.4)",                  0 )
3296GAME( 1991, cmaster,  cmv4,     cm,       cmaster,  0,        ROT0, "Dyna",              "Cherry Master I (ver.1.01)",             0 )
3297GAME( 198?, cm2v841,  cmv4,     cm,       cmv801,   0,        ROT0, "Dyna",              "Cherry Master (II?) (ver.8.41, set 1)",  GAME_NOT_WORKING )
3298GAME( 198?, cm2841a,  cmv4,     cm,       cmv801,   0,        ROT0, "Dyna",              "Cherry Master (II?) (ver.8.41, set 2)",  GAME_NOT_WORKING )
3299
3300GAME( 1991, cmast91,  0,        cmast91,  cmv801,   cmast91,  ROT0, "Dyna",              "Cherry Master '91 (ver.1.30)",           GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_NOT_WORKING )
3301
3302GAME( 1989, lucky8,   0,        lucky8,   lucky8,   0,        ROT0, "Wing Co.Ltd / GEI", "New Lucky 8 Lines (set 1)",              GAME_IMPERFECT_COLORS )
3303GAME( 1989, lucky8a,  lucky8,   lucky8,   lucky8a,  lucky8a,  ROT0, "Wing Co.Ltd / GEI", "New Lucky 8 Lines (set 2)",              GAME_IMPERFECT_COLORS )
src/mame/drivers/ms32.c
r4057r4058
12801280   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
12811281   ROM_LOAD( "bbbx22.bin",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
12821282   ROM_LOAD( "bbbx23.bin",  0x200000, 0x200000, CRC(b7875a23) SHA1(62bb4c1318f98ea68894658d92ce08e84d386d0c) )
1283
1284    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1285    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
12831286ROM_END
12841287
12851288ROM_START( 47pie2 )
r4057r4058
13151318   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
13161319   ROM_LOAD( "94019-10.22", 0x000000, 0x200000, CRC(745d41ec) SHA1(9118d0f27b65c9d37970326ccf86fdccb81d32f5) )
13171320   ROM_LOAD( "94019-11.23", 0x200000, 0x200000, CRC(021dc350) SHA1(c71936091f86440201fdbdc94b0d1d22c4018188) )
1321
1322    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1323    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
13181324ROM_END
13191325
13201326ROM_START( 47pie2o )
r4057r4058
13501356   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
13511357   ROM_LOAD( "94019-10.22", 0x000000, 0x200000, CRC(745d41ec) SHA1(9118d0f27b65c9d37970326ccf86fdccb81d32f5) )
13521358   ROM_LOAD( "94019-11.23", 0x200000, 0x200000, CRC(021dc350) SHA1(c71936091f86440201fdbdc94b0d1d22c4018188) )
1359
1360    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1361    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
13531362ROM_END
13541363
13551364ROM_START( desertwr )
r4057r4058
13871396   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
13881397   ROM_LOAD( "92042-01.33", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
13891398   ROM_LOAD( "94038-13.34", 0x200000, 0x200000, CRC(b0cac8f2) SHA1(f7d2e32d9c2f301341f7c02678c2c1e09ce655ba) )
1399
1400    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1401    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
13901402ROM_END
13911403
13921404ROM_START( f1superb )
r4057r4058
14391451   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
14401452   ROM_LOAD( "f1sb24.bin", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
14411453   ROM_LOAD( "f1sb23.bin", 0x200000, 0x200000, CRC(bfefa3ab) SHA1(7770cc9b091e258ede7f2780df61a592cc008dd7) )
1454
1455    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1456    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
14421457ROM_END
14431458
14441459ROM_START( gratia )
r4057r4058
14731488   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
14741489   ROM_LOAD( "92042.01", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common rom?
14751490   ROM_LOAD( "94019.10", 0x200000, 0x200000, CRC(a751e316) SHA1(3d658370c71b83582fd132b3da441089df9bfd05) )
1491
1492    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1493    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
14761494ROM_END
14771495
14781496ROM_START( gratiaa )
r4057r4058
15071525   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
15081526   ROM_LOAD( "92042.01", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common rom?
15091527   ROM_LOAD( "94019.10", 0x200000, 0x200000, CRC(a751e316) SHA1(3d658370c71b83582fd132b3da441089df9bfd05) )
1528
1529    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1530    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
15101531ROM_END
15111532
15121533ROM_START( gametngk )
r4057r4058
15441565   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
15451566   ROM_LOAD( "mr94041.13", 0x000000, 0x200000, CRC(fba84caf) SHA1(318270dbf825a8e0f315992c49a2dc34dd1df7c1) )
15461567   ROM_LOAD( "mr94041.14", 0x200000, 0x200000, CRC(2d6308bd) SHA1(600b6ccdbb976301075e0b287124a9fd5fe7fc1b) )
1568
1569    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1570    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
15471571ROM_END
15481572
15491573ROM_START( hayaosi2 )
r4057r4058
15771601   ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
15781602   ROM_LOAD( "mr92042.01",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
15791603   ROM_LOAD( "mr93038.01",  0x200000, 0x200000, CRC(b8a38bfc) SHA1(1aa7b69beebceb6f09a1ee006de054cb84002e94) )
1604
1605    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1606    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
15801607ROM_END
15811608
15821609/*
r4057r4058
16791706   ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
16801707   ROM_LOAD( "mr92042.01",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
16811708   ROM_LOAD( "mr94027.10",  0x200000, 0x200000, CRC(e7cabe41) SHA1(5d903baed690a98856f7581319cf4dbfe1db47bb) )
1709
1710    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1711    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
16821712ROM_END
16831713
16841714ROM_START( kirarast )
r4057r4058
17151745   ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
17161746   ROM_LOAD( "mr95025.12",  0x000000, 0x200000, CRC(1dd4f766) SHA1(455befd3a216f2197cd2e7e4899d4f1af7d20bf7) )
17171747   ROM_LOAD( "mr95025.13",  0x200000, 0x200000, CRC(0adfe5b8) SHA1(02309e5789b58896e5f68603502c76d4a917bd91) )
1748
1749    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1750    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
17181751ROM_END
17191752
17201753ROM_START( akiss )
r4057r4058
17501783   ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
17511784   ROM_LOAD( "95008-11.22",  0x000000, 0x200000, CRC(23b9af76) SHA1(98b4087c142500dc759bda94d71c77634452a7ad))
17521785   ROM_LOAD( "95008-12.23",  0x200000, 0x200000, CRC(780a2f45) SHA1(770cbf04e34ae7d72e6eb2304bcdfaff483cd8c1))
1786
1787    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1788    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
17531789ROM_END
17541790
17551791ROM_START( p47aces )
r4057r4058
17871823   ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
17881824   ROM_LOAD( "p47-22.bin",  0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) )
17891825   ROM_LOAD( "p47-23.bin",  0x200000, 0x200000, CRC(547fa4d4) SHA1(8a5ecb3300646762f63d37a27e643e1f6ce5e775) )
1826
1827    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1828    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
17901829ROM_END
17911830
17921831ROM_START( tetrisp )
r4057r4058
18161855   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
18171856   ROM_LOAD( "mr95024.22", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) ) // common samples
18181857   ROM_LOAD( "mr95024.23", 0x200000, 0x200000, CRC(57502a17) SHA1(ce880188854dc17d9ebbfa3c373469cf5e6858c2) )
1858
1859    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1860    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
18191861ROM_END
18201862
18211863ROM_START( tp2m32 )
r4057r4058
18441886
18451887   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
18461888   ROM_LOAD( "tp2m3205.22", 0x000000, 0x200000, CRC(74aa5c31) SHA1(7e3f86198fb678244fab76bee9c72bbdfc818118) )
1889
1890    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1891    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
18471892ROM_END
18481893
18491894
r4057r4058
18801925
18811926   ROM_REGION( 0x400000, "ymf", 0 ) /* samples - 8-bit signed PCM */
18821927   ROM_LOAD( "mr96004-10.22",  0x000000, 0x400000, CRC(83f4303a) SHA1(90ee010591afe1d35744925ef0e8d9a7e2ef3378) )
1928
1929    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
1930    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
18831931ROM_END
18841932
18851933/*
r4057r4058
19511999   ROM_REGION( 0x400000, "ymf", 0 ) /* samples */
19522000   ROM_LOAD( "mr92042-01.22", 0x000000, 0x200000, CRC(0fa26f65) SHA1(e92b14862fbce33ea4ab4567ec48199bfcbbdd84) )
19532001   ROM_LOAD( "mr95033-08.23", 0x200000, 0x200000, CRC(89a291fa) SHA1(7746a0490134fc902ce2dc7b0d33b455d792c105) )
2002
2003    ROM_REGION( 0x000001, "motherbrd_pals", 0) /* Motherboard PAL */
2004    ROM_LOAD( "91022-01.ic83", 0x00000, 0x00001, NO_DUMP ) /* AMI 18CV8-15. */
19542005ROM_END
19552006
19562007
src/mame/drivers/wwfsstar.c
r4057r4058
268268   /* An interrupt is generated every 16 scanlines */
269269   if (scanline % 16 == 0)
270270   {
271      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
271      if (scanline > 0)
272         video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
272273      cpu_set_input_line(timer->machine->cpu[0], 5, ASSERT_LINE);
273274   }
274275
r4057r4058
278279      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
279280      cpu_set_input_line(timer->machine->cpu[0], 6, ASSERT_LINE);
280281   }
281
282   /* Adjust for next scanline */
283   if (++scanline >= video_screen_get_height(timer->machine->primary_screen))
284   {
285      scanline = 0;
286   }
287282}
288283
289284static CUSTOM_INPUT( wwfsstar_vblank_r )
src/mame/drivers/model1.c
r4057r4058
12161216
12171217ROM_START( vf )
12181218
1219   ROM_REGION( 0x1400000, "main", 0 ) /* v60 code */
1219   ROM_REGION( 0x2000000, "main", ROMREGION_ERASEFF ) /* v60 code */
12201220   ROM_LOAD16_BYTE( "epr-16082.14", 0x200000, 0x80000, CRC(b23f22ee) SHA1(9fd5b5a5974703a60a54de3d2bce4301bfc0e533) )
12211221   ROM_LOAD16_BYTE( "epr-16083.15", 0x200001, 0x80000, CRC(d12c77f8) SHA1(b4aeba8d5f1ab4aec024391407a2cb58ce2e94b0) )
12221222
r4057r4058
12591259ROM_START( vr )
12601260   MODEL1_CPU_BOARD
12611261
1262   ROM_REGION( 0x1400000, "main", 0 ) /* v60 code */
1262   ROM_REGION( 0x2000000, "main", ROMREGION_ERASEFF ) /* v60 code */
12631263   ROM_LOAD16_BYTE( "epr-14882.14", 0x200000, 0x80000, CRC(547D75AD) SHA1(a57c11966886c37de1d7df131ad60457669231dd) )
12641264   ROM_LOAD16_BYTE( "epr-14883.15", 0x200001, 0x80000, CRC(6BFAD8B1) SHA1(c1f780e456b405abd42d92f4e03e40aad88f8c22) )
12651265
r4057r4058
13091309ROM_START( vformula )
13101310   MODEL1_CPU_BOARD
13111311
1312   ROM_REGION( 0x1400000, "main", 0 ) /* v60 code */
1312   ROM_REGION( 0x2000000, "main", ROMREGION_ERASEFF ) /* v60 code */
13131313   ROM_LOAD16_BYTE( "epr15638.14", 0x200000, 0x80000, CRC(b9db21a2) SHA1(db58c047977f5fc37f278afe7159a78e3fa6c015) )
13141314   ROM_LOAD16_BYTE( "epr15639.15", 0x200001, 0x80000, CRC(4c3796f5) SHA1(1bf312a4999a15fbc5d194627f9c0ad9dbc1f2c0) )
13151315
r4057r4058
13611361
13621362
13631363ROM_START( swa )
1364   ROM_REGION( 0x1000000, "main", 0 ) /* v60 code */
1364   ROM_REGION( 0x2000000, "main", ROMREGION_ERASEFF ) /* v60 code */
13651365   ROM_LOAD16_BYTE( "epr-16468.14", 0x200000, 0x80000, CRC(681d03c0) SHA1(4d21e26ce211466d429b84bca69a8147ff31ec6c) )
13661366   ROM_LOAD16_BYTE( "epr-16469.15", 0x200001, 0x80000, CRC(6f281f7c) SHA1(6a9179e48d14838bb2a1a3f63fdd3a68ed009e03) )
13671367
r4057r4058
14071407ROM_END
14081408
14091409ROM_START( wingwar )
1410   ROM_REGION( 0x1300000, "main", 0 ) /* v60 code */
1410   ROM_REGION( 0x2000000, "main", ROMREGION_ERASEFF ) /* v60 code */
14111411   ROM_LOAD16_BYTE( "epr-16729.14", 0x200000, 0x80000, CRC(7edec2cc) SHA1(3e423a868ca7c8475fbb5bc1a10526e69d94d865) )
14121412   ROM_LOAD16_BYTE( "epr-16730.15", 0x200001, 0x80000, CRC(bab24dee) SHA1(26c95139c1aa7f34b6a5cce39e5bd1dd2ef0dd49) )
14131413
r4057r4058
14541454ROM_END
14551455
14561456ROM_START( wingwara )
1457   ROM_REGION( 0x1300000, "main", 0 ) /* v60 code */
1457   ROM_REGION( 0x2000000, "main", ROMREGION_ERASEFF ) /* v60 code */
14581458   ROM_LOAD16_BYTE( "epr-16729.14", 0x200000, 0x80000, CRC(7edec2cc) SHA1(3e423a868ca7c8475fbb5bc1a10526e69d94d865) )
14591459   ROM_LOAD16_BYTE( "epr-16730.15", 0x200001, 0x80000, CRC(bab24dee) SHA1(26c95139c1aa7f34b6a5cce39e5bd1dd2ef0dd49) )
14601460
src/mame/drivers/polepos.c
r4057r4058
223223#include "polepos.h"
224224#include "nam_cust.h"
225225
226#include "polepos.lh"
227
226228#define POLEPOS_TOGGLE   PORT_TOGGLE
227229
228230
r4057r4058
874876
875877   MDRV_GFXDECODE(polepos)
876878   MDRV_PALETTE_LENGTH(0x0f00)
879   MDRV_DEFAULT_LAYOUT(layout_polepos)
877880
878881   MDRV_PALETTE_INIT(polepos)
879882   MDRV_VIDEO_START(polepos)
r4057r4058
17721775GAME( 1983, polepos2, 0,      polepos, polepos2, polepos2, ROT0, "Namco", "Pole Position II", 0 )
17731776GAME( 1983, poleps2a, polepos2, polepos, polepos2, polepos2, ROT0, "Namco (Atari license)", "Pole Position II (Atari)", 0 )
17741777GAME( 1983, poleps2b, polepos2, polepos, polepos2, polepos,    ROT0, "bootleg", "Pole Position II (bootleg)", 0 )
1775
src/mame/drivers/suna8.c
r4057r4058
4545#include "sound/samples.h"
4646#include "includes/suna8.h"
4747
48#define SUNA8_MASTER_CLOCK      XTAL_24MHz
49
4850/***************************************************************************
4951
5052
r4057r4058
14831485static MACHINE_DRIVER_START( hardhead )
14841486
14851487   /* basic machine hardware */
1486   MDRV_CPU_ADD("main", Z80, 24000000 / 4)         /* ? */
1488   MDRV_CPU_ADD("main", Z80, SUNA8_MASTER_CLOCK / 4)         /* ? */
14871489   MDRV_CPU_PROGRAM_MAP(hardhead_readmem,hardhead_writemem)
14881490   MDRV_CPU_IO_MAP(hardhead_io_map,0)
14891491   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* No NMI */
14901492
1491   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)               /* ? */
1493   MDRV_CPU_ADD("audio", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
14921494   MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem)
14931495   MDRV_CPU_IO_MAP(hardhead_sound_io_map,0)
14941496   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* No NMI */
r4057r4058
15101512   /* sound hardware */
15111513   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
15121514
1513   MDRV_SOUND_ADD("ym", YM3812, 4000000)
1515   MDRV_SOUND_ADD("ym", YM3812, SUNA8_MASTER_CLOCK / 8)
15141516   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
15151517   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
15161518
1517   MDRV_SOUND_ADD("ay", AY8910, 24000000 / 16)
1519   MDRV_SOUND_ADD("ay", AY8910, SUNA8_MASTER_CLOCK / 16)
15181520   MDRV_SOUND_CONFIG(hardhead_ay8910_interface)
15191521   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.30)
15201522   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.30)
r4057r4058
15371539static MACHINE_DRIVER_START( rranger )
15381540
15391541   /* basic machine hardware */
1540   MDRV_CPU_ADD("main", Z80, 24000000 / 4)               /* ? */
1542   MDRV_CPU_ADD("main", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
15411543   MDRV_CPU_PROGRAM_MAP(rranger_readmem,rranger_writemem)
15421544   MDRV_CPU_IO_MAP(rranger_io_map,0)
15431545   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   /* IRQ & NMI ! */
15441546
1545   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)               /* ? */
1547   MDRV_CPU_ADD("audio", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
15461548   MDRV_CPU_PROGRAM_MAP(rranger_sound_readmem,rranger_sound_writemem)
15471549   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* NMI = retn */
15481550
r4057r4058
15631565   /* sound hardware */
15641566   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
15651567
1566   MDRV_SOUND_ADD("ym1", YM2203, 4000000)
1568   MDRV_SOUND_ADD("ym1", YM2203, SUNA8_MASTER_CLOCK / 6)
15671569   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
15681570   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
15691571
1570   MDRV_SOUND_ADD("ym2", YM2203, 4000000)
1572   MDRV_SOUND_ADD("ym2", YM2203, SUNA8_MASTER_CLOCK / 6)
15711573   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
15721574   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
15731575MACHINE_DRIVER_END
r4057r4058
15931595static MACHINE_DRIVER_START( brickzn )
15941596
15951597   /* basic machine hardware */
1596   MDRV_CPU_ADD("main", Z80, 24000000 / 4)      /* SUNA PROTECTION BLOCK */
1598   MDRV_CPU_ADD("main", Z80, SUNA8_MASTER_CLOCK / 4)      /* SUNA PROTECTION BLOCK */
15971599   MDRV_CPU_PROGRAM_MAP(brickzn_readmem,brickzn_writemem)
15981600//  MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt, 2)
15991601   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)   // nmi breaks ramtest but is needed!
16001602
1601   MDRV_CPU_ADD("sound", Z80, 24000000 / 4)   /* Z0840006PSC */
1603   MDRV_CPU_ADD("sound", Z80, SUNA8_MASTER_CLOCK / 4)   /* Z0840006PSC */
16021604   MDRV_CPU_PROGRAM_MAP(brickzn_sound_readmem,brickzn_sound_writemem)
16031605
1604   MDRV_CPU_ADD("pcm", Z80, 24000000 / 4)   /* Z0840006PSC */
1606   MDRV_CPU_ADD("pcm", Z80, SUNA8_MASTER_CLOCK / 4)   /* Z0840006PSC */
16051607   MDRV_CPU_PROGRAM_MAP(brickzn_pcm_readmem,brickzn_pcm_writemem)
16061608   MDRV_CPU_IO_MAP(brickzn_pcm_io_map,0)
16071609
r4057r4058
16221624   /* sound hardware */
16231625   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
16241626
1625   MDRV_SOUND_ADD("ym", YM3812, 4000000)
1627   MDRV_SOUND_ADD("ym", YM3812, SUNA8_MASTER_CLOCK / 6)
16261628   MDRV_SOUND_CONFIG(brickzn_ym3812_interface)
16271629   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
16281630   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
16291631
1630   MDRV_SOUND_ADD("ay", AY8910, 24000000 / 16)
1632   MDRV_SOUND_ADD("ay", AY8910, SUNA8_MASTER_CLOCK / 16)
16311633   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.33)
16321634   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.33)
16331635
r4057r4058
16951697static MACHINE_DRIVER_START( starfigh )
16961698
16971699   /* basic machine hardware */
1698   MDRV_CPU_ADD("main", Z80, 24000000 / 4)               /* ? */
1700   MDRV_CPU_ADD("main", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
16991701   MDRV_CPU_PROGRAM_MAP(starfigh_readmem,starfigh_writemem)
17001702   MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt,2)   /* IRQ & NMI */
17011703
17021704   /* The sound section is identical to that of hardhead */
1703   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)               /* ? */
1705   MDRV_CPU_ADD("audio", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
17041706   MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem)
17051707   MDRV_CPU_IO_MAP(hardhead_sound_io_map,0)
17061708   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* No NMI */
r4057r4058
17221724   /* sound hardware */
17231725   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
17241726
1725   MDRV_SOUND_ADD("ym", YM3812, 4000000)
1727   MDRV_SOUND_ADD("ym", YM3812, SUNA8_MASTER_CLOCK / 6)
17261728   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
17271729   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
17281730
1729   MDRV_SOUND_ADD("ay", AY8910, 24000000 / 16)
1731   MDRV_SOUND_ADD("ay", AY8910, SUNA8_MASTER_CLOCK / 16)
17301732   MDRV_SOUND_CONFIG(starfigh_ay8910_interface)
17311733   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
17321734   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
r4057r4058
17541756static MACHINE_DRIVER_START( sparkman )
17551757
17561758   /* basic machine hardware */
1757   MDRV_CPU_ADD("main", Z80, 24000000 / 4)               /* ? */
1759   MDRV_CPU_ADD("main", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
17581760   MDRV_CPU_PROGRAM_MAP(sparkman_readmem,sparkman_writemem)
17591761   MDRV_CPU_VBLANK_INT_HACK(sparkman_interrupt,2)   /* IRQ & NMI */
17601762
1761   MDRV_CPU_ADD("audio", Z80, 24000000 / 4)            /* ? */
1763   MDRV_CPU_ADD("audio", Z80, SUNA8_MASTER_CLOCK / 4)            /* ? */
17621764   MDRV_CPU_PROGRAM_MAP(hardhead_sound_readmem,hardhead_sound_writemem)
17631765   MDRV_CPU_IO_MAP(hardhead_sound_io_map,0)
17641766   MDRV_CPU_VBLANK_INT_HACK(irq0_line_hold,4)   /* No NMI */
r4057r4058
17801782   /* sound hardware */
17811783   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
17821784
1783   MDRV_SOUND_ADD("ym", YM3812, 4000000)
1785   MDRV_SOUND_ADD("ym", YM3812, SUNA8_MASTER_CLOCK / 6)
17841786   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
17851787   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
17861788
1787   MDRV_SOUND_ADD("ay", AY8910, 24000000 / 16)
1789   MDRV_SOUND_ADD("ay", AY8910, SUNA8_MASTER_CLOCK / 16)
17881790   MDRV_SOUND_CONFIG(hardhead_ay8910_interface)
17891791   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.30)
17901792   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.30)
src/mame/drivers/btime.c
r4057r4058
6262***************************************************************************/
6363
6464#include "driver.h"
65#include "deprecat.h"
6665#include "cpu/m6502/m6502.h"
6766#include "sound/ay8910.h"
6867#include "includes/btime.h"
6968
70#define MASTER_CLOCK (XTAL_12MHz)
69#define MASTER_CLOCK    XTAL_12MHz
70#define HCLK         (MASTER_CLOCK/2)
71#define HCLK1         (HCLK/2)
72#define HCLK2         (HCLK1/2)
73#define HCLK4         (HCLK2/2)
7174
75
76enum
77{
78   AUDIO_ENABLE_NONE,
79   AUDIO_ENABLE_DIRECT,      /* via direct address in memory map */
80   AUDIO_ENABLE_AY8910         /* via ay-8910 port A */
81};
82
7283static WRITE8_HANDLER( audio_command_w );
84static READ8_HANDLER( audio_command_r );
7385
7486static UINT8 *decrypted;
7587static UINT8 *rambase;
7688static UINT8 *audio_rambase;
7789
90static UINT8 audio_nmi_enable_type;
91static UINT8 audio_nmi_enabled;
92static UINT8 audio_nmi_state;
7893
7994
95
96static MACHINE_START( btime )
97{
98   /* by default, the audio NMI is disabled, except for bootlegs which don't use the enable */
99   audio_nmi_enabled = (audio_nmi_enable_type == AUDIO_ENABLE_NONE);
100}
101
102static WRITE8_HANDLER( audio_nmi_enable_w )
103{
104   /* for most games, this serves as the NMI enable for the audio CPU; however,
105       lnc and disco use bit 0 of the first AY-8910's port A instead; many other
106       games also write there in addition to this address */
107   if (audio_nmi_enable_type == AUDIO_ENABLE_DIRECT)
108   {
109      audio_nmi_enabled = data & 1;
110      cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
111   }
112}
113
114static WRITE8_HANDLER( ay_audio_nmi_enable_w )
115{
116   /* port A bit 0, when 1, inhibits the NMI */
117   if (audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
118   {
119      audio_nmi_enabled = ~data & 1;
120      cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
121   }
122}
123
124static TIMER_DEVICE_CALLBACK( audio_nmi_gen )
125{
126   int scanline = param;
127   audio_nmi_state = scanline & 8;
128   cpu_set_input_line(timer->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
129}
130
131
132
133
134
80135INLINE UINT8 swap_bits_5_6(UINT8 data)
81136{
82137   return BITSWAP8(data,7,5,6,4,3,2,1,0);
r4057r4058
119174   else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space,offset - 0x3c00,data); return; }
120175   else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space,offset - 0x7c00,data); return; }
121176   else if (offset == 0x8000)                     { return; }  /* SMH_NOP */
122   else if (offset == 0x8001)                     { lnc_video_control_w(space,0,data); return; }
177   else if (offset == 0x8001)                     { bnj_video_control_w(space,0,data); return; }
123178   else if (offset == 0x8003)                       ;
124179   else if (offset == 0x9000)                     { return; }  /* SMH_NOP */
125180   else if (offset == 0x9002)                     { audio_command_w(space,0,data); return; }
r4057r4058
137192   if      (offset <= 0x3bff)                       ;
138193   else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space,offset - 0x3c00,data); return; }
139194   else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space,offset - 0x7c00,data); return; }
140   else if (offset == 0x8001)                     { lnc_video_control_w(space,0,data); return; }
195   else if (offset == 0x8001)                     { bnj_video_control_w(space,0,data); return; }
141196   else if (offset == 0x8003)                       ;
142197   else if (offset == 0x9000)                     { return; }  /* SMH_NOP */
143198   else if (offset == 0x9002)                     { audio_command_w(space,0,data); return; }
r4057r4058
303358   AM_RANGE(0x7800, 0x7bff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram)  /* this is just here to initialize the pointer */
304359   AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w)
305360   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW1") AM_WRITENOP     /* ??? */
306   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW2") AM_WRITE(lnc_video_control_w)
361   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW2") AM_WRITE(bnj_video_control_w)
307362   AM_RANGE(0x8003, 0x8003) AM_WRITE(SMH_RAM) AM_BASE(&lnc_charbank)
308363   AM_RANGE(0x9000, 0x9000) AM_READ_PORT("P1") AM_WRITENOP     /* IRQ ack??? */
309364   AM_RANGE(0x9001, 0x9001) AM_READ_PORT("P2")
r4057r4058
320375   AM_RANGE(0x7800, 0x7bff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram)      /* this is just here to initialize the pointer */
321376   AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w)
322377   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW1")
323   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW2") AM_WRITE(lnc_video_control_w)
378   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW2") AM_WRITE(bnj_video_control_w)
324379   AM_RANGE(0x8003, 0x8003) AM_WRITE(SMH_RAM) AM_BASE(&lnc_charbank)
325380   AM_RANGE(0x9000, 0x9000) AM_READ_PORT("P1") AM_WRITENOP   /* IRQ ack??? */
326381   AM_RANGE(0x9001, 0x9001) AM_READ_PORT("P2")
r4057r4058
365420ADDRESS_MAP_END
366421
367422
423
368424static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 )
369   AM_RANGE(0x0000, 0x03ff) AM_RAM AM_BASE(&audio_rambase)
370   AM_RANGE(0x0400, 0x0fff) AM_ROM AM_REGION("audio", 0xf400)
371   AM_RANGE(0x2000, 0x2fff) AM_WRITE(ay8910_write_port_0_w)
372   AM_RANGE(0x4000, 0x4fff) AM_WRITE(ay8910_control_port_0_w)
373   AM_RANGE(0x6000, 0x6fff) AM_WRITE(ay8910_write_port_1_w)
374   AM_RANGE(0x8000, 0x8fff) AM_WRITE(ay8910_control_port_1_w)
375   AM_RANGE(0xa000, 0xafff) AM_READ(soundlatch_r)
376   AM_RANGE(0xc000, 0xcfff) AM_WRITE(interrupt_enable_w)
377   AM_RANGE(0xf000, 0xffff) AM_ROM
425   AM_RANGE(0x0000, 0x03ff) AM_MIRROR(0x1c00) AM_RAM AM_BASE(&audio_rambase)
426   AM_RANGE(0x2000, 0x3fff) AM_WRITE(ay8910_write_port_0_w)
427   AM_RANGE(0x4000, 0x5fff) AM_WRITE(ay8910_control_port_0_w)
428   AM_RANGE(0x6000, 0x7fff) AM_WRITE(ay8910_write_port_1_w)
429   AM_RANGE(0x8000, 0x9fff) AM_WRITE(ay8910_control_port_1_w)
430   AM_RANGE(0xa000, 0xbfff) AM_READ(audio_command_r)
431   AM_RANGE(0xc000, 0xdfff) AM_WRITE(audio_nmi_enable_w)
432   AM_RANGE(0xe000, 0xefff) AM_MIRROR(0x1000) AM_ROM
378433ADDRESS_MAP_END
379434
380435static ADDRESS_MAP_START( disco_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
r4057r4058
409464static WRITE8_HANDLER( audio_command_w )
410465{
411466   soundlatch_w(space,offset,data);
412   cpu_set_input_line(space->machine->cpu[1], 0, HOLD_LINE);
467   cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE);
413468}
414469
470static READ8_HANDLER( audio_command_r )
471{
472   cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE);
473   return soundlatch_r(space,offset);
474}
415475
476
416477static INPUT_PORTS_START( btime )
417478   PORT_START("P1")
418479   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
r4057r4058
10851146
10861147static const gfx_layout tile8layout =
10871148{
1088   8,8,    /* 8*8 characters */
1149   8,8,
10891150   RGN_FRAC(1,3),
10901151   3,
1091   {  RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
1092   { 0, 1, 2, 3, 4, 5, 6, 7 },
1093   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1152   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
1153   { STEP8(0,1) },
1154   { STEP8(0,8) },
10941155   8*8
10951156};
10961157
r4057r4058
10981159
10991160static const gfx_layout tile16layout =
11001161{
1101   16,16,  /* 16*16 sprites */
1102   RGN_FRAC(1,3),    /* 64 characters */
1103   3,      /* 3 bits per pixel */
1104   {  RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },    /* the bitplanes are separated */
1105   { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,
1106     0, 1, 2, 3, 4, 5, 6, 7 },
1107   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
1108     8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
1109   32*8    /* every sprite takes 32 consecutive bytes */
1162   16,16,
1163   RGN_FRAC(1,3),
1164   3,
1165   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3) },
1166   { STEP8(16*8,1), STEP8(0,1) },
1167   { STEP16(0,8) },
1168   32*8
11101169};
11111170
11121171
r4057r4058
11171176   RGN_FRAC(1,2),
11181177   3,
11191178   { RGN_FRAC(1,2)+4, RGN_FRAC(0,2)+0, RGN_FRAC(0,2)+4 },
1120   { 3*16*8+0, 3*16*8+1, 3*16*8+2, 3*16*8+3, 2*16*8+0, 2*16*8+1, 2*16*8+2, 2*16*8+3,
1121     16*8+0, 16*8+1, 16*8+2, 16*8+3, 0, 1, 2, 3 },
1122   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
1123     8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
1179   { STEP4(3*16*8,1), STEP4(2*16*8,1), STEP4(1*16*8,1), STEP4(0*16*8,1) },
1180   { STEP16(0,8) },
11241181   64*8
11251182};
11261183
r4057r4058
11601217
11611218
11621219
1220static const ay8910_interface ay1_intf =
1221{
1222   AY8910_LEGACY_OUTPUT,
1223   AY8910_DEFAULT_LOADS,
1224   NULL, NULL, ay_audio_nmi_enable_w, NULL
1225};
1226
11631227static MACHINE_DRIVER_START( btime )
11641228
11651229   /* basic machine hardware */
1166   MDRV_CPU_ADD("main", M6502, 1500000)
1230   MDRV_CPU_ADD("main", M6502, HCLK2)   /* seletable between H2/H4 via jumper */
11671231   MDRV_CPU_PROGRAM_MAP(btime_map,0)
11681232
1169   MDRV_CPU_ADD("audio", M6502, 500000)
1233   MDRV_CPU_ADD("audio", M6502, HCLK1/3/2)
11701234   MDRV_CPU_PROGRAM_MAP(audio_map,0)
1171   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16)
1235   MDRV_TIMER_ADD_SCANLINE("audionmi", audio_nmi_gen, "main", 0, 8)
11721236
11731237   /* video hardware */
11741238   MDRV_SCREEN_ADD("main", RASTER)
1175   MDRV_SCREEN_REFRESH_RATE(57)
1176   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3072))
11771239   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1178   MDRV_SCREEN_SIZE(32*8, 32*8)
1179   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 31*8-1)
1240   MDRV_SCREEN_RAW_PARAMS(HCLK, 384, 8, 248, 272, 8, 248)
11801241
1242   MDRV_MACHINE_START(btime)
1243
11811244   MDRV_GFXDECODE(btime)
11821245   MDRV_PALETTE_LENGTH(16)
11831246
r4057r4058
11881251   /* audio hardware */
11891252   MDRV_SPEAKER_STANDARD_MONO("mono")
11901253
1191   MDRV_SOUND_ADD("ay1", AY8910, 1500000)
1254   MDRV_SOUND_ADD("ay1", AY8910, HCLK2)
11921255   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
1256   MDRV_SOUND_CONFIG(ay1_intf)
11931257
1194   MDRV_SOUND_ADD("ay2", AY8910, 1500000)
1258   MDRV_SOUND_ADD("ay2", AY8910, HCLK2)
11951259   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.23)
11961260MACHINE_DRIVER_END
11971261
r4057r4058
12211285   MDRV_CPU_MODIFY("main")
12221286   MDRV_CPU_PROGRAM_MAP(lnc_map,0)
12231287
1224   MDRV_CPU_MODIFY("audio")
1225   MDRV_CPU_VBLANK_INT_HACK(lnc_sound_interrupt,16)
1226
12271288   MDRV_MACHINE_RESET(lnc)
12281289
12291290   /* video hardware */
r4057r4058
12391300
12401301   /* basic machine hardware */
12411302   MDRV_IMPORT_FROM(lnc)
1242   MDRV_CPU_MODIFY("audio")
1243   MDRV_CPU_VBLANK_INT_HACK(nmi_line_pulse,16)
12441303
12451304   /* video hardware */
12461305   MDRV_VIDEO_UPDATE(eggs)
r4057r4058
12601319
12611320   /* basic machine hardware */
12621321   MDRV_IMPORT_FROM(btime)
1263   MDRV_CPU_REPLACE("main", M6502, 750000)
1322   MDRV_CPU_REPLACE("main", M6502, HCLK4)
12641323   MDRV_CPU_PROGRAM_MAP(bnj_map,0)
12651324
12661325   /* video hardware */
r4057r4058
12911350
12921351   /* basic machine hardware */
12931352   MDRV_IMPORT_FROM(btime)
1294   MDRV_CPU_REPLACE("main", M6502, 750000)
1353   MDRV_CPU_REPLACE("main", M6502, HCLK4)
12951354   MDRV_CPU_PROGRAM_MAP(disco_map,0)
12961355
12971356   MDRV_CPU_MODIFY("audio")
r4057r4058
13311390   ROM_LOAD( "aa07.15b",     0xf000, 0x1000, CRC(086440ad) SHA1(4a32bc92f8ff5fbe112f56e62d2c03da8851a7b9) )
13321391
13331392   ROM_REGION( 0x10000, "audio", 0 )
1334   ROM_LOAD( "ab14.12h",     0xf000, 0x1000, CRC(f55e5211) SHA1(27940026d0c6212d1138d2fd88880df697218627) )
1393   ROM_LOAD( "ab14.12h",     0xe000, 0x1000, CRC(f55e5211) SHA1(27940026d0c6212d1138d2fd88880df697218627) )
13351394
13361395   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
13371396   ROM_LOAD( "aa12.7k",      0x0000, 0x1000, CRC(c4617243) SHA1(24204d591aa2c264a852ee9ba8c4be63efd97728) )    /* charset #1 */
r4057r4058
13591418   ROM_LOAD( "aa07.15b",     0xf000, 0x1000, CRC(086440ad) SHA1(4a32bc92f8ff5fbe112f56e62d2c03da8851a7b9) )
13601419
13611420   ROM_REGION( 0x10000, "audio", 0 )
1362   ROM_LOAD( "ab14.12h",     0xf000, 0x1000, CRC(f55e5211) SHA1(27940026d0c6212d1138d2fd88880df697218627) )
1421   ROM_LOAD( "ab14.12h",     0xe000, 0x1000, CRC(f55e5211) SHA1(27940026d0c6212d1138d2fd88880df697218627) )
13631422
13641423   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
13651424   ROM_LOAD( "aa12.7k",      0x0000, 0x1000, CRC(c4617243) SHA1(24204d591aa2c264a852ee9ba8c4be63efd97728) )    /* charset #1 */
r4057r4058
13871446   ROM_LOAD( "ab07.15b",     0xf000, 0x1000, CRC(a142f862) SHA1(39d7ef172d18874885f1b1542e885cc4287dc344) )
13881447
13891448   ROM_REGION( 0x10000, "audio", 0 )
1390   ROM_LOAD( "ab14.12h",     0xf000, 0x1000, CRC(f55e5211) SHA1(27940026d0c6212d1138d2fd88880df697218627) )
1449   ROM_LOAD( "ab14.12h",     0xe000, 0x1000, CRC(f55e5211) SHA1(27940026d0c6212d1138d2fd88880df697218627) )
13911450
13921451   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
13931452   ROM_LOAD( "ab12.7k",      0x0000, 0x1000, CRC(6c79f79f) SHA1(338009199b5889621693833d88c35abb8e9e38a2) )    /* charset #1 */
r4057r4058
14141473   ROM_LOAD( "2k",           0xffe0, 0x0020, CRC(e2553b3d) SHA1(0a38929cdb3f37c6e4bacc5c3f94c049b4352858) )   /* reset/interrupt vectors */
14151474
14161475   ROM_REGION( 0x10000, "audio", 0 )
1417   ROM_LOAD( "6f.6",         0xf000, 0x1000, CRC(6b8e0272) SHA1(372a891b7b357aea0297ba9bcae752c3c9d8c1be) ) /* starts at 0000, not f000; 0000-01ff is RAM */
1476   ROM_LOAD( "6f.6",         0xe000, 0x1000, CRC(6b8e0272) SHA1(372a891b7b357aea0297ba9bcae752c3c9d8c1be) ) /* starts at 0000, not f000; 0000-01ff is RAM */
14181477
14191478   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
14201479   ROM_LOAD( "m8.7",         0x0000, 0x2000, CRC(a1a0d5a6) SHA1(e9583320e9c303407abfe02988b95403e5209c52) )  /* charset #1 */
r4057r4058
14471506   ROM_LOAD( "t-09.b14",     0xf000, 0x1000, CRC(5b26771a) SHA1(31d86acba4b6549fc08a3947d6d6d1a470fcb9da) )
14481507
14491508   ROM_REGION( 0x10000, "audio", 0 )
1450   ROM_LOAD( "t-0a.j11",     0xf000, 0x1000, CRC(807e1652) SHA1(ccfee616dc0e34d10a0e62b9864fd987291bf176) )
1509   ROM_LOAD( "t-0a.j11",     0xe000, 0x1000, CRC(807e1652) SHA1(ccfee616dc0e34d10a0e62b9864fd987291bf176) )
14511510
14521511   ROM_REGION( 0x3000, "gfx1", ROMREGION_DISPOSE )
14531512   ROM_LOAD( "t-13.k14",     0x0000, 0x1000, CRC(95bdec2f) SHA1(201b9c53ea53a25535b619231d0d14e08c206ecf) )
r4057r4058
14831542   ROM_LOAD( "s0-3a",        0xf000, 0x1000, CRC(beb4b1fc) SHA1(166a96b5757946231f3619844366218065412935) )
14841543
14851544   ROM_REGION( 0x10000, "audio", 0 )
1486   ROM_LOAD( "sa-1h",        0xf000, 0x1000, CRC(379387ec) SHA1(29d37f04c64ed53a2573962dfa9c0623b89e0045) )
1545   ROM_LOAD( "sa-1h",        0xe000, 0x1000, CRC(379387ec) SHA1(29d37f04c64ed53a2573962dfa9c0623b89e0045) )
14871546
14881547   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
14891548   ROM_LOAD( "s4-11l",       0x0000, 0x1000, CRC(a2162a9e) SHA1(2729cef805c8e863af540424faa1aca82d3525e2) )
r4057r4058
15271586   ROM_LOAD( "t2",           0xf000, 0x1000, CRC(d2f9dd30) SHA1(1faa088806e8627b5e561d8b99054d295045dcfb) )
15281587
15291588   ROM_REGION( 0x10000, "audio", 0 )
1530   ROM_LOAD( "t1",           0xf000, 0x1000, CRC(40737ea7) SHA1(27e8474028385574035d3982f9c576bb9bb3facd) ) /* starts at 0000, not f000; 0000-01ff is RAM */
1589   ROM_LOAD( "t1",           0xe000, 0x1000, CRC(40737ea7) SHA1(27e8474028385574035d3982f9c576bb9bb3facd) ) /* starts at 0000, not f000; 0000-01ff is RAM */
15311590
15321591   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
15331592   ROM_LOAD( "t7",           0x0000, 0x1000, CRC(aa935169) SHA1(965f41a9fcf35ac7c899e79acd0a85ab588d5831) )
r4057r4058
15501609   ROM_LOAD( "mmonkey.a4",   0xf000, 0x1000, CRC(f7d3d1e3) SHA1(ff650a833e5e8975fe5b4a644ce6c35de5e04740) )
15511610
15521611   ROM_REGION( 0x10000, "audio", 0 )
1553   ROM_LOAD( "mmonkey.h1",   0xf000, 0x1000, CRC(5bcb2e81) SHA1(60fb8fd83c83b278e3aaf96f0b6dbefbc1eef0f7) )
1612   ROM_LOAD( "mmonkey.h1",   0xe000, 0x1000, CRC(5bcb2e81) SHA1(60fb8fd83c83b278e3aaf96f0b6dbefbc1eef0f7) )
15541613
15551614   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
15561615   ROM_LOAD( "mmonkey.l11",  0x0000, 0x1000, CRC(b6aa8566) SHA1(bc90d4cfa9a221477d1989fea532621ce3e76439) )
r4057r4058
15721631   ROM_LOAD( "brubber.12d",  0xe000, 0x2000, CRC(b2ce51f5) SHA1(5e38ea24bcafef1faba023def96532abd6f97d38) )
15731632
15741633   ROM_REGION( 0x10000, "audio", 0 )
1575   ROM_LOAD( "bnj6c.bin",    0xf000, 0x1000, CRC(8c02f662) SHA1(1279d564e65fd3ccac25b1f9fbb40d910de2b544) )
1634   ROM_LOAD( "bnj6c.bin",    0xe000, 0x1000, CRC(8c02f662) SHA1(1279d564e65fd3ccac25b1f9fbb40d910de2b544) )
15761635
15771636   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
15781637   ROM_LOAD( "bnj4e.bin",    0x0000, 0x2000, CRC(b864d082) SHA1(cacf71fa6c0f7121d077381a0ff6222f534295ab) )
r4057r4058
15911650   ROM_LOAD( "bnj12d.bin",   0xe000, 0x2000, CRC(b88bc99e) SHA1(08a4ddea4037f9e14d0d9f4262a1746b0a3a140c) )
15921651
15931652   ROM_REGION( 0x10000, "audio", 0 )
1594   ROM_LOAD( "bnj6c.bin",    0xf000, 0x1000, CRC(8c02f662) SHA1(1279d564e65fd3ccac25b1f9fbb40d910de2b544) )
1653   ROM_LOAD( "bnj6c.bin",    0xe000, 0x1000, CRC(8c02f662) SHA1(1279d564e65fd3ccac25b1f9fbb40d910de2b544) )
15951654
15961655   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
15971656   ROM_LOAD( "bnj4e.bin",    0x0000, 0x2000, CRC(b864d082) SHA1(cacf71fa6c0f7121d077381a0ff6222f534295ab) )
r4057r4058
16101669   ROM_LOAD( "c6.12d",  0xe000, 0x2000, CRC(1d6957c4) SHA1(bd30f00187e56eef9adcc167dd752a3bb616454c) )
16111670
16121671   ROM_REGION( 0x10000, "audio", 0 )
1613   ROM_LOAD( "c5.6c",   0xf000, 0x1000, CRC(8c02f662) SHA1(1279d564e65fd3ccac25b1f9fbb40d910de2b544) )
1672   ROM_LOAD( "c5.6c",   0xe000, 0x1000, CRC(8c02f662) SHA1(1279d564e65fd3ccac25b1f9fbb40d910de2b544) )
16141673
16151674   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
16161675   ROM_LOAD( "c0.4e",   0x0000, 0x2000, CRC(bf3ea732) SHA1(d98970b2dda8c3435506656909e5e3aa70d45652) )
r4057r4058
16321691
16331692ROM_START( zoar )
16341693   ROM_REGION( 0x10000, "main", 0 )
1635   ROM_LOAD( "zoar15",       0xd000, 0x1000, BAD_DUMP CRC(1f0cfdb7) SHA1(ce7e871f17c52b6eaf99cfb721e702e4f0e6bb25) )
1694   ROM_LOAD( "zoar15",       0xd000, 0x1000, CRC(1f0cfdb7) SHA1(ce7e871f17c52b6eaf99cfb721e702e4f0e6bb25) )
16361695   ROM_LOAD( "zoar16",       0xe000, 0x1000, CRC(7685999c) SHA1(fabe38d71e797ae0b04b5d3aba228b4c85d96185) )
16371696   ROM_LOAD( "zoar17",       0xf000, 0x1000, CRC(619ea867) SHA1(0a3735384f03a1052d54ab799b5e37038d8ece2a) )
16381697
16391698   ROM_REGION( 0x10000, "audio", 0 )
1640   ROM_LOAD( "zoar09",       0xf000, 0x1000, CRC(18d96ff1) SHA1(671d934a451e0b042450ea86d24c3751a39b38f8) )
1699   ROM_LOAD( "zoar09",       0xe000, 0x1000, CRC(18d96ff1) SHA1(671d934a451e0b042450ea86d24c3751a39b38f8) )
16411700
16421701   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
16431702   ROM_LOAD( "zoar00",       0x0000, 0x1000, CRC(fd2dcb64) SHA1(1a49a6ec6ffd354d872b1af83d55ec96e8215b2b) )
r4057r4058
17101769   ROM_LOAD( "ao_06.12d",  0xe000, 0x2000, CRC(413c984c) SHA1(1431df4db52d621ba39fd47dbd49da103b5c0bcf) )
17111770
17121771   ROM_REGION( 0x10000, "audio", 0 )
1713   ROM_LOAD( "ao_05.6c",    0xf000, 0x1000, CRC(46833e38) SHA1(420831149a566199d6a3c74ef3df0687b4ddcbe4) )
1772   ROM_LOAD( "ao_05.6c",    0xe000, 0x1000, CRC(46833e38) SHA1(420831149a566199d6a3c74ef3df0687b4ddcbe4) )
17141773
17151774   ROM_REGION( 0x6000, "gfx1", ROMREGION_DISPOSE )
17161775   ROM_LOAD( "ao_00.4e",    0x0000, 0x2000, CRC(f4e0cbd6) SHA1(a2ede0ce4a26957a5d3b62872a42b8979f5000aa) )
r4057r4058
17691828static DRIVER_INIT( btime )
17701829{
17711830   init_rom1(machine);
1831   audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
17721832}
17731833
17741834static DRIVER_INIT( zoar )
r4057r4058
17821842   memset(&rom[0xd50a],0xea,8);
17831843
17841844   init_rom1(machine);
1845   audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
17851846}
17861847
17871848static DRIVER_INIT( tisland )
r4057r4058
17951856   memset(&rom[0xa2b6],0x24,1);
17961857
17971858   init_rom1(machine);
1859   audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
17981860}
17991861
18001862static DRIVER_INIT( lnc )
18011863{
18021864   decrypt_C10707_cpu(machine, "main");
1865   audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
18031866}
18041867
1868static DRIVER_INIT( bnj )
1869{
1870   decrypt_C10707_cpu(machine, "main");
1871   audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
1872}
1873
1874static DRIVER_INIT( disco )
1875{
1876   DRIVER_INIT_CALL(btime);
1877   audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
1878}
1879
18051880static DRIVER_INIT( cookrace )
18061881{
1807   memcpy(&audio_rambase[0x200], memory_region(machine, "audio") + 0xf200, 0x200);
18081882   decrypt_C10707_cpu(machine, "main");
1883
1884   memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, SMH_BANK10);
1885   memory_set_bankptr(machine, 10, memory_region(machine, "audio") + 0xe200);
1886   audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
18091887}
18101888
1889static DRIVER_INIT( protennb )
1890{
1891   DRIVER_INIT_CALL(btime);
1892   audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
1893}
1894
18111895static DRIVER_INIT( wtennis )
18121896{
1813   memcpy(&audio_rambase[0x200], memory_region(machine, "audio") + 0xf200, 0x200);
1897   decrypt_C10707_cpu(machine, "main");
1898
18141899   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
1815   decrypt_C10707_cpu(machine, "main");
1900
1901   memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, SMH_BANK10);
1902   memory_set_bankptr(machine, 10, memory_region(machine, "audio") + 0xe200);
1903   audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
18161904}
18171905
18181906static DRIVER_INIT( sdtennis )
18191907{
18201908   decrypt_C10707_cpu(machine, "main");
18211909   decrypt_C10707_cpu(machine, "audio");
1910   audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
18221911}
18231912
18241913
1825GAME( 1982, btime,    0,       btime,    btime,    btime,   ROT270, "Data East Corporation", "Burger Time (Data East set 1)", 0 )
1826GAME( 1982, btime2,   btime,   btime,    btime,    btime,   ROT270, "Data East Corporation", "Burger Time (Data East set 2)", 0 )
1827GAME( 1982, btimem,   btime,   btime,    btime,    btime,   ROT270, "Data East (Bally Midway license)", "Burger Time (Midway)", 0 )
1828GAME( 1982, cookrace, btime,   cookrace, cookrace, cookrace,ROT270, "bootleg", "Cook Race", 0 )
1829GAME( 1981, tisland,  0,       tisland,  btime,    tisland, ROT270, "Data East Corporation", "Treasure Island", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
1830GAME( 1981, lnc,      0,       lnc,      lnc,      lnc,     ROT270, "Data East Corporation", "Lock'n'Chase", 0 )
1831GAME( 1982, protennb, 0,       disco,    disco,    btime,   ROT270, "bootleg", "Tennis (bootleg of Pro Tennis)", 0 )
1832GAME( 1982, wtennis,  0,       wtennis,  wtennis,  wtennis, ROT270, "bootleg", "World Tennis", 0 )
1833GAME( 1982, mmonkey,  0,       mmonkey,  mmonkey,  lnc,     ROT270, "Technos + Roller Tron", "Minky Monkey", 0 )
1834GAME( 1982, brubber,  0,       bnj,      bnj,      lnc,     ROT270, "Data East", "Burnin' Rubber", 0 )
1835GAME( 1982, bnj,      brubber, bnj,      bnj,      lnc,     ROT270, "Data East USA (Bally Midway license)", "Bump 'n' Jump", 0 )
1836GAME( 1982, caractn,  brubber, bnj,      bnj,      lnc,     ROT270, "bootleg", "Car Action", 0 )
1837GAME( 1982, zoar,     0,       zoar,     zoar,     zoar,    ROT270, "Data East USA", "Zoar", 0 )
1838GAME( 1982, disco,    0,       disco,    disco,    btime,   ROT270, "Data East", "Disco No.1", 0 )
1839GAME( 1982, discof,   disco,   disco,    disco,    btime,   ROT270, "Data East", "Disco No.1 (Rev.F)", 0 )
1840GAME( 1983, sdtennis, 0,       bnj,      sdtennis, sdtennis,ROT270, "Data East Corporation", "Super Doubles Tennis", 0 )
1914GAME( 1982, btime,    0,       btime,    btime,    btime,    ROT270, "Data East Corporation", "Burger Time (Data East set 1)", 0 )
1915GAME( 1982, btime2,   btime,   btime,    btime,    btime,    ROT270, "Data East Corporation", "Burger Time (Data East set 2)", 0 )
1916GAME( 1982, btimem,   btime,   btime,    btime,    btime,    ROT270, "Data East (Bally Midway license)", "Burger Time (Midway)", 0 )
1917GAME( 1982, cookrace, btime,   cookrace, cookrace, cookrace, ROT270, "bootleg", "Cook Race", 0 )
1918GAME( 1981, tisland,  0,       tisland,  btime,    tisland,  ROT270, "Data East Corporation", "Treasure Island", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
1919GAME( 1981, lnc,      0,       lnc,      lnc,      lnc,      ROT270, "Data East Corporation", "Lock'n'Chase", 0 )
1920GAME( 1982, protennb, 0,       disco,    disco,    protennb, ROT270, "bootleg", "Tennis (bootleg of Pro Tennis)", 0 )
1921GAME( 1982, wtennis,  0,       wtennis,  wtennis,  wtennis,  ROT270, "bootleg", "World Tennis", 0 )
1922GAME( 1982, mmonkey,  0,       mmonkey,  mmonkey,  lnc,      ROT270, "Technos + Roller Tron", "Minky Monkey", 0 )
1923GAME( 1982, brubber,  0,       bnj,      bnj,      bnj,      ROT270, "Data East", "Burnin' Rubber", 0 )
1924GAME( 1982, bnj,      brubber, bnj,      bnj,      bnj,      ROT270, "Data East USA (Bally Midway license)", "Bump 'n' Jump", 0 )
1925GAME( 1982, caractn,  brubber, bnj,      bnj,      bnj,      ROT270, "bootleg", "Car Action", 0 )
1926GAME( 1982, zoar,     0,       zoar,     zoar,     zoar,     ROT270, "Data East USA", "Zoar", 0 )
1927GAME( 1982, disco,    0,       disco,    disco,    disco,    ROT270, "Data East", "Disco No.1", 0 )
1928GAME( 1982, discof,   disco,   disco,    disco,    disco,    ROT270, "Data East", "Disco No.1 (Rev.F)", 0 )
1929GAME( 1983, sdtennis, 0,       bnj,      sdtennis, sdtennis, ROT270, "Data East Corporation", "Super Doubles Tennis", 0 )
src/mame/drivers/scobra.c
r4057r4058
436436   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
437437ADDRESS_MAP_END
438438
439static INPUT_PORTS_START( scobra )
440   PORT_START("IN0")
441   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
442   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
443   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
444   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
445   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
446   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
447   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
448   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
449
450   PORT_START("IN1")
451   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Allow_Continue ) )
452   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
453   PORT_DIPSETTING(    0x01, DEF_STR( Yes ) )
454   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
455   PORT_DIPSETTING(    0x00, "3" )
456   PORT_DIPSETTING(    0x02, "4" )
457   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
458   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
459   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
460   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
461   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
462   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
463
464   PORT_START("IN2")
465   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
466   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
467   PORT_DIPSETTING(    0x04, DEF_STR( 2C_1C ) )
468   PORT_DIPSETTING(    0x06, DEF_STR( 4C_3C ) )
469   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
470   PORT_DIPSETTING(    0x00, "1 Coin/99 Credits" )
471   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
472   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
473   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
474   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
475   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
476   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
477   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
478INPUT_PORTS_END
479
480/* identical to scobra apart from the number of lives */
481static INPUT_PORTS_START( scobras )
482   PORT_INCLUDE( scobra )
483
484   PORT_MODIFY("IN1")
485   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Lives ) )
486   PORT_DIPSETTING(    0x00, "3" )
487   PORT_DIPSETTING(    0x02, "5" )
488INPUT_PORTS_END
489
490
491439/* stratgyx coinage DIPs are spread accross two input ports */
492440static CUSTOM_INPUT( stratgyx_coinage_r )
493441{
r4057r4058
662610INPUT_PORTS_END
663611
664612
665/* cocktail mode not working due to bug in game code */
666static INPUT_PORTS_START( anteater )
667   PORT_START("IN0")
668   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
669   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
670   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
671   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
672   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
673   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
674   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
675   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
676
677   PORT_START("IN1")
678   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) )
679   PORT_DIPSETTING(    0x01, "3" )
680   PORT_DIPSETTING(    0x00, "5" )
681   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
682   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
683   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
684   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
685   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
686   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
687   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
688   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
689   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
690
691   PORT_START("IN2")
692   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
693   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
694   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
695   PORT_DIPSETTING(    0x00, "Coin A 1/2 Coin B 2/1" )
696   PORT_DIPSETTING(    0x04, "Coin A 1/3 Coin B 3/1" )
697   PORT_DIPSETTING(    0x06, "Coin A 1/4 Coin B 4/1" )
698   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )
699   PORT_DIPSETTING(    0x08, DEF_STR( Upright ) )
700   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
701   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
702   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
703   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
704   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
705   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
706   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
707   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
708   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
709   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
710   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
711INPUT_PORTS_END
712
713613static INPUT_PORTS_START( anteatg )
714614   PORT_START("IN0")
715615   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
r4057r4058
920820   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
921821INPUT_PORTS_END
922822
923/* cocktail mode is N/A */
924static INPUT_PORTS_START( losttomb )
925   PORT_START("IN0")
926   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2 )
927   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
928   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_8WAY
929   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY
930   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT) PORT_8WAY
931   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY
932   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
933   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
934823
935   PORT_START("IN1")
936   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
937   PORT_DIPSETTING(    0x01, "3" )
938   PORT_DIPSETTING(    0x02, "5" )
939   PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
940   PORT_DIPSETTING(    0x00, "Invulnerability (Cheat)")
941   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY
942   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY
943   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT) PORT_8WAY
944   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY
945   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 )
946   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
947   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
948   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
949
950   PORT_START("DSW")
951   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
952   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
953   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
954   PORT_DIPNAME( 0x06, 0x02, DEF_STR( Coinage ) )
955   PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
956   PORT_DIPSETTING(    0x00, "A 1/2 B 2/1" )
957   PORT_DIPSETTING(    0x04, "A 1/3 B 3/1" )
958   PORT_DIPSETTING(    0x06, "A 1/4 B 4/1" )
959   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
960   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
961   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
962   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
963   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
964   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
965   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
966   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
967   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
968   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
969   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
970   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
971   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
972   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
973   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
974INPUT_PORTS_END
975
976
977824static INPUT_PORTS_START( hustler )
978825   PORT_START("IN0")
979826   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r4057r4058
12841131
12851132***************************************************************************/
12861133
1287ROM_START( scobra )
1288   ROM_REGION( 0x10000, "main", 0 )
1289   ROM_LOAD( "epr1265.2c",   0x0000, 0x1000, CRC(a0744b3f) SHA1(8949298a04f8ba8a82d5d84a7b012a0e7cff11df) )
1290   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(8e7245cd) SHA1(281504ff364c3ddbf901c92729b139afd93b9785) )
1291   ROM_LOAD( "epr1267.2f",   0x2000, 0x1000, CRC(47a4e6fb) SHA1(01775ad11dc23469649539ee8fb8a5800df031c6) )
1292   ROM_LOAD( "2h",           0x3000, 0x1000, CRC(7244f21c) SHA1(f5fff565ed3f6c5f277a4db53c9f569813fcec1d) )
1293   ROM_LOAD( "epr1269.2j",   0x4000, 0x1000, CRC(e1f8a801) SHA1(2add8270352d6596052d3ff22c891ceccaa92071) )
1294   ROM_LOAD( "2l",           0x5000, 0x1000, CRC(d52affde) SHA1(5681771ed51d504bdcc2999fcbf926a30b137828) )
1295
1296   ROM_REGION( 0x10000, "audio", 0 )
1297   ROM_LOAD( "5c",           0x0000, 0x0800, CRC(d4346959) SHA1(5eab4505beb69a5bdd88b23db60e1193371250cf) )
1298   ROM_LOAD( "5d",           0x0800, 0x0800, CRC(cc025d95) SHA1(2b0784c4d05c466e0b7648f16e14f34393d792c3) )
1299   ROM_LOAD( "5e",           0x1000, 0x0800, CRC(1628c53f) SHA1(ec79a73e4a2d7373454b227dd7eff255f1cc60cc) )
1300
1301   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1302   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
1303   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
1304
1305   ROM_REGION( 0x0020, "proms", 0 )
1306   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
1307ROM_END
1308
1309ROM_START( scobras )
1310   ROM_REGION( 0x10000, "main", 0 )
1311   ROM_LOAD( "scobra2c.bin", 0x0000, 0x1000, CRC(e15ade38) SHA1(21cf26d1781d133fa336d275d8a61d3f95d10b77) )
1312   ROM_LOAD( "scobra2e.bin", 0x1000, 0x1000, CRC(a270e44d) SHA1(8b7307af458b9cd3c45bb72b35e682d6d109ed01) )
1313   ROM_LOAD( "scobra2f.bin", 0x2000, 0x1000, CRC(bdd70346) SHA1(bda0dc5777233a86a3a0aceb6eded45145057ba8) )
1314   ROM_LOAD( "scobra2h.bin", 0x3000, 0x1000, CRC(dca5ec31) SHA1(50073d44ccef76a3c36c73a6ed4479127f2c98ee) )
1315   ROM_LOAD( "scobra2j.bin", 0x4000, 0x1000, CRC(0d8f6b6e) SHA1(0ca0096cd55cdb87d14cb7f4c7c7b853ec1661c7) )
1316   ROM_LOAD( "scobra2l.bin", 0x5000, 0x1000, CRC(6f80f3a9) SHA1(817d212454c5eb16c5d7471d2ccefc4f8708d57f) )
1317
1318   ROM_REGION( 0x10000, "audio", 0 )
1319   ROM_LOAD( "epr1275.5c",   0x0000, 0x0800, CRC(deeb0dd3) SHA1(b815a586f05361b75078d58f1fddfdb36f9d8fae) )
1320   ROM_LOAD( "epr1276.5d",   0x0800, 0x0800, CRC(872c1a74) SHA1(20f05bf398ad2690f5ba4e4158ad62aeec226413) )
1321   ROM_LOAD( "epr1277.5e",   0x1000, 0x0800, CRC(ccd7a110) SHA1(5a247e360530be0f94c90fcc7d0ce628d460449f) )
1322
1323   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1324   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
1325   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
1326
1327   ROM_REGION( 0x0020, "proms", 0 )
1328   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
1329ROM_END
1330
1331ROM_START( scobrase )
1332   ROM_REGION( 0x10000, "main", 0 )
1333   ROM_LOAD( "epr1265.2c",   0x0000, 0x1000, CRC(a0744b3f) SHA1(8949298a04f8ba8a82d5d84a7b012a0e7cff11df) )
1334   ROM_LOAD( "epr1266.2e",   0x1000, 0x1000, CRC(65306279) SHA1(f6e10d57c9b88e3fcd7333f76708e190a97b4faa) )
1335   ROM_LOAD( "epr1267.2f",   0x2000, 0x1000, CRC(47a4e6fb) SHA1(01775ad11dc23469649539ee8fb8a5800df031c6) )
1336   ROM_LOAD( "epr1268.2h",   0x3000, 0x1000, CRC(53eecaf2) SHA1(08ca34097f63af8ab69b1d836a12a8bd4d42e4a2) )
1337   ROM_LOAD( "epr1269.2j",   0x4000, 0x1000, CRC(e1f8a801) SHA1(2add8270352d6596052d3ff22c891ceccaa92071) )
1338   ROM_LOAD( "epr1270.2l",   0x5000, 0x1000, CRC(f7709710) SHA1(dff9ae72ba00a98d4f5acdd6d506e3d7add6b2c6) )
1339
1340   ROM_REGION( 0x10000, "audio", 0 )
1341   ROM_LOAD( "epr1275.5c",   0x0000, 0x0800, CRC(deeb0dd3) SHA1(b815a586f05361b75078d58f1fddfdb36f9d8fae) )
1342   ROM_LOAD( "epr1276.5d",   0x0800, 0x0800, CRC(872c1a74) SHA1(20f05bf398ad2690f5ba4e4158ad62aeec226413) )
1343   ROM_LOAD( "epr1277.5e",   0x1000, 0x0800, CRC(ccd7a110) SHA1(5a247e360530be0f94c90fcc7d0ce628d460449f) )
1344
1345   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1346   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
1347   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
1348
1349   ROM_REGION( 0x0020, "proms", 0 )
1350   ROM_LOAD( "pr1278.6e",    0x0000, 0x0020, CRC(fd35c561) SHA1(590f60beb443dd689c890c37cc100e0b936bf8c9) )
1351ROM_END
1352
1353ROM_START( scobrab )
1354   ROM_REGION( 0x10000, "main", 0 )
1355   ROM_LOAD( "vid_2c.bin",   0x0000, 0x0800, CRC(aeddf391) SHA1(87632469e943cfe38a9676de5e8ed839a63c5da2) )
1356   ROM_LOAD( "vid_2e.bin",   0x0800, 0x0800, CRC(72b57eb7) SHA1(978d0acbfccb7c1edddb073ad9417d4cbd9b7e63) )
1357   ROM_LOAD( "scobra2e.bin", 0x1000, 0x1000, CRC(a270e44d) SHA1(8b7307af458b9cd3c45bb72b35e682d6d109ed01) )
1358   ROM_LOAD( "scobra2f.bin", 0x2000, 0x1000, CRC(bdd70346) SHA1(bda0dc5777233a86a3a0aceb6eded45145057ba8) )
1359   ROM_LOAD( "scobra2h.bin", 0x3000, 0x1000, CRC(dca5ec31) SHA1(50073d44ccef76a3c36c73a6ed4479127f2c98ee) )
1360   ROM_LOAD( "scobra2j.bin", 0x4000, 0x1000, CRC(0d8f6b6e) SHA1(0ca0096cd55cdb87d14cb7f4c7c7b853ec1661c7) )
1361   ROM_LOAD( "scobra2l.bin", 0x5000, 0x1000, CRC(6f80f3a9) SHA1(817d212454c5eb16c5d7471d2ccefc4f8708d57f) )
1362
1363   ROM_REGION( 0x10000, "audio", 0 )
1364   ROM_LOAD( "snd_5c.bin",   0x0000, 0x0800, CRC(deeb0dd3) SHA1(b815a586f05361b75078d58f1fddfdb36f9d8fae) )
1365   ROM_LOAD( "snd_5d.bin",   0x0800, 0x0800, CRC(872c1a74) SHA1(20f05bf398ad2690f5ba4e4158ad62aeec226413) )
1366   ROM_LOAD( "snd_5e.bin",   0x1000, 0x0800, CRC(ccd7a110) SHA1(5a247e360530be0f94c90fcc7d0ce628d460449f) )
1367
1368   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1369   ROM_LOAD( "epr1274.5h",   0x0000, 0x0800, CRC(64d113b4) SHA1(7b439bb74d5ecc792e0ca8964bcca8c6b7a51262) )
1370   ROM_LOAD( "epr1273.5f",   0x0800, 0x0800, CRC(a96316d3) SHA1(9de0e94932e91dc34aea7c81880bde6a486d103b) )
1371
1372   ROM_REGION( 0x0020, "proms", 0 )
1373   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
1374ROM_END
1375
13761134ROM_START( stratgyx )
13771135   ROM_REGION( 0x10000, "main", 0 )
13781136   ROM_LOAD( "2c_1.bin",     0x0000, 0x1000, CRC(eec01237) SHA1(619aaf6379064395a1166575f207d61c90731bb9) )
r4057r4058
14441202   ROM_LOAD( "6e.cpu",       0x0000, 0x0020, CRC(86b6e124) SHA1(76cc422aeb53a4970f91bd5eb00a3e24a76c09d1) )
14451203ROM_END
14461204
1447ROM_START( tazmania )
1448   ROM_REGION( 0x10000, "main", 0 )
1449   ROM_LOAD( "2c.cpu",       0x0000, 0x1000, CRC(932c5a06) SHA1(f90040a12f579a05cb91eacbe49dae9b2c725592) )
1450   ROM_LOAD( "2e.cpu",       0x1000, 0x1000, CRC(ef17ce65) SHA1(e1372886a4a2ae58278772f49b4f3be35e0b65d1) )
1451   ROM_LOAD( "2f.cpu",       0x2000, 0x1000, CRC(43c7c39d) SHA1(3cfe97009e3c9236b118fa1beadc50f41584bd7e) )
1452   ROM_LOAD( "2h.cpu",       0x3000, 0x1000, CRC(be829694) SHA1(3885c95ae1704e7a472139740b87fc8dd9610e07) )
1453   ROM_LOAD( "2j.cpu",       0x4000, 0x1000, CRC(6e197271) SHA1(231141a95e4dcb54d8bbee346825702e52824c42) )
1454   ROM_LOAD( "2k.cpu",       0x5000, 0x1000, CRC(a1eb453b) SHA1(50ddfd1dd8cc8c2cde97e52d4ef90e6d10e27a53) )
1455
1456   ROM_REGION( 0x10000, "audio", 0 )
1457   ROM_LOAD( "rom0.snd",     0x0000, 0x0800, CRC(b8d741f1) SHA1(a1bb8a1e0d6b34111f05c539c8e92fffacf5aa5c) )
1458
1459   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1460   ROM_LOAD( "5f.cpu",       0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) )
1461   ROM_LOAD( "5h.cpu",       0x0800, 0x0800, CRC(3f5ff3ac) SHA1(bc70eef54a45b52c14e35464e5f06b5eec554eb6) )
1462
1463   ROM_REGION( 0x0020, "proms", 0 )
1464   ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, CRC(fce333c7) SHA1(f63a214dc47c5e7c80db000b0b6a261ca8da6629) )
1465ROM_END
1466
14671205ROM_START( tazmani2 )
14681206   ROM_REGION( 0x10000, "main", 0 )
14691207   ROM_LOAD( "2ck.cpu",      0x0000, 0x1000, CRC(bf0492bf) SHA1(e665be8b36eb00388daca1bc3a4e4b93b943e2bd) )
r4057r4058
14841222   ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, CRC(fce333c7) SHA1(f63a214dc47c5e7c80db000b0b6a261ca8da6629) )
14851223ROM_END
14861224
1487ROM_START( anteater )
1488   ROM_REGION( 0x10000, "main", 0 )
1489   ROM_LOAD( "ra1-2c",       0x0000, 0x1000, CRC(58bc9393) SHA1(7122782a69ef0d2196ec16833f229b6286802668) )
1490   ROM_LOAD( "ra1-2e",       0x1000, 0x1000, CRC(574fc6f6) SHA1(a1a213d215fe8502edf22383c3a6fb7c9b279d94) )
1491   ROM_LOAD( "ra1-2f",       0x2000, 0x1000, CRC(2f7c1fe5) SHA1(4cea7e66a85766a9cf9846bb5bc1ca4e6ee1f4e2) )
1492   ROM_LOAD( "ra1-2h",       0x3000, 0x1000, CRC(ae8a5da3) SHA1(1893d8293b25431d080b89f5b0874440d14e8d17) )
1493
1494   ROM_REGION( 0x10000, "audio", 0 )
1495   ROM_LOAD( "ra4-5c",       0x0000, 0x0800, CRC(87300b4f) SHA1(b81b685ac1d353ff1cd40b876a7478b87b85e7a9) )
1496   ROM_LOAD( "ra4-5d",       0x0800, 0x0800, CRC(af4e5ffe) SHA1(62717a233cf9f58267af4a9e1c80479b373ab317) )
1497
1498   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1499   ROM_LOAD( "ra6-5f",       0x0000, 0x0800, CRC(4c3f8a08) SHA1(3152eef64903be1a82f09764821a3654f316197d) )
1500   ROM_LOAD( "ra6-5h",       0x0800, 0x0800, CRC(b30c7c9f) SHA1(d4ae040d1fd7e5a5d08c2f6968735c551119c207) )
1501
1502   ROM_REGION( 0x0020, "proms", 0 )
1503   ROM_LOAD( "colr6f.cpu",   0x0000, 0x0020, CRC(fce333c7) SHA1(f63a214dc47c5e7c80db000b0b6a261ca8da6629) )
1504ROM_END
1505
15061225ROM_START( anteatg )
15071226   ROM_REGION( 0x10000, "main", 0 )
15081227   ROM_LOAD( "prg_2.bin",    0x0000, 0x0400, CRC(2ba793a8) SHA1(a97c96dcd55804d3b41856ece6477ec1c1e45892) )
r4057r4058
16061325   ROM_LOAD( "minefld.clr",  0x0000, 0x0020, CRC(1877368e) SHA1(5850e03debe572f72abd91c756c0f8613018a962) )
16071326ROM_END
16081327
1609ROM_START( losttomb )
1610   ROM_REGION( 0x10000, "main", 0 )
1611   ROM_LOAD( "2c",           0x0000, 0x1000, CRC(d6176d2c) SHA1(bc2bf63ee8d3e376f155d218704ceb5adcdf8e54) )
1612   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(a5f55f4a) SHA1(3609fc2b15b6856e81738bbd370250735dba694d) )
1613   ROM_LOAD( "2f",           0x2000, 0x1000, CRC(0169fa3c) SHA1(2c06b1deca6c80d067032bfc2386da6ab0111e5f) )
1614   ROM_LOAD( "2h-easy",      0x3000, 0x1000, CRC(054481b6) SHA1(b0f5d19af0336883e4d9813e58a75c176a63a987) )
1615   ROM_LOAD( "2j",           0x4000, 0x1000, CRC(249ee040) SHA1(7297039e95e67220fa3e75fc50635f4df4c46a86) )
1616   ROM_LOAD( "2l",           0x5000, 0x1000, CRC(c7d2e608) SHA1(8aabecabd1dcd6833fb581e4571d71a680e6563a) )
1617   ROM_LOAD( "2m",           0x6000, 0x1000, CRC(bc4bc5b1) SHA1(95ffa72e57d1da10ddeda4d9333c9e0a2fb33e82) )
1618
1619   ROM_REGION( 0x10000, "audio", 0 )
1620   ROM_LOAD( "5c",           0x0000, 0x0800, CRC(b899be2a) SHA1(9b343a682531255104db61177a43ad933c3af34e) )
1621   ROM_LOAD( "5d",           0x0800, 0x0800, CRC(6907af31) SHA1(8496c8db5342129d81381eec196facbca45bca77) )
1622
1623   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1624   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(61f137e7) SHA1(8bff09bc29fa829e21e6b36f7b3f67f19f6bbb26) )
1625   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(5581de5f) SHA1(763dacb0d2183c159e7f1f04c7ecb1182da18abf) )
1626
1627   ROM_REGION( 0x0020, "proms", 0 )
1628   ROM_LOAD( "ltprom",       0x0000, 0x0020, CRC(1108b816) SHA1(49fdb08f8f31fefa2f3dca3d3455318cb21847a3) )
1629ROM_END
1630
1631ROM_START( losttmbh )
1632   ROM_REGION( 0x10000, "main", 0 )
1633   ROM_LOAD( "2c",           0x0000, 0x1000, CRC(d6176d2c) SHA1(bc2bf63ee8d3e376f155d218704ceb5adcdf8e54) )
1634   ROM_LOAD( "2e",           0x1000, 0x1000, CRC(a5f55f4a) SHA1(3609fc2b15b6856e81738bbd370250735dba694d) )
1635   ROM_LOAD( "2f",           0x2000, 0x1000, CRC(0169fa3c) SHA1(2c06b1deca6c80d067032bfc2386da6ab0111e5f) )
1636   ROM_LOAD( "lthard",       0x3000, 0x1000, CRC(e32cbf0e) SHA1(c4a63e01fad7bd450def5c4412690d4bb8d12691) )
1637   ROM_LOAD( "2j",           0x4000, 0x1000, CRC(249ee040) SHA1(7297039e95e67220fa3e75fc50635f4df4c46a86) )
1638   ROM_LOAD( "2l",           0x5000, 0x1000, CRC(c7d2e608) SHA1(8aabecabd1dcd6833fb581e4571d71a680e6563a) )
1639   ROM_LOAD( "2m",           0x6000, 0x1000, CRC(bc4bc5b1) SHA1(95ffa72e57d1da10ddeda4d9333c9e0a2fb33e82) )
1640
1641   ROM_REGION( 0x10000, "audio", 0 )
1642   ROM_LOAD( "5c",           0x0000, 0x0800, CRC(b899be2a) SHA1(9b343a682531255104db61177a43ad933c3af34e) )
1643   ROM_LOAD( "5d",           0x0800, 0x0800, CRC(6907af31) SHA1(8496c8db5342129d81381eec196facbca45bca77) )
1644
1645   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1646   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(61f137e7) SHA1(8bff09bc29fa829e21e6b36f7b3f67f19f6bbb26) )
1647   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(5581de5f) SHA1(763dacb0d2183c159e7f1f04c7ecb1182da18abf) )
1648
1649   ROM_REGION( 0x0020, "proms", 0 )
1650   ROM_LOAD( "ltprom",       0x0000, 0x0020, CRC(1108b816) SHA1(49fdb08f8f31fefa2f3dca3d3455318cb21847a3) )
1651ROM_END
1652
16531328ROM_START( hustler )
16541329   ROM_REGION( 0x10000, "main", 0 )
16551330   ROM_LOAD( "hustler.1",    0x0000, 0x1000, CRC(94479a3e) SHA1(ea3a1a3f6bee3d35a6a0fb0ba689a25f6b919e5d) )
src/mame/drivers/galaxian.c
r4057r4058
166166  newer set, Bit4=1 selects the 1P spinner and Bit4=0 selects the 2P spinner.
167167
168168
169Galaxian Bootleg Single Board Layout:
170-------------------------------------
169171
172      |----------------------------------------------------------------------------------------------|
173      |                                                                                              |
174    A | AM27LS00    7486     7486     74163    74163    74LS393  LM324    NE555             ECG740A  |
175      |                                                                                              |
176    B | AM27LS00    74LS00   74LS32   74LS161  74LS161  74LS74   NE555    NE555                      |
177      |                                                                                              |
178    C | AM27LS00    7408     74LS02   74LS161  74LS161  74175    4066     NE555    NE555             |
179      |                                                                                              |
180    D | AM27LS00    74LS00   74LS20   74LS10   74LS74   74LS377  2114     74LS138                    |
181      |                                                                                              |
182    E | AM27LS00    7408     74LS20   74LS283  74LS283  74LS02   2114     74LS138  DM8334            |
183      |                                                                                              |
184    F | 7486        74LS273  74LS??   74LS367  74LS367  74LS273           74LS138  DM8334            |
185      |   G                                                                                          |
186    G |   F         74LS194  74LS157  74LS273  74LS367  6331-1J  PRG1     74LS00   DM8334            |--|
187      |   X                                                                                             |
188    H |   1         74LS194  74LS157  UPB8216                             74161    74161                |
189      |                                                                                                 |
190    I |   G         74LS194  74LS157  UPB8216           74LS157                    74LS273              |
191      |   F                                                                                             |
192    J |   X         74LS194  2114        2        2     7408              UPB8216                       |
193      |   2                              1        1              PRG2                                   |
194    K | 18.432MHZ   74LS157  2114        0        0     74LS74            UPB8216  74LS368              |
195      |                                  1        1                                                     |
196    L | 74LS368     74LS157  74LS157  74LS157  74LS157  74LS04            74LS139  74LS368           |--|
197      |                                                                                              |
198    M | 74LS107     7474     74LS74   74LS139  74LS10   74LS02   74LS367  74LS367  74LS368       2   |
199      |                                                                                          |   |
200    N | 7474                 74LS20   74LS139  74LS74   74LS74   74LS367           74LS368       U   |
201      |                                                                                          P   |
202    O | 74LS164     74LS366  7486     7486     7486     7486           Z80                       C   |
203      |                                                                                          G   |
204    P | 74LS164     74LS30   74LS161  74LS161  74LS161  74LS161                                      |
205      |----------------------------------------------------------------------------------------------|
206        1           2        3        4        5        6        7        8        9        1
207                                                                                            0
208
209
170210TO DO :
171211-------
172212
src/mame/drivers/calomega.c
r4057r4058
450450    --------------
451451
452452
453    [2008-12-26]
454
455    - Correctly setup the MC6845 device for all systems.
456    - Added common MC6845 device interface.
457
458
453459    [2008-07-01]
454460
455461    - Unified MACHINE_RESET for systems 903/904/905.
r4057r4058
19001906};
19011907
19021908
1909/************************
1910*    CRTC Interface    *
1911************************/
1912
1913static const mc6845_interface mc6845_intf =
1914{
1915   "main",   /* screen we are acting on */
1916   8,      /* number of pixels per video memory address */
1917   NULL,   /* before pixel update callback */
1918   NULL,   /* row update callback */
1919   NULL,   /* after pixel update callback */
1920   NULL,   /* callback for display state changes */
1921   NULL,   /* HSYNC callback */
1922   NULL   /* VSYNC callback */
1923};
1924
1925
19031926/*************************
19041927*    Machine Drivers     *
19051928*************************/
r4057r4058
19301953   MDRV_VIDEO_START(calomega)
19311954   MDRV_VIDEO_UPDATE(calomega)
19321955
1933   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
1956   MDRV_MC6845_ADD("crtc", MC6845, CPU_CLOCK, mc6845_intf)   /* 6845 @ CPU clock */
19341957
19351958   /* sound hardware */
19361959   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/4roses.c
r4057r4058
353353};
354354
355355
356/************************
357*    CRTC Interface    *
358************************/
359
360static const mc6845_interface mc6845_intf =
361{
362   "main",      /* screen we are acting on */
363   8,         /* number of pixels per video memory address */
364   NULL,      /* before pixel update callback */
365   NULL,      /* row update callback */
366   NULL,      /* after pixel update callback */
367   NULL,      /* callback for display state changes */
368   NULL,      /* HSYNC callback */
369   NULL      /* VSYNC callback */
370};
371
372
356373/**************************
357374*     Machine Drivers     *
358375**************************/
359376
360377static MACHINE_DRIVER_START( 4roses )
361    /* basic machine hardware */
378   /* basic machine hardware */
362379   MDRV_CPU_ADD("main", M65C02, MASTER_CLOCK/8)   /* 2MHz, guess */
363380   MDRV_CPU_PROGRAM_MAP(4roses_map, 0)
364381   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
365382
366383//  MDRV_NVRAM_HANDLER(generic_0fill)
367384
368    /* video hardware */
385   /* video hardware */
369386
370387   MDRV_SCREEN_ADD("main", RASTER)
371388   MDRV_SCREEN_REFRESH_RATE(60)
r4057r4058
381398   MDRV_VIDEO_START(funworld)
382399   MDRV_VIDEO_UPDATE(funworld)
383400
384   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
401   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/8, mc6845_intf) /* 2MHz, guess */
385402
386    /* sound hardware */
403   /* sound hardware */
387404   MDRV_SPEAKER_STANDARD_MONO("mono")
388405
389406   MDRV_SOUND_ADD("ay8910", AY8910, MASTER_CLOCK/8)   /* 2MHz, guess */
src/mame/drivers/popeye.c
r4057r4058
4848
4949/* the protection device simply returns the last two values written shifted left */
5050/* by a variable amount. */
51static int prot0,prot1,prot_shift;
51static UINT8 prot0,prot1,prot_shift;
5252
5353static READ8_HANDLER( protection_r )
5454{
r4057r4058
271271   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
272272
273273   PORT_START("DSW0")   /* DSW0 */
274   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
275   PORT_DIPSETTING(    0x03, "A 3/1 B 1/2" )
276   PORT_DIPSETTING(    0x0e, DEF_STR( 2C_1C ) )
277   PORT_DIPSETTING(    0x01, "A 2/1 B 2/5" )
278   PORT_DIPSETTING(    0x04, "A 2/1 B 1/3" )
279   PORT_DIPSETTING(    0x07, "A 1/1 B 2/1" )
274   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )    PORT_DIPLOCATION("SW1:1,2,3,4")
275   PORT_DIPSETTING(    0x08, DEF_STR( 6C_1C ) )
276   PORT_DIPSETTING(    0x05, DEF_STR( 5C_1C ) )
277   PORT_DIPSETTING(    0x09, DEF_STR( 4C_1C ) )
278   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )
279   PORT_DIPSETTING(    0x0d, DEF_STR( 2C_1C ) )
280280   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
281   PORT_DIPSETTING(    0x0c, "A 1/1 B 1/2" )
282   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_2C ) )
283   PORT_DIPSETTING(    0x06, "A 1/2 B 1/4" )
284   PORT_DIPSETTING(    0x0b, "A 1/2 B 1/5" )
285   PORT_DIPSETTING(    0x02, "A 2/5 B 1/1" )
286   PORT_DIPSETTING(    0x0a, "A 1/3 B 1/1" )
287   PORT_DIPSETTING(    0x09, "A 1/4 B 1/1" )
288   PORT_DIPSETTING(    0x05, "A 1/5 B 1/1" )
289   PORT_DIPSETTING(    0x08, "A 1/6 B 1/1" )
281   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
282   PORT_DIPSETTING(    0x03, DEF_STR( 1C_3C ) )
290283   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
291284   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
292285   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
r4057r4058
299292   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* scans DSW1 one bit at a time */
300293
301294   PORT_START("DSW1")   /* DSW1 (FAKE - appears as bit 7 of DSW0, see code below) */
302   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
295   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )       PORT_DIPLOCATION("SW2:1,2")
303296   PORT_DIPSETTING(    0x03, "1" )
304297   PORT_DIPSETTING(    0x02, "2" )
305298   PORT_DIPSETTING(    0x01, "3" )
306299   PORT_DIPSETTING(    0x00, "4" )
307   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )
300   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW2:3,4")
308301   PORT_DIPSETTING(    0x0c, DEF_STR( Easy ) )
309302   PORT_DIPSETTING(    0x08, DEF_STR( Medium ) )
310303   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
311304   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
312   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )
305   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) )  PORT_DIPLOCATION("SW2:5,6")
313306   PORT_DIPSETTING(    0x30, "40000" )
314307   PORT_DIPSETTING(    0x20, "60000" )
315308   PORT_DIPSETTING(    0x10, "80000" )
316309   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
317   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )
310   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
318311   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
319312   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
320   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
313   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )     PORT_DIPLOCATION("SW2:8")
321314   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
322315   PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
323316INPUT_PORTS_END
r4057r4058
475468
476469static MACHINE_DRIVER_START( skyskipr )
477470   /* basic machine hardware */
478   MDRV_CPU_ADD("main", Z80, 8000000/2)   /* 4 MHz */
471   MDRV_CPU_ADD("main", Z80, XTAL_8MHz/2)   /* 4 MHz */
479472   MDRV_CPU_PROGRAM_MAP(skyskipr_readmem,skyskipr_writemem)
480473   MDRV_CPU_IO_MAP(io_map,0)
481474   MDRV_CPU_VBLANK_INT("main", popeye_interrupt)
r4057r4058
498491   /* sound hardware */
499492   MDRV_SPEAKER_STANDARD_MONO("mono")
500493
501   MDRV_SOUND_ADD("ay", AY8910, 8000000/4)
494   MDRV_SOUND_ADD("ay", AY8910, XTAL_8MHz/4)
502495   MDRV_SOUND_CONFIG(ay8910_config)
503496   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
504497MACHINE_DRIVER_END
r4057r4058
558551   ROM_LOAD( "tnx1-t.3j",    0x0240, 0x0100, CRC(1c5c8dea) SHA1(5738303b2a9c79b7d06bcf20fdb4d9b29f6e2d96) ) /* timing for the protection ALU */
559552ROM_END
560553
554/*
555    Popeye
556
557    CPU/Sound Board: TPP2-01-CPU
558    Video Board:     TPP2-01-VIDEO
559*/
560
561561ROM_START( popeye )
562562   ROM_REGION( 0x10000, "main", 0 )
563   ROM_LOAD( "c-7a",         0x0000, 0x2000, CRC(9af7c821) SHA1(592acfe221b5c3bd9b920f639b141f37a56d6997) )
564   ROM_LOAD( "c-7b",         0x2000, 0x2000, CRC(c3704958) SHA1(af96d10fa9bdb86b00c89d10f67cb5ca5586f446) )
565   ROM_LOAD( "c-7c",         0x4000, 0x2000, CRC(5882ebf9) SHA1(5531229b37f9ba0ede7fdc24909e3c3efbc8ade4) )
566   ROM_LOAD( "c-7e",         0x6000, 0x2000, CRC(ef8649ca) SHA1(a0157f91600e56e2a953dadbd76da4330652e5c8) )
563   ROM_LOAD( "tpp2-c.7a", 0x0000, 0x2000, CRC(9af7c821) SHA1(592acfe221b5c3bd9b920f639b141f37a56d6997) )
564   ROM_LOAD( "tpp2-c.7b", 0x2000, 0x2000, CRC(c3704958) SHA1(af96d10fa9bdb86b00c89d10f67cb5ca5586f446) )
565   ROM_LOAD( "tpp2-c.7c", 0x4000, 0x2000, CRC(5882ebf9) SHA1(5531229b37f9ba0ede7fdc24909e3c3efbc8ade4) )
566   ROM_LOAD( "tpp2-c.7e", 0x6000, 0x2000, CRC(ef8649ca) SHA1(a0157f91600e56e2a953dadbd76da4330652e5c8) )
567567
568568   ROM_REGION( 0x0800, "gfx1", ROMREGION_DISPOSE )
569   ROM_LOAD( "v-5n",         0x0000, 0x0800, CRC(cca61ddd) SHA1(239f87947c3cc8c6693c295ebf5ea0b7638b781c) )   /* first half is empty */
570   ROM_CONTINUE(             0x0000, 0x0800 )
569   ROM_LOAD( "tpp2-v.5n", 0x0000, 0x0800, CRC(cca61ddd) SHA1(239f87947c3cc8c6693c295ebf5ea0b7638b781c) )   /* first half is empty */
570   ROM_CONTINUE(          0x0000, 0x0800 )
571571
572572   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
573   ROM_LOAD( "v-1e",         0x0000, 0x2000, CRC(0f2cd853) SHA1(426c9b4f6579bfcebe72b976bfe4f05147d53f96) )
574   ROM_LOAD( "v-1f",         0x2000, 0x2000, CRC(888f3474) SHA1(ddee56b2b49bd50aaf9c98d8ef6e905e3f6ab859) )
575   ROM_LOAD( "v-1j",         0x4000, 0x2000, CRC(7e864668) SHA1(8e275dbb1c586f4ebca7548db05246ef0f56d7b1) )
576   ROM_LOAD( "v-1k",         0x6000, 0x2000, CRC(49e1d170) SHA1(bd51a4e34ce8109f26954760156e3cf05fb9db57) )
573   ROM_LOAD( "tpp2-v.1e", 0x0000, 0x2000, CRC(0f2cd853) SHA1(426c9b4f6579bfcebe72b976bfe4f05147d53f96) )
574   ROM_LOAD( "tpp2-v.1f", 0x2000, 0x2000, CRC(888f3474) SHA1(ddee56b2b49bd50aaf9c98d8ef6e905e3f6ab859) )
575   ROM_LOAD( "tpp2-v.1j", 0x4000, 0x2000, CRC(7e864668) SHA1(8e275dbb1c586f4ebca7548db05246ef0f56d7b1) )
576   ROM_LOAD( "tpp2-v.1k", 0x6000, 0x2000, CRC(49e1d170) SHA1(bd51a4e34ce8109f26954760156e3cf05fb9db57) )
577577
578578   ROM_REGION( 0x0340, "proms", 0 )
579   ROM_LOAD( "prom-cpu.4a",  0x0000, 0x0020, CRC(375e1602) SHA1(d84159a0af5db577821c43712bc733329a43af80) ) /* background palette */
580   ROM_LOAD( "prom-cpu.3a",  0x0020, 0x0020, CRC(e950bea1) SHA1(0b48082fe79d9fcdca7e80caff1725713d0c3163) ) /* char palette */
581   ROM_LOAD( "prom-cpu.5b",  0x0040, 0x0100, CRC(c5826883) SHA1(f2c4d3473b3bfa55bffad003dc1fd79540e7e0d1) ) /* sprite palette - low 4 bits */
582   ROM_LOAD( "prom-cpu.5a",  0x0140, 0x0100, CRC(c576afba) SHA1(013c8e8db08a03c7ba156cfefa671d26155fe835) ) /* sprite palette - high 4 bits */
583   ROM_LOAD( "prom-vid.7j",  0x0240, 0x0100, CRC(a4655e2e) SHA1(2a620932fccb763c6c667278c0914f31b9f00ddf) ) /* timing for the protection ALU */
579   ROM_LOAD( "tpp2-c.4a", 0x0000, 0x0020, CRC(375e1602) SHA1(d84159a0af5db577821c43712bc733329a43af80) ) /* background palette */
580   ROM_LOAD( "tpp2-c.3a", 0x0020, 0x0020, CRC(e950bea1) SHA1(0b48082fe79d9fcdca7e80caff1725713d0c3163) ) /* char palette */
581   ROM_LOAD( "tpp2-c.5b", 0x0040, 0x0100, CRC(c5826883) SHA1(f2c4d3473b3bfa55bffad003dc1fd79540e7e0d1) ) /* sprite palette - low 4 bits */
582   ROM_LOAD( "tpp2-c.5a", 0x0140, 0x0100, CRC(c576afba) SHA1(013c8e8db08a03c7ba156cfefa671d26155fe835) ) /* sprite palette - high 4 bits */
583   ROM_LOAD( "tpp2-v.7j", 0x0240, 0x0100, CRC(a4655e2e) SHA1(2a620932fccb763c6c667278c0914f31b9f00ddf) ) /* timing for the protection ALU */
584584ROM_END
585585
586586ROM_START( popeyeu )
587587   ROM_REGION( 0x10000, "main", 0 )
588   ROM_LOAD( "7a",           0x0000, 0x2000, CRC(0bd04389) SHA1(3b08186c9b20dd4dfb92df98941b18999f23aece) )
589   ROM_LOAD( "7b",           0x2000, 0x2000, CRC(efdf02c3) SHA1(4fa616bdb4e21f752e46890d007c911fff9ceadc) )
590   ROM_LOAD( "7c",           0x4000, 0x2000, CRC(8eee859e) SHA1(a597d5655d06d565653c64b18ed8842625e15088) )
591   ROM_LOAD( "7e",           0x6000, 0x2000, CRC(b64aa314) SHA1(b5367f518350223e191d94434dc535873efb4c74) )
588   ROM_LOAD( "7a",        0x0000, 0x2000, CRC(0bd04389) SHA1(3b08186c9b20dd4dfb92df98941b18999f23aece) )
589   ROM_LOAD( "7b",        0x2000, 0x2000, CRC(efdf02c3) SHA1(4fa616bdb4e21f752e46890d007c911fff9ceadc) )
590   ROM_LOAD( "7c",        0x4000, 0x2000, CRC(8eee859e) SHA1(a597d5655d06d565653c64b18ed8842625e15088) )
591   ROM_LOAD( "7e",        0x6000, 0x2000, CRC(b64aa314) SHA1(b5367f518350223e191d94434dc535873efb4c74) )
592592
593593   ROM_REGION( 0x0800, "gfx1", ROMREGION_DISPOSE )
594   ROM_LOAD( "v-5n",         0x0000, 0x0800, CRC(cca61ddd) SHA1(239f87947c3cc8c6693c295ebf5ea0b7638b781c) )   /* first half is empty */
595   ROM_CONTINUE(             0x0000, 0x0800 )
594   ROM_LOAD( "tpp2-v.5n", 0x0000, 0x0800, CRC(cca61ddd) SHA1(239f87947c3cc8c6693c295ebf5ea0b7638b781c) )   /* first half is empty */
595   ROM_CONTINUE(          0x0000, 0x0800 )
596596
597597   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
598   ROM_LOAD( "v-1e",         0x0000, 0x2000, CRC(0f2cd853) SHA1(426c9b4f6579bfcebe72b976bfe4f05147d53f96) )
599   ROM_LOAD( "v-1f",         0x2000, 0x2000, CRC(888f3474) SHA1(ddee56b2b49bd50aaf9c98d8ef6e905e3f6ab859) )
600   ROM_LOAD( "v-1j",         0x4000, 0x2000, CRC(7e864668) SHA1(8e275dbb1c586f4ebca7548db05246ef0f56d7b1) )
601   ROM_LOAD( "v-1k",         0x6000, 0x2000, CRC(49e1d170) SHA1(bd51a4e34ce8109f26954760156e3cf05fb9db57) )
598   ROM_LOAD( "tpp2-v.1e", 0x0000, 0x2000, CRC(0f2cd853) SHA1(426c9b4f6579bfcebe72b976bfe4f05147d53f96) )
599   ROM_LOAD( "tpp2-v.1f", 0x2000, 0x2000, CRC(888f3474) SHA1(ddee56b2b49bd50aaf9c98d8ef6e905e3f6ab859) )
600   ROM_LOAD( "tpp2-v.1j", 0x4000, 0x2000, CRC(7e864668) SHA1(8e275dbb1c586f4ebca7548db05246ef0f56d7b1) )
601   ROM_LOAD( "tpp2-v.1k", 0x6000, 0x2000, CRC(49e1d170) SHA1(bd51a4e34ce8109f26954760156e3cf05fb9db57) )
602602
603603   ROM_REGION( 0x0340, "proms", 0 )
604   ROM_LOAD( "prom-cpu.4a",  0x0000, 0x0020, CRC(375e1602) SHA1(d84159a0af5db577821c43712bc733329a43af80) ) /* background palette */
605   ROM_LOAD( "prom-cpu.3a",  0x0020, 0x0020, CRC(e950bea1) SHA1(0b48082fe79d9fcdca7e80caff1725713d0c3163) ) /* char palette */
606   ROM_LOAD( "prom-cpu.5b",  0x0040, 0x0100, CRC(c5826883) SHA1(f2c4d3473b3bfa55bffad003dc1fd79540e7e0d1) ) /* sprite palette - low 4 bits */
607   ROM_LOAD( "prom-cpu.5a",  0x0140, 0x0100, CRC(c576afba) SHA1(013c8e8db08a03c7ba156cfefa671d26155fe835) ) /* sprite palette - high 4 bits */
608   ROM_LOAD( "prom-vid.7j",  0x0240, 0x0100, CRC(a4655e2e) SHA1(2a620932fccb763c6c667278c0914f31b9f00ddf) ) /* timing for the protection ALU */
604   ROM_LOAD( "tpp2-c.4a", 0x0000, 0x0020, CRC(375e1602) SHA1(d84159a0af5db577821c43712bc733329a43af80) ) /* background palette */
605   ROM_LOAD( "tpp2-c.3a", 0x0020, 0x0020, CRC(e950bea1) SHA1(0b48082fe79d9fcdca7e80caff1725713d0c3163) ) /* char palette */
606   ROM_LOAD( "tpp2-c.5b", 0x0040, 0x0100, CRC(c5826883) SHA1(f2c4d3473b3bfa55bffad003dc1fd79540e7e0d1) ) /* sprite palette - low 4 bits */
607   ROM_LOAD( "tpp2-c.5a", 0x0140, 0x0100, CRC(c576afba) SHA1(013c8e8db08a03c7ba156cfefa671d26155fe835) ) /* sprite palette - high 4 bits */
608   ROM_LOAD( "tpp2-v.7j", 0x0240, 0x0100, CRC(a4655e2e) SHA1(2a620932fccb763c6c667278c0914f31b9f00ddf) ) /* timing for the protection ALU */
609609ROM_END
610610
611611ROM_START( popeyef )
612612   ROM_REGION( 0x10000, "main", 0 )
613   ROM_LOAD( "tpp2-c_f.7a",  0x0000, 0x2000, CRC(5fc5264d) SHA1(6c3d4df748c55293b6de58bd874a08f8164b878d) )
614   ROM_LOAD( "tpp2-c_f.7b",  0x2000, 0x2000, CRC(51de48e8) SHA1(7573931c6fcb53ee5ab9408906cd8eb2ba271c64) )
615   ROM_LOAD( "tpp2-c_f.7c",  0x4000, 0x2000, CRC(62df9647) SHA1(65d043b4142aa3ad2db7a1d4e1a2c22656ca7ade) )
616   ROM_LOAD( "tpp2-c_f.7e",  0x6000, 0x2000, CRC(f31e7916) SHA1(0f54ea7b1691b7789067fe880ffc56fac1d9523a) )
613   ROM_LOAD( "tpp2-c_f.7a", 0x0000, 0x2000, CRC(5fc5264d) SHA1(6c3d4df748c55293b6de58bd874a08f8164b878d) )
614   ROM_LOAD( "tpp2-c_f.7b", 0x2000, 0x2000, CRC(51de48e8) SHA1(7573931c6fcb53ee5ab9408906cd8eb2ba271c64) )
615   ROM_LOAD( "tpp2-c_f.7c", 0x4000, 0x2000, CRC(62df9647) SHA1(65d043b4142aa3ad2db7a1d4e1a2c22656ca7ade) )
616   ROM_LOAD( "tpp2-c_f.7e", 0x6000, 0x2000, CRC(f31e7916) SHA1(0f54ea7b1691b7789067fe880ffc56fac1d9523a) )
617617
618618   ROM_REGION( 0x0800, "gfx1", ROMREGION_DISPOSE )
619   ROM_LOAD( "v-5n",         0x0000, 0x0800, CRC(cca61ddd) SHA1(239f87947c3cc8c6693c295ebf5ea0b7638b781c) )   /* first half is empty */
620   ROM_CONTINUE(             0x0000, 0x0800 )
619   ROM_LOAD( "tpp2-v.5n",   0x0000, 0x0800, CRC(cca61ddd) SHA1(239f87947c3cc8c6693c295ebf5ea0b7638b781c) )   /* first half is empty */
620   ROM_CONTINUE(            0x0000, 0x0800 )
621621
622622   ROM_REGION( 0x8000, "gfx2", ROMREGION_DISPOSE )
623   ROM_LOAD( "v-1e",         0x0000, 0x2000, CRC(0f2cd853) SHA1(426c9b4f6579bfcebe72b976bfe4f05147d53f96) )
624   ROM_LOAD( "v-1f",         0x2000, 0x2000, CRC(888f3474) SHA1(ddee56b2b49bd50aaf9c98d8ef6e905e3f6ab859) )
625   ROM_LOAD( "v-1j",         0x4000, 0x2000, CRC(7e864668) SHA1(8e275dbb1c586f4ebca7548db05246ef0f56d7b1) )
626   ROM_LOAD( "v-1k",         0x6000, 0x2000, CRC(49e1d170) SHA1(bd51a4e34ce8109f26954760156e3cf05fb9db57) )
623   ROM_LOAD( "tpp2-v.1e",   0x0000, 0x2000, CRC(0f2cd853) SHA1(426c9b4f6579bfcebe72b976bfe4f05147d53f96) )
624   ROM_LOAD( "tpp2-v.1f",   0x2000, 0x2000, CRC(888f3474) SHA1(ddee56b2b49bd50aaf9c98d8ef6e905e3f6ab859) )
625   ROM_LOAD( "tpp2-v.1j",   0x4000, 0x2000, CRC(7e864668) SHA1(8e275dbb1c586f4ebca7548db05246ef0f56d7b1) )
626   ROM_LOAD( "tpp2-v.1k",   0x6000, 0x2000, CRC(49e1d170) SHA1(bd51a4e34ce8109f26954760156e3cf05fb9db57) )
627627
628628   ROM_REGION( 0x0340, "proms", 0 )
629   ROM_LOAD( "prom-cpu.4a",  0x0000, 0x0020, CRC(375e1602) SHA1(d84159a0af5db577821c43712bc733329a43af80) ) /* background palette */
630   ROM_LOAD( "prom-cpu.3a",  0x0020, 0x0020, CRC(e950bea1) SHA1(0b48082fe79d9fcdca7e80caff1725713d0c3163) ) /* char palette */
631   ROM_LOAD( "prom-cpu.5b",  0x0040, 0x0100, CRC(c5826883) SHA1(f2c4d3473b3bfa55bffad003dc1fd79540e7e0d1) ) /* sprite palette - low 4 bits */
632   ROM_LOAD( "prom-cpu.5a",  0x0140, 0x0100, CRC(c576afba) SHA1(013c8e8db08a03c7ba156cfefa671d26155fe835) ) /* sprite palette - high 4 bits */
633   ROM_LOAD( "prom-vid.7j",  0x0240, 0x0100, CRC(a4655e2e) SHA1(2a620932fccb763c6c667278c0914f31b9f00ddf) ) /* timing for the protection ALU */
629   ROM_LOAD( "tpp2-c.4a",   0x0000, 0x0020, CRC(375e1602) SHA1(d84159a0af5db577821c43712bc733329a43af80) ) /* background palette */
630   ROM_LOAD( "tpp2-c.3a",   0x0020, 0x0020, CRC(e950bea1) SHA1(0b48082fe79d9fcdca7e80caff1725713d0c3163) ) /* char palette */
631   ROM_LOAD( "tpp2-c.5b",   0x0040, 0x0100, CRC(c5826883) SHA1(f2c4d3473b3bfa55bffad003dc1fd79540e7e0d1) ) /* sprite palette - low 4 bits */
632   ROM_LOAD( "tpp2-c.5a",   0x0140, 0x0100, CRC(c576afba) SHA1(013c8e8db08a03c7ba156cfefa671d26155fe835) ) /* sprite palette - high 4 bits */
633   ROM_LOAD( "tpp2-v.7j",   0x0240, 0x0100, CRC(a4655e2e) SHA1(2a620932fccb763c6c667278c0914f31b9f00ddf) ) /* timing for the protection ALU */
634634ROM_END
635635
636636ROM_START( popeyebl )
r4057r4058
675675      memcpy(rom,buffer,len);
676676      free(buffer);
677677   }
678
679    state_save_register_global(machine, prot0);
680    state_save_register_global(machine, prot1);
681    state_save_register_global(machine, prot_shift);
678682}
679683
680684static DRIVER_INIT( popeye )
r4057r4058
692696      memcpy(rom,buffer,len);
693697      free(buffer);
694698   }
699
700    state_save_register_global(machine, prot0);
701    state_save_register_global(machine, prot1);
702    state_save_register_global(machine, prot_shift);
695703}
696704
697705
698GAME( 1981, skyskipr, 0,      skyskipr, skyskipr, skyskipr, ROT0, "Nintendo", "Sky Skipper", 0 )
699GAME( 1982, popeye,   0,      popeye,   popeye,   popeye,   ROT0, "Nintendo", "Popeye (revision D)", 0 )
700GAME( 1982, popeyeu,  popeye, popeye,   popeye,   popeye,   ROT0, "Nintendo", "Popeye (revision D not protected)", 0 )
701GAME( 1982, popeyef,  popeye, popeye,   popeyef,  popeye,   ROT0, "Nintendo", "Popeye (revision F)", 0 )
702GAME( 1982, popeyebl, popeye, popeyebl, popeye,   0,        ROT0, "bootleg",  "Popeye (bootleg)", 0 )
703
706GAME( 1981, skyskipr, 0,      skyskipr, skyskipr, skyskipr, ROT0, "Nintendo", "Sky Skipper", GAME_SUPPORTS_SAVE )
707GAME( 1982, popeye,   0,      popeye,   popeye,   popeye,   ROT0, "Nintendo", "Popeye (revision D)", GAME_SUPPORTS_SAVE )
708GAME( 1982, popeyeu,  popeye, popeye,   popeye,   popeye,   ROT0, "Nintendo", "Popeye (revision D not protected)", GAME_SUPPORTS_SAVE )
709GAME( 1982, popeyef,  popeye, popeye,   popeyef,  popeye,   ROT0, "Nintendo", "Popeye (revision F)", GAME_SUPPORTS_SAVE )
710GAME( 1982, popeyebl, popeye, popeyebl, popeye,   0,        ROT0, "bootleg",  "Popeye (bootleg)", GAME_SUPPORTS_SAVE )
src/mame/drivers/gstream.c
r4057r4058
200200static WRITE32_HANDLER( gstream_oki_0_w ) { okim6295_data_0_w(space, 0, data & 0xff); }
201201static WRITE32_HANDLER( gstream_oki_1_w ) { okim6295_data_1_w(space, 0, data & 0xff); }
202202
203static WRITE32_HANDLER( gstream_oki_4030_w )
203static WRITE32_HANDLER( gstream_oki_banking_w )
204204{
205/*
206    // the only nibbles that are written are: 0x6 0x7 0x9 0xa 0xb 0xe 0xd 0xf which should map to the 8 oki banks
205   /* OKI BANKING  (still far from perfect, based on game behaviour)
207206
208    static const int bank_lookup[16] = { -1, -1, -1, -1, -1, -1, 0, 1, -1, 2, 3, 4, -1, 5, 6, 7 };
207    The two okis can indifferently play music or samples and are switched on the fly during game
208    This is a preliminary table of the banks:
209209
210    static int old_bank_0 = -1;
211    static int old_bank_1 = -1;
210    BANK    MUSIC   SAMPLES
211     0         X
212     1    X
213     2    X
214     3    X
215     4         X
216     5    X
217     6    X
218     7    X
212219
213    if(bank_lookup[data & 0xf] != old_bank_0)
214    {
215        old_bank_0 = bank_lookup[data & 0xf];
220    Two nibbles are used in this handler: (data & 0xf) and ((data >> 4) & 0xf)
221    The values for the first nibble are the followings and should map the 8 oki banks:
222    - 0x6, 0x7, 0x9, 0xa, 0xb, 0xd, 0xe, 0xf
223    The values for the second nibble are the followings and should probably be used too:
224    - 0x6, 0x9, 0xa
216225
217        if(old_bank_0 != -1)
218            okim6295_set_bank_base(0, old_bank_0 * 0x40000);
219        else
220            logerror("oki_0 banking value = %X\n",data & 0xf);
221    }
226    Same values are redudant, for example:
227    level 2: data = 0x99
228    level 6: data = 0x99
229    (this means same background music for the two levels - it could be correct, though)
222230
223    if(bank_lookup[(data >> 4) & 0xf] != old_bank_1)
224    {
225        old_bank_1 = bank_lookup[(data >> 4) & 0xf];
231    Also with current implementation, using only (data & 0xf), we have to force some values
232    manually, because the correspondent places in the table are already used
226233
227        if(old_bank_1 != -1)
228            okim6295_set_bank_base(1, old_bank_1 * 0x40000);
229        else
230            logerror("oki_1 banking value = %X\n",(data >> 4) & 0xf);
231    }
232*/
234    Musics order is completely guessed but close to what the original PCB game should be */
235
236   static const int bank_table_0[16] = { -1, -1, -1, -1, -1, -1, 0, 0, -1, 6, 0, 5, -1, 0, 0, 0 };
237   static const int bank_table_1[16] = { -1, -1, -1, -1, -1, -1, 2, 2, -1, 0, 0, 4, -1, 1, 1, 1 };
238
239   static int bank_0 = 0;
240   static int bank_1 = 0;
241
242   //popmessage("oki_0 banking value = %X\noki_1 banking value = %X\n",data & 0xf,(data >> 4) & 0xf);
243
244   bank_0 = bank_table_0[data & 0xf];
245   bank_1 = bank_table_1[data & 0xf];      // (data >> 4) & 0xf ??
246
247   /* some values are already used in the table, so we force them manually */
248   if ((data == 0x6f) || (data == 0x6e))
249   {
250      bank_0 = 0;    // level 3b-5a samples
251      bank_1 = 6;      // level 3b-5a music
252   }
253
254   if (data == 0x9b)
255   {
256      bank_0 = 7;      // level 7 music
257      bank_1 = 0;      // level 7 samples
258   }
259
260   if (data == 0x9f)
261   {
262      bank_0 = 0;      // end sequence samples
263      bank_1 = 3;      // end sequence music
264   }
265
266   okim6295_set_bank_base(0, bank_0 * 0x40000);
267   okim6295_set_bank_base(1, bank_1 * 0x40000);
233268}
234269
235270static WRITE32_HANDLER( gstream_oki_4040_w )
r4057r4058
240275static ADDRESS_MAP_START( gstream_io, ADDRESS_SPACE_IO, 32 )
241276   AM_RANGE(0x4000, 0x4003) AM_READ_PORT("IN0")
242277   AM_RANGE(0x4010, 0x4013) AM_READ_PORT("IN1")
243   AM_RANGE(0x4020, 0x4023) AM_READ_PORT("IN2") // extra coin switches etc
244   AM_RANGE(0x4030, 0x4033) AM_WRITE(gstream_oki_4030_w) // ??
245   AM_RANGE(0x4040, 0x4043) AM_WRITE(gstream_oki_4040_w) // ??
246   AM_RANGE(0x4050, 0x4053) AM_READWRITE(gstream_oki_1_r, gstream_oki_1_w) // music
247   AM_RANGE(0x4060, 0x4063) AM_READWRITE(gstream_oki_0_r, gstream_oki_0_w) // samples
278   AM_RANGE(0x4020, 0x4023) AM_READ_PORT("IN2")    // extra coin switches etc
279   AM_RANGE(0x4030, 0x4033) AM_WRITE(gstream_oki_banking_w)    // oki banking
280   AM_RANGE(0x4040, 0x4043) AM_WRITE(gstream_oki_4040_w)    // ??
281   AM_RANGE(0x4050, 0x4053) AM_READWRITE(gstream_oki_1_r, gstream_oki_1_w)    // music and samples
282   AM_RANGE(0x4060, 0x4063) AM_READWRITE(gstream_oki_0_r, gstream_oki_0_w)    // music and samples
248283ADDRESS_MAP_END
249284
250285static INPUT_PORTS_START( gstream )
r4057r4058
434469   MDRV_SPEAKER_STANDARD_MONO("mono")
435470
436471   MDRV_SOUND_ADD("oki1", OKIM6295, 1000000) /* 1 Mhz? */
437   MDRV_SOUND_CONFIG(okim6295_interface_pin7low) // pin 7 not verified
438   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
472   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // pin 7 not verified
473   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
439474
440475   MDRV_SOUND_ADD("oki2", OKIM6295, 1000000) /* 1 Mhz? */
441   MDRV_SOUND_CONFIG(okim6295_interface_pin7low) // pin 7 not verified
442   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
476   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // pin 7 not verified
477   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
443478MACHINE_DRIVER_END
444479
445480ROM_START( gstream )
r4057r4058
481516{
482517   if (cpu_get_pc(space->cpu)==0xc0001592)
483518   {
484      cpu_eat_cycles(space->cpu, 50);
519      cpu_spinuntil_int(space->cpu);
485520   }
486521
487522   return gstream_workram[0xd1ee0/4];
r4057r4058
492527   memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd1ee0, 0xd1ee3, 0, 0, gstream_speedup_r );
493528
494529}
530
495531GAME( 2002, gstream, 0, gstream, gstream, gstream, ROT270, "Oriental Soft Japan", "G-Stream G2020", GAME_IMPERFECT_SOUND )
src/mame/drivers/4enraya.c
r4057r4058
155155   GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0, 8 )
156156GFXDECODE_END
157157
158static MACHINE_START( 4enraya )
159{
160    state_save_register_global(machine, soundlatch);
161}
158162
159163static MACHINE_DRIVER_START( 4enraya )
160164
r4057r4058
177181   MDRV_VIDEO_START(4enraya)
178182   MDRV_VIDEO_UPDATE(4enraya)
179183
184    MDRV_MACHINE_START(4enraya)
185
180186   /* sound hardware */
181187   MDRV_SPEAKER_STANDARD_MONO("mono")
182188   MDRV_SOUND_ADD("ay", AY8910, 8000000/4 /* guess */)
r4057r4058
203209   ROM_LOAD( "1.bpr",   0x0000, 0x0020, CRC(dcbd2352) SHA1(ce72e84129ed1b455aaf648e1dfaa4333e7e7628) )   /* not used */
204210ROM_END
205211
206GAME( 1990, 4enraya,  0,       4enraya,  4enraya,  0, ROT0, "IDSA", "4 En Raya", 0 )
212GAME( 1990, 4enraya,  0,       4enraya,  4enraya,  0, ROT0, "IDSA", "4 En Raya", GAME_SUPPORTS_SAVE )
src/mame/drivers/igs017.c
r0r4058
1/************************************************************************************************************
2
3                                          -= IGS017 Based Hardware =-
4
5                             driver by   Pierpaolo Prazzoli, Luca Elia (l.elia@tin.it)
6
7IGS017: 2 tilemaps, variable size sprites, protection.
8
9-------------------------------------------------------------------------------------------------------------
10Year + Game                      PCB        CPU      Sound         Custom                Other
11-------------------------------------------------------------------------------------------------------------
1296 Shu Zi Le Yuan                N0-0131-4  HD64180  M6295 YM2413  IGS017 8255           Battery
1397 Mahjong Tian Jiang Shen Bing  N0-0157-2  HD64180  M6295 YM2413  IGS017 IGS025         Battery
1498 Mahjong Man Guan Cai Shen     N0-0192-1  M68000   M6295         IGS017 IGS025 IGS029  Battery
15-------------------------------------------------------------------------------------------------------------
16
17To Do:
18
19- Protection emulation, instead of patching the roms.
20- tjsb: finish sprites decryption (data lines scrambling), protection, inputs.
21- iqblocka: NVRAM.
22- iqblockf: protection.
23
24Notes:
25
26- iqblocka: keep start or test pressed during boot to enter test mode A or B.
27
28************************************************************************************************************/
29
30#include "driver.h"
31#include "deprecat.h"
32#include "cpu/m68000/m68000.h"
33#include "cpu/z180/z180.h"
34#include "machine/8255ppi.h"
35#include "sound/2413intf.h"
36#include "sound/okim6295.h"
37
38/***************************************************************************
39                                Video Hardware
40***************************************************************************/
41
42static UINT8 *fg_videoram, *bg_videoram;
43static tilemap *fg_tilemap, *bg_tilemap;
44
45#define COLOR(_X)   (((_X)>>2))
46
47static TILE_GET_INFO( get_fg_tile_info )
48{
49   int code = fg_videoram[tile_index*4+0] + (fg_videoram[tile_index*4+1] << 8);
50   int attr = fg_videoram[tile_index*4+2] + (fg_videoram[tile_index*4+3] << 8);
51   SET_TILE_INFO(0, code, COLOR(attr), 0);
52}
53static TILE_GET_INFO( get_bg_tile_info )
54{
55   int code = bg_videoram[tile_index*4+0] + (bg_videoram[tile_index*4+1] << 8);
56   int attr = bg_videoram[tile_index*4+2] + (bg_videoram[tile_index*4+3] << 8);
57   SET_TILE_INFO(0, code, COLOR(attr)+8, 0);
58}
59
60static WRITE8_HANDLER( fg_w )
61{
62   fg_videoram[offset] = data;
63   tilemap_mark_tile_dirty(fg_tilemap,offset/4);
64}
65
66static WRITE8_HANDLER( bg_w )
67{
68   bg_videoram[offset] = data;
69   tilemap_mark_tile_dirty(bg_tilemap,offset/4);
70}
71
72// 16-bit handlers for an 8-bit chip
73
74static READ16_HANDLER( fg_lsb_r )
75{
76   return fg_videoram[offset];
77}
78static WRITE16_HANDLER( fg_lsb_w )
79{
80   if (ACCESSING_BITS_0_7)
81      fg_w(space,offset,data);
82}
83
84static READ16_HANDLER( bg_lsb_r )
85{
86   return bg_videoram[offset];
87}
88static WRITE16_HANDLER( bg_lsb_w )
89{
90   if (ACCESSING_BITS_0_7)
91      bg_w(space,offset,data);
92}
93
94static READ16_HANDLER( spriteram_lsb_r )
95{
96   return spriteram[offset];
97}
98static WRITE16_HANDLER( spriteram_lsb_w )
99{
100   if (ACCESSING_BITS_0_7)
101      spriteram[offset] = data;
102}
103
104
105static VIDEO_START( igs017 )
106{
107   fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
108   bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
109
110   tilemap_set_transparent_pen(fg_tilemap,0xf);
111   tilemap_set_transparent_pen(bg_tilemap,0xf);
112}
113
114
115static UINT8 *sprites_gfx;
116static int sprites_gfx_size;
117
118// Eeach 16 bit word in the sprites gfx roms contains three 5 bit pens: x-22222-11111-00000.
119// This routine expands each word into three bytes.
120static void expand_sprites(running_machine *machine)
121{
122   UINT8 *rom   =   memory_region(machine, "sprites");
123   int size   =   memory_region_length(machine, "sprites");
124   int i;
125
126   sprites_gfx_size   =   size / 2 * 3;
127   sprites_gfx         =   auto_malloc(sprites_gfx_size);
128
129   for (i = 0; i < size / 2 ; i++)
130   {
131      UINT16 pens = (rom[i*2+1] << 8) | rom[i*2];
132
133      sprites_gfx[i * 3 + 0] = (pens >>  0) & 0x1f;
134      sprites_gfx[i * 3 + 1] = (pens >>  5) & 0x1f;
135      sprites_gfx[i * 3 + 2] = (pens >> 10) & 0x1f;
136   }
137}
138
139/***************************************************************************
140                              Sprites Format
141
142    Offset:         Bits:               Value:
143
144        0.b                             Y (low)
145
146        1.b         7654 32--           Size Y (low)
147                    ---- --10           Y (high)
148
149        2.b         7654 3---           X (low)
150                    ---- -210           Size Y (high)
151
152        3.b         76-- ----           Size X (low)
153                    --5- ----
154                    ---4 3210           X (high)
155
156        4.b         76-- ----           Code (low)
157                    --54 3210           Size X (high)
158
159        5.b                             Code (mid low)
160
161        6.b                             Code (mid high)
162
163        7.b         765- ----           Color
164                    ---4 ----           Flip X
165                    ---- 3---
166                    ---- -210           Code (high)
167
168    Code = ROM Address / 2 = Pixel / 3
169
170***************************************************************************/
171
172static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
173{
174   // prepare GfxElement on the fly
175   gfx_element gfx;
176
177   gfx.machine = machine;
178   gfx.width = dimx;
179   gfx.height = dimy;
180   gfx.total_elements = 1;
181   gfx.color_depth = 32;
182   gfx.color_granularity = 32;
183   gfx.color_base = 0x100;
184   gfx.total_colors = 8;
185   gfx.pen_usage = NULL;
186   gfx.gfxdata = sprites_gfx + addr;
187   gfx.line_modulo = dimx;
188   gfx.char_modulo = 0;   // doesn't matter
189   gfx.flags = 0;
190
191   // Bounds checking
192   if ( addr + dimx * dimy >= sprites_gfx_size )
193      return;
194
195   drawgfx(   bitmap,&gfx,
196            0, color,
197            flipx, flipy,
198            sx, sy,
199            cliprect, TRANSPARENCY_PEN, 0x1f   );
200}
201
202static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
203{
204   UINT8 *s   =   spriteram;
205   UINT8 *end   =   spriteram + 0x800;
206
207   for ( ; s < end; s += 8 )
208   {
209      int   x,y, sx,sy, dimx,dimy, flipx,flipy, addr,color;
210
211      y      =   s[0] + (s[1] << 8);
212      x      =   s[2] + (s[3] << 8);
213      addr   =   (s[4] >> 6) | (s[5] << 2) | (s[6] << 10) | ((s[7] & 0x07) << 18);
214      addr   *=   3;
215
216      flipx   =   s[7] & 0x10;
217      flipy   =   0;
218
219      dimx   =   ((((s[4] & 0x3f)<<2) | ((s[3] & 0xc0)>>6))+1) * 3;
220      dimy   =   ((y >> 10) | ((x & 0x03)<<6))+1;
221
222      x      >>=   3;
223      sx      =   (x & 0x1ff) - (x & 0x200);
224      sy      =   (y & 0x1ff) - (y & 0x200);
225
226      color = (s[7] & 0xe0) >> 5;
227
228      draw_sprite(machine, bitmap, cliprect, sx, sy, dimx, dimy, flipx, flipy, color, addr);
229   }
230}
231
232// A simple gfx viewer (toggle with T)
233static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
234{
235#ifdef MAME_DEBUG
236   static int toggle = 0;
237   if (input_code_pressed_once(KEYCODE_T))   toggle = 1-toggle;
238   if (toggle)   {
239      static int a = 0, w = 512;
240      int h = 256;
241
242      if (input_code_pressed(KEYCODE_O))      w += 1;
243      if (input_code_pressed(KEYCODE_I))      w -= 1;
244
245      if (input_code_pressed(KEYCODE_U))      w += 8;
246      if (input_code_pressed(KEYCODE_Y))      w -= 8;
247
248      if (input_code_pressed(KEYCODE_RIGHT))   a += 1;
249      if (input_code_pressed(KEYCODE_LEFT))   a -= 1;
250
251      if (input_code_pressed(KEYCODE_DOWN))   a += w;
252      if (input_code_pressed(KEYCODE_UP))      a -= w;
253
254      if (input_code_pressed(KEYCODE_PGDN))   a += w * h;
255      if (input_code_pressed(KEYCODE_PGUP))   a -= w * h;
256
257      if (a < 0)      a = 0;
258      if (a > sprites_gfx_size)   a = sprites_gfx_size;
259
260      if (w <= 0)      w = 0;
261      if (w > 1024)   w = 1024;
262
263      bitmap_fill(bitmap,cliprect,0);
264
265      draw_sprite(machine, bitmap, cliprect, 0,0, w,h, 0,0, 0, a);
266
267      popmessage("a: %08X w: %03X p: %02X-%02x-%02x",a,w,sprites_gfx[a/3*3+0],sprites_gfx[a/3*3+1],sprites_gfx[a/3*3+2]);
268      osd_sleep(200000);
269      return 1;
270   }
271#endif
272   return 0;
273}
274
275static VIDEO_UPDATE( igs017 )
276{
277   int layers_ctrl = -1;
278
279#ifdef MAME_DEBUG
280   if (input_code_pressed(KEYCODE_Z))
281   {
282      int mask = 0;
283      if (input_code_pressed(KEYCODE_Q))   mask |= 1;
284      if (input_code_pressed(KEYCODE_W))   mask |= 2;
285      if (input_code_pressed(KEYCODE_A))   mask |= 4;
286      if (mask != 0) layers_ctrl &= mask;
287   }
288#endif
289
290   if (debug_viewer(screen->machine, bitmap,cliprect))
291      return 0;
292
293   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect,bg_tilemap,TILEMAP_DRAW_OPAQUE,0);
294   else               bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
295
296   if (layers_ctrl & 4)   draw_sprites(screen->machine,bitmap,cliprect);
297
298   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
299
300   return 0;
301}
302
303/***************************************************************************
304                                Decryption
305***************************************************************************/
306
307static void decrypt_program_rom(running_machine *machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
308{
309   int length = memory_region_length(machine, "main");
310   UINT8 *rom = memory_region(machine, "main");
311   UINT8 *tmp = auto_malloc(length);
312   int i;
313
314   // decrypt the program ROM
315
316   // XOR layer
317   for (i = 0;i < length;i++)
318   {
319      if(i & 0x2000)
320      {
321         if((i & mask) == mask)
322            rom[i] ^= 0x01;
323      }
324      else
325      {
326         if(i & 0x0100)
327         {
328            if((i & mask) == mask)
329               rom[i] ^= 0x01;
330         }
331         else
332         {
333            if(i & 0x0080)
334            {
335               if((i & mask) == mask)
336                  rom[i] ^= 0x01;
337            }
338            else
339            {
340               if((i & mask) != mask)
341                  rom[i] ^= 0x01;
342            }
343         }
344      }
345   }
346
347   memcpy(tmp,rom,length);
348
349   // address lines swap
350   for (i = 0;i < length;i++)
351   {
352      int addr = (i & ~0xff) | BITSWAP8(i,a7,a6,a5,a4,a3,a2,a1,a0);
353      rom[i] = tmp[addr];
354   }
355}
356
357
358// iqblocka
359
360static void iqblocka_patch_rom(running_machine *machine)
361{
362   UINT8 *rom = memory_region(machine, "main");
363
364//  rom[0x7b64] = 0xc9;
365
366   rom[0x010c7] = 0x18;
367
368   // CBEF bank 0a
369   rom[0x16bef] = 0x18;
370
371   // C1BD bank 24
372   rom[0x301bd] = 0x18;
373
374   // C21B bank 2e
375   rom[0x3a21b] = 0x18;
376
377   // DCA9 bank 2e
378   rom[0x3bca9] = 0x18;
379
380   // maybe
381//  rom[0x18893] = 0x18;
382//  rom[0x385b1] = 0x18;
383}
384
385static DRIVER_INIT( iqblocka )
386{
387   decrypt_program_rom(machine, 0x11, 7, 6, 5, 4, 3, 2, 1, 0);
388   iqblocka_patch_rom(machine);
389
390   expand_sprites(machine);
391}
392
393// iqblockf
394
395static DRIVER_INIT( iqblockf )
396{
397   decrypt_program_rom(machine, 0x11, 7, 6, 5, 4, 3, 2, 1, 0);
398//  iqblockf_patch_rom(machine);
399
400   expand_sprites(machine);
401}
402
403// tjsb
404
405static void tjsb_decrypt_sprites(running_machine *machine)
406{
407   int length = memory_region_length(machine, "sprites");
408   UINT8 *rom = memory_region(machine, "sprites");
409   UINT8 *tmp = auto_malloc(length);
410   int i;
411
412   // address lines swap (to do: collapse into one bitswap)
413   memcpy(tmp,rom,length);
414   for (i = 0;i < length;i++)
415   {
416      int addr = (i & ~0xff) | BITSWAP8(i,7,6,5,4,1,2,3,0);
417      rom[i] = tmp[addr];
418   }
419
420   memcpy(tmp,rom,length);
421   for (i = 0;i < length;i++)
422   {
423      int addr = (i & ~0xff) | BITSWAP8(i,7,6,5,2,4,3,1,0);
424      rom[i] = tmp[addr];
425   }
426
427   memcpy(tmp,rom,length);
428   for (i = 0;i < length;i++)
429   {
430      int addr = (i & ~0xff) | BITSWAP8(i,7,6,5,3,4,2,1,0);
431      rom[i] = BITSWAP8(tmp[addr],7,6,5,4,3,2,1,0);
432   }
433}
434
435static void tjsb_patch_rom(running_machine *machine)
436{
437   UINT8 *rom = memory_region(machine, "main");
438   rom[0x011df] = 0x18;
439}
440
441static DRIVER_INIT( tjsb )
442{
443   decrypt_program_rom(machine, 0x05, 7, 6, 3, 2, 5, 4, 1, 0);
444   tjsb_patch_rom(machine);
445
446   tjsb_decrypt_sprites(machine);
447   expand_sprites(machine);
448}
449
450// mgcs
451
452static void mgcs_decrypt_program_rom(running_machine *machine)
453{
454   int i;
455   UINT16 *src = (UINT16 *)memory_region(machine, "main");
456
457   int rom_size = 0x80000;
458
459   for (i=0; i<rom_size/2; i++)
460   {
461      UINT16 x = src[i];
462
463      /* bit 0 xor layer */
464
465      if( i & 0x20/2 )
466      {
467         if( i & 0x02/2 )
468         {
469            x ^= 0x0001;
470         }
471      }
472
473      if( !(i & 0x4000/2) )
474      {
475         if( !(i & 0x300/2) )
476         {
477            x ^= 0x0001;
478         }
479      }
480
481      /* bit 8 xor layer */
482
483      if( (i & 0x2000/2) || !(i & 0x80/2) )
484      {
485         if( i & 0x100/2 )
486         {
487            if( !(i & 0x20/2) || (i & 0x400/2) )
488            {
489               x ^= 0x0100;
490            }
491         }
492      }
493      else
494      {
495         x ^= 0x0100;
496      }
497
498      src[i] = x;
499   }
500}
501
502static void mgcs_decrypt_tiles(running_machine *machine)
503{
504   int length = memory_region_length(machine, "tilemaps");
505   UINT8 *rom = memory_region(machine, "tilemaps");
506   UINT8 *tmp = malloc_or_die(length);
507   int i;
508
509   memcpy(tmp,rom,length);
510   for (i = 0;i < length;i++)
511   {
512      int addr = (i & ~0xffff) | BITSWAP16(i,15,14,13,12,11,10,6,7,8,9,5,4,3,2,1,0);
513      rom[i] = tmp[addr];
514   }
515
516   free(tmp);
517}
518
519static void mgcs_flip_sprites(running_machine *machine)
520{
521   int length = memory_region_length(machine, "sprites");
522   UINT8 *rom = memory_region(machine, "sprites");
523   int i;
524
525   for (i = 0;i < length;i+=2)
526   {
527      UINT16 pixels = (rom[i+1] << 8) | rom[i+0];
528
529      // flip bits
530      pixels = BITSWAP16(pixels,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
531
532      // flip pixels
533      pixels = BITSWAP16(pixels,15, 0,1,2,3,4, 5,6,7,8,9, 10,11,12,13,14);
534
535      rom[i+0] = pixels;
536      rom[i+1] = pixels >> 8;
537   }
538}
539
540static void mgcs_patch_rom(running_machine *machine)
541{
542   UINT16 *rom = (UINT16 *)memory_region(machine, "main");
543
544   rom[0x4e036/2] = 0x6006;
545
546   // IGS029 reads the dips?
547   rom[0x4e00e/2] = 0x4e75;
548
549   rom[0x4dfce/2] = 0x6010;   // 04DFCE: 6610    bne $4dfe0
550   rom[0x20666/2] = 0x601e;   // 020666: 671E    beq $20686 (rom check)
551}
552
553static DRIVER_INIT( mgcs )
554{
555   mgcs_decrypt_program_rom(machine);
556   mgcs_patch_rom(machine);
557
558   mgcs_decrypt_tiles(machine);
559   mgcs_flip_sprites(machine);
560
561   expand_sprites(machine);
562}
563
564
565/***************************************************************************
566                                Memory Maps
567***************************************************************************/
568
569static ADDRESS_MAP_START( iqblocka_map, ADDRESS_SPACE_PROGRAM, 8 )
570   AM_RANGE( 0x00000, 0x0dfff ) AM_ROM
571   AM_RANGE( 0x0e000, 0x0efff ) AM_RAM
572   AM_RANGE( 0x0f000, 0x0ffff ) AM_RAM
573   AM_RANGE( 0x10000, 0x3ffff ) AM_ROM
574ADDRESS_MAP_END
575
576static int nmi_enable;
577static WRITE8_HANDLER( nmi_enable_w )
578{
579   nmi_enable = data & 1;
580   if (data & (~1))
581      logerror("PC %06X: nmi_enable = %02x\n",cpu_get_pc(space->cpu),data);
582}
583
584static int irq_enable;
585static WRITE8_HANDLER( irq_enable_w )
586{
587   irq_enable = data & 1;
588   if (data & (~1))
589      logerror("PC %06X: irq_enable = %02x\n",cpu_get_pc(space->cpu),data);
590}
591
592static UINT8 input_select;
593static WRITE8_HANDLER( input_select_w )
594{
595   input_select = data;
596}
597
598static READ8_HANDLER( input_r )
599{
600   switch (input_select)
601   {
602      case 0x00:   return input_port_read(space->machine, "PLAYER1");
603      case 0x01:   return input_port_read(space->machine, "PLAYER2");
604      case 0x02:   return input_port_read(space->machine, "COINS");
605
606      case 0x03:   return 01;
607
608      case 0x20:   return 0x49;
609      case 0x21:   return 0x47;
610      case 0x22:   return 0x53;
611
612      case 0x24:   return 0x41;
613      case 0x25:   return 0x41;
614      case 0x26:   return 0x7f;
615      case 0x27:   return 0x41;
616      case 0x28:   return 0x41;
617
618      case 0x2a:   return 0x3e;
619      case 0x2b:   return 0x41;
620      case 0x2c:   return 0x49;
621      case 0x2d:   return 0xf9;
622      case 0x2e:   return 0x0a;
623
624      case 0x30:   return 0x26;
625      case 0x31:   return 0x49;
626      case 0x32:   return 0x49;
627      case 0x33:   return 0x49;
628      case 0x34:   return 0x32;
629
630      default:
631         logerror("PC %06X: input %02x read\n",cpu_get_pc(space->cpu),input_select);
632         return 0xff;
633   }
634}
635
636static ADDRESS_MAP_START( iqblocka_io, ADDRESS_SPACE_IO, 8 )
637   AM_RANGE( 0x0000, 0x003f ) AM_RAM // internal regs
638
639   AM_RANGE( 0x1000, 0x17ff ) AM_RAM AM_BASE( &spriteram )
640   AM_RANGE( 0x1800, 0x1bff ) AM_READWRITE( SMH_RAM, paletteram_xRRRRRGGGGGBBBBB_le_w ) AM_BASE(&paletteram)
641   AM_RANGE( 0x1c00, 0x1fff ) AM_RAM
642
643//  AM_RANGE(0x200a, 0x200a) AM_WRITENOP
644
645   AM_RANGE( 0x2010, 0x2013 ) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
646
647   AM_RANGE( 0x2014, 0x2014 ) AM_WRITE( nmi_enable_w )
648   AM_RANGE( 0x2015, 0x2015 ) AM_WRITE( irq_enable_w )
649
650   AM_RANGE( 0x4000, 0x5fff ) AM_RAM_WRITE( fg_w ) AM_BASE( &fg_videoram )
651   AM_RANGE( 0x6000, 0x7fff ) AM_RAM_WRITE( bg_w ) AM_BASE( &bg_videoram )
652
653   AM_RANGE( 0x8000, 0x8000 ) AM_WRITE( input_select_w )
654   AM_RANGE( 0x8001, 0x8001 ) AM_READ ( input_r )
655
656   AM_RANGE( 0x9000, 0x9000 ) AM_READWRITE( okim6295_status_0_r, okim6295_data_0_w )
657
658   AM_RANGE( 0xa000, 0xa000 ) AM_READ_PORT( "BUTTONS" )
659
660   AM_RANGE( 0xb000, 0xb000 ) AM_WRITE( ym2413_register_port_0_w )
661   AM_RANGE( 0xb001, 0xb001 ) AM_WRITE( ym2413_data_port_0_w )
662ADDRESS_MAP_END
663
664
665// mgcs
666
667static UINT16 igs_magic[2];
668static UINT8 scramble_data;
669
670static WRITE16_HANDLER( mgcs_magic_w )
671{
672   COMBINE_DATA(&igs_magic[offset]);
673
674   if (offset == 0)
675      return;
676
677   switch(igs_magic[0])
678   {
679      case 0x00:
680         if (ACCESSING_BITS_0_7)
681         {
682            input_select = data & 0xff;
683         }
684
685         if ( input_select & ~0xfc )
686            logerror("%06x: warning, unknown bits written in input_select = %02x\n", cpu_get_pc(space->cpu), input_select);
687         break;
688
689      case 0x01:
690         if (ACCESSING_BITS_0_7)
691         {
692            scramble_data = data & 0xff;
693         }
694         break;
695
696      default:
697         logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(space->cpu), igs_magic[0], data);
698   }
699}
700
701static READ16_HANDLER( mgcs_magic_r )
702{
703   switch(igs_magic[0])
704   {
705      case 0x01:
706         return BITSWAP8(scramble_data, 4,5,6,7, 0,1,2,3);
707
708      default:
709         logerror("%06x: warning, reading with igs_magic = %02x\n", cpu_get_pc(space->cpu), igs_magic[0]);
710         break;
711   }
712
713   return 0xffff;
714}
715
716static READ8_DEVICE_HANDLER( mgcs_keys_r )
717{
718   if (~input_select & 0x08)   return input_port_read(device->machine, "KEY0");
719   if (~input_select & 0x10)   return input_port_read(device->machine, "KEY1");
720   if (~input_select & 0x20)   return input_port_read(device->machine, "KEY2");
721   if (~input_select & 0x40)   return input_port_read(device->machine, "KEY3");
722   if (~input_select & 0x80)   return input_port_read(device->machine, "KEY4");
723
724   logerror("%s: warning, reading key with input_select = %02x\n", cpuexec_describe_context(device->machine), input_select);
725   return 0xff;
726}
727
728static int irq1_enable;
729static WRITE16_HANDLER( irq1_enable_w )
730{
731   if (ACCESSING_BITS_0_7)
732      irq1_enable = data & 1;
733
734   if (data != 0 && data != 0xff)
735      logerror("PC %06X: irq1_enable = %04x\n",cpu_get_pc(space->cpu),data);
736}
737
738static int irq2_enable;
739static WRITE16_HANDLER( irq2_enable_w )
740{
741   if (ACCESSING_BITS_0_7)
742      irq2_enable = data & 1;
743
744   if (data != 0 && data != 0xff)
745      logerror("PC %06X: irq2_enable = %04x\n",cpu_get_pc(space->cpu),data);
746}
747
748static WRITE16_HANDLER( mgcs_paletteram_xRRRRRGGGGGBBBBB_w )
749{
750   int rgb;
751
752   COMBINE_DATA(&paletteram16[offset]);
753
754   rgb = ((paletteram16[offset/2*2+0] & 0xff) << 8) | (paletteram16[offset/2*2+1] & 0xff);
755
756   // bitswap
757   rgb = BITSWAP16(rgb,7,8,9,2,14,3,13,15,12,11,10,0,1,4,5,6);
758
759   palette_set_color_rgb(space->machine, offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
760}
761
762static READ16_DEVICE_HANDLER ( mgcs_ppi8255_r )   {   return ppi8255_r(device, offset);   }
763static WRITE16_DEVICE_HANDLER( mgcs_ppi8255_w )   {   if (ACCESSING_BITS_0_7)   ppi8255_w(device, offset, data);   }
764
765static ADDRESS_MAP_START( mgcs, ADDRESS_SPACE_PROGRAM, 16 )
766   AM_RANGE( 0x000000, 0x07ffff ) AM_ROM
767   AM_RANGE( 0x300000, 0x303fff ) AM_RAM
768
769   AM_RANGE( 0x49c000, 0x49c003 ) AM_WRITE( mgcs_magic_w )
770   AM_RANGE( 0x49c002, 0x49c003 ) AM_READ ( mgcs_magic_r )
771
772   AM_RANGE( 0xa02000, 0xa02fff ) AM_READWRITE( spriteram_lsb_r, spriteram_lsb_w ) AM_BASE( (UINT16**)&spriteram )
773   AM_RANGE( 0xa03000, 0xa037ff ) AM_RAM_WRITE( mgcs_paletteram_xRRRRRGGGGGBBBBB_w ) AM_BASE( &paletteram16 )
774
775   AM_RANGE( 0xa04020, 0xa04027 ) AM_DEVREADWRITE(PPI8255, "ppi8255", mgcs_ppi8255_r, mgcs_ppi8255_w)
776
777   AM_RANGE( 0xa04028, 0xa04029 ) AM_WRITE( irq2_enable_w )
778   AM_RANGE( 0xa0402a, 0xa0402b ) AM_WRITE( irq1_enable_w )
779
780   AM_RANGE( 0xa08000, 0xa0bfff ) AM_READWRITE( fg_lsb_r, fg_lsb_w ) AM_BASE( (UINT16**)&fg_videoram )
781   AM_RANGE( 0xa0c000, 0xa0ffff ) AM_READWRITE( bg_lsb_r, bg_lsb_w ) AM_BASE( (UINT16**)&bg_videoram )
782
783   // oki banking?
784   AM_RANGE( 0xa12000, 0xa12001 ) AM_READWRITE( okim6295_status_0_lsb_r, okim6295_data_0_lsb_w )
785ADDRESS_MAP_END
786
787
788/***************************************************************************
789                                Input Ports
790***************************************************************************/
791
792static INPUT_PORTS_START( iqblocka )
793
794   PORT_START("DSW0")   // IN0
795   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
796   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
797   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
798   PORT_DIPNAME( 0x02, 0x02, "Hold Mode" )
799   PORT_DIPSETTING(    0x02, "In Win" )
800   PORT_DIPSETTING(    0x00, "Always" )
801   PORT_DIPNAME( 0x04, 0x04, "Max Credit" )
802   PORT_DIPSETTING(    0x04, "4000" )
803   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
804   PORT_DIPNAME( 0x38, 0x38, "Cigarette Bet" )
805   PORT_DIPSETTING(    0x38, "1" )
806   PORT_DIPSETTING(    0x30, "10" )
807   PORT_DIPSETTING(    0x28, "20" )
808   PORT_DIPSETTING(    0x20, "50" )
809   PORT_DIPSETTING(    0x18, "80" )
810   PORT_DIPSETTING(    0x10, "100" )
811   PORT_DIPSETTING(    0x08, "120" )
812   PORT_DIPSETTING(    0x00, "150" )
813   PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" )
814   PORT_DIPSETTING(    0xc0, "1" )
815   PORT_DIPSETTING(    0x80, "10" )
816   PORT_DIPSETTING(    0x40, "20" )
817   PORT_DIPSETTING(    0x00, "50" )
818
819   PORT_START("DSW1")   // IN1
820   PORT_DIPNAME( 0x07, 0x07, "Key In" )
821   PORT_DIPSETTING(    0x07, "10" )
822   PORT_DIPSETTING(    0x06, "20" )
823   PORT_DIPSETTING(    0x05, "40" )
824   PORT_DIPSETTING(    0x04, "50" )
825   PORT_DIPSETTING(    0x03, "100" )
826   PORT_DIPSETTING(    0x02, "200" )
827   PORT_DIPSETTING(    0x01, "250" )
828   PORT_DIPSETTING(    0x00, "500" )
829   PORT_DIPNAME( 0x08, 0x08, "Key Out" )
830   PORT_DIPSETTING(    0x08, "10" )
831   PORT_DIPSETTING(    0x00, "100" )
832   PORT_DIPNAME( 0x10, 0x10, "Open Mode" )
833   PORT_DIPSETTING(    0x10, "Gaming" )
834   PORT_DIPSETTING(    0x00, "Amuse" )
835   PORT_DIPNAME( 0x20, 0x20, "Demo Game" )
836   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
837   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
838   PORT_DIPNAME( 0xc0, 0xc0, "Bonus Base" )
839   PORT_DIPSETTING(    0xc0, "100" )
840   PORT_DIPSETTING(    0x80, "200" )
841   PORT_DIPSETTING(    0x40, "300" )
842   PORT_DIPSETTING(    0x00, "400" )
843
844   PORT_START("DSW2")   // IN2
845   PORT_DIPNAME( 0x03, 0x03, "Win Up Pool" )
846   PORT_DIPSETTING(    0x03, "300" )
847   PORT_DIPSETTING(    0x02, "500" )
848   PORT_DIPSETTING(    0x01, "800" )
849   PORT_DIPSETTING(    0x00, "1000" )
850   PORT_DIPNAME( 0x0c, 0x0c, "Max Double Up" )
851   PORT_DIPSETTING(    0x0c, "20000" )
852   PORT_DIPSETTING(    0x08, "30000" )
853   PORT_DIPSETTING(    0x04, "40000" )
854   PORT_DIPSETTING(    0x00, "50000" )
855   PORT_DIPNAME( 0x10, 0x10, "Cards" )
856   PORT_DIPSETTING(    0x10, "A,J,Q,K" )
857   PORT_DIPSETTING(    0x00, "Number" )
858   PORT_DIPNAME( 0x20, 0x20, "Title Name" )
859   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
860   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
861   PORT_DIPNAME( 0x40, 0x40, "Double" )
862   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
863   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
864   PORT_DIPNAME( 0x80, 0x80, "CG Select" )
865   PORT_DIPSETTING(    0x80, DEF_STR( Low ) )
866   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
867
868   PORT_START("PLAYER1")
869   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1         )   PORT_NAME( "Start / Test" )   // keep pressed while booting
870   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    )
871   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  )
872   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  )
873   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
874   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_NAME( "Help / Big" )
875   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2        )
876   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN        )
877
878   PORT_START("PLAYER2")
879   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2         )   PORT_NAME( "Bet" )
880   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_PLAYER(2)
881   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_PLAYER(2)
882   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_PLAYER(2)
883   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
884   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1        ) PORT_PLAYER(2)
885   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2        ) PORT_PLAYER(2)
886   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN        )
887
888   PORT_START("COINS")
889   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1     ) PORT_IMPULSE(2)
890   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2     ) PORT_IMPULSE(2)
891   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN   )
892   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN   )
893   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN   )
894   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN   )
895   PORT_SERVICE_NO_TOGGLE( 0x40, IP_ACTIVE_LOW  )   // keep pressed while booting
896   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )   // this seems to toggle between videogame and gambling
897
898   PORT_START("BUTTONS")
899   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Small" )
900   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3   ) PORT_IMPULSE(2)   // coin error
901   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
902   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME( "Score -> Time" )   // converts score into time
903   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
904   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
905   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
906   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
907
908INPUT_PORTS_END
909
910static INPUT_PORTS_START( mgcs )
911
912   // DSWs don't work: they are read through a protection device (IGS029? see code at 1CF16)
913
914   PORT_START("DSW1")
915   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )
916   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
917   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
918   PORT_DIPSETTING(    0x01, DEF_STR( 1C_3C ) )
919   PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )
920   PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" )
921   PORT_DIPSETTING(    0x0c, "10" )
922   PORT_DIPSETTING(    0x08, "20" )
923   PORT_DIPSETTING(    0x04, "50" )
924   PORT_DIPSETTING(    0x00, "100" )
925   PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" )
926   PORT_DIPSETTING(    0x10, "500" )
927   PORT_DIPSETTING(    0x00, "1000" )
928   PORT_DIPNAME( 0x20, 0x20, "Money Type" )
929   PORT_DIPSETTING(    0x20, "Coins" )
930   PORT_DIPSETTING(    0x00, "Notes" )
931   PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" )
932   PORT_DIPSETTING(    0x40, "Coins" )
933   PORT_DIPSETTING(    0x00, "Notes" )
934   PORT_DIPNAME( 0x80, 0x80, "Double Up Limit" )
935   PORT_DIPSETTING(    0x80, "1000" )
936   PORT_DIPSETTING(    0x00, "2000" )
937
938   PORT_START("DSW2")
939   PORT_DIPNAME( 0x03, 0x03, "Min Bet" )
940   PORT_DIPSETTING(    0x03, "1" )
941   PORT_DIPSETTING(    0x02, "2" )
942   PORT_DIPSETTING(    0x01, "3" )
943   PORT_DIPSETTING(    0x00, "5" )
944   PORT_DIPNAME( 0x04, 0x04, "Double Up" )
945   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
946   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
947   PORT_DIPNAME( 0x10, 0x10, "Double Up Type" )
948   PORT_DIPSETTING(    0x10, "Double" )
949   PORT_DIPSETTING(    0x00, DEF_STR( Single ) )
950   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Controls ) )
951   PORT_DIPSETTING(    0x20, "Keyboard" )
952   PORT_DIPSETTING(    0x00, DEF_STR( Joystick ) )
953   PORT_DIPNAME( 0x40, 0x40, "Number Type" )
954   PORT_DIPSETTING(    0x40, "Number" )
955   PORT_DIPSETTING(    0x00, "Tile" )
956   PORT_DIPNAME( 0x80, 0x80, "Bet Number" )
957   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
958   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
959
960   // the top 2 bits of COINS and KEYx are read and combined (see code at 1C83A)
961
962   PORT_START("COINS")
963   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ? (shown in service mode)
964   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // service mode (keep pressed during boot too)
965   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics")   // press with the above for sound test
966   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1    ) PORT_IMPULSE(5)
967   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER    ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O)
968   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE3 ) // ? (shown in service mode)
969   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN  )
970   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
971
972   PORT_START("KEY0")
973   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
974   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
975   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
976   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
977   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
978   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
979   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
980   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
981
982   PORT_START("KEY1")
983   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
984   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
985   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
986   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
987   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
988   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
989   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
990   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
991
992   PORT_START("KEY2")
993   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
994   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
995   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
996   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
997   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
998   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
999   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1000   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1001
1002   PORT_START("KEY3")
1003   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
1004   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
1005   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
1006   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
1007   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
1008   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
1009   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1010   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1011
1012   PORT_START("KEY4")
1013   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
1014   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE )
1015   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )
1016   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1017   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG )
1018   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL )
1019   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1020   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1021
1022INPUT_PORTS_END
1023
1024
1025/***************************************************************************
1026                                Graphics Layout
1027***************************************************************************/
1028
1029static const gfx_layout layout_8x8x4 =
1030{
1031   8,8,
1032   RGN_FRAC(1,1),
1033   4,
1034   { 8*3,8*2,8*1,8*0 },
1035   { STEP8(0, 1) },
1036   { STEP8(0, 8*4) },
1037   8*8*4
1038};
1039
1040static const gfx_layout layout_8x8x4_flipped =
1041{
1042   8,8,
1043   RGN_FRAC(1,1),
1044   4,
1045   { 8*2,8*3,8*0,8*1 },
1046   { STEP8(7, -1) },
1047   { STEP8(0, 8*4) },
1048   8*8*4
1049};
1050
1051static GFXDECODE_START( igs017_flipped )
1052   GFXDECODE_ENTRY( "tilemaps", 0, layout_8x8x4_flipped, 0, 16 )
1053GFXDECODE_END
1054
1055static GFXDECODE_START( igs017 )
1056   GFXDECODE_ENTRY( "tilemaps", 0, layout_8x8x4, 0, 16 )
1057GFXDECODE_END
1058
1059
1060/***************************************************************************
1061                                Machine Drivers
1062***************************************************************************/
1063
1064static INTERRUPT_GEN( iqblocka_interrupt )
1065{
1066   if (cpu_getiloops(device) & 1)
1067   {
1068       if (nmi_enable)
1069         cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
1070   }
1071   else
1072   {
1073       if (irq_enable)
1074         cpu_set_input_line(device, 0, HOLD_LINE);
1075   }
1076}
1077
1078// Dips are read through the 8255
1079static const ppi8255_interface iqblocka_ppi8255_intf =
1080{
1081   DEVICE8_PORT("DSW0"),   // Port A read
1082   DEVICE8_PORT("DSW1"),   // Port B read
1083   DEVICE8_PORT("DSW2"),   // Port C read
1084
1085   0,                  // Port A write
1086   0,                  // Port B write
1087   0,                  // Port C write
1088};
1089
1090static MACHINE_RESET( iqblocka )
1091{
1092   nmi_enable = 0;
1093   irq_enable = 0;
1094}
1095
1096static MACHINE_DRIVER_START( iqblocka )
1097
1098   /* basic machine hardware */
1099   MDRV_CPU_ADD("main", Z180, XTAL_16MHz / 2)
1100   MDRV_CPU_PROGRAM_MAP(iqblocka_map,0)
1101   MDRV_CPU_IO_MAP(iqblocka_io,0)
1102   MDRV_CPU_VBLANK_INT_HACK(iqblocka_interrupt,2)
1103
1104   MDRV_PPI8255_ADD( "ppi8255", iqblocka_ppi8255_intf )
1105
1106   MDRV_MACHINE_RESET(iqblocka)
1107
1108   /* video hardware */
1109   MDRV_SCREEN_ADD("main", RASTER)
1110   MDRV_SCREEN_REFRESH_RATE(60)
1111   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1112   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1113   MDRV_SCREEN_SIZE(512, 256)
1114   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 240-1)
1115
1116   MDRV_GFXDECODE(igs017)
1117   MDRV_PALETTE_LENGTH(0x100*2)
1118
1119   MDRV_VIDEO_START(igs017)
1120   MDRV_VIDEO_UPDATE(igs017)
1121
1122   /* sound hardware */
1123   MDRV_SPEAKER_STANDARD_MONO("mono")
1124   MDRV_SOUND_ADD("ym", YM2413, XTAL_3_579545MHz)
1125   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
1126
1127   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_16MHz / 16)
1128   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
1129   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
1130MACHINE_DRIVER_END
1131
1132
1133
1134// mgcs
1135
1136static INTERRUPT_GEN( mgcs_interrupt )
1137{
1138   if (cpu_getiloops(device) & 1)
1139   {
1140       if (irq2_enable)
1141         cpu_set_input_line(device, 2, HOLD_LINE);
1142   }
1143   else
1144   {
1145       if (irq1_enable)
1146         cpu_set_input_line(device, 1, HOLD_LINE);
1147   }
1148}
1149
1150static MACHINE_RESET( mgcs )
1151{
1152   irq1_enable = 0;
1153   irq2_enable = 0;
1154}
1155
1156static const ppi8255_interface mgcs_ppi8255_intf =
1157{
1158   DEVICE8_PORT("COINS"),   // Port A read
1159   mgcs_keys_r,         // Port B read
1160   0,                  // Port C read (see code at 1C83A)
1161
1162   0,                  // Port A write
1163   0,                  // Port B write
1164   0,                  // Port C write (with 0/1)
1165};
1166
1167static MACHINE_DRIVER_START( mgcs )
1168   MDRV_CPU_ADD("main", M68000, XTAL_22MHz / 2)
1169   MDRV_CPU_PROGRAM_MAP(mgcs,0)
1170   MDRV_CPU_VBLANK_INT_HACK(mgcs_interrupt,2)
1171
1172   MDRV_MACHINE_RESET(mgcs)
1173
1174   MDRV_PPI8255_ADD( "ppi8255", mgcs_ppi8255_intf )
1175
1176   /* video hardware */
1177   MDRV_SCREEN_ADD("main", RASTER)
1178   MDRV_SCREEN_REFRESH_RATE(60)
1179   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1180   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1181   MDRV_SCREEN_SIZE(512, 256)
1182   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 240-1)
1183
1184   MDRV_GFXDECODE(igs017_flipped)
1185   MDRV_PALETTE_LENGTH(0x100*2)
1186
1187   MDRV_VIDEO_START(igs017)
1188   MDRV_VIDEO_UPDATE(igs017)
1189
1190   /* sound hardware */
1191   MDRV_SPEAKER_STANDARD_MONO("mono")
1192   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_8MHz / 8)
1193   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
1194   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
1195MACHINE_DRIVER_END
1196
1197
1198/***************************************************************************
1199                                ROMs Loading
1200***************************************************************************/
1201
1202/*
1203
1204IQ Block (alt hardware)
1205IGS, 1996
1206
1207PCB Layout
1208----------
1209
1210IGS PCB N0- 0131-4
1211|---------------------------------------|
1212|uPD1242H     VOL    U3567   3.579545MHz|
1213|                               AR17961 |
1214|   HD64180RP8                          |
1215|  16MHz                         BATTERY|
1216|                                       |
1217|                         SPEECH.U17    |
1218|                                       |
1219|J                        6264          |
1220|A                                      |
1221|M      8255              V.U18         |
1222|M                                      |
1223|A                                      |
1224|                                       |
1225|                                       |
1226|                      |-------|        |
1227|                      |       |        |
1228|       CG.U7          |IGS017 |        |
1229|                      |       |        |
1230|       TEXT.U8        |-------|   PAL  |
1231|            22MHz               61256  |
1232|                   DSW1  DSW2  DSW3    |
1233|---------------------------------------|
1234Notes:
1235      HD64180RP8 - Hitachi HD64180 CPU. Clocks 16MHz (pins 2 & 3), 8MHz (pin 64)
1236      61256   - 32k x8 SRAM (DIP28)
1237      6264    - 8k x8 SRAM (DIP28)
1238      IGS017  - Custom IGS IC (QFP208)
1239      AR17961 - == Oki M6295 (QFP44). Clock 1.000MHz [16/16]. pin 7 = high
1240      U3567   - == YM2413. Clock 3.579545MHz
1241      VSync   - 60Hz
1242      HSync   - 15.31kHz
1243
1244*/
1245
1246ROM_START( iqblocka )
1247   ROM_REGION( 0x40000, "main", 0 )
1248   ROM_LOAD( "v.u18", 0x00000, 0x40000, CRC(2e2b7d43) SHA1(cc73f4c8f9a6e2219ee04c9910725558a80b4eb2) )
1249
1250   ROM_REGION( 0x80000, "sprites", ROMREGION_DISPOSE )
1251   ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) )   // FIXED BITS (xxxxxxxx0xxxxxxx)
1252
1253   ROM_REGION( 0x80000, "tilemaps", ROMREGION_DISPOSE)
1254   ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) )
1255
1256   ROM_REGION( 0x40000, "oki", 0 )
1257   ROM_LOAD( "speech.u17", 0x00000, 0x40000, CRC(d9e3d39f) SHA1(bec85d1ac2dfca77453cbca0e7dd53fee8fb438b) )
1258ROM_END
1259
1260ROM_START( iqblockf )
1261   ROM_REGION( 0x40000, "main", 0 )
1262   ROM_LOAD( "v113fr.u18", 0x00000, 0x40000, CRC(346c68af) SHA1(ceae4c0143c288dc9c1dd1e8a51f1e3371ffa439) )
1263
1264   ROM_REGION( 0x80000, "sprites", ROMREGION_DISPOSE )
1265   ROM_LOAD( "cg.u7", 0x000000, 0x080000, CRC(cb48a66e) SHA1(6d597193d1333a97957d5ceec8179a24bedfd928) )   // FIXED BITS (xxxxxxxx0xxxxxxx)
1266
1267   ROM_REGION( 0x80000, "tilemaps", ROMREGION_DISPOSE )
1268   ROM_LOAD( "text.u8", 0x000000, 0x080000, CRC(48c4f4e6) SHA1(b1e1ca62cf6a99c11a5cc56705eef7e22a3b2740) )
1269
1270   ROM_REGION( 0x40000, "oki", 0 )
1271   ROM_LOAD( "sp.u17", 0x00000, 0x40000, CRC(71357845) SHA1(25f4f7aebdcc0706018f041d3696322df569b0a3) )
1272ROM_END
1273
1274/*
1275
1276Mahjong Tian Jiang Shen Bing
1277IGS, 1997
1278
1279This PCB is almost the same as IQBlock (IGS, 1996)
1280but the 8255 has been replaced with the IGS025 IC
1281
1282PCB Layout
1283----------
1284
1285IGS PCB N0- 0157-2
1286|---------------------------------------|
1287|uPD1242H     VOL    U3567   3.579545MHz|
1288|                         AR17961       |
1289|   HD64180RP8                   SPDT_SW|
1290|  16MHz                         BATTERY|
1291|                                       |
1292|                         S0703.U15     |
1293|                                       |
1294|J     |-------|          6264          |
1295|A     |       |                        |
1296|M     |IGS025 |          P0700.U16     |
1297|M     |       |                        |
1298|A     |-------|                        |
1299|                                       |
1300|                                       |
1301|                      |-------|        |
1302|                      |       |   PAL  |
1303|       A0701.U3       |IGS017 |        |
1304|                      |       |   PAL  |
1305|       TEXT.U6        |-------|        |
1306|            22MHz               61256  |
1307|                   DSW1  DSW2  DSW3    |
1308|---------------------------------------|
1309Notes:
1310      HD64180RP8 - Hitachi HD64180 CPU. Clocks 16MHz (pins 2 & 3), 8MHz (pin 64)
1311      61256   - 32k x8 SRAM (DIP28)
1312      6264    - 8k x8 SRAM (DIP28)
1313      IGS017  - Custom IGS IC (QFP208)
1314      IGS025  - Custom IGS IC (PLCC68)
1315      AR17961 - == Oki M6295 (QFP44). Clock 1.000MHz [16/16]. pin 7 = high
1316      U3567   - == YM2413. Clock 3.579545MHz
1317      VSync   - 60Hz
1318      HSync   - 15.30kHz
1319
1320*/
1321
1322ROM_START( tjsb )
1323   ROM_REGION( 0x40000, "main", 0 )
1324   ROM_LOAD( "p0700.u16", 0x00000, 0x40000,CRC(1b2a50df) SHA1(95a272e624f727df9523667864f933118d9e633c) )
1325
1326   ROM_REGION( 0x200000, "sprites", ROMREGION_DISPOSE )
1327   ROM_LOAD( "a0701.u3", 0x000000, 0x200000, CRC(aa182140) SHA1(37c2053386c183ff726ba417d13f2063cf9a22df) )   // FIXED BITS (xxxxxxxx0xxxxxxx)
1328
1329   ROM_REGION( 0x80000, "tilemaps", ROMREGION_DISPOSE )
1330   ROM_LOAD( "text.u6", 0x00000, 0x80000,  CRC(3be886b8) SHA1(15b3624ed076640c1828d065b01306a8656f5a9b) )   // BADADDR     --xxxxxxxxxxxxxxxxx
1331
1332   ROM_REGION( 0x80000, "oki", 0 )
1333   ROM_LOAD( "s0703.u15", 0x00000, 0x80000,  CRC(c6f94d29) SHA1(ec413580240711fc4977dd3c96c288501aa7ef6c) )
1334ROM_END
1335
1336/*
1337
1338Mahjong Man Guan Cai Shen
1339IGS, 1998
1340
1341
1342PCB Layout
1343----------
1344
1345IGS PCB NO-0192-1
1346|---------------------------------------|
1347|              JAMMA            UPC1242 |
1348|                                       |
1349|               S1502.U10               |
1350|                          K668    VOL  |
1351|                                       |
1352|                                       |
1353|                       22MHz           |
1354|1     61256                            |
1355|8              |-------|      TEXT.U25 |
1356|W     PAL      |       |               |
1357|A              |IGS017 |               |
1358|Y              |       |      M1501.U23|
1359|               |-------|               |
1360|   |-------|                           |
1361|   |       |                           |
1362|   |IGS025 |   P1500.U8                |
1363|   |       |              PAL    6264  |
1364|1  |-------|                           |
1365|0  |----|                 PAL    6264  |
1366|W  |IGS |                 PAL          |
1367|A  |029 |  8MHz                 SPDT_SW|
1368|Y  |----|                 68000        |
1369|T DSW1  DSW2                   BATTERY |
1370|---------------------------------------|
1371Notes:
1372      Uses JAMMA & common 10-way/18-way Mahjong pinout
1373      68000 clock 11.000MHz [22/2]
1374      K668  == Oki M6295 (QFP44). Clock 1MHz [8/8]. pin7 = High
1375      VSync - 60Hz
1376      HSync - 15.3kHz
1377
1378*/
1379
1380ROM_START( mgcs )
1381   ROM_REGION( 0x80000, "main", 0 )
1382   ROM_LOAD16_WORD_SWAP( "p1500.u8", 0x00000, 0x80000, CRC(a8cb5905) SHA1(37be7d926a1352869632d43943763accd4dec4b7) )
1383
1384   ROM_REGION( 0x400000, "sprites", ROMREGION_DISPOSE )
1385   ROM_LOAD( "m1501.u23", 0x000000, 0x400000, CRC(96fce058) SHA1(6b87f47d646bad9b3061bdc8a9af65467fdbbc9f) )   // FIXED BITS (xxxxxxx0xxxxxxxx)
1386
1387   ROM_REGION( 0x80000, "tilemaps", ROMREGION_DISPOSE )
1388   ROM_LOAD( "text.u25", 0x00000, 0x80000, CRC(a37f9613) SHA1(812f060ca98a34540c48a180c359c3d0f1c0b5bb) )
1389
1390   ROM_REGION( 0x80000, "oki", 0 )
1391   ROM_LOAD( "s1502.u10", 0x00000, 0x80000, CRC(a8a6ba58) SHA1(59276a8ab4a31812600816c2a43b74bd71394419) )
1392ROM_END
1393
1394GAME( 1996, iqblocka, iqblock, iqblocka, iqblocka, iqblocka, ROT0, "IGS", "Shu Zi Le Yuan (V127M)",             GAME_NOT_WORKING )
1395GAME( 1996, iqblockf, iqblock, iqblocka, iqblocka, iqblockf, ROT0, "IGS", "Shu Zi Le Yuan (V113FR)",            GAME_NOT_WORKING )
1396GAME( 1997, tjsb,     0,       iqblocka, iqblocka, tjsb,     ROT0, "IGS", "Mahjong Tian Jiang Shen Bing",       GAME_NOT_WORKING )
1397GAME( 1998, mgcs,     0,       mgcs,     mgcs,     mgcs,     ROT0, "IGS", "Mahjong Man Guan Cai Shen (V103CS)", GAME_NOT_WORKING )
src/mame/drivers/tmnt.c
r4057r4058
37873787
37883788ROM_START( thndrx2 )
37893789   ROM_REGION( 0x40000, "main", 0 ) /* 2*32k for 68000 code */
3790   ROM_LOAD16_BYTE( "073-k02.11c", 0x000000, 0x20000, CRC(0c8b2d3f) SHA1(44ca5d96d8f85ae2760df4e1c339916e0a76143f) )
3791   ROM_LOAD16_BYTE( "073-k03.12c", 0x000001, 0x20000, CRC(3803b427) SHA1(95b755c70ac55af604c6b44bc41b761efce19f48) )
3790   ROM_LOAD16_BYTE( "073-ea-l02.11c", 0x000000, 0x20000, CRC(eae02b51) SHA1(ac513919b183d5353792418e6190c484c5cf1bcd) )
3791   ROM_LOAD16_BYTE( "073-ea-l03.12c", 0x000001, 0x20000, CRC(738ed007) SHA1(4539fd37ca9d7b25ee3b79c428c8f6c3be484bdf) )
37923792
37933793   ROM_REGION( 0x10000, "audio", 0 )
37943794   ROM_LOAD( "073-c01.4f",   0x0000, 0x10000, CRC(44ebe83c) SHA1(9274df6affa4f0456d273ff3aa1bda7d2a20416e) )
r4057r4058
38073807
38083808ROM_START( thndrx2a )
38093809   ROM_REGION( 0x40000, "main", 0 ) /* 2*32k for 68000 code */
3810   ROM_LOAD16_BYTE( "073-m02.11c", 0x000000, 0x20000, CRC(5b5b4cc0) SHA1(9f67169fba4523e2893e5ecf17b1be8cdedba83e) )
3811   ROM_LOAD16_BYTE( "073-m03.12c", 0x000001, 0x20000, CRC(320435a8) SHA1(5f656867049b614b0834ef6d8e36fe86118ea1cf) )
3810   ROM_LOAD16_BYTE( "073-aa-m02.11c", 0x000000, 0x20000, CRC(5b5b4cc0) SHA1(9f67169fba4523e2893e5ecf17b1be8cdedba83e) )
3811   ROM_LOAD16_BYTE( "073-aa-m03.12c", 0x000001, 0x20000, CRC(320435a8) SHA1(5f656867049b614b0834ef6d8e36fe86118ea1cf) )
38123812
38133813   ROM_REGION( 0x10000, "audio", 0 )
38143814   ROM_LOAD( "073-c01.4f",   0x0000, 0x10000, CRC(44ebe83c) SHA1(9274df6affa4f0456d273ff3aa1bda7d2a20416e) )
r4057r4058
38253825   ROM_LOAD( "073-b04.2d",   0x0000, 0x80000, CRC(05287a0b) SHA1(10784b8be6a93a5ebf22a884f99c116e51ae8743) )
38263826ROM_END
38273827
3828ROM_START( thndrx2j )
3829   ROM_REGION( 0x40000, "main", 0 ) /* 2*32k for 68000 code */
3830   ROM_LOAD16_BYTE( "073-ja-k02.11c", 0x000000, 0x20000, CRC(0c8b2d3f) SHA1(44ca5d96d8f85ae2760df4e1c339916e0a76143f) )
3831   ROM_LOAD16_BYTE( "073-ja-k03.12c", 0x000001, 0x20000, CRC(3803b427) SHA1(95b755c70ac55af604c6b44bc41b761efce19f48) )
38283832
3833   ROM_REGION( 0x10000, "audio", 0 )
3834   ROM_LOAD( "073-c01.4f",   0x0000, 0x10000, CRC(44ebe83c) SHA1(9274df6affa4f0456d273ff3aa1bda7d2a20416e) )
3835
3836   ROM_REGION( 0x100000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
3837   ROM_LOAD( "073-c06.16k",  0x000000, 0x080000, CRC(24e22b42) SHA1(7e5e14495bd4adbe5d1cbec75262c9c4c83f5793) )   /* tiles */
3838   ROM_LOAD( "073-c05.12k",  0x080000, 0x080000, CRC(952a935f) SHA1(87ed81616a243d679f7501db7acdd8b6617f85a3) )
3839
3840   ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
3841   ROM_LOAD( "073-c07.7k",   0x000000, 0x080000, CRC(14e93f38) SHA1(bf111b68be722c9c2f0f9c7700b3af6cd8fd28be) )   /* sprites */
3842   ROM_LOAD( "073-c08.3k",   0x080000, 0x080000, CRC(09fab3ab) SHA1(af54c7bfe8edc5b5ea2c4fba4d5c637cfcbbeff5) )
3843
3844   ROM_REGION( 0x80000, "konami", 0 )   /* samples for the 053260 */
3845   ROM_LOAD( "073-b04.2d",   0x0000, 0x80000, CRC(05287a0b) SHA1(10784b8be6a93a5ebf22a884f99c116e51ae8743) )
3846ROM_END
3847
38293848ROM_START( prmrsocr )
38303849   ROM_REGION( 0x80000, "main", 0 ) /* 2*256k for 68000 code */
38313850   ROM_LOAD16_BYTE( "101eab08.1h", 0x000000, 0x40000, CRC(47208de6) SHA1(fe4ef56688d4a50f67a604357e7beea785106cd1) ) // 3.bin
r4057r4058
41804199GAME( 1991, ssrdrjbd, ssriders, ssriders, ssriders, gfx,      ROT0,  "Konami", "Sunset Riders (2 Players ver JBD)", GAME_IMPERFECT_GRAPHICS )
41814200GAME( 1991, sunsetbl, ssriders, sunsetbl, sunsetbl, gfx,      ROT0,  "Konami", "Sunset Riders (bootleg 4 Players ver ADD)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS )
41824201
4183GAME( 1991, thndrx2,  0,        thndrx2,  thndrx2,  gfx,      ROT0,  "Konami", "Thunder Cross II (Japan)", 0 )
4202GAME( 1991, thndrx2,  0,        thndrx2,  thndrx2,  gfx,      ROT0,  "Konami", "Thunder Cross II (World)", 0 )
41844203GAME( 1991, thndrx2a, thndrx2,  thndrx2,  thndrx2,  gfx,      ROT0,  "Konami", "Thunder Cross II (Asia)", 0 )
4204GAME( 1991, thndrx2j, thndrx2,  thndrx2,  thndrx2,  gfx,      ROT0,  "Konami", "Thunder Cross II (Japan)", 0 )
41854205
41864206GAME( 1993, prmrsocr, 0,        prmrsocr, prmrsocr, glfgreat, ROT0,  "Konami", "Premier Soccer (ver EAB)", 0 )
41874207GAME( 1993, prmrsocj, prmrsocr, prmrsocr, prmrsocr, glfgreat, ROT0,  "Konami", "Premier Soccer (ver JAB)", 0 )
src/mame/drivers/namcos12.c
r4057r4058
10101010   }
10111011   if( ACCESSING_BITS_16_31 )
10121012   {
1013      m_n_dmaoffset = ( ( offset + 2 ) * 4 ) | ( data & 0xffff0000 );
1013      m_n_dmaoffset = ( ( offset * 4 ) + 2 ) | ( data & 0xffff0000 );
10141014   }
10151015   verboselog( space->machine, 1, "dmaoffset_w( %08x, %08x, %08x ) %08x\n", offset, data, mem_mask, m_n_dmaoffset );
10161016}
r4057r4058
10231023   INT32 n_ramleft;
10241024   INT32 n_romleft;
10251025
1026   UINT32 *p_n_src;
1027   UINT32 *p_n_dst;
1026   UINT16 *source;
1027   UINT16 *destination;
10281028
10291029   if( ( m_n_dmaoffset >= 0x80000000 ) || ( m_n_dmabias == 0x1f300000 ) )
10301030   {
r4057r4058
10511051      verboselog( machine, 1, "namcos12_rom_read( %08x, %08x ) game %08x\n", n_address, n_size, n_offset );
10521052   }
10531053
1054   p_n_src = (UINT32 *)( memory_region( machine, n_region ) + n_offset );
1054   source = (UINT16 *) memory_region( machine, n_region );
10551055   n_romleft = ( memory_region_length( machine, n_region ) - n_offset ) / 4;
10561056   if( n_size > n_romleft )
10571057   {
r4057r4058
10591059      n_size = n_romleft;
10601060   }
10611061
1062   p_n_dst = &g_p_n_psxram[ n_address / 4 ];
1062   destination = (UINT16 *) g_p_n_psxram;
10631063   n_ramleft = ( g_n_psxramsize - n_address ) / 4;
10641064   if( n_size > n_ramleft )
10651065   {
r4057r4058
10671067      n_size = n_ramleft;
10681068   }
10691069
1070   n_size *= 2;
1071   n_address /= 2;
1072   n_offset /= 2;
1073
10701074   while( n_size > 0 )
10711075   {
1072      *( p_n_dst++ ) = *( p_n_src++ );
1076      destination[ WORD_XOR_LE( n_address ) ] = source[ WORD_XOR_LE( n_offset ) ];
1077      n_address++;
1078      n_offset++;
10731079      n_size--;
10741080   }
10751081}
r4057r4058
23552361GAME( 1996, tekken3c,  tekken3,  coh700,   namcos12, namcos12, ROT0, "Namco",         "Tekken 3 (TET2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
23562362GAME( 1997, lbgrande,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Libero Grande (LG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC006 */
23572363GAME( 1997, toukon3,   0,        coh700,   namcos12, namcos12, ROT0, "Tomy/Namco",    "Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (TR1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC019 */
2358GAME( 1998, soulclbr,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC14/VER.C)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
2359GAME( 1998, soulclba,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.C)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC020 */
2360GAME( 1998, soulclbb,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC13/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC020 */
2361GAME( 1998, soulclbc,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.B)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC020 */
2362GAME( 1998, soulclbd,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) /* KC020 */
2364GAME( 1998, soulclbr,  0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC14/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2365GAME( 1998, soulclba,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.C)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2366GAME( 1998, soulclbb,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC13/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2367GAME( 1998, soulclbc,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
2368GAME( 1998, soulclbd,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (SOC11/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
23632369GAME( 1998, ehrgeiz,   0,        coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
23642370GAME( 1998, ehrgeiza,  ehrgeiz,  coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
23652371GAME( 1998, mdhorse,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Derby Quiz My Dream Horse (MDH1/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC035 */
src/mame/drivers/raiden2.c
r4057r4058
18271827   ROM_LOAD( "copx_d3.357",   0x00000, 0x20000, CRC(fa2cf3ad) SHA1(13eee40704d3333874b6e3da9ee7d969c6dc662a) )
18281828ROM_END
18291829
1830/*
18301831
1832X Se Dae Quiz
1833Seibu/Dream Island, 1995
1834
1835This game runs on a Zero Team PCB
1836
1837PCB Layout
1838ZERO TEAM-V2 SEIBU KAIHATSU INC.
1839|----------------------------------------|
1840|LA4460 YM2151 M6295 9  Z80    Y         |
1841|HB-46A1 YM3014 SEI150 8                 |
1842|VOL      6116     6116  28.6362MHz 6116 |
1843|                  6116   SEI251    6116 |
1844|J HB-2                            62256 |
1845|A                  OBJ-2  OBJ-1   62256 |
1846|M                                 62256 |
1847|M      SW1(8) PAL    1      3     62256 |
1848|A             PAL    4      2  SEI1000  |
1849|   SW2(8)     6264                      |
1850|          PAL 6264          X           |
1851|   SW3(8)       SEI0200  5    D71011    |
1852|         7     BG-1      6         V30  |
1853|----------------------------------------|
1854Notes:
1855      PCB is identical to standard Zero Team PCB
1856      with the following differences....
1857      1. X - location for COPX ROM, not populated
1858      2. Y - location for battery, not populated
1859      3. NEC V30 and NEC D71011 are located on a sub board and
1860         the surface-mounted V30 (UPD70116) is not populated
1861      4. ROM7 is located in a 8M-DIP42 to 4M-DIP40 adapter and is a 27C4002 EPROM
1862      5. ROM8 has the top 4 pins hanging out of the DIP28 socket and is a 27C1001
1863         EPROM. Pins 30,31 & 32 are tied together and pin 2 is tied to the SEI150
1864         with a wire.
1865*/
1866
1867ROM_START( xsedae )
1868   ROM_REGION( 0x200000, "user1", 0 ) /* v30 main cpu */
1869   ROM_LOAD32_BYTE("1.u024",   0x000000, 0x40000, CRC(185437f9) SHA1(e46950b6a549d11dc57105dd7d9cb512a8ecbe70) )
1870   ROM_LOAD32_BYTE("3.u023",   0x000002, 0x40000, CRC(293fd6c1) SHA1(8b1a231f4bedbf9c0f347330e13fdf092b9888b4) )
1871   ROM_LOAD32_BYTE("2.u025",   0x000001, 0x40000, CRC(a2b052df) SHA1(e8bf9ab3d5d4e601ea9386e1f2d4e017b025407e) )
1872   ROM_LOAD32_BYTE("4.u026",   0x000003, 0x40000, CRC(5adf20bf) SHA1(42a0bb5a460c656675b2c432c043fc61a9049276) )
1873
1874   ROM_REGION( 0x40000, "user2", ROMREGION_ERASEFF )   /* COPDX */
1875   /* Not populated */
1876
1877   ROM_REGION( 0x20000, "audio", 0 ) /* 64k code for sound Z80 */
1878   ROM_LOAD( "8.u1110",  0x000000, 0x20000, CRC(2dc2f81a) SHA1(0f6605042e0e295b4256b43dbdf5d53daebe1a9a) )
1879
1880   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE ) /* chars */
1881   ROM_LOAD16_BYTE( "5.u077",   0x000000,   0x010000, CRC(478deced) SHA1(88cd72cb76bbc1c4255c3dfae4b9a10af9b050b2) )
1882    ROM_LOAD16_BYTE( "6.u072",   0x000001,   0x010000, CRC(a788402d) SHA1(8a1ac4760cf75cd2e32c1d15f36ad15cce3d411b) )
1883
1884    ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE ) /* background gfx */
1885    ROM_LOAD( "bg-1.u075",   0x000000, 0x100000, CRC(ac087560) SHA1(b6473b20c55ec090961cfc46a024b3c5b707ec25) )
1886    ROM_LOAD( "7.u0714",     0x100000, 0x080000, CRC(296105dc) SHA1(c2b80d681646f504b03c2dde13e37b1d820f82d2) )
1887
1888    ROM_REGION( 0x800000, "gfx3", ROMREGION_DISPOSE ) /* sprite gfx (not encrypted) */
1889    ROM_LOAD32_WORD( "obj-1.u0811",  0x000000, 0x100000, CRC(e65f1b4e) SHA1(b04be9af41ce868e64071715252c4ff228891cf0) )
1890    ROM_LOAD32_WORD( "obj-2.u082",   0x000002, 0x100000, CRC(e753e7ad) SHA1(643ab39ac1b7df686a16b1ed6fdcb686720ca8e8) )
1891
1892    ROM_REGION( 0x100000, "oki1", 0 )   /* ADPCM samples */
1893    ROM_LOAD( "9.u105", 0x00000, 0x40000, CRC(a7a0c5f9) SHA1(7882681ac152642aa4f859071f195842068b214b) )
1894
1895    ROM_REGION( 0x100000, "oki2", ROMREGION_ERASEFF )   /* ADPCM samples */
1896ROM_END
1897
18311898static DRIVER_INIT (raiden2)
18321899{
18331900   /* wrong , there must be some banking this just stops it crashing */
r4057r4058
18391906   raiden2_decrypt_sprites(machine);
18401907}
18411908
1909static DRIVER_INIT (xsedae)
1910{
1911   /* wrong , there must be some banking this just stops it crashing */
1912   UINT8 *RAM = memory_region(machine, "user1");
1913   memory_set_bankptr(machine, 1,&RAM[0x100000]);
1914   memory_set_bankptr(machine, 2,&RAM[0x040000]);
1915}
18421916
18431917
1844
18451918static const UINT8 r2_v33_default_eeprom_type1[32] =
18461919{
18471920   0x41, 0x52, 0x44, 0x49, 0x4E, 0x45, 0x49, 0x49, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x91, 0x80,
r4057r4058
21322205GAME( 1993, zeroteaa, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND)
21332206GAME( 1993, zeroteab, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team (set 3)", GAME_NOT_WORKING|GAME_NO_SOUND)
21342207GAME( 1993, zerotsel, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "Zero Team Selection", GAME_NOT_WORKING|GAME_NO_SOUND)
2208GAME( 1995, xsedae,   0,       raiden2,  raiden2,  xsedae,   ROT0,   "Dream Island",   "X Se Dae Quiz", GAME_NOT_WORKING|GAME_NO_SOUND)
21352209
21362210// 'V33 system type_b' - uses V33 CPU, COPX-D3 external protection rom, but still has the proper sound system
21372211GAME( 1993, nzerotea, zeroteam,raiden2,  raiden2,  raiden2,  ROT0,   "Seibu Kaihatsu", "New Zero Team", GAME_NOT_WORKING|GAME_NO_SOUND) // this uses a v33 and COPD3
src/mame/drivers/scramble.c
r4057r4058
104104//  AM_RANGE(0x8200, 0x8203) AM_WRITE(ppi8255_1_w)
105105ADDRESS_MAP_END
106106
107static ADDRESS_MAP_START( explorer_readmem, ADDRESS_SPACE_PROGRAM, 8 )
108   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
109   AM_RANGE(0x4000, 0x4bff) AM_READ(SMH_RAM)
110   AM_RANGE(0x4c00, 0x4fff) AM_READ(galaxold_videoram_r)   /* mirror */
111   AM_RANGE(0x5000, 0x50ff) AM_READ(SMH_RAM)
112   AM_RANGE(0x5100, 0x51ff) AM_READ(SMH_NOP)   /* test mode mirror? */
113   AM_RANGE(0x7000, 0x7000) AM_READ(watchdog_reset_r)
114   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
115   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("IN1")
116   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN2")
117   AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN3")
118ADDRESS_MAP_END
119
120static ADDRESS_MAP_START( explorer_writemem, ADDRESS_SPACE_PROGRAM, 8 )
121   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
122   AM_RANGE(0x4000, 0x47ff) AM_WRITE(SMH_RAM)
123   AM_RANGE(0x4800, 0x4bff) AM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
124   AM_RANGE(0x4c00, 0x4fff) AM_WRITE(galaxold_videoram_w)   /* mirror address */
125   AM_RANGE(0x5000, 0x503f) AM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
126   AM_RANGE(0x5040, 0x505f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
127   AM_RANGE(0x5060, 0x507f) AM_WRITE(SMH_RAM) AM_BASE(&galaxold_bulletsram) AM_SIZE(&galaxold_bulletsram_size)
128   AM_RANGE(0x5080, 0x50ff) AM_WRITE(SMH_RAM)
129   AM_RANGE(0x5100, 0x51ff) AM_WRITE(SMH_NOP)   /* test mode mirror? */
130   AM_RANGE(0x6800, 0x6800) AM_WRITE(SMH_NOP)
131   AM_RANGE(0x6801, 0x6801) AM_WRITE(galaxold_nmi_enable_w)
132   AM_RANGE(0x6802, 0x6802) AM_WRITE(galaxold_coin_counter_w)
133   AM_RANGE(0x6803, 0x6803) AM_WRITE(SMH_NOP)
134   AM_RANGE(0x6804, 0x6804) AM_WRITE(galaxold_stars_enable_w)
135   AM_RANGE(0x6806, 0x6806) AM_WRITE(galaxold_flip_screen_x_w)
136   AM_RANGE(0x6807, 0x6807) AM_WRITE(galaxold_flip_screen_y_w)
137   AM_RANGE(0x7000, 0x7000) AM_WRITE(SMH_NOP)
138   AM_RANGE(0x8000, 0x8000) AM_WRITE(soundlatch_w)
139   AM_RANGE(0x9000, 0x9000) AM_WRITE(hotshock_sh_irqtrigger_w)
140ADDRESS_MAP_END
141
142
143107static ADDRESS_MAP_START( ckongs_readmem, ADDRESS_SPACE_PROGRAM, 8 )
144108   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
145109   AM_RANGE(0x6000, 0x6bff) AM_READ(SMH_RAM)
r4057r4058
356320ADDRESS_MAP_END
357321
358322
359static READ8_DEVICE_HANDLER(frogf_ppi8255_r)
360{
361   return ppi8255_r(device, offset >> 3);
362}
363
364static WRITE8_DEVICE_HANDLER(frogf_ppi8255_w)
365{
366   ppi8255_w(device, offset >> 3, data);
367}
368
369static ADDRESS_MAP_START( frogf_map, ADDRESS_SPACE_PROGRAM, 8 )
370   AM_RANGE(0x0000, 0x2fff) AM_ROM
371   AM_RANGE(0x8000, 0x87ff) AM_RAM
372   AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(galaxold_videoram_w) AM_BASE(&galaxold_videoram)
373   AM_RANGE(0x9000, 0x903f) AM_RAM_WRITE(galaxold_attributesram_w) AM_BASE(&galaxold_attributesram)
374   AM_RANGE(0x9040, 0x905f) AM_RAM AM_BASE(&galaxold_spriteram) AM_SIZE(&galaxold_spriteram_size)
375   AM_RANGE(0x9060, 0x90ff) AM_RAM
376   AM_RANGE(0xa802, 0xa802) AM_WRITE(galaxold_flip_screen_x_w)
377   AM_RANGE(0xa804, 0xa804) AM_WRITE(galaxold_nmi_enable_w)
378   AM_RANGE(0xa806, 0xa806) AM_WRITE(galaxold_flip_screen_y_w)
379   AM_RANGE(0xa808, 0xa808) AM_WRITE(galaxold_coin_counter_1_w)
380   AM_RANGE(0xa80e, 0xa80e) AM_WRITE(galaxold_coin_counter_0_w)
381   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
382   AM_RANGE(0xd000, 0xd018) AM_DEVREADWRITE(PPI8255, "ppi8255_0", frogf_ppi8255_r, frogf_ppi8255_w)
383   AM_RANGE(0xe000, 0xe018) AM_DEVREADWRITE(PPI8255, "ppi8255_1", frogf_ppi8255_r, frogf_ppi8255_w)
384ADDRESS_MAP_END
385
386323static ADDRESS_MAP_START( ad2083_map, ADDRESS_SPACE_PROGRAM, 8 )
387324   AM_RANGE(0x0000, 0x3fff) AM_ROM
388325   AM_RANGE(0x4000, 0x47ff) AM_RAM
r4057r4058
425362   AM_RANGE(0x80, 0x80) AM_WRITE(ay8910_control_port_1_w)
426363ADDRESS_MAP_END
427364
428static WRITE8_HANDLER( scorpion_extra_sound_w )
429{
430   if(data != 0xff)
431      popmessage("Played sample/speech %02X",data);
432}
433
434static WRITE8_HANDLER( scorpion_sound_cmd_w )
435{
436   // data == 0xfc -> don't play anything
437   if(data == 0xf8)
438   {
439      /* play the sample/speech */
440   }
441}
442
443static ADDRESS_MAP_START( scorpion_sound_io, ADDRESS_SPACE_IO, 8 )
444   ADDRESS_MAP_GLOBAL_MASK(0xff)
445   AM_RANGE(0x04, 0x04) AM_WRITE(ay8910_control_port_0_w)
446   AM_RANGE(0x08, 0x08) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
447   AM_RANGE(0x10, 0x10) AM_WRITE(ay8910_control_port_1_w)
448   AM_RANGE(0x20, 0x20) AM_READWRITE(ay8910_read_port_1_r, ay8910_write_port_1_w)
449   AM_RANGE(0x40, 0x40) AM_WRITE(ay8910_control_port_2_w)
450   AM_RANGE(0x80, 0x80) AM_READWRITE(ay8910_read_port_2_r, ay8910_write_port_2_w)
451ADDRESS_MAP_END
452
453365static READ8_HANDLER( hncholms_prot_r )
454366{
455367   if(cpu_get_pc(space->cpu) == 0x2b || cpu_get_pc(space->cpu) == 0xa27)
r4057r4058
543455   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )   /* protection bit */
544456INPUT_PORTS_END
545457
546static INPUT_PORTS_START( explorer )
547   PORT_START("IN0")
548   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY
549   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 )
550   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY
551   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 )
552   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY
553   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY
554   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN2 )
555   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
556
557   PORT_START("IN1")
558   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
559   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
560   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
561   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
562   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
563   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
564   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
565   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
566   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
567   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
568   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
569   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
570   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
571   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
572   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
573   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* pressing this disables the coins */
574   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_START2 )
575   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START1 )
576
577   PORT_START("IN2")
578   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) )
579   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
580   PORT_DIPSETTING(    0x09, DEF_STR( 2C_2C ) )
581   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
582   PORT_DIPSETTING(    0x0a, DEF_STR( 2C_3C ) )
583   PORT_DIPSETTING(    0x0b, DEF_STR( 2C_4C ) )
584   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
585   PORT_DIPSETTING(    0x0c, DEF_STR( 2C_5C ) )
586   PORT_DIPSETTING(    0x0d, DEF_STR( 2C_6C ) )
587   PORT_DIPSETTING(    0x02, DEF_STR( 1C_3C ) )
588   PORT_DIPSETTING(    0x0e, DEF_STR( 2C_7C ) )
589   PORT_DIPSETTING(    0x0f, DEF_STR( 2C_8C ) )
590   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )
591   PORT_DIPSETTING(    0x04, DEF_STR( 1C_5C ) )
592   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )
593   PORT_DIPSETTING(    0x06, DEF_STR( 1C_7C ) )
594   PORT_DIPSETTING(    0x07, DEF_STR( 1C_8C ) )
595   PORT_DIPNAME( 0xf0, 0x00, DEF_STR( Coin_B ) )
596   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
597   PORT_DIPSETTING(    0x90, DEF_STR( 2C_2C ) )
598   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
599   PORT_DIPSETTING(    0xa0, DEF_STR( 2C_3C ) )
600   PORT_DIPSETTING(    0xb0, DEF_STR( 2C_4C ) )
601   PORT_DIPSETTING(    0x10, DEF_STR( 1C_2C ) )
602   PORT_DIPSETTING(    0xc0, DEF_STR( 2C_5C ) )
603   PORT_DIPSETTING(    0xd0, DEF_STR( 2C_6C ) )
604   PORT_DIPSETTING(    0x20, DEF_STR( 1C_3C ) )
605   PORT_DIPSETTING(    0xe0, DEF_STR( 2C_7C ) )
606   PORT_DIPSETTING(    0xf0, DEF_STR( 2C_8C ) )
607   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )
608   PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
609   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )
610   PORT_DIPSETTING(    0x60, DEF_STR( 1C_7C ) )
611   PORT_DIPSETTING(    0x70, DEF_STR( 1C_8C ) )
612
613   PORT_START("IN3")
614   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
615   PORT_DIPSETTING(    0x00, "2" )
616   PORT_DIPSETTING(    0x01, "3" )
617   PORT_DIPSETTING(    0x02, "4" )
618   PORT_DIPSETTING(    0x03, "5" )
619   PORT_DIPNAME( 0x1c, 0x00, DEF_STR( Bonus_Life ) )
620   PORT_DIPSETTING(    0x04, "10000" )
621   PORT_DIPSETTING(    0x0c, "15000" )
622   PORT_DIPSETTING(    0x14, "20000" )
623   PORT_DIPSETTING(    0x1c, "25000" )
624   PORT_DIPSETTING(    0x00, "30000" )
625   PORT_DIPSETTING(    0x08, "50000" )
626   PORT_DIPSETTING(    0x10, "70000" )
627   PORT_DIPSETTING(    0x18, "90000" )
628   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
629   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
630   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
631   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
632   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
633   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
634   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
635INPUT_PORTS_END
636
637static INPUT_PORTS_START( strfbomb )
638   PORT_START("IN0")
639   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
640   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
641   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
642   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
643   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
644   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
645   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
646   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
647
648   PORT_START("IN1")
649   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
650   PORT_DIPSETTING(    0x00, "3" )
651   PORT_DIPSETTING(    0x01, "4" )
652   PORT_DIPSETTING(    0x02, "5" )
653   PORT_DIPSETTING(    0x03, "255 (Cheat)")
654   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
655   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
656   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
657   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
658   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
659   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
660
661   PORT_START("IN2")
662   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
663   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
664   PORT_DIPSETTING(    0x00, "A 1/2  B 4/1  C 1/2" )
665   PORT_DIPSETTING(    0x02, "A 1/3  B 2/1  C 1/3" )
666   PORT_DIPSETTING(    0x04, "A 1/4  B 3/1  C 1/4" )
667   PORT_DIPSETTING(    0x06, "A 1/5  B 1/1  C 1/5" )
668   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
669   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
670   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
671   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
672   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL )   /* protection bit */
673   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
674   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL )   /* protection bit */
675INPUT_PORTS_END
676
677static INPUT_PORTS_START( atlantis )
678   PORT_START("IN0")
679   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
680   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
681   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably unused */
682   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
683   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
684   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
685   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
686   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
687
688   PORT_START("IN1")
689   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
690   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
691   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
692   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Lives ) )
693   PORT_DIPSETTING(    0x02, "3" )
694   PORT_DIPSETTING(    0x00, "5" )
695   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
696   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
697   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
698   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
699   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
700   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
701
702   PORT_START("IN2")
703   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
704   PORT_DIPNAME( 0x0e, 0x00, DEF_STR( Coinage ) )
705   PORT_DIPSETTING(    0x02, "A 1/3  B 2/1" )
706   PORT_DIPSETTING(    0x00, "A 1/6  B 1/1" )
707   PORT_DIPSETTING(    0x04, "A 1/99 B 1/99")
708   /* all the other combos give 99 credits */
709   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
710   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
711   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
712   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
713INPUT_PORTS_END
714
715static INPUT_PORTS_START( theend )
716   PORT_START("IN0")
717   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
718   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
719   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
720   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
721   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
722   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
723   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
724   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
725
726   PORT_START("IN1")
727   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
728   PORT_DIPSETTING(    0x00, "3" )
729   PORT_DIPSETTING(    0x01, "4" )
730   PORT_DIPSETTING(    0x02, "5" )
731   PORT_DIPSETTING(    0x03, "256 (Cheat)")
732   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
733   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
734   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
735   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
736   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
737   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
738
739   PORT_START("IN2")
740   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
741   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
742   PORT_DIPSETTING(    0x04, DEF_STR( 3C_1C ) )
743   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
744   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
745   PORT_DIPSETTING(    0x06, DEF_STR( 1C_2C ) )
746   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
747   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
748   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
749   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )      /* output bits */
750INPUT_PORTS_END
751
752static INPUT_PORTS_START( froggers )
753   PORT_START("IN0")
754   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
755   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot2 - unused */
756   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
757   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* read - function unknown */
758   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
759   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
760   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
761   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
762
763   PORT_START("IN1")
764   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
765   PORT_DIPSETTING(    0x00, "3" )
766   PORT_DIPSETTING(    0x01, "5" )
767   PORT_DIPSETTING(    0x02, "7" )
768   PORT_DIPSETTING(    0x03, "256 (Cheat)")
769   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot2 - unused */
770   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot1 - unused */
771   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
772   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
773   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
774   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
775
776   PORT_START("IN2")
777   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
778   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
779   PORT_DIPSETTING(    0x02, "A 2/1 B 2/1 C 2/1" )
780   PORT_DIPSETTING(    0x04, "A 2/1 B 1/3 C 2/1" )
781   PORT_DIPSETTING(    0x00, "A 1/1 B 1/1 C 1/1" )
782   PORT_DIPSETTING(    0x06, "A 1/1 B 1/6 C 1/1" )
783   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
784   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
785   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
786   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
787   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
788   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
789   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
790INPUT_PORTS_END
791
792static INPUT_PORTS_START( amidars )
793   PORT_START("IN0")
794   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
795   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot2 - unused */
796   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
797   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
798   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
799   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
800   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
801   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
802
803   PORT_START("IN1")
804   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
805   PORT_DIPSETTING(    0x03, "2" )
806   PORT_DIPSETTING(    0x02, "3" )
807   PORT_DIPSETTING(    0x01, "4" )
808   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ))
809   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
810   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
811   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
812   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
813   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
814   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
815
816   PORT_START("IN2")
817   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
818   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
819   PORT_DIPSETTING(    0x00, "A 1/1 B 1/6" )
820   PORT_DIPSETTING(    0x02, "A 2/1 B 1/3" )
821   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
822   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
823   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
824   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
825   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
826   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
827   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
828   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
829   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
830   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
831   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
832   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
833   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
834   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
835   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
836INPUT_PORTS_END
837
838
839458static INPUT_PORTS_START( turpins )
840459   PORT_START("IN0")
841460   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
r4057r4058
1356975   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* protection check? */
1357976INPUT_PORTS_END
1358977
1359static INPUT_PORTS_START( sfx )
1360   PORT_START("IN0")
1361   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1362   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)   // "Fire" left
1363   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1364   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)   // "Fire" right
1365   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1366   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1367   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1368   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1369
1370   PORT_START("IN1")
1371   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
1372   PORT_DIPSETTING(    0x02, "3" )
1373   PORT_DIPSETTING(    0x01, "4" )
1374   PORT_DIPSETTING(    0x00, "5" )
1375   PORT_DIPSETTING(    0x03, "Invulnerability (Cheat)")
1376   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)   // "Fire" left
1377   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)   // "Fire" right
1378   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1379   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1380   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1381   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1382
1383   PORT_START("IN2")
1384   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1385   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coinage ) )
1386   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
1387   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
1388   PORT_DIPSETTING(    0x06, DEF_STR( 1C_1C ) )
1389   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
1390   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
1391   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1392   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
1393   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1394   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused */
1395   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1396   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* unused */
1397INPUT_PORTS_END
1398
1399978/* Same as 'mimonkey' (scobra.c driver) */
1400979static INPUT_PORTS_START( mimonscr )
1401980   PORT_START("IN0")
r4057r4058
14411020   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
14421021INPUT_PORTS_END
14431022
1444static INPUT_PORTS_START( scorpion )
1445   PORT_START("IN0")
1446   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1447   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1448   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
1449   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
1450   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1451   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1452   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
1453   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1454
1455   PORT_START("IN1")
1456   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
1457   PORT_DIPSETTING(    0x03, "3")
1458   PORT_DIPSETTING(    0x02, "4" )
1459   PORT_DIPSETTING(    0x01, "5" )
1460   PORT_DIPSETTING(    0x00, "255" )
1461   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
1462   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
1463   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1464   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1465   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
1466   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
1467
1468   PORT_START("IN2")
1469   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1470   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
1471   PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
1472   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
1473   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1474   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1475   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1476   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )
1477   PORT_DIPSETTING(    0x08, "A 1/1  B 1/1" )
1478   PORT_DIPSETTING(    0x00, "A 1/1  B 1/3" )
1479   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1480   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1481   PORT_DIPNAME( 0xa0, 0xa0, DEF_STR( Difficulty ) )
1482   PORT_DIPSETTING(    0xa0, DEF_STR( Normal ) )
1483   PORT_DIPSETTING(    0x80, DEF_STR( Medium ) )
1484   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
1485   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
1486INPUT_PORTS_END
1487
14881023static INPUT_PORTS_START( ad2083 )
14891024   /* There are no Player 2 controls for this game:
14901025     * Dipswitch is read upon startup. If Cabinet = Cocktail, a 1 is stored @400F.
r4057r4058
16401175   64*8
16411176};
16421177
1643static const gfx_layout sfx_charlayout =
1644{
1645   8,8,   /* 8*8 characters */
1646   RGN_FRAC(1,4),
1647   2,   /* 2 bits per pixel */
1648   { RGN_FRAC(0,2), RGN_FRAC(1,2) },   /* the two bitplanes are separated */
1649   { 0, 1, 2, 3, 4, 5, 6, 7 },
1650   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
1651   8*8   /* every char takes 8 consecutive bytes */
1652};
1653static const gfx_layout sfx_spritelayout =
1654{
1655   16,16,   /* 16*16 sprites */
1656   RGN_FRAC(1,4),
1657   2,   /* 2 bits per pixel */
1658   { RGN_FRAC(0,2), RGN_FRAC(1,2) },   /* the two bitplanes are separated */
1659   { 0, 1, 2, 3, 4, 5, 6, 7,
1660         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
1661   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
1662         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
1663   32*8   /* every sprite takes 32 consecutive bytes */
1664};
1665
16661178static const gfx_layout ad2083_charlayout =
16671179{
16681180   8,8,   /* 8*8 characters */
r4057r4058
17021214   GFXDECODE_ENTRY( "gfx1", 0x0000, mrkougar_spritelayout, 0, 8 )
17031215GFXDECODE_END
17041216
1705static GFXDECODE_START( sfx )
1706   GFXDECODE_ENTRY( "gfx1", 0x0800, sfx_charlayout,    0, 8 )
1707   GFXDECODE_ENTRY( "gfx1", 0x0000, sfx_spritelayout,  0, 8 )
1708GFXDECODE_END
1709
17101217static GFXDECODE_START( ad2083 )
17111218   GFXDECODE_ENTRY( "gfx1", 0x0000, ad2083_charlayout,    0, 8 )
17121219   GFXDECODE_ENTRY( "gfx1", 0x0000, ad2083_spritelayout,  0, 8 )
r4057r4058
17221229   NULL
17231230};
17241231
1725static const ay8910_interface sfx_ay8910_interface_1 =
1726{
1727   AY8910_LEGACY_OUTPUT,
1728   AY8910_DEFAULT_LOADS,
1729   NULL,
1730   NULL,
1731   soundlatch2_w,
1732   sfx_sh_irqtrigger_w
1733};
1734
1735static const ay8910_interface explorer_ay8910_interface_1 =
1736{
1737   AY8910_LEGACY_OUTPUT,
1738   AY8910_DEFAULT_LOADS,
1739   scramble_portB_r,
1740   NULL,
1741   NULL,
1742   NULL
1743};
1744
1745static const ay8910_interface explorer_ay8910_interface_2 =
1746{
1747   AY8910_LEGACY_OUTPUT,
1748   AY8910_DEFAULT_LOADS,
1749   hotshock_soundlatch_r,
1750   NULL,
1751   NULL,
1752   NULL
1753};
1754
17551232static const ay8910_interface hotshock_ay8910_interface_2 =
17561233{
17571234   AY8910_LEGACY_OUTPUT,
r4057r4058
17621239   NULL
17631240};
17641241
1765static const ay8910_interface scorpion_ay8910_interface_1 =
1766{
1767   AY8910_LEGACY_OUTPUT,
1768   AY8910_DEFAULT_LOADS,
1769   NULL,
1770   NULL,
1771   scorpion_extra_sound_w,
1772   scorpion_sound_cmd_w,
1773};
1774
17751242static const ay8910_interface triplep_ay8910_interface =
17761243{
17771244   AY8910_LEGACY_OUTPUT,
r4057r4058
18821349   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
18831350MACHINE_DRIVER_END
18841351
1885static MACHINE_DRIVER_START( fscramble )
1886
1887   /* scramble with filters */
1888   MDRV_IMPORT_FROM(scramble)
1889   MDRV_SOUND_MODIFY("8910.1")
1890   MDRV_SOUND_ROUTE(0, "filter1A", 1.0)
1891   MDRV_SOUND_ROUTE(1, "filter1B", 1.0)
1892   MDRV_SOUND_ROUTE(2, "filter1C", 1.0)
1893
1894   MDRV_SOUND_ADD("filter1A", FILTER_RC, 0)
1895   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
1896   MDRV_SOUND_ADD("filter1B", FILTER_RC, 0)
1897   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
1898   MDRV_SOUND_ADD("filter1C", FILTER_RC, 0)
1899   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) // scramblec057gre
1900
1901   MDRV_SOUND_MODIFY("8910.2")
1902   MDRV_SOUND_ROUTE(0, "filter2A", 1.0)
1903   MDRV_SOUND_ROUTE(1, "filter2B", 1.0)
1904   MDRV_SOUND_ROUTE(2, "filter2C", 1.0)
1905
1906   MDRV_SOUND_ADD("filter2A", FILTER_RC, 0)
1907   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
1908   MDRV_SOUND_ADD("filter2B", FILTER_RC, 0)
1909   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.3)
1910   MDRV_SOUND_ADD("filter2C", FILTER_RC, 0)
1911   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) // scramblec057gre
1912MACHINE_DRIVER_END
1913
1914static MACHINE_DRIVER_START( explorer )
1915
1916   /* basic machine hardware */
1917   MDRV_IMPORT_FROM(scramble)
1918   MDRV_CPU_MODIFY("main")
1919   MDRV_CPU_PROGRAM_MAP(explorer_readmem,explorer_writemem)
1920
1921   MDRV_MACHINE_RESET(explorer)
1922
1923   /* sound hardware */
1924   MDRV_SOUND_MODIFY("8910.1")
1925   MDRV_SOUND_CONFIG(explorer_ay8910_interface_1)
1926   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
1927
1928   MDRV_SOUND_MODIFY("8910.2")
1929   MDRV_SOUND_CONFIG(explorer_ay8910_interface_2)
1930   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
1931
1932   MACHINE_DRIVER_END
1933
1934static MACHINE_DRIVER_START( theend )
1935
1936   /* basic machine hardware */
1937   MDRV_IMPORT_FROM(scramble)
1938
1939   /* video hardware */
1940   MDRV_PALETTE_LENGTH(32+64+2+0)   /* 32 for characters, 64 for stars, 2 for bullets, 0/1 for background */
1941
1942   MDRV_PALETTE_INIT(galaxold)
1943   MDRV_VIDEO_START(theend)
1944MACHINE_DRIVER_END
1945
1946
19471352static MACHINE_DRIVER_START( mars )
19481353
19491354   /* basic machine hardware */
r4057r4058
20641469   MDRV_VIDEO_START(ckongs)
20651470MACHINE_DRIVER_END
20661471
2067
2068
2069
2070
2071
20721472static MACHINE_DRIVER_START( mimonscr )
20731473
20741474   /* basic machine hardware */
r4057r4058
21431543   MDRV_VIDEO_START(scorpion)
21441544MACHINE_DRIVER_END
21451545
2146static MACHINE_DRIVER_START( scorpion )
2147
2148   /* basic machine hardware */
2149   MDRV_IMPORT_FROM(scramble)
2150
2151   MDRV_CPU_MODIFY("audio")
2152   MDRV_CPU_IO_MAP(scorpion_sound_io,0)
2153
2154   MDRV_VIDEO_START(scorpion)
2155
2156   /* sound hardware */
2157   MDRV_SOUND_MODIFY("8910.1")
2158   MDRV_SOUND_CONFIG(scorpion_ay8910_interface_1)
2159   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2160
2161   MDRV_SOUND_MODIFY("8910.2")
2162   MDRV_SOUND_CONFIG(triplep_ay8910_interface)
2163   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2164
2165   MDRV_SOUND_ADD("ay", AY8910, 14318000/8)
2166   MDRV_SOUND_CONFIG(scramble_ay8910_interface_2)
2167   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
2168MACHINE_DRIVER_END
2169
21701546static MACHINE_DRIVER_START( ad2083 )
21711547   /* basic machine hardware */
21721548   MDRV_CPU_ADD("main", Z80, 18432000/6)   /* 3.072 MHz */
r4057r4058
22101586
22111587***************************************************************************/
22121588
2213ROM_START( scramble )
2214   ROM_REGION( 0x10000, "main", 0 )
2215   ROM_LOAD( "s1.2d",         0x0000, 0x0800, CRC(ea35ccaa) SHA1(1dcb375987fe21e0483c27d485c405de53848d61) )
2216   ROM_LOAD( "s2.2e",         0x0800, 0x0800, CRC(e7bba1b3) SHA1(240877576045fddcc9ff01d97dc78139454ac4f1) )
2217   ROM_LOAD( "s3.2f",         0x1000, 0x0800, CRC(12d7fc3e) SHA1(a84d191c7be8700f630a83ddad798be9e83b5d55) )
2218   ROM_LOAD( "s4.2h",         0x1800, 0x0800, CRC(b59360eb) SHA1(5d155808c19dcf2e14aa8e29c0ee41a6d3d3c43a) )
2219   ROM_LOAD( "s5.2j",         0x2000, 0x0800, CRC(4919a91c) SHA1(9cb5861c61e4783e5fbaa3869d51195f127b1129) )
2220   ROM_LOAD( "s6.2l",         0x2800, 0x0800, CRC(26a4547b) SHA1(67c0fa81729370631647b5d78bb5a61433facd7f) )
2221   ROM_LOAD( "s7.2m",         0x3000, 0x0800, CRC(0bb49470) SHA1(05a6fe3010c2136284ca76352dac147797c79778) )
2222   ROM_LOAD( "s8.2p",         0x3800, 0x0800, CRC(6a5740e5) SHA1(e3b09141cee26857d626412e9d1a0e759469b97a) )
2223
2224   ROM_REGION( 0x10000, "audio", 0 )
2225   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
2226   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
2227   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
2228
2229   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2230   ROM_LOAD( "c2.5f",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
2231   ROM_LOAD( "c1.5h",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
2232
2233   ROM_REGION( 0x0020, "proms", 0 )
2234   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2235ROM_END
2236
2237ROM_START( scrambls )
2238   ROM_REGION( 0x10000, "main", 0 )
2239   ROM_LOAD( "2d",           0x0000, 0x0800, CRC(b89207a1) SHA1(5422df979e82bcc73df49f50515fe76c126c037b) )
2240   ROM_LOAD( "2e",           0x0800, 0x0800, CRC(e9b4b9eb) SHA1(a8ee9ddfadf5e9accedfaf81da757a88a2e55a0a) )
2241   ROM_LOAD( "2f",           0x1000, 0x0800, CRC(a1f14f4c) SHA1(3eae2b3e4596505a8afb5c5cfb108e823c2c4319) )
2242   ROM_LOAD( "2h",           0x1800, 0x0800, CRC(591bc0d9) SHA1(170f9e92f0a3bee04407be27210b4fa825367688) )
2243   ROM_LOAD( "2j",           0x2000, 0x0800, CRC(22f11b6b) SHA1(e426ef6a7444a39a34d59799973b07d11b89f372) )
2244   ROM_LOAD( "2l",           0x2800, 0x0800, CRC(705ffe49) SHA1(174df3f281068c767344f751daace646360e26d6) )
2245   ROM_LOAD( "2m",           0x3000, 0x0800, CRC(ea26c35c) SHA1(a2f3380982d93a022f46756f974fd16c4cd617de) )
2246   ROM_LOAD( "2p",           0x3800, 0x0800, CRC(94d8f5e3) SHA1(f3a9c4d1d91836476fcad87ea0d243dde7171e0a) )
2247
2248   ROM_REGION( 0x10000, "audio", 0 )
2249   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
2250   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
2251   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
2252
2253   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2254   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(5f30311a) SHA1(d64134089bebd995b3a1a089411e180c8c29f32d) )
2255   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(516e029e) SHA1(81b44eb1ce43cebde87f0a41ade2e7eb291af78d) )
2256
2257   ROM_REGION( 0x0020, "proms", 0 )
2258   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2259ROM_END
2260
2261ROM_START( explorer )
2262   ROM_REGION( 0x10000, "main", 0 )
2263   ROM_LOAD( "10l.bin",      0x0000, 0x1000, CRC(d5adf626) SHA1(f362322f780c13cee73697f9158a8ca8aa943a2e) )
2264   ROM_LOAD( "9l.bin",       0x1000, 0x1000, CRC(48e32788) SHA1(7a98848d2ed8ba5b2da28c014226109af7cc9287) )
2265   ROM_LOAD( "8l.bin",       0x2000, 0x1000, CRC(c0dbdbde) SHA1(eac7444246bdf80f97962031bf900ce09b28c8b5) )
2266   ROM_LOAD( "7l.bin",       0x3000, 0x1000, CRC(9b30d227) SHA1(22764e0a2a5ce7abe862e42c84abaaf25949575f) )
2267
2268   ROM_REGION( 0x10000, "audio", 0 )
2269   ROM_LOAD( "3f.bin",        0x0000, 0x1000, CRC(9faf18cf) SHA1(1b6c65472d639753cc39031750f85efe1d31ae5e) )
2270   ROM_LOAD( "4b.bin",       0x1000, 0x0800, CRC(e910b5c3) SHA1(228e8d36dd1ac8a00a396df74b80aa6616997028) )
2271
2272   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2273   ROM_LOAD( "c2.5f",         0x0000, 0x0800, CRC(4708845b) SHA1(a8b1ad19a95a9d35050a2ab7194cc96fc5afcdc9) )
2274   ROM_LOAD( "c1.5h",         0x0800, 0x0800, CRC(11fd2887) SHA1(69844e48bb4d372cac7ae83c953df573c7ecbb7f) )
2275
2276   ROM_REGION( 0x0020, "proms", 0 )
2277   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2278ROM_END
2279
2280ROM_START( strfbomb )
2281   ROM_REGION( 0x10000, "main", 0 )
2282   ROM_LOAD( "1.2c",         0x0000, 0x0800, CRC(b102aaa0) SHA1(00560da7a2ded6afcdc1d46e12cc3c795654639a) )
2283   ROM_LOAD( "2.2e",         0x0800, 0x0800, CRC(d4155703) SHA1(defd37df55536890456c29812340e0d6b4292b78) )
2284   ROM_LOAD( "3.2f",         0x1000, 0x0800, CRC(a9568c89) SHA1(0d8e6b3af92e4933814700d54acfd43407f3ede1) )
2285   ROM_LOAD( "4.2h",         0x1800, 0x0800, CRC(663b6c35) SHA1(354fb2e92f4376b20aee412ed361d59b8a2c01e1) )
2286   ROM_LOAD( "5.2j",         0x2000, 0x0800, CRC(4919a91c) SHA1(9cb5861c61e4783e5fbaa3869d51195f127b1129) )
2287   ROM_LOAD( "6.2l",         0x2800, 0x0800, CRC(4ec66ae3) SHA1(a74827e161212e9b2eddd980321507a377f1e30b) )
2288   ROM_LOAD( "7.2m",         0x3000, 0x0800, CRC(0feb0192) SHA1(45a44bde3bf1483abf95fe1d1d5066bfcb1736df) )
2289   ROM_LOAD( "8.2p",         0x3800, 0x0800, CRC(280a6142) SHA1(f17625b91eaaffa36a433be32e4e80651d94b3b9) )
2290
2291   ROM_REGION( 0x10000, "audio", 0 )
2292   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
2293   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
2294   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
2295
2296   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2297   ROM_LOAD( "9.5f",         0x0000, 0x0800, CRC(3abeff25) SHA1(ff6de0596c849ec877fb759c1ab9c7a8ffe2edac) )
2298   ROM_LOAD( "10.5h",        0x0800, 0x0800, CRC(79ecacbe) SHA1(285cb3ee0ff8d596877bb571ea8479566ab36eb9) )
2299
2300   ROM_REGION( 0x0020, "proms", 0 )
2301   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2302ROM_END
2303
2304ROM_START( atlantis )
2305   ROM_REGION( 0x10000, "main", 0 )
2306   ROM_LOAD( "2c",           0x0000, 0x0800, CRC(0e485b9a) SHA1(976f1d6f4552fbee134359a776b5688588824cbb) )
2307   ROM_LOAD( "2e",           0x0800, 0x0800, CRC(c1640513) SHA1(a0dfb34f401330b16e9e4d66ec4b49d120499606) )
2308   ROM_LOAD( "2f",           0x1000, 0x0800, CRC(eec265ee) SHA1(29b6cf6b93220414eb58cddeba591dc8813c4935) )
2309   ROM_LOAD( "2h",           0x1800, 0x0800, CRC(a5d2e442) SHA1(e535d1a501ebd861ad62da70b87215fb7c23de1d) )
2310   ROM_LOAD( "2j",           0x2000, 0x0800, CRC(45f7cf34) SHA1(d1e0e0be6dec377b684625bdfdc5a3a8af847492) )
2311   ROM_LOAD( "2l",           0x2800, 0x0800, CRC(f335b96b) SHA1(17daa6d9bc916081f3c6cbdfe5b4960177dc7c9b) )
2312
2313   ROM_REGION( 0x10000, "audio", 0 )
2314   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
2315   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
2316   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
2317
2318   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2319   ROM_LOAD( "5f",           0x0000, 0x0800, CRC(57f9c6b9) SHA1(ad0d09a6611998d093d676a9c9fe9e32b10f643e) )
2320   ROM_LOAD( "5h",           0x0800, 0x0800, CRC(e989f325) SHA1(947aee915779687deae040aeef9e9aee680aaebf) )
2321
2322   ROM_REGION( 0x0020, "proms", 0 )
2323   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2324ROM_END
2325
2326ROM_START( atlants2 )
2327   ROM_REGION( 0x10000, "main", 0 )
2328   ROM_LOAD( "rom1",         0x0000, 0x0800, CRC(ad348089) SHA1(3548b94192c451c0126e7aaecefa7137ae074cd3) )
2329   ROM_LOAD( "rom2",         0x0800, 0x0800, CRC(caa705d1) SHA1(b4aefbea21fa9608e1dae2a09ae0d31270eb8c78) )
2330   ROM_LOAD( "rom3",         0x1000, 0x0800, CRC(e420641d) SHA1(103e7590f5acbac6991d665495f933c3a68da1c8) )
2331   ROM_LOAD( "rom4",         0x1800, 0x0800, CRC(04792d90) SHA1(cb477e4b8e4538def01c10b0348f8f8e3a2a9500) )
2332   ROM_LOAD( "2j",           0x2000, 0x0800, CRC(45f7cf34) SHA1(d1e0e0be6dec377b684625bdfdc5a3a8af847492) )
2333   ROM_LOAD( "rom6",         0x2800, 0x0800, CRC(b297bd4b) SHA1(0c48da41d9cf2a3456df5b1e8bf27fa641bc643b) )
2334   ROM_LOAD( "rom7",         0x3000, 0x0800, CRC(a50bf8d5) SHA1(5bca98e1c0838d27ec66bf4b906877977b212b6d) )
2335   ROM_LOAD( "rom8",         0x3800, 0x0800, CRC(d2c5c984) SHA1(a9432f9aff8a2f5ca1d347443efc008a177d8ae0) )
2336
2337   ROM_REGION( 0x10000, "audio", 0 )
2338   ROM_LOAD( "ot1.5c",           0x0000, 0x0800, CRC(bcd297f0) SHA1(8ed78487d76fd0a917ab7b258937a46e2cd9800c) )
2339   ROM_LOAD( "ot2.5d",           0x0800, 0x0800, CRC(de7912da) SHA1(8558b4eff5d7e63029b325edef9914feda5834c3) )
2340   ROM_LOAD( "ot3.5e",           0x1000, 0x0800, CRC(ba2fa933) SHA1(1f976d8595706730e29f93027e7ab4620075c078) )
2341
2342   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2343   ROM_LOAD( "rom9",         0x0000, 0x0800, CRC(55cd5acd) SHA1(b3e2ce71d4e48255d44cd451ee015a7234a108c8) )
2344   ROM_LOAD( "rom10",        0x0800, 0x0800, CRC(72e773b8) SHA1(6ce178df3bd6a4177c68761572a13a56d222c48f) )
2345
2346   ROM_REGION( 0x0020, "proms", 0 )
2347   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2348ROM_END
2349
2350ROM_START( theend )
2351   ROM_REGION( 0x10000, "main", 0 )
2352   ROM_LOAD( "ic13_1t.bin",  0x0000, 0x0800, CRC(93e555ba) SHA1(f684927cecabfbd7544f7549a6152c0a6a436019) )
2353   ROM_LOAD( "ic14_2t.bin",  0x0800, 0x0800, CRC(2de7ad27) SHA1(caf369fde632652a0a5fb11d3605f0d2386d297a) )
2354   ROM_LOAD( "ic15_3t.bin",  0x1000, 0x0800, CRC(035f750b) SHA1(5f70518e5dbfca0ba12ba4dc4f357ce8e6b27bc8) )
2355   ROM_LOAD( "ic16_4t.bin",  0x1800, 0x0800, CRC(61286b5c) SHA1(14464aa5284aecc9c6046e464ab3d13da89d8dda) )
2356   ROM_LOAD( "ic17_5t.bin",  0x2000, 0x0800, CRC(434a8f68) SHA1(3c8c099c7865997d475c096f1b1c93d88ab21543) )
2357   ROM_LOAD( "ic18_6t.bin",  0x2800, 0x0800, CRC(dc4cc786) SHA1(3311361a1eb29715aa41d61fbb3563014bd9eeb1) )
2358
2359   ROM_REGION( 0x10000, "audio", 0 )
2360   ROM_LOAD( "ic56_1.bin",   0x0000, 0x0800, CRC(7a141f29) SHA1(ca483943971c8fc7f5775a8a7cc6ddd331d48170) )
2361   ROM_LOAD( "ic55_2.bin",   0x0800, 0x0800, CRC(218497c1) SHA1(3e080621f2e83909a6f304a2d960a080bccbbdc2) )
2362
2363   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2364   ROM_LOAD( "ic30_2c.bin",  0x0000, 0x0800, CRC(68ccf7bf) SHA1(a8ea784a2660f855757ae0b30cb2a33ab6f2cd59) )
2365   ROM_LOAD( "ic31_1c.bin",  0x0800, 0x0800, CRC(4a48c999) SHA1(f1abcbfc3146a18dc3ff865e3ba278377a42a875) )
2366
2367   ROM_REGION( 0x0020, "proms", 0 )
2368   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
2369ROM_END
2370
2371ROM_START( theends )
2372   ROM_REGION( 0x10000, "main", 0 )
2373   ROM_LOAD( "ic13",         0x0000, 0x0800, CRC(90e5ab14) SHA1(b926801ab1cc1e2787a76ced6c7cffd6fce753d4) )
2374   ROM_LOAD( "ic14",         0x0800, 0x0800, CRC(950f0a07) SHA1(bde9f3c6cf060dc6f5b7652287b94e04bed7bcf7) )
2375   ROM_LOAD( "ic15",         0x1000, 0x0800, CRC(6786bcf5) SHA1(7556d3dc51d6a112b6357b8a36df05fd1a4d1cc9) )
2376   ROM_LOAD( "ic16",         0x1800, 0x0800, CRC(380a0017) SHA1(3354eb328a32537f722fe8a0949ddcab6cf21eb8) )
2377   ROM_LOAD( "ic17",         0x2000, 0x0800, CRC(af067b7f) SHA1(855c6ddf29fbfea004c7143fe29064abf53801ad) )
2378   ROM_LOAD( "ic18",         0x2800, 0x0800, CRC(a0411b93) SHA1(d644968758a1b73d13e09b24d24bfec82276e8f4) )
2379
2380   ROM_REGION( 0x10000, "audio", 0 )
2381   ROM_LOAD( "ic56",         0x0000, 0x0800, CRC(3b2c2f70) SHA1(bcccdacacfc9a3b5f1412dfba6bb0046d283bccc) )
2382   ROM_LOAD( "ic55",         0x0800, 0x0800, CRC(e0429e50) SHA1(27678fc3172cbca3ae1eae96e9d8a62561d5ce40) )
2383
2384   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
2385   ROM_LOAD( "ic30",         0x0000, 0x0800, CRC(527fd384) SHA1(92a384899d5acd2c689f637da16a0e2d11a9d9c6) )
2386   ROM_LOAD( "ic31",         0x0800, 0x0800, CRC(af6d09b6) SHA1(f3ad51dc88aa58fd39195ead978b039e0b0b585c) )
2387
2388   ROM_REGION( 0x0020, "proms", 0 )
2389   ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
2390ROM_END
2391
23921589ROM_START( triplep )
23931590   ROM_REGION( 0x10000, "main", 0 )
23941591   ROM_LOAD( "triplep.2g",   0x0000, 0x1000, CRC(c583a93d) SHA1(2bd4a02f945d64ef3ff814d0b8cbf32380d3f790) )
r4057r4058
27501947   ROM_LOAD( "cavelon.clr",  0x0000, 0x0020, CRC(d133356b) SHA1(58db4013a9ad77107f0d462c96363d7c38d86fa2) )
27511948ROM_END
27521949
2753ROM_START( skelagon )
2754   ROM_REGION( 0x10000, "main", 0 )
2755   /* first half of 36.bin is missing */
2756   ROM_LOAD( "31.bin",       0x1000, 0x1000, CRC(ae6f8647) SHA1(801e88b91c204f2797e5ce45390ea6eec27a3f54) )
2757   ROM_LOAD( "32.bin",       0x2000, 0x1000, CRC(a28c5838) SHA1(0a37de7986c494d1522ce76635dd1fa6d03f05c7) )
2758   ROM_LOAD( "33.bin",       0x3000, 0x1000, CRC(32f7e99c) SHA1(2718063a77eeeb8067a9cad7ff3d9e0266b61566) )
2759   ROM_LOAD( "37.bin",       0x7000, 0x1000, CRC(47f68a31) SHA1(6e15024f67c88a733ede8702d2a80ddb1892b27e) )
2760   ROM_LOAD( "24.bin",       0xc000, 0x1000, CRC(e6d7dc74) SHA1(c1e6d9598fb837775ee6550fea3cd4910572615e) )
2761   ROM_LOAD( "35.bin",       0xd000, 0x1000, CRC(5b2a0158) SHA1(66d2fb05a8daaa86bb547b4860d5bf27b4359326) )
2762   ROM_LOAD( "36.bin",       0xe000, 0x1000, BAD_DUMP CRC(f53ead29) SHA1(f8957b0c0558acc005f418adbfeb66d1d562c9ac) )
2763
2764   ROM_REGION( 0x10000, "audio", 0 )
2765   ROM_LOAD( "5.5j",         0x0000, 0x1000, CRC(59028fb6) SHA1(94105b5b03c81a948a409f7ea20312bb9c79c150) )
2766   ROM_LOAD( "6.6j",         0x1000, 0x1000, CRC(5427670f) SHA1(ffc3f7186d0319f0fd7ed25eb97bb0db7bc107c6) )
2767
2768   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for the sample CPU */
2769   ROM_LOAD( "1.1j",         0x0000, 0x1000, CRC(2f172c58) SHA1(4706d55fcfad4d5a87d96a0a0187f59997ef9720) )
2770   ROM_LOAD( "2.2j",         0x1000, 0x1000, CRC(a6ad2f6b) SHA1(14d1a93e507c349b14a1b26408cce23f089fa33c) )
2771   ROM_LOAD( "3.3j",         0x2000, 0x1000, CRC(fa1274fa) SHA1(e98cb602b265b209eaa4a9b3972e47c869ff863b) )
2772   ROM_LOAD( "4.4j",         0x3000, 0x1000, CRC(1cd33f3a) SHA1(cf9248fd6cb56ec81d354afe032a2dea810e834b) )
2773   ROM_LOAD( "10.bin",       0x4000, 0x1000, CRC(2c719de2) SHA1(0953e96f8be1cbab3f4a8e166457c74e986a87b1) )
2774   ROM_LOAD( "8.bin",        0x5000, 0x1000, CRC(350379dd) SHA1(e979251b11d6702170dd60ffd28fc15ea737588b) )
2775
2776   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
2777   ROM_LOAD( "38.bin",       0x0000, 0x1000, CRC(2fffa8b1) SHA1(6a6032f55b9fe1da209e4ed4423042efec773d4d) )
2778   ROM_LOAD( "39.bin",       0x1000, 0x1000, CRC(a854b5de) SHA1(dd038f20ee366d439f09f0c82fd6432101b3781a) )
2779
2780   ROM_REGION( 0x0020, "proms", 0 )
2781   ROM_LOAD( "6331.9g",      0x0000, 0x0020, CRC(ca1d9ccd) SHA1(27124759a06497c1bc1a64b6d3faa6ba924a8447) )
2782ROM_END
2783
27841950ROM_START( mimonscr )
27851951   ROM_REGION( 0x10000, "main", 0 )
27861952   ROM_LOAD( "mm1",          0x0000, 0x1000, CRC(0399a0c4) SHA1(8314124f9b535ce531663625d19cd3a76782ed3b) )
r4057r4058
28041970   ROM_LOAD( "c01s.6e",    0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
28051971ROM_END
28061972
2807ROM_START( scorpion )
2808   ROM_REGION( 0x10000, "main", 0 )
2809   ROM_LOAD( "1.2d",         0x0000, 0x1000, CRC(ba1219b4) SHA1(33c7843dba44152a8bc3223ea0c30b13609b80ba) )
2810   ROM_LOAD( "2.2f",         0x1000, 0x1000, CRC(c3909ab6) SHA1(0bec902ae4291fa0530f4c89ad45cc7aab888b7a) )
2811   ROM_LOAD( "3.2g",         0x2000, 0x1000, CRC(43261352) SHA1(49468cbed7e0286b260eef297bd5fad0ab9fd45b) )
2812   ROM_LOAD( "4.2h",         0x3000, 0x1000, CRC(aba2276a) SHA1(42b0378f06d2bdb4faaaa95274a6c0f965716877) )
2813   ROM_LOAD( "5.2k",         0x6000, 0x0800, CRC(952f78f2) SHA1(9562037b104fc1852c2d2650209a77ffce2cb90e) )
2814   ROM_CONTINUE(             0x5800, 0x0800 )
2815
2816   ROM_REGION( 0x10000, "audio", 0 )
2817   ROM_LOAD( "32_a4.7c",     0x0000, 0x1000, CRC(361b8a36) SHA1(550ac5f721aaa9fea5f6d63ba590d6b367525c23) )
2818   ROM_LOAD( "32_a5.7d",     0x1000, 0x1000, CRC(addecdd4) SHA1(ba28f1d9c7c6b5e8ecef56a4b3f64be13fc10d43) )
2819
2820   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
2821   ROM_LOAD( "32_f5.5f",     0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) )
2822   ROM_LOAD( "32_h5.5h",     0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
2823
2824   ROM_REGION( 0x3000, "speech", 0 ) /* Samples? / Speech? */
2825   ROM_LOAD( "32_a3.6e",     0x0000, 0x1000, CRC(279ae6f9) SHA1(a93b1d68c9f4b6ad62fdb8816285e61bd3b4b884) )
2826   ROM_LOAD( "32_a2.6d",     0x1000, 0x1000, CRC(90352dd4) SHA1(62c261a2f2fbd8eff31d5c72cf532d5e43d86dd3) )
2827   ROM_LOAD( "32_a1.6c",     0x2000, 0x1000, CRC(3bf2452d) SHA1(7a163e0ef108dd40d3beab5e9805886e45be744b) )
2828
2829   ROM_REGION( 0x0020, "proms", 0 )
2830   ROM_LOAD( "prom.6e",      0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2831ROM_END
2832
2833
2834ROM_START( scrpiona )
2835   /* this dump is bad (at least one rom) */
2836   ROM_REGION( 0x10000, "main", 0 )
2837   ROM_LOAD( "scor_d2.bin",  0x0000, 0x1000, BAD_DUMP CRC(c5b9daeb) SHA1(faf7a22013dd5f063eb8f506f3722cfd5522539a) )
2838   ROM_LOAD( "scor_e2.bin",  0x1000, 0x1000, BAD_DUMP CRC(82308d05) SHA1(26bc7c8b3ea0020fd1b93f6aaa29d82d04ae64b2) )
2839   ROM_LOAD( "scor_g2.bin",  0x2000, 0x1000, BAD_DUMP CRC(756b09cd) SHA1(9aec34e063fe8c0d1392db09daea2875d06eec46) )
2840   ROM_LOAD( "scor_h2.bin",  0x3000, 0x1000, BAD_DUMP CRC(a0457b93) SHA1(5ed32e117a97660dae001bd97fcb3f31e0debb24) )
2841   ROM_LOAD( "scor_k2.bin",  0x5800, 0x0800, BAD_DUMP CRC(42ec34d8) SHA1(b358d10a96490f325420b992e8e03bb3884e415a) )
2842   ROM_LOAD( "scor_l2.bin",  0x6000, 0x0800, BAD_DUMP CRC(6623da33) SHA1(99110005d00c80d674bde5d21608f50b85ee488c) )
2843
2844   ROM_REGION( 0x10000, "audio", 0 )
2845   ROM_LOAD( "32_a4.7c",     0x0000, 0x1000, CRC(361b8a36) SHA1(550ac5f721aaa9fea5f6d63ba590d6b367525c23) )
2846   ROM_LOAD( "32_a5.7d",     0x1000, 0x1000, CRC(addecdd4) SHA1(ba28f1d9c7c6b5e8ecef56a4b3f64be13fc10d43) )
2847
2848   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
2849   ROM_LOAD( "scor_f5.bin",  0x0000, 0x1000, CRC(60180a38) SHA1(518c1267523139aa4e27860012a722b67fe25b6d) )
2850   ROM_LOAD( "32_h5.5h",     0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
2851
2852   ROM_REGION( 0x3000, "speech", 0 ) /* Samples? / Speech? */
2853   ROM_LOAD( "scor_a3.bin",  0x0000, 0x1000, CRC(04abf178) SHA1(2e7f231413d9ec461ca21840f31d1d6b8b17c4d5) )
2854   ROM_LOAD( "scor_a2.bin",  0x1000, 0x1000, CRC(452d6354) SHA1(3d5397fddcc17b4d03b9cdc53a6439f159d1bfcc) )
2855   ROM_LOAD( "32_a1.6c",     0x2000, 0x1000, CRC(3bf2452d) SHA1(7a163e0ef108dd40d3beab5e9805886e45be744b) )
2856
2857   ROM_REGION( 0x0020, "proms", 0 )
2858   ROM_LOAD( "prom.6e",      0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2859ROM_END
2860
28611973ROM_START( ad2083 )
28621974   ROM_REGION( 0x10000, "main", 0 )
28631975   ROM_LOAD( "ad0.10o",      0x0000, 0x2000, CRC(4d34325a) SHA1(4a0eb1cd94382c44ab2642d734d3da9025872eba) )
r4057r4058
28851997ROM_END
28861998
28871999
2888ROM_START( scrpionb )
2889   ROM_REGION( 0x10000, "main", 0 )
2890   ROM_LOAD( "ic109.2d",         0x0000, 0x1000, CRC(f54688c9) SHA1(2881d5238733353b9c277a2829d157688a87601b) )
2891   ROM_LOAD( "ic110.2e",         0x1000, 0x1000, CRC(91aaaa12) SHA1(2a5e5eb5aeec5637ee4675930f67158a969e0d5d) )
2892   ROM_LOAD( "ic111.2g",         0x2000, 0x1000, CRC(4c3720da) SHA1(5b2758c8a91f9463bf98abf2b52af946c5e90cf0) )
2893   ROM_LOAD( "ic112.2h",         0x3000, 0x1000, CRC(53e2a983) SHA1(cfe272055a92793de76dd1cff617b13281815485) )
2894   ROM_LOAD( "ic113.2k",         0x6000, 0x0800, CRC(e4ad299a) SHA1(712cab86eadeba9e859f7bae98eb289f00d2e217) )
2895   ROM_CONTINUE(             0x5800, 0x0800 )
2896
2897   ROM_REGION( 0x10000, "audio", 0 )
2898   ROM_LOAD( "32_a4.7c",     0x0000, 0x1000, CRC(361b8a36) SHA1(550ac5f721aaa9fea5f6d63ba590d6b367525c23) ) // missing in this dump
2899   ROM_LOAD( "ic13.7d",     0x1000, 0x1000, CRC(addecdd4) SHA1(ba28f1d9c7c6b5e8ecef56a4b3f64be13fc10d43) )
2900
2901   ROM_REGION( 0x2000, "gfx1", ROMREGION_DISPOSE )
2902   ROM_LOAD( "ic72.5f",     0x0000, 0x1000, CRC(1e5da9d6) SHA1(ca8b27e6dd40e4ca13e7e6b5f813bafca78b62f4) )
2903   ROM_LOAD( "ic73.5h",     0x1000, 0x1000, CRC(a57adb0a) SHA1(d97c7dc4a6c5efb59cc0148e2498156c682c6714) )
2904
2905   ROM_REGION( 0x3000, "speech", 0 ) /* Samples? / Speech? */
2906   ROM_LOAD( "ic25.6e",     0x0000, 0x1000, CRC(04abf178) SHA1(2e7f231413d9ec461ca21840f31d1d6b8b17c4d5) )
2907   ROM_LOAD( "ic24.6d",     0x1000, 0x1000, CRC(90352dd4) SHA1(62c261a2f2fbd8eff31d5c72cf532d5e43d86dd3) )
2908   ROM_LOAD( "ic23.6c",     0x2000, 0x1000, CRC(3bf2452d) SHA1(7a163e0ef108dd40d3beab5e9805886e45be744b) )
2909
2910   ROM_REGION( 0x0020, "proms", 0 )
2911   ROM_LOAD( "prom.6e",      0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
2912ROM_END
2913
2914
29152000ROM_START( turpins )
29162001   ROM_REGION( 0x10000, "main", 0 )
29172002   ROM_LOAD( "t1.bin",   0x0000, 0x1000, CRC(89dd50cc) SHA1(90e18f71324056a63272a02cabb0a6fe2a96dd0d) )
src/mame/drivers/igs009.c
r4057r4058
4242   SET_TILE_INFO(
4343         0,
4444         (code)+(((tile_index+1)&0x3)*0x100),
45         0,
45         (code & 0x80) ? 0xc : 0,
4646         0);
4747}
4848
r4057r4058
7474   SET_TILE_INFO(
7575         0,
7676         (code)+(((tile_index+1)&0x3)*0x100),
77         0,
77         (code & 0x80) ? 0xc : 0,
7878         0);
7979}
8080
r4057r4058
106106   SET_TILE_INFO(
107107         0,
108108         (code)+(((tile_index+1)&0x3)*0x100),
109         0,
109         (code & 0x80) ? 0xc : 0,
110110         0);
111111}
112112
r4057r4058
138138   SET_TILE_INFO(
139139         0,
140140         (code)+(((tile_index+1)&0x3)*0x100),
141         0,
141         (code & 0x80) ? 0xc : 0,
142142         0);
143143}
144144
r4057r4058
731731   ROM_LOAD( "jingle133isp.u38", 0x00000, 0x20000, CRC(a42d73b1) SHA1(93157e9630d5c8bb34c71186415d0aa8c5d51951) )
732732
733733   ROM_REGION( 0x2dd, "plds",0 )
734   ROM_LOAD( "palce16v8h-ch-jin-u12v.u12", 0x000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) )
735   ROM_LOAD( "palce16v8h-ch-jin-u33v.u33", 0x000, 0x117, CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) )
734   ROM_LOAD( "palce16v8h-ch-jin-u12v.u12", 0x000, 0x117, BAD_DUMP CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) )
735   ROM_LOAD( "palce16v8h-ch-jin-u33v.u33", 0x000, 0x117, BAD_DUMP CRC(c89d2f52) SHA1(f9d52d9c42ef95b7b85bbf6d09888ebdeac11fd3) )
736736   ROM_LOAD( "palce22v10h-ajbu24.u24",     0x000, 0x2dd, CRC(6310f441) SHA1(b610e170ccca1fcb06a57f718ece1408b696ba9c) )
737   ROM_LOAD( "palce22v10h-ch-jin-u27.u27", 0x000, 0x2dd, CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) )
737   ROM_LOAD( "palce22v10h-ch-jin-u27.u27", 0x000, 0x2dd, BAD_DUMP CRC(5c4e9024) SHA1(e9d1e4df3d79c21f4ce053a84bb7b7a43d650f91) )
738738ROM_END
739739
740740static DRIVER_INIT( jingbell )
r4057r4058
771771   ROM_LOAD( "prg", 0x00000, 0x20000, CRC(1c02b8cc) SHA1(b8a29cbd96581f8ae1c1028279b8ee703be29f5f) )
772772
773773   ROM_REGION( 0x8000, "data", 0 )
774   ROM_COPY( "main", 0x10000, 0x00000, 0x8000 )
774   ROM_COPY( "main", 0x18000, 0x00000, 0x8000 )
775775
776   ROM_REGION( 0x180000, "gfx1", ROMREGION_DISPOSE ) // 6bpp (2bpp per rom) font at tile # 0x4000
776   ROM_REGION( 0x180000, "tempgfx", ROMREGION_DISPOSE ) // 6bpp (2bpp per rom) font at tile # 0x4000
777777   ROM_LOAD( "49", 0x000000, 0x80000, BAD_DUMP CRC(a9d9367d) SHA1(91c74740fc8394f1e1cd68feb8c993afd2042d70) )
778778   ROM_LOAD( "50", 0x080000, 0x80000, CRC(48f6190d) SHA1(b430131a258b4e2fc178ac0e3e3f0010a82eac65) )
779779   ROM_LOAD( "51", 0x100000, 0x80000, CRC(30a2ef85) SHA1(38ea637acd83b175eccd2969ef21879265b88992) )
780780
781   ROM_REGION( 0x180000, "gfx2", ROMREGION_DISPOSE ) // 6bpp (2bpp per rom) font at tile # 0x4000
782   ROM_COPY( "gfx1", 0x00000, 0x00000, 0x180000 )
781   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE )
782   ROM_COPY( "tempgfx", 0x000000, 0x00000, 0x40000 )
783   ROM_COPY( "tempgfx", 0x080000, 0x40000, 0x40000 )
784   ROM_COPY( "tempgfx", 0x100000, 0x80000, 0x40000 )
783785
786   ROM_REGION( 0xc0000, "gfx2", ROMREGION_DISPOSE )
787   ROM_COPY( "tempgfx", 0x040000, 0x00000, 0x40000 )
788   ROM_COPY( "tempgfx", 0x0c0000, 0x40000, 0x40000 )
789   ROM_COPY( "tempgfx", 0x140000, 0x80000, 0x40000 )
790
791
784792   ROM_REGION( 0x20000, "oki", ROMREGION_ERASE00 )
785793   /* no OKI on this */
786794ROM_END
src/mame/drivers/jangou.c
r4057r4058
120120
121121static UINT8 jangou_gfx_nibble(running_machine *machine,UINT16 niboffset)
122122{
123   UINT8 *blit_rom = memory_region(machine,"gfx");
123   const UINT8 *const blit_rom = memory_region(machine,"gfx");
124124
125125   if (niboffset&1)
126126   {
r4057r4058
814814   ROM_LOAD( "rom6.bin", 0x00000, 0x0800, CRC(33965a89) SHA1(92912cea76a472d9b709c664d9818844a07fcc32)  ) // = mq3    Moon Quasar
815815   ROM_LOAD( "rom7.bin", 0x00800, 0x0800, CRC(481b64cc) SHA1(3f35c545fc784ed4f969aba2d7be6e13a5ae32b7)  ) // = cc06   Crazy Climber (US)
816816
817   ROM_REGION( 0x6000, "gfx", 0 )
817   ROM_REGION( 0x10000, "gfx", 0 )
818818   ROM_LOAD( "rom1.bin", 0x00000, 0x02000, CRC(92033f37) SHA1(aa407c2feb1cbb7cbc6c59656338453c5a670749)  )
819819   ROM_LOAD( "rom2.bin", 0x02000, 0x02000, CRC(0588cc48) SHA1(f769ece2955eb9f055c499b6243a2fead9d07984)  )
820820   ROM_LOAD( "rom3.bin", 0x04000, 0x02000, CRC(ce00ff56) SHA1(c5e58707a5dd0f57c34b09de542ef30e96ab95d1)  )
src/mame/drivers/namcos21.c
r4057r4058
327327static UINT16 pointram_control;
328328
329329
330#define ENABLE_LOGGING      0
330331
332
331333#define DSP_BUF_MAX (4096*12)
332334static struct
333335{
r4057r4058
418420{
419421   unsigned offs = mpDspState->slaveInputStart+mpDspState->slaveBytesAvailable++;
420422   mpDspState->slaveInputBuffer[offs%DSP_BUF_MAX] = data;
421   logerror( "+%04x(#%04x)\n", data, mpDspState->slaveBytesAvailable );
423   if (ENABLE_LOGGING) logerror( "+%04x(#%04x)\n", data, mpDspState->slaveBytesAvailable );
422424   mpDspState->slaveActive = 1;
423425   if( mpDspState->slaveBytesAvailable >= DSP_BUF_MAX )
424426   {
r4057r4058
446448            {
447449               addr = namcos21_dspram16[addr];
448450               mpDspState->masterSourceAddr = addr;
449               logerror( "LOOP:0x%04x\n", addr );
451               if (ENABLE_LOGGING) logerror( "LOOP:0x%04x\n", addr );
450452               addr&=0x7fff;
451453               if( old==addr )
452454               {
r4057r4058
461463         }
462464         else if( mode==0 )
463465         { /* direct data transfer */
464            logerror( "DATA TFR(0x%x)\n", code );
466            if (ENABLE_LOGGING) logerror( "DATA TFR(0x%x)\n", code );
465467            TransmitWordToSlave( code );
466468            for( i=0; i<code; i++ )
467469            {
r4057r4058
471473         }
472474         else if( code==0x18 || code==0x1a )
473475         {
474            logerror( "HEADER TFR(0x%x)\n", code );
476            if (ENABLE_LOGGING) logerror( "HEADER TFR(0x%x)\n", code );
475477            TransmitWordToSlave( code+1 );
476478            for( i=0; i<code; i++ )
477479            {
r4057r4058
482484         else
483485         {
484486            INT32 masterAddr = ReadPointROMData(machine, code);
485            logerror( "OBJ TFR(0x%x)\n", code );
487            if (ENABLE_LOGGING) logerror( "OBJ TFR(0x%x)\n", code );
486488            {
487489               UINT16 len = namcos21_dspram16[addr++];
488490               for(;;)
r4057r4058
512514                     }
513515                     else
514516                     {
515                        logerror( "TFR NOP?\n" );
517                        if (ENABLE_LOGGING) logerror( "TFR NOP?\n" );
516518                     }
517519                  }
518520               } /* for(;;) */
r4057r4058
571573      {
572574         mpDspState->slaveBytesAdvertised--;
573575      }
574      logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context(space->machine), data, mpDspState->slaveBytesAvailable );
576      if (ENABLE_LOGGING) logerror( "%s:-%04x(0x%04x)\n", cpuexec_describe_context(space->machine), data, mpDspState->slaveBytesAvailable );
575577   }
576578   return data;
577579} /* ReadWordFromSlaveInput */
r4057r4058
604606      if( mpDspState->masterSourceAddr &&
605607         offset == 1+(mpDspState->masterSourceAddr&0x7fff) )
606608      {
607         logerror( "IDC-CONTINUE\n" );
609         if (ENABLE_LOGGING) logerror( "IDC-CONTINUE\n" );
608610         TransferDspData(space->machine);
609611      }
610612      else if( namcos2_gametype == NAMCOS21_SOLVALOU &&
r4057r4058
653655
654656static WRITE16_HANDLER( dsp_port0_w )
655657{ /* unused? */
656   logerror( "PTRAM_LO(0x%04x)\n", data );
658   if (ENABLE_LOGGING) logerror( "PTRAM_LO(0x%04x)\n", data );
657659} /* dsp_port0_w */
658660
659661static READ16_HANDLER( dsp_port1_r )
r4057r4058
668670
669671static WRITE16_HANDLER( dsp_port1_w )
670672{ /* unused? */
671   logerror( "PTRAM_HI(0x%04x)\n", data );
673   if (ENABLE_LOGGING) logerror( "PTRAM_HI(0x%04x)\n", data );
672674} /* dsp_port1_w */
673675
674676static READ16_HANDLER( dsp_port2_r )
r4057r4058
678680
679681static WRITE16_HANDLER( dsp_port2_w )
680682{
681   logerror( "IDC ADDR INIT(0x%04x)\n", data );
683   if (ENABLE_LOGGING) logerror( "IDC ADDR INIT(0x%04x)\n", data );
682684   mpDspState->masterSourceAddr = data;
683685   TransferDspData(space->machine);
684686} /* dsp_port2_w */
r4057r4058
707709
708710static WRITE16_HANDLER( dsp_port8_w )
709711{ /* IRQ-enable? */
710   logerror( "port8_w(%d)\n", data );
712   if (ENABLE_LOGGING) logerror( "port8_w(%d)\n", data );
711713   if( data )
712714   {
713715      mpDspState->masterFinished = 1;
r4057r4058
732734   /* INT2 begin: 1 */
733735   /* direct-draw begin: 0 */
734736   /* INT1 begin: 1 */
735//  logerror( "dsp_porta_w(0x%04x)\n", data );
737//  if (ENABLE_LOGGING) logerror( "dsp_porta_w(0x%04x)\n", data );
736738} /* dsp_porta_w */
737739
738740static READ16_HANDLER(dsp_portb_r)
r4057r4058
792794
793795static WRITE16_HANDLER( dsp_xf_w )
794796{
795   logerror("xf(%d)\n",data);
797   if (ENABLE_LOGGING) logerror("xf(%d)\n",data);
796798}
797799
798800static ADDRESS_MAP_START( master_dsp_program, ADDRESS_SPACE_PROGRAM, 16 )
r4057r4058
881883      }
882884      else if( count==0 )
883885      {
884         logerror( "RenderSlaveOutput\n" );
886         if (ENABLE_LOGGING) logerror( "RenderSlaveOutput\n" );
885887         exit(1);
886888      }
887889   }
r4057r4058
916918
917919static WRITE16_HANDLER( slave_XF_output_w )
918920{
919   logerror( "0x%x:slaveXF(%d)\n", cpu_get_pc(space->cpu), data );
921   if (ENABLE_LOGGING) logerror( "0x%x:slaveXF(%d)\n", cpu_get_pc(space->cpu), data );
920922} /* slave_XF_output_w */
921923
922924static READ16_HANDLER( slave_portf_r )
src/mame/drivers/cb2001.c
r4057r4058
4545#define xxxx 0x90 /* Unknown */
4646
4747const UINT8 cb2001_decryption_table[256] = {
48   0xe8,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 00 */
49//  pppp
50   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x32,xxxx,xxxx,xxxx,0x3a,xxxx,xxxx,xxxx, /* 10 */
51//                                           ????                ????
52   xxxx,0x8e,xxxx,xxxx,xxxx,0x49,xxxx,xxxx, xxxx,xxxx,xxxx,0x75,xxxx,xxxx,xxxx,xxxx, /* 20 */
53//       !!!!                ????                           pppp
54   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xbe,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xb0,xxxx, /* 30 */
55//                                pppp                                     ????
48   0xe8,xxxx,xxxx,xxxx,xxxx,0x61,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 00 */
49//  pppp                     ????
50   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x32,xxxx,xxxx,xxxx,0x3a,xxxx,xxxx,0x1f, /* 10 */
51//                                           pppp                pppp           ????
52   xxxx,0x8e,xxxx,0x0f,xxxx,0x49,0xbc,xxxx, xxxx,xxxx,xxxx,0x75,xxxx,xxxx,xxxx,xxxx, /* 20 */
53//       !!!!      ????      ???? ????                      pppp
54   0x9d,xxxx,xxxx,xxxx,xxxx,xxxx,0xbe,xxxx, xxxx,xxxx,0x74,xxxx,xxxx,0xa6,0xbf,xxxx, /* 30 */
55//  ????                          pppp                 ????           ???? ????
5656   xxxx,0xea,xxxx,xxxx,xxxx,0xb0,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 40 */
5757//       !!!!                gggg
58   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0x78,xxxx,xxxx,xxxx, /* 50 */
58   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x42,xxxx, xxxx,xxxx,xxxx,xxxx,0xeb,xxxx,xxxx,xxxx, /* 50 */
5959//                                ????                           ????
60   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xba,xxxx, /* 60 */
61//                                                                         gggg
62   0xc3,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 70 */
63//  pppp                                               ????
60   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,0xa5,xxxx,xxxx,xxxx,xxxx,0xba,xxxx, /* 60 */
61//                                                ????                     gggg
62   0xc3,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, 0x72,xxxx,0xf2,xxxx,xxxx,xxxx,xxxx,xxxx, /* 70 */
63//  pppp                                     ????      ????
6464   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0x34, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* 80 */
6565//                                     ????
66   xxxx,xxxx,0xe9,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xb9,xxxx,xxxx,xxxx, /* 90 */
67//            ????                                               pppp
68   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xb8, xxxx,xxxx,0xfa,xxxx,xxxx,xxxx,xxxx,xxxx, /* A0 */
69//                                     !!!!            ????
70   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* B0 */
71//
72   xxxx,xxxx,0xee,xxxx,xxxx,0xe2,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* C0 */
73//            ????           pppp
74   xxxx,xxxx,0x46,xxxx,xxxx,xxxx,xxxx,xxxx, 0x88,xxxx,xxxx,xxxx,xxxx,0xfa,0xc7,xxxx, /* D0 */
75//              ????                           ????                     ???? !!!!
76   0xb0,xxxx,xxxx,0xc6,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* E0 */
66   xxxx,xxxx,0xe9,xxxx,xxxx,0xbe,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0xb9,xxxx,xxxx,xxxx, /* 90 */
67//            ????           ????                                pppp
68   xxxx,xxxx,xxxx,0x06,0xaa,0x9c,xxxx,0xb8, xxxx,xxxx,0xfc,xxxx,xxxx,xxxx,xxxx,xxxx, /* A0 */
69//                 ???? ???? ????      !!!!            ????
70   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,0x1e,xxxx,0x07,0xcf, /* B0 */
71//                                                               ????      ???? ????
72   xxxx,xxxx,0xee,xxxx,xxxx,0xe2,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,0xa4,xxxx, /* C0 */
73//            ????           pppp                                          ????
74   xxxx,xxxx,0x46,xxxx,0x60,xxxx,xxxx,xxxx, 0x88,xxxx,xxxx,xxxx,xxxx,0xfa,0xc7,xxxx, /* D0 */
75//              pppp      ????                 pppp                     ???? !!!!
76   0x8a,xxxx,xxxx,0xc6,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* E0 */
7777//  ????           !!!!
7878   xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, /* F0 */
7979//
r4057r4058
8181
8282/* robiza notes:
8383
84
858456 -> ????
8685
87
88865c -> conditional jmp for sure
8987
9088aa -> ????
r4057r4058
9391d8 ????
9492dd -> fa (di)
9593
96
9794guessed:
989545 -> b0 (mov al,#value)
99966e -> ba (mov dw,#value)
10097c2 -> ee (out dw,al)
10198
99probably:
102100
103
104probably:
10500 -> e8 (call)
1061012b -> conditional jmp for sure (75)
10710236 -> be
10841 -> ea (jmp_far)
10970 -> c3 (ret)
1101039c -> it's a counter (like mov cw,#value) -> not sure the register (cw,bw,....) -> b9 (cw)
111104c5 -> 75 (loop?)
112105
106very probably:
10700 -> e8 (call)
10841 -> ea (jmp_far)
10970 -> c3 (ret)
110
113111checked against gussun and quizf1 (start up code):
11411221 -> 8e
115113a7 -> b8
116114de -> c7
117115e3 -> c6
118116
117opcodes: 36,9c,00,18,d8,d2,c5,70 probably:
118e1af1 36 62 06 mov ix,0662
119      9c 04 00 mov cw,0004
120      00 94 17 call e328e
121
122e328e 18 c0 xor al,al
123      d8 04 mov byte ptr [ix],al
124      d2    inc ix
125      c5 fb dbnz e3290
126      70    ret
119127*/
120128
121129
src/mame/drivers/mpoker.c
r0r4058
1/*
2
3Merit Poker?
4
5*/
6
7#include "driver.h"
8#include "cpu/z80/z80.h"
9
10static UINT8* mpoker_video;
11
12
13VIDEO_START(mpoker)
14{
15
16}
17
18VIDEO_UPDATE(mpoker)
19{
20   int y,x;
21   int count;
22   const gfx_element *gfx = screen->machine->gfx[0];
23
24   count = 0;
25   for (y=0;y<32;y++)
26   {
27      for (x=0;x<32;x++)
28      {
29         UINT16 dat = mpoker_video[count];
30         UINT16 col = mpoker_video[count+0x400];
31         drawgfx(bitmap,gfx,dat,col,0,0,x*16,y*16,cliprect,TRANSPARENCY_NONE,0);
32         count++;
33      }
34
35   }
36   return 0;
37}
38
39static READ8_HANDLER( test_r )
40{
41   return mame_rand(space->machine);
42}
43
44static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
45   AM_RANGE(0x0000, 0x2fff) AM_ROM
46   AM_RANGE(0x3800, 0x3fff) AM_RAM
47   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&mpoker_video)
48   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("IN0")
49   AM_RANGE(0x8001, 0x8001) AM_READ(test_r)
50   AM_RANGE(0x8002, 0x8002) AM_READ_PORT("IN1")
51   AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN2")
52//  AM_RANGE(0x8004, 0x8004) AM_READ(test_r)
53//  AM_RANGE(0x8005, 0x8005) AM_READ(test_r)
54//  AM_RANGE(0x8006, 0x8006) AM_READ(test_r)
55//  AM_RANGE(0x8007, 0x8007) AM_READ(test_r)
56ADDRESS_MAP_END
57
58static INPUT_PORTS_START( mpoker )
59   PORT_START("IN0")
60   PORT_DIPNAME( 0x01, 0x01, "IN0" )
61   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
62   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
63   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
64   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
65   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
66   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
67   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
68   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
69   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
70   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
71   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
72   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
73   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
74   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
75   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
76   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
77   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
78   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
79   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
80   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
81   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
82   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
83   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
84   PORT_START("IN1")
85   PORT_DIPNAME( 0x01, 0x01, "IN1" )
86   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
87   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
88   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
89   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
90   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
91   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
92   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
93   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
94   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
95   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
96   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
97   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
98   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
99   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
100   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
101   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
102   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
103   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
104   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
105   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
106   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
107   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
108   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
109   PORT_START("IN2")
110   PORT_DIPNAME( 0x01, 0x01, "IN2" )
111   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
112   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
113   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
114   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
115   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
116   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
117   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
118   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
119   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
120   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
121   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
122   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
123   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
124   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
125   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
126   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
127   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
128   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
129   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
130   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
131   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
132   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
133   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
134INPUT_PORTS_END
135
136
137static const gfx_layout tiles16x16_layout =
138{
139   16,16,
140   RGN_FRAC(1,1),
141   1,
142   { 0 },
143   { 0, 1, 2, 3, 4, 5, 6, 7,8,9,10,11,12,13,14,15 },
144   { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
145     8*16, 9*16,10*16,11*16,12*16,13*16,14*16,15*16},
146   16*16
147};
148
149static GFXDECODE_START( mpoker )
150   GFXDECODE_ENTRY( "gfx1", 0, tiles16x16_layout, 0, 16 )
151GFXDECODE_END
152
153static MACHINE_DRIVER_START( mpoker )
154   /* basic machine hardware */
155   MDRV_CPU_ADD("main", Z80,4000000)       /* ? MHz */
156   MDRV_CPU_PROGRAM_MAP(main_map,0)
157   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
158
159   /* video hardware */
160   MDRV_SCREEN_ADD("main", RASTER)
161   MDRV_SCREEN_REFRESH_RATE(60)
162   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
163   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
164   MDRV_SCREEN_SIZE(512, 256)
165   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
166
167   MDRV_GFXDECODE(mpoker)
168   MDRV_PALETTE_LENGTH(0x100)
169
170   MDRV_VIDEO_START(mpoker)
171   MDRV_VIDEO_UPDATE(mpoker)
172MACHINE_DRIVER_END
173
174ROM_START( mpoker )
175   ROM_REGION( 0x3000, "main", 0 )
176   ROM_LOAD( "u13_mlt10_mk2716j.bin", 0x0000, 0x0800, CRC(ce2da863) SHA1(ddb921ac2fdd965138a91757843d3035144a7007) )
177   ROM_LOAD( "u14_mlt11_mk2716j.bin", 0x0800, 0x0800, CRC(1382d166) SHA1(a8e7339f94d65b9540a8c16190a28ff0af48ccb4) )
178   ROM_LOAD( "u15_mlt12_mk2716j.bin", 0x1000, 0x0800, CRC(eb12716c) SHA1(1589cb0aa180a3bfa5cb3da200b71f77c2191272) )
179   ROM_LOAD( "u16_mlt13_mk2716j.bin", 0x1800, 0x0800, CRC(e2d80ff0) SHA1(f8aaa513f57da458ca89f999e30ea6b2d2ef41d3) )
180   ROM_LOAD( "u17_mlt14_mk2716j.bin", 0x2000, 0x0800, CRC(36efcdf1) SHA1(d6fdc6abb1dbb5f812dc1c1ecb8d369bfcbf2b8a) )
181   ROM_LOAD( "u18_mlt15_mk2716j.bin", 0x2800, 0x0800, CRC(7701c7df) SHA1(abf19f75367f926e49031e2fb4021172ebf176e1) )
182
183   ROM_REGION( 0x2000, "gfx1", 0 )
184   ROM_LOAD( "u68_cgm0_mk2716j.bin", 0x0000, 0x0800, CRC(3e4148e3) SHA1(bc5d173cc6ff17e0a7f06d36790e20d254be0377) )
185   ROM_LOAD( "u67_cgm1_mk2716j.bin", 0x0800, 0x0800, CRC(c66c30ed) SHA1(9fb8fc669da37ff2e0379b023349ed314c8dcba4) )
186   ROM_LOAD( "u66_cgm2_mk2716j.bin", 0x1000, 0x0800, CRC(3b6b98d3) SHA1(9fc1d9d61d67ad696750c21ef9a19968ddb0a9e1) )
187   ROM_LOAD( "u65_cgm3_mk2716j.bin", 0x1800, 0x0800, CRC(d61ae9d1) SHA1(219123518999fc925397db4f442ac444dfddffbe) )
188ROM_END
189
190GAME( 1983, mpoker,  0,    mpoker, mpoker,  0, ROT0, "Merit", "Merit Poker", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/qix.c
r4057r4058
560560
561561   /* high interleave needed to ensure correct text in service mode */
562562   /* Zookeeper settings and high score table seem especially sensitive to this */
563   MDRV_QUANTUM_TIME(HZ(60000))
563   MDRV_QUANTUM_PERFECT_CPU("main")
564564
565565   MDRV_MACHINE_START(qix)
566566   MDRV_MACHINE_RESET(qix)
src/mame/drivers/cps3.c
r4057r4058
27212721   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* GFX Region */
27222722
27232723   DISK_REGION( "cdrom" )
2724   DISK_IMAGE_READONLY( "33s000", 0, MD5(f159ad85cc94ced3ddb9ef5e92173a9f) SHA1(47c7ae0f2dc47c7d28bdf66d378a3aaba4c99c75) )
2724   DISK_IMAGE_READONLY( "cap-33s-2", 0, SHA1(24e78b8c66fb1573ffd642ee51607f3b53ed40b7) MD5(cf63f3dbcc2653b95709133fe79c7225) )
27252725ROM_END
27262726
27272727ROM_START( sfiii3a )
r4057r4058
27322732   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* GFX Region */
27332733
27342734   DISK_REGION( "cdrom" )
2735   DISK_IMAGE_READONLY( "cap-33s-2", 0, SHA1(24e78b8c66fb1573ffd642ee51607f3b53ed40b7) MD5(cf63f3dbcc2653b95709133fe79c7225) )
2735   DISK_IMAGE_READONLY( "33s000", 0, MD5(f159ad85cc94ced3ddb9ef5e92173a9f) SHA1(47c7ae0f2dc47c7d28bdf66d378a3aaba4c99c75) )
27362736ROM_END
27372737
27382738ROM_START( redearth )
r4057r4058
27572757   DISK_IMAGE_READONLY( "wzd000", 0, MD5(028ff12a4ce34118dd0091e87c8cdd08) SHA1(6d4e6b7fff4ff3f04e349479fa5a1cbe63e673b8) )
27582758ROM_END
27592759
2760
27612760ROM_START( jojo )
27622761   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27632762   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
r4057r4058
27662765   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* GFX Region */
27672766
27682767   DISK_REGION( "cdrom" )
2769   DISK_IMAGE_READONLY( "jjk000", 0, MD5(05440ecf90e836207a27a99c817a3328) SHA1(d5a11315ac21e573ffe78e63602ec2cb420f361f) )
2768   DISK_IMAGE_READONLY( "cap-jjk-160", 0, SHA1(74fb14d838d98c3e10baa08e6f7b2464d840dcf0) MD5(93cc16f11a88c8f5268cb96baebc0a13) )
27702769ROM_END
27712770
2772ROM_START( jojoalt )
2771ROM_START( jojoa )
27732772   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
27742773   ROM_LOAD( "jojo_japan.29f400.u2", 0x000000, 0x080000, CRC(02778f60) SHA1(a167f9ebe030592a0cdb0c6a3c75835c6a43be4c) )
27752774
r4057r4058
27772776   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* GFX Region */
27782777
27792778   DISK_REGION( "cdrom" )
2780   DISK_IMAGE_READONLY( "cap-jjk-160", 0, SHA1(74fb14d838d98c3e10baa08e6f7b2464d840dcf0) MD5(93cc16f11a88c8f5268cb96baebc0a13) )
2779   DISK_IMAGE_READONLY( "jjk000", 0, MD5(05440ecf90e836207a27a99c817a3328) SHA1(d5a11315ac21e573ffe78e63602ec2cb420f361f) )
27812780ROM_END
27822781
27832782ROM_START( jojoba )
r4057r4058
28082807   ROM_LOAD( "50",  0x2000000, 0x400000, CRC(58933dc2) SHA1(1f1723be676a817237e96b6e20263b935c59daae) )
28092808ROM_END
28102809
2811
28122810ROM_START( sfiii2n )
28132811   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28142812   ROM_LOAD( "sfiii2_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(fd297c0d) SHA1(4323deda2789f104b53f32a663196ec16de73215) )
r4057r4058
28252823   ROM_LOAD( "51",  0x2800000, 0x800000, CRC(1102b8eb) SHA1(c7dd2ee3a3214c6ec47a03fe3e8c941775d57f76) )
28262824ROM_END
28272825
2828
28292826ROM_START( sfiii3n )
28302827   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28312828   ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) )
28322829
28332830   ROM_REGION32_BE( 0x800000*2, "user4", ROMREGION_ERASEFF ) /* cd content region */
2834   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(77233d39) SHA1(59c3f890fdc33a7d8dc91e5f9c4e7b7019acfb00) )
2831   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(ba7f76b2) SHA1(6b396596dea009b34af17484919ae37eda53ec65) )
28352832   ROM_LOAD( "20",  0x0800000, 0x800000, CRC(5ca8faba) SHA1(71c12638ae7fa38b362d68c3ccb4bb3ccd67f0e9) )
28362833   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* cd content region */
28372834   ROM_LOAD( "30",  0x0000000, 0x800000, CRC(b37cf960) SHA1(60310f95e4ecedee85846c08ccba71e286cda73b) )
r4057r4058
28492846   ROM_LOAD( "sfiii3_japan_nocd.29f400.u2", 0x000000, 0x080000, CRC(1edc6366) SHA1(60b4b9adeb030a33059d74fdf03873029e465b52) )
28502847
28512848   ROM_REGION32_BE( 0x800000*2, "user4", ROMREGION_ERASEFF ) /* cd content region */
2852   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(ba7f76b2) SHA1(6b396596dea009b34af17484919ae37eda53ec65) )
2849   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(77233d39) SHA1(59c3f890fdc33a7d8dc91e5f9c4e7b7019acfb00) )
28532850   ROM_LOAD( "20",  0x0800000, 0x800000, CRC(5ca8faba) SHA1(71c12638ae7fa38b362d68c3ccb4bb3ccd67f0e9) )
28542851   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* cd content region */
28552852   ROM_LOAD( "30",  0x0000000, 0x800000, CRC(b37cf960) SHA1(60310f95e4ecedee85846c08ccba71e286cda73b) )
r4057r4058
28672864   ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
28682865
28692866   ROM_REGION32_BE( 0x800000*2, "user4", ROMREGION_ERASEFF ) /* cd content region */
2870   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(e40dc123) SHA1(517e7006349b5a8fd6c30910362583f48d009355) )
2871   ROM_LOAD( "20",  0x0800000, 0x800000, CRC(0571e37c) SHA1(1aa28ef6ea1b606a55d0766480b3ee156f0bca5a) )
2867   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(bc612872) SHA1(18930f2906176b54a9b8bec56f06dda3362eb418) )
2868   ROM_LOAD( "20",  0x0800000, 0x800000, CRC(0e1daddf) SHA1(34bb4e0fb86258095a7b20f60174453195f3735a) )
28722869   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* cd content region */
28732870   ROM_LOAD( "30",  0x0000000, 0x800000, CRC(1d99181b) SHA1(25c216de16cefac2d5892039ad23d07848a457e6) )
28742871   ROM_LOAD( "31",  0x0800000, 0x800000, CRC(6889fbda) SHA1(53a51b993d319d81a604cdf70b224955eacb617e) )
r4057r4058
28772874   ROM_LOAD( "50",  0x2000000, 0x400000, CRC(1c749cc7) SHA1(23df741360476d8035c68247e645278fbab53b59) )
28782875ROM_END
28792876
2880ROM_START( jojoaltn )
2877ROM_START( jojoan )
28812878   ROM_REGION32_BE( 0x080000, "user1", 0 ) /* bios region */
28822879   ROM_LOAD( "jojo_asia_nocd.29f400.u2", 0x000000, 0x080000, CRC(05b4f953) SHA1(c746c7bb5359acc9adced817cb4870b1912eaefd) )
28832880
28842881   ROM_REGION32_BE( 0x800000*2, "user4", ROMREGION_ERASEFF ) /* cd content region */
2885   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(bc612872) SHA1(18930f2906176b54a9b8bec56f06dda3362eb418) )
2886   ROM_LOAD( "20",  0x0800000, 0x800000, CRC(0e1daddf) SHA1(34bb4e0fb86258095a7b20f60174453195f3735a) )
2882   ROM_LOAD( "10",  0x0000000, 0x800000, CRC(e40dc123) SHA1(517e7006349b5a8fd6c30910362583f48d009355) )
2883   ROM_LOAD( "20",  0x0800000, 0x800000, CRC(0571e37c) SHA1(1aa28ef6ea1b606a55d0766480b3ee156f0bca5a) )
28872884   ROM_REGION16_BE( 0x800000*10, "user5", ROMREGION_ERASEFF ) /* cd content region */
28882885   ROM_LOAD( "30",  0x0000000, 0x800000, CRC(1d99181b) SHA1(25c216de16cefac2d5892039ad23d07848a457e6) )
28892886   ROM_LOAD( "31",  0x0800000, 0x800000, CRC(6889fbda) SHA1(53a51b993d319d81a604cdf70b224955eacb617e) )
r4057r4058
30913088GAME( 1997, sfiii2,  0,        cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 2nd Impact: Giant Attack (USA, 970930)", GAME_IMPERFECT_GRAPHICS )
30923089GAME( 1997, sfiii2j, sfiii2,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Japan, 970930)", GAME_IMPERFECT_GRAPHICS )
30933090
3094GAME( 1999, sfiii3,  0,        cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA, 990512)", GAME_IMPERFECT_GRAPHICS )
3095GAME( 1999, sfiii3a, sfiii3,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA, 990608)", GAME_IMPERFECT_GRAPHICS )
3091GAME( 1999, sfiii3,  0,        cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA, 990608)", GAME_IMPERFECT_GRAPHICS )
3092GAME( 1999, sfiii3a, sfiii3,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (USA, 990512)", GAME_IMPERFECT_GRAPHICS )
30963093
3097GAME( 1998, jojo,    0,        cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Japan, 981202)", GAME_IMPERFECT_GRAPHICS )
3098GAME( 1998, jojoalt, jojo,     cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Japan, 990108)", GAME_IMPERFECT_GRAPHICS )
3094GAME( 1998, jojo,    0,        cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Japan, 990108)", GAME_IMPERFECT_GRAPHICS )
3095GAME( 1998, jojoa,   jojo,     cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Japan, 981202)", GAME_IMPERFECT_GRAPHICS )
30993096
31003097GAME( 1999, jojoba,  0,        cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyouna Bouken: Miraie no Isan (Japan, 990913)", GAME_IMPERFECT_GRAPHICS )
31013098
r4057r4058
31083105
31093106GAME( 1997, sfiii2n, sfiii2,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Asia, 970930, NO CD)", GAME_IMPERFECT_GRAPHICS )
31103107
3111GAME( 1999, sfiii3n, sfiii3,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan, 990512, NO CD)", GAME_IMPERFECT_GRAPHICS )
3112GAME( 1999, sfiii3an,sfiii3,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan, 990608, NO CD)", GAME_IMPERFECT_GRAPHICS )
3108GAME( 1999, sfiii3n, sfiii3,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan, 990608, NO CD)", GAME_IMPERFECT_GRAPHICS )
3109GAME( 1999, sfiii3an,sfiii3,   cps3, cps3, cps3, ROT0,   "Capcom", "Street Fighter III 3rd Strike: Fight for the Future (Japan, 990512, NO CD)", GAME_IMPERFECT_GRAPHICS )
31133110
3114GAME( 1998, jojon,   jojo,     cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Asia, 981202, NO CD)", GAME_IMPERFECT_GRAPHICS )
3115GAME( 1998, jojoaltn,jojo,     cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Asia, 990108, NO CD)", GAME_IMPERFECT_GRAPHICS )
3111GAME( 1998, jojon,   jojo,     cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Asia, 990108, NO CD)", GAME_IMPERFECT_GRAPHICS )
3112GAME( 1998, jojoan,  jojo,     cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Venture / JoJo no Kimyouna Bouken (Asia, 981202, NO CD)", GAME_IMPERFECT_GRAPHICS )
31163113
31173114GAME( 1999, jojoban, jojoba,   cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyouna Bouken: Miraie no Isan (Japan, 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
31183115GAME( 1999, jojobane,jojoba,   cps3, cps3, cps3, ROT0,   "Capcom", "JoJo's Bizarre Adventure: Heritage for the Future / JoJo no Kimyouna Bouken: Miraie no Isan (Euro, 990913, NO CD)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/toaplan2.c
r4057r4058
1818    ghox        TP-021        Toaplan       Ghox (Spinner with single up/down axis control)
1919    ghoxj       TP-021        Toaplan       Ghox (8-Way Joystick controls)
2020    dogyuun     TP-022        Toaplan       Dogyuun
21    dogyuunk    TP-022        Toaplan       Dogyuun (Licensed to Unite Trading For Korea)
2122    kbash       TP-023        Toaplan       Knuckle Bash
2223    kbash2      bootleg       Toaplan       Knuckle Bash 2
2324    truxton2    TP-024        Toaplan       Truxton 2 / Tatsujin Oh
r4057r4058
5051
5152    SET NOTES:
5253
53    sstriker - The region jumper is read with this set but even when set to Japan you get all english
54               text etc which seems a little odd. However this has been verified correct on two boards.
55    kingdmgp - might be a bootleg / hack, some of the tiles needed for the credits screen have been
56               stripped out, doesn't seem very professional, since its rare and should probably only
57               have a different graphics rom its nearly impossible for us to verify, a lot of boards
58               being sold as 'Kingdom Grand Prix' are infact conversions using Neill Corlett's hack
54    sstriker - The region jumper is read with this set but even when set to Japan you get all English
55               text etc. which seems a little odd. However, this has been verified correct on two boards.
5956
57    kingdmgp - Might be a bootleg / hack, some of the tiles needed for the credits screen have been
58               stripped out, doesn't seem very professional, since it's rare and should probably only
59               have a different graphics rom, it's nearly impossible for us to verify. A lot of boards
60               being sold as 'Kingdom Grand Prix' are infact conversions using Neill Corlett's hack.
61
6062            ** The above two look like genuine Korean release boards, Raizing probably just missed a few things
6163
62    bgaregga - the clones have fewer types of enemy bullets (not fewer bullets, just fewer types!)
64    bgaregga - The clones have fewer types of enemy bullets (not fewer bullets, just fewer types!)
6365               and Stage Edit is disabled - the dipswitch is still listed in service mode but it
64               doesn't do anything. In addition to these changes, bgaregt2 has no third button!
66               doesn't do anything. In addition to these changes, bgaregt2 has no third button!
6567               Instead of being able to change the formation of your options with a button press,
6668               each of the selectable ships has a different, fixed option formation.
6769
68    batrider - original release was marketed as a two button game, but actually needed a third button
69               to fully use some of the ships' weaponry!  This error was rectified in the B Version
70               (which is fully playable with either two or three buttons)
70    batrider - The original release was marketed as a two button game, but actually needed a third button
71               to fully use some of the ships' weaponry! This error was rectified in the B Version
72               (which is fully playable with either two or three buttons).
7173
72    bbakraid - the Unlimited Version can display more score digits (as players managed to counter stop
74    bbakraid - The Unlimited Version can display more score digits (as players managed to counter stop
7375               the original within days of its release!) and adds a "team" mode ala Batrider where you
74               select a different ship for each of your three lives
76               select a different ship for each of your three lives.
7577
78    dogyuunk - PCB says "TOAPLAN CO.,LTD. TP-022-1 MADE IN KOREA". It contains 3 custom Toaplan chips
79               (2 gfx chips and TS-002-MACH sound MCU). Uses original Toaplan-badged MASKROMs for GFX
80               and sound and original 'TP-022 01 TOAPLAN' sticker on program EPROM.
81
82
7683 ****************************************************************************
7784 * Battle Garegga and Armed Police Batrider have secret characters.         *
7885 * Try to input the following commands to use them.                         *
r4057r4058
22472254INPUT_PORTS_END
22482255
22492256
2257static INPUT_PORTS_START( dogyuunk )
2258   PORT_INCLUDE( dogyuun )
2259
2260   PORT_MODIFY("JMPR")
2261   PORT_DIPNAME( 0x000f,   0x0005, "Territory" )
2262   PORT_DIPSETTING(      0x0003, DEF_STR( Europe ) )
2263   PORT_DIPSETTING(      0x0001, DEF_STR( USA ) )
2264//  PORT_DIPSETTING(        0x0007, DEF_STR( USA ) )
2265   PORT_DIPSETTING(      0x0002, "USA (Atari Games Corp license)" )
2266//  PORT_DIPSETTING(        0x000c, "USA (Atari Games Corp license)" )
2267   PORT_DIPSETTING(      0x0000, DEF_STR( Japan ) )
2268   PORT_DIPSETTING(      0x000f, "Japan (Taito Corp license)" )
2269   PORT_DIPSETTING(      0x0008, "South East Asia (Charterfield license)" )
2270//  PORT_DIPSETTING(        0x000d, "South East Asia (Charterfield license)" )
2271   PORT_DIPSETTING(      0x0005, "Korea (Unite Trading license)" )
2272//  PORT_DIPSETTING(        0x000a, "Korea (Unite Trading license)" )
2273   PORT_DIPSETTING(      0x0004, "Hong Kong (Charterfield license)" )
2274//  PORT_DIPSETTING(        0x0009, "Hong Kong (Charterfield license)" )
2275   PORT_DIPSETTING(      0x0006, "Taiwan" )
2276//  PORT_DIPSETTING(        0x000b, "Taiwan" )
2277   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* Sound ready */
2278INPUT_PORTS_END
2279
2280
22502281static INPUT_PORTS_START( kbash )
22512282   PORT_INCLUDE( toaplan2 )
22522283
r4057r4058
42024233ROM_END
42034234
42044235
4236ROM_START( dogyuunk )
4237   ROM_REGION( 0x080000, "main", 0 )         /* Main 68K code */
4238   ROM_LOAD16_WORD_SWAP( "01.u64", 0x000000, 0x080000, CRC(fe5bd7f4) SHA1(9c725466112a514c9ed0fb074422d291c175c3f4) )
4239
4240   /* Secondary CPU is a Toaplan marked chip, (TS-002-MACH  TOA PLAN) */
4241   /* Its likely to be a NEC V25+ (PLCC94). */
4242#if USE_V25
4243   ROM_REGION( 0x10000, "cpu1", 0 )         /* Sound CPU code */
4244//  ROM_LOAD( "tp022.mcu", 0x00000, 0x08000, NO_DUMP )
4245#endif
4246
4247   ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE )
4248   ROM_LOAD16_WORD_SWAP( "tp022_3.w92", 0x000000, 0x100000, CRC(191b595f) SHA1(89344946daa18087cc83f92027cf5da659b1c7a5) )
4249   ROM_LOAD16_WORD_SWAP( "tp022_4.w93", 0x100000, 0x100000, CRC(d58d29ca) SHA1(90d142fef37764ef817347a2bed77892a288a077) )
4250
4251   ROM_REGION( 0x400000, "gfx2", ROMREGION_DISPOSE )
4252   ROM_LOAD16_WORD_SWAP( "tp022_5.w16", 0x000000, 0x200000, CRC(d4c1db45) SHA1(f5655467149ba737128c2f54c9c6cdaca6e4c35c) )
4253   ROM_LOAD16_WORD_SWAP( "tp022_6.w17", 0x200000, 0x200000, CRC(d48dc74f) SHA1(081b5a00a2ff2bd82b98b30aab3cb5b6ae1014d5) )
4254
4255   ROM_REGION( 0x40000, "oki", 0 )      /* ADPCM Samples */
4256   ROM_LOAD( "tp022_2.w30", 0x00000, 0x40000, CRC(043271b3) SHA1(c7eaa929e55dd956579b824ea9d20a1d0129a925) )
4257ROM_END
4258
4259
42054260ROM_START( kbash )
42064261   ROM_REGION( 0x080000, "main", 0 )         /* Main 68K code */
42074262   ROM_LOAD16_WORD_SWAP( "kbash01.bin", 0x000000, 0x080000, CRC(2965f81d) SHA1(46f2df30fa92c80ba5a37f75e756424e15534784) )
r4057r4058
49965051GAME( 1991, ghox,     0,        ghox,     ghox,     T2_Z180,  ROT270, "Toaplan", "Ghox (Spinner with Up/Down Axis)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
49975052GAME( 1991, ghoxj,    ghox,     ghox,     ghox,     T2_Z180,  ROT270, "Toaplan", "Ghox (8-Way Joystick)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
49985053GAME( 1992, dogyuun,  0,        dogyuun,  dogyuun,  T2_V25,   ROT270, "Toaplan", "Dogyuun", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
5054GAME( 1992, dogyuunk, dogyuun,  dogyuun,  dogyuunk, T2_V25,   ROT270, "Toaplan", "Dogyuun (Licensed to Unite Trading For Korea)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )
49995055GAME( 1993, kbash,    0,        kbash,    kbash,    T2_V25,   ROT0,   "Toaplan", "Knuckle Bash", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
50005056GAME( 1999, kbash2,   0,        kbash2,   kbash2,   T2_noZ80, ROT0,   "bootleg", "Knuckle Bash 2 (bootleg)", GAME_SUPPORTS_SAVE )
50015057GAME( 1992, truxton2, 0,        truxton2, truxton2, T2_noZ80, ROT270, "Toaplan", "Truxton II / Tatsujin Oh", GAME_SUPPORTS_SAVE )
src/mame/drivers/subsino.c
r4057r4058
7373   return 0;
7474}
7575
76static PALETTE_INIT( subsino_depth3 )
76static PALETTE_INIT( subsino_2proms )
7777{
7878   // To be done (only 2 roms?)
7979}
8080
81static PALETTE_INIT( subsino_depth4 )
81static PALETTE_INIT( subsino_3proms )
8282{
8383   int i;
8484   for (i = 0; i < 256; i++)
r4057r4058
249249};
250250
251251static GFXDECODE_START( subsino_depth3 )
252   GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x3, 0, 16 )
252   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x3, 0, 16 )
253253GFXDECODE_END
254254
255255static GFXDECODE_START( subsino_depth4 )
256   GFXDECODE_ENTRY( "gfx1", 0, layout_8x8x4, 0, 16 )
256   GFXDECODE_ENTRY( "tilemap", 0, layout_8x8x4, 0, 16 )
257257GFXDECODE_END
258258
259259
r4057r4058
276276   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0+16, 256-16-1)
277277
278278   MDRV_GFXDECODE(subsino_depth3)
279
279280   MDRV_PALETTE_LENGTH(0x100)
281//  MDRV_PALETTE_INIT(subsino_3proms)   // no proms?
280282
281//  MDRV_PALETTE_INIT(subsino_depth3)   // no proms?
282283   MDRV_VIDEO_START(subsino)
283284   MDRV_VIDEO_UPDATE(subsino)
284285
r4057r4058
297298
298299   /* basic machine hardware */
299300   MDRV_IMPORT_FROM( victor5 )
300   MDRV_PALETTE_INIT(subsino_depth3)   // 2 proms?
301   MDRV_PALETTE_INIT(subsino_2proms)
301302MACHINE_DRIVER_END
302303
303304
r4057r4058
316317   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0+16, 256-16-1)
317318
318319   MDRV_GFXDECODE(subsino_depth4)
320
319321   MDRV_PALETTE_LENGTH(0x100)
322   MDRV_PALETTE_INIT(subsino_3proms)
320323
321   MDRV_PALETTE_INIT(subsino_depth4)
322324   MDRV_VIDEO_START(subsino)
323325   MDRV_VIDEO_UPDATE(subsino)
324326
r4057r4058
334336MACHINE_DRIVER_END
335337
336338
339static MACHINE_DRIVER_START( crsbingo )
340   /* basic machine hardware */
341   MDRV_CPU_ADD("main", Z180, XTAL_12MHz / 3)   // Unknown CPU and clock
342   MDRV_CPU_PROGRAM_MAP(victor5_map,0)
343   MDRV_CPU_IO_MAP(subsino_iomap,0)
344
345   /* video hardware */
346   MDRV_SCREEN_ADD("main", RASTER)
347   MDRV_SCREEN_REFRESH_RATE(60)
348   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
349   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
350   MDRV_SCREEN_SIZE(512, 256)
351   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0+16, 256-16-1)
352
353   MDRV_GFXDECODE(subsino_depth4)
354
355   MDRV_PALETTE_LENGTH(0x100)
356   MDRV_PALETTE_INIT(subsino_2proms)
357
358   MDRV_VIDEO_START(subsino)
359   MDRV_VIDEO_UPDATE(subsino)
360
361   /* sound hardware */
362   MDRV_SPEAKER_STANDARD_MONO("mono")
363
364   MDRV_SOUND_ADD("ym", YM2413, XTAL_3_579545MHz)   // unknown clock
365   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
366
367   // no OKI
368MACHINE_DRIVER_END
369
337370/***************************************************************************
338371                                ROMs Loading
339372***************************************************************************/
r4057r4058
377410   ROM_REGION( 0x10000, "main", 0 )
378411   ROM_LOAD( "1.u1", 0x00000, 0x10000, CRC(e3ada2fc) SHA1(eddb460dcb80a29fbbe3ed6c4733c75b892baf52) )
379412
380   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
413   ROM_REGION( 0x18000, "tilemap", ROMREGION_DISPOSE )
381414   ROM_LOAD( "2.u24", 0x00000, 0x8000, CRC(1229e951) SHA1(1e548625bb60e2d6f52a376a0dea9e5709f94135) )
382415   ROM_LOAD( "3.u23", 0x08000, 0x8000, CRC(2d89bbf1) SHA1(d7fda0174a835e88b330dfd09bdb604bfe4c2e44) )
383416   ROM_LOAD( "4.u22", 0x10000, 0x8000, CRC(ecf840a1) SHA1(9ecf522afb23e3557d37effc3c8568e8a14dad1a) )
r4057r4058
426459   ROM_REGION( 0x10000, "main", 0 )
427460   ROM_LOAD( "1.u1", 0x00000, 0x10000, CRC(43999b2d) SHA1(7ce26fd332ffe35fd826a1a6166b228d4bc370b8) )
428461
429   ROM_REGION( 0x18000, "gfx1", ROMREGION_DISPOSE )
462   ROM_REGION( 0x18000, "tilemap", ROMREGION_DISPOSE )
430463   ROM_LOAD( "2.u24", 0x00000, 0x8000, CRC(f1181b93) SHA1(53cd4d2ce13973495b51d911a4745a69a9784983) )
431464   ROM_LOAD( "3.u25", 0x08000, 0x8000, CRC(437abb27) SHA1(bd3790807d60a41d58e07f60fb990553076d6e96) )
432465   ROM_LOAD( "4.u26", 0x10000, 0x8000, CRC(e2f66eee) SHA1(ece924fe626f21fd7d31faabf19225d80e2bcfd3) )
r4057r4058
483516   ROM_REGION( 0x10000, "main", 0 )
484517   ROM_LOAD( "shark_n.1.u18", 0x00000, 0x10000, CRC(25aeac2f) SHA1(d94e3e5cfffd150ac48e1463493a8323f42e7a89) )
485518
486   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
519   ROM_REGION( 0x40000, "tilemap", ROMREGION_DISPOSE )
487520   ROM_LOAD( "shark_n.2.u17", 0x00000, 0x08000, CRC(c27f3d0a) SHA1(77c8eb0322c5b9c89777cb080d26ecf9abe01ae7) )
488521   ROM_CONTINUE(              0x10000, 0x08000 )
489522   ROM_CONTINUE(              0x08000, 0x08000 )
r4057r4058
546579   ROM_REGION( 0x10000, "main", 0 )
547580   ROM_LOAD( "shark1.6.u18", 0x00000, 0x10000, CRC(365312a0) SHA1(de8370b1f35e8d071185d2e5f2fbd2fdf74c55ac) )
548581
549   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
582   ROM_REGION( 0x40000, "tilemap", ROMREGION_DISPOSE )
550583   ROM_LOAD( "shark_n.2.u17", 0x00000, 0x08000, CRC(c27f3d0a) SHA1(77c8eb0322c5b9c89777cb080d26ecf9abe01ae7) )
551584   ROM_CONTINUE(              0x10000, 0x08000 )
552585   ROM_CONTINUE(              0x08000, 0x08000 )
r4057r4058
608641   ROM_REGION( 0x10000, "main", 0 )
609642   ROM_LOAD( "rideritaly_1ver1.6.u18", 0x0000, 0x10000, CRC(c7c0c3e8) SHA1(5dc80bc775f370653135a7b3ea9c8d3c92263804) )
610643
611   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
644   ROM_REGION( 0x40000, "tilemap", ROMREGION_DISPOSE )
612645   ROM_LOAD( "rideritaly_3ver1.6.u16", 0x00000, 0x08000, CRC(998a8feb) SHA1(27f08b23f2dd3736f4f12f489d9a3aa096c99e8a) )
613646   ROM_CONTINUE(                       0x10000, 0x08000 )
614647   ROM_CONTINUE(                       0x08000, 0x08000 )
r4057r4058
627660   ROM_LOAD( "prom-n82s129an.u13", 0x200, 0x100, CRC(9cb4a5c0) SHA1(0e0a368329c6d1cb685ed655d699a4894988fdb1) )
628661ROM_END
629662
663static DRIVER_INIT( smoto16 )
664{
665   UINT8 *rom = memory_region( machine, "main" );
666   rom[0x12d0] = 0x20;   // "ERROR 951010"
667}
668
630669/***************************************************************************
631670
632671Super Rider (Italy Ver 2.0)
r4057r4058
672711   ROM_REGION( 0x10000, "main", 0 )
673712   ROM_LOAD( "italyv2.0-25.u18", 0x00000, 0x10000, CRC(91abc76e) SHA1(b0eb3afda1d94111056559017802b16b2e72a9a5) )
674713
675   ROM_REGION( 0x40000, "gfx1", ROMREGION_DISPOSE )
714   ROM_REGION( 0x40000, "tilemap", ROMREGION_DISPOSE )
676715   ROM_LOAD( "3.u16", 0x00000, 0x08000, CRC(44b44385) SHA1(27c2865e52ab67aa8e077e8e1202cbf2addc0dfc) )
677716   ROM_CONTINUE(      0x10000, 0x08000 )
678717   ROM_CONTINUE(      0x08000, 0x08000 )
r4057r4058
696735   UINT8 *rom = memory_region( machine, "main" );
697736   rom[0x12e1] = 0x20;   // "ERROR 951010"
698737}
699static DRIVER_INIT( smoto16 )
700{
701   UINT8 *rom = memory_region( machine, "main" );
702   rom[0x12d0] = 0x20;   // "ERROR 951010"
703}
704738
739/***************************************************************************
740
741Cross Bingo
742(C)1991 Subsino
743
744Chips:
745
7461x big unknown epoxy block (main)
7471x unknown Subsino SS9101-173001 (DIP42)
7481x unknown blank quad chip (QFP68)
7491x UM3567 (sound)
7503x ULN2003AN (sound)
7511x LM324N (sound)
7521x oscillator 12.000
7531x oscillator 3.579545
754
755ROMs:
756
7573x M27512
7582x PROM N82S129N
7592x PLD 18CV8PC (read protected)
760
761Other:
762
7631x 22x2 edge connector
7641x 11x2 edge connector
7651x 10x2 edge connector (payout system)
7661x RS232 connector
7671x trimmer (volume)
7681x pushbutton
7694x 8x2 switches dip
7701x battery
771
772Info by f205v (14/12/2008)
773
774***************************************************************************/
775
776ROM_START( crsbingo )
777   ROM_REGION( 0x10000, "main", 0 )
778   ROM_LOAD( "1.u36", 0x00000, 0x10000, CRC(c5aff4eb) SHA1(74f06d7735975657fca9be5fff9e7d53f38fcd02) )
779
780   ROM_REGION( 0x20000, "tilemap", ROMREGION_DISPOSE )
781   ROM_LOAD( "2.u4",  0x00000, 0x10000, CRC(ce527722) SHA1(f3759cefab902259eb25f8d4be2fcafc1afd90b9) )
782   ROM_LOAD( "3.u15", 0x10000, 0x10000, CRC(23785451) SHA1(8574e59aa816a644ff4b102bd5754ef1284deea0) )
783
784   ROM_REGION( 0x200, "proms", ROMREGION_DISPOSE )
785   ROM_LOAD( "82s129.u13", 0x000, 0x100, CRC(89c06859) SHA1(b98d5335f36ea3842086677aca47b605030d442f) )
786   ROM_LOAD( "82s129.u14", 0x100, 0x100, CRC(eaddb54f) SHA1(51fbf31e910a93315204a892d10bcf982a6ed099) )
787
788   ROM_REGION( 0x155 * 2, "plds", ROMREGION_DISPOSE )
789   ROM_LOAD( "18cv8.u22", 0x000, 0x155, BAD_DUMP CRC(996e8f59) SHA1(630d9b91f6e8eda781061e2a8ff6fb0fecaf034c) )
790   ROM_LOAD( "18cv8.u29", 0x155, 0x155, BAD_DUMP CRC(996e8f59) SHA1(630d9b91f6e8eda781061e2a8ff6fb0fecaf034c) )
791ROM_END
792
793
705794GAME( 1990, victor5,  0,        victor5,  0,        0,        ROT0, "Subsino", "Victor 5",                  GAME_NOT_WORKING )
706795GAME( 1990, victor21, 0,        victor21, 0,        0,        ROT0, "Subsino", "Victor 21",                 GAME_NOT_WORKING )
796GAME( 1991, crsbingo, 0,        crsbingo, 0,        0,        ROT0, "Subsino", "Cross Bingo",               GAME_NOT_WORKING )
707797GAME( 1993, sharkpy,  0,        srider,   smoto,    0,        ROT0, "Subsino", "Shark Party",               GAME_NOT_WORKING )
708798GAME( 1993, sharkpya, sharkpy,  srider,   smoto,    0,        ROT0, "Subsino", "Shark Party (alt)",         GAME_NOT_WORKING )
709799GAME( 1996, smoto20,  0,        srider,   smoto,    smoto20,  ROT0, "Subsino", "Super Rider (Italy, v2.0)", GAME_WRONG_COLORS )
src/mame/drivers/dmndrby.c
r4057r4058
1/*
1/*******************************************************************************************
2
3Diamond Derby - G4001 board (c) 1986 Electrocoin
4
5driver by David Haywood,Mike Green & Angelo Salese
6
7Notes:
8-Press Collect Button to "get the money";
9
10TODO:
11-Enters into Service Mode (?) if you let it go in attract mode after some time;
12-Fix remaining graphic issues;
13-Fix colors (check bar test on the first Service Mode menu);
14
15============================================================================================
16
217G4001
318Diamond Derby - Electrocoin on an SNK board
419
r4057r4058
3348 2114                  2148 2148
3449 2114              H10
3550
51*******************************************************************************************/
3652
37 Driver Improvements by Mike Green
38
39*/
40
4153#include "driver.h"
4254#include "cpu/z80/z80.h"
4355#include "sound/ay8910.h"
4456#include "video/resnet.h"
4557
4658static UINT8* dderby_vidchars;
47static UINT8* dderby_soundmem;
4859static UINT8* scroll_ram;
4960static UINT8* dderby_vidattribs;
5061static UINT8* sprite_ram;
5162static UINT8 *nvram;
52static UINT8 *main_rom;
53static UINT8 *main_ram;
5463static size_t nvram_size;
5564static UINT8 *racetrack_tilemap_rom;
5665static tilemap *racetrack_tilemap;
r4057r4058
6574
6675static WRITE8_HANDLER( dderby_sound_w )
6776{
68   static UINT8 last=0;
69   if(data!=last)
70      soundlatch_w(space,0,data);
71
72   last=data;
77   soundlatch_w(space,0,data);
78   cpu_set_input_line(cputag_get_cpu(space->machine, "audio"), 0, HOLD_LINE);
7379}
7480
81static UINT8 io_port[8];
7582
76static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 )
77   AM_RANGE(0x0000, 0x5fff) AM_ROM AM_BASE(&main_rom)
78//  AM_RANGE(0x6000,0x67ff) AM_RAM AM_SHARE(1)
79//  AM_RANGE(0x8810, 0x8810) AM_WRITE(SMH_NOP) // sound hook?
80//  AM_RANGE(0x8810, 0x8810) AM_READ(dderby_ff)
81   AM_RANGE(0x8811, 0x8811) AM_READ_PORT("IN2") // ??? doubt if this is dip 2.
82//  AM_RANGE(0x8bab, 0x8bab) AM_READ_PORT("IN1") // ??? doubt if this is dip 2.
83//  AM_RANGE(0x8baa, 0x8baa) AM_READ_PORT("IN1") // ??? doubt if this is dip 2.
84//  AM_RANGE(0x8000, 0x8fff) AM_RAM AM_BASE(&main_ram)
85   AM_RANGE(0x8880, 0x8880) AM_MIRROR(0x8) AM_READ_PORT("KEY0") // ??? doubt if this is dip 2.
86   AM_RANGE(0x8881, 0x8881) AM_MIRROR(0x8) AM_READ_PORT("KEYA") // ??? doubt if this is dip 2.
87   AM_RANGE(0x8882, 0x8882) AM_READ_PORT("KEY1") //AM_MIRROR(0x8)// ??? doubt if this is dip 2.
88   AM_RANGE(0x8883, 0x8883) AM_MIRROR(0x8) AM_READ_PORT("KEY2") // ??? doubt if this is dip 2.
89   AM_RANGE(0x8884, 0x8884) AM_MIRROR(0x8) AM_READ_PORT("KEY3") // ??? doubt if this is dip 2.
90   AM_RANGE(0x8885, 0x8885) AM_MIRROR(0x8) AM_READ_PORT("KEY4") // ??? COLLECT??
91   AM_RANGE(0x8886, 0x8886) AM_MIRROR(0x8) AM_READ_PORT("KEY5") // ??? doubt if this is dip 2.
92   AM_RANGE(0x8887, 0x8887) AM_MIRROR(0x8) AM_READ_PORT("KEY6") // ??? doubt if this is dip 2.
93   AM_RANGE(0x8888, 0x8888) AM_READ_PORT("KEY7") // ??? doubt if this is dip 2.
94   AM_RANGE(0x8889, 0x8889) AM_READ_PORT("KEY8") // ??? doubt if this is dip 2.
95   AM_RANGE(0x888a, 0x888a) AM_READ_PORT("KEY9") // ??? doubt if this is dip 2.
96//  AM_RANGE(0x888e, 0x888e) AM_READ_PORT("KEY0") // ??? doubt if this is dip 2.
97/*  AM_RANGE(0x888f, 0x888f) AM_READ_PORT("KEYA") // ??? doubt if this is dip 2.
98    AM_RANGE(0x888a, 0x888a) AM_READ_PORT("KEY1") // ??? doubt if this is dip 2.
99    AM_RANGE(0x888b, 0x888b) AM_READ_PORT("KEY2") // ??? doubt if this is dip 2.
100    AM_RANGE(0x888c, 0x888c) AM_READ_PORT("KEY3") // ??? doubt if this is dip 2.
101    AM_RANGE(0x888d, 0x888d) AM_READ_PORT("KEY4") // ??? COLLECT??
102    AM_RANGE(0x888e, 0x888e) AM_READ_PORT("KEY5") // ??? doubt if this is dip 2.
103*/
104//  AM_RANGE(0x8887, 0x8887) AM_READ_PORT("KEY6") // ??? doubt if this is dip 2.
83static READ8_HANDLER( input_r )
84{
85   switch(offset & 7)
86   {
87      case 0: return input_port_read(space->machine, "IN0");
88      case 1: return input_port_read(space->machine, "IN1");
89      case 2: return input_port_read(space->machine, "IN2");
90      case 3: return input_port_read(space->machine, "IN3");
91      case 4: return input_port_read(space->machine, "IN4");
92      case 5: return input_port_read(space->machine, "IN5");
93      case 6: return input_port_read(space->machine, "IN6");
94      case 7: return input_port_read(space->machine, "IN7");
95   }
10596
106//  AM_RANGE(0x8887, 0x8887) AM_READ_PORT("IN1") // ??? doubt if this is dip 2.
107//  AM_RANGE(0x8889, 0x8889) AM_READ_PORT("IN2")
97   return 0xff;
98}
10899
109   AM_RANGE(0x8887, 0x8887) AM_MIRROR(0x8) AM_READ_PORT("SERVICE")
110//  AM_RANGE(0x888f, 0x888f) AM_READ_PORT("SERVICE")
100static WRITE8_HANDLER( output_w )
101{
102   /*
103    ---- x--- refill meter [4]
104    ---- x--- token out meter [5]
105    ---- x--- token in meter [6]
106    ---- x--- cash out meter [7]
107    ---- -x-- coin out (meter) [0-3]
108    ---- -x-- coin lockout token [4]
109    ---- -x-- coin counter (meter) [5]
110    ---- --x- coin lockout [0-3]
111    ---- ---x lamp [0-6]
112    */
113   io_port[offset] = data;
114//  popmessage("%02x|%02x|%02x|%02x|%02x|%02x|%02x|%02x|",io_port[0],io_port[1],io_port[2],io_port[3],io_port[4],io_port[5],io_port[6],io_port[7]);
115}
111116
112   AM_RANGE(0x8888, 0x8888) AM_MIRROR(0x8) AM_READ_PORT("DOOR")
113//  AM_RANGE(0x8890, 0x8890) AM_READ_PORT("DOOR")
114
115   AM_RANGE(0x8892, 0x8892) AM_MIRROR(0x8) AM_READ_PORT("DOOR2")
116//  AM_RANGE(0x889a, 0x889a) AM_READ_PORT("DOOR2")
117   AM_RANGE(0x8893, 0x8893) AM_MIRROR(0x8)AM_READ_PORT("DOOR3")
118//  AM_RANGE(0x889b, 0x889b) AM_READ_PORT("DOOR3")
119
120   AM_RANGE(0x8e00, 0x8fff) AM_RAM // nvram maybe!
121
122   AM_RANGE(0x8000, 0x8dff) AM_RAM AM_BASE(&main_ram)
123
124   AM_RANGE(0xC000, 0xC007) AM_RAM // shared ram to 2nd cpu?? battery backed ram?
125
126   AM_RANGE(0xC802, 0xC802) AM_READ_PORT("DSW") // first dip
127//  AM_RANGE(0xc803, 0xc803) AM_READ_PORT("IN1") // ??? doubt if this is dip 2.
128
129   AM_RANGE(0xCA02, 0xCA03) AM_RAM AM_WRITE(dderby_sound_w) // BEST GUESS SO FAR!
130   AM_RANGE(0xCA00, 0xCA00) AM_RAM AM_WRITE(dderby_sound_w) // BEST GUESS SO FAR!
131   AM_RANGE(0xCA00, 0xCA03) AM_RAM //AM_WRITE(SMH_NOP) // sound hook?
132
133   AM_RANGE(0xCC00, 0xCC05) AM_RAM AM_BASE(&scroll_ram)
134
135// CORRECT HERE (I THINK!)
136   AM_RANGE(0xCE08, 0XCE1F) AM_RAM AM_BASE(&sprite_ram) // horse sprites
137   AM_RANGE(0xD000, 0xD3ff) AM_RAM AM_BASE(&dderby_vidchars) // char ram
138   AM_RANGE(0xD400, 0xD7ff) AM_RAM AM_BASE(&dderby_vidattribs) // colours/ attrib ram
139
117static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 )
118   AM_RANGE(0x0000, 0x5fff) AM_ROM
119   AM_RANGE(0x8000, 0x8fff) AM_RAM
120   AM_RANGE(0xc000, 0xc007) AM_READ(input_r)
121   AM_RANGE(0xc000, 0xc007) AM_WRITE(output_w)
122   AM_RANGE(0xc802, 0xc802) AM_READ_PORT("DSW1")
123   AM_RANGE(0xc803, 0xc803) AM_READ_PORT("DSW2")
124   AM_RANGE(0xca00, 0xca00) AM_WRITENOP//(vblank_irq_w) //???
125   AM_RANGE(0xca01, 0xca01) AM_WRITENOP //watchdog
126   AM_RANGE(0xca02, 0xca02) AM_RAM AM_WRITE(dderby_sound_w)
127   AM_RANGE(0xca03, 0xca03) AM_WRITENOP//(timer_irq_w) //???
128   AM_RANGE(0xcc00, 0xcc05) AM_RAM AM_BASE(&scroll_ram)
129   AM_RANGE(0xce08, 0xce1f) AM_RAM AM_BASE(&sprite_ram) // horse sprites
130   AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_BASE(&dderby_vidchars) // char ram
131   AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_BASE(&dderby_vidattribs) // colours/ attrib ram
140132ADDRESS_MAP_END
141133
142134static ADDRESS_MAP_START( dderby_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
143135   AM_RANGE(0x0000, 0x0fff) AM_ROM
144   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&dderby_soundmem) AM_SHARE(1)
145   AM_RANGE(0x1000, 0x1000) AM_RAM
146   AM_RANGE(0x4000, 0x4000) AM_WRITE(ay8910_control_port_0_w)
136   AM_RANGE(0x1000, 0x1000) AM_RAM //???
137   AM_RANGE(0x4000, 0x4000) AM_READWRITE(soundlatch_r,ay8910_control_port_0_w)
147138   AM_RANGE(0x4001, 0x4001) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w)
148
149   AM_RANGE(0x4000, 0x4000) AM_READ(soundlatch_r)
150
139   AM_RANGE(0x6000, 0x67ff) AM_RAM
151140ADDRESS_MAP_END
152141
153142static INPUT_PORTS_START( dderby )
143    PORT_START("IN0")
144   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN4 )
145   PORT_DIPNAME( 0x0002, 0x0002, "Out Coin 1" )//out coin 1
146   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
147   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
148   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("BET Horse 5")  PORT_CODE(KEYCODE_B)
149   PORT_BIT( 0xf4, IP_ACTIVE_LOW, IPT_UNUSED )
154150
155   PORT_START("SERVICE")
156   PORT_DIPNAME(0xff,0xff,"Refill Key")
157   PORT_DIPSETTING(0xff, DEF_STR( Off ))
158   PORT_DIPSETTING(0x00,DEF_STR( On ))
159   PORT_START("KEY0")
160   PORT_DIPNAME(0xff,0xff,"KEY0")
161   PORT_DIPSETTING(0xff, DEF_STR( Off ))
162   PORT_DIPSETTING(0x00,DEF_STR( On ))
163   PORT_START("KEYA")
164   PORT_DIPNAME(0xff,0xff,"KEYA")
165   PORT_DIPSETTING(0xff, DEF_STR( Off ))
166   PORT_DIPSETTING(0x00,DEF_STR( On ))
151    PORT_START("IN1")
152   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
153   PORT_DIPNAME( 0x0002, 0x0002, "Out Coin 2" )//out coin 2
154   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
155   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
156   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("BET Horse 6")  PORT_CODE(KEYCODE_N)
157   PORT_BIT( 0xf4, IP_ACTIVE_LOW, IPT_UNUSED )
167158
159    PORT_START("IN2")
160   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN2 )
161   PORT_DIPNAME( 0x0002, 0x0002, "Out Coin 3" )//out coin 3
162   PORT_DIPSETTING(      0x0002, DEF_STR( Off ) )
163   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
164   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Collect")  PORT_CODE(KEYCODE_2_PAD) //to get coins
165   PORT_BIT( 0xf4, IP_ACTIVE_LOW, IPT_UNUSED )
168166
169   PORT_START("KEY1")
170   PORT_DIPNAME(0xff,0xff,"KEY1")
171   PORT_DIPSETTING(0xff, DEF_STR( Off ))
172   PORT_DIPSETTING(0x00,DEF_STR( On ))
167    PORT_START("IN3")
168   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
169   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
173170
174   PORT_START("KEY2")
175   PORT_DIPNAME(0xff,0xff,"KEY2")
176   PORT_DIPSETTING(0xff, DEF_STR( Off ))
177   PORT_DIPSETTING(0x00,DEF_STR( On ))
171    PORT_START("IN4")
172   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Refill Key")  PORT_CODE(KEYCODE_1_PAD)
173   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("BET Horse 4")  PORT_CODE(KEYCODE_V)
174   PORT_BIT( 0xf5, IP_ACTIVE_LOW, IPT_UNUSED )
178175
179   PORT_START("KEY3")
180   PORT_DIPNAME(0xff,0xff,"KEY3")
181   PORT_DIPSETTING(0xff, DEF_STR( Off ))
182   PORT_DIPSETTING(0x00,DEF_STR( On ))
176    PORT_START("IN5")
177   PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
178   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("BET Horse 3")  PORT_CODE(KEYCODE_C)
179   PORT_BIT( 0xf5, IP_ACTIVE_LOW, IPT_UNUSED )
183180
184   PORT_START("KEY4")
185   PORT_DIPNAME(0xff,0xff,"KEY4")
186   PORT_DIPSETTING(0xff, DEF_STR( Off ))
187   PORT_DIPSETTING(0x00,DEF_STR( On ))
181    PORT_START("IN6")
182   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Back Door")  PORT_CODE(KEYCODE_3_PAD)
183   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("BET Horse 2")  PORT_CODE(KEYCODE_X)
184   PORT_BIT( 0xf5, IP_ACTIVE_LOW, IPT_UNUSED )
188185
189   PORT_START("KEY5")
190   PORT_DIPNAME(0xff,0xff,"KEY5")
191   PORT_DIPSETTING(0xff, DEF_STR( Off ))
192   PORT_DIPSETTING(0x00,DEF_STR( On ))
186    PORT_START("IN7")
187   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Token Coin")  PORT_CODE(KEYCODE_0)
188   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("BET Horse 1")  PORT_CODE(KEYCODE_Z)
189   PORT_BIT( 0xf5, IP_ACTIVE_LOW, IPT_UNUSED )
193190
194   PORT_START("KEY6")
195   PORT_DIPNAME(0xff,0xff,"KEY6")
196   PORT_DIPSETTING(0xff, DEF_STR( Off ))
197   PORT_DIPSETTING(0x00,DEF_STR( On ))
198
199   PORT_START("KEY7")
200   PORT_DIPNAME(0xff,0xff,"KEY7")
201   PORT_DIPSETTING(0xff, DEF_STR( Off ))
202   PORT_DIPSETTING(0x00,DEF_STR( On ))
203
204   PORT_START("KEY8")
205   PORT_DIPNAME(0xff,0xff,"KEY8")
206   PORT_DIPSETTING(0xff, DEF_STR( Off ))
207   PORT_DIPSETTING(0x00,DEF_STR( On ))
208
209   PORT_START("KEY9")
210   PORT_DIPNAME(0xff,0xff,"KEY9")
211   PORT_DIPSETTING(0xff, DEF_STR( Off ))
212   PORT_DIPSETTING(0x00,DEF_STR( On ))
213
214   PORT_START("DOOR")
215   PORT_DIPNAME(0x02,0x02,"Door")
216   PORT_DIPSETTING(0x02, "Open")
217   PORT_DIPSETTING(0x00," CLOSED")
218   PORT_START("DOOR2")
219   PORT_DIPNAME(0x02,0x02,"Door")
220   PORT_DIPSETTING(0x02, "Open")
221   PORT_DIPSETTING(0x00," CLOSED")
222   PORT_START("DOOR3")
223   PORT_DIPNAME(0x02,0x02,"Door")
224   PORT_DIPSETTING(0x02, "Open")
225   PORT_DIPSETTING(0x00," CLOSED")
226
227   PORT_START("DSW")   /* 8bit */
191   PORT_START("DSW1")
228192   PORT_DIPNAME( 0x01, 0x01, " Unknown 1")
229193   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
230194   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4057r4058
237201   PORT_DIPSETTING(    0x04, "480p (cash + tokens)" )
238202   PORT_DIPSETTING(    0x00, "600p (cash + tokens)" )
239203   PORT_DIPNAME( 0x30, 0x00, "Percentage Payout" )
240   PORT_DIPSETTING(    0x00, "76%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80)
241   PORT_DIPSETTING(    0x10, "80%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80)
242   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80)
243   PORT_DIPSETTING(    0x30, "88%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_LESSTHAN, 0x80)
244
245   PORT_DIPSETTING(    0x00, "78%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
246   PORT_DIPSETTING(    0x10, "82%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
247   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
248   PORT_DIPSETTING(    0x30, "90%" )   PORT_CONDITION("DSW", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
249
204   PORT_DIPSETTING(    0x00, "76%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
205   PORT_DIPSETTING(    0x10, "80%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
206   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
207   PORT_DIPSETTING(    0x30, "88%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_LESSTHAN, 0x80)
208   PORT_DIPSETTING(    0x00, "78%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
209   PORT_DIPSETTING(    0x10, "82%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
210   PORT_DIPSETTING(    0x20, "86%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
211   PORT_DIPSETTING(    0x30, "90%" )   PORT_CONDITION("DSW1", 0xc0, PORTCOND_NOTLESSTHAN, 0x80)
250212   PORT_DIPNAME( 0xc0, 0x80, "Price Per Game" )
251213   PORT_DIPSETTING(    0x00, "2p" )
252214   PORT_DIPSETTING(    0x40, "5p" )
253215   PORT_DIPSETTING(    0x80, "10p" )
254216   PORT_DIPSETTING(    0xc0, "20p" )
255217
256   PORT_START("IN1")   /* 8bit */
218   PORT_START("DSW2")   /* 8bit */
257219   PORT_DIPNAME( 0x01, 0x01, "Show Results")
258220   PORT_DIPSETTING(    0x01, "Last Race" )
259221   PORT_DIPSETTING(    0x00, "Last 6 Races" )
r4057r4058
278240   PORT_DIPNAME( 0x80, 0x80, " Unknown 8" )
279241   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
280242   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
281
282   PORT_START("IN2")   /* 8bit */
283   PORT_DIPNAME( 0x01, 0x00, " Unknown 1") // token error ???
284   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
285   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
286   PORT_DIPNAME( 0x02, 0x02, " Unknown 2" )
287   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
288   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
289   PORT_DIPNAME( 0x04, 0x04, " Unknown 3" )
290   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
292   PORT_DIPNAME( 0x08, 0x08, " Unknown 4" )
293   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
294   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
295   PORT_DIPNAME( 0x10, 0x10, " Unknown 1")
296   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
297   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298   PORT_DIPNAME( 0x20, 0x20, " Unknown 2" )
299   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
301   PORT_DIPNAME( 0x40, 0x40, " Unknown 3" )
302   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
303   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
304   PORT_DIPNAME( 0x80, 0x80, " Unknown 4" )
305   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
306   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
307
308243INPUT_PORTS_END
309244
310245static INPUT_PORTS_START( dderbya )
311246   PORT_INCLUDE( dderby )
312   PORT_MODIFY("DSW")   /* 8bit */
247   PORT_MODIFY("DSW1")   /* 8bit */
313248   PORT_DIPNAME( 0x01, 0x01, "Price Per Play")
314249   PORT_DIPSETTING(    0x01, "5p" )
315250   PORT_DIPSETTING(    0x00, "10p" )
r4057r4058
332267   PORT_DIPNAME( 0x80, 0x80, " Unknown 4" )
333268   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
334269   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
335
336270INPUT_PORTS_END
337271
338272static const gfx_layout tiles8x8_layout =
r4057r4058
373307   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 32*16, 16 )
374308   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout2, 0, 8)
375309   GFXDECODE_ENTRY( "gfx3", 0, tiles16x16_layout, 16*16, 32 )
376
377310GFXDECODE_END
378311
379
380
381
382
383312static TILE_GET_INFO( get_dmndrby_tile_info )
384313{
385314   int code = racetrack_tilemap_rom[tile_index];
r4057r4058
509438   return 0;
510439}
511440
512
513static INTERRUPT_GEN( dderby_interrupt )
514{
515   cpu_set_input_line_and_vector(cputag_get_cpu(device->machine, "main"), 0, HOLD_LINE, 0x8a); // game
516}
517
518
519static INTERRUPT_GEN( dderby_sound_interrupt )
520{
521   cpu_set_input_line_and_vector(cputag_get_cpu(device->machine, "audio"), 0, HOLD_LINE, 0x50);
522}
523
524
525// copied from elsewhere. maybe incorrect
441// copied from elsewhere. surely incorrect
526442static PALETTE_INIT( dmnderby )
527443{
528444   static const int resistances_rg[3] = { 1000, 470, 220 };
r4057r4058
576492   }
577493}
578494
495/*Main Z80 is IM 0,HW-latched irqs. */
496static INTERRUPT_GEN( dderby_irq )
497{
498   cpu_set_input_line_and_vector(cputag_get_cpu(device->machine, "main"), 0, HOLD_LINE, 0xd7); /* RST 10h */
499}
500
501static INTERRUPT_GEN( dderby_timer_irq )
502{
503   cpu_set_input_line_and_vector(cputag_get_cpu(device->machine, "main"), 0, HOLD_LINE, 0xcf); /* RST 08h */
504}
505
579506static MACHINE_DRIVER_START( dderby )
580507   /* basic machine hardware */
581508   MDRV_CPU_ADD("main", Z80,4000000)       /* ? MHz */
582509   MDRV_CPU_PROGRAM_MAP(memmap,0)
583   MDRV_CPU_PERIODIC_INT(dderby_interrupt, 244)   // seems about right judging by countdown timer on screen (15 > 1)
584//  MDRV_CPU_VBLANK_INT("main", dderby_interrupt)
510   MDRV_CPU_VBLANK_INT("main", dderby_irq)
511   MDRV_CPU_PERIODIC_INT(dderby_timer_irq, 244)
585512
586// SOUND CPU (PROBABLY WRONG)
587//
588513   MDRV_CPU_ADD("audio", Z80, 4000000)   /* verified on schematics */
589514   MDRV_CPU_PROGRAM_MAP(dderby_sound_map,0)
590   MDRV_CPU_PERIODIC_INT(dderby_sound_interrupt, 100)   // total guess
591515
592516   MDRV_QUANTUM_TIME(HZ(6000))
593517   MDRV_NVRAM_HANDLER(dderby)
r4057r4058
714638
715639
716640/*    YEAR, NAME,    PARENT,   MACHINE, INPUT,   INIT,    MONITOR, COMPANY,   FULLNAME */
717GAME( 1994, dmndrby,  0,       dderby, dderby,  0, ROT0, "Electrocoin", "Diamond Derby (Newer)",GAME_NOT_WORKING|GAME_NO_SOUND ) // hack?
718GAME( 1986, dmndrbya, dmndrby, dderby, dderbya, 0, ROT0, "Electrocoin", "Diamond Derby (Original)",GAME_NOT_WORKING|GAME_NO_SOUND )
641GAME( 1994, dmndrby,  0,       dderby, dderby,  0, ROT0, "Electrocoin", "Diamond Derby (Newer)",GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_COLORS|GAME_NOT_WORKING ) // hack?
642GAME( 1986, dmndrbya, dmndrby, dderby, dderbya, 0, ROT0, "Electrocoin", "Diamond Derby (Original)",GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_COLORS|GAME_NOT_WORKING )
src/mame/drivers/seattle.c
r4057r4058
18511851   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
18521852   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
18531853   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1854   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
1854   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
18551855
18561856   PORT_START("IN2")
18571857   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
src/mame/drivers/rockola.c
r4057r4058
272272#include "rockola.h"
273273
274274
275#define MASTER_CLOCK   XTAL_11_289MHz
276
275277/* Change to 1 to allow fake debug buttons */
276278#define NIBBLER_HACK   0
277279
r4057r4058
295297   sasuke_counter = 0;
296298
297299   sasuke_timer = timer_alloc(machine, sasuke_update_counter, NULL);
298   timer_adjust_periodic(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(11289000/8));   // 1.4 MHz
300   timer_adjust_periodic(sasuke_timer, attotime_zero, 0, ATTOTIME_IN_HZ(MASTER_CLOCK / 8));   // 1.4 MHz
299301}
300302
301303
r4057r4058
756758
757759/*************************************
758760 *
761 *  6845 CRTC interface
762 *
763 *************************************/
764
765static const mc6845_interface mc6845_intf =
766{
767   "main",      /* screen we are acting on */
768   8,         /* number of pixels per video memory address */
769   NULL,      /* before pixel update callback */
770   NULL,      /* row update callback */
771   NULL,      /* after pixel update callback */
772   NULL,      /* callback for display state changes */
773   NULL,      /* HSYNC callback */
774   NULL      /* VSYNC callback */
775};
776
777
778/*************************************
779 *
759780 *  Machine initialisation
760781 *
761782 *************************************/
r4057r4058
801822
802823static MACHINE_DRIVER_START( sasuke )
803824   // basic machine hardware
804   MDRV_CPU_ADD("main", M6502, 11289000/16) // 700 kHz
825   MDRV_CPU_ADD("main", M6502, MASTER_CLOCK / 16) // 700 kHz
805826   MDRV_CPU_PROGRAM_MAP(sasuke_map, 0)
806827   MDRV_CPU_VBLANK_INT_HACK(satansat_interrupt, 2)
807828
r4057r4058
810831   // video hardware
811832
812833   MDRV_SCREEN_ADD("main", RASTER)
813   MDRV_SCREEN_REFRESH_RATE((11289000.0 / 16) / (45 * 32 * 8))
834   MDRV_SCREEN_REFRESH_RATE((MASTER_CLOCK / 16) / (45 * 32 * 8))
814835   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
815836   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
816837   MDRV_SCREEN_SIZE(32*8, 32*8)
r4057r4058
823844   MDRV_VIDEO_START(satansat)
824845   MDRV_VIDEO_UPDATE(rockola)
825846
826   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
847   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
827848
828849   // sound hardware
829850   MDRV_SPEAKER_STANDARD_MONO("mono")
r4057r4058
875896
876897static MACHINE_DRIVER_START( vanguard )
877898   // basic machine hardware
878   //MDRV_CPU_ADD("main", M6502, 11289000/8)   // 1.4 MHz
899   //MDRV_CPU_ADD("main", M6502, MASTER_CLOCK / 8)   // 1.4 MHz
879900   MDRV_CPU_ADD("main", M6502, 930000)      // adjusted
880901   MDRV_CPU_PROGRAM_MAP(vanguard_map, 0)
881902   MDRV_CPU_VBLANK_INT_HACK(rockola_interrupt, 2)
r4057r4058
885906   // video hardware
886907
887908   MDRV_SCREEN_ADD("main", RASTER)
888   MDRV_SCREEN_REFRESH_RATE((11289000.0 / 16) / (45 * 32 * 8))
909   MDRV_SCREEN_REFRESH_RATE((MASTER_CLOCK / 16) / (45 * 32 * 8))
889910   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
890911   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
891912   MDRV_SCREEN_SIZE(32*8, 32*8)
r4057r4058
898919   MDRV_VIDEO_START(rockola)
899920   MDRV_VIDEO_UPDATE(rockola)
900921
901   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
922   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
902923
903924   // sound hardware
904925   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/magicfly.c
r4057r4058
730730GFXDECODE_END
731731
732732
733/************************
734*    CRTC Interface    *
735************************/
736
737static const mc6845_interface mc6845_intf =
738{
739   "main",      /* screen we are acting on */
740   8,         /* number of pixels per video memory address */
741   NULL,      /* before pixel update callback */
742   NULL,      /* row update callback */
743   NULL,      /* after pixel update callback */
744   NULL,      /* callback for display state changes */
745   NULL,      /* HSYNC callback */
746   NULL      /* VSYNC callback */
747};
748
749
733750/*************************
734751*    Machine Drivers     *
735752*************************/
r4057r4058
758775   MDRV_VIDEO_START(magicfly)
759776   MDRV_VIDEO_UPDATE(magicfly)
760777
761   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
778   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */
762779
763780   /* sound hardware */
764781   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/galaxold.c
r4057r4058
19251925   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
19261926INPUT_PORTS_END
19271927
1928static INPUT_PORTS_START( catacomb )
1929   PORT_START("IN0")
1930   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1931   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
1932   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY
1933   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY
1934   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1935   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
1936   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
1937   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
1938   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1939   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1940   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1941   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1942   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1943   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
19441928
1945   PORT_START("IN1")
1946   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
1947   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
1948   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1949   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1950   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_COCKTAIL
1951   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1952   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1953   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1954   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
1955   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
1956   PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
1957   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Coin_B ) )
1958   PORT_DIPSETTING(    0x00, DEF_STR( 1C_3C ) )
1959   PORT_DIPSETTING(    0x80, DEF_STR( 1C_5C ) )
1960
1961   PORT_START("DSW0")
1962   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
1963   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1964   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1965   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
1966   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1967   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1968   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
1969   PORT_DIPSETTING(    0x04, "3" )
1970   PORT_DIPSETTING(    0x00, "5" )
1971   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
1972   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1973   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1974   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1975   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1976   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1977   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
1978   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1979   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1980   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
1981   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1982   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1983   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
1984   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1985   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1986
1987   PORT_START("SENSE")
1988   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
1989INPUT_PORTS_END
1990
1991static INPUT_PORTS_START( luctoday )
1992   PORT_START("IN0") //These inputs are clearly wrong, they need a full test
1993   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
1994   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1995   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )PORT_2WAY PORT_NAME("Add Credit to Bet")
1996   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_2WAY PORT_NAME("Remove Credit from Bet")
1997   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
1998   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1999   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2000   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BILL1 )
2001
2002   PORT_START("IN1")
2003   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
2004   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
2005   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
2006   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
2007   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
2008   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
2009   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
2010   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
2011
2012   PORT_START("DSW0")
2013   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2014   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2015   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2016   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
2017   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
2018INPUT_PORTS_END
2019
20201929/* ckongg coinage DIPs are spread accross two input ports */
20211930static CUSTOM_INPUT( ckongg_coinage_r )
20221931{
r4057r4058
21862095   32*8
21872096};
21882097
2189static const gfx_layout pacmanbl_charlayout =
2190{
2191   8,8,
2192   256,
2193   2,
2194   { 0, 256*8*8 },
2195   { 0, 1, 2, 3, 4, 5, 6, 7 },
2196   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
2197   8*8
2198};
21992098static const gfx_layout pacmanbl_spritelayout =
22002099{
22012100   16,16,
r4057r4058
22742173GFXDECODE_END
22752174
22762175/* separate character and sprite ROMs */
2277static GFXDECODE_START( pacmanbl )
2278   GFXDECODE_ENTRY( "gfx1", 0x0000, pacmanbl_charlayout,   0, 8 )
2279   GFXDECODE_ENTRY( "gfx1", 0x1000, pacmanbl_spritelayout, 0, 8 )
2280GFXDECODE_END
2281
22822176static GFXDECODE_START( bagmanmc )
22832177   GFXDECODE_ENTRY( "gfx1", 0x0000, bagmanmc_charlayout,    0, 8 )
22842178   GFXDECODE_ENTRY( "gfx1", 0x2000, pacmanbl_spritelayout, 0, 8 )
r4057r4058
22892183   GFXDECODE_ENTRY( "gfx1", 0x4000, _4in1_spritelayout,    0, 8 )
22902184GFXDECODE_END
22912185
2292static const ay8910_interface checkmaj_ay8910_interface =
2293{
2294   AY8910_LEGACY_OUTPUT,
2295   AY8910_DEFAULT_LOADS,
2296   soundlatch_r,
2297   NULL,
2298   NULL,
2299   NULL
2300};
2301
23022186static const ay8910_interface bongo_ay8910_interface =
23032187{
23042188   AY8910_LEGACY_OUTPUT,
r4057r4058
30972981   ROM_LOAD( "senko1.bin",   0x0000, 0x0020, CRC(1434c7ff) SHA1(0ee5f5351dd84fbf8d3d8eaafbdbe86dd29960f8) )
30982982ROM_END
30992983
3100ROM_START( luctoday )
3101   ROM_REGION( 0x10000, "main", 0 )
3102   ROM_LOAD( "ltprog1.bin", 0x0000, 0x0800, CRC(59c389b9) SHA1(1e158ced3b56db2c51e422fb4c0b8893565f1956))
3103   ROM_LOAD( "ltprog2.bin", 0x2000, 0x0800, CRC(ac3893b1) SHA1(f6b9cd8111b367ff7030cba52fe965959d92568f))
3104
3105   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
3106   ROM_LOAD( "ltchar2.bin", 0x0000, 0x0800, CRC(8cd73bdc) SHA1(6174f7347d2c96f9c5074bc0da5a370c9b07461b))
3107   ROM_LOAD( "ltchar1.bin", 0x0800, 0x0800, CRC(b5ba9946) SHA1(7222cbe8c41ca74b214f4dd5439bf69d90f4644e))
3108
3109   ROM_REGION( 0x0020, "proms", 0 )//This may not be the correct prom
3110   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, BAD_DUMP CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d))
3111ROM_END
3112
3113ROM_START( chewing )
3114   ROM_REGION( 0x10000, "main", 0 )
3115   ROM_LOAD( "1.bin", 0x0000, 0x1000, CRC(7470b347) SHA1(315d2631b50a6e469b9538318d95452e8d2e1f69) )
3116   ROM_LOAD( "7l.bin", 0x2000, 0x0800, CRC(78ebed36) SHA1(e80185737c8ac448901cf0e60ca50d967c323b34) )
3117
3118   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
3119   ROM_LOAD( "2.bin", 0x0000, 0x0800, CRC(88c605f3) SHA1(938a9fadfa0994a1d2fc9b3266ec4ccdb5ec6d3a) )
3120   ROM_LOAD( "3.bin", 0x0800, 0x0800, CRC(77ac016a) SHA1(fa5b1e79603ca8d2ee7b3d0a78f12d9ffeec3fd4) )
3121
3122   ROM_REGION( 0x0020, "proms", 0 )
3123   ROM_LOAD( "74s288.ch", 0x0000, 0x0020, CRC(24652bc4) SHA1(d89575f3749c75dc963317fe451ffeffd9856e4d) )
3124ROM_END
3125
3126ROM_START( catacomb )
3127   ROM_REGION( 0x10000, "main", 0 )
3128   ROM_LOAD( "catacomb.u",    0x0000, 0x0800, CRC(35cc28d2) SHA1(e1dbd75fc21ec88b8119bf9508c87d78e1d5c4f6) )
3129   ROM_LOAD( "catacomb.v",    0x0800, 0x0800, CRC(1d1ce133) SHA1(e22a169003a2238004bdf6c2558198216c2353b7) )
3130   ROM_LOAD( "catacomb.w",    0x1000, 0x0800, CRC(479bbde7) SHA1(9981662cb6351de7c1730de45f645fb0e26ea467) )
3131   /* no .x */
3132   ROM_LOAD( "catacomb.y",    0x2000, 0x0800, CRC(5e3da534) SHA1(a9b960ae96c8ef0b2d590bc58b711aad949025e2) )
3133
3134   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
3135   ROM_LOAD( "cat-gfx1",       0x0000, 0x0800, CRC(e871e65c) SHA1(0b528dfab0f57153db9406798848cdedee0323a0) )
3136   ROM_LOAD( "cat-gfx2",       0x0800, 0x0800, CRC(b14dafaa) SHA1(592d5931a76563b3565f22ac4c0120b9a120193f) )
3137
3138   ROM_REGION( 0x0020, "proms", 0 )
3139   /* No color PROM came with the conversion - the Moon Cresta one seems more appropriate than Galaxian,
3140       (the game is unplayable with a Galaxian PROM) but which was intended for use with the kit is unclear */
3141   ROM_LOAD( "mmi6331.6l", 0x0000, 0x0020, BAD_DUMP CRC(6a0c7d87) SHA1(140335d85c67c75b65689d4e76d29863c209cf32) )
3142ROM_END
3143
3144
31452984/*
31462985Crazy Kong
31472986Bootleg, 1982
src/mame/drivers/centiped.c
r4057r4058
2626      136013-109.5p
2727      136013-110.5r
2828
29The Two Bit Score "Dux" hack was circulated and common enough for inclusion
30
2931****************************************************************************
3032
3133    Main clock: XTAL = 12.096 MHz
r4057r4058
17611763ROM_END
17621764
17631765
1766ROM_START( centipdd ) /* Centipede "Dux" graphics hack by Two Bit Score */
1767   ROM_REGION( 0x10000, "main", 0 )
1768   ROM_LOAD( "136001-307.d1",  0x2000, 0x0800, CRC(5ab0d9de) SHA1(8ea6e3304202831aabaf31dbd0f970a7b3bfe421) )
1769   ROM_LOAD( "136001-308.e1",  0x2800, 0x0800, CRC(4c07fd3e) SHA1(af4fdbf32c23b1864819d620a874e7f205da3cdb) )
1770   ROM_LOAD( "136001-309.fh1", 0x3000, 0x0800, CRC(ff69b424) SHA1(689fa560d40a384dcbcad7c8095bc12e91875580) )
1771   ROM_LOAD( "136001-310.j1",  0x3800, 0x0800, CRC(44e40fa4) SHA1(c557db83876afc8ab52047ab1a3c3bfef34d6351) )
1772
1773   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1774   ROM_LOAD( "dux-211.f7",  0x0000, 0x0800, CRC(fee15594) SHA1(1193c295b57904d1c19c7f0400ef4c1893a80f55) )
1775   ROM_LOAD( "dux-212.hj7", 0x0800, 0x0800, CRC(f980c777) SHA1(3997a45ed38d7ae68dddf70b37da6e2e0c6a7710) )
1776
1777   ROM_REGION( 0x0100, "proms", 0 )
1778   ROM_LOAD( "136001-213.p4",   0x0000, 0x0100, CRC(6fa3093a) SHA1(2b7aeca74c1ae4156bf1878453a047330f96f0a8) )
1779ROM_END
1780
1781
17641782ROM_START( centipd2 )
17651783   ROM_REGION( 0x10000, "main", 0 )
17661784   ROM_LOAD( "136001-207.d1",  0x2000, 0x0800, CRC(b2909e2f) SHA1(90ec90bd1e262861730afd5b113ec8dddd958ed8) )
r4057r4058
18721890ROM_END
18731891
18741892
1893ROM_START( millipdd ) /* Millipede "Dux" graphics hack by Two Bit Score */
1894   ROM_REGION( 0x10000, "main", 0 )
1895   ROM_LOAD( "136013-104.1mn", 0x4000, 0x1000, CRC(40711675) SHA1(b595d6a0f5d3c611ade1b83a94c3b909d2124dc4) )
1896   ROM_LOAD( "136013-103.1l",  0x5000, 0x1000, CRC(fb01baf2) SHA1(9c1d0bbc20bf25dd21761a311fd1ed80aa029241) )
1897   ROM_LOAD( "136013-102.1jk", 0x6000, 0x1000, CRC(62e137e0) SHA1(9fe40db55ba1d20d4f11704f7f5df9ff75b87f30) )
1898   ROM_LOAD( "136013-101.1h",  0x7000, 0x1000, CRC(46752c7d) SHA1(ab06b1fd80271849946f90757b3837b617394929) )
1899
1900   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
1901   ROM_LOAD( "mil-dux.5r", 0x0000, 0x0800, CRC(b6c617b6) SHA1(a672a9b35b773677aea6b9a5c4305939180f6854) )
1902   ROM_LOAD( "mil-dux.5p", 0x0800, 0x0800, CRC(2a6ef4b0) SHA1(832dae8c1b1f959bb8582f9503d84bea9d50c08c) )
1903
1904   ROM_REGION( 0x0100, "proms", 0 )
1905   ROM_LOAD( "136001-213.7e", 0x0000, 0x0100, CRC(6fa3093a) SHA1(2b7aeca74c1ae4156bf1878453a047330f96f0a8) ) /* not used */
1906ROM_END
1907
1908
18751909ROM_START( mazeinv )
18761910   ROM_REGION( 0x10000, "main", 0 )
18771911   ROM_LOAD( "005.011",      0x3000, 0x1000, CRC(37129536) SHA1(356cb986a40b332100e00fb72194fd4dade2cba7) )
r4057r4058
19651999GAME( 1980, centipd2, centiped, centiped, centiped, 0,        ROT270, "Atari",   "Centipede (revision 2)", GAME_SUPPORTS_SAVE )
19662000GAME( 1980, centtime, centiped, centiped, centtime, 0,        ROT270, "Atari",   "Centipede (1 player, timed)", GAME_SUPPORTS_SAVE )
19672001GAME( 1980, centipdb, centiped, centipdb, centiped, 0,        ROT270, "bootleg", "Centipede (bootleg)", GAME_SUPPORTS_SAVE )
2002GAME( 1980, centipdd, centiped, centiped, centiped, 0,        ROT270, "hack",    "Centipede Dux (hack)", GAME_SUPPORTS_SAVE )
19682003GAME( 1980, caterplr, centiped, caterplr, caterplr, caterplr, ROT270, "bootleg", "Caterpillar", GAME_SUPPORTS_SAVE )
19692004GAME( 1980, millpac,  centiped, centipdb, centiped, 0,        ROT270, "Valadon Automation", "Millpac", GAME_SUPPORTS_SAVE )
19702005GAME( 1980, magworm,  centiped, magworm,  magworm,  magworm,  ROT270, "bootleg", "Magic Worm (bootleg)", GAME_SUPPORTS_SAVE )
19712006GAME( 1982, milliped, 0,        milliped, milliped, 0,        ROT270, "Atari",   "Millipede", GAME_SUPPORTS_SAVE )
2007GAME( 1982, millipdd, milliped, milliped, milliped, 0,        ROT270, "Atari",   "Millipede Dux (hack)", GAME_SUPPORTS_SAVE )
19722008
19732009GAME( 1980, warlords, 0,        warlords, warlords, 0,        ROT0,   "Atari",   "Warlords", GAME_SUPPORTS_SAVE )
19742010GAME( 1981, mazeinv,  0,        mazeinv,  mazeinv,  0,        ROT270, "Atari",   "Maze Invaders (prototype)", 0 )
src/mame/drivers/atarisy1.c
r4057r4058
1616
1717****************************************************************************
1818
19    Atari System 1 TTL motherboard factory modifications.  (From TTL Rev 1 dump.)
20
21    Location A2
22      74S02 with no pins pulled up
23      (On the solder side the traces for Pin 1 and 3 are severed and swapped by
24      jumper wire on the parts side.)
25
26        Pin 1 - Jumpered to C15
27        Pin 3 - Jumpered to C16
28
29
30    Location J16
31      74LS164 piggybacked on top of existing chip with all pins pulled up
32      except for VCC and GND
33
34        Pin 1  - Jumpered to VCC
35        Pin 2  - Jumpered to VCC
36        Pin 3  - No connection
37        Pin 4  - No connection
38        Pin 5  - No connection
39        Pin 6  - No connection
40        Pin 7  - Ground
41        Pin 8  - Jumpered to Pin 4 of 74LS244 at C17
42        Pin 9  - Jumpered to Pin 11 of piggybacked 74LS00 at J17
43        Pin 10 - No Connection
44        Pin 11 - No Connection
45        Pin 12 - No Connection
46        Pin 13 - Jumpered to Pin 9 of piggybacked 74LS00 at J17
47        Pin 14 - VCC
48
49
50    Location J17
51      74LS00 piggybacked on top of existing chip with all pins pulled up except
52      for VCC and GND
53
54        Pin 1  - Jumpered to Pin 2 of YM2151 at H16
55        Pin 2  - Jumpered to Pin 6 of 74LS273 at E10
56        Pin 3  - Jumpered to Pin 12 of piggybacked 74LS00
57        Pin 4  - No connection
58        Pin 5  - No connection
59        Pin 6  - No connection
60        Pin 7  - Ground
61        Pin 8  - Jumpered to Pin 2 of 6502 at L19 (Pin 2 of 6502 pulled up)
62        Pin 9  - Jumpered to Pin 13 of piggybacked 74LS164 at J16
63        Pin 10 - Jumpered to Pin 4 of 74LS367 at D17
64        Pin 11 - Jumpered to Pin 13 of piggybacked 74LS164 at J16
65        Pin 12 - Jumpered to Pin 3 of piggybacked 74LS00
66        Pin 13 - Jumpered to VCC
67        Pin 14 - VCC
68
69****************************************************************************
70
1971    Memory map
2072
2173****************************************************************************
r4057r4058
754806 *
755807 *************************************/
756808
809/*
810    Atari System 1 Motherboard BIOS
811
812    Initially Atari released the Atari System 1 motherboard in the TTL version and
813    then later consolidated some of the chips into the LSI version.
814
815    Motherboard Manuals:
816        * The TTL Motherboard is referenced in the TM-277 and SP-277 manuals.
817        * The LSI Motherboard is referenced in the TM-286 and SP-286 manuals.
818*/
819
757820#define ROM_LOAD16_BYTE_BIOS(bios,name,offset,length,hash) \
758821   ROMX_LOAD(name, offset, length, hash, ROM_BIOS(bios+1) | ROM_SKIP(1)) /* Note '+1' */
759822
760823#define ROM_LOAD_BIOS(bios,name,offset,length,hash) \
761824   ROMX_LOAD(name, offset, length, hash, ROM_BIOS(bios+1)) /* Note '+1' */
762825
763#define MOTHERBOARD_BIOS                                                                                 \
764   ROM_SYSTEM_BIOS( 0, "ttl", "TTL Motherboard (TM277 and SP277 manuals)" )                                        \
765    ROM_LOAD16_BYTE_BIOS(0, "136032.205", 0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) ) \
766   ROM_LOAD16_BYTE_BIOS(0, "136032.206", 0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) ) \
767   ROM_SYSTEM_BIOS( 1, "lsi", "LSI Motherboard (TM286 and SP286 manuals)" )                                        \
768    ROM_LOAD16_BYTE_BIOS(1, "136032.114", 0x00000, 0x04000, CRC(195c54ad) SHA1(d7cda3cd3db4c6f77074ca05e96ae11b62e048b7) ) /* Located at J11 */ \
769   ROM_LOAD16_BYTE_BIOS(1, "136032.115", 0x00001, 0x04000, CRC(7275b4dc) SHA1(0896ab37ea832a1335046353612c1b4c86d8d040) ) /* Located at J10 */
826#define MOTHERBOARD_BIOS                                                                                            \
827   ROM_SYSTEM_BIOS( 0, "ttl", "TTL Motherboard (Rev 2)" )                                                                     \
828    ROM_LOAD16_BYTE_BIOS(0, "136032.205.l13", 0x00000, 0x04000, CRC(88d0be26) SHA1(d124045eccc562ff0423b23a240e27ad740fa0c9) ) \
829   ROM_LOAD16_BYTE_BIOS(0, "136032.206.l12", 0x00001, 0x04000, CRC(3c79ef05) SHA1(20fdca7131478e1ee12691bdafd2d5bb74cbd16f) ) \
830   ROM_SYSTEM_BIOS( 1, "ttl1", "TTL Motherboard (Rev 1)" )                                                                    \
831    ROM_LOAD16_BYTE_BIOS(1, "136032.105.l13", 0x00000, 0x04000, CRC(690b37d3) SHA1(547372f1044a3442aa52fcd2b3546540aba59344) ) \
832   ROM_LOAD16_BYTE_BIOS(1, "136032.106.l12", 0x00001, 0x04000, CRC(76ee86c4) SHA1(cbcd424510435a04e9041967a13781fd19b0f2c4) ) \
833   ROM_SYSTEM_BIOS( 2, "lsi", "LSI Motherboard" )                                                                             \
834    ROM_LOAD16_BYTE_BIOS(2, "136032.114.j11", 0x00000, 0x04000, CRC(195c54ad) SHA1(d7cda3cd3db4c6f77074ca05e96ae11b62e048b7) ) \
835   ROM_LOAD16_BYTE_BIOS(2, "136032.115.j10", 0x00001, 0x04000, CRC(7275b4dc) SHA1(0896ab37ea832a1335046353612c1b4c86d8d040) )
770836
771#define MOTHERBOARD_ALPHA                                                                                       \
772    ROM_LOAD_BIOS(0, "136032.107", 0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) ) \
773    ROM_LOAD_BIOS(1, "136028.107", 0x00000, 0x02000, CRC(315e4bea) SHA1(a00ea23fbdbf075f8f3f184275be83387e8ac82b) ) \
837#define MOTHERBOARD_ALPHA                                                                                          \
838    ROM_LOAD_BIOS(0, "136032.104.f5", 0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) ) \
839    ROM_LOAD_BIOS(1, "136032.104.f5", 0x00000, 0x02000, CRC(7a29dc07) SHA1(72ba464da01bd6d3a91b8d9997d5ac14b6f47aad) ) \
840    ROM_LOAD_BIOS(2, "136032.107.b2", 0x00000, 0x02000, CRC(315e4bea) SHA1(a00ea23fbdbf075f8f3f184275be83387e8ac82b) )
774841
842#define MOTHERBOARD_PROMS                                                                                              \
843    ROM_LOAD_BIOS(0, "136032.101.e3", 0x00000, 0x00100, CRC(7e84972a) SHA1(84d422b53547271e3a07342704a05ef481db3f99) ) \
844    ROM_LOAD_BIOS(0, "136032.102.e5", 0x00000, 0x00100, CRC(ebf1e0ae) SHA1(2d327e78832edd67ca3909c25b8c8c839637a1ed) ) \
845    ROM_LOAD_BIOS(0, "136032.103.f7", 0x00000, 0x00001, NO_DUMP ) /* N82S153 */                                        \
846    ROM_LOAD_BIOS(1, "136032.101.e3", 0x00000, 0x00100, CRC(7e84972a) SHA1(84d422b53547271e3a07342704a05ef481db3f99) ) \
847    ROM_LOAD_BIOS(1, "136032.102.e5", 0x00000, 0x00100, CRC(ebf1e0ae) SHA1(2d327e78832edd67ca3909c25b8c8c839637a1ed) ) \
848    ROM_LOAD_BIOS(1, "136032.103.f7", 0x00000, 0x00001, NO_DUMP ) /* N82S153 */
775849
776850ROM_START( atarisy1 )
777851   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
r4057r4058
784858
785859   ROM_REGION( 0x100000, "tiles", ROMREGION_DISPOSE | ROMREGION_INVERT | ROMREGION_ERASEFF )
786860
861    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by the TTL version.) */
862    MOTHERBOARD_PROMS
863
787864   ROM_REGION( 0x400, "proms", ROMREGION_ERASE00 )   /* graphics mapping PROMs */
788865ROM_END
789866
790867
868/*
869    Marble Madness
870
871    Initially Atari released the TTL version and then later consolidated some
872    of the chips into the LSI version.
873
874    There are two different versions of the schematics and they are not compatible.
875    The SP-276 manual is for the TTL version and the SP-276-A manual is for the LSI version.
876*/
877
791878ROM_START( marble )
792879   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
793880    MOTHERBOARD_BIOS
r4057r4058
828915   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
829916   ROM_LOAD( "136033.118",   0x000, 0x200, CRC(2101b0ed) SHA1(e4fb8dfa80ed78847c697f9de2bd8540b0c04889) )  /* remap */
830917   ROM_LOAD( "136033.119",   0x200, 0x200, CRC(19f6e767) SHA1(041f24cc03c9043c31c3294c9565dfda9bdada74) )  /* color */
918
919    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
920    MOTHERBOARD_PROMS
831921ROM_END
832922
833923
r4057r4058
867957   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
868958   ROM_LOAD( "136033.118",   0x000, 0x200, CRC(2101b0ed) SHA1(e4fb8dfa80ed78847c697f9de2bd8540b0c04889) )  /* remap */
869959   ROM_LOAD( "136033.119",   0x200, 0x200, CRC(19f6e767) SHA1(041f24cc03c9043c31c3294c9565dfda9bdada74) )  /* color */
960
961    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
962    MOTHERBOARD_PROMS
870963ROM_END
871964
872965
r4057r4058
906999   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
9071000   ROM_LOAD( "136033.118",   0x000, 0x200, CRC(2101b0ed) SHA1(e4fb8dfa80ed78847c697f9de2bd8540b0c04889) )  /* remap */
9081001   ROM_LOAD( "136033.119",   0x200, 0x200, CRC(19f6e767) SHA1(041f24cc03c9043c31c3294c9565dfda9bdada74) )  /* color */
1002
1003    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1004    MOTHERBOARD_PROMS
9091005ROM_END
9101006
9111007
r4057r4058
9491045   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
9501046   ROM_LOAD( "136033.118",   0x000, 0x200, CRC(2101b0ed) SHA1(e4fb8dfa80ed78847c697f9de2bd8540b0c04889) )  /* remap */
9511047   ROM_LOAD( "136033.119",   0x200, 0x200, CRC(19f6e767) SHA1(041f24cc03c9043c31c3294c9565dfda9bdada74) )  /* color */
1048
1049    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1050    MOTHERBOARD_PROMS
9521051ROM_END
9531052
9541053
r4057r4058
9821081    ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
9831082   ROM_LOAD(        "136033.118", 0x00000, 0x00200, CRC(2101b0ed) SHA1(e4fb8dfa80ed78847c697f9de2bd8540b0c04889) )  /* remap, located at A7 */
9841083   ROM_LOAD(        "136033.159", 0x00200, 0x00200, CRC(19f6e767) SHA1(041f24cc03c9043c31c3294c9565dfda9bdada74) )  /* color, located at A5 */
1084
1085    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1086    MOTHERBOARD_PROMS
9851087ROM_END
9861088
9871089
1090/*
1091    Peter Pack-Rat
1092*/
1093
9881094ROM_START( peterpak )
9891095   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
9901096    MOTHERBOARD_BIOS
r4057r4058
10231129   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
10241130   ROM_LOAD( "136028.136",   0x000, 0x200, CRC(861cfa36) SHA1(d18ca5e28bf48df6506be6bc0283c996c6520ef4) )  /* remap */
10251131   ROM_LOAD( "136028.137",   0x200, 0x200, CRC(8507e5ea) SHA1(a009a98fe02625a20f4a9d9ab1c70891bf4e45ec) )  /* color */
1132
1133    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1134    MOTHERBOARD_PROMS
10261135ROM_END
10271136
10281137
1138/*
1139    Indiana Jones and the Temple of Doom
1140*/
1141
10291142ROM_START( indytemp )
10301143   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
10311144    MOTHERBOARD_BIOS
r4057r4058
10701183   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
10711184   ROM_LOAD( "136036.152",   0x000, 0x200, CRC(4f96e57c) SHA1(271633a0aacd1d1efe2917728b73e90010c64d2c) )  /* remap */
10721185   ROM_LOAD( "136036.151",   0x200, 0x200, CRC(7daf351f) SHA1(95c13d81a47440f847af7b19632cc032380b9ff4) )  /* color */
1186
1187    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1188    MOTHERBOARD_PROMS
10731189ROM_END
10741190
10751191
r4057r4058
11171233   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
11181234   ROM_LOAD( "136036.152",   0x000, 0x200, CRC(4f96e57c) SHA1(271633a0aacd1d1efe2917728b73e90010c64d2c) )  /* remap */
11191235   ROM_LOAD( "136036.151",   0x200, 0x200, CRC(7daf351f) SHA1(95c13d81a47440f847af7b19632cc032380b9ff4) )  /* color */
1236
1237    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1238    MOTHERBOARD_PROMS
11201239ROM_END
11211240
11221241
r4057r4058
11641283   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
11651284   ROM_LOAD( "136036.152",   0x000, 0x200, CRC(4f96e57c) SHA1(271633a0aacd1d1efe2917728b73e90010c64d2c) )  /* remap */
11661285   ROM_LOAD( "136036.151",   0x200, 0x200, CRC(7daf351f) SHA1(95c13d81a47440f847af7b19632cc032380b9ff4) )  /* color */
1286
1287    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1288    MOTHERBOARD_PROMS
11671289ROM_END
11681290
11691291
r4057r4058
12111333   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
12121334   ROM_LOAD( "136036.152",   0x000, 0x200, CRC(4f96e57c) SHA1(271633a0aacd1d1efe2917728b73e90010c64d2c) )  /* remap */
12131335   ROM_LOAD( "136036.151",   0x200, 0x200, CRC(7daf351f) SHA1(95c13d81a47440f847af7b19632cc032380b9ff4) )  /* color */
1336
1337    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1338    MOTHERBOARD_PROMS
12141339ROM_END
12151340
12161341
r4057r4058
13051430   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
13061431   ROM_LOAD( "136036.152",   0x000, 0x200, CRC(4f96e57c) SHA1(271633a0aacd1d1efe2917728b73e90010c64d2c) )  /* remap */
13071432   ROM_LOAD( "136036.151",   0x200, 0x200, CRC(7daf351f) SHA1(95c13d81a47440f847af7b19632cc032380b9ff4) )  /* color */
1433
1434    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1435    MOTHERBOARD_PROMS
13081436ROM_END
13091437
13101438
1439/*
1440    Road Runner
1441*/
1442
13111443ROM_START( roadrunn )
13121444   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
13131445    MOTHERBOARD_BIOS
r4057r4058
13651497   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
13661498   ROM_LOAD( "136040-126.7a",   0x000000, 0x000200, CRC(1713c0cd) SHA1(237ce1c53d8a17823df3341360f03b2b94cd91bb) )
13671499   ROM_LOAD( "136040-125.5a",   0x000200, 0x000200, CRC(a9ca8795) SHA1(77583510e7a7179493f313e0c0b25d029dd6e583) )
1500
1501    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1502    MOTHERBOARD_PROMS
13681503ROM_END
13691504
13701505
r4057r4058
14251560   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
14261561   ROM_LOAD( "136040-126.7a",   0x000000, 0x000200, CRC(1713c0cd) SHA1(237ce1c53d8a17823df3341360f03b2b94cd91bb) )
14271562   ROM_LOAD( "136040-125.5a",   0x000200, 0x000200, CRC(a9ca8795) SHA1(77583510e7a7179493f313e0c0b25d029dd6e583) )
1563
1564    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1565    MOTHERBOARD_PROMS
14281566ROM_END
14291567
14301568
r4057r4058
14851623   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
14861624   ROM_LOAD( "136040-126.7a",   0x000000, 0x000200, CRC(1713c0cd) SHA1(237ce1c53d8a17823df3341360f03b2b94cd91bb) )
14871625   ROM_LOAD( "136040-125.5a",   0x000200, 0x000200, CRC(a9ca8795) SHA1(77583510e7a7179493f313e0c0b25d029dd6e583) )
1626
1627    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1628    MOTHERBOARD_PROMS
14881629ROM_END
14891630
14901631
1632/*
1633    Road Blasters
1634
1635    Road Blasters was released in a cartridge version for the generic upright
1636    cabinet and a dedicated three board stack for the cockpit version.
1637
1638    The cartridge version is referenced in the TM-298 and SP-298 manuals.
1639
1640    The cockpit version is referenced in the TM-299 and SP-299 manuals.
1641*/
1642
14911643ROM_START( roadblst )
14921644   ROM_REGION( 0x88000, "main", 0 )   /* 8.5*64k for 68000 code & slapstic ROM */
14931645    MOTHERBOARD_BIOS
r4057r4058
15501702   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
15511703   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
15521704   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
1705
1706    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1707    MOTHERBOARD_PROMS
15531708ROM_END
15541709
15551710
r4057r4058
16151770   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
16161771   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
16171772   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
1773
1774    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1775    MOTHERBOARD_PROMS
16181776ROM_END
16191777
16201778
r4057r4058
16801838   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
16811839   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
16821840   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
1841
1842    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1843    MOTHERBOARD_PROMS
16831844ROM_END
16841845
16851846
r4057r4058
17451906   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
17461907   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
17471908   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
1909
1910    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1911    MOTHERBOARD_PROMS
17481912ROM_END
17491913
17501914
r4057r4058
18101974   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
18111975   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
18121976   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
1977
1978    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
1979    MOTHERBOARD_PROMS
18131980ROM_END
18141981
18151982
r4057r4058
18752042   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
18762043   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
18772044   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
2045
2046    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
2047    MOTHERBOARD_PROMS
18782048ROM_END
18792049
18802050
r4057r4058
19402110   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
19412111   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
19422112   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
2113
2114    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
2115    MOTHERBOARD_PROMS
19432116ROM_END
19442117
19452118
r4057r4058
20052178   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
20062179   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
20072180   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
2181
2182    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
2183    MOTHERBOARD_PROMS
20082184ROM_END
20092185
20102186
r4057r4058
20702246   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
20712247   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
20722248   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
2249
2250    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
2251    MOTHERBOARD_PROMS
20732252ROM_END
20742253
20752254
r4057r4058
21352314   ROM_REGION( 0x400, "proms", 0 )   /* graphics mapping PROMs */
21362315   ROM_LOAD( "136048-1174.12d", 0x000000, 0x000200, CRC(db4a4d53) SHA1(c5468f3585ec9bc23c9ee990b3ae3738b0309823) )
21372316   ROM_LOAD( "136048-1173.2d",  0x000200, 0x000200, CRC(c80574af) SHA1(9a3dc83f70e79915ce0db3e6e69b5dcfee3acb6f) )
2317
2318    ROM_REGION( 0x201, "motherbrd_proms", ROMREGION_DISPOSE) /* Motherboard PROM's (Only used by TTL version.) */
2319    MOTHERBOARD_PROMS
21382320ROM_END
21392321
21402322
src/mame/drivers/janshi.c
r4057r4058
55Janshi
66(c)1992 Eagle
77
8CPU: 68000? -- no, it isn't, might be Z180 internal rom?
8CPU: HD647180X0P6 (16K EPROM internal rom)
99Sound: AY-3-8910, M6295
1010Others: Battery
11OSC: 32MHz, 21MHz & 12.2880MHz
1112
1213ROMs:
13141.1A         [92b140a5]
r4057r4058
7071
7172static MACHINE_DRIVER_START( janshi )
7273   /* basic machine hardware */
73   MDRV_CPU_ADD("main", Z80,8000000)/*Z80? Z180?*/       /* ? MHz */
74   MDRV_CPU_ADD("main", Z80,6000000) /* Z180 */       /* ? MHz */
7475   MDRV_CPU_PROGRAM_MAP(0,mainmap)
7576//  MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
7677
r4057r4058
103104   ROM_LOAD( "11.1l", 0x00000, 0x20000, CRC(a7692ddf) SHA1(5e7f43d8337583977baf22a28bbcd9b2182c0cde) )
104105
105106   ROM_REGION( 0x10000, "main", 0 )
106   ROM_COPY( "user1", 0x10000, 0x00000, 0x4000 )// no.. is there any valid startup code, or should there be internal rom?
107   ROM_COPY( "user1", 0x10000, 0x00000, 0x4000 )// Missing 16K internal rom (might need decapping)
107108
108109   ROM_REGION( 0x140000, "gfx1", 0 )
109110   ROM_LOAD( "1.1a", 0x000000, 0x40000, CRC(92b140a5) SHA1(f3b38563f74650604ed0faaf84460e0b04b386b7) )
src/mame/drivers/taitoair.c
r4057r4058
677677   ROM_LOAD16_BYTE( "b62-32.30",  0x0c0001, 0x20000, CRC(66806646) SHA1(d8e0c37b5227d8583d523164ffc6828b4508d5a3) )
678678
679679   ROM_REGION( 0xa0000, "ym", 0 )   /* ADPCM samples */
680   ROM_LOAD( "b62-13.1",  0x00000, 0x20000, CRC(b37dc3ea) SHA1(198d4f828132316c624da998e49b1873b9886bf0) )
681   ROM_LOAD( "b62-14.2",  0x20000, 0x20000, CRC(617948a3) SHA1(4660570fa6263c28cfae7ccdf154763cc6144896) )
680   ROM_LOAD( "b62-17.5",  0x00000, 0x20000, CRC(36447066) SHA1(91c8cc4e99534b2d533895a342abb22766a20090) )
681   ROM_LOAD( "b62-16.4",  0x20000, 0x20000, CRC(203a5c27) SHA1(f6fc9322dea8d82bfec3be3fdc8616dc6adf666e) )
682682   ROM_LOAD( "b62-15.3",  0x40000, 0x20000, CRC(e35ffe81) SHA1(f35afdd7cfd4c09907fb062beb5ae46c2286a381) )
683   ROM_LOAD( "b62-16.4",  0x60000, 0x20000, CRC(203a5c27) SHA1(f6fc9322dea8d82bfec3be3fdc8616dc6adf666e) )
684   ROM_LOAD( "b62-17.5",  0x80000, 0x20000, CRC(36447066) SHA1(91c8cc4e99534b2d533895a342abb22766a20090) )
683   ROM_LOAD( "b62-14.2",  0x60000, 0x20000, CRC(617948a3) SHA1(4660570fa6263c28cfae7ccdf154763cc6144896) )
684   ROM_LOAD( "b62-13.1",  0x80000, 0x20000, CRC(b37dc3ea) SHA1(198d4f828132316c624da998e49b1873b9886bf0) )
685685
686686   ROM_REGION( 0x20000, "ym.deltat", 0 )   /* Delta-T samples */
687687   ROM_LOAD( "b62-18.31", 0x00000, 0x20000, CRC(3a4e687a) SHA1(43f07fe19dec351e851defdf9c7810fb9df04736) )
src/mame/drivers/nightgal.c
r0r4058
1/*******************************************************************************************
2
3Night Gal (c) 1984 Nichibutsu
4
5a.k.a. same Jangou blitter but with NCS CPU for displaying graphics as protection.
6
7preliminary driver by David Haywood & Angelo Salese
8
9TODO:
10-Get the other three games to boot;
11-Proper Z80<->MCU comms,many video problems because of that;
12-Abstract the video chip to a proper video file and get the name of that chip;
13
14*******************************************************************************************/
15
16#include "driver.h"
17#include "sound/ay8910.h"
18#include "cpu/z80/z80.h"
19#include "cpu/m6800/m6800.h"
20
21#define MASTER_CLOCK   XTAL_19_968MHz
22
23static UINT8 blit_raw_data[3];
24static UINT8 *blit_buffer;
25static UINT8 pen_data[0x10];
26static UINT8 pen_raw_data[0x10];
27
28static READ8_HANDLER( blitter_status_r )
29{
30   return 0x80;
31}
32
33static VIDEO_START( nightgal )
34{
35   blit_buffer = auto_malloc(256*256);
36}
37
38static VIDEO_UPDATE( nightgal )
39{
40   int x, y;
41
42   for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
43   {
44      UINT8 *src = &blit_buffer[y * 512/2 + cliprect->min_x];
45      UINT16 *dst = BITMAP_ADDR16(bitmap, y, cliprect->min_x);
46
47      for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
48      {
49         UINT32 srcpix = *src++;
50         *dst++ = screen->machine->pens[srcpix & 0xf];
51         *dst++ = screen->machine->pens[(srcpix >> 4) & 0xf];
52      }
53   }
54
55
56   return 0;
57}
58
59static UINT8 nightgal_gfx_nibble(running_machine *machine,int niboffset)
60{
61   UINT8 *blit_rom = memory_region(machine,"gfx1");
62
63   if (niboffset&1)
64   {
65      return (blit_rom[(niboffset>>1)&0x1ffff] & 0xf0)>>4;
66   }
67   else
68   {
69      return (blit_rom[(niboffset>>1)&0x1ffff] & 0x0f);
70   }
71}
72
73static void plot_nightgal_gfx_pixel(UINT8 pix, int x, int y)
74{
75   if (y>=512) return;
76   if (x>=512) return;
77   if (y<0) return;
78   if (x<0) return;
79
80   if (x&1)
81   {
82      blit_buffer[(y*256)+(x>>1)] = (blit_buffer[(y*256)+(x>>1)] & 0x0f) | ((pix<<4) & 0xf0);
83   }
84   else
85   {
86      blit_buffer[(y*256)+(x>>1)] = (blit_buffer[(y*256)+(x>>1)] & 0xf0) | (pix & 0x0f);
87   }
88}
89
90static WRITE8_HANDLER(nsc_true_blitter_w )
91{
92   static UINT8 true_blit[7];
93
94   int src,x,y,h,w, flipx;
95   true_blit[offset] = data;
96
97   /*trigger blitter write to ram,might not be correct...*/
98   if(offset == 5)
99   {
100      //printf("%02x %02x %02x %02x %02x %02x %02x\n",true_blit[0],true_blit[1],true_blit[2],true_blit[3],true_blit[4],true_blit[5],true_blit[6]);
101      w = (true_blit[4] & 0xff)+1;
102      h = (true_blit[5] & 0xff)+1;
103      src = ((true_blit[1]<<8)|(true_blit[0]<<0));
104      src |= (true_blit[6]&3)<<16;
105
106
107      x = (true_blit[2] & 0xff);
108      y = (true_blit[3] & 0xff);
109
110      // lowest bit of src controls flipping / draw direction?
111      flipx=(true_blit[0] & 1);
112
113      if (!flipx) src += (w*h)-1;
114      else src -= (w*h)-1;
115
116      {
117         int count = 0;
118         int xcount,ycount;
119         for(ycount=0;ycount<h;ycount++)
120         {
121            for(xcount=0;xcount<w;xcount++)
122            {
123               int drawx = (x+xcount) & 0xff;
124               int drawy = (y+ycount) & 0xff;
125               UINT8 dat = nightgal_gfx_nibble(space->machine,src+count);
126               UINT8 cur_pen_hi = pen_data[(dat & 0xf0)>>4];
127               UINT8 cur_pen_lo = pen_data[(dat & 0x0f)>>0];
128
129               dat = cur_pen_lo | cur_pen_hi<<4;
130
131               if((dat & 0xff) != 0)
132                  plot_nightgal_gfx_pixel(dat, drawx,drawy);
133
134               if (!flipx)   count--;
135               else count++;
136            }
137         }
138      }
139   }
140}
141
142static PALETTE_INIT( nightgal )
143{
144   int   bit0, bit1, bit2 , r, g, b;
145   int   i;
146
147   for (i = 0; i < 0x10; ++i)
148   {
149      bit0 = (color_prom[0] >> 0) & 0x01;
150      bit1 = (color_prom[0] >> 1) & 0x01;
151      bit2 = (color_prom[0] >> 2) & 0x01;
152      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
153      bit0 = (color_prom[0] >> 3) & 0x01;
154      bit1 = (color_prom[0] >> 4) & 0x01;
155      bit2 = (color_prom[0] >> 5) & 0x01;
156      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
157      bit0 = 0;
158      bit1 = (color_prom[0] >> 6) & 0x01;
159      bit2 = (color_prom[0] >> 7) & 0x01;
160      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
161
162      palette_set_color(machine, i, MAKE_RGB(r, g, b));
163      color_prom++;
164   }
165}
166
167/********************************************
168*
169* Z80-MCU communications
170*
171********************************************/
172
173/*
174(note:when I say "0x80" I just mean a negative result)
175master-slave algorythm
176-z80 writes the data for the mcu;
177-z80 writes 0 to c200;
178-it waits with the bit 0x80 on c100 clears (i.e. the z80 halts),when this happens the z80 continues his logic algorythm (so stop it until we are done!!!)
179
180-nsc takes an irq
181-puts ff to [1100]
182-it waits that the bit 0x80 on [1100] clears
183-(puts default clut data,only the first time around)
184-reads params from z80 and puts them on the blitter chip
185-expects that bit [80] is equal to 0x80;
186-clears [1100] and expects that [1100] is 0
187-executes a wai (i.e. halt) opcode then expects to receive another irq...
188*/
189
190#define MAIN_Z80_RUN   if(offset == 2) z80_latch = 0x00
191#define MAIN_Z80_HALT  if(offset == 2) z80_latch = 0x80
192//#define SUB_NCS_RUN ncs_latch = 0x00
193//#define SUB_NCS_HALT ncs_latch = 0x80
194
195static UINT8 nsc_latch,z80_latch;
196
197static WRITE8_HANDLER( nsc_latch_w )
198{
199   cpu_set_input_line(space->machine->cpu[1], 0, HOLD_LINE );
200}
201
202static READ8_HANDLER( nsc_latch_r )
203{
204   return z80_latch;
205}
206
207static WRITE8_HANDLER( z80_latch_w )
208{
209   nsc_latch = data;
210}
211
212static READ8_HANDLER( z80_latch_r )
213{
214   return nsc_latch;
215}
216
217/*z80 -> MCU video params*/
218static WRITE8_HANDLER( blitter_w )
219{
220   blit_raw_data[offset] = data;
221   MAIN_Z80_HALT;
222}
223
224static READ8_HANDLER( nsc_blit_r )
225{
226   MAIN_Z80_RUN;
227   return blit_raw_data[offset];
228}
229
230static WRITE8_HANDLER( blit_vregs_w )
231{
232   pen_raw_data[offset] = data;
233}
234
235static READ8_HANDLER( blit_vregs_r )
236{
237   return pen_raw_data[offset];
238}
239
240static WRITE8_HANDLER( blit_true_vregs_w )
241{
242   pen_data[offset] = data;
243}
244
245/********************************************
246*
247* Input Multiplexer handling
248*
249********************************************/
250
251static UINT8 mux_data;
252
253static WRITE8_HANDLER( mux_w )
254{
255   mux_data = ~data;
256//  printf("%02x\n",mux_data);
257}
258
259static READ8_HANDLER( input_1p_r )
260{
261   static UINT8 cr_clear;
262
263   cr_clear = input_port_read(space->machine, "CR_CLEAR");
264
265   switch(mux_data)
266   {
267      case 0x01: return input_port_read(space->machine, "PL1_1") | cr_clear;
268      case 0x02: return input_port_read(space->machine, "PL1_2") | cr_clear;
269      case 0x04: return input_port_read(space->machine, "PL1_3") | cr_clear;
270      case 0x08: return input_port_read(space->machine, "PL1_4") | cr_clear;
271      case 0x10: return input_port_read(space->machine, "PL1_5") | cr_clear;
272      case 0x20: return input_port_read(space->machine, "PL1_6") | cr_clear;
273   }
274//  printf("%04x\n",mux_data);
275
276   return (input_port_read(space->machine, "PL1_1") & input_port_read(space->machine, "PL1_2") & input_port_read(space->machine, "PL1_3") &
277          input_port_read(space->machine, "PL1_4") & input_port_read(space->machine, "PL1_5") & input_port_read(space->machine, "PL1_6")) | cr_clear;//input_port_read(space->machine, "PL1_0") && ;
278}
279
280static READ8_HANDLER( input_2p_r )
281{
282   static UINT8 coin_port;
283
284   coin_port = input_port_read(space->machine, "COINS");
285
286   switch(mux_data)
287   {
288      case 0x01: return input_port_read(space->machine, "PL2_1") | coin_port;
289      case 0x02: return input_port_read(space->machine, "PL2_2") | coin_port;
290      case 0x04: return input_port_read(space->machine, "PL2_3") | coin_port;
291      case 0x08: return input_port_read(space->machine, "PL2_4") | coin_port;
292      case 0x10: return input_port_read(space->machine, "PL2_5") | coin_port;
293      case 0x20: return input_port_read(space->machine, "PL2_6") | coin_port;
294   }
295//  printf("%04x\n",mux_data);
296
297   return (input_port_read(space->machine, "PL2_1") & input_port_read(space->machine, "PL2_2") & input_port_read(space->machine, "PL2_3") &
298          input_port_read(space->machine, "PL2_4") & input_port_read(space->machine, "PL2_5") & input_port_read(space->machine, "PL2_6")) | coin_port;//input_port_read(space->machine, "PL1_0") && ;
299
300}
301
302/********************************************
303*
304* Memory Maps
305*
306********************************************/
307
308static ADDRESS_MAP_START( nightgal_map, ADDRESS_SPACE_PROGRAM, 8 )
309   AM_RANGE(0x0000, 0x7fff) AM_ROM
310   AM_RANGE(0xc100, 0xc100) AM_READ(nsc_latch_r)
311   AM_RANGE(0xc200, 0xc200) AM_WRITE(nsc_latch_w)
312   AM_RANGE(0xc300, 0xc30f) AM_WRITE(blit_vregs_w)
313   AM_RANGE(0xf000, 0xffff) AM_RAM
314ADDRESS_MAP_END
315
316static ADDRESS_MAP_START( nightgal_io, ADDRESS_SPACE_IO, 8 )
317   ADDRESS_MAP_GLOBAL_MASK(0xff)
318   AM_RANGE(0x01,0x01) AM_READ(ay8910_read_port_0_r) //ay read port
319   AM_RANGE(0x02,0x02) AM_WRITE(ay8910_write_port_0_w)
320   AM_RANGE(0x03,0x03) AM_WRITE(ay8910_control_port_0_w)
321//  AM_RANGE(0x10,0x10) AM_WRITE(output_w)
322   AM_RANGE(0x10,0x10) AM_READ_PORT("DSWC")
323   AM_RANGE(0x11,0x11) AM_READ_PORT("SYSA")
324   AM_RANGE(0x12,0x12) AM_READ_PORT("DSWA")
325   AM_RANGE(0x13,0x13) AM_READ_PORT("DSWB")
326   AM_RANGE(0x11,0x11) AM_WRITE(mux_w)
327   AM_RANGE(0x12,0x14) AM_WRITE(blitter_w) //data for the nsc to be processed
328ADDRESS_MAP_END
329
330static ADDRESS_MAP_START( nsc_map, ADDRESS_SPACE_PROGRAM, 8 )
331   AM_RANGE(0x0000, 0x007f) AM_RAM
332   AM_RANGE(0x0080, 0x0080) AM_READ(blitter_status_r)
333   AM_RANGE(0x0081, 0x0083) AM_READ(nsc_blit_r)
334   AM_RANGE(0x0080, 0x0086) AM_WRITE(nsc_true_blitter_w)
335
336   AM_RANGE(0x00a0, 0x00af) AM_WRITE(blit_true_vregs_w)
337
338   AM_RANGE(0x1100, 0x1100) AM_READWRITE(z80_latch_r,z80_latch_w) //irq control?
339   AM_RANGE(0x1200, 0x1200) AM_READNOP //flip screen set bit
340   AM_RANGE(0x1300, 0x130f) AM_READ(blit_vregs_r)
341//  AM_RANGE(0x1000, 0xdfff) AM_ROM AM_REGION("gfx1", 0 )
342   AM_RANGE(0xe000, 0xffff) AM_ROM AM_WRITENOP
343ADDRESS_MAP_END
344
345/********************************************
346*
347* Input ports
348*
349********************************************/
350
351static INPUT_PORTS_START( sexygal )
352   PORT_START("CR_CLEAR")
353   PORT_DIPNAME( 0x40, 0x40, "Credit Clear-1" )//button
354   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
355   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
356   PORT_DIPNAME( 0x80, 0x80, "Credit Clear-2" )//button
357   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
358   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
359
360   PORT_START("COINS")
361   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) //player-1 side
362   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) //player-2 side
363
364   PORT_START("PL1_1")
365   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
366   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
367   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
368   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
369   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
370   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
371   PORT_START("PL1_2")
372   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
373   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
374   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
375   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
376   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
377   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CODE(KEYCODE_3)//rate button
378   PORT_START("PL1_3")
379   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
380   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
381   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
382   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
383   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
384   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //another D button
385   PORT_START("PL1_4")
386   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
387   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
388   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
389   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
390   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) //another opt 1 button
391   PORT_START("PL1_5")
392   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
393   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 1")
394   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 2")
395   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
396   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 3")
397   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 4")
398   PORT_START("PL1_6")
399   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
400   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Pass") //???
401   PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
402
403   PORT_START("PL2_1")
404   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
405   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
406   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
407   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
408   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
409   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
410   PORT_START("PL2_2")
411   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
412   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
413   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
414   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
415   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
416   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CODE(KEYCODE_4) PORT_PLAYER(2)//rate button
417   PORT_START("PL2_3")
418   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
419   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
420   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
421   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
422   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
423   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //another D button
424   PORT_START("PL2_4")
425   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
426   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
427   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
428   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
429   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) //another opt 1 button
430   PORT_START("PL2_5")
431   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
432   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 1") PORT_PLAYER(2)
433   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 2") PORT_PLAYER(2)
434   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
435   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 3") PORT_PLAYER(2)
436   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 4") PORT_PLAYER(2)
437   PORT_START("PL2_6")
438   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
439   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Pass") PORT_PLAYER(2) //???
440   PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
441
442   PORT_START("SYSTEM")
443   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
444   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
445   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
446   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
447   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
448   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
449   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
450   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
452   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
453   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
454   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
455   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
456   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
457   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
458   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
459   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
460   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
461   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
462   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
463   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
464   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
465   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
466   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
467
468   PORT_START("SYSA")
469   PORT_DIPNAME( 0x01, 0x00, "SYSA" )
470   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
471   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
472   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
473   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
474   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
475   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
476   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
477   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
478   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
479   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
480   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
481   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
482   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
483   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
484   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
485   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
486   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
487   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
488   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
489   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
490   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
491   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
492   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
493
494   PORT_START("DSWA")
495   PORT_DIPNAME( 0x01, 0x01, "DSWA" )
496   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
497   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
498   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
499   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
500   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
501   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
502   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
503   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
504   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
505   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
506   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
507   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
508   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
509   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
510   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
511   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
512   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
513   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
514   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
515   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
516   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
517   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
518   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
519
520   PORT_START("DSWB")
521   PORT_DIPNAME( 0x01, 0x01, "DSWB" )
522   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
523   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
524   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
525   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
526   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
527   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
528   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
529   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
530   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
531   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
532   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
533   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
534   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
535   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
536   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
537   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
538   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
539   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
540   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
541   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
542   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
543   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
544   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
545
546   PORT_START("DSWC")
547   PORT_DIPNAME( 0x01, 0x01, "DSWC" )
548   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
549   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
550   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
551   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
552   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
553   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
554   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
555   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
556   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
557   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
558   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
559   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
560   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
561   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
562   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
563   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
564   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
565   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
566   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
567   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
568   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
569   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
570   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
571INPUT_PORTS_END
572
573static const ay8910_interface ay8910_config =
574{
575   AY8910_LEGACY_OUTPUT,
576   AY8910_DEFAULT_LOADS,
577   input_1p_r,
578   input_2p_r,
579   NULL,
580   NULL
581};
582
583static MACHINE_DRIVER_START( nightgal )
584   /* basic machine hardware */
585   MDRV_CPU_ADD("main", Z80,MASTER_CLOCK / 4)       /* ? MHz */
586   MDRV_CPU_PROGRAM_MAP(0,nightgal_map)
587   MDRV_CPU_IO_MAP(0,nightgal_io)
588   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
589
590   MDRV_CPU_ADD("sub", NSC8105, MASTER_CLOCK / 4)
591   MDRV_CPU_PROGRAM_MAP(nsc_map, 0)
592
593   MDRV_QUANTUM_PERFECT_CPU("main")
594
595   /* video hardware */
596   MDRV_SCREEN_ADD("main", RASTER)
597   MDRV_SCREEN_REFRESH_RATE(60)
598   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
599   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
600   MDRV_SCREEN_SIZE(256, 256)
601   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
602   MDRV_PALETTE_INIT(nightgal)
603
604   MDRV_PALETTE_LENGTH(0x10)
605
606   MDRV_VIDEO_START(nightgal)
607   MDRV_VIDEO_UPDATE(nightgal)
608
609   /* sound hardware */
610   MDRV_SPEAKER_STANDARD_MONO("mono")
611
612   MDRV_SOUND_ADD("ay", AY8910, MASTER_CLOCK / 8)
613   MDRV_SOUND_CONFIG(ay8910_config)
614   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
615MACHINE_DRIVER_END
616
617/*TODO*/
618static MACHINE_DRIVER_START( sexygal )
619   /* basic machine hardware */
620   MDRV_IMPORT_FROM( nightgal )
621//  MDRV_CPU_MODIFY("main")
622//  MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
623MACHINE_DRIVER_END
624
625
626/*
627Night Gal
628(c)1984 NihonBussan Co.,Ltd.
629
630OSC:20MHz
631CPU:Z80
632SND:AY-3-8910
633ETC:CUSTOM(The surface of the chip is scrached, so the name of the chip is unknown), MemoryBackup
634
635NGAL_01.BIN graphic
636NGAL_02.BIN graphic
637NGAL_03.BIN graphic
638NGAL_04.BIN graphic
639NGAL_05.BIN graphic
640NGAL_06.BIN graphic
641NGAL_07.BIN graphic
642NGAL_08.BIN graphic
643NGAL_09.BIN program
644NGAL_10.BIN program
645NGAL_11.BIN program
646NGAL_12.BIN program
647NGAL_BP.BIN color
648
649Dumped by Gastroptosis. 2000/06/04
650Dumped by Uki. 2000/06/11
651?
652*/
653
654ROM_START( nightgal )
655   ROM_REGION( 0x8000, "main", 0 )
656   ROM_LOAD( "ngal_10.bin", 0x00000, 0x02000, CRC(5eb28742) SHA1(d48045b7cbce69093494c4ec764cf4fb3c120bd6) )
657   ROM_LOAD( "ngal_11.bin", 0x02000, 0x02000, CRC(c52f7942) SHA1(e23b9e4936f9b3111ea14c0250190ee6de1ed4ab) )
658   ROM_LOAD( "ngal_12.bin", 0x04000, 0x02000, CRC(515e69a7) SHA1(234247c829c2b082360d7d44c1488fc5fcf45cd2) )
659
660   ROM_REGION( 0x10000, "sub", 0 )
661   ROM_LOAD( "ngal_09.bin", 0x0e000, 0x02000, CRC(da3dcc08) SHA1(6f5319c1777dabf7041286698ac8f25eca1545a1) )
662
663   ROM_REGION( 0x20000, "gfx1", 0 )
664   ROM_LOAD( "ngal_01.bin",  0x00000, 0x02000, CRC(8e4c92ad) SHA1(13cebe765ebabe6be79c9c9ac3f778550e450380) )
665   ROM_LOAD( "ngal_02.bin",  0x02000, 0x02000, CRC(c60f7dc1) SHA1(273fd05c62e1efe26538efd2d4f0973c5eba65e4) )
666   ROM_LOAD( "ngal_03.bin",  0x04000, 0x02000, CRC(824b7d9e) SHA1(04d3340cbb954add0d70c093df4ccb669e5ed12b) )
667   ROM_LOAD( "ngal_04.bin",  0x06000, 0x02000, CRC(d1981ad6) SHA1(668a7aaa43b4e727a90a4e11cee659509465e546) )
668   ROM_LOAD( "ngal_05.bin",  0x08000, 0x02000, CRC(ed5e4a28) SHA1(5d9441a2c79ad3a3d1b2ad7187bba49bdbd0a76e) )
669   ROM_LOAD( "ngal_06.bin",  0x0a000, 0x02000, CRC(81de181d) SHA1(b528c0c82dc240dc34fe5b2fcb77b0e5f5701c7c) )
670   ROM_LOAD( "ngal_07.bin",  0x0c000, 0x02000, CRC(de0e6f9b) SHA1(ac3428b0ba560e41f46dfb906da2c5e0f034d31c) )
671   ROM_LOAD( "ngal_08.bin",  0x0e000, 0x02000, CRC(2c5cc9a0) SHA1(9ba797eb2fc549e9f16dfee442fd7de53a58d4f0) )
672
673   ROM_REGION( 0x20, "proms", 0 )
674   ROM_LOAD( "ngal_bp.bin", 0x00, 0x20, CRC(19255a7d) SHA1(4ac6316f7d8b575f28d33564b422b68993a4e484) )
675ROM_END
676
677/*
678
679Night Bunny
680(c)1984 Nichibutsu
681
682CPU: Z80
683Sound: AY-3-8910
684OSC: 20.000MHz
685Other: surface scrached DIP40 (NB1413M3?)
686
687ROMs:
6881.3A
6892.3C
6903.3D
6914.3F
6925.3M
6936.3N
6947.3P
6958.3S (2764)
696MB7051.6S
697
698
699dumped by sayu
700--- Team Japump!!! ---
701http://japump.i.am/
702
703
704*/
705ROM_START( ngtbunny )
706   ROM_REGION( 0x8000, "main", 0 )
707   ROM_LOAD( "6.3n", 0x00000, 0x02000, CRC(3e39c0ef) SHA1(56287fb19ff1a61ff606454315e433ecd2e9318a) )
708   ROM_LOAD( "7.3p", 0x02000, 0x02000, CRC(34024380) SHA1(ba535e2b198f55e68a45ad7030b12c9aa1389aea) )
709   ROM_LOAD( "8.3s", 0x04000, 0x02000, CRC(9bf96168) SHA1(f0e9302bc9577fe779b56cb72035672368c94481) )
710
711   ROM_REGION( 0x10000, "sub", 0 )
712   ROM_LOAD( "5.3m",  0x0e000, 0x02000, CRC(b8a82966) SHA1(9f86b3208fb48f9735cfc4f8e62680f0cb4a92f0) )
713
714   ROM_REGION( 0x20000, "gfx1", 0 )
715   ROM_LOAD( "1.3a",  0x00000, 0x02000, CRC(16776c5f) SHA1(a2925eaed938ae3985ea796658b62d6fafb6412b) )
716   ROM_LOAD( "2.3c",  0x02000, 0x02000, CRC(dffd2cc6) SHA1(34f45b20596f69c44dc01c7aef765ab3ddaa076b) )
717   ROM_LOAD( "3.3d",  0x04000, 0x02000, CRC(c532ca49) SHA1(b01b08e99e24649c45ce1833f830775d6f532f6b) )
718   ROM_LOAD( "4.3f",  0x06000, 0x02000, CRC(ade1d0d8) SHA1(c3ad6bfeed878132d02770d97f6392daa509de5f) )
719
720   ROM_REGION( 0x20, "proms", 0 )
721   ROM_LOAD( "mb7051.6s", 0x00, 0x20, CRC(006b42d6) SHA1(ced119a299a9a7694d2fa0ef178b69d76abd0d6f) )
722ROM_END
723
724ROM_START( royalngt )
725   ROM_REGION( 0x8000, "main", 0 )
726   ROM_LOAD( "rn6.3n", 0x00000, 0x02000, CRC(abbf38b9) SHA1(455dcec2ac2187b7216ff53fbbb8975b763fb981) )
727   ROM_LOAD( "rn7.3p", 0x02000, 0x02000, CRC(ae9c082b) SHA1(ee3effea653f972fd732453e9ab72f48e75410f8) )
728   ROM_LOAD( "rn8.3s", 0x04000, 0x02000, CRC(1371a83a) SHA1(c7107b62534837dd51bb4a93ba9a690f91393930) )
729
730   ROM_REGION( 0x10000, "sub", 0 )
731   ROM_LOAD( "rn5.3l",  0x0e000, 0x02000, CRC(b8a82966) SHA1(9f86b3208fb48f9735cfc4f8e62680f0cb4a92f0) )
732
733   ROM_REGION( 0x20000, "gfx1", 0 )
734   ROM_LOAD( "rn1.3a",  0x00000, 0x02000, CRC(16776c5f) SHA1(a2925eaed938ae3985ea796658b62d6fafb6412b) )
735   ROM_LOAD( "rn2.3c",  0x02000, 0x02000, CRC(dffd2cc6) SHA1(34f45b20596f69c44dc01c7aef765ab3ddaa076b) )
736   ROM_LOAD( "rn3.3d",  0x04000, 0x02000, CRC(31fb1d47) SHA1(41441bc2613c95dc810cad569cbaa0c023c819ba) )
737   ROM_LOAD( "rn4.3e",  0x06000, 0x02000, CRC(ade1d0d8) SHA1(c3ad6bfeed878132d02770d97f6392daa509de5f) )
738
739   ROM_REGION( 0x20, "proms", 0 )
740   ROM_LOAD( "f5.6s", 0x00, 0x20, CRC(006b42d6) SHA1(ced119a299a9a7694d2fa0ef178b69d76abd0d6f) )
741ROM_END
742
743/*
744
745Sexy Gal
746(c)1985 Nihon Bussan
747
748XG-1B (main board)
749SGP-A (sub board)
750
751CPU:    Z80-A
752SOUND:  YM2203C
753    DAC
754OSC:    20.000MHz
755    10.000MHz
756    6.000MHz (sub board)
757Chips:  CPU? 40pin
758    CPU? 40pin (sub board)
759
760
7611.3A    prg?
762
7632.3C    chr.
7643.3D
7654.3E
7665.3F
7676.3H
7687.3JK
7698.3KL
7709.3M
771
77210.3N   Z80 prg.
77311.3PR
774
77512.S8B  prg./samples?
77613.S7B
77714.S6B
778
779SG.7E   color
780
781
782*/
783
784ROM_START( sexygal )
785   ROM_REGION( 0x10000, "main", 0 )
786   ROM_LOAD( "10.3n",  0x00000, 0x04000, CRC(53425b74) SHA1(1239c0527d00d693313366b7e3da669565f99ffd) )
787   ROM_LOAD( "11.3pr", 0x04000, 0x04000, CRC(a3138b42) SHA1(1bf7f6e2c4020251379cc72fa731c17795f35e2e) )
788
789   ROM_REGION( 0x10000, "sub", 0 )
790   ROM_LOAD( "1.3a",   0x0c000, 0x04000, CRC(f814cf27) SHA1(ceba1f14a202d926380039d7cb4669eb8be58539) ) // has a big (16 byte wide) ASCII 'Y.M' art, written in YMs (!)
791
792   ROM_REGION( 0xc000, "samples", 0 )
793   ROM_LOAD( "12.s8b",  0x00000, 0x04000, CRC(7ac4a984) SHA1(7b41c522387938fe7625c9a6c62a385d6635cc5e) )
794   ROM_LOAD( "13.s7b",  0x04000, 0x04000, CRC(5eb75f56) SHA1(b7d81d786d1ac8d65a6a122140954eb89d76e8b4) )
795   ROM_LOAD( "14.s6b",  0x08000, 0x04000, CRC(b4a2497b) SHA1(7231f57b4548899c886625e883b9972c0f30e9f2) )
796
797   ROM_REGION( 0x20000, "gfx1", 0 )
798   ROM_LOAD( "2.3c",  0x00000, 0x04000, CRC(f719e09d) SHA1(c78411b4f974b3dd261d51e522e086fc30a96fcb) )
799   ROM_LOAD( "3.3d",  0x04000, 0x04000, CRC(a84d9a89) SHA1(91d5978e35ba4acf9353a13ec22c22aeb8a35f12) )
800   ROM_LOAD( "4.3e",  0x08000, 0x04000, CRC(f1cdbedb) SHA1(caacf2887a3a05e498d57d570a1e9873f95a5d5f) )
801   ROM_LOAD( "5.3f",  0x0c000, 0x04000, CRC(76569186) SHA1(79cb32c1f1a96f90d59f331a01ca548936933b87) )
802   ROM_LOAD( "6.3h",  0x10000, 0x04000, CRC(8b6268e4) SHA1(c57bb7fe8f079d8f202f370cd7bdce1cf0596ede) )
803   ROM_LOAD( "7.3jk", 0x14000, 0x04000, CRC(c88f68b8) SHA1(512019f465c298ba8fbf0f6c285a9b0d6c8f7411) )
804   ROM_LOAD( "8.3kl", 0x18000, 0x04000, CRC(4631e092) SHA1(961b10b556defe9e4ba84180149bb2ef4042dbe9) )
805   ROM_LOAD( "9.3m",  0x1c000, 0x04000, CRC(198df711) SHA1(adf9531ee7058db2314811aba7568bd332632947) )
806
807   ROM_REGION( 0x20, "proms", 0 )
808   ROM_LOAD( "sg.7e", 0x00, 0x20, CRC(5786a035) SHA1(29d95a6fb076d64ca217206fcadde51993830a88) )
809ROM_END
810
811ROM_START( sweetgal )
812   ROM_REGION( 0x10000, "main", 0 )
813   ROM_LOAD( "10.3n",  0x00000, 0x04000, CRC(0f6c4bf0) SHA1(50e5c6f08e124641f5df8938ccfcdebde18f6a0f) )
814   ROM_LOAD( "11.3p", 0x04000, 0x04000, CRC(7388e9b3) SHA1(e318d2d3888679bbd43a0aab68252fd359b7969d) )
815
816   ROM_REGION( 0x10000, "sub", 0 )
817   ROM_LOAD( "1.3a", 0x0e000, 0x2000, CRC(5342c757) SHA1(b4ff84c45bd2c6a6a468f1d0daaf5b19c4dbf8fe) )
818
819   ROM_REGION( 0xc000, "samples", 0 ) // sound samples
820   ROM_LOAD( "v2_12.bin",  0x00000, 0x04000, CRC(66a35be2) SHA1(4f0d73d753387acacc5ccc90e91d848a5ecce55e) )
821   ROM_LOAD( "v2_13.bin",  0x04000, 0x04000, CRC(60785a0d) SHA1(71eaec3512c0b18b93c083c1808eec51cfd4f520) )
822   ROM_LOAD( "v2_14.bin",  0x08000, 0x04000, CRC(149e84c1) SHA1(5c4e18637bef2f31bc3578cae6525fb6280fbc06) )
823
824   ROM_REGION( 0x20000, "gfx1", 0 )
825   ROM_LOAD( "2.3c",  0x00000, 0x04000, CRC(3a3d78f7) SHA1(71e35529f30c43ee8ec2363f85fe17042f1d304e) )
826   ROM_LOAD( "3.3d",  0x04000, 0x04000, CRC(c6f9b884) SHA1(32d6fe1906a3f1f528f30dbd3f89971b2ea1925b) )
827   // all roms below match sexygal
828   ROM_LOAD( "4.3e",  0x08000, 0x04000, CRC(f1cdbedb) SHA1(caacf2887a3a05e498d57d570a1e9873f95a5d5f) )
829   ROM_LOAD( "5.3f",  0x0c000, 0x04000, CRC(76569186) SHA1(79cb32c1f1a96f90d59f331a01ca548936933b87) )
830   ROM_LOAD( "6.3h",  0x10000, 0x04000, CRC(8b6268e4) SHA1(c57bb7fe8f079d8f202f370cd7bdce1cf0596ede) )
831   ROM_LOAD( "7.3jk", 0x14000, 0x04000, CRC(c88f68b8) SHA1(512019f465c298ba8fbf0f6c285a9b0d6c8f7411) )
832   ROM_LOAD( "8.3kl", 0x18000, 0x04000, CRC(4631e092) SHA1(961b10b556defe9e4ba84180149bb2ef4042dbe9) )
833   ROM_LOAD( "9.3m",  0x1c000, 0x04000, CRC(198df711) SHA1(adf9531ee7058db2314811aba7568bd332632947) )
834
835   ROM_REGION( 0x20, "proms", 0 )
836   ROM_LOAD( "sg.7e", 0x00, 0x20, CRC(5786a035) SHA1(29d95a6fb076d64ca217206fcadde51993830a88) )
837ROM_END
838
839/*
840
841Night Gal Summer (JPN Ver.)
842(c)1985 Nihon Bussan
843
844CPU:    Z80
845SOUND:  AY-3-8910
846    DAC
847OSC:    20.000MHz
848    6.000MHz (sub board)
849
850Chips:  NG138507 (CPU?)
851    Unknown 40pin
852    Unknown 40pin
853
854
8551S.IC7  prg./samples?
8562S.IC6
8573S.IC5
858
8591.3A    chr.
8602.3C
8613.3D
8624.3F
8635.3H
8646.3L
865
8667.3P    main prg.
8678.3S
8689.3T
86910.3V
870
871NG2.6U  color
872
873
874
875*/
876
877ROM_START( ngalsumr )
878   ROM_REGION( 0x8000, "main", 0 )
879   ROM_LOAD( "8.3s", 0x00000, 0x02000, CRC(30f81b12) SHA1(e264b0cdc6ff400643cba56847344c270e96a204) )
880   ROM_LOAD( "9.3t", 0x02000, 0x02000, CRC(879fc493) SHA1(ec7c6928b5d4e46dcc99271466e7eb801f601a70) )
881   ROM_LOAD( "10.3v", 0x04000, 0x02000, CRC(31211088) SHA1(960b781c420602be3de66565a030cf5ebdcc2ffb) )
882
883   ROM_REGION( 0x10000, "sub", 0 )
884   ROM_LOAD( "7.3p",  0x0e000, 0x02000, CRC(20c55a25) SHA1(9dc88cb6c016b594264f7272d4fd5f30567e7c5d) )
885
886   ROM_REGION( 0xc000, "samples", 0 )
887   ROM_LOAD( "1s.ic7", 0x00000, 0x04000, CRC(47ad8a0f) SHA1(e3b1e13f0a5c613bd205338683bef8d005b54830) )
888   ROM_LOAD( "2s.ic6", 0x04000, 0x04000, CRC(ca2a735f) SHA1(5980525a67fb0ffbfa04b82d805eee2463236ce3) )
889   ROM_LOAD( "3s.ic5", 0x08000, 0x04000, CRC(5cf15267) SHA1(72e4b2aa59a50af6b1b25d5279b3b125bfe06d86) )
890
891   ROM_REGION( 0x20000, "gfx1", 0 )
892   ROM_LOAD( "1.3a",  0x00000, 0x04000, CRC(9626f812) SHA1(ca7162811a0ba05dfaa2aa8cc93a2e898b326e9e) )
893   ROM_LOAD( "2.3c",  0x04000, 0x04000, CRC(0d59cf7a) SHA1(600bc70d29853fb936f8adaef048d925cbae0ce9) )
894   ROM_LOAD( "3.3d",  0x08000, 0x04000, CRC(2fb2ec0b) SHA1(2f1735e33906783b8c0b283455a2a079431e6f11) )
895   ROM_LOAD( "4.3f",  0x0c000, 0x04000, CRC(c7b85199) SHA1(1c4ed2faf82f45d8a23c168793b02969f1201df6) )
896   ROM_LOAD( "5.3h",  0x10000, 0x04000, CRC(feaca6a3) SHA1(6658c01ac5769e8317a1c7eec6802e7c96885710) )
897   ROM_LOAD( "6.3l",  0x14000, 0x04000, CRC(de9e05f8) SHA1(724468eade222b513b7f39f0a24515f343428130) )
898
899   ROM_REGION( 0x20, "proms", 0 )
900   ROM_LOAD( "ng2.6u", 0x00, 0x20, CRC(0162a24a) SHA1(f7e1623c5bca3725f2e59ae2096b9bc42e0363bf) )
901ROM_END
902
903
904/* Type 1 HW*/
905GAME( 1984, nightgal, 0,       nightgal, sexygal,  0, ROT0,"Nichibutsu", "Night Gal (Japan 840920 AG 1-00)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
906GAME( 1984, ngtbunny, 0,       nightgal, sexygal,  0, ROT0,"Nichibutsu", "Night Bunny (Japan 840601 MRN 2-10)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
907GAME( 1984, royalngt, ngtbunny,nightgal, sexygal,  0, ROT0,"Royal Denshi", "Royal Night (Japan 840220 RN 2-00)", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
908/* Type 2 HW*/
909GAME( 1985, sexygal,  0,       sexygal,  sexygal,  0, ROT0,"Nichibutsu", "Sexy Gal", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
910GAME( 1985, sweetgal, sexygal, sexygal,  sexygal,  0, ROT0,"Nichibutsu", "Sweet Gal", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
911GAME( 1985, ngalsumr, 0,       sexygal,  sexygal,  0, ROT0,"Nichibutsu", "Night Gal Summer", GAME_NOT_WORKING|GAME_UNEMULATED_PROTECTION )
src/mame/drivers/usgames.c
r4057r4058
225225GFXDECODE_END
226226
227227
228static const mc6845_interface mc6845_intf =
229{
230   "main",      /* screen we are acting on */
231   8,         /* number of pixels per video memory address */
232   NULL,      /* before pixel update callback */
233   NULL,      /* row update callback */
234   NULL,      /* after pixel update callback */
235   NULL,      /* callback for display state changes */
236   NULL,      /* HSYNC callback */
237   NULL      /* VSYNC callback */
238};
228239
240
229241static MACHINE_DRIVER_START( usg32 )
230242
231243   /* basic machine hardware */
r4057r4058
250262   MDRV_VIDEO_START(usgames)
251263   MDRV_VIDEO_UPDATE(usgames)
252264
253   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
265   MDRV_MC6845_ADD("crtc", MC6845, XTAL_18MHz / 16, mc6845_intf)
254266
255267   /* sound hardware */
256268   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/suna16.c
r4057r4058
410410
411411static WRITE8_HANDLER( uballoon_pcm_1_bankswitch_w )
412412{
413   UINT8 *RAM = memory_region(space->machine, "pcm");
413   UINT8 *RAM = memory_region(space->machine, "pcm1");
414414   int bank = data & 1;
415415   if (bank & ~1)   logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(space->cpu), data);
416416   memory_set_bankptr(space->machine, 1, &RAM[bank * 0x10000 + 0x400]);
r4057r4058
907907   MDRV_CPU_ADD("audio", Z80, 3579545)   /* ? */
908908   MDRV_CPU_PROGRAM_MAP(uballoon_sound_readmem,uballoon_sound_writemem)
909909
910   MDRV_CPU_ADD("pcm", Z80, 5000000)   /* ? */
910   MDRV_CPU_ADD("pcm1", Z80, 5000000)   /* ? */
911911   MDRV_CPU_PROGRAM_MAP(uballoon_pcm_1_readmem,uballoon_pcm_1_writemem)
912912   MDRV_CPU_IO_MAP(uballoon_pcm_1_io_map,0)
913913
r4057r4058
958958   MDRV_CPU_ADD("audio", Z80, 14318000/4)
959959   MDRV_CPU_PROGRAM_MAP(sunaq_sound_readmem,sunaq_sound_writemem)
960960
961   MDRV_CPU_ADD("pcm", Z80, 24000000/4)      /* Z80B */
961   MDRV_CPU_ADD("pcm1", Z80, 24000000/4)      /* Z80B */
962962   MDRV_CPU_PROGRAM_MAP(bssoccer_pcm_1_readmem,bssoccer_pcm_1_writemem)
963963   MDRV_CPU_IO_MAP(bssoccer_pcm_1_io_map,0)
964964
r4057r4058
10301030   MDRV_CPU_ADD("audio", Z80, 24000000/4)
10311031   MDRV_CPU_PROGRAM_MAP(bestbest_sound_map,0)
10321032
1033   MDRV_CPU_ADD("pcm", Z80, 24000000/4)
1033   MDRV_CPU_ADD("pcm1", Z80, 24000000/4)
10341034   MDRV_CPU_PROGRAM_MAP(bestbest_pcm_1_map,0)
10351035   MDRV_CPU_IO_MAP(bestbest_pcm_1_iomap,0)
10361036
r4057r4058
11651165   ROM_REGION( 0x010000, "audio", 0 )    /* Z80 #1 - Music */
11661166   ROM_LOAD( "audio1.rom", 0x000000, 0x010000, CRC(c771f2b4) SHA1(6da4c526c0ea3be5d5bb055a31bf1171a6ddb51d) )
11671167
1168   ROM_REGION( 0x020000, "pcm", 0 )    /* Z80 #2 - PCM */
1168   ROM_REGION( 0x020000, "pcm1", 0 )    /* Z80 #2 - PCM */
11691169   ROM_LOAD( "audio2.rom", 0x000000, 0x020000, CRC(c7f75347) SHA1(5bbbd39285c593441c6da6a12f3632d60b103216) )
11701170
11711171   /* There's no Z80 #3 - PCM */
r4057r4058
12181218   ROM_REGION( 0x010000, "audio", 0 )    /* Z80 #1 - Music */
12191219   ROM_LOAD( "audio1.bin", 0x000000, 0x010000, CRC(3df42f82) SHA1(91c1037c9d5d1ec82ed4cdfb35de5a6d626ecb3b) )
12201220
1221   ROM_REGION( 0x080000, "pcm", 0 )    /* Z80 #2 - PCM */
1221   ROM_REGION( 0x080000, "pcm1", 0 )    /* Z80 #2 - PCM */
12221222   ROM_LOAD( "audio2.bin", 0x000000, 0x080000, CRC(cac85ba9) SHA1(e5fbe813022c17d9eaf2a57184341666e2af365a) )
12231223
12241224   /* There's no Z80 #3 - PCM */
r4057r4058
12951295   ROM_REGION( 0x10000, "audio", 0 )    /* Z80 #1 - Music */
12961296   ROM_LOAD( "5.bin", 0x00000, 0x10000, CRC(bb9265e6) SHA1(424eceac4fd48c9a99653ece2f3fcbc8b37569cf) ) // BEST OF BEST V10 XILINX PROGRAM 3020 1994,1,17
12971297
1298   ROM_REGION( 0x10000, "pcm", 0 )    /* Z80 #2 - PCM */
1298   ROM_REGION( 0x10000, "pcm1", 0 )    /* Z80 #2 - PCM */
12991299   ROM_LOAD( "6.bin", 0x00000, 0x10000, CRC(dd445f6b) SHA1(658417d72c003f25db273e3c731838317ed1876c) )
13001300
13011301   /* There's no Z80 #3 - PCM */
src/mame/drivers/taitopjc.c
r0r4058
1/*
2   Taito Power-JC System
3
4   Skeleton driver. Requires TLCS-900 CPU core to make progress.
5
6   Hardware appears sufficiently different to JC system to warrant
7   a separate driver.
8
9   PCB Information (incomplete!)
10   ===============
11
12   POWER JC MOTHER-G PCB
13   K11X0870A
14   OPERATION TIGER
15
16   PowerPC 603E
17   CXD1176Q
18
19   TMS320C53PQ80
20   40MHz osc
21   43256 x 2
22   E63-03_H.29 (AT27C512 PLCC)
23   E63-04_L.28 (AT27C512 PLCC)
24
25   E63-01 PALCE16V8H
26   E63-02 PALCE22V10H
27
28   IC41 E63-06 PALCE16V8H
29   IC43 E63-07 PALCE16V8H
30
31   uPD4218160 x 2
32   uPD4218160 x 2
33
34   uPD482445 x 4
35
36   CY78991
37   IS61LV256AH x 3
38   Taito TC0780FPA x 2
39   Taito TCG010PJC
40
41   MN1020819
42   ZOOM ZSG-2
43   ZOOM ZFX-2
44   MSM514256
45
46
47   Second PCB
48   ----------
49
50   19 ROMs
51
52   TMP95C063F
53   25.0000MHz osc
54   1.84320MHz osc
55*/
56
57#include "driver.h"
58#include "cpu/powerpc/ppc.h"
59
60
61static VIDEO_START( taitopjc )
62{
63
64}
65
66static VIDEO_UPDATE( taitopjc )
67{
68   return 0;
69}
70
71static ADDRESS_MAP_START( ppc603e_mem, ADDRESS_SPACE_PROGRAM, 64)
72   AM_RANGE(0x00000000, 0x003fffff) AM_RAM // Work RAM
73   AM_RANGE(0x40000000, 0x40000007) AM_RAM // Screen RAM (+ others?) data port
74   AM_RANGE(0x40000008, 0x4000000f) AM_RAM // Screen RAM (+ others?) address port
75   AM_RANGE(0xc0000ff8, 0xc0000fff) AM_RAM
76   AM_RANGE(0xffe00000, 0xffffffff) AM_ROM AM_REGION("user1", 0)
77ADDRESS_MAP_END
78
79
80static INPUT_PORTS_START( taitopjc )
81INPUT_PORTS_END
82
83
84static const powerpc_config ppc603e_config =
85{
86   XTAL_66_6667MHz      /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
87};
88
89static MACHINE_DRIVER_START( taitopjc )
90   MDRV_CPU_ADD("main", PPC603E, 100000000)
91   MDRV_CPU_CONFIG(ppc603e_config)
92   MDRV_CPU_PROGRAM_MAP(ppc603e_mem, 0)
93
94   /* TMP95C063F I/O CPU */
95   /* TMS320C53 DSP */
96   /* MN1020819DA sound CPU - NOTE: May have 64kB internal ROM */
97
98   MDRV_SCREEN_ADD("main", RASTER)
99   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
100   MDRV_SCREEN_REFRESH_RATE(60)
101   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
102   MDRV_SCREEN_SIZE(512, 384)
103   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 383)
104
105   MDRV_VIDEO_START(taitopjc)
106   MDRV_VIDEO_UPDATE(taitopjc)
107MACHINE_DRIVER_END
108
109
110ROM_START( optiger )
111   ROM_REGION64_BE( 0x200000, "user1", 0 )
112   ROM_LOAD32_BYTE( "e63-33-1_p-hh.23", 0x000000, 0x080000, CRC(5ab176e2) SHA1(a0a5b7c0e91928d0a49987f88f6ae647f5cb3e34) )
113   ROM_LOAD32_BYTE( "e63-32-1_p-hl.22", 0x000001, 0x080000, CRC(cca8bacc) SHA1(e5a081f5c12a52601745f5b67fe3412033581b00) )
114   ROM_LOAD32_BYTE( "e63-31-1_p-lh.8",  0x000002, 0x080000, CRC(ad69e649) SHA1(9fc853d2cb6e7cac87dc06bad91048f191b799c5) )
115   ROM_LOAD32_BYTE( "e63-30-1_p-ll.7",  0x000003, 0x080000, CRC(a6183479) SHA1(e556c3edf100342079e680ec666f018fca7a82b0) )
116
117   ROM_REGION64_BE( 0x20000, "user2", 0 )
118   /* More PowerPC code? */
119   ROM_LOAD16_BYTE( "e63-04_l.29",  0x000001, 0x010000, CRC(eccae391) SHA1(e5293c16342cace54dc4b6dfb827558e18ac25a4) )
120   ROM_LOAD16_BYTE( "e63-03_h.28",  0x000000, 0x010000, CRC(58fce52f) SHA1(1e3d9ee034b25e658ca45a8b900de2aa54b00135) )
121
122   ROM_REGION( 0x40000, "io_cpu", 0 )
123   ROM_LOAD16_BYTE( "e63-28-1_0.59", 0x000000, 0x020000, CRC(ef41ffaf) SHA1(419621f354f548180d37961b861304c469e43a65) )
124   ROM_LOAD16_BYTE( "e63-27-1_1.58", 0x000001, 0x020000, CRC(facc17a7) SHA1(40d69840cfcfe5a509d69824c2994de56a3c6ece) )
125
126   ROM_REGION( 0x80000, "unk1", 0 )
127   ROM_LOAD16_BYTE( "e63-17-1_s-l.18", 0x000000, 0x040000, CRC(2a063d5b) SHA1(a2b2fe4d8bad1aef7d9dcc0be607cc4e5bc4f0eb) )
128   ROM_LOAD16_BYTE( "e63-18-1_s-h.19", 0x000001, 0x040000, CRC(2f590881) SHA1(7fb827a676f45b24380558b0068b76cb858314f6) )
129
130   ROM_REGION( 0x1000000, "gfx1", 0 )
131   ROM_LOAD32_WORD_SWAP( "e63-21_c-h.24", 0x000000, 0x400000, CRC(c818b211) SHA1(dce07bfe71a9ba11c3f028a640226c6e59c6aece) )
132   ROM_LOAD32_WORD_SWAP( "e63-15_c-l.9",  0x000002, 0x400000, CRC(4ec6a2d7) SHA1(2ee6270cff7ea2459121961a29d42e000cee2921) )
133   ROM_LOAD32_WORD_SWAP( "e63-22_m-h.25", 0x800000, 0x400000, CRC(6d895eb6) SHA1(473795da42fd29841a926f18a93e5992f4feb27c) )
134   ROM_LOAD32_WORD_SWAP( "e63-16_m-l.10", 0x800002, 0x400000, CRC(d39c1e34) SHA1(6db0ce2251841db3518a9bd9c4520c3c666d19a0) )
135
136   ROM_REGION( 0xc00000, "poly", 0 )
137   ROM_LOAD( "e63-09_poly0.3", 0x000000, 0x400000, CRC(c3e2b1e0) SHA1(ee71f3f59b46e26dbe2ff724da2c509267c8bf2f) )
138   ROM_LOAD( "e63-10_poly1.4", 0x400000, 0x400000, CRC(f4a56390) SHA1(fc3c51a7f4639479e66ad50dcc94255d94803c97) )
139   ROM_LOAD( "e63-11_poly2.5", 0x800000, 0x400000, CRC(2293d9f8) SHA1(16adaa0523168ee63a7a34b29622c623558fdd82) )
140// Poly 3 is not populated
141
142   ROM_REGION( 0x800000, "sound_data", 0 )
143   ROM_LOAD( "e63-23_wd0.36", 0x000000, 0x200000, CRC(d69e196e) SHA1(f738bb9e1330f6dabb5e0f0378a1a8eb48a4fa40) )
144   ROM_LOAD( "e63-24_wd1.37", 0x200000, 0x200000, CRC(cd55f17b) SHA1(08f847ef2fd592dbaf63ef9e370cdf1f42012f74) )
145   ROM_LOAD( "e63-25_wd2.38", 0x400000, 0x200000, CRC(bd35bdac) SHA1(5cde6c1a6b74659507b31fcb88257e65f230bfe2) )
146   ROM_LOAD( "e63-26_wd3.39", 0x600000, 0x200000, CRC(346bd413) SHA1(0f6081d22db88eef08180278e7ae97283b5e8452) )
147
148   ROM_REGION( 0x500, "plds", ROMREGION_DISPOSE )
149   // TODO: There are 6 PALs in total on the main PCB.
150ROM_END
151
152GAME( 1998, optiger, 0, taitopjc, taitopjc, 0, ROT0, "Taito", "Operation Tiger", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/shadfrce.c
r4057r4058
287287      if (scanline == raster_scanline)
288288      {
289289         raster_scanline = (raster_scanline + 1) % 240;
290         video_screen_update_partial(timer->machine->primary_screen, raster_scanline - 1);
290         if (raster_scanline > 0)
291            video_screen_update_partial(timer->machine->primary_screen, raster_scanline - 1);
291292         cpu_set_input_line(timer->machine->cpu[0], 1, ASSERT_LINE);
292293      }
293294   }
r4057r4058
297298   {
298299      if (scanline % 16 == 0)
299300      {
300         video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
301         if (scanline > 0)
302            video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
301303         cpu_set_input_line(timer->machine->cpu[0], 2, ASSERT_LINE);
302304      }
303305   }
r4057r4058
311313         cpu_set_input_line(timer->machine->cpu[0], 3, ASSERT_LINE);
312314      }
313315   }
314
315   /* Adjust for next scanline */
316   if (++scanline >= video_screen_get_height(timer->machine->primary_screen))
317   {
318      scanline = 0;
319   }
320316}
321317
322318
src/mame/drivers/jongkyo.c
r4057r4058
6161   //      data3 = videoram2[x/4 + y*64]; // wrong
6262
6363   // good mahjong tiles
64   //      data3 = 0x0f; // we're missing 2 bits.. there must be another piece of video ram somewhere or we can't use all the colours (6bpp).. banked somehow?
64         data3 = 0x0f; // we're missing 2 bits.. there must be another piece of video ram somewhere or we can't use all the colours (6bpp).. banked somehow?
6565   // good girl tiles
66         data3 = 0x00; // we're missing 2 bits.. there must be another piece of video ram somewhere or we can't use all the colours (6bpp).. banked somehow?
66   //  data3 = 0x00; // we're missing 2 bits.. there must be another piece of video ram somewhere or we can't use all the colours (6bpp).. banked somehow?
6767
6868
6969
r4057r4058
102102   memory_set_bank(space->machine, 1, rom_bank);
103103}
104104
105static UINT8 keyboard_select;
105static UINT8 mux_data;
106106
107static READ8_HANDLER( keyboard1_r )
107static WRITE8_HANDLER( mux_w )
108108{
109   switch (keyboard_select)
110   {
109   mux_data = ~data;
110//  printf("%02x\n",mux_data);
111}
111112
112      case 0xef:
113         return  input_port_read(space->machine, "0");
113static WRITE8_HANDLER( jongkyo_coin_counter_w )
114{
115   /* bit 1 = coin counter */
116   coin_counter_w(0,data & 2);
114117
115      case 0xf7:
116         return  input_port_read(space->machine, "1");
118   /* bit 2 always set? */
119}
117120
118      case 0xfb:
119         return  input_port_read(space->machine, "2");
121static READ8_HANDLER( input_1p_r )
122{
123   static UINT8 cr_clear;
120124
121      case 0xfd:
122         return  input_port_read(space->machine, "3");
125   cr_clear = input_port_read(space->machine, "CR_CLEAR");
123126
124      case 0xfe:
125         return  input_port_read(space->machine, "4");
126
127      default:
128         printf("keyboard1_r, select %02x\n",keyboard_select);
129         /* fall through */
127   switch(mux_data)
128   {
129      case 0x01: return input_port_read(space->machine, "PL1_1") | cr_clear;
130      case 0x02: return input_port_read(space->machine, "PL1_2") | cr_clear;
131      case 0x04: return input_port_read(space->machine, "PL1_3") | cr_clear;
132      case 0x08: return input_port_read(space->machine, "PL1_4") | cr_clear;
133      case 0x10: return input_port_read(space->machine, "PL1_5") | cr_clear;
134      case 0x20: return input_port_read(space->machine, "PL1_6") | cr_clear;
130135   }
136//  printf("%04x\n",mux_data);
131137
132   return 0xff;
138   return (input_port_read(space->machine, "PL1_1") & input_port_read(space->machine, "PL1_2") & input_port_read(space->machine, "PL1_3") &
139          input_port_read(space->machine, "PL1_4") & input_port_read(space->machine, "PL1_5") & input_port_read(space->machine, "PL1_6")) | cr_clear;//input_port_read(space->machine, "PL1_0") && ;
133140}
134141
135
136static READ8_HANDLER( keyboard2_r )
142static READ8_HANDLER( input_2p_r )
137143{
138   switch (keyboard_select)
139   {
140      case 0xef:
141         return  input_port_read(space->machine, "5");
144   static UINT8 coin_port;
142145
143      case 0xf7:
144         return  input_port_read(space->machine, "6");
146   coin_port = input_port_read(space->machine, "COINS");
145147
146      case 0xfb:
147         return  input_port_read(space->machine, "7");
148
149      case 0xfd:
150         return  input_port_read(space->machine, "8");
151
152      case 0xfe:
153         return  input_port_read(space->machine, "9");
154
155      default:
156         printf("keyboard2_r, select %02x\n",keyboard_select);
157         /* fall through */
148   switch(mux_data)
149   {
150      case 0x01: return input_port_read(space->machine, "PL2_1") | coin_port;
151      case 0x02: return input_port_read(space->machine, "PL2_2") | coin_port;
152      case 0x04: return input_port_read(space->machine, "PL2_3") | coin_port;
153      case 0x08: return input_port_read(space->machine, "PL2_4") | coin_port;
154      case 0x10: return input_port_read(space->machine, "PL2_5") | coin_port;
155      case 0x20: return input_port_read(space->machine, "PL2_6") | coin_port;
158156   }
157//  printf("%04x\n",mux_data);
159158
160   return 0xff;
161}
159   return (input_port_read(space->machine, "PL2_1") & input_port_read(space->machine, "PL2_2") & input_port_read(space->machine, "PL2_3") &
160          input_port_read(space->machine, "PL2_4") & input_port_read(space->machine, "PL2_5") & input_port_read(space->machine, "PL2_6")) | coin_port;//input_port_read(space->machine, "PL1_0") && ;
162161
163
164static WRITE8_HANDLER( keyboard_select_w )
165{
166   keyboard_select = data;
167162}
168
169163static WRITE8_HANDLER( videoram2_w )
170164{
171165   videoram2[offset] = data;
172166}
173167
168static WRITE8_HANDLER( unknown_w )
169{
170   switch (offset)
171   {
172      case 0: // different values
173         break;
174      case 1: // set to 0 at the boot and set to 1 continuesly
175         break;
176      case 2: // only set to 0 at the boot
177         break;
178      case 3: // not used
179         break;
180      case 4: // set to 1 before the girl drawing (probably is the palette selector, not sure how to restore the old palette)
181         break;
182      case 5: // only set to 0 at the boot
183         break;
184      case 6: // different values
185         break;
186      case 7: // 07 and 08 are like a counter: every write in 08 is a incremented value (from 00 to ff)
187         break;
188      case 8: // when this value is 0xff the next value is 00 and port 07 is incremented (from 00 to ff)
189         break;
190      case 9: // different values
191         break;
192   }
193}
194
174195static ADDRESS_MAP_START( jongkyo_memmap, ADDRESS_SPACE_PROGRAM, 8 )
175196   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM) AM_WRITE(videoram2_w) // wrong, this doesn't seem to be video ram on write..
176197   AM_RANGE(0x4000, 0x6bff) AM_READ(SMH_ROM) // fixed rom
r4057r4058
187208   AM_RANGE(0x02, 0x02) AM_WRITE(ay8910_write_port_0_w)
188209   AM_RANGE(0x03, 0x03) AM_WRITE(ay8910_control_port_0_w)
189210
190   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW")
191   AM_RANGE(0x11, 0x11) AM_READ_PORT("IN0") AM_WRITE(keyboard_select_w)
211   AM_RANGE(0x10, 0x10) AM_READ_PORT("DSW") AM_WRITE(jongkyo_coin_counter_w)
212   AM_RANGE(0x11, 0x11) AM_READ_PORT("IN0") AM_WRITE(mux_w)
192213   // W 11 select keyboard row (fe fd fb f7)
193214   AM_RANGE(0x40, 0x45) AM_WRITE(bank_select_w)
215   AM_RANGE(0x46, 0x4f) AM_WRITE(unknown_w)
194216ADDRESS_MAP_END
195217
196218/*
r4057r4058
231253
232254
233255static INPUT_PORTS_START( jongkyo )
234   PORT_START("0")
235    PORT_DIPNAME( 0x01, 0x01, "0" )
236    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
237    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
238    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
239    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
240    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
241    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
242    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
243    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
244    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
245    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
246    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
247    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
248    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
249    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
250    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
251    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
252    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
253    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
254    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
255    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
257    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
258    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
256   PORT_START("CR_CLEAR")
257   PORT_DIPNAME( 0x40, 0x40, "Credit Clear-1" )//button
258   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
259   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
260   PORT_DIPNAME( 0x80, 0x80, "Credit Clear-2" )//button
261   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
262   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
259263
260   PORT_START("1")
261    PORT_DIPNAME( 0x01, 0x01, "1" )
262    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
263    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
265    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
266    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
267    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
268    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
269    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
270    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
271    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
272    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
273    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
274    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
275    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
276    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
277    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
278    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
279    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
280    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
281    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
282    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
283    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
284    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264   PORT_START("COINS")
265   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) //player-1 side
266   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) //player-2 side
285267
286   PORT_START("2")
287    PORT_DIPNAME( 0x01, 0x01, "2" )
288    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
289    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
290    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
291    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
292    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
293    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
294    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
295    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
296    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
297    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
298    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
299    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
300    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
301    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
302    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
303    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
304    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
305    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
306    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
307    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
308    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
309    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
310    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
268   PORT_START("PL1_1")
269   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
270   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
271   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
272   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
273   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
274   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
275   PORT_START("PL1_2")
276   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
277   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
278   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
279   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
280   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
281   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CODE(KEYCODE_3)//rate button
282   PORT_START("PL1_3")
283   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
284   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
285   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
286   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
287   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
288   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //another D button
289   PORT_START("PL1_4")
290   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
291   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
292   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
293   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
294   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) //another opt 1 button
295   PORT_START("PL1_5")
296   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE )
297   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 1")
298   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 2")
299   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
300   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 3")
301   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Option 4")
302   PORT_START("PL1_6")
303   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
304   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1P Pass") //???
305   PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
311306
312   PORT_START("3")
313    PORT_DIPNAME( 0x01, 0x01, "3" )
314    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
315    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
316    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
317    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
318    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
319    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
320    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
321    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
322    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
323    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
324    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
325    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
326    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
327    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
328    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
329    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
330    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
331    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
332    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
333    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
334    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
335    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
336    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
307   PORT_START("PL2_1")
308   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
309   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
310   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
311   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
312   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
313   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
314   PORT_START("PL2_2")
315   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
316   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
317   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
318   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
319   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
320   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_CODE(KEYCODE_4) PORT_PLAYER(2)//rate button
321   PORT_START("PL2_3")
322   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
323   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
324   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
325   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
326   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
327   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //another D button
328   PORT_START("PL2_4")
329   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
330   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
331   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
332   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
333   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED ) //another opt 1 button
334   PORT_START("PL2_5")
335   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2)
336   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 1") PORT_PLAYER(2)
337   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 2") PORT_PLAYER(2)
338   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
339   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 3") PORT_PLAYER(2)
340   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Option 4") PORT_PLAYER(2)
341   PORT_START("PL2_6")
342   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
343   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2P Pass") PORT_PLAYER(2) //???
344   PORT_BIT( 0x3c, IP_ACTIVE_LOW, IPT_UNUSED )
337345
338   PORT_START("4")
339    PORT_DIPNAME( 0x01, 0x01, "4" )
340    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
341    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
342    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
343    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
344    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
345    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
346    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
347    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
348    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
349    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
350    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
351    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
352    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
353    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
354    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
355    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
356    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
357    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
358    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
359    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
360    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
361    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
362    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
363
364   PORT_START("5")
365    PORT_DIPNAME( 0x01, 0x01, "5" )
366    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
367    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
368    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
369    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
370    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
371    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
372    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
373    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
374    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
375    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
376    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
377    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
378    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
379    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
380    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
381    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
382    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
383    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
384    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
385    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
386    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
387    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
388    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
389
390   PORT_START("6")
391    PORT_DIPNAME( 0x01, 0x01, "6" )
392    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
393    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
394    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
395    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
396    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
397    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
398    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
399    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
400    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
401    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
402    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
403    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
404    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
405    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
406    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
407    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
408    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
409    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
410    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
411    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
412    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
413    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
414    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
415
416   PORT_START("7")
417    PORT_DIPNAME( 0x01, 0x01, "7" )
418    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
419    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
420    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
421    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
422    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
423    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
424    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
425    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
426    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
427    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
428    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
429    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
430    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
431    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
432    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
433    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
434    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
435    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
436    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
437    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
438    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
439    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
440    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
441
442   PORT_START("8")
443    PORT_DIPNAME( 0x01, 0x01, "8" )
444    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
445    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
446    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
447    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
448    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
449    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
450    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
451    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
452    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
453    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
454    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
455    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
456    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
457    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
458    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
459    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
460    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
461    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
462    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
463    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
464    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
465    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
466    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
467
468   PORT_START("9")
469    PORT_DIPNAME( 0x01, 0x01, "9")
470    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
471    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
472    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
473    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
474    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
475    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
476    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
477    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
478    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
479    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
480    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
481    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
482    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
483    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
484    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
485    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
486    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
487    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
488    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
489    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
490    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
491    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
492    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
493
494   PORT_START("10")
495    PORT_DIPNAME( 0x01, 0x01, "10" )
496    PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
497    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
498    PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
499    PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
500    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
501    PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
502    PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
503    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
504    PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
505    PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
506    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
507    PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
508    PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
509    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
510    PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
511    PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
512    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
513    PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
514    PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
515    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
516    PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
517    PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
518    PORT_DIPSETTING(    0x00, DEF_STR( On ) )
519
520346   PORT_START("IN0")
521347   PORT_DIPNAME( 0x01, 0x00, "Note" )
522348   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
r4057r4058
584410{
585411   AY8910_LEGACY_OUTPUT,
586412   AY8910_DEFAULT_LOADS,
587   keyboard1_r,
588   keyboard2_r,
413   input_1p_r,
414   input_2p_r,
589415   NULL,
590416   NULL
591417};
src/mame/drivers/nbmj8891.c
r4057r4058
2424
2525- Controls in gionbana: 1~8 is assigned to A~H, "Yes" is LShift, "No" is Z.
2626
27- Controls in maiko and hanaoji: 1~8 is assigned to A~H, "Yes" is M, "No" is N.
27- Controls in maiko,hanaoji,hnxmasev and hnageman: 1~8 is assigned to A~H, "Yes" is M, "No" is N.
2828
2929- Real machine has ROMs for protection, but I don't know how to access the ROM,
3030  so I'm doing something that works but is probably wrong.
r4057r4058
4141
4242- taiwanmb needs MCU emulation (color lookup table data output etc.)
4343
44- Missing VCR tape / emulation for hnxmasev,hnageman
45
4446******************************************************************************/
4547
4648#include "driver.h"
r4057r4058
431433   AM_RANGE(0xf800, 0xffff) AM_WRITE(SMH_RAM)
432434ADDRESS_MAP_END
433435
436static ADDRESS_MAP_START( hnxmasev_mem, ADDRESS_SPACE_PROGRAM, 8 )
437   AM_RANGE(0x0000, 0xefff) AM_ROM
438   AM_RANGE(0xf200, 0xf3ff) AM_READWRITE(nbmj8891_palette_type2_r,nbmj8891_palette_type2_w)
439   AM_RANGE(0xf700, 0xf70f) AM_READWRITE(nbmj8891_clut_r,nbmj8891_clut_w)
440   AM_RANGE(0xf800, 0xffff) AM_RAM
441ADDRESS_MAP_END
442
443static ADDRESS_MAP_START( hnageman_mem, ADDRESS_SPACE_PROGRAM, 8 )
444   AM_RANGE(0x0000, 0xefff) AM_ROM
445   AM_RANGE(0xf400, 0xf5ff) AM_READWRITE(nbmj8891_palette_type2_r,nbmj8891_palette_type2_w)
446   AM_RANGE(0xf000, 0xf00f) AM_READWRITE(nbmj8891_clut_r,nbmj8891_clut_w)
447   AM_RANGE(0xf800, 0xffff) AM_RAM
448ADDRESS_MAP_END
449
434450static ADDRESS_MAP_START( writemem_mmaiko, ADDRESS_SPACE_PROGRAM, 8 )
435451   AM_RANGE(0x0000, 0xefff) AM_WRITE(SMH_ROM)
436452   AM_RANGE(0xf000, 0xf1ff) AM_WRITE(nbmj8891_palette_type2_w)
r4057r4058
29122928   MDRV_NVRAM_HANDLER(nb1413m3)
29132929MACHINE_DRIVER_END
29142930
2931static MACHINE_DRIVER_START( hnxmasev )
29152932
2933   /* basic machine hardware */
2934   MDRV_IMPORT_FROM(maiko)
2935   MDRV_CPU_MODIFY("main")
2936   MDRV_CPU_PROGRAM_MAP(hnxmasev_mem, 0)
2937   MDRV_CPU_IO_MAP(readport_maiko, writeport_maiko)
2938MACHINE_DRIVER_END
2939
2940static MACHINE_DRIVER_START( hnageman )
2941
2942   /* basic machine hardware */
2943   MDRV_IMPORT_FROM(maiko)
2944   MDRV_CPU_MODIFY("main")
2945   MDRV_CPU_PROGRAM_MAP(hnageman_mem, 0)
2946   MDRV_CPU_IO_MAP(readport_maiko, writeport_maiko)
2947MACHINE_DRIVER_END
2948
29162949static MACHINE_DRIVER_START( scandal )
29172950
29182951   /* basic machine hardware */
r4057r4058
38483881   ROM_LOAD( "clut_ram.8f", 0x000000, 0x00800, CRC(bd80fa09) SHA1(896421e1e01beef0de6acebbbc255224e4e0438b) )
38493882ROM_END
38503883
3884/*
3885AV Hanafuda Hana no Christmas Eve
3886(c)1990 Nichibutsu
38513887
3888The PCB accepts composite video and monaural audio input from VCR.
3889Then converts the signal to RGB (uses NEC uPC1352C).
3890
3891CPU: Z80B
3892Sound: YM3812 Y3014B
3893OSC: 3.579545MHz, 20.00000MHz
3894Custom: 1413M3
3895
3896ROMs:
3897A.4C
3898B.4F
3899C.10A
3900D.10C
3901E.10D
3902F.10E
3903G.10F
3904H.10J
3905I.10K
3906J.10L
3907K.10M
3908
3909
3910dumped by sayu
3911--- Team Japump!!! ---
3912http://japump.i.am/
3913
3914*/
3915
3916ROM_START( hnxmasev )
3917   ROM_REGION( 0x10000, "main", 0 ) /* program */
3918   ROM_LOAD( "b.3f",   0x00000, 0x10000, CRC(45e34624) SHA1(db7f880a8b2f36d5bed939bd0b2694f27e29141b) )
3919
3920   ROM_REGION( 0x20000, "voice", 0 ) /* voice */
3921   ROM_LOAD( "a.3c",     0x00000, 0x20000, CRC(713b3f8f) SHA1(460e9dcfc4a31f8e6d3f40ba77d6639257d9762f) ) //same as maiko
3922
3923   ROM_REGION( 0x80000, "gfx1", 0 ) /* gfx */
3924   ROM_LOAD( "c.10a", 0x000000, 0x10000, CRC(e46a1baa) SHA1(95ccf45a3c542391b67bd7993b5f7828ab525ebc) )
3925   ROM_LOAD( "d.10c", 0x010000, 0x10000, CRC(0777dad4) SHA1(7c502d78f778402614a5850bc9066322dda3f73d) )
3926   ROM_LOAD( "e.10d", 0x020000, 0x10000, CRC(eedd6244) SHA1(b636dacc4b2064c50ecaffef082735159031d333) )
3927   ROM_LOAD( "f.10e", 0x030000, 0x10000, CRC(9a8f2cf0) SHA1(31b504785c8e0747bc61a06d1684d96dbd84c261) )
3928   ROM_LOAD( "g.10h", 0x040000, 0x10000, CRC(a78fe88a) SHA1(d5e8a02d2266bd0e61ee662c5d3fe9ea4f3ebfb3) )
3929   ROM_LOAD( "h.10j", 0x050000, 0x10000, CRC(4810eb2e) SHA1(89b91b444f41127559e21f794eda4922b56b50bd) )
3930   ROM_LOAD( "i.10k", 0x060000, 0x10000, CRC(cf0c26cf) SHA1(5f64779abc578388e712abb381e2bbdbf4f78e0c) )
3931   ROM_LOAD( "j.10l", 0x070000, 0x10000, CRC(b0fb3334) SHA1(99032e00ccfbc903dc068d174f8d51211269b99c) )
3932
3933   ROM_REGION( 0x10000, "vcr", 0 ) /* vcr prg?data? */
3934   ROM_LOAD( "k.10m",   0x00000, 0x10000, CRC(e29e9ef2) SHA1(5a3ea8f771f3191fad88d237b70301634353b7bb) )
3935
3936   DISK_REGION( "vhs" ) /* Video Home System tape */
3937   DISK_IMAGE_READONLY( "hnxmasev", 0, NO_DUMP )
3938ROM_END
3939
3940/*
3941AV Hanafuda Hana no Ageman
3942(c)1990 Nichibutsu / AV Japan
3943
3944The PCB accepts composite video and monaural audio input from VCR.
3945Then converts the signal to RGB (uses NEC uPC1352C).
3946
3947CPU: Z80B
3948Sound: YM3812 Y3014B
3949OSC: 3.579545MHz, 20.00000MHz
3950Custom: 1413M3
3951
3952ROMs:
39531.4C
39542.4F
39553.10A
39564.10C
39575.10D
39586.10E
39597.10F
39608.10J
39619.10K
3962
3963
3964dumped by sayu
3965--- Team Japump!!! ---
3966http://japump.i.am/
3967
3968*/
3969
3970ROM_START( hnageman )
3971   ROM_REGION( 0x10000, "main", 0 ) /* program */
3972   ROM_LOAD( "2.3f",   0x00000, 0x10000, CRC(155ed09a) SHA1(254f199063fe525c574032ae69d4d21b0debb4c5) )
3973
3974   ROM_REGION( 0x20000, "voice", 0 ) /* voice */
3975   ROM_LOAD( "1.3c",     0x00000, 0x20000, CRC(713b3f8f) SHA1(460e9dcfc4a31f8e6d3f40ba77d6639257d9762f) ) //same as maiko
3976
3977   ROM_REGION( 0xd0000, "gfx1", 0 ) /* gfx */
3978   ROM_LOAD( "3.10a", 0x000000, 0x20000, CRC(080e0daa) SHA1(331137392c46fededdc55bd731c3a0bee88e59e3) )
3979   ROM_LOAD( "4.10c", 0x020000, 0x20000, CRC(d297ee95) SHA1(a89d438175b6f0b3af83a4706744a19c0d742904) )
3980   ROM_LOAD( "5.10d", 0x040000, 0x20000, CRC(c2eb8ced) SHA1(d58ef5f7d47da4624595058c23e949e193ced40a) )
3981   ROM_LOAD( "6.10e", 0x060000, 0x20000, CRC(36106de2) SHA1(15f2957c3e83d05b5706a0b98068a3d0d8d57ae9) )
3982   ROM_LOAD( "7.10h", 0x080000, 0x20000, CRC(0bb99a3a) SHA1(1c896f50f74a52fcf96a40ca536502908bab85c9) )
3983   ROM_LOAD( "8.10j", 0x0a0000, 0x20000, CRC(23fad43a) SHA1(7276b92623dc4559e62d2f4742c8a68233c1dfe5) )
3984   ROM_LOAD( "9.10k", 0x0c0000, 0x10000, CRC(c995c1da) SHA1(c8a1f4919296221c375763b0d9838f31ed53135d) )
3985
3986   DISK_REGION( "vhs" ) /* Video Home System tape */
3987   DISK_IMAGE_READONLY( "hnageman", 0, NO_DUMP )
3988ROM_END
3989
3990
3991
3992
38523993//     YEAR,     NAME,   PARENT,  MACHINE,    INPUT,     INIT, MONITOR,COMPANY,FULLNAME,FLAGS)
38533994GAME( 1988, msjiken,   0,        msjiken,  msjiken,  msjiken,  ROT270, "Nichibutsu", "Mahjong Satsujin Jiken (Japan 881017)", 0 )
38543995GAME( 1988, hanamomo,  0,        hanamomo, hanamomo, hanamomo, ROT0,   "Nichibutsu", "Mahjong Hana no Momoko gumi (Japan 881201)", 0 )
r4057r4058
38744015GAME( 1990, chinmoku,  0,        mjnanpas, chinmoku, chinmoku, ROT0,   "Nichibutsu", "Mahjong Chinmoku no Hentai (Japan 900511)", 0 )
38754016GAME( 1990, maiko,     0,        maiko,    maiko,    maiko,    ROT0,   "Nichibutsu", "Maikobana (Japan 900802)", 0 )
38764017GAME( 1990, mmaiko,    0,        mmaiko,   mmaiko,   mmaiko,   ROT0,   "Nichibutsu", "Maikobana [BET] (Japan 900911)", 0 )
4018GAME( 1990, hnxmasev,  0,       hnxmasev, maiko,    maiko,    ROT180, "Nichibutsu / AV Japan", "AV Hanafuda Hana no Christmas Eve (Japan 901204)", GAME_NOT_WORKING )
4019GAME( 1990, hnageman,  0,       hnageman, maiko,    maiko,    ROT180, "Nichibutsu / AV Japan", "AV Hanafuda Hana no Ageman (Japan 900716)", GAME_NOT_WORKING )
38774020GAME( 1990, club90s,   0,        mjnanpas, club90s,  club90s,  ROT0,   "Nichibutsu", "Mahjong CLUB 90's (set 1) (Japan 900919)", 0 )
38784021GAME( 1990, club90sa,  club90s,  mjnanpas, club90s,  club90s,  ROT0,   "Nichibutsu", "Mahjong CLUB 90's (set 2) (Japan 900919)", 0 )
38794022GAME( 1990, lovehous,  club90s,  lovehous, lovehous, lovehous, ROT0,   "Nichibutsu", "Mahjong Love House [BET] (Japan 901024)", 0 )
src/mame/drivers/wc90b.c
r4057r4058
467467
468468ROM_START( wc90b2 )
469469   ROM_REGION( 0x20000, "main", 0 )
470   ROM_LOAD( "3.bin",        0x00000, 0x10000, CRC(1e6e94c9) SHA1(1731e3e3b5d17ba676a7e42638d7206212a0080d) )
471   ROM_LOAD( "a03.bin",      0x10000, 0x10000, BAD_DUMP CRC(f54ff17a) SHA1(a19850fc28a5a0da20795a5cc6b56d9c16554bce) ) /* for now roms from wc90b1 */
470   ROM_LOAD( "a02",          0x00000, 0x10000, CRC(1e6e94c9) SHA1(1731e3e3b5d17ba676a7e42638d7206212a0080d) )   /* c000-ffff is not used */
471   ROM_LOAD( "a03.bin",      0x10000, 0x10000, CRC(f54ff17a) SHA1(a19850fc28a5a0da20795a5cc6b56d9c16554bce) )   /* banked at f000-f7ff */
472472
473473   ROM_REGION( 0x20000, "sub", 0 )  /* Second CPU */
474474   ROM_LOAD( "a04.bin",      0x00000, 0x10000, CRC(3d535e2f) SHA1(f1e1878b5a8316e770c74a1e1f29a7a81a4e5dfe) )   /* c000-ffff is not used */
r4057r4058
479479   ROM_CONTINUE(             0x10000, 0x8000 ) /* banked at 8000-bfff */
480480
481481   ROM_REGION( 0x010000, "gfx1", ROMREGION_DISPOSE )
482//  ROM_LOAD( "18.bin",       0x000000, 0x04000, CRC(0c054481) SHA1(eebab099a4db5fbf13522ecd67bfa741e16e40d4) ) /* maybe bad dump: double size */
483//  ROM_LOAD( "19.bin",       0x004000, 0x04000, CRC(ebb3eb48) SHA1(9cb133e02004bc04a9d7016b8cf5f6865e3ccf26) ) /* maybe bad dump: double size */
484//  ROM_LOAD( "20.bin",       0x008000, 0x04000, CRC(c0232af8) SHA1(5bbab00403a47feae153e179c04212021036b8a7) ) /* maybe bad dump: double size */
485//  ROM_LOAD( "21.bin",       0x00c000, 0x04000, CRC(a36e17fb) SHA1(45e4df4b4a22658f6dad21853e87fae734698fbd) ) /* maybe bad dump: double size */
486   ROM_LOAD( "a06.bin",      0x000000, 0x04000, BAD_DUMP CRC(3b5387b7) SHA1(b839b4eafe8bf6f9e841e19fee1bdb64a66f3448) ) /* roms from wc90b1 */
487   ROM_LOAD( "a08.bin",      0x004000, 0x04000, BAD_DUMP CRC(c622a5a3) SHA1(468c8c24af1f6f244228b66df04cb0ea81c1875e) ) /* roms from wc90b1 */
488   ROM_LOAD( "a10.bin",      0x008000, 0x04000, BAD_DUMP CRC(0923d9f6) SHA1(4b10ee3fc17bb63cda51b2a978d066b6a140a551) ) /* roms from wc90b1 */
489   ROM_LOAD( "a20.bin",      0x00c000, 0x04000, BAD_DUMP CRC(b8dec83e) SHA1(fe617ddccdd0dbd05ca09a1507074aa14b529322) ) /* roms from wc90b1 */
482   ROM_LOAD( "a06",       0x000000, 0x04000, CRC(0c054481) SHA1(eebab099a4db5fbf13522ecd67bfa741e16e40d4) )
483   ROM_CONTINUE ( 0x000000, 0x04000)
484   ROM_LOAD( "a08",       0x004000, 0x04000, CRC(ebb3eb48) SHA1(9cb133e02004bc04a9d7016b8cf5f6865e3ccf26) )
485   ROM_CONTINUE ( 0x004000, 0x04000)
486   ROM_LOAD( "a10",       0x008000, 0x04000, CRC(c0232af8) SHA1(5bbab00403a47feae153e179c04212021036b8a7) )
487   ROM_CONTINUE ( 0x008000, 0x04000)
488   ROM_LOAD( "a20",       0x00c000, 0x04000, CRC(a36e17fb) SHA1(45e4df4b4a22658f6dad21853e87fae734698fbd) )
489   ROM_CONTINUE ( 0x00c000, 0x04000)
490490
491491   ROM_REGION( 0x080000, "gfx2", ROMREGION_DISPOSE )
492   ROM_LOAD( "a07.bin",      0x000000, 0x20000, BAD_DUMP CRC(38c31817) SHA1(cb24ed8702d62066366924c033c07ffc78bd1fad) ) /* for now roms from wc90b1 */
493   ROM_LOAD( "a09.bin",      0x020000, 0x20000, BAD_DUMP CRC(32e39e29) SHA1(44f22ed6c983541c7fea5857ba0456aaa87b36d1) ) /* for now roms from wc90b1 */
494   ROM_LOAD( "a11.bin",      0x040000, 0x20000, BAD_DUMP CRC(5ccec796) SHA1(2cc191a4267819eb31962726e2ed4567c825c39e) ) /* for now roms from wc90b1 */
495   ROM_LOAD( "a21.bin",      0x060000, 0x20000, BAD_DUMP CRC(0c54a091) SHA1(3eecb285b5a7bbc310c87492516d7ffb2841aa3b) ) /* for now roms from wc90b1 */
492   ROM_LOAD( "a07.bin",      0x000000, 0x20000, CRC(38c31817) SHA1(cb24ed8702d62066366924c033c07ffc78bd1fad) )
493   ROM_LOAD( "a09.bin",      0x020000, 0x20000, CRC(32e39e29) SHA1(44f22ed6c983541c7fea5857ba0456aaa87b36d1) )
494   ROM_LOAD( "a11.bin",      0x040000, 0x20000, CRC(5ccec796) SHA1(2cc191a4267819eb31962726e2ed4567c825c39e) )
495   ROM_LOAD( "a21.bin",      0x060000, 0x20000, CRC(0c54a091) SHA1(3eecb285b5a7bbc310c87492516d7ffb2841aa3b) )
496496
497497   ROM_REGION( 0x080000, "gfx3", ROMREGION_DISPOSE | ROMREGION_INVERT )
498498   ROM_LOAD( "146_a12.bin",  0x000000, 0x10000, CRC(d5a60096) SHA1(a8e351a4b020b4fc2b2cb7d3f0fdfb43fc44d7d9) )
499   ROM_LOAD( "12.bin",       0x010000, 0x10000, CRC(5b16fd48) SHA1(b167d6a7da0c696cde39581822fc61d20756321c) )
499   ROM_LOAD( "147_a13",      0x010000, 0x10000, CRC(5b16fd48) SHA1(b167d6a7da0c696cde39581822fc61d20756321c) )
500500   ROM_LOAD( "148_a14.bin",  0x020000, 0x10000, CRC(26371c18) SHA1(0887041d86dc9f19dad264ae27dc56fb89ac3265) )
501   ROM_LOAD( "10.bin",       0x030000, 0x10000, CRC(b2423962) SHA1(098bc06411cf3f9c7cf69933eba360fd059b5d3f) )
501   ROM_LOAD( "149_a15",      0x030000, 0x10000, CRC(b2423962) SHA1(098bc06411cf3f9c7cf69933eba360fd059b5d3f) )
502502   ROM_LOAD( "150_a16.bin",  0x040000, 0x10000, CRC(0da825f9) SHA1(cfba0c85fc767726c1d63f87468335d1c2f1eed8) )
503   ROM_LOAD( "8.bin",        0x050000, 0x10000, CRC(af98778e) SHA1(5bbce33a4cec5a234ed78e30899a4a166d71447a) )
503   ROM_LOAD( "151_a17",      0x050000, 0x10000, CRC(af98778e) SHA1(5bbce33a4cec5a234ed78e30899a4a166d71447a) )
504504   ROM_LOAD( "152_a18.bin",  0x060000, 0x10000, CRC(516b6c09) SHA1(9d02514dece864b087f67886009ce54bd51b5575) )
505   ROM_LOAD( "6.bin",        0x070000, 0x10000, CRC(8caa2745) SHA1(41efb92c98e063f5ed5fb0e68fa014f89da00cda) )
505   ROM_LOAD( "153_a19",      0x070000, 0x10000, CRC(8caa2745) SHA1(41efb92c98e063f5ed5fb0e68fa014f89da00cda) )
506506
507507   ROM_REGION( 0x1000, "plds", ROMREGION_DISPOSE )
508508   ROM_LOAD( "el_ic39_gal16v8_0.bin", 0x0000, 0x0117, NO_DUMP SHA1(894b345b395097acf6cf52ab8bc922099f97a85f) )
src/mame/drivers/liberate.c
r4057r4058
559559   MDRV_CPU_MODIFY("main")
560560   MDRV_CPU_TYPE(M6502)
561561   MDRV_CPU_PROGRAM_MAP(liberatb_readmem,liberatb_writemem)
562   MDRV_CPU_IO_MAP(0,0)
562563   MDRV_CPU_VBLANK_INT("main", deco16_interrupt)
563
564   MDRV_CPU_REMOVE("main")
565564MACHINE_DRIVER_END
566565
567566static MACHINE_DRIVER_START( boomrang )
src/mame/drivers/seta.c
r4057r4058
83638363   ROM_LOAD( "ud2011.t07", 0x000000, 0x080000, CRC(9c9ff69f) SHA1(3840b654f4f709bc4c03dfe4ee79369d5c70dd62) )
83648364ROM_END
83658365
8366ROM_START( downtowj )
8367   ROM_REGION( 0x0a0000, "main", 0 )      /* 68000 Code */
8368   ROM_LOAD16_BYTE( "ud2001.000", 0x000000, 0x040000, CRC(f1965260) SHA1(c0560342238d75f9b81ae9f3408cacfbcd331529) )
8369   ROM_LOAD16_BYTE( "ud2001.003", 0x000001, 0x040000, CRC(e7d5fa5f) SHA1(48612514598711aa73bf75243c842f0aca72f3d0) )
8370   ROM_LOAD16_BYTE( "u37.9a",     0x080000, 0x010000, CRC(73047657) SHA1(731663101d809170aad3cd39e901ef494494c5a1) )
8371   ROM_LOAD16_BYTE( "u31.8a",     0x080001, 0x010000, CRC(6a050240) SHA1(6a1a305b7d32bb2ad17842b4eeabc891fce02160) )
8372
8373   ROM_REGION( 0x04c000, "sub", 0 )      /* 65c02 Code */
8374   ROM_LOAD( "ud2002.004", 0x004000, 0x040000, CRC(bbd538b1) SHA1(de4c43bfc4004a14f9f66b5e8ff192b00c45c003) )
8375   ROM_RELOAD(             0x00c000, 0x040000  )
8376
8377   ROM_REGION( 0x200000, "gfx1", ROMREGION_DISPOSE )   /* Sprites */
8378   ROM_LOAD16_BYTE( "ud2005.t01", 0x000000, 0x080000, CRC(77e6d249) SHA1(cdf67211cd447858293188511e826640fe24078b) )
8379   ROM_LOAD16_BYTE( "ud2006.t02", 0x000001, 0x080000, CRC(6e381bf2) SHA1(ba46e019d2991dec539444ef7376fe0e9a6a8b75) )
8380   ROM_LOAD16_BYTE( "ud2007.t03", 0x100000, 0x080000, CRC(737b4971) SHA1(2a034011b0ac03d532a89b544f4eec497ac7ee80) )
8381   ROM_LOAD16_BYTE( "ud2008.t04", 0x100001, 0x080000, CRC(99b9d757) SHA1(c3a763993305110ec2a0b231d75fbef4c385d21b) )
8382
8383   ROM_REGION( 0x100000, "gfx2", ROMREGION_DISPOSE )   /* Layer 1 */
8384   ROM_LOAD( "ud2009.t05", 0x000000, 0x080000, CRC(aee6c581) SHA1(5b2150a308ca12eea8148d0bbff663b3baf0c831) )
8385   ROM_LOAD( "ud2010.t06", 0x080000, 0x080000, CRC(3d399d54) SHA1(7d9036e73fbf0e9c3b976336e3e4786b17b2f4fc) )
8386
8387   ROM_REGION( 0x080000, "x1", 0 )   /* Samples */
8388   ROM_LOAD( "ud2011.t07", 0x000000, 0x080000, CRC(9c9ff69f) SHA1(3840b654f4f709bc4c03dfe4ee79369d5c70dd62) )
8389ROM_END
8390
83668391ROM_START( downtowp )
83678392   ROM_REGION( 0x0a0000, "main", 0 )      /* 68000 Code */
83688393   ROM_LOAD16_BYTE( "ud2001.000",   0x000000, 0x040000, CRC(f1965260) SHA1(c0560342238d75f9b81ae9f3408cacfbcd331529) )
r4057r4058
96349659GAME( 1988, twineagl, 0,        twineagl, twineagl, twineagl, ROT270, "Seta (Taito license)",   "Twin Eagle - Revenge Joe's Brother" , 0) // Country/License: DSW
96359660GAME( 1989, downtown, 0,        downtown, downtown, downtown, ROT270, "Seta",                   "DownTown / Mokugeki (Set 1)" , 0) // Country/License: DSW
96369661GAME( 1989, downtow2, downtown, downtown, downtown, downtown, ROT270, "Seta",                   "DownTown / Mokugeki (Set 2)" , 0) // Country/License: DSW
9662GAME( 1989, downtowj, downtown, downtown, downtown, downtown, ROT270, "Seta",                   "DownTown / Mokugeki (Joystick Hack)" , 0) // Country/License: DSW
96379663GAME( 1989, downtowp, downtown, downtown, downtown, downtown, ROT270, "Seta",                   "DownTown / Mokugeki (prototype)" , 0) // Country/License: DSW
96389664GAME( 1989, usclssic, 0,        usclssic, usclssic, 0,        ROT270, "Seta",                   "U.S. Classic" , 0) // Country/License: DSW
96399665GAME( 1989, calibr50, 0,        calibr50, calibr50, 0,        ROT270, "Athena / Seta",          "Caliber 50" , 0) // Country/License: DSW
src/mame/drivers/laserbat.c
r4057r4058
498498static TILE_GET_INFO( get_tile_info )
499499{
500500   // wrong color index!
501   SET_TILE_INFO(0, videoram[tile_index], colorram[tile_index], 0);
501   SET_TILE_INFO(0, videoram[tile_index], colorram[tile_index] & 0x7f, 0);
502502}
503503
504504static VIDEO_START( laserbat )
src/mame/drivers/tnzs.c
r4057r4058
622622#include "driver.h"
623623#include "cpu/z80/z80.h"
624624#include "taitoipt.h"
625#include "cpu/i8x41/i8x41.h"
625#include "cpu/mcs48/mcs48.h"
626626#include "sound/2203intf.h"
627627#include "sound/dac.h"
628628#include "sound/samples.h"
r4057r4058
894894ADDRESS_MAP_END
895895
896896static ADDRESS_MAP_START( i8742_io_map, ADDRESS_SPACE_IO, 8 )
897   AM_RANGE(0x02, 0x02) AM_WRITE(tnzs_port2_w)
898   AM_RANGE(I8X41_p1, I8X41_p1) AM_READ(tnzs_port1_r)
899   AM_RANGE(I8X41_p2, I8X41_p2) AM_READ(tnzs_port2_r)
900   AM_RANGE(I8X41_t0, I8X41_t0) AM_READ_PORT("COIN1")
901   AM_RANGE(I8X41_t1, I8X41_t1) AM_READ_PORT("COIN2")
897   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(tnzs_port1_r)
898   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(tnzs_port2_r, tnzs_port2_w)
899   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ_PORT("COIN1")
900   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ_PORT("COIN2")
902901ADDRESS_MAP_END
903902
904903
r4057r4058
16491648   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
16501649   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
16511650
1652   MDRV_QUANTUM_PERFECT_CPU("main")//TIME(HZ(600000))
1651   MDRV_QUANTUM_PERFECT_CPU("main")
16531652
16541653   MDRV_MACHINE_RESET(tnzs)
16551654
r4057r4058
16881687   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
16891688   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
16901689
1691   MDRV_QUANTUM_TIME(HZ(600000))
1690   MDRV_QUANTUM_PERFECT_CPU("main")
16921691
16931692   MDRV_MACHINE_RESET(tnzs)
16941693
r4057r4058
17301729   MDRV_CPU_ADD("mcu", I8742 ,12000000/2)   /* 400KHz ??? - Main board Crystal is 12MHz */
17311730   MDRV_CPU_IO_MAP(i8742_io_map,0)
17321731
1733   MDRV_QUANTUM_TIME(HZ(600000))
1732   MDRV_QUANTUM_PERFECT_CPU("main")
17341733
17351734   MDRV_MACHINE_RESET(tnzs)
17361735
r4057r4058
17681767   MDRV_CPU_PROGRAM_MAP(sub_readmem,sub_writemem)
17691768   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
17701769
1771   MDRV_QUANTUM_TIME(HZ(600000))
1770   MDRV_QUANTUM_PERFECT_CPU("main")
17721771
17731772   MDRV_MACHINE_RESET(tnzs)
17741773
r4057r4058
18061805   MDRV_CPU_PROGRAM_MAP(kageki_sub_readmem,kageki_sub_writemem)
18071806   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
18081807
1809   MDRV_QUANTUM_TIME(HZ(600000))
1808   MDRV_QUANTUM_PERFECT_CPU("main")
18101809
18111810   MDRV_MACHINE_RESET(tnzs)
18121811
r4057r4058
18551854   MDRV_CPU_PROGRAM_MAP(tnzsb_cpu2_map,0)
18561855   MDRV_CPU_IO_MAP(tnzsb_io_map,0)
18571856
1858   MDRV_QUANTUM_TIME(HZ(600000))
1857   MDRV_QUANTUM_PERFECT_CPU("main")
18591858
18601859   MDRV_MACHINE_RESET(tnzs)
18611860
r4057r4058
19191918   MDRV_CPU_PROGRAM_MAP(jpopnics_sub_map,0)
19201919   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
19211920
1922   MDRV_QUANTUM_TIME(HZ(600000))
1921   MDRV_QUANTUM_PERFECT_CPU("main")
19231922
19241923   /* video hardware */
19251924   MDRV_SCREEN_ADD("main", RASTER)
src/mame/drivers/vball.c
r4057r4058
9595#include "sound/okim6295.h"
9696#include "includes/vball.h"
9797
98#define MAIN_CLOCK      XTAL_12MHz
99#define CPU_CLOCK         MAIN_CLOCK / 6
100#define PIXEL_CLOCK      MAIN_CLOCK / 2
98101
102/* Based on ddragon driver */
103INLINE int scanline_to_vcount(int scanline)
104{
105   int vcount = scanline + 8;
106   if (vcount < 0x100)
107      return vcount;
108   else
109      return (vcount - 0x18) | 0x100;
110}
111
112static TIMER_DEVICE_CALLBACK( vball_scanline )
113{
114   int scanline = param;
115   int screen_height = video_screen_get_height(timer->machine->primary_screen);
116   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
117   int vcount = scanline_to_vcount(scanline);
118
119   /* Update to the current point */
120   if (scanline > 0)
121   {
122      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
123   }
124
125   /* IRQ fires every on every 8th scanline */
126   if (!(vcount_old & 8) && (vcount & 8))
127   {
128      cpu_set_input_line(timer->machine->cpu[0], M6502_IRQ_LINE, ASSERT_LINE);
129   }
130
131   /* NMI fires on scanline 248 (VBL) and is latched */
132   if (vcount == 0xf8)
133   {
134      cpu_set_input_line(timer->machine->cpu[0], INPUT_LINE_NMI, ASSERT_LINE);
135   }
136
137   /* Save the scroll x register value */
138   if (scanline < 256)
139   {
140      scrollx[255 - scanline] = (vb_scrollx_hi + vb_scrollx_lo+4);
141   }
142}
143
144static WRITE8_HANDLER( vball_irq_ack_w )
145{
146   if (offset == 0)
147      cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE);
148
149   else
150      cpu_set_input_line(space->machine->cpu[0], M6502_IRQ_LINE, CLEAR_LINE);
151}
152
153
99154/* bit 0 = bank switch
100155   bit 1 = ?
101156   bit 2 = ?
r4057r4058
118173}
119174
120175/* The sound system comes all but verbatim from Double Dragon */
121
122
123176static WRITE8_HANDLER( cpu_sound_command_w ) {
124177   soundlatch_w( space, offset, data );
125178   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
r4057r4058
144197   //logerror("%04x: vb_scrollx_hi = %d\n",cpu_get_previouspc(space->cpu), vb_scrollx_hi);
145198}
146199
200static WRITE8_HANDLER(vb_scrollx_lo_w)
201{
202   vb_scrollx_lo = data;
203   //logerror("%04x: vb_scrollx_lo =%d\n",cpu_get_previouspc(space->cpu), vb_scrollx_lo);
204}
205
206
147207static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
148208   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_RAM)
149209   AM_RANGE(0x1000, 0x1000) AM_READ_PORT("P1")
r4057r4058
170230   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)
171231ADDRESS_MAP_END
172232
173static WRITE8_HANDLER(vb_scrollx_lo_w)
174{
175   vb_scrollx_lo = data;
176   //logerror("%04x: vb_scrollx_lo =%d\n",cpu_get_previouspc(space->cpu), vb_scrollx_lo);
177}
178
179233//Cheaters note: Scores are stored in ram @ 0x57-0x58 (though the space is used for other things between matches)
180234static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
181235   AM_RANGE(0x0000, 0x07ff) AM_WRITE(SMH_RAM)
182236   AM_RANGE(0x0800, 0x08ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
183237   AM_RANGE(0x1008, 0x1008) AM_WRITE(vb_scrollx_hi_w)
184238   AM_RANGE(0x1009, 0x1009) AM_WRITE(vb_bankswitch_w)
185   AM_RANGE(0x100a, 0x100a) AM_WRITE(SMH_RAM)
186   AM_RANGE(0x100b, 0x100b) AM_WRITE(SMH_RAM)      //Counts from 0 to 7 continuously
239   AM_RANGE(0x100a, 0x100b) AM_WRITE(vball_irq_ack_w)   /* is there a scanline counter here? */
187240   AM_RANGE(0x100c, 0x100c) AM_WRITE(vb_scrollx_lo_w)
188241   AM_RANGE(0x100d, 0x100d) AM_WRITE(cpu_sound_command_w)
189242   AM_RANGE(0x100e, 0x100e) AM_WRITE(SMH_RAM) AM_BASE(&vb_scrolly_lo)
r4057r4058
369422   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 128, 8 )   /* 16x16 sprites */
370423GFXDECODE_END
371424
425
372426static void vball_irq_handler(running_machine *machine, int irq)
373427{
374428   cpu_set_input_line(machine->cpu[1], 0 , irq ? ASSERT_LINE : CLEAR_LINE );
r4057r4058
379433   vball_irq_handler
380434};
381435
436
382437static MACHINE_DRIVER_START( vball )
383438
384439   /* basic machine hardware */
385    MDRV_CPU_ADD("main", M6502, 2000000)   /* 2 MHz - measured by guru but it makes the game far far too slow ?! */
440    MDRV_CPU_ADD("main", M6502, CPU_CLOCK)   /* 2 MHz - measured by guru but it makes the game far far too slow ?! */
386441   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
387   MDRV_CPU_VBLANK_INT_HACK(vball_interrupt,32)   /* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */
442   MDRV_TIMER_ADD_SCANLINE("scantimer", vball_scanline, "main", 0, 1)
388443
389444   MDRV_CPU_ADD("audio", Z80, 3579545)   /* 3.579545 MHz */
390445   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
391446
392447   /* video hardware */
393448   MDRV_SCREEN_ADD("main", RASTER)
394   MDRV_SCREEN_REFRESH_RATE(60)
395   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
396449   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
397450   MDRV_SCREEN_SIZE(32*8, 32*8)
398   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)   /* 240 x 240 */
451   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 8, 248)   /* based on ddragon driver */
399452
400453   MDRV_GFXDECODE(vb)
401454   MDRV_PALETTE_LENGTH(256)
r4057r4058
418471MACHINE_DRIVER_END
419472
420473static MACHINE_DRIVER_START( vball2pj )
474   MDRV_IMPORT_FROM(vball)
421475
422   /* basic machine hardware */
423    MDRV_CPU_ADD("main", M6502, 2000000)   /* 2.0 MHz */
476   MDRV_CPU_MODIFY("main")
424477   MDRV_CPU_PROGRAM_MAP(vball2pj_readmem,writemem)
425   MDRV_CPU_VBLANK_INT_HACK(vball_interrupt,32)   /* ??1 IRQ every 8 visible scanlines, plus NMI for vblank?? */
426
427   MDRV_CPU_ADD("audio", Z80, 3579545)   /* 3.579545 MHz */
428   MDRV_CPU_PROGRAM_MAP(sound_readmem,sound_writemem)
429
430   /* video hardware */
431   MDRV_SCREEN_ADD("main", RASTER)
432   MDRV_SCREEN_REFRESH_RATE(60)
433   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
434   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
435   MDRV_SCREEN_SIZE(32*8, 32*8)
436   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)   /* 240 x 240 */
437
438   MDRV_GFXDECODE(vb)
439   MDRV_PALETTE_LENGTH(256)
440
441   MDRV_VIDEO_START(vb)
442   MDRV_VIDEO_UPDATE(vb)
443
444   /* sound hardware */
445   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
446
447   MDRV_SOUND_ADD("ym", YM2151, 3579545)
448   MDRV_SOUND_CONFIG(ym2151_config)
449   MDRV_SOUND_ROUTE(0, "left", 0.60)
450   MDRV_SOUND_ROUTE(1, "right", 0.60)
451
452   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
453   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
454   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
455   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
456478MACHINE_DRIVER_END
457479
458480
src/mame/drivers/naomi.c
r4057r4058
12281228      src[i] = atomiswave_decrypt(src[i], i*2, &fotns_key);
12291229   }
12301230
1231
1231#if 0
12321232   {
12331233      FILE *fp;
12341234      const char *gamename = machine->gamedrv->name;
r4057r4058
12421242         fclose(fp);
12431243      }
12441244   }
1245#endif
12451246}
12461247
12471248
r4057r4058
12581259      src[i] = atomiswave_decrypt(src[i], i*2, &df_key);
12591260   }
12601261
1261
1262#if 0
12621263   {
12631264      FILE *fp;
12641265      const char *gamename = machine->gamedrv->name;
r4057r4058
12721273         fclose(fp);
12731274      }
12741275   }
1276#endif
12751277}
12761278
12771279
src/mame/drivers/progolf.c
r4057r4058
4747static ADDRESS_MAP_START( main_cpu, ADDRESS_SPACE_PROGRAM, 8 )
4848   AM_RANGE(0x0000, 0x0fff) AM_RAM
4949   AM_RANGE(0x1000, 0x1fff) AM_RAM //AM_WRITE(deco_charram_w) AM_BASE(&deco_charram)
50   AM_RANGE(0x2000, 0x7fff) AM_RAM //AM_WRITE(deco_charram_w) AM_BASE(&deco_charram)
50   AM_RANGE(0x2000, 0x7fff) AM_RAM AM_BASE(&deco_charram) //AM_WRITE(deco_charram_w)
5151   AM_RANGE(0x9000, 0x9000) AM_WRITENOP
5252   AM_RANGE(0x9000, 0x9000) AM_READNOP
5353   AM_RANGE(0x9200, 0x9200) AM_WRITENOP
src/mame/drivers/megatech.c
r4057r4058
12781278/* 37 */ // unknown
12791279/* 38 */ GAME( 1990, mt_eswat, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Cyber Police ESWAT: Enhanced Special Weapons and Tactics (Mega-Tech)", GAME_NOT_WORKING )
12801280/* 39 */ GAME( 1990, mt_smgp,  megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Super Monaco GP (Mega-Tech)", GAME_NOT_WORKING )
1281/* 40 */ GAME( 1990, mt_mwalk, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Moonwalker (Mega-Tech)", GAME_NOT_WORKING )
1281/* 40 */ GAME( 1990, mt_mwalk, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Michael Jackson's Moonwalker (Mega-Tech)", GAME_NOT_WORKING )
12821282/* 41 */ GAME( 1990, mt_crack, megatech, megatech, megatech, mtnew, ROT0, "Sega",                  "Crack Down (Mega-Tech)", GAME_NOT_WORKING )
12831283/* 42 */ // unknown
12841284/* 43 */ // unknown
src/mame/drivers/igs_blit.c
r4057r4058
30763076
30773077/***************************************************************************
30783078
3079    Zhong Guo Long? (Hong Kong, V011H)
3079    Dong Fang Zhi Zhu (Hong Kong version of Zhong Guo Long, V011H)
30803080
30813081***************************************************************************/
30823082
src/mame/drivers/vamphalf.c
r4057r4058
1818    Final Godori              (c) 2001 SemiCom            (version 2.20.5915)
1919    Wyvern Wings              (c) 2001 SemiCom
2020
21 Games Needed:
22
23    Vamp 1/2 (World version)
24
2521 Real games bugs:
2622 - dquizgo2: bugged video test
2723
r4057r4058
712708ROM_START( vamphalf )
713709   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
714710   /* 0 - 0x80000 empty */
711   ROM_LOAD( "prg.rom1", 0x80000, 0x80000, CRC(9b1fc6c5) SHA1(acf10a50d2119ac893b6cbd494911982a9352350) )
712
713   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE ) /* 16x16x8 Sprites */
714   ROM_LOAD32_WORD( "eur.roml00", 0x000000, 0x200000, CRC(bdee9a46) SHA1(7e240b07377201afbe0cd0911ccee4ad52a74079) )
715   ROM_LOAD32_WORD( "eur.romu00", 0x000002, 0x200000, CRC(fa79e8ea) SHA1(feaba99f0a863bc5d27ad91d206168684976b4c2) )
716   ROM_LOAD32_WORD( "eur.roml01", 0x400000, 0x200000, CRC(a7995b06) SHA1(8b789b6a00bc177c3329ee4a31722fc65376b975) )
717   ROM_LOAD32_WORD( "eur.romu01", 0x400002, 0x200000, CRC(e269f5fe) SHA1(70f1308f11e147dd20f8bd45b91aefc9fd653da6) )
718
719   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
720   ROM_LOAD( "snd.vrom1", 0x00000, 0x40000, CRC(ee9e371e) SHA1(3ead5333121a77d76e4e40a0e0bf0dbc75f261eb) )
721ROM_END
722
723
724ROM_START( vamphafk )
725   ROM_REGION16_BE( 0x100000, "user1", ROMREGION_ERASE00 ) /* Hyperstone CPU Code */
726   /* 0 - 0x80000 empty */
715727   ROM_LOAD( "prom1", 0x80000, 0x80000, CRC(f05e8e96) SHA1(c860e65c811cbda2dc70300437430fb4239d3e2d) )
716728
717729   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE ) /* 16x16x8 Sprites */
r4057r4058
721733   ROM_LOAD32_WORD( "romu01", 0x400002, 0x200000, CRC(d5be3363) SHA1(dbdd0586909064e015f190087f338f37bbf205d2) )
722734
723735   ROM_REGION( 0x40000, "oki", 0 ) /* Oki Samples */
724   ROM_LOAD( "vrom1", 0x00000, 0x40000, CRC(ee9e371e) SHA1(3ead5333121a77d76e4e40a0e0bf0dbc75f261eb) )
736   ROM_LOAD( "snd.vrom1", 0x00000, 0x40000, CRC(ee9e371e) SHA1(3ead5333121a77d76e4e40a0e0bf0dbc75f261eb) )
725737ROM_END
726738
739
727740/*
728741
729742Mission Craft
r4057r4058
11571170         cpu_eat_cycles(space->cpu, 50);
11581171   }
11591172
1173   return wram[(0x4a840/2)+offset];
1174}
1175
1176static READ16_HANDLER( vamphafk_speedup_r )
1177{
1178   if(cpu_get_pc(space->cpu) == 0x82de)
1179   {
1180      if(irq_active(space))
1181         cpu_spinuntil_int(space->cpu);
1182      else
1183         cpu_eat_cycles(space->cpu, 50);
1184   }
1185
11601186   return wram[(0x4a6d0/2)+offset];
11611187}
11621188
r4057r4058
12771303   return wram[(0xcde70/2)+offset];
12781304}
12791305
1280
12811306static DRIVER_INIT( vamphalf )
12821307{
1283   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0004a6d0, 0x0004a6d3, 0, 0, vamphalf_speedup_r );
1308   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0004a840, 0x0004a843, 0, 0, vamphalf_speedup_r );
12841309
12851310   palshift = 0;
12861311   flip_bit = 0x80;
12871312}
12881313
1314static DRIVER_INIT( vamphafk )
1315{
1316   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0004a6d0, 0x0004a6d3, 0, 0, vamphafk_speedup_r );
1317
1318   palshift = 0;
1319   flip_bit = 0x80;
1320}
1321
12891322static DRIVER_INIT( misncrft )
12901323{
12911324   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00072eb4, 0x00072eb7, 0, 0, misncrft_speedup_r );
r4057r4058
13651398   flip_bit = 1;
13661399}
13671400
1368GAME( 1999, coolmini, 0,      coolmini, common,   coolmini, ROT0,   "SemiCom",           "Cool Minigame Collection", 0 )
1369GAME( 1999, suplup,   0,      suplup,   common,   suplup,   ROT0,   "Omega System",      "Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)" , 0)
1370GAME( 1999, luplup,   suplup, suplup,   common,   luplup,   ROT0,   "Omega System",      "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 3.0 / 990128)", 0 )
1371GAME( 1999, luplup29, suplup, suplup,   common,   luplup29, ROT0,   "Omega System",      "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 2.9 / 990108)", 0 )
1372GAME( 1999, puzlbang, suplup, suplup,   common,   puzlbang, ROT0,   "Omega System",      "Puzzle Bang Bang (version 2.8 / 990106)", 0 )
1373GAME( 1999, vamphalf, 0,      vamphalf, common,   vamphalf, ROT0,   "Danbi & F2 System", "Vamp 1/2 (Korea version)", 0 )
1374GAME( 2000, dquizgo2, 0,      coolmini, common,   dquizgo2, ROT0,   "SemiCom",           "Date Quiz Go Go Episode 2" , 0)
1375GAME( 2000, misncrft, 0,      misncrft, common,   misncrft, ROT90,  "Sun",               "Mission Craft (version 2.4)", GAME_NO_SOUND )
1376GAME( 2001, finalgdr, 0,      finalgdr, finalgdr, finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea, version 2.20.5915)", 0 )
1377GAME( 2001, wyvernwg, 0,      wyvernwg, common,   wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND )
1401GAME( 1999, coolmini, 0,        coolmini, common,   coolmini, ROT0,   "SemiCom",           "Cool Minigame Collection", 0 )
1402GAME( 1999, suplup,   0,        suplup,   common,   suplup,   ROT0,   "Omega System",      "Super Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 4.0 / 990518)" , 0)
1403GAME( 1999, luplup,   suplup,   suplup,   common,   luplup,   ROT0,   "Omega System",      "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 3.0 / 990128)", 0 )
1404GAME( 1999, luplup29, suplup,   suplup,   common,   luplup29, ROT0,   "Omega System",      "Lup Lup Puzzle / Zhuan Zhuan Puzzle (version 2.9 / 990108)", 0 )
1405GAME( 1999, puzlbang, suplup,   suplup,   common,   puzlbang, ROT0,   "Omega System",      "Puzzle Bang Bang (version 2.8 / 990106)", 0 )
1406GAME( 1999, vamphalf, 0,        vamphalf, common,   vamphalf, ROT0,   "Danbi & F2 System", "Vamf x1/2 (Europe)", 0 )
1407GAME( 1999, vamphafk, vamphalf, vamphalf, common,   vamphafk, ROT0,   "Danbi & F2 System", "Vamp x1/2 (Korea)", 0 )
1408GAME( 2000, dquizgo2, 0,        coolmini, common,   dquizgo2, ROT0,   "SemiCom",           "Date Quiz Go Go Episode 2" , 0)
1409GAME( 2000, misncrft, 0,        misncrft, common,   misncrft, ROT90,  "Sun",               "Mission Craft (version 2.4)", GAME_NO_SOUND )
1410GAME( 2001, finalgdr, 0,        finalgdr, finalgdr, finalgdr, ROT0,   "SemiCom",           "Final Godori (Korea, version 2.20.5915)", 0 )
1411GAME( 2001, wyvernwg, 0,        wyvernwg, common,   wyvernwg, ROT270, "SemiCom (Game Vision License)", "Wyvern Wings", GAME_NO_SOUND )
src/mame/drivers/gridlee.c
r4057r4058
9797static UINT8 *poly17 = NULL;
9898static UINT8 *rand17 = NULL;
9999
100
101
102100/* local prototypes */
103101static void poly17_init(void);
104102
103/* local timers */
104static emu_timer *irq_off;
105static emu_timer *irq_timer;
106static emu_timer *firq_off;
107static emu_timer *firq_timer;
105108
106109/*************************************
107110 *
r4057r4058
109112 *
110113 *************************************/
111114
112static TIMER_CALLBACK( irq_off )
115static TIMER_CALLBACK( irq_off_tick )
113116{
114117   cpu_set_input_line(machine->cpu[0], M6809_IRQ_LINE, CLEAR_LINE);
115118}
116119
117120
118static TIMER_CALLBACK( irq_timer )
121static TIMER_CALLBACK( irq_timer_tick )
119122{
120123   /* next interrupt after scanline 256 is scanline 64 */
121124   if (param == 256)
122      timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), NULL, 64, irq_timer);
125        timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64);
123126   else
124      timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, param + 64, 0), NULL, param + 64, irq_timer);
127        timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, param + 64, 0), param + 64);
125128
126129   /* IRQ starts on scanline 0, 64, 128, etc. */
127130   cpu_set_input_line(machine->cpu[0], M6809_IRQ_LINE, ASSERT_LINE);
128131
129132   /* it will turn off on the next HBLANK */
130   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, param, BALSENTE_HBSTART), NULL, 0, irq_off);
133    timer_adjust_oneshot(irq_off, video_screen_get_time_until_pos(machine->primary_screen, param, BALSENTE_HBSTART), 0);
131134}
132135
133136
134static TIMER_CALLBACK( firq_off )
137static TIMER_CALLBACK( firq_off_tick )
135138{
136139   cpu_set_input_line(machine->cpu[0], M6809_FIRQ_LINE, CLEAR_LINE);
137140}
138141
139142
140static TIMER_CALLBACK( firq_timer )
143static TIMER_CALLBACK( firq_timer_tick )
141144{
142145   /* same time next frame */
143   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, FIRQ_SCANLINE, 0), NULL, 0, firq_timer);
146    timer_adjust_oneshot(firq_timer, video_screen_get_time_until_pos(machine->primary_screen, FIRQ_SCANLINE, 0), 0);
144147
145148   /* IRQ starts on scanline FIRQ_SCANLINE? */
146149   cpu_set_input_line(machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE);
147150
148151   /* it will turn off on the next HBLANK */
149   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, FIRQ_SCANLINE, BALSENTE_HBSTART), NULL, 0, firq_off);
152    timer_adjust_oneshot(firq_off, video_screen_get_time_until_pos(machine->primary_screen, FIRQ_SCANLINE, BALSENTE_HBSTART), 0);
150153}
151154
155static MACHINE_START( gridlee )
156{
157    /* create the polynomial tables */
158    poly17_init();
152159
160    state_save_register_global_array(machine, last_analog_input);
161    state_save_register_global_array(machine, last_analog_output);
162
163    irq_off = timer_alloc(machine, irq_off_tick, 0);
164    irq_timer = timer_alloc(machine, irq_timer_tick, 0);
165    firq_off = timer_alloc(machine, firq_off_tick, 0);
166    firq_timer = timer_alloc(machine, firq_timer_tick, 0);
167}
168
169
153170static MACHINE_RESET( gridlee )
154171{
155172   /* start timers to generate interrupts */
156   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), NULL, 0, irq_timer);
157   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, FIRQ_SCANLINE, 0), NULL, 0, firq_timer);
158
159   /* create the polynomial tables */
160   poly17_init();
173    timer_adjust_oneshot(irq_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
174    timer_adjust_oneshot(firq_timer, video_screen_get_time_until_pos(machine->primary_screen, FIRQ_SCANLINE, 0), 0);
161175}
162176
163177
r4057r4058
437451   MDRV_CPU_ADD("main", M6809, BALSENTE_CPU_CLOCK)
438452   MDRV_CPU_PROGRAM_MAP(readmem_cpu1,writemem_cpu1)
439453
454    MDRV_MACHINE_START(gridlee)
440455   MDRV_MACHINE_RESET(gridlee)
441456   MDRV_NVRAM_HANDLER(generic_0fill)
442457
r4057r4058
500515 *
501516 *************************************/
502517
503GAME( 1983, gridlee, 0,        gridlee, gridlee, 0,     ROT0, "Videa", "Gridlee", GAME_IMPERFECT_SOUND )
518GAME( 1983, gridlee, 0,        gridlee, gridlee, 0,     ROT0, "Videa", "Gridlee", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
src/mame/drivers/igs_m68.c
r4057r4058
139139   ROM_LOAD( "m1103",    0x000000, 0x080000, CRC(4d3776b4) SHA1(fa9b311b1a6ad56e136b66d090bc62ed5003b2f2) )
140140ROM_END
141141
142/*
143142
144Mahjong Man Guan Cai Shen
145IGS, 1998
146
147
148PCB Layout
149----------
150
151IGS PCB NO-0192-1
152|---------------------------------------|
153|              JAMMA            UPC1242 |
154|                                       |
155|               S1502.U10               |
156|                          K668    VOL  |
157|                                       |
158|                                       |
159|                       22MHz           |
160|1     61256                            |
161|8              |-------|      TEXT.U25 |
162|W     PAL      |       |               |
163|A              |IGS017 |               |
164|Y              |       |      M1501.U23|
165|               |-------|               |
166|   |-------|                           |
167|   |       |                           |
168|   |IGS025 |   P1500.U8                |
169|   |       |              PAL    6264  |
170|1  |-------|                           |
171|0  |----|                 PAL    6264  |
172|W  |IGS |                 PAL          |
173|A  |029 |  8MHz                 SPDT_SW|
174|Y  |----|                 68000        |
175|T DSW1  DSW2                   BATTERY |
176|---------------------------------------|
177Notes:
178      Uses JAMMA & common 10-way/18-way Mahjong pinout
179      68000 clock 11.000MHz [22/2]
180      K668  == Oki M6295 (QFP44). Clock 1MHz [8/8]. pin7 = High
181      VSync - 60Hz
182      HSync - 15.3kHz
183
184*/
185
186
187ROM_START( mgcs )
188   ROM_REGION( 0x80000, "main", 0 ) /* 68000 Code */
189   ROM_LOAD16_WORD_SWAP( "p1500.u8", 0x00000, 0x80000, CRC(a8cb5905) SHA1(37be7d926a1352869632d43943763accd4dec4b7) )
190
191   ROM_REGION( 0x80000, "oki", 0 ) /* Samples */
192   ROM_LOAD( "s1502.u10", 0x00000, 0x80000, CRC(a8a6ba58) SHA1(59276a8ab4a31812600816c2a43b74bd71394419) )
193
194   ROM_REGION( 0x200000, "gfx1", 0 )
195   ROM_LOAD( "m1501.u23", 0x000000, 0x200000, CRC(7a876bcc) SHA1(581740f39cfac56324f483a24aece6957645378a) )
196   ROM_LOAD( "text.u25",    0x000000, 0x080000, CRC(a37f9613) SHA1(812f060ca98a34540c48a180c359c3d0f1c0b5bb) )
197ROM_END
198
199143/*
200144
201145Mahjong Shuang Long Qiang Zhu 2
r4057r4058
460404
461405}
462406
463static DRIVER_INIT( mgcs )
464{
465   int i;
466   UINT16 *src = (UINT16 *) (memory_region(machine, "main"));
467
468   int rom_size = 0x80000;
469
470   for (i=0; i<rom_size/2; i++)
471   {
472      UINT16 x = src[i];
473
474      /* bit 0 xor layer */
475
476      if( i & 0x20/2 )
477      {
478         if( i & 0x02/2 )
479         {
480            x ^= 0x0001;
481         }
482      }
483
484      if( !(i & 0x4000/2) )
485      {
486         if( !(i & 0x300/2) )
487         {
488            x ^= 0x0001;
489         }
490      }
491
492      /* bit 8 xor layer */
493
494      if( (i & 0x2000/2) || !(i & 0x80/2) )
495      {
496         if( i & 0x100/2 )
497         {
498            if( !(i & 0x20/2) || (i & 0x400/2) )
499            {
500               x ^= 0x0100;
501            }
502         }
503      }
504      else
505      {
506         x ^= 0x0100;
507      }
508
509      src[i] = x;
510   }
511}
512
513407static DRIVER_INIT( slqz2 )
514408{
515409   int i;
r4057r4058
643537
644538GAME( 1998, lhzb2,    0,        igs_m68,    igs_m68,    lhzb2,  ROT0,  "IGS", "Mahjong Long Hu Zheng Ba 2 (set 1)", GAME_NOT_WORKING )
645539GAME( 1998, lhzb2a,   lhzb2,    igs_m68,    igs_m68,    lhzb2a, ROT0,  "IGS", "Mahjong Long Hu Zheng Ba 2 (set 2)", GAME_NOT_WORKING )
646GAME( 1998, mgcs,     0,        igs_m68,    igs_m68,    mgcs,   ROT0,  "IGS", "Mahjong Man Guan Cai Shen", GAME_NOT_WORKING )
647540GAME( 1998, slqz2,    0,        igs_m68,    igs_m68,    slqz2,  ROT0,  "IGS", "Mahjong Shuang Long Qiang Zhu 2", GAME_NOT_WORKING )
648541GAME( 1997, sdmg2,    0,        igs_m68,    igs_m68,    sdmg2,  ROT0,  "IGS", "Mahjong Super Da Man Guan 2", GAME_NOT_WORKING )
649542
src/mame/drivers/realbrk.c
r4057r4058
232398  Billiard Academy Real Break (Japan)     NM523-1-9805
242498  Billiard Academy Real Break (Europe)    MM600-1-9807
252598  Billiard Academy Real Break (Korea)     MM600-1-9807
2604  Dai-Dai-Kakumei (Japan)                 NM522-1-9803
2627---------------------------------------------------------------------------
2728
2829Notes:
r4057r4058
676677static MACHINE_DRIVER_START( realbrk )
677678
678679   /* basic machine hardware */
679   MDRV_CPU_ADD("main",M68000,32000000 / 2)         /* !! TMP68301 !! */
680   MDRV_CPU_ADD("main",M68000, XTAL_32MHz / 2)         /* !! TMP68301 !! */
680681   MDRV_CPU_PROGRAM_MAP(realbrk_mem,base_mem)
681682   MDRV_CPU_VBLANK_INT("main", realbrk_interrupt)
682683
r4057r4058
699700   /* sound hardware */
700701   MDRV_SPEAKER_STANDARD_STEREO("left", "right")
701702
702   MDRV_SOUND_ADD("ymz", YMZ280B, 33868800 / 2)
703   MDRV_SOUND_ADD("ymz", YMZ280B, XTAL_33_8688MHz / 2)
703704   MDRV_SOUND_ROUTE(0, "left", 0.50)
704705   MDRV_SOUND_ROUTE(1, "right", 0.50)
705706
706   MDRV_SOUND_ADD("ym", YM2413, 3579000)
707   MDRV_SOUND_ADD("ym", YM2413, XTAL_3_579545MHz)
707708   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 0.50)
708709   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 0.50)
709710MACHINE_DRIVER_END
r4057r4058
10521053   ROM_LOAD( "mm60003.2e", 0x000000, 0x400000, CRC(39512459) SHA1(b5859a7d8f2f87d923e7f86f095cbffd31f9cbfa) )
10531054ROM_END
10541055
1056// Team Japump board:
1057
10551058ROM_START( dai2kaku )
10561059   ROM_REGION( 0x100000, "main", 0 )      /* TMP68301 Code */
1060   ROM_LOAD16_BYTE( "52201b.2r", 0x000000, 0x080000, CRC(5672cbe6) SHA1(4379edd0725e1b8cd5b3f9201e484487eccd1714) )
10571061   ROM_LOAD16_BYTE( "52202b.1r", 0x000001, 0x080000, CRC(e45d6368) SHA1(5fb39b7c2e0fd474e7c366279f616b9244e6cf2e) )
1058   ROM_LOAD16_BYTE( "52201b.2r", 0x000000, 0x080000, CRC(5672cbe6) SHA1(4379edd0725e1b8cd5b3f9201e484487eccd1714) )
10591062
10601063   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE )   /* Backgrounds */
10611064   ROM_LOAD32_WORD( "52210.9b", 0x0000000, 0x400000, CRC(29f0cd88) SHA1(e8eab4f3e4cb12663874d4f4a2fefc77d15fa078) )
r4057r4058
10731076   ROM_LOAD( "52203.2e", 0x000000, 0x100000, CRC(a612ba97) SHA1(b7bb903f8e00ce5febf3b68a3d892da9162b45be) )
10741077ROM_END
10751078
1079// Guru board:
10761080
1077GAME( 1998, pkgnsh,   0,       pkgnsh,   pkgnsh,   0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu (Japan)", GAME_IMPERFECT_GRAPHICS )
1078GAME( 1998, pkgnshdx, 0,       pkgnshdx, pkgnshdx, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu DX (Japan)", GAME_IMPERFECT_GRAPHICS )
1079GAME( 1998, realbrk,  0,       realbrk,  realbrk,  0, ROT0, "Nakanihon", "Billiard Academy Real Break (Europe)", GAME_IMPERFECT_GRAPHICS )
1080GAME( 1998, realbrkj, realbrk, realbrk,  realbrk,  0, ROT0, "Nakanihon", "Billiard Academy Real Break (Japan)", GAME_IMPERFECT_GRAPHICS )
1081GAME( 1998, realbrkk, realbrk, realbrk,  realbrk,  0, ROT0, "Nakanihon", "Billiard Academy Real Break (Korea)", GAME_IMPERFECT_GRAPHICS )
1082GAME( 2004, dai2kaku, 0,       dai2kaku, realbrk,  0, ROT0, "SystemBit", "DaiDaiKakumei (Japan)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
1081/***************************************************************************
10831082
1083Dai Dai Kakumei
1084SystemBit Corp. 2004
1085
1086Same PCB as Pachinko Gindama Shoubu DX (Japan)
1087
1088PCB Layout
1089----------
1090
1091NM522-1-9803
1092|-------------------------------------------------------|
1093|  TMP68301   1R    TPC1010  M548262     2E    MN52204  |
1094|             2R             M548262           MN52205  |
1095|                 TC55257         32.768kHz             |
1096|                 TC55257  33.8688MHz   PST532          |
1097|M                             M6242 BATTERY   4L10F2467|
1098|A     VR1                          PAL                 |
1099|H     VR2                4L10F2468     32MHz           |
1100|J  TA7252                                              |
1101|O        JRC3404                                       |
1102|N  YAC516  JRC3404                                     |
1103|G   YM2413                LC3664                       |
1104|                          LC3664    9F    9D    9B 9A  |
1105|DSW2 DSW1   3.579545MHz           LC3664               |
1106|DSW3 DSW4             TC55257     LC3664               |
1107|                      TC55257                          |
1108|CN3                   TC55257                          |
1109|CN4                   TC55257                          |
1110|-------------------------------------------------------|
1111Notes:
1112      TMP68301 - clock 16.000MHz
1113      YM2413   - clock 3.579545MHz
1114      YMZ280B  - clock 16.9344MHz [33.8688/2]
1115      VSync    - 59.8986Hz
1116      HSync    - 15.332kHz
1117      TPC1010  - Actel CPLD
1118      TC55257  - 256kx8 SRAM
1119      LC3664   - 64kx8 SRAM
1120      M548262  - 256k x8 fastpage VRAM
1121      PST532   - IC for system reset and battery backup switching
1122      DIPSW's  - Each have 10 switches
1123      VOL1/VOL2- Separate volume levels for sound and voice
1124      CN3/CN4  - Connectors for player 3 & 4 controls
1125
112627C160 EPROMs. They don't have numbers like the other dump.
1127There is no 52203 number on the ROMs (or any other),
1128just 9A 9B 9D 9F 2E 2R 1R.
1129The only ones with numbers are the EPROMs at 1A and 1B.
1130
1131***************************************************************************/
1132/*
1133This dump matches the already supported set, except for rom sizes:
1134
1135    1r                      52201B.2R               IDENTICAL
1136    2r                      52202B.1R               IDENTICAL
1137    nm52204.1b              52204.1B                IDENTICAL
1138    nm52205.1a              52205.1A                IDENTICAL
1139    2e           [1/2]      52203.2E                IDENTICAL
1140    9a                      52211.9A     [1/2]      IDENTICAL
1141    9b                      52210.9B     [1/2]      IDENTICAL
1142    9d                      52208.9D     [1/2]      IDENTICAL
1143    9f                      52206.9F     [1/2]      IDENTICAL
1144*/
1145#if 0
1146ROM_START( dai2kaku_alt_rom_size )
1147   ROM_REGION( 0x100000, "main", 0 )
1148   ROM_LOAD16_BYTE( "1r", 0x000000, 0x080000, CRC(5672cbe6) SHA1(4379edd0725e1b8cd5b3f9201e484487eccd1714) )
1149   ROM_LOAD16_BYTE( "2r", 0x000001, 0x080000, CRC(e45d6368) SHA1(5fb39b7c2e0fd474e7c366279f616b9244e6cf2e) )
1150
1151   ROM_REGION( 0x400000, "gfx1", ROMREGION_DISPOSE )
1152   ROM_LOAD32_WORD( "9b", 0x000000, 0x200000, CRC(eab21697) SHA1(28540e04c0d4040328f3d3373e623138a8730c07) )
1153   ROM_LOAD32_WORD( "9a", 0x000002, 0x200000, CRC(1b12dd4e) SHA1(8be13b72b2427eb66f1c4f736aa8bde0a8e1bc9b) )
1154
1155   ROM_REGION( 0x40000, "gfx2", ROMREGION_DISPOSE )
1156   ROM_LOAD16_BYTE( "nm52204.1b", 0x000000, 0x020000, CRC(47a39496) SHA1(3ac9499b70c63185fb65378c18d4ff30ba1d2f2b) )
1157   ROM_LOAD16_BYTE( "nm52205.1a", 0x000001, 0x020000, CRC(4b7d16c0) SHA1(5f6410121ec13bea2869d61db169dbe2536453ea) )
1158
1159   ROM_REGION( 0x400000, "gfx3", ROMREGION_DISPOSE )
1160   ROM_LOAD32_WORD( "9f", 0x000000, 0x200000, CRC(63a1a280) SHA1(a6a4b7ebe2b8d57f5c1fce43c9b28c5dc2d6057a) )
1161   ROM_LOAD32_WORD( "9d", 0x000002, 0x200000, CRC(1743a929) SHA1(4756e9c567c406f635c6380e263f38a6a2a82038) )
1162
1163   ROM_REGION( 0x200000, "ymz", 0 )
1164   ROM_LOAD( "2e", 0x000000, 0x200000, CRC(833856b5) SHA1(10663abd2a051f95c07b301573124ae53f902044) )
1165ROM_END
1166#endif
1167
1168GAME( 1998, pkgnsh,   0,       pkgnsh,   pkgnsh,   0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu (Japan)",      GAME_IMPERFECT_GRAPHICS )
1169GAME( 1998, pkgnshdx, 0,       pkgnshdx, pkgnshdx, 0, ROT0, "Nakanihon / Dynax", "Pachinko Gindama Shoubu DX (Japan)",   GAME_IMPERFECT_GRAPHICS )
1170GAME( 1998, realbrk,  0,       realbrk,  realbrk,  0, ROT0, "Nakanihon",         "Billiard Academy Real Break (Europe)", GAME_IMPERFECT_GRAPHICS )
1171GAME( 1998, realbrkj, realbrk, realbrk,  realbrk,  0, ROT0, "Nakanihon",         "Billiard Academy Real Break (Japan)",  GAME_IMPERFECT_GRAPHICS )
1172GAME( 1998, realbrkk, realbrk, realbrk,  realbrk,  0, ROT0, "Nakanihon",         "Billiard Academy Real Break (Korea)",  GAME_IMPERFECT_GRAPHICS )
1173GAME( 2004, dai2kaku, 0,       dai2kaku, realbrk,  0, ROT0, "SystemBit",         "Dai-Dai-Kakumei (Japan)",              GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/xain.c
r4057r4058
147147#include "cpu/m6805/m6805.h"
148148#include "sound/2203intf.h"
149149
150static UINT8 *xain_sharedram;
150#define MASTER_CLOCK      XTAL_12MHz
151#define CPU_CLOCK         MASTER_CLOCK / 8
152#define MCU_CLOCK         MASTER_CLOCK / 4
153#define PIXEL_CLOCK      MASTER_CLOCK / 2
154
151155static int vblank;
152156
153157VIDEO_UPDATE( xain );
r4057r4058
164168extern UINT8 *xain_charram, *xain_bgram0, *xain_bgram1, xain_pri;
165169
166170
167static READ8_HANDLER( xain_sharedram_r )
171/*
172    Based on the Solar Warrior schematics, vertical timing counts as follows:
173
174        08,09,0A,0B,...,FC,FD,FE,FF,E8,E9,EA,EB,...,FC,FD,FE,FF,
175        08,09,....
176
177    Thus, it counts from 08 to FF, then resets to E8 and counts to FF again.
178    This gives (256 - 8) + (256 - 232) = 248 + 24 = 272 total scanlines.
179
180    VBLK is signalled starting when the counter hits F8, and continues through
181    the reset to E8 and through until the next reset to 08 again.
182
183    Since MAME's video timing is 0-based, we need to convert this.
184*/
185
186INLINE int scanline_to_vcount(int scanline)
168187{
169   return xain_sharedram[offset];
188   int vcount = scanline + 8;
189   if (vcount < 0x100)
190      return vcount;
191   else
192      return (vcount - 0x18) | 0x100;
170193}
171194
172static WRITE8_HANDLER( xain_sharedram_w )
195static TIMER_DEVICE_CALLBACK( xain_scanline )
173196{
174   /* locations 003d and 003e are used as a semaphores between CPU A and B, */
175   /* so let's resync every time they are changed to avoid deadlocks */
176   if ((offset == 0x003d || offset == 0x003e)
177         && xain_sharedram[offset] != data)
178      cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(20));
179   xain_sharedram[offset] = data;
197   int scanline = param;
198   int screen_height = video_screen_get_height(timer->machine->primary_screen);
199   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
200   int vcount = scanline_to_vcount(scanline);
201
202   /* update to the current point */
203   if (scanline > 0)
204   {
205      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
206   }
207
208   /* FIRQ (IMS) fires every on every 8th scanline (except 0) */
209   if (!(vcount_old & 8) && (vcount & 8))
210   {
211      cpu_set_input_line(timer->machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE);
212   }
213
214   /* NMI fires on scanline 248 (VBL) and is latched */
215   if (vcount == 0xf8)
216   {
217      cpu_set_input_line(timer->machine->cpu[0], INPUT_LINE_NMI, ASSERT_LINE);
218   }
219
220   /* VBLANK input bit is held high from scanlines 248-255 */
221   if (vcount >= 248-1)   // -1 is a hack - see notes above
222   {
223      vblank = 1;
224   }
225   else
226   {
227      vblank = 0;
228   }
180229}
181230
182231static WRITE8_HANDLER( xainCPUA_bankswitch_w )
183232{
184   UINT8 *RAM = memory_region(space->machine, "main");
185
186   xain_pri=data&0x7;
187
188   if (data & 0x08) {memory_set_bankptr(space->machine, 1,&RAM[0x10000]);}
189   else {memory_set_bankptr(space->machine, 1,&RAM[0x4000]);}
233   xain_pri = data & 0x7;
234   memory_set_bank(space->machine, 1, (data >> 3) & 1);
190235}
191236
192237static WRITE8_HANDLER( xainCPUB_bankswitch_w )
193238{
194   UINT8 *RAM = memory_region(space->machine, "sub");
195
196   if (data & 0x01) {memory_set_bankptr(space->machine, 2,&RAM[0x10000]);}
197   else {memory_set_bankptr(space->machine, 2,&RAM[0x4000]);}
239   memory_set_bank(space->machine, 2, data & 1);
198240}
199241
200242static WRITE8_HANDLER( xain_sound_command_w )
r4057r4058
248290   return vblank;
249291}
250292
251static INTERRUPT_GEN( xain_interrupt )
252{
253   int scanline = 255 - cpu_getiloops(device);
254293
255   /* FIRQ (IMS) fires every on every 8th scanline (except 0) */
256   if (scanline & 0x08)
257      cpu_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE);
258
259   /* NMI fires on scanline 248 (VBL) and is latched */
260   if (scanline == 248)
261      cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
262
263   /* VBLANK input bit is held high from scanlines 248-255 */
264   if (scanline >= 248-1) // -1 is a hack - see notes above
265      vblank = 1;
266   else
267      vblank = 0;
268}
269
270294static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
271   AM_RANGE(0x0000, 0x1fff) AM_READWRITE(xain_sharedram_r, xain_sharedram_w) AM_BASE(&xain_sharedram)
272   AM_RANGE(0x2000, 0x37ff) AM_READ(SMH_RAM)
273   AM_RANGE(0x2000, 0x27ff) AM_WRITE(xain_charram_w) AM_BASE(&xain_charram)
274   AM_RANGE(0x2800, 0x2fff) AM_WRITE(xain_bgram1_w) AM_BASE(&xain_bgram1)
275   AM_RANGE(0x3000, 0x37ff) AM_WRITE(xain_bgram0_w) AM_BASE(&xain_bgram0)
295   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE(1)
296   AM_RANGE(0x2000, 0x27ff) AM_RAM_WRITE(xain_charram_w) AM_BASE(&xain_charram)
297   AM_RANGE(0x2800, 0x2fff) AM_RAM_WRITE(xain_bgram1_w) AM_BASE(&xain_bgram1)
298   AM_RANGE(0x3000, 0x37ff) AM_RAM_WRITE(xain_bgram0_w) AM_BASE(&xain_bgram0)
276299   AM_RANGE(0x3800, 0x397f) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
277300   AM_RANGE(0x3a00, 0x3a00) AM_READ_PORT("P1")
278301   AM_RANGE(0x3a00, 0x3a01) AM_WRITE(xain_scrollxP1_w)
r4057r4058
292315   AM_RANGE(0x3a0f, 0x3a0f) AM_WRITE(xainCPUA_bankswitch_w)
293316   AM_RANGE(0x3c00, 0x3dff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split1_w) AM_BASE(&paletteram)
294317   AM_RANGE(0x3e00, 0x3fff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_split2_w) AM_BASE(&paletteram_2)
295   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK1)
296   AM_RANGE(0x4000, 0xffff) AM_ROM
318   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
319   AM_RANGE(0x8000, 0xffff) AM_ROM
297320ADDRESS_MAP_END
298321
299322static ADDRESS_MAP_START( cpu_map_B, ADDRESS_SPACE_PROGRAM, 8 )
300   AM_RANGE(0x0000, 0x1fff) AM_READWRITE(xain_sharedram_r, xain_sharedram_w)
323   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE(1)
301324   AM_RANGE(0x2000, 0x2000) AM_WRITE(xain_irqA_assert_w)
302325   AM_RANGE(0x2800, 0x2800) AM_WRITE(xain_irqB_clear_w)
303326   AM_RANGE(0x3000, 0x3000) AM_WRITE(xainCPUB_bankswitch_w)
304   AM_RANGE(0x4000, 0x7fff) AM_READ(SMH_BANK2)
305   AM_RANGE(0x4000, 0xffff) AM_ROM
327   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(2)
328   AM_RANGE(0x8000, 0xffff) AM_ROM
306329ADDRESS_MAP_END
307330
308331#if 0
r4057r4058
322345   AM_RANGE(0x4000, 0xffff) AM_ROM
323346ADDRESS_MAP_END
324347
348
325349static INPUT_PORTS_START( xsleena )
326350   PORT_START("P1")
327351   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
r4057r4058
399423INPUT_PORTS_END
400424
401425
402
403426static const gfx_layout charlayout =
404427{
405428   8,8,
r4057r4058
430453GFXDECODE_END
431454
432455
433
434456/* handler called by the 2203 emulator when the internal timers cause an IRQ */
435457static void irqhandler(running_machine *machine, int irq)
436458{
r4057r4058
447469   irqhandler
448470};
449471
450
451472static MACHINE_START( xsleena )
452473{
453   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
454   /* initialize the bank pointers */
455   xainCPUA_bankswitch_w(space,0,0);
456   xainCPUB_bankswitch_w(space,0,0);
474   memory_configure_bank(machine, 1, 0, 2, memory_region(machine, "main") + 0x4000, 0xc000);
475   memory_configure_bank(machine, 2, 0, 2, memory_region(machine, "sub")  + 0x4000, 0xc000);
476   memory_set_bank(machine, 1, 0);
477   memory_set_bank(machine, 2, 0);
457478}
458479
459
460480static MACHINE_DRIVER_START( xsleena )
461481
462482   /* basic machine hardware */
463   MDRV_CPU_ADD("main", M6809, 1500000)   /* Confirmed 1.5MHz */
483   MDRV_CPU_ADD("main", M6809, CPU_CLOCK)   /* Confirmed 1.5MHz */
464484   MDRV_CPU_PROGRAM_MAP(main_map,0)
465   MDRV_CPU_VBLANK_INT_HACK(xain_interrupt,256)
485   MDRV_TIMER_ADD_SCANLINE("scantimer", xain_scanline, "main", 0, 1)
466486
467   MDRV_CPU_ADD("sub", M6809, 1500000)   /* Confirmed 1.5MHz */
487   MDRV_CPU_ADD("sub", M6809, CPU_CLOCK)   /* Confirmed 1.5MHz */
468488   MDRV_CPU_PROGRAM_MAP(cpu_map_B,0)
469489
470   MDRV_CPU_ADD("audio", M6809, 1500000)   /* Confirmed 1.5MHz */
490   MDRV_CPU_ADD("audio", M6809, CPU_CLOCK)   /* Confirmed 1.5MHz */
471491   MDRV_CPU_PROGRAM_MAP(sound_map,0)
472492
473//  MDRV_CPU_ADD("mcu", M68705, 3000000)    /* Confirmed 3MHz */
493//  MDRV_CPU_ADD("mcu", M68705, MCU_CLOCK)    /* Confirmed 3MHz */
474494//  MDRV_CPU_PROGRAM_MAP(mcu_map,0)
475495
476496   MDRV_MACHINE_START(xsleena)
477497
478   MDRV_QUANTUM_TIME(HZ(6000))
498   MDRV_QUANTUM_PERFECT_CPU("main")
479499
480500   /* video hardware */
481501   MDRV_SCREEN_ADD("main", RASTER)
482   MDRV_SCREEN_REFRESH_RATE(57)
483   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
484502   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
485   MDRV_SCREEN_SIZE(32*8, 32*8)
486   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
503   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 8, 248)   /* based on ddragon driver */
487504
488505   MDRV_GFXDECODE(xain)
489506   MDRV_PALETTE_LENGTH(512)
r4057r4058
509526MACHINE_DRIVER_END
510527
511528
512
513529/***************************************************************************
514530
515531  Game driver(s)
r4057r4058
676692ROM_END
677693
678694
679
680695static DRIVER_INIT( xsleena )
681696{
682697   UINT8 *RAM = memory_region(machine, "main");
r4057r4058
704719}
705720
706721
707
708722GAME( 1986, xsleena,  0,       xsleena, xsleena, xsleena,  ROT0, "Technos", "Xain'd Sleena", 0 )
709723GAME( 1986, xsleenab, xsleena, xsleena, xsleena, 0,        ROT0, "bootleg", "Xain'd Sleena (bootleg)", 0 )
710724GAME( 1986, solarwar, xsleena, xsleena, xsleena, solarwar, ROT0, "[Technos] Taito (Memetron license)", "Solar-Warrior", 0 )
src/mame/drivers/galdrvr.c
r4057r4058
46554655   ROM_LOAD( "82s123.6e",    0x0000, 0x0020, CRC(9b87f90d) SHA1(d11ac5e4a6057301ea2a9cbb404c2b978eb4c1dc) )
46564656ROM_END
46574657
4658/*
4659    Lost Tomb
46584660
4661    CPU/Sound Board: A969
4662    Video Board:     A2048
4663*/
4664
46594665ROM_START( losttomb )
46604666   ROM_REGION( 0x10000, "main", 0 )
46614667   ROM_LOAD( "2c",           0x0000, 0x1000, CRC(d6176d2c) SHA1(bc2bf63ee8d3e376f155d218704ceb5adcdf8e54) )
r4057r4058
50395045GAME( 1981, frogg,    frogger,  galaxian, frogg,    frogg,    ROT90,  "bootleg", "Frog (Galaxian hardware)", GAME_SUPPORTS_SAVE )
50405046
50415047
5042/* Turtles based hardware */
5048/*
5049    Turtles based hardware
5050
5051    CPU/Video Board: KT-4108-2
5052    Sound Board:     KT-4108-1
5053*/
50435054GAME( 1981, turtles,  0,        turtles,  turtles,  turtles,  ROT90,  "[Konami] (Stern license)", "Turtles", GAME_SUPPORTS_SAVE )
50445055GAME( 1981, turpin,   turtles,  turtles,  turpin,   turtles,  ROT90,  "[Konami] (Sega license)", "Turpin", GAME_SUPPORTS_SAVE )
50455056GAME( 1981, 600,      turtles,  turtles,  turtles,  turtles,  ROT90,  "Konami", "600", GAME_SUPPORTS_SAVE )
src/mame/drivers/mrdo.c
r4057r4058
1616#include "cpu/z80/z80.h"
1717#include "sound/sn76496.h"
1818
19#define MAIN_CLOCK      XTAL_8MHz
20#define VIDEO_CLOCK      XTAL_20MHz
1921
22
2023extern UINT8 *mrdo_bgvideoram,*mrdo_fgvideoram;
2124WRITE8_HANDLER( mrdo_bgvideoram_w );
2225WRITE8_HANDLER( mrdo_fgvideoram_w );
r4057r4058
3942
4043
4144
42static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
43   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
44   AM_RANGE(0x8000, 0x8fff) AM_READ(SMH_RAM)   /* video and color RAM */
45static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
46   AM_RANGE(0x0000, 0x7fff) AM_ROM
47   AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(mrdo_bgvideoram_w) AM_BASE(&mrdo_bgvideoram)
48   AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(mrdo_fgvideoram_w) AM_BASE(&mrdo_fgvideoram)
49   AM_RANGE(0x9000, 0x90ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
50   AM_RANGE(0x9800, 0x9800) AM_WRITE(mrdo_flipscreen_w)   /* screen flip + playfield priority */
51   AM_RANGE(0x9801, 0x9801) AM_WRITE(sn76496_0_w)
52   AM_RANGE(0x9802, 0x9802) AM_WRITE(sn76496_1_w)
4553   AM_RANGE(0x9803, 0x9803) AM_READ(mrdo_SECRE_r)
4654   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("P1")
4755   AM_RANGE(0xa001, 0xa001) AM_READ_PORT("P2")
4856   AM_RANGE(0xa002, 0xa002) AM_READ_PORT("DSW1")
4957   AM_RANGE(0xa003, 0xa003) AM_READ_PORT("DSW2")
50   AM_RANGE(0xe000, 0xefff) AM_READ(SMH_RAM)
51ADDRESS_MAP_END
52
53static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
54   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
55   AM_RANGE(0x8000, 0x87ff) AM_WRITE(mrdo_bgvideoram_w) AM_BASE(&mrdo_bgvideoram)
56   AM_RANGE(0x8800, 0x8fff) AM_WRITE(mrdo_fgvideoram_w) AM_BASE(&mrdo_fgvideoram)
57   AM_RANGE(0x9000, 0x90ff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
58   AM_RANGE(0x9800, 0x9800) AM_WRITE(mrdo_flipscreen_w)   /* screen flip + playfield priority */
59   AM_RANGE(0x9801, 0x9801) AM_WRITE(sn76496_0_w)
60   AM_RANGE(0x9802, 0x9802) AM_WRITE(sn76496_1_w)
61   AM_RANGE(0xe000, 0xefff) AM_WRITE(SMH_RAM)
58   AM_RANGE(0xe000, 0xefff) AM_RAM
6259   AM_RANGE(0xf000, 0xf7ff) AM_WRITE(mrdo_scrollx_w)
6360   AM_RANGE(0xf800, 0xffff) AM_WRITE(mrdo_scrolly_w)
6461ADDRESS_MAP_END
r4057r4058
142139
143140static const gfx_layout charlayout =
144141{
145   8,8,   /* 8*8 characters */
146   512,   /* 512 characters */
147   2,   /* 2 bits per pixel */
148   { 0, 512*8*8 },   /* the two bitplanes are separated */
149   { 7, 6, 5, 4, 3, 2, 1, 0 },
150   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
151   8*8   /* every char takes 8 consecutive bytes */
142   8,8,
143   RGN_FRAC(1,2),
144   2,
145   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
146   { STEP8(7,-1) },
147   { STEP8(0,8) },
148   8*8
152149};
150
153151static const gfx_layout spritelayout =
154152{
155   16,16,   /* 16*16 sprites */
156   128,   /* 128 sprites */
157   2,   /* 2 bits per pixel */
158   { 4, 0 },   /* the two bitplanes for 4 pixels are packed into one byte */
159   { 3, 2, 1, 0, 8+3, 8+2, 8+1, 8+0,
160         16+3, 16+2, 16+1, 16+0, 24+3, 24+2, 24+1, 24+0 },
161   { 0*16, 2*16, 4*16, 6*16, 8*16, 10*16, 12*16, 14*16,
162         16*16, 18*16, 20*16, 22*16, 24*16, 26*16, 28*16, 30*16 },
163   64*8   /* every sprite takes 64 consecutive bytes */
153   16,16,
154   RGN_FRAC(1,1),
155   2,
156   { 4, 0 },
157   { STEP4(0*8+3,-1), STEP4(1*8+3,-1), STEP4(2*8+3,-1), STEP4(3*8+3,-1) },
158   { STEP16(0,32) },
159   64*8
164160};
165161
166
167
168162static GFXDECODE_START( mrdo )
169163   GFXDECODE_ENTRY( "gfx1", 0, charlayout,      0, 64 )   /* colors 0-255 directly mapped */
170164   GFXDECODE_ENTRY( "gfx2", 0, charlayout,      0, 64 )
r4057r4058
176170static MACHINE_DRIVER_START( mrdo )
177171
178172   /* basic machine hardware */
179   MDRV_CPU_ADD("main", Z80,8000000/2)   /* 4 MHz */
180   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
173   MDRV_CPU_ADD("main", Z80, MAIN_CLOCK/2)   /* 4 MHz */
174   MDRV_CPU_PROGRAM_MAP(main_map,0)
181175   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
182176
183177   /* video hardware */
184178   MDRV_SCREEN_ADD("main", RASTER)
185   MDRV_SCREEN_REFRESH_RATE(5000000.0/312/262)
186   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(4368))
187179   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
188   MDRV_SCREEN_SIZE(32*8, 32*8)
189   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 4*8, 28*8-1)
180   MDRV_SCREEN_RAW_PARAMS(VIDEO_CLOCK/4, 312, 8, 248, 262, 32, 224)
190181
191182   MDRV_GFXDECODE(mrdo)
192183   MDRV_PALETTE_LENGTH(64*4+16*4)
r4057r4058
198189   /* sound hardware */
199190   MDRV_SPEAKER_STANDARD_MONO("mono")
200191
201   MDRV_SOUND_ADD("sn1", SN76489, 4000000)
192   MDRV_SOUND_ADD("sn1", SN76489, MAIN_CLOCK/2)
202193   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
203194
204   MDRV_SOUND_ADD("sn2", SN76489, 4000000)
195   MDRV_SOUND_ADD("sn2", SN76489, MAIN_CLOCK/2)
205196   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
206197MACHINE_DRIVER_END
207198
r4057r4058
397388
398389
399390
400GAME( 1982, mrdo,     0,    mrdo, mrdo, 0, ROT270, "Universal", "Mr. Do!", 0 )
401GAME( 1982, mrdoy,    mrdo, mrdo, mrdo, 0, ROT270, "Universal", "Mr. Do! (prototype)" , 0)   /* aka "Yukidaruma" */
402GAME( 1982, mrdot,    mrdo, mrdo, mrdo, 0, ROT270, "Universal (Taito license)", "Mr. Do! (Taito)", 0 )
403GAME( 1982, mrdofix,  mrdo, mrdo, mrdo, 0, ROT270, "Universal (Taito license)", "Mr. Do! (bugfixed)", 0 )
404GAME( 1982, mrlo,     mrdo, mrdo, mrdo, 0, ROT270, "bootleg", "Mr. Lo!", 0 )
405GAME( 1982, mrdu,     mrdo, mrdo, mrdo, 0, ROT270, "bootleg", "Mr. Du!", 0 )
406GAME( 1982, yankeedo, mrdo, mrdo, mrdo, 0, ROT270, "hack", "Yankee DO!", 0 )
391GAME( 1982, mrdo,     0,    mrdo, mrdo, 0, ROT270, "Universal", "Mr. Do!", GAME_SUPPORTS_SAVE )
392GAME( 1982, mrdoy,    mrdo, mrdo, mrdo, 0, ROT270, "Universal", "Mr. Do! (prototype)" , GAME_SUPPORTS_SAVE )   /* aka "Yukidaruma" */
393GAME( 1982, mrdot,    mrdo, mrdo, mrdo, 0, ROT270, "Universal (Taito license)", "Mr. Do! (Taito)", GAME_SUPPORTS_SAVE )
394GAME( 1982, mrdofix,  mrdo, mrdo, mrdo, 0, ROT270, "Universal (Taito license)", "Mr. Do! (bugfixed)", GAME_SUPPORTS_SAVE )
395GAME( 1982, mrlo,     mrdo, mrdo, mrdo, 0, ROT270, "bootleg", "Mr. Lo!", GAME_SUPPORTS_SAVE )
396GAME( 1982, mrdu,     mrdo, mrdo, mrdo, 0, ROT270, "bootleg", "Mr. Du!", GAME_SUPPORTS_SAVE )
397GAME( 1982, yankeedo, mrdo, mrdo, mrdo, 0, ROT270, "hack", "Yankee DO!", GAME_SUPPORTS_SAVE )
src/mame/drivers/40love.c
r4057r4058
10201020
10211021/*******************************************************************************/
10221022
1023static MACHINE_START( 40love )
1024{
1025    state_save_register_global(machine, pix1);
1026    state_save_register_global_array(machine, pix2);
1027    state_save_register_global(machine, from_mcu);
1028    state_save_register_global(machine, mcu_cmd);
1029    state_save_register_global_array(machine, mcu_in[0]);
1030    state_save_register_global_array(machine, mcu_in[1]);
1031    state_save_register_global_array(machine, mcu_out[0]);
1032    state_save_register_global_array(machine, mcu_out[1]);
1033    state_save_register_global(machine, snd_data);
1034    state_save_register_global(machine, snd_flag);
1035    state_save_register_global_array(machine, vol_ctrl);
1036    state_save_register_global(machine, snd_ctrl0);
1037    state_save_register_global(machine, snd_ctrl1);
1038    state_save_register_global(machine, snd_ctrl2);
1039    state_save_register_global(machine, snd_ctrl3);
1040}
1041
10231042static MACHINE_DRIVER_START( 40love )
10241043
10251044   /* basic machine hardware */
r4057r4058
10511070   MDRV_VIDEO_START(fortyl)
10521071   MDRV_VIDEO_UPDATE(fortyl)
10531072
1073    MDRV_MACHINE_START(40love)
1074
10541075   /* sound hardware */
10551076   MDRV_SPEAKER_STANDARD_MONO("mono")
10561077
r4057r4058
11061127   MDRV_VIDEO_START(fortyl)
11071128   MDRV_VIDEO_UPDATE(fortyl)
11081129
1130    MDRV_MACHINE_START(40love)
1131
11091132   /* sound hardware */
11101133   MDRV_SPEAKER_STANDARD_MONO("mono")
11111134
r4057r4058
12471270   ROM_LOAD( "a17-18.23v", 0x0c00, 0x0400, CRC(3023a1da) SHA1(08ce4c6e99d04b358d66f0588852311d07183619) )   /* ??? */
12481271ROM_END
12491272
1250GAME( 1984, 40love,   0,        40love,   40love,   40love,   ROT0, "Taito Corporation", "Forty-Love", GAME_IMPERFECT_GRAPHICS )
1251GAME( 1984, fieldday, 0,        undoukai, undoukai, undoukai, ROT0, "Taito Corporation", "Field Day", 0 )
1252GAME( 1984, undoukai, fieldday, undoukai, undoukai, undoukai, ROT0, "Taito Corporation", "The Undoukai (Japan)", 0 )
1273GAME( 1984, 40love,   0,        40love,   40love,   40love,   ROT0, "Taito Corporation", "Forty-Love", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
1274GAME( 1984, fieldday, 0,        undoukai, undoukai, undoukai, ROT0, "Taito Corporation", "Field Day", GAME_SUPPORTS_SAVE )
1275GAME( 1984, undoukai, fieldday, undoukai, undoukai, undoukai, ROT0, "Taito Corporation", "The Undoukai (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/galaga.c
r4057r4058
19041904/**********************************************************************************************
19051905  Bosconian & clones
19061906**********************************************************************************************/
1907/*
19071908
1909Bosconian
1910Namco/Midway, 1981
1911
1912*/
1913
19081914#define BOSCO_CUSTOMS \
19091915   ROM_REGION_NAMCO_50XX( CPUTAG_50XX ) \
19101916   ROM_REGION_NAMCO_50XX( CPUTAG_50XX_2 ) \
r4057r4058
20362042   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
20372043ROM_END
20382044
2045/*
2046    Bosconian - Midway Version
2047
2048    CPU/Sound Board: A084-91412-B550
2049    Video Board:     A084-91413-B550
2050*/
2051
20392052ROM_START( boscomd )
20402053   ROM_REGION( 0x10000, "main", 0 )   /* 64k for code for the first CPU  */
20412054   ROM_LOAD( "3n",       0x0000, 0x1000, CRC(441b501a) SHA1(7b4921ff40b3c56950fd32aa0ec5563b02a00929) )
r4057r4058
20752088   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
20762089   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
20772090   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
2091
2092    ROM_REGION( 0x0001, "pal_vidbd", 0 ) /* PAL located on the video board */
2093    ROM_LOAD( "0066-005xx-xxqx.5a", 0x00000, 0x00001, NO_DUMP ) /* According to the manual it's a PAL. What type is unknown. */
20782094ROM_END
20792095
20802096ROM_START( boscomdo )
r4057r4058
21162132   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
21172133   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
21182134   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
2135
2136    ROM_REGION( 0x0001, "pal_vidbd", 0 ) /* PAL located on the video board */
2137    ROM_LOAD( "0066-005xx-xxqx.5a", 0x00000, 0x00001, NO_DUMP ) /* According to the manual it's a PAL. What type is unknown. */
21192138ROM_END
21202139
21212140/**********************************************************************************************
r4057r4058
25252544   ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \
25262545   ROM_REGION_NAMCO_51XX( "51xx" ) \
25272546
2547/*
2548    Xevious - Namco Version
2549
2550    Single/Dual Board?
2551*/
2552
25282553ROM_START( xevious )
25292554   ROM_REGION( 0x10000, "main", 0 )   /* 64k for the first CPU */
25302555   ROM_LOAD( "xvi_1.3p",     0x0000, 0x1000, CRC(09964dda) SHA1(4882b25b0938a903f3a367455ba788a30759b5b0) )
r4057r4058
25752600   ROM_LOAD( "xvi_1bpr.5n",  0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
25762601ROM_END
25772602
2603/*
2604    Xevious - Atari Version
2605
2606    CPU/Sound Board: A039785
2607    Video Board:     A039787
2608*/
2609
25782610ROM_START( xeviousa )
25792611   ROM_REGION( 0x10000, "main", 0 )   /* 64k for the first CPU */
25802612   ROM_LOAD( "xea-1m-a.bin", 0x0000, 0x2000, CRC(8c2b50ec) SHA1(f770873b711d838556dde67a8aac8a7f572fcc5b) )
r4057r4058
26172649   ROM_LOAD( "xvi_4bpr.3l",  0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
26182650   ROM_LOAD( "xvi_5bpr.3m",  0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
26192651
2652    ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */
2653    ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */
2654
26202655   ROM_REGION( 0x0200, "namco", 0 )   /* sound PROMs */
26212656   ROM_LOAD( "xvi_2bpr.7n",  0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
26222657   ROM_LOAD( "xvi_1bpr.5n",  0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
r4057r4058
26642699   ROM_LOAD( "xvi_4bpr.3l",  0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
26652700   ROM_LOAD( "xvi_5bpr.3m",  0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
26662701
2702    ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */
2703    ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */
2704
26672705   ROM_REGION( 0x0200, "namco", 0 )   /* sound PROMs */
26682706   ROM_LOAD( "xvi_2bpr.7n",  0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
26692707   ROM_LOAD( "xvi_1bpr.5n",  0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
r4057r4058
27142752   ROM_LOAD( "xvi_4bpr.3l",  0x0700, 0x0200, CRC(fd8b9d91) SHA1(87ddf0b9d723aabb422d6d416aa9ec6bc246bf34) ) /* sprite lookup table low bits */
27152753   ROM_LOAD( "xvi_5bpr.3m",  0x0900, 0x0200, CRC(bf906d82) SHA1(776168a73d3b9f0ce05610acc8a623deae0a572b) ) /* sprite lookup table high bits */
27162754
2755    ROM_REGION( 0x0001, "pals_vidbd", 0) /* PAL's located on the video board */
2756    ROM_LOAD( "137294-001.1f", 0x0000, 0x0001, NO_DUMP ) /* N82S153N */
2757
27172758   ROM_REGION( 0x0200, "namco", 0 )   /* sound PROMs */
27182759   ROM_LOAD( "xvi_2bpr.7n",  0x0000, 0x0100, CRC(550f06bc) SHA1(816a0fafa0b084ac11ae1af70a5186539376fc2a) )
27192760   ROM_LOAD( "xvi_1bpr.5n",  0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
27202761ROM_END
27212762
2763/*
2764    Xevious Bootleg
2765
2766    Single/Dual Board?
2767*/
2768
27222769ROM_START( xevios )
27232770   ROM_REGION( 0x10000, "main", 0 )   /* 64k for the first CPU */
27242771   ROM_LOAD( "4.7h",         0x0000, 0x1000, CRC(1f8ca4c0) SHA1(9fdaa2e0016c07e274544f8334778fe81b8344a5) )
r4057r4058
29643011   ROM_LOAD( "136007.109",   0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
29653012ROM_END
29663013
3014/*
3015    Dig Dug - Atari Version
3016
3017    There are two revisions of the board and the placement of the components
3018    are different between the two versions.
3019
3020    Revision A:
3021        * The letter "A" is silkscreened in the A10 corner of the board.
3022        * The 1st, 2nd and 3rd edition TM-203 and SP-203 manuals cover this board.
3023
3024    Revision B:
3025        * The letter "B" is silkscreened in the P12 corner (on right side of
3026          the edge connector).
3027        * Also, the three Z80's are located on the opposite side of the edge connector and
3028          they are stacked in a column.  (The Z80's are oriented vertically instead of
3029          horizontal as the other chips are.)
3030        * The 4th edition TM-203 and SP-203 manuals cover this board.
3031*/
3032
29673033ROM_START( digdugat )
29683034   ROM_REGION( 0x10000, "main", 0 )   /* 64k for code for the first CPU  */
29693035   ROM_LOAD( "136007.201",   0x0000, 0x1000, CRC(23d0b1a4) SHA1(a118d55e03a9ccf069f37c7bac2c9044dccd1f5e) )
r4057r4058
30463112   ROM_LOAD( "136007.109",   0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
30473113ROM_END
30483114
3115/*
3116    Zig Zag (Dig Dug bootleg)
3117*/
3118
30493119ROM_START( dzigzag )
30503120   ROM_REGION( 0x10000, "main", 0 )   /* 64k for code for the first CPU  */
30513121   ROM_LOAD( "136007.101",   0x0000, 0x1000, CRC(b9198079) SHA1(1d3fe04020f584ed250e32fdc6f6a3b769342884) )
r4057r4058
32793349GAME( 1982, digdugb,  digdug,  digdug,  digdug,   0,       ROT90, "Namco", "Dig Dug (rev 1)", GAME_SUPPORTS_SAVE )
32803350GAME( 1982, digdugat, digdug,  digdug,  digdug,   0,       ROT90, "[Namco] (Atari license)", "Dig Dug (Atari, rev 2)", GAME_SUPPORTS_SAVE )
32813351GAME( 1982, digduga1, digdug,  digdug,  digdug,   0,       ROT90, "[Namco] (Atari license)", "Dig Dug (Atari, rev 1)", GAME_SUPPORTS_SAVE )
3282GAME( 1982, digsid,   digdug,  digdug, digdug,    0,       ROT90, "Namco [Sidam license]", "Dig Dug (manufactured by Sidam)", GAME_SUPPORTS_SAVE )
3352GAME( 1982, digsid,   digdug,  digdug, digdug,   0,       ROT90, "Namco [Sidam license]", "Dig Dug (manufactured by Sidam)", GAME_SUPPORTS_SAVE )
32833353
32843354/* Bootlegs with replacement I/O chips */
32853355
src/mame/drivers/nbmj8688.c
r4057r4058
2525
2626- Screen flip is not perfect.
2727
28- Barline has wrong NMI enable trigger,causing wrong sample pitch (& sometimes
29  crashes when you soft reset)
30
2831******************************************************************************/
2932
3033#include "driver.h"
r4057r4058
271274   nb1413m3_type = NB1413M3_NIGHTLOV;
272275}
273276
277static DRIVER_INIT( barline )
278{
279   nb1413m3_type = NB1413M3_BARLINE;
280}
274281
275282static ADDRESS_MAP_START( readmem_mjsikaku, ADDRESS_SPACE_PROGRAM, 8 )
276283   AM_RANGE(0x0000, 0xf7ff) AM_READ(SMH_ROM)
r4057r4058
339346   AM_RANGE(0xf0, 0xf0) AM_WRITE(mjsikaku_scrolly_w)
340347ADDRESS_MAP_END
341348
349static WRITE8_HANDLER( barline_output_w )
350{
351   coin_lockout_w(0,~data & 0x80);
352   coin_counter_w(0,data & 0x02);
353}
354
355static ADDRESS_MAP_START( readport_barline, ADDRESS_SPACE_IO, 8 )
356   ADDRESS_MAP_GLOBAL_MASK(0xff)
357//  AM_RANGE(0x00, 0x7f) AM_READ(nb1413m3_sndrom_r)
358   AM_RANGE(0x80, 0x80) AM_READ(ym3812_status_port_0_r)
359   AM_RANGE(0x90, 0x90) AM_READ(nb1413m3_inputport0_r)
360   AM_RANGE(0xa0, 0xa0) AM_READ(nb1413m3_inputport1_r)
361   AM_RANGE(0xb0, 0xb0) AM_READ(nb1413m3_inputport2_r)
362   AM_RANGE(0xd0, 0xd0) AM_READ(ff_r)   // irq ack? watchdog?
363    AM_RANGE(0xf0, 0xf0) AM_READ(nb1413m3_dipsw1_r)
364   AM_RANGE(0xf1, 0xf1) AM_READ(nb1413m3_dipsw2_r)
365ADDRESS_MAP_END
366
367static ADDRESS_MAP_START( writeport_barline, ADDRESS_SPACE_IO, 8 )
368   ADDRESS_MAP_GLOBAL_MASK(0xff)
369   AM_RANGE(0x00, 0x00) AM_WRITE(nb1413m3_sndrombank1_w)
370   AM_RANGE(0x70, 0x70) AM_WRITE(nb1413m3_nmi_clock_w)
371   AM_RANGE(0x80, 0x80) AM_WRITE(ym3812_control_port_0_w)
372   AM_RANGE(0x81, 0x81) AM_WRITE(ym3812_write_port_0_w)
373   AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
374   AM_RANGE(0xa0, 0xa0) AM_WRITE(nb1413m3_inputportsel_w)
375   AM_RANGE(0xb0, 0xb0) AM_WRITE(barline_output_w)
376   AM_RANGE(0xc0, 0xcf) AM_WRITE(nbmj8688_clut_w)
377//  AM_RANGE(0xd0, 0xd0) AM_WRITE(DAC_0_WRITE) //not used
378   AM_RANGE(0xe0, 0xe0) AM_WRITE(secolove_romsel_w)
379   AM_RANGE(0xf0, 0xf0) AM_WRITE(mjsikaku_scrolly_w)
380ADDRESS_MAP_END
381
342382static ADDRESS_MAP_START( writeport_crystalg, ADDRESS_SPACE_IO, 8 )
343383   ADDRESS_MAP_GLOBAL_MASK(0xff)
344384   AM_RANGE(0x00, 0x00) AM_WRITE(nb1413m3_nmi_clock_w)
r4057r4058
443483   AM_RANGE(0xf0, 0xf0) AM_WRITE(mjsikaku_scrolly_w)
444484ADDRESS_MAP_END
445485
486static ADDRESS_MAP_START( writeport_mjgaiden, ADDRESS_SPACE_IO, 8 )
487    ADDRESS_MAP_GLOBAL_MASK(0xff)
488    AM_RANGE(0x00, 0x00) AM_WRITE(nb1413m3_nmi_clock_w)
489    AM_RANGE(0x20, 0x3f) AM_WRITE(nbmj8688_clut_w)
490    AM_RANGE(0x50, 0x50) AM_WRITE(mjsikaku_romsel_w)
491    AM_RANGE(0x90, 0x97) AM_WRITE(nbmj8688_blitter_w)
492    AM_RANGE(0x82, 0x82) AM_WRITE(ay8910_write_port_0_w)
493    AM_RANGE(0x83, 0x83) AM_WRITE(ay8910_control_port_0_w)
494    AM_RANGE(0xa0, 0xa0) AM_WRITE(nb1413m3_inputportsel_w)
495    AM_RANGE(0xb0, 0xb0) AM_WRITE(nb1413m3_sndrombank1_w)
496    AM_RANGE(0xd0, 0xd0) AM_WRITE(DAC_0_WRITE)
497    AM_RANGE(0xe0, 0xe0) AM_WRITE(mjsikaku_gfxflag2_w)
498    AM_RANGE(0xf0, 0xf0) AM_WRITE(mjsikaku_scrolly_w)
499ADDRESS_MAP_END
446500
447501static ADDRESS_MAP_START( writeport_p16bit_LCD, ADDRESS_SPACE_IO, 8 )
448502   ADDRESS_MAP_GLOBAL_MASK(0xff)
r4057r4058
12231277   PORT_INCLUDE( nbmjcontrols )
12241278INPUT_PORTS_END
12251279
1280static INPUT_PORTS_START( barline )
1281   PORT_START("DSWA")
1282   PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" )
1283   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1284   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1285   PORT_DIPNAME( 0x02, 0x02, "DIPSW 1-2" )
1286   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1287   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1288   PORT_DIPNAME( 0x04, 0x04, "DIPSW 1-3" )
1289   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1290   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1291   PORT_DIPNAME( 0x08, 0x08, "DIPSW 1-4" )
1292   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1293   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1294   PORT_DIPNAME( 0x10, 0x10, "DIPSW 1-5" )
1295   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1296   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1297   PORT_DIPNAME( 0x20, 0x20, "DIPSW 1-6" )
1298   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1299   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1300   PORT_DIPNAME( 0x40, 0x40, "DIPSW 1-7" )
1301   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1302   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1303   PORT_DIPNAME( 0x80, 0x80, "DIPSW 1-8" )
1304   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1305   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1306
1307   PORT_START("DSWB")
1308   PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" )
1309   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1310   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1311   PORT_DIPNAME( 0x02, 0x02, "DIPSW 2-2" )
1312   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1313   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1314   PORT_DIPNAME( 0x04, 0x04, "DIPSW 2-3" )
1315   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1316   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1317   PORT_DIPNAME( 0x08, 0x08, "DIPSW 2-4" )
1318   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1319   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1320   PORT_DIPNAME( 0x10, 0x10, "DIPSW 2-5" )
1321   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1322   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1323   PORT_DIPNAME( 0x20, 0x20, "DIPSW 2-6" )
1324   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1325   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1326   PORT_DIPNAME( 0x40, 0x40, "DIPSW 2-7" )
1327   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1328   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1329   PORT_DIPNAME( 0x80, 0x80, "DIPSW 2-8" )
1330   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1332
1333   PORT_START("SYSTEM")
1334   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(nb1413m3_busyflag_r, NULL)   // DRAW BUSY
1335   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )         //
1336   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 )      // MEMORY RESET
1337   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 )      // ANALYZER
1338   PORT_SERVICE( 0x10, IP_ACTIVE_LOW )               // TEST
1339   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 )         // COIN1
1340   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )         // CREDIT CLEAR
1341   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )      // SERVICE
1342
1343   PORT_START("KEY0")
1344   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P Stop 1") PORT_CODE(KEYCODE_Z)
1345   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("1P Stop 2") PORT_CODE(KEYCODE_X)
1346   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1P Stop 3") PORT_CODE(KEYCODE_C)
1347   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("1P Stop 4") PORT_CODE(KEYCODE_V)
1348   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("1P Start") PORT_CODE(KEYCODE_N)
1349   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_NAME("1P Bet") PORT_CODE(KEYCODE_B)
1350   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
1351
1352   PORT_START("KEY1")
1353   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_NAME("1P Flip Flop") PORT_CODE(KEYCODE_Q)
1354   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
1355
1356   PORT_START("KEY2")
1357   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1358
1359   PORT_START("KEY3")
1360   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1361
1362   PORT_START("KEY4")
1363   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1364
1365   PORT_START("KEY5")
1366   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_NAME("Double Up") PORT_CODE(KEYCODE_A)
1367   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_NAME("Big") PORT_CODE(KEYCODE_S)
1368   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_NAME("Small") PORT_CODE(KEYCODE_D)
1369   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_NAME("Take Score") PORT_CODE(KEYCODE_F)
1370   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start/Stop")
1371   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Push Bet")
1372   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
1373
1374   PORT_START("KEY6")
1375   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_R)
1376   PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
1377
1378   PORT_START("KEY7")
1379   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1380
1381   PORT_START("KEY8")
1382   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1383
1384   PORT_START("KEY9")
1385   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
1386INPUT_PORTS_END
1387
1388
12261389static INPUT_PORTS_START( citylove )
12271390   PORT_START("DSWA")
12281391   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Difficulty ) )
r4057r4058
28933056   MDRV_VIDEO_START(mbmj8688_hybrid_12bit)
28943057MACHINE_DRIVER_END
28953058
3059/*Same as h12bit HW with different sound HW + NMI enable bit*/
3060static MACHINE_DRIVER_START( barline )
28963061
3062   /* basic machine hardware */
3063   MDRV_IMPORT_FROM(mbmj_h12bit)
3064   MDRV_CPU_MODIFY("main")
3065   MDRV_CPU_IO_MAP(readport_barline, writeport_barline)
3066//  MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128)    // nmiclock = 60
3067
3068   MDRV_SOUND_REPLACE("8910", YM3812, 20000000/8)
3069   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
3070
3071   MDRV_SOUND_REMOVE("dac")
3072MACHINE_DRIVER_END
3073
28973074static MACHINE_DRIVER_START( mbmj_p16bit )
28983075
28993076   /* basic machine hardware */
r4057r4058
29703147//  MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128)    // nmiclock = 60
29713148MACHINE_DRIVER_END
29723149
3150static MACHINE_DRIVER_START( mjgaiden )
3151    /* basic machine hardware */
3152    MDRV_IMPORT_FROM(NBMJDRV_4096)
29733153
3154    MDRV_CPU_MODIFY("main")
3155    MDRV_CPU_PROGRAM_MAP(readmem_ojousan, writemem_ojousan)
3156    MDRV_CPU_IO_MAP(readport_secolove, writeport_mjgaiden)
3157MACHINE_DRIVER_END
3158
29743159static MACHINE_DRIVER_START( iemoto )
29753160
29763161   /* basic machine hardware */
r4057r4058
29923177//  MDRV_CPU_VBLANK_INT_HACK(nb1413m3_interrupt, 128)    // nmiclock = 60
29933178MACHINE_DRIVER_END
29943179
2995
29963180static MACHINE_DRIVER_START( mbmj_p12bit )
29973181
29983182   /* basic machine hardware */
r4057r4058
32883472   ROM_LOAD( "se1507.6a",    0x200000, 0x80000, CRC(f1e9555e) SHA1(a34ffcff2b2d6ba40a8a453b89970d636515a8ad) )   // seiha/se1507.6a
32893473ROM_END
32903474
3475/*
3476Mahjong Gaiden
3477(c)1987 Central Denshi
3478
3479CPU: Z80B
3480Sound: AY-3-8910
3481OSC: 5.000MHz
3482Custom: 1413M3
3483
3484ROMs:
34851.4G
34862.3G
34873.3I
34884.2I
34895.1I
3490W19.1A
3491W20.2A
3492W21.3A
3493W22.4A
3494W23.5A
3495
3496Subboard
34976.2A
34987.3A
34998.4A
35009.2B
350110.3B
3502
3503
3504dumped by sayu
3505--- Team Japump!!! ---
3506http://japump.i.am/
3507
3508*/
3509
3510/*
3511Is this a hack of Seiha or an officially licensed game? There are Seiha references in various places plus
3512it shares some gfx roms...
3513*/
3514ROM_START( mjgaiden )
3515    ROM_REGION( 0x30000, "main", 0 ) /* program */
3516    ROM_LOAD( "1.4g",      0x00000, 0x08000, CRC(6f54ab3d) SHA1(08fe565616de2e06141407c56b6de23014cfc56c) )
3517    ROM_LOAD( "2.3g",      0x08000, 0x08000, CRC(b4fed864) SHA1(a48300e586cb160fff903fb4203ee66418a81b3d) )
3518
3519    ROM_REGION( 0x40000, "voice", 0 ) /* voice */
3520    ROM_LOAD( "3.3i",   0x00000, 0x10000, CRC(2bcf3d87) SHA1(e768d112d7c314d1252c41793352bdca7a86f92e) )
3521    ROM_LOAD( "4.2i",   0x10000, 0x10000, CRC(2fc905d0) SHA1(add824681979c2eba42b199280a99f7ea063b18e) )
3522
3523   /*TODO: check if the w labeled roms are correctly mapped.*/
3524    ROM_REGION( 0x400000, "gfx1", 0 ) /* gfx */
3525    ROM_LOAD( "se1507.6a",0x000000, 0x80000, CRC(f1e9555e) SHA1(a34ffcff2b2d6ba40a8a453b89970d636515a8ad) ) // seiha/se1507.6a
3526    ROM_LOAD( "w19.1a",   0x080000, 0x40000, CRC(788cd3ca) SHA1(955a520e122aaee30e080d0a784556b69ba3de36) )
3527    ROM_LOAD( "w20.2a",   0x0c0000, 0x40000, CRC(a3175a8f) SHA1(8214fdefa1186dd96bc55a30b64a24a486750f05) )
3528    ROM_LOAD( "w21.3a",   0x100000, 0x40000, CRC(da46163e) SHA1(c6e5f59fe813915f94d81ff28526614c943b7082) )
3529    ROM_LOAD( "6.2a",     0x180000, 0x10000, CRC(9fefe2ca) SHA1(7b638a739640e9d311ee15c0e7b4f3f2dfdd3589) ) // seiha/seiha06.8a
3530    ROM_LOAD( "7.3a",     0x190000, 0x10000, CRC(a7d438ec) SHA1(5d145bab0ffc76fd77582ea5495ca4496210d41a) )            // seiha/seiha07.9a
3531    ROM_LOAD( "8.4a",     0x1a0000, 0x10000, CRC(e8e61e48) SHA1(e1d0e64b39bad3e294b061fb6f02ece2f2ee4bca) )
3532    ROM_LOAD( "9.2b",     0x1b0000, 0x10000, CRC(541f6e9f) SHA1(946a9c9cc8e6985098af4dd035f80ecc50e800ec) )            // seiha/seiha05.1i
3533    ROM_LOAD( "10.3b",    0x1c0000, 0x10000, CRC(a4144f78) SHA1(316ebe91aa604f1d4a0f1942df9d87de487c977a) )
3534    ROM_LOAD( "w22.4a",   0x200000, 0x40000, CRC(ea2b78b3) SHA1(38ec10a29f32cbb6b270fa10ade815cf3e0a54c2) )
3535    ROM_LOAD( "w23.5a",   0x240000, 0x40000, CRC(0263ff75) SHA1(16a18dfaf732ab94dec70fd8e955d6179525115c) )
3536ROM_END
3537
32913538ROM_START( bijokkoy )
32923539   ROM_REGION( 0x10000, "main", 0 ) /* program */
32933540   ROM_LOAD( "1.4c",   0x00000, 0x08000, CRC(7dec7ae1) SHA1(fd16a33342014b1c7400e278755ae68248134129) )
r4057r4058
38314078   ROM_LOAD( "ic3m.bin", 0x00000, 0x40000, CRC(ba005a3a) SHA1(305041f764b5ba9ffa882c1a69555a38a53b1556) )   // same as iemoto/iemoto31.1a gfx data
38324079ROM_END
38334080
4081ROM_START( barline )
4082   ROM_REGION( 0x10000, "main", 0 )
4083   ROM_LOAD( "16061_1h1r.c2", 0x00000, 0x10000, CRC(0a1d3e61) SHA1(652005181779e69c03f2b29e6aac2481321b8d06) )
38344084
4085   ROM_REGION( 0x100000, "gfx1", 0 )
4086   ROM_LOAD( "16061_2a.e9", 0x00000, 0x10000, CRC(53c1a339) SHA1(439bb1dc072be47233567ec9215384cb1959e2d4) )
4087   ROM_LOAD( "16061_2b.e10",0x10000, 0x10000, CRC(8126dac6) SHA1(45b7f2f0dd373847bdfe13c7f51b198ea409d70e) )
4088   ROM_LOAD( "16061_3a.f9", 0x20000, 0x10000, CRC(ceb17b22) SHA1(a7b72ec3e93bab6dcb5c480d812c0223b7e0acc1) )
4089   ROM_LOAD( "16061_3b.f10",0x30000, 0x10000, CRC(b269b85b) SHA1(a8f21f37b7dde7425fa1fd0264b3c67620ffcdaa) )
4090   ROM_LOAD( "16061_4a.g9", 0x40000, 0x10000, CRC(729dbf45) SHA1(8b5fbeacf45365d16546654525fe1e65ec781ece) )
4091   ROM_LOAD( "16061_4b.g10",0x50000, 0x10000, CRC(7c6946be) SHA1(5f236658073b3b3a54c82f0a973fb7a8c91a1e13) )
4092   ROM_LOAD( "16061_5a.h9", 0x60000, 0x10000, CRC(707ca3b9) SHA1(6a5d931bfbfeb7b6be038d3bdb982055c201335e) )
4093   ROM_LOAD( "16061_5b.h10",0x70000, 0x10000, CRC(6d83713e) SHA1(5548b75d07793a609e1b92bd385c77efff41e46d) )
4094   ROM_LOAD( "16061_6a.i9", 0x80000, 0x10000, CRC(79d93064) SHA1(ad07e22519064f6e952787e1ff072f769536cb2b) )
4095   ROM_LOAD( "16061_6b.i10",0x90000, 0x10000, CRC(e724d22f) SHA1(6810a4b0e4665d6773c55355607e85b4e3efe380) )
4096   ROM_LOAD( "16061_7a.j9", 0xa0000, 0x10000, CRC(49a5322c) SHA1(0037107833ece237b22a00793ac8a8562d57a3c5) )
4097   ROM_LOAD( "16061_7b.j10",0xb0000, 0x10000, CRC(cfbbe06b) SHA1(f251df0f102d2812a23ff99dbdbd832ba122d787) )
38354098
4099   ROM_REGION( 0x104, "pals", 0 )
4100   ROM_LOAD( "16061.c10",0x000, 0x104, CRC(f8a85391) SHA1(ac47909fd4ab8fa198b14b82c2619e82a79ae3ef) )
4101   ROM_LOAD( "16061.db", 0x000, 0x104, CRC(9c28c9c9) SHA1(7622f985fece66951a5d9d2e3a2b2c26d0980d26) )
4102   ROM_LOAD( "16061.g3", 0x000, 0x104, CRC(22579310) SHA1(33fe9ea70895e0233fa1c5a999d3c9e50031209c) )
4103   ROM_LOAD( "16061.k7", 0x000, 0x104, CRC(d25ccac8) SHA1(cfad5a4cd9609ac2461314d77a5e0cecd326c63b) )
4104ROM_END
38364105
38374106/* 8-bit palette */
38384107GAME( 1986, crystalg, 0,        crystalg,        crystalg, crystalg, ROT0, "Nichibutsu", "Crystal Gal (Japan 860512)", 0 )
r4057r4058
38444113GAME( 1986, citylove, 0,        mbmj_h12bit,     citylove, citylove, ROT0, "Nichibutsu", "City Love (Japan 860908)", 0 )
38454114GAME( 1986, mcitylov, citylove, mbmj_h12bit,     mcitylov, mcitylov, ROT0, "Nichibutsu", "City Love [BET] (Japan 860904)", 0 )
38464115GAME( 1986, secolove, 0,        mbmj_h12bit,     secolove, secolove, ROT0, "Nichibutsu", "Second Love (Japan 861201)", 0 )
4116GAME( 1986?,barline,  0,       barline,         barline,  barline,  ROT180, "Nichibutsu", "Barline (Japan?)",  GAME_IMPERFECT_SOUND )
38474117
38484118/* hybrid 16-bit palette */
3849GAME( 1987, seiha,    0,        seiha,           seiha,    seiha,    ROT0, "Nichibutsu", "Seiha (Japan 870725)", 0 )
3850GAME( 1987, seiham,   seiha,    seiha,           seiham,   seiham,   ROT0, "Nichibutsu", "Seiha [BET] (Japan 870723)", 0 )
3851GAME( 1987, iemoto,   0,        iemoto,          iemoto,   iemoto,   ROT0, "Nichibutsu", "Iemoto (Japan 871020)", 0 )
3852GAME( 1987, iemotom,  iemoto,   ojousan,         iemotom,  iemotom,  ROT0, "Nichibutsu", "Iemoto [BET] (Japan 871118)", 0 )
4119GAME( 1987, seiha,    0,        seiha,           seiha,    seiha,    ROT0, "Nichibutsu",     "Seiha (Japan 870725)", 0 )
4120GAME( 1987, seiham,   seiha,    seiha,           seiham,   seiham,   ROT0, "Nichibutsu",     "Seiha [BET] (Japan 870723)", 0 )
4121GAME( 1987, mjgaiden, 0,        mjgaiden,        ojousan,  ojousan,  ROT0, "Central Denshi", "Mahjong Gaiden [BET] (Japan 870803)", 0 )
4122GAME( 1987, iemoto,   0,        iemoto,          iemoto,   iemoto,   ROT0, "Nichibutsu",     "Iemoto (Japan 871020)", 0 )
4123GAME( 1987, iemotom,  iemoto,   ojousan,         iemotom,  iemotom,  ROT0, "Nichibutsu",     "Iemoto [BET] (Japan 871118)", 0 )
38534124GAME( 1987, ryuuha,   iemoto,   ojousan,         ryuuha,   ryuuha,   ROT0, "Central Denshi", "Ryuuha [BET] (Japan 871027)", 0 )
3854GAME( 1987, ojousan,  0,        ojousan,         ojousan,  ojousan,  ROT0, "Nichibutsu", "Ojousan (Japan 871204)", 0 )
3855GAME( 1987, ojousanm, ojousan,  ojousan,         ojousanm, ojousanm, ROT0, "Nichibutsu", "Ojousan [BET] (Japan 870108)", 0 )
3856GAME( 1988, korinai,  0,        ojousan,         korinai,  korinai,  ROT0, "Nichibutsu", "Mahjong-zukino Korinai Menmen (Japan 880425)", 0 )
3857GAME( 1988, korinaim, korinai,  ojousan,         korinaim, korinaim, ROT0, "Nichibutsu", "Mahjong-zukino Korinai Menmen [BET] (Japan 880920)", 0 )
4125GAME( 1987, ojousan,  0,        ojousan,         ojousan,  ojousan,  ROT0, "Nichibutsu",     "Ojousan (Japan 871204)", 0 )
4126GAME( 1987, ojousanm, ojousan,  ojousan,         ojousanm, ojousanm, ROT0, "Nichibutsu",     "Ojousan [BET] (Japan 870108)", 0 )
4127GAME( 1988, korinai,  0,        ojousan,         korinai,  korinai,  ROT0, "Nichibutsu",     "Mahjong-zukino Korinai Menmen (Japan 880425)", 0 )
4128GAME( 1988, korinaim, korinai,  ojousan,         korinaim, korinaim, ROT0, "Nichibutsu",     "Mahjong-zukino Korinai Menmen [BET] (Japan 880920)", 0 )
38584129
38594130/* pure 16-bit palette (+ LCD in some) */
38604131GAME( 1987, housemnq, 0,        mbmj_p16bit_LCD, housemnq, housemnq, ROT0, "Nichibutsu", "House Mannequin (Japan 870217)", 0 )
r4057r4058
38844155GAME( 1988, mjcamera, 0,        otonano,         mjcamera, mjcamera, ROT0, "MIKI SYOUJI", "Mahjong Camera Kozou (set 1) (Japan 881109)", 0 )
38854156
38864157
3887
38884158/*
38894159
38904160iemotom     outcoin check
src/mame/drivers/1943.c
r4057r4058
458458
459459/* Game Drivers */
460460
461GAME( 1987, 1943,     0,        1943,     1943,     0, ROT270, "Capcom", "1943: The Battle of Midway (US)", 0 )
462GAME( 1987, 1943j,    1943,     1943,     1943,     0, ROT270, "Capcom", "1943: Midway Kaisen (Japan)", 0 )
463GAME( 1987, 1943kai,  0,        1943,     1943,     0, ROT270, "Capcom", "1943 Kai: Midway Kaisen (Japan)", 0 )
461GAME( 1987, 1943,     0,        1943,     1943,     0, ROT270, "Capcom", "1943: The Battle of Midway (US)", GAME_SUPPORTS_SAVE )
462GAME( 1987, 1943j,    1943,     1943,     1943,     0, ROT270, "Capcom", "1943: Midway Kaisen (Japan)", GAME_SUPPORTS_SAVE )
463GAME( 1987, 1943kai,  0,        1943,     1943,     0, ROT270, "Capcom", "1943 Kai: Midway Kaisen (Japan)", GAME_SUPPORTS_SAVE )
src/mame/drivers/jack.c
r4057r4058
815815static const gfx_layout charlayout =
816816{
817817   8,8,   /* 8*8 characters */
818   1024,   /* 1024 characters */
818   RGN_FRAC(1,2),   /* 1024 characters */
819819   2,   /* 2 bits per pixel */
820   { 0, 1024*8*8 },   /* the two bitplanes are seperated */
820   { RGN_FRAC(0,2), RGN_FRAC(1,2) },   /* the two bitplanes are seperated */
821821   { 0, 1, 2, 3, 4, 5, 6, 7 },
822822   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
823823   8*8   /* every char takes 16 bytes */
r4057r4058
13081308   ROM_LOAD( "snd.5a",       0x0000, 0x1000, CRC(b7ddf84f) SHA1(fa4cc0b2e5a88c82c62492c03e97ac6aa8a905b1) )
13091309
13101310   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
1311   ROM_LOAD( "chr0.1a",      0x0000, 0x1000, CRC(8f60229b) SHA1(96a888ae02797a205e1c6202395d3b42a820ad4d) )
1311   ROM_LOAD( "chr3.5a",      0x0000, 0x1000, CRC(8f982a9c) SHA1(dd6f454dfd3e03d008080890881cfafd79758a40) )
13121312   ROM_LOAD( "chr2.4a",      0x1000, 0x1000, CRC(8f982a9c) SHA1(dd6f454dfd3e03d008080890881cfafd79758a40) )
1313   ROM_LOAD( "chr3.5a",      0x2000, 0x1000, CRC(8f982a9c) SHA1(dd6f454dfd3e03d008080890881cfafd79758a40) )
1314   ROM_LOAD( "chr1.2a",      0x3000, 0x1000, CRC(7ad4358e) SHA1(dd3a03c78fa8bf435e9905b901dc5a9987cd52e4) )
1313   ROM_LOAD( "chr1.2a",      0x2000, 0x1000, CRC(7ad4358e) SHA1(dd3a03c78fa8bf435e9905b901dc5a9987cd52e4) )
1314   ROM_LOAD( "chr0.1a",      0x3000, 0x1000, CRC(8f60229b) SHA1(96a888ae02797a205e1c6202395d3b42a820ad4d) )
13151315
13161316   ROM_REGION( 0x80000, "user1", ROMREGION_ERASEFF ) /* Question roms */
13171317   ROM_LOAD( "rom.u6",       0x00000, 0x8000, CRC(a32d7a28) SHA1(fbad0b5c9f1dbeb4f245a2198248c18ceae556fa) )
r4057r4058
14571457GAME( 1981, tripoola, tripool,  tripool, tripool,  jack,     ROT90, "Noma (Costal Games license)", "Tri-Pool (Costal Games)", 0 )
14581458GAME( 1986, joinem,   0,        joinem,  joinem,   zzyzzyxx, ROT90, "Global Corporation", "Joinem", 0 )
14591459GAME( 1983, loverboy, 0,        loverboy,loverboy, loverboy, ROT90, "G.T Enterprise Inc", "Lover Boy", 0 )
1460GAME( 1985, striv,    0,        jack,    striv,    striv,    ROT270,"Hara Industries", "Super Triv", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_COLORS )
1460GAME( 1985, striv,    0,        jack,    striv,    striv,    ROT270,"Hara Industries", "Super Triv", GAME_IMPERFECT_SOUND )
14611461
src/mame/drivers/esripsys.c
r0r4058
1/***************************************************************************
2
3    Entertainment Sciences Real-Time Image Processor (RIP) hardware
4
5    driver by Phil Bennett
6
7    Games supported:
8        * Turbo Sub [2 sets]
9
10    ROMs wanted:
11        * Bouncer
12        * Turbo Sub [later version] (uses 512kbit graphics ROMs)
13
14    Notes:
15        * 'turbosub' executes a series of hardware tests on startup.
16        To skip, hold down keypad '*' on reset.
17        * Hold '*' during the game to access the operator menu.
18
19    Todo:
20        * TMS5220 speech. The game is sending speech play commands to
21        the sound CPU but any speech code greater than 2 is ignored (see $EC26).
22        I think most of the speech data is stored in the upper half of the
23        banked sound data ROMs but I don't know how or when the ROM
24        bank is switched :/
25
26        * Determine if line drop outs occur on real hardware. Overclocking
27        the RIP CPU eliminates them.
28
29        * Implement collision detection hardware (not used by Turbo Sub).
30
31****************************************************************************/
32
33#include "driver.h"
34#include "cpu/m6809/m6809.h"
35#include "cpu/esrip/esrip.h"
36#include "machine/6840ptm.h"
37#include "sound/dac.h"
38#include "sound/5220intf.h"
39#include "esripsys.h"
40
41
42/*************************************
43 *
44 *  Statics
45 *
46 *************************************/
47
48/* I/O */
49static UINT8 g_iodata;
50static UINT8 g_ioaddr;
51static UINT8 coin_latch;
52static UINT8 keypad_status;
53static UINT8 g_status;
54static UINT8 f_status;
55static int io_firq_status;
56static UINT8 cmos_ram_a2_0;
57static UINT8 cmos_ram_a10_3;
58static UINT8 *cmos_ram;
59
60/* Sound */
61static UINT8 u56a;
62static UINT8 u56b;
63static UINT8 g_to_s_latch1;
64static UINT8 g_to_s_latch2;
65static UINT8 s_to_g_latch1;
66static UINT8 s_to_g_latch2;
67static UINT8 dac_msb;
68static UINT8 dac_vol;
69static UINT8 tms_data;
70
71/* Frame/Video CPU shared RAM */
72static UINT8 *fdt_a;
73static UINT8 *fdt_b;
74static int _fasel = 0;
75static int _fbsel = 1;
76
77
78/*************************************
79 *
80 *  6840 PTM
81 *
82 *************************************/
83
84static void ptm_irq(running_machine *machine, int state)
85{
86   cpu_set_input_line(machine->cpu[ESRIPSYS_SOUND_CPU], M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
87}
88
89static const ptm6840_interface ptm_intf =
90{
91   XTAL_8MHz / 4,
92   { 0, 0, 0 },
93   { NULL, NULL, NULL },
94   ptm_irq
95};
96
97
98/*************************************
99 *
100 *  i8251A UART
101 *
102 *************************************/
103
104/* Note: Game CPU /FIRQ is connected to RXRDY */
105static WRITE8_HANDLER( uart_w )
106{
107   if ((offset & 1) == 0)
108      mame_printf_debug("%c",data);
109}
110
111static READ8_HANDLER( uart_r )
112{
113   return 0;
114}
115
116
117/*************************************
118 *
119 *  Game CPU Status Ports
120 *
121 *************************************/
122
123/*
124    Write                   Read
125    =====                   ====
126    0: ROM bank bit 0       0: Frame CPU status D0
127    1: ROM bank bit 1       1: Frame CPU status D1
128    2: -                    2: Frame CPU status D2
129    3: Bank sel enable?     3: Frame CPU status D3
130    4: Frame CPU /FIRQ      4: -
131    5: /INTACK              5: Frame CPU status D5
132    6: -                    6: RIP BANK 4
133    7: Frame CPU /NMI       7: /VBLANK
134*/
135
136static READ8_HANDLER( g_status_r )
137{
138   int bank4 = BIT(get_rip_status(space->machine->cpu[ESRIPSYS_VIDEO_CPU]), 2);
139   int vblank = video_screen_get_vblank(space->machine->primary_screen);
140
141   return (!vblank << 7) | (bank4 << 6) | (f_status & 0x2f);
142}
143
144static WRITE8_HANDLER( g_status_w )
145{
146   int bankaddress;
147   UINT8* const ROM = memory_region(space->machine, "game_cpu");
148
149   g_status = data;
150
151   bankaddress = 0x10000 + (data & 0x03) * 0x10000;
152   memory_set_bankptr(space->machine, 1, &ROM[bankaddress]);
153
154   cpu_set_input_line(space->machine->cpu[ESRIPSYS_FRAME_CPU], M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
155   cpu_set_input_line(space->machine->cpu[ESRIPSYS_FRAME_CPU], INPUT_LINE_NMI,  data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
156
157   cpu_set_input_line(space->machine->cpu[ESRIPSYS_VIDEO_CPU], INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
158
159   /* /VBLANK IRQ acknowledge */
160   if (!(data & 0x20))
161      cpu_set_input_line(space->machine->cpu[ESRIPSYS_GAME_CPU], M6809_IRQ_LINE, CLEAR_LINE);
162}
163
164
165/*************************************
166 *
167 *  Frame CPU Status Ports
168 *
169 *************************************/
170
171/*
172    Write                       Read
173    =====                       ====
174    0: Game CPU status in D0    0: /ERROR (AM29116)
175    1: Game CPU status in D1    1: /IPT UPLOAD (AM29116)
176    2: Game CPU status in D2    2: -
177    3: Game CPU status in D3    3: RER0 (AM29116)
178    4: -                        4: RER1 (AM29116)
179    5: Game CPU status in D5    5: VBLANK flag (cleared on FRAME write)
180    6: -                        6: /FBSEL
181    7: /FRDONE                  7: /VBLANK
182*/
183
184static READ8_HANDLER( f_status_r )
185{
186   int vblank = video_screen_get_vblank(space->machine->primary_screen);
187   UINT8 rip_status = get_rip_status(space->machine->cpu[ESRIPSYS_VIDEO_CPU]);
188
189   rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) |  BIT(rip_status, 7);
190
191   return (!vblank << 7) | (_fbsel << 6) | (esripsys_frame_vbl << 5) | rip_status;
192}
193
194static WRITE8_HANDLER( f_status_w )
195{
196   f_status = data;
197}
198
199
200/*************************************
201 *
202 *  Frame CPU Functions
203 *
204 *************************************/
205
206static TIMER_CALLBACK( delayed_bank_swap )
207{
208   _fasel ^= 1;
209   _fbsel ^= 1;
210}
211
212static WRITE8_HANDLER( frame_w )
213{
214   timer_call_after_resynch(space->machine, NULL, 0, delayed_bank_swap);
215   esripsys_frame_vbl = 1;
216}
217
218static READ8_HANDLER( fdt_r )
219{
220   if (!_fasel)
221      return fdt_b[offset];
222   else
223      return fdt_a[offset];
224}
225
226static WRITE8_HANDLER( fdt_w )
227{
228   if (!_fasel)
229      fdt_b[offset] = data;
230   else
231      fdt_a[offset] = data;
232}
233
234
235/*************************************
236 *
237 *  Video CPU Functions
238 *
239 *************************************/
240
241READ16_DEVICE_HANDLER( fdt_rip_r )
242{
243   offset = (offset & 0x7ff) << 1;
244
245   if (!_fasel)
246      return (fdt_a[offset] << 8) | fdt_a[offset + 1];
247   else
248      return (fdt_b[offset] << 8) | fdt_b[offset + 1];
249}
250
251WRITE16_DEVICE_HANDLER( fdt_rip_w )
252{
253   offset = (offset & 0x7ff) << 1;
254
255   if (!_fasel)
256   {
257      fdt_a[offset + 0] = data >> 8;
258      fdt_a[offset + 1] = data & 0xff;
259   }
260   else
261   {
262      fdt_b[offset + 0] = data >> 8;
263      fdt_b[offset + 1] = data & 0xff;
264   }
265}
266
267/*
268   D0 = /VBLANK
269   D1 = /HBLANK
270   D2 = 1/2SEL
271   D3 = /FIG
272   D4 = /FBSEL
273   D5 = VO
274   D6 =
275   D7 = /FDONE
276*/
277
278UINT8 rip_status_in(running_machine *machine)
279{
280   UINT8 _vblank = !video_screen_get_vblank(machine->primary_screen);
281   UINT8 _hblank = !video_screen_get_hblank(machine->primary_screen);
282   UINT8 v0 =  video_screen_get_vpos(machine->primary_screen) & 1;
283
284   return   _vblank
285         | (_hblank << 1)
286         | (esripsys__12sel << 2)
287         | (_fbsel << 4)
288         | (v0 << 5)
289         | (f_status & 0x80);
290}
291
292/*************************************
293 *
294 *  I/O
295 *
296 *************************************/
297
298static WRITE8_HANDLER( g_iobus_w )
299{
300   g_iodata = data;
301}
302
303static READ8_HANDLER( g_iobus_r )
304{
305   switch (g_ioaddr & 0x7f)
306   {
307      case 0:
308         return s_to_g_latch2 & 0x3f;
309      case 3:
310         return s_to_g_latch1;
311      case 5:
312         return cmos_ram[(cmos_ram_a10_3 << 3) | (cmos_ram_a2_0 & 3)];
313      case 8:
314      {
315         int keypad = input_port_read(space->machine, "KEYPAD_B") | keypad_status;
316         keypad_status = 0;
317         io_firq_status = 0;
318         return keypad;
319      }
320      case 9:
321      {
322         return input_port_read(space->machine, "KEYPAD_A");
323      }
324      case 0xa:
325      {
326         int coins =  coin_latch | (input_port_read(space->machine, "COINS") & 0x30);
327         coin_latch = 0;
328         io_firq_status = 0;
329         return coins;
330      }
331      case 0x10:
332         return input_port_read(space->machine, "IO_1");
333      case 0x11:
334         return input_port_read(space->machine, "JOYSTICK_X");
335      case 0x12:
336         return input_port_read(space->machine, "JOYSTICK_Y");
337      case 0x16:
338         return io_firq_status;
339      case 0x18:
340         return input_port_read(space->machine, "IO_2");
341         /* Unused I/O */
342      case 0x19:
343      case 0x1a:
344         return 0xff;
345      case 0x50:
346      case 0x51:
347      case 0x52:
348      case 0x53:
349      case 0x54:
350      case 0x55:
351      case 0x56:
352      case 0x57:
353      case 0x58:
354      case 0x59:
355      case 0x5a:
356      case 0x5b:
357      case 0x5c:
358      case 0x5d:
359      case 0x5e:
360         /* MSM5832 real-time clock/calendar */
361         return 0xff;
362      default:
363      {
364         logerror("Unknown I/O read (%x)\n", g_ioaddr & 0x7f);
365         return 0xff;
366      }
367   }
368}
369
370static WRITE8_HANDLER( g_ioadd_w )
371{
372   g_ioaddr = data;
373
374   /* Bit 7 is connected to /OE of LS374 containing I/O data */
375   if ((data & 0x80) == 0)
376   {
377      switch (g_ioaddr & 0x7f)
378      {
379         case 0x00:
380         {
381            g_to_s_latch1 = g_iodata;
382            break;
383         }
384         case 0x02:
385         {
386            cpu_set_input_line(space->machine->cpu[ESRIPSYS_SOUND_CPU], INPUT_LINE_NMI, g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE);
387
388            if (!(g_to_s_latch2 & 1) && (g_iodata & 1))
389            {
390               /* Rising D0 will clock in 1 to FF1... */
391               u56a = 1;
392
393               /*...causing a sound CPU /IRQ */
394               cpu_set_input_line(space->machine->cpu[ESRIPSYS_SOUND_CPU], M6809_IRQ_LINE, ASSERT_LINE);
395            }
396
397            if (g_iodata & 2)
398               u56b = 0;
399
400            g_to_s_latch2 = g_iodata;
401
402            break;
403         }
404         case 0x04:
405         {
406            cmos_ram[(cmos_ram_a10_3 << 3) | (cmos_ram_a2_0 & 3)] = g_iodata;
407            break;
408         }
409         case 0x06:
410         {
411            cmos_ram_a10_3 = g_iodata;
412            break;
413         }
414         case 0x07:
415         {
416            cmos_ram_a2_0 = g_iodata;
417            break;
418         }
419         case 0x0b:
420         {
421            /* Possibly I/O acknowledge; see FIRQ */
422            break;
423         }
424         case 0x14:
425         {
426            break;
427         }
428         case 0x15:
429         {
430            esripsys_video_firq_en = g_iodata & 1;
431            break;
432         }
433         default:
434         {
435            logerror("Unknown I/O write to %x with %x\n", g_ioaddr, g_iodata);
436         }
437      }
438   }
439}
440
441static INPUT_CHANGED( keypad_interrupt )
442{
443   if (newval == 0)
444   {
445      io_firq_status |= 2;
446      keypad_status |= 0x20;
447      cpu_set_input_line(field->port->machine->cpu[ESRIPSYS_GAME_CPU], M6809_FIRQ_LINE, HOLD_LINE);
448   }
449}
450
451static INPUT_CHANGED( coin_interrupt )
452{
453   if (newval == 1)
454   {
455      io_firq_status |= 2;
456      coin_latch = input_port_read(field->port->machine, "COINS") << 2;
457      cpu_set_input_line(field->port->machine->cpu[ESRIPSYS_GAME_CPU], M6809_FIRQ_LINE, HOLD_LINE);
458   }
459}
460
461/*************************************
462 *
463 *  Port definitions
464 *
465 *************************************/
466
467INPUT_PORTS_START( turbosub )
468   PORT_START("KEYPAD_A")
469   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Keypad 0") PORT_CHANGED(keypad_interrupt, 0)
470   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("Keypad 1") PORT_CHANGED(keypad_interrupt, 0)
471   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Keypad 2") PORT_CHANGED(keypad_interrupt, 0)
472   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("Keypad 3") PORT_CHANGED(keypad_interrupt, 0)
473   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Keypad 4") PORT_CHANGED(keypad_interrupt, 0)
474   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON6 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Keypad 5") PORT_CHANGED(keypad_interrupt, 0)
475
476   PORT_START("KEYPAD_B")
477   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON7 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Keypad 6") PORT_CHANGED(keypad_interrupt, 0)
478   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON8 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Keypad 7") PORT_CHANGED(keypad_interrupt, 0)
479   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON9 )  PORT_PLAYER(3) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Keypad 8") PORT_CHANGED(keypad_interrupt, 0)
480   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_PLAYER(3) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("Keypad 9") PORT_CHANGED(keypad_interrupt, 0)
481   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_PLAYER(3) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME("Keypad *") PORT_CHANGED(keypad_interrupt, 0)
482
483   PORT_START("COINS")
484   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
485   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_CHANGED(coin_interrupt, 0)
486   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED(coin_interrupt, 0)
487   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
488
489   PORT_START("IO_1")
490   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
491   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
492   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Neutralizer")
493   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Fire")
494   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
495   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
496   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
497   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
498
499   /* Mirror of IO_1 (unused) */
500   PORT_START("IO_2")
501   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
502
503   PORT_START("JOYSTICK_X")
504   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_MINMAX(0xff, 0x00) PORT_SENSITIVITY(25) PORT_KEYDELTA(200)
505
506   PORT_START("JOYSTICK_Y")
507   PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_MINMAX(0xff, 0x00) PORT_SENSITIVITY(25) PORT_KEYDELTA(200)
508INPUT_PORTS_END
509
510
511/*************************************
512 *
513 *  Sound
514 *
515 *************************************/
516
517/* Game/Sound CPU communications */
518static READ8_HANDLER( s_200e_r )
519{
520   return g_to_s_latch1;
521}
522
523static WRITE8_HANDLER( s_200e_w )
524{
525   s_to_g_latch1 = data;
526}
527
528static WRITE8_HANDLER( s_200f_w )
529{
530   /* Bit 6 -> Reset latch U56A */
531   /* Bit 7 -> Clock latch U56B */
532
533   if (s_to_g_latch2 & 0x40)
534   {
535      u56a = 0;
536      cpu_set_input_line(space->machine->cpu[ESRIPSYS_SOUND_CPU], M6809_IRQ_LINE, CLEAR_LINE);
537   }
538
539   if (!(s_to_g_latch2 & 0x80) && (data & 0x80))
540      u56b = 1;
541
542   s_to_g_latch2 = data;
543}
544
545static READ8_HANDLER( s_200f_r )
546{
547   return (g_to_s_latch2 & 0xfc) | (u56b << 1) | u56a;
548}
549
550static READ8_HANDLER( tms5220_r )
551{
552   if (offset == 0)
553   {
554      /* TMS5220 core returns status bits in D7-D6 */
555      UINT8 status = tms5220_status_r(space, 0);
556
557      status = (status & 0x80 >> 5) | (status & 0x40 >> 5) | (status & 0x20 >> 5);
558      return (!tms5220_ready_r() << 7) | (!tms5220_int_r() << 6) | status;
559   }
560
561   return 0xff;
562}
563
564/* TODO: Implement correctly using the state PROM */
565static WRITE8_HANDLER( tms5220_w )
566{
567   if (offset == 0)
568   {
569      if (tms5220_ready_r())
570         tms5220_status_r(space, 0);
571
572      tms_data = data;
573   }
574   if (offset == 1)
575   {
576      if (tms5220_ready_r())
577         tms5220_data_w(0, 0, tms_data);
578   }
579}
580
581/* Not used in later revisions */
582static WRITE8_HANDLER( control_w )
583{
584   logerror("Sound control write: %.2x (PC:0x%.4x)\n", data, cpu_get_previouspc(space->cpu));
585}
586
587
588/* 10-bit MC3410CL DAC */
589static WRITE8_HANDLER( dac_w )
590{
591   if (offset == 0)
592   {
593      dac_msb = data & 3;
594   }
595   else
596   {
597      UINT16 dac_data = (dac_msb << 8) | data;
598
599      /*
600            The 8-bit DAC modulates the 10-bit DAC.
601            Shift down to prevent clipping.
602        */
603      dac_signed_data_16_w(0, (dac_vol * dac_data) >> 1);
604   }
605}
606
607/* 8-bit MC3408 DAC */
608static WRITE8_HANDLER( volume_dac_w )
609{
610   dac_vol = data;
611}
612
613
614/*************************************
615 *
616 *  Memory Maps
617 *
618 *************************************/
619
620static ADDRESS_MAP_START( game_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
621   AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE(1)
622   AM_RANGE(0x4000, 0x42ff) AM_RAM AM_BASE(&esripsys_pal_ram)
623   AM_RANGE(0x4300, 0x4300) AM_WRITE(esripsys_bg_intensity_w)
624   AM_RANGE(0x4400, 0x47ff) AM_NOP /* Collision detection RAM */
625   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(g_status_r, g_status_w)
626   AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(g_iobus_r, g_iobus_w)
627   AM_RANGE(0x5000, 0x53ff) AM_WRITE(g_ioadd_w)
628   AM_RANGE(0x5400, 0x57ff) AM_NOP
629   AM_RANGE(0x5c00, 0x5fff) AM_READWRITE(uart_r, uart_w)
630   AM_RANGE(0x6000, 0xdfff) AM_ROMBANK(1)
631   AM_RANGE(0xe000, 0xffff) AM_ROM
632ADDRESS_MAP_END
633
634
635static ADDRESS_MAP_START( frame_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
636   AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE(1)
637   AM_RANGE(0x4000, 0x4fff) AM_READWRITE(fdt_r, fdt_w)
638   AM_RANGE(0x6000, 0x6000) AM_READWRITE(f_status_r, f_status_w)
639   AM_RANGE(0x8000, 0x8000) AM_WRITE(frame_w)
640   AM_RANGE(0xc000, 0xffff) AM_ROM
641ADDRESS_MAP_END
642
643
644static ADDRESS_MAP_START( sound_cpu_map, ADDRESS_SPACE_PROGRAM, 8 )
645   AM_RANGE(0x0000, 0x07ff) AM_RAM
646   AM_RANGE(0x0800, 0x0fff) AM_RAM /* Not installed on later PCBs */
647   AM_RANGE(0x2008, 0x2009) AM_READWRITE(tms5220_r, tms5220_w)
648   AM_RANGE(0x200a, 0x200b) AM_WRITE(dac_w)
649   AM_RANGE(0x200c, 0x200c) AM_WRITE(volume_dac_w)
650   AM_RANGE(0x200d, 0x200d) AM_WRITE(control_w)
651   AM_RANGE(0x200e, 0x200e) AM_READWRITE(s_200e_r, s_200e_w)
652   AM_RANGE(0x200f, 0x200f) AM_READWRITE(s_200f_r, s_200f_w)
653   AM_RANGE(0x2020, 0x2027) AM_READWRITE(ptm6840_0_r, ptm6840_0_w)
654   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK(2)
655   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(3)
656   AM_RANGE(0xc000, 0xdfff) AM_ROMBANK(4)
657   AM_RANGE(0xe000, 0xffff) AM_ROM
658ADDRESS_MAP_END
659
660
661static ADDRESS_MAP_START( video_cpu_map, ADDRESS_SPACE_PROGRAM, 64 )
662   AM_RANGE(0x000, 0x1ff) AM_ROM
663ADDRESS_MAP_END
664
665
666/*************************************
667 *
668 *  Machine drivers
669 *
670 *************************************/
671
672static DRIVER_INIT( esripsys )
673{
674   UINT8* const ROM = memory_region(machine, "sound_data");
675
676   fdt_a = auto_malloc(FDT_RAM_SIZE);
677   fdt_b = auto_malloc(FDT_RAM_SIZE);
678   cmos_ram = auto_malloc(CMOS_RAM_SIZE);
679
680   ptm6840_config(machine, 0, &ptm_intf);
681
682   memory_set_bankptr(machine, 2, &ROM[0x0000+0x0000]);
683   memory_set_bankptr(machine, 3, &ROM[0x0000+0x4000]);
684   memory_set_bankptr(machine, 4, &ROM[0x0000+0x8000]);
685
686   /* TODO: Finish me! */
687//  state_save_register_global_pointer(fdt_a, FDT_RAM_SIZE);
688//  state_save_register_global_pointer(fdt_b, FDT_RAM_SIZE);
689}
690
691static NVRAM_HANDLER( esripsys )
692{
693   if (read_or_write)
694      mame_fwrite(file, cmos_ram, CMOS_RAM_SIZE);
695   else if (file)
696      mame_fread(file, cmos_ram, CMOS_RAM_SIZE);
697   else
698      memset(cmos_ram, 0x00, CMOS_RAM_SIZE);
699}
700
701static esrip_config rip_config =
702{
703   fdt_rip_r,
704   fdt_rip_w,
705   rip_status_in,
706   esripsys_draw,
707   "proms"
708};
709
710static MACHINE_DRIVER_START( esripsys )
711   MDRV_CPU_ADD("game_cpu", M6809E, XTAL_8MHz)
712   MDRV_CPU_PROGRAM_MAP(game_cpu_map, 0)
713   MDRV_CPU_VBLANK_INT("main", esripsys_vblank_irq)
714
715   MDRV_CPU_ADD("frame_cpu", M6809E, XTAL_8MHz)
716   MDRV_CPU_PROGRAM_MAP(frame_cpu_map, 0)
717
718   MDRV_CPU_ADD("video_cpu", ESRIP, XTAL_40MHz / 4)
719   MDRV_CPU_PROGRAM_MAP(video_cpu_map, 0)
720   MDRV_CPU_CONFIG(rip_config)
721
722   MDRV_CPU_ADD("sound_cpu", M6809E, XTAL_8MHz)
723   MDRV_CPU_PROGRAM_MAP(sound_cpu_map, 0)
724
725   MDRV_NVRAM_HANDLER(esripsys)
726
727   /* Video hardware */
728   MDRV_SCREEN_ADD("main", RASTER)
729   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
730   MDRV_SCREEN_RAW_PARAMS(ESRIPSYS_PIXEL_CLOCK, ESRIPSYS_HTOTAL, ESRIPSYS_HBLANK_END, ESRIPSYS_HBLANK_START, ESRIPSYS_VTOTAL, ESRIPSYS_VBLANK_END, ESRIPSYS_VBLANK_START)
731
732   MDRV_VIDEO_START(esripsys)
733   MDRV_VIDEO_UPDATE(esripsys)
734
735   /* Sound hardware */
736   MDRV_SPEAKER_STANDARD_MONO("mono")
737
738   MDRV_SOUND_ADD("tms5220nl", TMS5220, 640000)
739   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
740
741   MDRV_SOUND_ADD("dac", DAC, 0)
742   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
743MACHINE_DRIVER_END
744
745
746/*************************************
747 *
748 *  ROM definitions
749 *
750 *************************************/
751
752ROM_START( turbosub )
753   ROM_REGION( 0xc0000, "main_code", 0) /* Non-bankswitched, 6809 #0 code */
754   ROM_LOAD( "turbosub.u85",    0x18000, 0x4000, CRC(eabb9509) SHA1(cbfb6c5becb3fe1b4ed729e92a0f4029a5df7d67) )
755
756   ROM_REGION( 0x48000, "game_cpu", 0 ) /* Bankswitched 6809 code */
757   ROM_LOAD( "turbosub.u82",    0x10000, 0x2000, CRC(de32eb6f) SHA1(90bf31a5adf261d47b4f52e93b5e97f343b7ebf0) )
758   ROM_CONTINUE(                0x20000, 0x2000 )
759   ROM_LOAD( "turbosub.u81",    0x12000, 0x2000, CRC(9ae09613) SHA1(9b5ada4a21473b30be98bcc461129b6ed4e0bb11) )
760   ROM_CONTINUE(                0x22000, 0x2000 )
761   ROM_LOAD( "turbosub.u87",    0x14000, 0x2000, CRC(ad2284f7) SHA1(8e11b8ad0a98dd1fe6ec8f7ea9e6e4f4a45d8a1b) )
762   ROM_CONTINUE(                0x24000, 0x2000 )
763   ROM_LOAD( "turbosub.u86",    0x16000, 0x2000, CRC(4f51e6fd) SHA1(8f51ac6412aace29279ce7b02cad45ed681c2065) )
764   ROM_CONTINUE(                0x26000, 0x2000 )
765
766   ROM_LOAD( "turbosub.u80",    0x30000, 0x2000, CRC(ff2e2870) SHA1(45f91d63ad91585482c9dd05290b204b007e3f44) )
767   ROM_CONTINUE(                0x40000, 0x2000 )
768   ROM_LOAD( "turbosub.u79",    0x32000, 0x2000, CRC(13680923) SHA1(14e3daa2178853cef1fd96a68305420c11fceb96) )
769   ROM_CONTINUE(                0x42000, 0x2000 )
770   ROM_LOAD( "turbosub.u84",    0x34000, 0x2000, CRC(7059842d) SHA1(c20a8accd3fc23bc4476e1d08798d7a80915d37c) )
771   ROM_CONTINUE(                0x44000, 0x2000 )
772   ROM_LOAD( "turbosub.u83",    0x36000, 0x2000, CRC(31b86fc6) SHA1(8e56e8a75f653c3c4da2c9f31f739894beb194db) )
773   ROM_CONTINUE(                0x46000, 0x2000 )
774
775   /* e000 - ffff = Upper half of U85 (lower half is blank) */
776   ROM_COPY( "main_code", 0x18000 + 0x2000, 0xe000, 0x2000 )
777
778   ROM_REGION( 0x10000, "frame_cpu", 0 )
779   ROM_LOAD( "turbosub.u63", 0xc000, 0x4000, CRC(35701532) SHA1(77d957682aab10ee902c1e47c468b9ab8fe6a512) )
780
781   ROM_REGION( 0x1000, "video_cpu", 0 )
782   ROMX_LOAD( "27s29.u29", 0x0, 0x200, CRC(d580672b) SHA1(b56295a5b780ab5e8ff6817ebb084a8dfad8c281), ROM_SKIP(7))
783   ROMX_LOAD( "27s29.u28", 0x1, 0x200, CRC(f7976b87) SHA1(c19a1d375c497f1671170c7833952979819c3812), ROM_SKIP(7))
784   ROMX_LOAD( "27s29.u27", 0x2, 0x200, CRC(03ebd3ea) SHA1(109f5369bd36bcf0da5928b96566655c6895c737), ROM_SKIP(7))
785   ROMX_LOAD( "27s29.u21", 0x3, 0x200, CRC(e232384b) SHA1(cfc3acc86add06b4cb6addb3455d71123fb359ce), ROM_SKIP(7))
786   ROMX_LOAD( "27s29.u20", 0x4, 0x200, CRC(0a8e44d8) SHA1(2df46316510b2dbfd4c9913a1460c00d5572d586), ROM_SKIP(7))
787   ROMX_LOAD( "27s29.u19", 0x5, 0x200, CRC(de17e5f0) SHA1(3e14768374e1bda25183aee86a82d220b7f58ff9), ROM_SKIP(7))
788   ROMX_LOAD( "27s29.u18", 0x6, 0x200, CRC(e33ed0a4) SHA1(41edbdc7c022971ce14bd2f419c92714b796fad7), ROM_SKIP(7))
789
790   ROM_REGION( 0x10000, "sound_cpu", 0 )
791   ROM_LOAD( "turbosub.u66",   0xe000, 0x2000, CRC(8db3bcdb) SHA1(e6ae324ba9dad4884e1cb3d67ce099a6f4739456) )
792
793   ROM_REGION( 0xc000, "sound_data", 0)
794   ROM_LOAD( "turbosub.u69", 0x0000, 0x4000, CRC(ad04193b) SHA1(2f660302e60a7e68e079a8dd13266a77c077f939) )
795   ROM_LOAD( "turbosub.u68", 0x4000, 0x4000, CRC(72e3d09b) SHA1(eefdfcd0c4c32e465f18d40f46cb5bc022c22bfd) )
796   ROM_LOAD( "turbosub.u67", 0x8000, 0x4000, CRC(f8ae82e9) SHA1(fd27b9fe7872c3c680a1f71a4a5d5eeaa12e4a19) )
797
798   ROM_REGION( 0x40000, "4bpp", 0)
799   ROM_LOAD( "turbosub.u44", 0x00000, 0x4000, CRC(eaa05860) SHA1(f649891dae9354b7f2e46e6a380b52a569229d64) )
800   ROM_LOAD( "turbosub.u49", 0x10000, 0x4000, CRC(b4170ac2) SHA1(bdbfc43c891c8d525dcc46fb9d05602263ab69cd) )
801   ROM_LOAD( "turbosub.u54", 0x20000, 0x4000, CRC(bebf98d8) SHA1(170502bb44fc6d6bf14d8dac4778b37888c14a7b) )
802   ROM_LOAD( "turbosub.u59", 0x30000, 0x4000, CRC(9c1f4397) SHA1(94335f2db2650f8b7e24fc3f92a04b73325ab164) )
803
804   ROM_LOAD( "turbosub.u43", 0x04000, 0x4000, CRC(5d76237c) SHA1(3d50347856039e43290497348447b1c4581f3a33) )
805   ROM_LOAD( "turbosub.u48", 0x14000, 0x4000, CRC(cea4e036) SHA1(4afce4f2a09adf9c83ab7188c05cd7236dea16a3) )
806   ROM_LOAD( "turbosub.u53", 0x24000, 0x4000, CRC(1352d58a) SHA1(76ae86c365dd4c9e1a6c5af91c01d31e7ee35f0f) )
807   ROM_LOAD( "turbosub.u58", 0x34000, 0x4000, CRC(5024d83f) SHA1(a293d92a0ae01901b5618b0250d48e3ba631dfcb) )
808
809   ROM_LOAD( "turbosub.u42", 0x08000, 0x4000, CRC(057a1c72) SHA1(5af89b128b7818550572d02e5ff724c415fa8b8b) )
810   ROM_LOAD( "turbosub.u47", 0x18000, 0x4000, CRC(10def494) SHA1(a3ba691eb2b0d782162ffc6c081761965844a3a9) )
811   ROM_LOAD( "turbosub.u52", 0x28000, 0x4000, CRC(070d07d6) SHA1(4c81310cd646641a380817fedffab66e76529c97) )
812   ROM_LOAD( "turbosub.u57", 0x38000, 0x4000, CRC(5ddb0458) SHA1(d1169882397f364ca38fbd563250b33d13b1a7c6) )
813
814   ROM_LOAD( "turbosub.u41", 0x0c000, 0x4000, CRC(014bb06b) SHA1(97276ba26b60c2907e59b92cc9de5251298579cf) )
815   ROM_LOAD( "turbosub.u46", 0x1c000, 0x4000, CRC(3b866e2c) SHA1(c0dd4827a18eb9f4b1055d92544beed10f01fd86) )
816   ROM_LOAD( "turbosub.u51", 0x2c000, 0x4000, CRC(43cdcb5c) SHA1(3dd966daa904d3be7be63c584ba033c0e7904d5c) )
817   ROM_LOAD( "turbosub.u56", 0x3c000, 0x4000, CRC(6d116adf) SHA1(f808e28cef41dc86e43d8c12966037213da87c87) )
818
819   ROM_REGION( 0x40000, "8bpp_l", 0)
820   ROM_LOAD( "turbosub.u4",  0x00000, 0x4000, CRC(08303604) SHA1(f075b645d89a2d91bd9b621748906a9f9890ee60) )
821   ROM_LOAD( "turbosub.u14", 0x10000, 0x4000, CRC(83b26c8d) SHA1(2dfa3b45c44652d255c402511bb3810fffb0731d) )
822   ROM_LOAD( "turbosub.u24", 0x20000, 0x4000, CRC(6bbb6cb3) SHA1(d513e547a05b34076bb8261abd51301ac5f3f5d4) )
823   ROM_LOAD( "turbosub.u34", 0x30000, 0x4000, CRC(7b844f4a) SHA1(82467eb7e116f9f225711a1698c151945e1de6e4) )
824
825   ROM_LOAD( "turbosub.u3",  0x04000, 0x4000, CRC(825ef29c) SHA1(affadd0976f793b8bdbcbc4768b7de27121e7b11) )
826   ROM_LOAD( "turbosub.u13", 0x14000, 0x4000, CRC(350cc17a) SHA1(b98d16be997fc0576d3206f51f29ce3e257492d3) )
827   ROM_LOAD( "turbosub.u23", 0x24000, 0x4000, CRC(b1531916) SHA1(805a23f40aa875f431e835fdaceba87261c14155) )
828   ROM_LOAD( "turbosub.u33", 0x34000, 0x4000, CRC(0d5130cb) SHA1(7e4e4e5ea50c581a60d15964571464029515c720) )
829
830   ROM_LOAD( "turbosub.u2",  0x08000, 0x4000, CRC(a8b8c032) SHA1(20512a3a1f8b9c0361e6f5a7e9a50605be3ae650) )
831   ROM_LOAD( "turbosub.u12", 0x18000, 0x4000, CRC(a2c4badf) SHA1(267af1be6261833211270af25045e306efffee80) )
832   ROM_LOAD( "turbosub.u22", 0x28000, 0x4000, CRC(97b7cf0e) SHA1(888fb2f384a5cba8a6f7569886eb6dc27e2b024f) )
833   ROM_LOAD( "turbosub.u32", 0x38000, 0x4000, CRC(b286710e) SHA1(5082db13630ba0967006619027c39ee3607b838d) )
834
835   ROM_LOAD( "turbosub.u1",  0x0c000, 0x4000, CRC(88b0a7a9) SHA1(9012c8059cf60131efa6a0432accd87813187206) )
836   ROM_LOAD( "turbosub.u11", 0x1c000, 0x4000, CRC(9f0ff723) SHA1(54b52b4ebc32f10aa32c799ac819928290e70455) )
837   ROM_LOAD( "turbosub.u21", 0x2c000, 0x4000, CRC(b4122fe2) SHA1(50e8b488a7b7f739336b60a3fd8a5b14f5010b75) )
838   ROM_LOAD( "turbosub.u31", 0x3c000, 0x4000, CRC(3fa15c78) SHA1(bf5cb85fc26b5045ad5acc944c917b068ace2c49) )
839
840   ROM_REGION( 0x40000, "8bpp_r", 0)
841   ROM_LOAD( "turbosub.u9",  0x00000, 0x4000, CRC(9a03eadf) SHA1(25ee1ebe52f030b2fa09d76161e46540c91cbc4c) )
842   ROM_LOAD( "turbosub.u19", 0x10000, 0x4000, CRC(498253b8) SHA1(dd74d4f9f19d8a746415baea604116faedb4fb31) )
843   ROM_LOAD( "turbosub.u29", 0x20000, 0x4000, CRC(809c374f) SHA1(d3849eed8441e4641ffcbca7c83ee3bb16681a0b) )
844   ROM_LOAD( "turbosub.u39", 0x30000, 0x4000, CRC(3e4e0681) SHA1(ac834f6823ffe835d6f149e79c1d31ae2b89e85d) )
845
846   ROM_LOAD( "turbosub.u8",  0x04000, 0x4000, CRC(01118737) SHA1(3a8e998b80dffe82296170273dcbbe9870c5b695) )
847   ROM_LOAD( "turbosub.u18", 0x14000, 0x4000, CRC(39fd8e57) SHA1(392f8a8cf58fc4813de840775d9c53561488152d) )
848   ROM_LOAD( "turbosub.u28", 0x24000, 0x4000, CRC(0628586d) SHA1(e37508c2812e1c98659aaba9c495e7396842614e) )
849   ROM_LOAD( "turbosub.u38", 0x34000, 0x4000, CRC(7d597a7e) SHA1(2f48faf75406ab3ff0b954040b74e68b7ca6f7a5) )
850
851   ROM_LOAD( "turbosub.u7",  0x08000, 0x4000, CRC(50eea315) SHA1(567dbb3cb3a75a7507f4cb4748c7dd878e69d6b7) )
852   ROM_LOAD( "turbosub.u17", 0x18000, 0x4000, CRC(8a9e19e6) SHA1(19067e153c0002edfd4a756f92ad75d9a0cbc3dd) )
853   ROM_LOAD( "turbosub.u27", 0x28000, 0x4000, CRC(1c81a8d9) SHA1(3d13d1ccd7ec3dddf2a27600eb64b5be386e868c) )
854   ROM_LOAD( "turbosub.u37", 0x38000, 0x4000, CRC(59f978cb) SHA1(e99d6378de941cad92e9702fcb18aea87acd371f) )
855
856   ROM_LOAD( "turbosub.u6",  0x0c000, 0x4000, CRC(841e00bd) SHA1(f777cc8dd8dd7c8baa2007355a76db782a218efc) )
857   ROM_LOAD( "turbosub.u16", 0x1c000, 0x4000, CRC(d3b63d81) SHA1(e86dd64825f6d9e7bebc26413f524a8962f68f2d) )
858   ROM_LOAD( "turbosub.u26", 0x2c000, 0x4000, CRC(867cfe32) SHA1(549e4e557d63dfab8e8c463916512a1b422ce425) )
859   ROM_LOAD( "turbosub.u36", 0x3c000, 0x4000, CRC(0d8ebc21) SHA1(7ae65edae05869376caa975ff2c778a08e8ad8a2) )
860
861   ROM_REGION( 0x260, "proms", 0)
862   ROM_LOAD( "27s29.u123",    0x0000, 0x0200, CRC(b2e8770e) SHA1(849292a6b30bb0e6547ce3232438136897a651b0) )
863   ROM_LOAD( "6331_snd.u2",   0x0200, 0x0020, CRC(f1328a5e) SHA1(44d4e802988415d24a0b9eaa38300f5add3a2727) )
864   ROM_LOAD( "6331_rom.u74",  0x0220, 0x0020, CRC(7b72b34e) SHA1(bc4d67a6993beb36a161368428e648d0492ac436) )
865   ROM_LOAD( "6331_vid.u155", 0x0240, 0x0020, CRC(63371737) SHA1(f08c03c81322c0de9ee64b4a9f11a1422c5bd463) )
866ROM_END
867
868ROM_START( turbosba )
869   ROM_REGION( 0xc0000, "main_code", 0) /* Non-bankswitched, 6809 #0 code */
870   ROM_LOAD( "u85",    0x18000, 0x4000, CRC(d37ccb06) SHA1(445df1caa4dd4901e474bb0903bf28e536edf493) )
871
872   ROM_REGION( 0x48000, "game_cpu", 0 ) /* Bankswitched 6809 code */
873   ROM_LOAD( "u82",    0x10000, 0x2000, CRC(1596a100) SHA1(0a53d4b79245f2a51de87ec4de6db525aa342f2c) )
874   ROM_CONTINUE(                0x20000, 0x2000 )
875   ROM_LOAD( "u81",    0x12000, 0x2000, CRC(1c8e053d) SHA1(397f04fdf7c5dfaa33a396b1b41c015a86537ef6) )
876   ROM_CONTINUE(                0x22000, 0x2000 )
877   ROM_LOAD( "u87",    0x14000, 0x2000, CRC(c80d0512) SHA1(aedd829edd2cb214fa30ae2fe25ad7590c86971b) )
878   ROM_CONTINUE(                0x24000, 0x2000 )
879   ROM_LOAD( "u86",    0x16000, 0x2000, CRC(8af137d3) SHA1(12768d14b18401d07a793de3412da059b5a33699) )
880   ROM_CONTINUE(                0x26000, 0x2000 )
881
882   ROM_LOAD( "u80",    0x30000, 0x2000, CRC(6f53b658) SHA1(39841e4b0a6809ad061a07adcdb8d92fd7652959) )
883   ROM_CONTINUE(                0x40000, 0x2000 )
884   ROM_LOAD( "u79",    0x32000, 0x2000, CRC(aa6f1db6) SHA1(70cacedb57f3c5646181e26c355f87f1cea1d651) )
885   ROM_CONTINUE(                0x42000, 0x2000 )
886   ROM_LOAD( "u84",    0x34000, 0x2000, CRC(e856323f) SHA1(d973f8efa3a1f5907b8c09b58043d7b41ff3f0c1) )
887   ROM_CONTINUE(                0x44000, 0x2000 )
888   ROM_LOAD( "u83",    0x36000, 0x2000, CRC(056fc173) SHA1(426bcea3c2420b8df036122ebb6fc80af89e63d2) )
889   ROM_CONTINUE(                0x46000, 0x2000 )
890
891   /* e000 - ffff = Upper half of U85 (lower half is blank) */
892   ROM_COPY( "main_code", 0x18000 + 0x2000, 0xe000, 0x2000 )
893
894   ROM_REGION( 0x10000, "frame_cpu", 0 )
895   ROM_LOAD( "u63",    0xe000, 0x2000, CRC(e85216d4) SHA1(7f61a93c52a31782116e9825d0aefa58ca3720b9) )
896
897   ROM_REGION( 0x1000, "video_cpu", 0 )
898   ROMX_LOAD( "27s29.u29", 0x0, 0x200, CRC(d580672b) SHA1(b56295a5b780ab5e8ff6817ebb084a8dfad8c281), ROM_SKIP(7))
899   ROMX_LOAD( "27s29.u28", 0x1, 0x200, CRC(f7976b87) SHA1(c19a1d375c497f1671170c7833952979819c3812), ROM_SKIP(7))
900   ROMX_LOAD( "27s29.u27", 0x2, 0x200, CRC(03ebd3ea) SHA1(109f5369bd36bcf0da5928b96566655c6895c737), ROM_SKIP(7))
901   ROMX_LOAD( "27s29.u21", 0x3, 0x200, CRC(e232384b) SHA1(cfc3acc86add06b4cb6addb3455d71123fb359ce), ROM_SKIP(7))
902   ROMX_LOAD( "27s29.u20", 0x4, 0x200, CRC(0a8e44d8) SHA1(2df46316510b2dbfd4c9913a1460c00d5572d586), ROM_SKIP(7))
903   ROMX_LOAD( "27s29.u19", 0x5, 0x200, CRC(de17e5f0) SHA1(3e14768374e1bda25183aee86a82d220b7f58ff9), ROM_SKIP(7))
904   ROMX_LOAD( "27s29.u18", 0x6, 0x200, CRC(e33ed0a4) SHA1(41edbdc7c022971ce14bd2f419c92714b796fad7), ROM_SKIP(7))
905
906   ROM_REGION( 0x10000, "sound_cpu", 0 )
907   ROM_LOAD( "turbosub.u66", 0xe000, 0x2000, CRC(8db3bcdb) SHA1(e6ae324ba9dad4884e1cb3d67ce099a6f4739456) )
908
909   ROM_REGION( 0xc000, "sound_data", 0)
910   ROM_LOAD( "turbosub.u69", 0x0000, 0x4000, CRC(ad04193b) SHA1(2f660302e60a7e68e079a8dd13266a77c077f939) )
911   ROM_LOAD( "turbosub.u68", 0x4000, 0x4000, CRC(72e3d09b) SHA1(eefdfcd0c4c32e465f18d40f46cb5bc022c22bfd) )
912   ROM_LOAD( "turbosub.u67", 0x8000, 0x4000, CRC(f8ae82e9) SHA1(fd27b9fe7872c3c680a1f71a4a5d5eeaa12e4a19) )
913
914   ROM_REGION( 0x40000, "4bpp", 0)
915   ROM_LOAD( "turbosub.u44", 0x00000, 0x4000, CRC(eaa05860) SHA1(f649891dae9354b7f2e46e6a380b52a569229d64) )
916   ROM_LOAD( "turbosub.u49", 0x10000, 0x4000, CRC(b4170ac2) SHA1(bdbfc43c891c8d525dcc46fb9d05602263ab69cd) )
917   ROM_LOAD( "turbosub.u54", 0x20000, 0x4000, CRC(bebf98d8) SHA1(170502bb44fc6d6bf14d8dac4778b37888c14a7b) )
918   ROM_LOAD( "turbosub.u59", 0x30000, 0x4000, CRC(9c1f4397) SHA1(94335f2db2650f8b7e24fc3f92a04b73325ab164) )
919
920   ROM_LOAD( "turbosub.u43", 0x04000, 0x4000, CRC(5d76237c) SHA1(3d50347856039e43290497348447b1c4581f3a33) )
921   ROM_LOAD( "turbosub.u48", 0x14000, 0x4000, CRC(cea4e036) SHA1(4afce4f2a09adf9c83ab7188c05cd7236dea16a3) )
922   ROM_LOAD( "turbosub.u53", 0x24000, 0x4000, CRC(1352d58a) SHA1(76ae86c365dd4c9e1a6c5af91c01d31e7ee35f0f) )
923   ROM_LOAD( "turbosub.u58", 0x34000, 0x4000, CRC(5024d83f) SHA1(a293d92a0ae01901b5618b0250d48e3ba631dfcb) )
924
925   ROM_LOAD( "turbosub.u42", 0x08000, 0x4000, CRC(057a1c72) SHA1(5af89b128b7818550572d02e5ff724c415fa8b8b) )
926   ROM_LOAD( "turbosub.u47", 0x18000, 0x4000, CRC(10def494) SHA1(a3ba691eb2b0d782162ffc6c081761965844a3a9) )
927   ROM_LOAD( "turbosub.u52", 0x28000, 0x4000, CRC(070d07d6) SHA1(4c81310cd646641a380817fedffab66e76529c97) )
928   ROM_LOAD( "turbosub.u57", 0x38000, 0x4000, CRC(5ddb0458) SHA1(d1169882397f364ca38fbd563250b33d13b1a7c6) )
929
930   ROM_LOAD( "turbosub.u41", 0x0c000, 0x4000, CRC(014bb06b) SHA1(97276ba26b60c2907e59b92cc9de5251298579cf) )
931   ROM_LOAD( "turbosub.u46", 0x1c000, 0x4000, CRC(3b866e2c) SHA1(c0dd4827a18eb9f4b1055d92544beed10f01fd86) )
932   ROM_LOAD( "turbosub.u51", 0x2c000, 0x4000, CRC(43cdcb5c) SHA1(3dd966daa904d3be7be63c584ba033c0e7904d5c) )
933   ROM_LOAD( "turbosub.u56", 0x3c000, 0x4000, CRC(6d116adf) SHA1(f808e28cef41dc86e43d8c12966037213da87c87) )
934
935   ROM_REGION( 0x40000, "8bpp_l", 0)
936   ROM_LOAD( "turbosub.u4",  0x00000, 0x4000, CRC(08303604) SHA1(f075b645d89a2d91bd9b621748906a9f9890ee60) )
937   ROM_LOAD( "turbosub.u14", 0x10000, 0x4000, CRC(83b26c8d) SHA1(2dfa3b45c44652d255c402511bb3810fffb0731d) )
938   ROM_LOAD( "turbosub.u24", 0x20000, 0x4000, CRC(6bbb6cb3) SHA1(d513e547a05b34076bb8261abd51301ac5f3f5d4) )
939   ROM_LOAD( "turbosub.u34", 0x30000, 0x4000, CRC(7b844f4a) SHA1(82467eb7e116f9f225711a1698c151945e1de6e4) )
940
941   ROM_LOAD( "turbosub.u3",  0x04000, 0x4000, CRC(825ef29c) SHA1(affadd0976f793b8bdbcbc4768b7de27121e7b11) )
942   ROM_LOAD( "turbosub.u13", 0x14000, 0x4000, CRC(350cc17a) SHA1(b98d16be997fc0576d3206f51f29ce3e257492d3) )
943   ROM_LOAD( "turbosub.u23", 0x24000, 0x4000, CRC(b1531916) SHA1(805a23f40aa875f431e835fdaceba87261c14155) )
944   ROM_LOAD( "turbosub.u33", 0x34000, 0x4000, CRC(0d5130cb) SHA1(7e4e4e5ea50c581a60d15964571464029515c720) )
945
946   ROM_LOAD( "turbosub.u2",  0x08000, 0x4000, CRC(a8b8c032) SHA1(20512a3a1f8b9c0361e6f5a7e9a50605be3ae650) )
947   ROM_LOAD( "turbosub.u12", 0x18000, 0x4000, CRC(a2c4badf) SHA1(267af1be6261833211270af25045e306efffee80) )
948   ROM_LOAD( "turbosub.u22", 0x28000, 0x4000, CRC(97b7cf0e) SHA1(888fb2f384a5cba8a6f7569886eb6dc27e2b024f) )
949   ROM_LOAD( "turbosub.u32", 0x38000, 0x4000, CRC(b286710e) SHA1(5082db13630ba0967006619027c39ee3607b838d) )
950
951   ROM_LOAD( "turbosub.u1",  0x0c000, 0x4000, CRC(88b0a7a9) SHA1(9012c8059cf60131efa6a0432accd87813187206) )
952   ROM_LOAD( "turbosub.u11", 0x1c000, 0x4000, CRC(9f0ff723) SHA1(54b52b4ebc32f10aa32c799ac819928290e70455) )
953   ROM_LOAD( "turbosub.u21", 0x2c000, 0x4000, CRC(b4122fe2) SHA1(50e8b488a7b7f739336b60a3fd8a5b14f5010b75) )
954   ROM_LOAD( "turbosub.u31", 0x3c000, 0x4000, CRC(3fa15c78) SHA1(bf5cb85fc26b5045ad5acc944c917b068ace2c49) )
955
956   ROM_REGION( 0x40000, "8bpp_r", 0)
957   ROM_LOAD( "turbosub.u9",  0x00000, 0x4000, CRC(9a03eadf) SHA1(25ee1ebe52f030b2fa09d76161e46540c91cbc4c) )
958   ROM_LOAD( "turbosub.u19", 0x10000, 0x4000, CRC(498253b8) SHA1(dd74d4f9f19d8a746415baea604116faedb4fb31) )
959   ROM_LOAD( "turbosub.u29", 0x20000, 0x4000, CRC(809c374f) SHA1(d3849eed8441e4641ffcbca7c83ee3bb16681a0b) )
960   ROM_LOAD( "turbosub.u39", 0x30000, 0x4000, CRC(3e4e0681) SHA1(ac834f6823ffe835d6f149e79c1d31ae2b89e85d) )
961
962   ROM_LOAD( "turbosub.u8",  0x04000, 0x4000, CRC(01118737) SHA1(3a8e998b80dffe82296170273dcbbe9870c5b695) )
963   ROM_LOAD( "turbosub.u18", 0x14000, 0x4000, CRC(39fd8e57) SHA1(392f8a8cf58fc4813de840775d9c53561488152d) )
964   ROM_LOAD( "turbosub.u28", 0x24000, 0x4000, CRC(0628586d) SHA1(e37508c2812e1c98659aaba9c495e7396842614e) )
965   ROM_LOAD( "turbosub.u38", 0x34000, 0x4000, CRC(7d597a7e) SHA1(2f48faf75406ab3ff0b954040b74e68b7ca6f7a5) )
966
967   ROM_LOAD( "turbosub.u7",  0x08000, 0x4000, CRC(50eea315) SHA1(567dbb3cb3a75a7507f4cb4748c7dd878e69d6b7) )
968   ROM_LOAD( "turbosub.u17", 0x18000, 0x4000, CRC(8a9e19e6) SHA1(19067e153c0002edfd4a756f92ad75d9a0cbc3dd) )
969   ROM_LOAD( "turbosub.u27", 0x28000, 0x4000, CRC(1c81a8d9) SHA1(3d13d1ccd7ec3dddf2a27600eb64b5be386e868c) )
970   ROM_LOAD( "turbosub.u37", 0x38000, 0x4000, CRC(59f978cb) SHA1(e99d6378de941cad92e9702fcb18aea87acd371f) )
971
972   ROM_LOAD( "turbosub.u6",  0x0c000, 0x4000, CRC(841e00bd) SHA1(f777cc8dd8dd7c8baa2007355a76db782a218efc) )
973   ROM_LOAD( "turbosub.u16", 0x1c000, 0x4000, CRC(d3b63d81) SHA1(e86dd64825f6d9e7bebc26413f524a8962f68f2d) )
974   ROM_LOAD( "turbosub.u26", 0x2c000, 0x4000, CRC(867cfe32) SHA1(549e4e557d63dfab8e8c463916512a1b422ce425) )
975   ROM_LOAD( "turbosub.u36", 0x3c000, 0x4000, CRC(0d8ebc21) SHA1(7ae65edae05869376caa975ff2c778a08e8ad8a2) )
976
977   ROM_REGION( 0x260, "proms", 0)
978   ROM_LOAD( "27s29.u123",    0x0000, 0x0200, CRC(b2e8770e) SHA1(849292a6b30bb0e6547ce3232438136897a651b0) )
979   ROM_LOAD( "6331_snd.u2",   0x0200, 0x0020, CRC(f1328a5e) SHA1(44d4e802988415d24a0b9eaa38300f5add3a2727) )
980   ROM_LOAD( "6331_rom.u74",  0x0220, 0x0020, CRC(7b72b34e) SHA1(bc4d67a6993beb36a161368428e648d0492ac436) )
981   ROM_LOAD( "6331_vid.u155", 0x0240, 0x0020, CRC(63371737) SHA1(f08c03c81322c0de9ee64b4a9f11a1422c5bd463) )
982ROM_END
983
984
985/*************************************
986 *
987 *  Game drivers
988 *
989 *************************************/
990
991GAME( 1985, turbosub, 0,        esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSCA)", GAME_IMPERFECT_SOUND )
992GAME( 1985, turbosba, turbosub, esripsys, turbosub, esripsys, ROT0, "Entertainment Sciences", "Turbo Sub (prototype rev. TSC6)", GAME_IMPERFECT_SOUND )
src/mame/drivers/nbmj8991.c
r4057r4058
6969
7070static MACHINE_RESET( nbmj8991 )
7171{
72   if (cpu_get_type(machine->cpu[1]) == CPU_Z80)
72   if (machine->cpu[1] != NULL && cpu_get_type(machine->cpu[1]) == CPU_Z80)
7373   {
7474      memory_configure_bank(machine, 1, 0, 4, memory_region(machine, "audio") + 0x8000, 0x8000);
7575      memory_set_bank(machine, 1, 0);
r4057r4058
22902290   ROM_LOAD( "5.bin",      0x020000, 0x20000, CRC(0eff4bbf) SHA1(c1bfbab792ac4b8e26944d759f40059077326a57) )
22912291   ROM_LOAD( "6.bin",      0x040000, 0x20000, CRC(ac351796) SHA1(23aaf79034227febe13defe86a3d5051733cfd3e) )
22922292   ROM_LOAD( "mj-1802.9a", 0x180000, 0x80000, CRC(e6213f10) SHA1(377399e9cd20fc2055b680eb28d024824161b2ff) )
2293
2294   DISK_REGION( "vhs" ) /* Video Home System tape */
2295   DISK_IMAGE_READONLY( "av2mj1bb", 0, NO_DUMP )
22932296ROM_END
22942297
22952298ROM_START( av2mj2rg )
r4057r4058
23082311   ROM_LOAD( "8.9j",       0x080000, 0x20000, CRC(637098a9) SHA1(f534308dd6300940df17b0b757a63b5861e43937) )
23092312   ROM_LOAD( "9.9k",       0x0a0000, 0x20000, CRC(6c06ca0d) SHA1(dee7023a906ce2709c4ef5d3bd33b9798dd56777) )
23102313   ROM_LOAD( "mj-1802.9a", 0x180000, 0x80000, CRC(e6213f10) SHA1(377399e9cd20fc2055b680eb28d024824161b2ff) )
2314
2315   DISK_REGION( "vhs" ) /* Video Home System tape */
2316   DISK_IMAGE_READONLY( "av2mj2rg", 0, NO_DUMP )
23112317ROM_END
23122318
23132319
src/mame/drivers/midwunit.c
r4057r4058
664664
665665ROM_START( mk3 )
666666   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
667   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
668   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
669   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
670   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
667   ROM_LOAD16_BYTE( "mk3-u2.bin", 0x000000, 0x100000, BAD_DUMP CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
668   ROM_LOAD16_BYTE( "mk3-u3.bin", 0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
669   ROM_LOAD16_BYTE( "mk3-u4.bin", 0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
670   ROM_LOAD16_BYTE( "mk3-u5.bin", 0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
671671
672672   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
673673   ROM_LOAD16_BYTE( "mk321u54.bin",  0x00000, 0x80000, CRC(9e344401) SHA1(5760b355f0a5c27c9746f33abfdedf4302f1af38) )
674674   ROM_LOAD16_BYTE( "mk321u63.bin",  0x00001, 0x80000, CRC(64d34776) SHA1(d8f09e1e946dc13fec5e9f83fdaf61d4076ba9ea) )
675675
676676   ROM_REGION( 0x2000000, "gfx1", 0 )
677   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
678   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
679   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
680   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
677   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
678   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
679   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
680   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
681681
682   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
683   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
684   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
685   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
682   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
683   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
684   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
685   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
686686
687   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
688   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
689   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
690   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
687   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
688   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
689   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
690   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
691691
692692   ROM_LOAD( "mk3-u121.bin",  0x0c00000, 0x100000, CRC(b6c6296a) SHA1(7b92a92d65493bb201daf5ece6f00140f017ac51) )
693693   ROM_LOAD( "mk3-u120.bin",  0x0d00000, 0x100000, CRC(8d1ccc3b) SHA1(35d91c00113718a08a9d56eb04366f8cf4069ba6) )
r4057r4058
703703
704704ROM_START( mk3r20 )
705705   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
706   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
707   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
708   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
709   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
706   ROM_LOAD16_BYTE( "mk3-u2.bin", 0x000000, 0x100000, BAD_DUMP CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
707   ROM_LOAD16_BYTE( "mk3-u3.bin", 0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
708   ROM_LOAD16_BYTE( "mk3-u4.bin", 0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
709   ROM_LOAD16_BYTE( "mk3-u5.bin", 0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
710710
711711   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
712712   ROM_LOAD16_BYTE( "mk320u54.bin",  0x00000, 0x80000, CRC(453da302) SHA1(d9a4814e7abb49ac0eb306ad05adcceac68df6a5) )
713713   ROM_LOAD16_BYTE( "mk320u63.bin",  0x00001, 0x80000, CRC(f8dc0600) SHA1(6eb689d92619c751252155b40af119ad47e94cfa) )
714714
715715   ROM_REGION( 0x2000000, "gfx1", 0 )
716   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
717   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
718   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
719   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
716   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
717   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
718   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
719   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
720720
721   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
722   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
723   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
724   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
721   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
722   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
723   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
724   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
725725
726   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
727   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
728   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
729   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
726   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
727   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
728   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
729   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
730730
731731   ROM_LOAD( "mk3-u121.bin",  0x0c00000, 0x100000, CRC(b6c6296a) SHA1(7b92a92d65493bb201daf5ece6f00140f017ac51) )
732732   ROM_LOAD( "mk3-u120.bin",  0x0d00000, 0x100000, CRC(8d1ccc3b) SHA1(35d91c00113718a08a9d56eb04366f8cf4069ba6) )
r4057r4058
742742
743743ROM_START( mk3r10 )
744744   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
745   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
746   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
747   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
748   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
745   ROM_LOAD16_BYTE( "mk3-u2.bin", 0x000000, 0x100000, BAD_DUMP CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
746   ROM_LOAD16_BYTE( "mk3-u3.bin", 0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
747   ROM_LOAD16_BYTE( "mk3-u4.bin", 0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
748   ROM_LOAD16_BYTE( "mk3-u5.bin", 0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
749749
750750   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
751751   ROM_LOAD16_BYTE( "mk310u54.bin",  0x00000, 0x80000, CRC(41829228) SHA1(5686b50a08b528d41b28ef578cfb171da9905c45) )
752752   ROM_LOAD16_BYTE( "mk310u63.bin",  0x00001, 0x80000, CRC(b074e1e8) SHA1(fe1a6f622614b1ebd8edc3edeec442d39ba2924c) )
753753
754754   ROM_REGION( 0x2000000, "gfx1", 0 )
755   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
756   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
757   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
758   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
755   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
756   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
757   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
758   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
759759
760   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
761   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
762   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
763   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
760   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
761   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
762   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
763   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
764764
765   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
766   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
767   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
768   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
765   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
766   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
767   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
768   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
769769
770770   ROM_LOAD( "mk3-u121.bin",  0x0c00000, 0x100000, CRC(b6c6296a) SHA1(7b92a92d65493bb201daf5ece6f00140f017ac51) )
771771   ROM_LOAD( "mk3-u120.bin",  0x0d00000, 0x100000, CRC(8d1ccc3b) SHA1(35d91c00113718a08a9d56eb04366f8cf4069ba6) )
r4057r4058
781781
782782ROM_START( mk3p40 )
783783   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
784   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
785   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
786   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
787   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
784   ROM_LOAD16_BYTE( "mk3-u2.bin", 0x000000, 0x100000, BAD_DUMP CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
785   ROM_LOAD16_BYTE( "mk3-u3.bin", 0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
786   ROM_LOAD16_BYTE( "mk3-u4.bin", 0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
787   ROM_LOAD16_BYTE( "mk3-u5.bin", 0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
788788
789789   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
790790   ROM_LOAD16_BYTE( "mk3p40.u54",  0x00000, 0x80000, CRC(4dfb0748) SHA1(8c628a51642c940de8abb795be36123e4008ce15) )
791791   ROM_LOAD16_BYTE( "mk3p40.u63",  0x00001, 0x80000, CRC(f25a8083) SHA1(ff11462d23d9e16f6ee0d77bf85caa996df32618) )
792792
793793   ROM_REGION( 0x2000000, "gfx1", 0 )
794   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
795   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
796   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
797   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
794   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
795   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
796   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
797   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
798798
799   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
800   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
801   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
802   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
799   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
800   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
801   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
802   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
803803
804   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
805   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
806   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
807   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
804   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
805   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
806   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
807   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
808808
809809   ROM_LOAD( "mk3-u121.bin",  0x0c00000, 0x100000, CRC(b6c6296a) SHA1(7b92a92d65493bb201daf5ece6f00140f017ac51) )
810810   ROM_LOAD( "mk3-u120.bin",  0x0d00000, 0x100000, CRC(8d1ccc3b) SHA1(35d91c00113718a08a9d56eb04366f8cf4069ba6) )
r4057r4058
819819
820820ROM_START( umk3 )
821821   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
822   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
823   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
824   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
825   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
822   ROM_LOAD16_BYTE( "umk3-u2.bin", 0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
823   ROM_LOAD16_BYTE( "mk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
824   ROM_LOAD16_BYTE( "mk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
825   ROM_LOAD16_BYTE( "mk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
826826
827827   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
828828   ROM_LOAD16_BYTE( "um312u54.bin",  0x00000, 0x80000, CRC(712b4db6) SHA1(7015a55f3d745c6aeb8630903e2d5cd9554b2766) )
829829   ROM_LOAD16_BYTE( "um312u63.bin",  0x00001, 0x80000, CRC(6d301faf) SHA1(18a8e29cc3e8ce5cc0e10f8386d43e7f44fd7b75) )
830830
831831   ROM_REGION( 0x2000000, "gfx1", 0 )
832   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
833   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
834   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
835   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
832   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
833   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
834   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
835   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
836836
837   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
838   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
839   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
840   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
837   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
838   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
839   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
840   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
841841
842   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
843   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
844   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
845   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
842   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
843   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
844   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
845   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
846846
847847   ROM_LOAD( "umk-u121.bin",  0x0c00000, 0x100000, CRC(cc4b95db) SHA1(3d53180eec649e9616c4b87db55573f12d9bfee3) )
848848   ROM_LOAD( "umk-u120.bin",  0x0d00000, 0x100000, CRC(1c8144cd) SHA1(77cdc1eaf630ccb7233f5532f8b08191d00f0816) )
r4057r4058
858858
859859ROM_START( umk3r11 )
860860   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
861   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
862   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
863   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
864   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
861   ROM_LOAD16_BYTE( "umk3-u2.bin", 0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
862   ROM_LOAD16_BYTE( "mk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
863   ROM_LOAD16_BYTE( "mk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
864   ROM_LOAD16_BYTE( "mk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
865865
866866   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
867867   ROM_LOAD16_BYTE( "um311u54.bin",  0x00000, 0x80000, CRC(8bb27659) SHA1(a3ffe3d8f21c261b36c7510d620d691a8bbf665b) )
868868   ROM_LOAD16_BYTE( "um311u63.bin",  0x00001, 0x80000, CRC(ea731783) SHA1(2915626090650c4b5adf5b26e736c3ec91ce81a6) )
869869
870870   ROM_REGION( 0x2000000, "gfx1", 0 )
871   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
872   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
873   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
874   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
871   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
872   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
873   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
874   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
875875
876   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
877   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
878   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
879   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
876   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
877   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
878   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
879   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
880880
881   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
882   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
883   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
884   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
881   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
882   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
883   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
884   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
885885
886886   ROM_LOAD( "umk-u121.bin",  0x0c00000, 0x100000, CRC(cc4b95db) SHA1(3d53180eec649e9616c4b87db55573f12d9bfee3) )
887887   ROM_LOAD( "umk-u120.bin",  0x0d00000, 0x100000, CRC(1c8144cd) SHA1(77cdc1eaf630ccb7233f5532f8b08191d00f0816) )
r4057r4058
897897
898898ROM_START( umk3r10 )
899899   ROM_REGION16_LE( 0x800000, "dcs", ROMREGION_ERASEFF )   /* sound data */
900   ROM_LOAD16_BYTE( "umk3-u2.bin",  0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
901   ROM_LOAD16_BYTE( "umk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
902   ROM_LOAD16_BYTE( "umk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
903   ROM_LOAD16_BYTE( "umk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
900   ROM_LOAD16_BYTE( "umk3-u2.bin", 0x000000, 0x100000, CRC(3838cfe5) SHA1(e3d2901f3bae1362742fc6ee0aa31c9f63b4dfa3) )
901   ROM_LOAD16_BYTE( "mk3-u3.bin",  0x200000, 0x100000, CRC(856fe411) SHA1(6165ebecfce7500e948d84492ffa19eed7f47091) )
902   ROM_LOAD16_BYTE( "mk3-u4.bin",  0x400000, 0x100000, CRC(428a406f) SHA1(e70ec83cd054de0da1e178720ed0035b8887f797) )
903   ROM_LOAD16_BYTE( "mk3-u5.bin",  0x600000, 0x100000, CRC(3b98a09f) SHA1(edf1d02a56dcf3349e6b4bb4097acfe7592305f4) )
904904
905905   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
906906   ROM_LOAD16_BYTE( "um310u54.bin",  0x00000, 0x80000, CRC(dfd735da) SHA1(bcb6d80dbde407d0042ec2f225b2f98740a79203) )
907907   ROM_LOAD16_BYTE( "um310u63.bin",  0x00001, 0x80000, CRC(2dff0c83) SHA1(8942ffa3addf134085ea8d77d56e82593312e7a5) )
908908
909909   ROM_REGION( 0x2000000, "gfx1", 0 )
910   ROM_LOAD( "umk-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
911   ROM_LOAD( "umk-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
912   ROM_LOAD( "umk-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
913   ROM_LOAD( "umk-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
910   ROM_LOAD( "mk3-u133.bin",  0x0000000, 0x100000, CRC(79b94667) SHA1(31bba640c351fdccc6685cadb74dd79a3f910ce8) )
911   ROM_LOAD( "mk3-u132.bin",  0x0100000, 0x100000, CRC(13e95228) SHA1(405b05f5a5a55667c2be17d4b399129bdacefd90) )
912   ROM_LOAD( "mk3-u131.bin",  0x0200000, 0x100000, CRC(41001e30) SHA1(2cec91116771951c0380cec5debf4cbb40c14c61) )
913   ROM_LOAD( "mk3-u130.bin",  0x0300000, 0x100000, CRC(49379dd7) SHA1(e6dfab4e23d9cc38ae56c1bbf10ccd160e8fad5e) )
914914
915   ROM_LOAD( "umk-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
916   ROM_LOAD( "umk-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
917   ROM_LOAD( "umk-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
918   ROM_LOAD( "umk-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
915   ROM_LOAD( "mk3-u129.bin",  0x0400000, 0x100000, CRC(a8b41803) SHA1(9697e35e8bb51d6d36b1d7ae47377b446e57682f) )
916   ROM_LOAD( "mk3-u128.bin",  0x0500000, 0x100000, CRC(b410d72f) SHA1(ac5c1c6f744186540f4ab100d9bd4ce6007e600b) )
917   ROM_LOAD( "mk3-u127.bin",  0x0600000, 0x100000, CRC(bd985be7) SHA1(f5183abea2e5eb2c2c8cefa72c9ed321679f5128) )
918   ROM_LOAD( "mk3-u126.bin",  0x0700000, 0x100000, CRC(e7c32cf4) SHA1(94ea7b2eed7dae66f5dd676c20d6b360140e3e0e) )
919919
920   ROM_LOAD( "umk-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
921   ROM_LOAD( "umk-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
922   ROM_LOAD( "umk-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
923   ROM_LOAD( "umk-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
920   ROM_LOAD( "mk3-u125.bin",  0x0800000, 0x100000, CRC(9a52227e) SHA1(0474a14fa8dbfea0b0889c1d1756b86391683558) )
921   ROM_LOAD( "mk3-u124.bin",  0x0900000, 0x100000, CRC(5c750ebc) SHA1(45d68af1a56994376e086d840502453c8d6be700) )
922   ROM_LOAD( "mk3-u123.bin",  0x0a00000, 0x100000, CRC(f0ab88a8) SHA1(cdc9dc12e162255845c6627b1e35182b7e8502d0) )
923   ROM_LOAD( "mk3-u122.bin",  0x0b00000, 0x100000, CRC(9b87cdac) SHA1(a5f8db559293978f23e6f105543d8b2e170a2e0d) )
924924
925925   ROM_LOAD( "umk-u121.bin",  0x0c00000, 0x100000, CRC(cc4b95db) SHA1(3d53180eec649e9616c4b87db55573f12d9bfee3) )
926926   ROM_LOAD( "umk-u120.bin",  0x0d00000, 0x100000, CRC(1c8144cd) SHA1(77cdc1eaf630ccb7233f5532f8b08191d00f0816) )
src/mame/drivers/route16.c
r4057r4058
870870   ROM_LOAD( "im5623.f12", 0x0100, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* bottom bitmap */
871871ROM_END
872872
873/*
874rom.b0                  cb7.5b                  IDENTICAL
875rom.a5                  cb6.2.3t                IDENTICAL
876rom.a2                  c3.4.5t                 IDENTICAL
877rom.a1                  c2.5t                   IDENTICAL
878rom.a4                  cb5.3t                  IDENTICAL
879rom.b3                  cb10.3b                 IDENTICAL
880rom.b2                  cb9.4b                  IDENTICAL
881rom.a3                  c4.4t                   IDENTICAL
882rom.a0                  c11.5.6t                99.853516%
883                        mb7052.6k               NO MATCH
884                        mb7052.6m               NO MATCH
885
886Only 3 bytes different between rom.a0 (spacecho) and c11.5.6t (spacech2), at offset 0x8b.
887
888Spacecho:    0x008b:  call $2929    cd 29 29
889
890Spacech2:    0x008b:  im 1          ed 56
891             0x008d:  nop           00
892
893So... spacech2 is avoiding to enter the sub at $2929.
894
895*/
896ROM_START( spacech2 )
897   ROM_REGION( 0x10000, "cpu1", 0 )
898   ROM_LOAD( "c11.5.6t",    0x0000, 0x0800, CRC(90637f25) SHA1(820d2f326a5d8d0a04a0fca46b035624dfd7222c) )   // 3 bytes different at 0x8e
899   ROM_LOAD( "c2.5t",       0x0800, 0x0800, CRC(a5f0a34f) SHA1(359e7a9954dedb464f7456cd071db77b2219ab2c) )
900   ROM_LOAD( "c3.4.5t",     0x1000, 0x0800, CRC(cbbb3acb) SHA1(3dc71683f31da39a544382b463ece39cca8124b3) )
901   ROM_LOAD( "c4.4t",       0x1800, 0x0800, CRC(311050ca) SHA1(ed4a5cb7ec0306654178dae8f30b39b9c8db0ce3) )
902   ROM_LOAD( "cb5.3t",      0x2000, 0x0800, CRC(28943803) SHA1(4904e6d092494bfca064d25d094ab9e9049fa9ca) )
903   ROM_LOAD( "cb6.2.3t",    0x2800, 0x0800, CRC(851c9f28) SHA1(c7bb4e25b74eb71e8b394214f9cbd95f59a1fa58) )
904
905   ROM_REGION( 0x10000, "cpu2", 0 )     /* 64k for the second CPU */
906   ROM_LOAD( "cb7.5b",      0x0000, 0x0800, CRC(db45689d) SHA1(057a8dc2629f57fdeebb6262de2bdd78b4e66dca) )
907   ROM_LOAD( "cb9.4b",      0x1000, 0x0800, CRC(1e074157) SHA1(cb2073415aff7804ac85e2137bef2005bf6cf239) )
908   ROM_LOAD( "cb10.3b",     0x1800, 0x0800, CRC(d50a8b20) SHA1(d733fa327d2e7dfe08c84015c6c326ed8ab39e3d) )
909
910   ROM_REGION( 0x0200, "proms", 0 ) /* Intersil IM5623CPE proms compatible with 82s129 */
911   /* The upper 128 bytes are 0's, used by the hardware to blank the display */
912   ROM_LOAD( "mb7052.6k", 0x0000, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* top bitmap */
913   ROM_LOAD( "mb7052.6m", 0x0100, 0x0100, CRC(08793ef7) SHA1(bfc27aaf25d642cd57c0fbe73ab575853bd5f3ca) ) /* bottom bitmap */
914ROM_END
915
873916ROM_START( ttmahjng )
874917   ROM_REGION( 0x10000, "cpu1", 0 )
875918   ROM_LOAD( "ju04", 0x0000, 0x1000, CRC(fe7c693a) SHA1(be0630557e0bcd9ec2e9542cc4a4d947889ec57a) )
r4057r4058
9631006GAME( 1980, speakres, 0,        speakres, speakres, 0,        ROT270, "Sun Electronics", "Speak & Rescue", 0 )
9641007GAME( 1980, stratvox, speakres, stratvox, stratvox, 0,        ROT270, "[Sun Electronics] (Taito license)", "Stratovox", 0 )
9651008GAME( 1980, stratvob, speakres, stratvox, stratvox, 0,        ROT270, "bootleg", "Stratovox (bootleg)", 0 )
966GAME( 1980, spacecho, speakres, spacecho, spacecho, 0,        ROT270, "bootleg", "Space Echo", 0 )
1009GAME( 1980, spacecho, speakres, spacecho, spacecho, 0,        ROT270, "bootleg", "Space Echo (set 1)", 0 )
1010GAME( 1980, spacech2, speakres, spacecho, spacecho, 0,        ROT270, "bootleg", "Space Echo (set 2)", 0 )
9671011GAME( 1981, ttmahjng, 0,        ttmahjng, ttmahjng, 0,        ROT0,   "Taito", "T.T Mahjong", 0 )
src/mame/drivers/tx1.c
r4057r4058
177177   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
178178   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
179179   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) PORT_TOGGLE
180   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 )
180181
181182   PORT_START("PPI_PORTD")
182183   /* Wire jumper setting on sound PCB */
r4057r4058
282283   PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
283284
284285   PORT_START("PPI_PORTC")
285   PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper:" )
286   PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper" )
286287   PORT_DIPSETTING(    0x00, "0" )
287288   PORT_DIPSETTING(    0x01, "1" )
288289   PORT_DIPSETTING(    0x02, "2" )
r4057r4058
367368
368369   /* Wire jumper setting on sound PCB */
369370   PORT_START("YM2149_IC19_B")
370   PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper:" )
371   PORT_DIPNAME( 0xff, 0x80, "Sound PCB Jumper" )
371372   PORT_DIPSETTING(    0x00, "0" )
372373   PORT_DIPSETTING(    0x01, "1" )
373374   PORT_DIPSETTING(    0x02, "2" )
r4057r4058
409410   return z80_ram[offset];
410411}
411412
412static WRITE8_DEVICE_HANDLER( tx1_coin_cnt )
413
414static WRITE8_DEVICE_HANDLER( tx1_coin_cnt_w )
413415{
414416   coin_counter_w(0, data & 0x80);
415417   coin_counter_w(1, data & 0x40);
418//  coin_counter_w(2, data & 0x40);
416419}
417420
421static WRITE8_DEVICE_HANDLER( bb_coin_cnt_w )
422{
423   coin_counter_w(0, data & 0x01);
424   coin_counter_w(1, data & 0x02);
425//  coin_counter_w(2, data & 0x04);
426}
427
418428static WRITE8_HANDLER( tx1_ppi_latch_w )
419429{
420430   tx1_ppi_latch_a = ((input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4) | (input_port_read(space->machine, "AN_ACCELERATOR") & 0xf);
r4057r4058
431441   return input_port_read(device->machine, "PPI_PORTD") | tx1_ppi_latch_b;
432442}
433443
434/* TODO */
444
445static UINT8 bit_reverse8(UINT8 val)
446{
447   val = ((val & 0xF0) >>  4) | ((val & 0x0F) <<  4);
448   val = ((val & 0xCC) >>  2) | ((val & 0x33) <<  2);
449   val = ((val & 0xAA) >>  1) | ((val & 0x55) <<  1);
450
451   return val;
452}
453
435454static READ8_HANDLER( bb_analog_r )
436455{
437   if ( offset == 1 )
438      return ((input_port_read(space->machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine, "AN_STEERING");
456   if (offset == 0)
457      return bit_reverse8(((input_port_read(space->machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine, "AN_STEERING"));
439458   else
440      return (input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4;
459      return bit_reverse8((input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4);
441460}
442461
443462static READ8_HANDLER( bbjr_analog_r )
444463{
445   if ( offset == 0 )
464   if (offset == 0)
446465      return ((input_port_read(space->machine, "AN_ACCELERATOR") & 0xf) << 4) | input_port_read(space->machine, "AN_STEERING");
447466   else
448467      return (input_port_read(space->machine, "AN_BRAKE") & 0xf) << 4;
r4057r4058
462481   NULL,
463482   DEVICE8_PORT("PPI_PORTC"),
464483   NULL,
484   bb_coin_cnt_w,
465485   NULL,
466   NULL
467486};
468487
469488
r4057r4058
474493   DEVICE8_PORT("PPI_PORTC"),
475494   NULL,
476495   NULL,
477   tx1_coin_cnt
496   tx1_coin_cnt_w
478497};
479498
480499
r4057r4058
588607   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE(&z80_ram)
589608   AM_RANGE(0x6000, 0x6001) AM_READ(bb_analog_r)
590609   AM_RANGE(0x6800, 0x6803) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
591   AM_RANGE(0x7000, 0x7003) AM_RAM
610   AM_RANGE(0x7000, 0x7003) AM_READWRITE(tx1_pit8253_r, tx1_pit8253_w)
592611   AM_RANGE(0x7800, 0x7800) AM_WRITE(z80_intreq_w)
593612   AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(ts_r, ts_w)
594613ADDRESS_MAP_END
r4057r4058
630649};
631650
632651
633/* YM2149 IC19 */
634652static const ay8910_interface buggyboy_ym2149_interface_1 =
635653{
636654   AY8910_LEGACY_OUTPUT,
637655   AY8910_DEFAULT_LOADS,
656   NULL,
657   NULL,
658   bb_ym1_a_w,
659   NULL,
660};
661
662static const ay8910_interface buggyboy_ym2149_interface_2 =
663{
664   AY8910_LEGACY_OUTPUT,
665   AY8910_DEFAULT_LOADS,
666   NULL,
667   NULL,
668   bb_ym2_a_w,
669   bb_ym2_b_w,
670};
671
672
673/* YM2149 IC19 */
674static const ay8910_interface buggybjr_ym2149_interface_1 =
675{
676   AY8910_LEGACY_OUTPUT,
677   AY8910_DEFAULT_LOADS,
638678   input_port_1_r,
639679   input_port_2_r,
640680   NULL,
r4057r4058
642682};
643683
644684/* YM2149 IC24 */
645static const ay8910_interface buggyboy_ym2149_interface_2 =
685static const ay8910_interface buggybjr_ym2149_interface_2 =
646686{
647687   AY8910_LEGACY_OUTPUT,
648688   AY8910_DEFAULT_LOADS,
649689   NULL,
650690   NULL,
651   bb_ym1_a_w,
652   bb_ym1_b_w,
691   bb_ym2_a_w,
692   bb_ym2_b_w,
653693};
654694
655695static const custom_sound_interface tx1_custom_interface =
r4057r4058
674714 *************************************/
675715
676716static MACHINE_DRIVER_START( tx1 )
677   MDRV_CPU_ADD("main", I8086, 5000000)
717   MDRV_CPU_ADD("main", I8086, CPU_MASTER_CLOCK / 3)
678718   MDRV_CPU_PROGRAM_MAP(tx1_main, 0)
679719//  MDRV_WATCHDOG_TIME_INIT(5)
680720
681   MDRV_CPU_ADD("math", I8086,5000000)
721   MDRV_CPU_ADD("math", I8086, CPU_MASTER_CLOCK / 3)
682722   MDRV_CPU_PROGRAM_MAP(tx1_math, 0)
683723
684724   MDRV_CPU_ADD("audio", Z80, TX1_PIXEL_CLOCK / 2)
r4057r4058
729769
730770
731771static MACHINE_DRIVER_START( buggyboy )
732   MDRV_CPU_ADD("main", I8086/*BUGGYBOY_CPU_TYPE*/, 5000000)
772   MDRV_CPU_ADD("main", I8086, CPU_MASTER_CLOCK / 3)
733773   MDRV_CPU_PROGRAM_MAP(buggyboy_main, 0)
734774//  MDRV_WATCHDOG_TIME_INIT(5)
735775
736   MDRV_CPU_ADD("math", I8086/*BUGGYBOY_CPU_TYPE*/, 5000000)
776   MDRV_CPU_ADD("math", I8086, CPU_MASTER_CLOCK / 3)
737777   MDRV_CPU_PROGRAM_MAP(buggyboy_math, 0)
738778
739779   MDRV_CPU_ADD("audio", Z80, BUGGYBOY_ZCLK / 2)
r4057r4058
785825
786826
787827static MACHINE_DRIVER_START( buggybjr )
788   MDRV_CPU_ADD("main", I8086/*BUGGYBOY_CPU_TYPE*/, 5000000)
828   MDRV_CPU_ADD("main", I8086, CPU_MASTER_CLOCK / 3)
789829   MDRV_CPU_PROGRAM_MAP(buggybjr_main, 0)
790830//  MDRV_WATCHDOG_TIME_INIT(5)
791831
792   MDRV_CPU_ADD("math", I8086/*BUGGYBOY_CPU_TYPE*/, 5000000)
832   MDRV_CPU_ADD("math", I8086, CPU_MASTER_CLOCK / 3)
793833   MDRV_CPU_PROGRAM_MAP(buggyboy_math, 0)
794834
795835   MDRV_CPU_ADD("audio", Z80, BUGGYBOY_ZCLK / 2)
r4057r4058
822862//  MDRV_SPEAKER_STANDARD_STEREO("rearleft", "rearright")
823863
824864   MDRV_SOUND_ADD("ym1", YM2149, BUGGYBOY_ZCLK / 4)
825   MDRV_SOUND_CONFIG(buggyboy_ym2149_interface_1)
865   MDRV_SOUND_CONFIG(buggybjr_ym2149_interface_1)
826866   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontleft", 0.15)
827867
828868   MDRV_SOUND_ADD("ym2", YM2149, BUGGYBOY_ZCLK / 4)
829   MDRV_SOUND_CONFIG(buggyboy_ym2149_interface_2)
869   MDRV_SOUND_CONFIG(buggybjr_ym2149_interface_2)
830870   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "frontright", 0.15)
831871
832872   MDRV_SOUND_ADD("buggyboy", CUSTOM, 0)
r4057r4058
10301070   ROM_LOAD( "xb12.ic50",  0x1700, 0x200, CRC(6b424cea) SHA1(83127326c20116b0a4be1126e163f9c6755e19dc) )
10311071ROM_END
10321072
1033/* The single monitor is the parent set at the moment, as the 3-monitor  is incomplete */
1073/*
1074    Buggy Boy Junior/Speed Buggy (Upright)
1075
1076    The single monitor is the parent set at the moment, as the 3-monitor is incomplete
1077
1078    The game is comprised of three boards.
1079        - Sound Board (labeled TC043-1, top small board)
1080        - CPU Board (labeled TC041, middle board, uses 15.000 MHz xtal)
1081        - Video Board (labeled TC042, bottom board, uses 18.000 MHz xtal)
1082*/
1083
10341084ROM_START( buggybjr )
10351085   ROM_REGION( 0x100000, "main", 0 )
10361086   ROM_LOAD16_BYTE( "bug1a.214", 0x20000, 0x8000, CRC(92797c25) SHA1(8f7434abbd7f557d3202abb01b1e4899c82c67a5) )
r4057r4058
10501100   ROM_RELOAD(                  0xc001,  0x2000 )
10511101   ROM_RELOAD(                  0xfc001, 0x2000 )
10521102
1103    /* ROM's Located on the sound board */
10531104   ROM_REGION( 0x10000, "audio", 0 )
10541105   ROM_LOAD( "bug35s.21", 0x00000, 0x4000, CRC(65d9af57) SHA1(17b09404942d17e7254550c43b56ae96a8c55680) )
10551106
r4057r4058
10921143   ROM_LOAD( "bug13.32",   0x0000, 0x2000, CRC(53604d7a) SHA1(bfa304cd885162ece7a5f54988d9880fc541eb3a) )
10931144   ROM_LOAD( "bug18s.141", 0x2000, 0x4000, CRC(67786327) SHA1(32cc1f5bc654497c968ddcd4af29720c6d659482) )
10941145
1146   /* PROMs located on the video board */
10951147   ROM_REGION( 0x10000, "proms", 0 )
10961148   /* RGBI */
10971149   ROM_LOAD( "bb10.41", 0x000, 0x100, CRC(f2368398) SHA1(53f28dba11bb494d033bb279abf138975c84b20d) )
r4057r4058
11111163
11121164   /* Road */
11131165   ROM_LOAD( "bb7.188", 0x1500, 0x100, CRC(b57b609f) SHA1(2dea375437c62cb4c64b21d5e6ddc09397b6ab35) )
1166
1167   /* PALs located on the sound board */
1168   ROM_REGION( 0x00001, "pals_soundbd", 0 )
1169   ROM_LOAD( "pal10l8cn.ic16", 0x00000, 0x00001, NO_DUMP )
1170
1171   /* PALs located on the video board */
1172   ROM_REGION( 0x00002, "pals_vidbd", 0 )
1173   ROM_LOAD( "pal10h8cn.ic82", 0x00000, 0x00001, NO_DUMP )
1174   ROM_LOAD( "pal14h4cn.ic83", 0x00000, 0x00001, NO_DUMP )
1175
1176   /* PALs located on the cpu board */
1177   ROM_REGION( 0x00009, "pals_cpubd", 0 )
1178   ROM_LOAD( "pal16r4a-2cn.ic83", 0x00000, 0x00001, NO_DUMP )
1179   ROM_LOAD( "pal12l6cn.ic87",    0x00000, 0x00001, NO_DUMP )
1180   ROM_LOAD( "pal10l8cn.ic88",    0x00000, 0x00001, NO_DUMP )
1181   ROM_LOAD( "pal14h4cn.ic149",   0x00000, 0x00001, NO_DUMP )
1182   ROM_LOAD( "pal16l8cj.ic150",   0x00000, 0x00001, NO_DUMP )
1183   ROM_LOAD( "pal14l4cn.ic151",   0x00000, 0x00001, NO_DUMP )
1184   ROM_LOAD( "pal14l4cn.ic167",   0x00000, 0x00001, NO_DUMP )
1185   ROM_LOAD( "pal14h4cn.ic229",   0x00000, 0x00001, NO_DUMP )
1186   ROM_LOAD( "pal14h4cn.ic230",   0x00000, 0x00001, NO_DUMP )
11141187ROM_END
11151188
11161189
src/mame/drivers/merit.c
r4057r4058
11301130   ROM_LOAD( "u40.rom",   0x0000, 0x2000, CRC(52298162) SHA1(79aa6c4ab6bec6450d882615e64f61cfef934153) )
11311131ROM_END
11321132
1133ROM_START( pitbossa )
1134    ROM_REGION( 0x10000, "main", 0 )
1135    ROM_LOAD( "m4a1.u5",   0x0000, 0x2000, CRC(f5284472) SHA1(9170b90d06caa382be29feb2f6e80993bba1e07e) )
1136    ROM_LOAD( "m4a1.u6",   0x2000, 0x2000, CRC(dd8df5fe) SHA1(dab8c1077058263729b2589dd9bf9989ad53be1c) )
1137    ROM_LOAD( "m4a1.u7",   0x4000, 0x2000, CRC(5fa5d436) SHA1(9f3fd81eae7f378268f3b4af8fd299ffb97d7fb6) )
1138
1139    ROM_REGION( 0x6000, "gfx1", 0 )
1140    ROM_LOAD( "chr2.u39",  0x0000, 0x2000, CRC(f9613e7b) SHA1(1e8cafe142a235d65b43c7e46a79ed4f6272b61c) )
1141    ROM_LOAD( "chr2.u38",  0x2000, 0x2000, CRC(7af28902) SHA1(04f685389958d581aaf2c86940d1b8b8cec05d7a) )
1142   ROM_LOAD( "chr2.u37",  0x4000, 0x2000, CRC(ea6f0c59) SHA1(f2c0ff99518c2cec3eb1b4042fa3754a702c0e34) )
1143
1144   ROM_REGION( 0x2000, "gfx2", 0 )
1145   ROM_LOAD( "chr2.u40",  0x0000, 0x2000, CRC(40c94dce) SHA1(86611e3a1048b2a3fffcc0110811656a2d0fc4a5) )
1146ROM_END
1147
11331148ROM_START( casino5 )
11341149   ROM_REGION( 0x10000, "main", 0 )
11351150   ROM_LOAD( "u5",           0x0000, 0x2000, CRC(abe240d8) SHA1(296eb3251dd51147d6984a8c08c3be22e5ed8e86) )
r4057r4058
11991214   ROM_LOAD( "trivia2.spo",  0x28000, 0x8000, CRC(ee9263b3) SHA1(1644ab01f17e3af1e193e509d64dcbb243d3eb80) )
12001215ROM_END
12011216
1217/* question board only - this contained a variety of roms from the 'trvwzh' and 'trvwzha' sets
1218  as well as 2 unique general knowledge ones */
1219ROM_START( trvwzhb )
1220   ROM_REGION( 0x10000, "main", 0 )
1221   ROM_LOAD( "trivia.u5",    0x0000, 0x2000, CRC(731fd5b1) SHA1(1074780321029446da0e6765b9e036b06b067a48) )
1222   ROM_LOAD( "trivia.u6",    0x2000, 0x2000, CRC(af6886c0) SHA1(48005b921d7ce33ffc0ba160be82053a26382a9d) )
1223
1224   ROM_REGION( 0x6000, "gfx1", 0 )
1225   ROM_LOAD( "trivia.u39",   0x0000, 0x2000, CRC(f8a5f5fb) SHA1(a511e1a2b5e887ef00dc919e9e664ccec2d36cfa) )
1226   ROM_LOAD( "trivia.u38",   0x2000, 0x2000, CRC(27621e52) SHA1(a7e88d329e2e774fef9bd8c5cefb4d8f1cfcba4c) )
1227   ROM_LOAD( "trivia.u37",   0x4000, 0x2000, CRC(f739b5dc) SHA1(fbf469b7f4cab50e06ec2def9344e3b9801a275e) )
1228
1229   ROM_REGION( 0x2000, "gfx2", 0 )
1230   ROM_LOAD( "trivia.u40",   0x0000, 0x2000, CRC(cea7319f) SHA1(663cd18a4699dfd5ad1d3357094eff247e9b4a47) )
1231
1232   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1233   ROM_LOAD( "merit2_6.1",   0x08000, 0x8000, CRC(8a4bcde3) SHA1(528ae9d3ff0b98201f89fd6b93a712cd7f0e9ab4) ) // 0xxxxxxxxxxxxxx = 0x00
1234   ROM_LOAD( "merit2_6.2",   0x18000, 0x8000, CRC(ded7e124) SHA1(7e6e04ae79dceba70d83ccfde4f9d0ccc0737c78) )
1235ROM_END
1236
12021237ROM_START( trvwzv )
12031238   ROM_REGION( 0x10000, "main", 0 )
12041239   ROM_LOAD( "u5.bin",       0x0000, 0x2000, CRC(fd3531ac) SHA1(d11573df65676e704b28cc2d99fb004b48a358a4) )
r4057r4058
12661301   ROM_LOAD( "sex-101.02a",  0x98000, 0x8000, CRC(2596091b) SHA1(7fbb9c2c3f74e12714513928c8cf3769bf29fc8b) )
12671302ROM_END
12681303
1304/* questions only - this dump contained a variety of questions from the 'trvwz2' ones above,
1305 and 2 unique roms, which are Sex Trivia */
1306ROM_START( trvwz2a )
1307   ROM_REGION( 0x10000, "main", 0 )
1308   ROM_LOAD( "u5_0e",        0x0000, 0x2000, CRC(97b8d320) SHA1(573945531113d8aae9418ba1e9a2063052227029) )
1309   ROM_LOAD( "u6_0e",        0x2000, 0x2000, CRC(2e86288d) SHA1(62c7024d8dfebed9bb05ea91302efe5d18cb7d2a) )
1310
1311   ROM_REGION( 0x6000, "gfx1", 0 )
1312   ROM_LOAD( "u39",          0x0000, 0x2000, CRC(b9d9a80e) SHA1(55b6a0d09f8619df93ba936e083835c859a557df) )
1313   ROM_LOAD( "u38",          0x2000, 0x2000, CRC(8348083e) SHA1(260a4c1ae043e7ceac65a8818c23940d32275879) )
1314   ROM_LOAD( "u37",          0x4000, 0x2000, CRC(b4d3c9f4) SHA1(dda99549306519c147d275d8c6af672e80a96b67) )
1315
1316   ROM_REGION( 0x2000, "gfx2", 0 )
1317   ROM_LOAD( "u40a",         0x0000, 0x2000, CRC(fbfae092) SHA1(b8569819952a5c805f11b6854d64b3ae9c857f97) )
1318
1319   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1320   ROM_LOAD( "merit2_4.0",  0x08000, 0x8000, CRC(069b59a3) SHA1(e3d75edd3a9271df73bf51f409f066547025abbe) ) // Sex Trivia
1321   ROM_LOAD( "merit2_4.1",  0x18000, 0x8000, CRC(938d319f) SHA1(5b5841692666c31f2c09cb318f7e106942fffea7) ) // Sex Trivia
1322ROM_END
1323
12691324ROM_START( trvwz3h )
12701325   ROM_REGION( 0x10000, "main", 0 )
12711326   ROM_LOAD( "u5",           0x0000, 0x2000, CRC(ad4ab519) SHA1(80e99f4e5542115e34074b41bbc69906e01a408f) )
r4057r4058
13171372   ROM_LOAD( "0",     0x98000, 0x8000, CRC(b395cd97) SHA1(a42c7c1687eaba64a725888cd6413568cc90b010) )
13181373ROM_END
13191374
1375ROM_START( trvwz3ha )
1376   ROM_REGION( 0x10000, "main", 0 )
1377   ROM_LOAD( "merit6.u5",           0x0000, 0x2000, CRC(e0a07f06) SHA1(02cde0fc4a62d108ecd3e2f7704b9166c31707f2) )
1378   ROM_LOAD( "merit6.u6",           0x2000, 0x2000, CRC(223482d6) SHA1(4d9dbce7505b98ccd8e2b55f6f86a59b213d72a1) )
1379
1380   ROM_REGION( 0x6000, "gfx1", 0 )
1381   ROM_LOAD( "merit6.u39",          0x0000, 0x2000, CRC(f8a5f5fb) SHA1(a511e1a2b5e887ef00dc919e9e664ccec2d36cfa) )
1382   ROM_LOAD( "merit6.u38",          0x2000, 0x2000, CRC(27621e52) SHA1(a7e88d329e2e774fef9bd8c5cefb4d8f1cfcba4c) )
1383   ROM_LOAD( "merit6.u37",          0x4000, 0x2000, CRC(f739b5dc) SHA1(fbf469b7f4cab50e06ec2def9344e3b9801a275e) )
1384
1385   ROM_REGION( 0x2000, "gfx2", 0 )
1386   ROM_LOAD( "merit6.u40",          0x0000, 0x2000, CRC(e829473f) SHA1(ba754d9377d955b409970494e1a14dbe1d359ee5) )
1387
1388   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1389   ROM_LOAD( "merit6.9",           0x08000, 0x8000, CRC(974dca96) SHA1(eb4a745c84307a1bbb220659877f97c28cd515ac) )
1390   ROM_LOAD( "merit6.8",           0x18000, 0x8000, CRC(503115a1) SHA1(5e6630191465b3d2a590fab08b4f47f7408ecc44) )
1391   ROM_LOAD( "merit6.6",           0x28000, 0x8000, CRC(0e4fe73d) SHA1(9aee22a5837637ec5e360b72e71555942df1d26f) )
1392   ROM_LOAD( "merit6.5",           0x38000, 0x8000, CRC(f56c0935) SHA1(8e16133ad90829bbc0e0f2e9ee9c26e9d0c5057e) )
1393   ROM_LOAD( "merit6.7",           0x48000, 0x8000, CRC(057f6676) SHA1(a93a7a76fc8b8263568a50b00a57f3abe76c9aa3) )
1394   ROM_LOAD( "merit6.0",           0x58000, 0x8000, CRC(1fa46b86) SHA1(16d54d0932fe342399faf303eafa3c0b7ba2e202) )
1395   ROM_LOAD( "merit6.3",           0x68000, 0x8000, CRC(b395cd97) SHA1(a42c7c1687eaba64a725888cd6413568cc90b010) )
1396   ROM_LOAD( "merit6.2",           0x78000, 0x8000, CRC(b064876b) SHA1(588300fb6603f334de41a9685b1fcf8c642b5c16) )
1397
1398   ROM_REGION( 0x8000, "misc", 0 )
1399   ROM_LOAD( "merit6.u13",         0x00000, 0x1f3, CRC(686d2ad0) SHA1(7aad0a1ed09942528eceaf4d7a5e1fd7601aeac7) )
1400   ROM_LOAD( "merit6.1",           0x00000, 0x8000, CRC(77a2a734) SHA1(7ba662d275b7914c9dcc9532116086e091e6cf88) ) // should be a question rom, but doesn't work, bad, or from a different game?
1401ROM_END
1402
13201403ROM_START( trvwz4 )
13211404   ROM_REGION( 0x10000, "main", 0 )
13221405   ROM_LOAD( "u5.bin",       0x0000, 0x8000, CRC(bc23a1ab) SHA1(b9601f316e373c568c5b208de417617094046559) )
r4057r4058
13421425   ROM_LOAD( "spo_4_2.bin",  0x98000, 0x8000, CRC(3f3390e0) SHA1(50bd7b79268438584bb0f497ab0055b4d4864590) )
13431426ROM_END
13441427
1428/* only the question board was dumped, but it contained a selection
1429  of roms from the above 'trvwz4' set, and one additional one which is Sex Trivia III
1430*/
1431ROM_START( trvwz4a )
1432   ROM_REGION( 0x10000, "main", 0 )
1433   ROM_LOAD( "u5.bin",       0x0000, 0x8000, CRC(bc23a1ab) SHA1(b9601f316e373c568c5b208de417617094046559) )
1434
1435   ROM_REGION( 0x6000, "gfx1", 0 )
1436   ROM_LOAD( "u39.bin",      0x0000, 0x2000, CRC(b9d9a80e) SHA1(55b6a0d09f8619df93ba936e083835c859a557df) )
1437   ROM_LOAD( "u38.bin",      0x2000, 0x2000, CRC(8348083e) SHA1(260a4c1ae043e7ceac65a8818c23940d32275879) )
1438   ROM_LOAD( "u37.bin",      0x4000, 0x2000, CRC(b4d3c9f4) SHA1(dda99549306519c147d275d8c6af672e80a96b67) )
1439
1440   ROM_REGION( 0x2000, "gfx2", 0 )
1441   ROM_LOAD( "u40.bin",      0x0000, 0x2000, CRC(fbfae092) SHA1(b8569819952a5c805f11b6854d64b3ae9c857f97) )
1442
1443   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1444   ROM_LOAD( "merit2_5.0",  0x08000, 0x8000, CRC(e07d139f) SHA1(e364dcc628719c1bcdc119bdb2f3c98b5538c411) ) // sex trivia III
1445ROM_END
1446
13451447/*
13461448
13471449crt200 rev e-1
r4057r4058
14131515   ROM_LOAD( "phrz.6",       0x50000, 0x8000, CRC(48e24f17) SHA1(f50c85505f6ab2360f0885494001f174224f8575) )
14141516ROM_END
14151517
1518ROM_START( phrcraza )
1519   ROM_REGION( 0x10000, "main", 0 )
1520   ROM_LOAD( "merit5.u5",      0x00000, 0x8000, CRC(d04c7657) SHA1(0b59fbf553eb5b68544ee2f94cf8106ab30ff1ed) )
1521
1522   ROM_REGION( 0x18000, "gfx1", 0 )
1523   ROM_LOAD( "merit5.u37",       0x00000, 0x8000, CRC(237e221a) SHA1(7aa69375c2b9a9e73e0e4ed207bf595368b2deb2) )
1524   ROM_LOAD( "merit5.u38",       0x08000, 0x8000, CRC(bfa78b67) SHA1(1b51c0e00240f798fe717624e706cb15700bc2f9) )
1525   ROM_LOAD( "merit5.u39",       0x10000, 0x8000, CRC(9ce22cb3) SHA1(b653afb8f13decd993e434aaad69a6e09ab65f83) )
1526
1527   ROM_REGION( 0x08000, "gfx2", 0 )
1528   ROM_LOAD( "merit5.u40",       0x00000, 0x8000, CRC(17dcddd4) SHA1(51682bdbfb67cd0ccf20b97e8fa12d72f0fe82ed) )
1529
1530   ROM_REGION( 0xa0000, "user1", ROMREGION_ERASEFF ) /* questions */
1531   ROM_LOAD( "merit2_0.0",     0x00000, 0x8000, CRC(7ef3bca7) SHA1(f25cd01f996882a500e1a800d924759cd1de255d) )
1532   ROM_LOAD( "merit2_0.1",     0x10000, 0x8000, CRC(ed7604b8) SHA1(b1e841b50b8ef6ae95fafac1c34b6d0337a05d18) )
1533   ROM_LOAD( "merit2_0.2",     0x20000, 0x8000, CRC(423eecd6) SHA1(ca8d181ccba05acba8ebc57f20e0542eda00c917) )
1534   ROM_LOAD( "merit2_0.3",     0x30000, 0x8000, CRC(05dd3900) SHA1(bb13a3c5f84771c450fa88560cc74c5a1be1b876) )
1535   ROM_LOAD( "merit2_0.4",     0x40000, 0x8000, CRC(c5980f24) SHA1(a3b665c74aaa704ffa382f95adac70c7c46fb446) )
1536   ROM_LOAD( "merit2_0.5",     0x50000, 0x8000, CRC(7cb395a9) SHA1(48b3ac524e6ae23f885b9b767e77930a89a81f5f) )
1537   ROM_LOAD( "merit2_0.6",     0x60000, 0x8000, CRC(effc811b) SHA1(2479539965ed541be417bbe48a5e66a58a6294aa) )
1538   ROM_LOAD( "merit2_0.7",     0x70000, 0x8000, CRC(c4c7dcee) SHA1(81d879df3da0fbe1cf2247d92b3853104a99689d) )
1539   ROM_LOAD( "merit2_0.8",     0x80000, 0x8000, CRC(527b3025) SHA1(36dc129d2276909643e90ae3810c8341076fd88c) )
1540   ROM_LOAD( "merit2_0.9",     0x90000, 0x8000, CRC(367f1dfa) SHA1(01d69004c365acefb0e52ac12593a3874c16ab9d) )
1541ROM_END
1542
14161543ROM_START( phrcrazs )
14171544   ROM_REGION( 0x10000, "main", 0 )
14181545   ROM_LOAD( "u5.bin",       0x00000, 0x8000, CRC(6122b5bb) SHA1(9952b14334287a992eefefbdc887b9a9215304ef) )
r4057r4058
15621689   memory_set_bankptr(machine, 1,ROM + 0x10000 + (0x2000 * 2));
15631690}
15641691
1565GAME( 1983, pitboss,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Pit Boss",                                    GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
1692GAME( 1983, pitboss,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Pit Boss (Set 1)",                            GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
1693GAME( 1983, pitbossa, pitboss, pitboss,  pitboss,  0,      ROT0,  "Merit", "Pit Boss (Set 2)",                            GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS )
1694
15661695GAME( 1983, casino5,  0,       pitboss,  pitboss,  0,      ROT0,  "Merit", "Casino 5",                                    GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1567GAME( 1985, trvwzh,   0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal - Question set 1)", GAME_SUPPORTS_SAVE )
1568GAME( 1985, trvwzha,  trvwzh,  trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal - Question set 2)", GAME_SUPPORTS_SAVE )
1569GAME( 1985, trvwzv,   0,       trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical - Question set 1)",   GAME_SUPPORTS_SAVE )
1570GAME( 1985, trvwzva,  trvwzv,  trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical - Question set 2)",   GAME_SUPPORTS_SAVE )
1571GAME( 1985, trvwz2,   0,       trvwhiz,  trivia,   key_2,  ROT90, "Merit", "Trivia ? Whiz (Edition 2)",                   GAME_SUPPORTS_SAVE )
1572GAME( 1985, trvwz3h,  0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Edition 3 - Horizontal)",      GAME_SUPPORTS_SAVE )
1573GAME( 1985, trvwz3v,  0,       trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Edition 3 - Vertical)",        GAME_SUPPORTS_SAVE )
1574GAME( 1985, trvwz4,   0,       trvwhziv, trvwhziv, key_5,  ROT90, "Merit", "Trivia ? Whiz (Edition 4)",                   GAME_SUPPORTS_SAVE )
1696
1697GAME( 1985, trvwzh,   0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal) (question set 1)", GAME_SUPPORTS_SAVE )
1698GAME( 1985, trvwzha,  trvwzh,  trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal) (question set 2)", GAME_SUPPORTS_SAVE )
1699GAME( 1985, trvwzhb,  trvwzh,  trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Horizontal) (question set 3)", GAME_SUPPORTS_SAVE )
1700GAME( 1985, trvwzv,   trvwzh,  trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical) (question set 1)",   GAME_SUPPORTS_SAVE )
1701GAME( 1985, trvwzva,  trvwzh,  trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Vertical) (question set 2)",   GAME_SUPPORTS_SAVE )
1702
1703GAME( 1985, trvwz2,   0,       trvwhiz,  trivia,   key_2,  ROT90, "Merit", "Trivia ? Whiz (Edition 2) (question set 1)",  GAME_SUPPORTS_SAVE )
1704GAME( 1985, trvwz2a,  trvwz2,  trvwhiz,  trivia,   key_2,  ROT90, "Merit", "Trivia ? Whiz (Edition 2) (question set 2)",  GAME_SUPPORTS_SAVE )
1705
1706GAME( 1985, trvwz3h,  0,       trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Edition 3 - Horizontal) (set 1)",GAME_SUPPORTS_SAVE )
1707GAME( 1985, trvwz3ha, trvwz3h, trvwhiz,  trivia,   key_0,  ROT0,  "Merit", "Trivia ? Whiz (Edition 3 - Horizontal) (set 2)",GAME_SUPPORTS_SAVE )
1708GAME( 1985, trvwz3v,  trvwz3h, trvwhiz,  trivia,   key_0,  ROT90, "Merit", "Trivia ? Whiz (Edition 3 - Vertical)",        GAME_SUPPORTS_SAVE )
1709
1710GAME( 1985, trvwz4,   0,       trvwhziv, trvwhziv, key_5,  ROT90, "Merit", "Trivia ? Whiz (Edition 4) (question set 1)",  GAME_SUPPORTS_SAVE )
1711GAME( 1985, trvwz4a,  trvwz4,  trvwhziv, trvwhziv, key_5,  ROT90, "Merit", "Trivia ? Whiz (Edition 4) (question set 2)",  GAME_SUPPORTS_SAVE )
1712
15751713GAME( 1985, tictac,   0,       tictac,   tictac,   key_4,  ROT0,  "Merit", "Tic Tac Trivia",                              GAME_SUPPORTS_SAVE )
1576GAME( 1986, phrcraze, 0,       phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze",                                GAME_SUPPORTS_SAVE )
1577GAME( 1986, phrcrazs, 0,       phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit)",                      GAME_SUPPORTS_SAVE )
1714
1715GAME( 1986, phrcraze, 0,       phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze (set 1)",                         GAME_SUPPORTS_SAVE )
1716GAME( 1986, phrcraza, phrcraze,phrcraze, phrcraze, key_7,  ROT0,  "Merit", "Phraze Craze (set 2)",                      GAME_SUPPORTS_SAVE )
1717GAME( 1986, phrcrazs, phrcraze,phrcraze, phrcrazs, key_7,  ROT90, "Merit", "Phraze Craze (Sex Kit)",                      GAME_SUPPORTS_SAVE )
1718
15781719GAME( 1986, bigappg,  0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Big Apple Games ?",                           GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1720
15791721GAME( 1986, dodge,    0,       bigappg,  bigappg,  0,      ROT0,  "Merit", "Dodge City",                                  GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
1722
15801723GAME( 1988, couple,   0,       couple,   couple,   couple, ROT0,  "Merit", "The Couples (Set 1)",                         GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
15811724GAME( 1988, couplep,  couple,  couple,   couplep,  couple, ROT0,  "Merit", "The Couples (Set 2)",                         GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
15821725GAME( 1988, couplei,  couple,  couple,   couple,   couple, ROT0,  "Merit", "The Couples (Set 3)",                         GAME_IMPERFECT_GRAPHICS | GAME_UNEMULATED_PROTECTION )
src/mame/drivers/cchance.c
r0r4058
1/***************************************************************************************************************************
2
3Cherry Chance (c) 1987 Taito Corporation?
4
5driver by David Haywood & Angelo Salese
6
7A cherry-type game that uses the tnzs video chip,might be a modified board as well.
8
9TODO:
10-imperfect hopper emulation makes this game to not coin up and gives "hopper time out errors" when you win (put dsw 1
11(0x01) and 8 (0x80) to enable hopper full-mode);
12-Wrong colors,caused by missing color proms;
13
14============================================================================================================================
15
16Cherry Chance Readme
17
18This one should be a simple project, it uses a Z80 and a Seta graphics chipset and a YM2149 for sound. It is a slot machine.
19
20There are 3 banks of dipswitches, 4,8,8. Battery backup of a 4364 cpu ram. 2 6264 video rams. All 5 eproms are 27512
21
22Chip    checksum
23cpu $ba0d
24cha0    $2ed7
25cha1    $dc81
26cha2    $cca8
27cha3    $10d8
28
292 color proms for the output. will get those dumped as well.
30
31
32*****************************************************************************************************************************/
33
34
35#include "driver.h"
36#include "cpu/z80/z80.h"
37#include "includes/tnzs.h"
38#include "sound/ay8910.h"
39
40static WRITE8_HANDLER( output_0_w )
41{
42
43   //---- --x- divider?
44   coin_lockout_w(0,~data & 1);
45
46//  coin_counter_w(0,~data & 1);
47}
48
49static UINT8 hop_io,bell_io;
50
51static READ8_HANDLER( input_1_r )
52{
53   return (hop_io) | (bell_io) | (input_port_read(space->machine,"SP") & 0xff);
54}
55
56static WRITE8_HANDLER( output_1_w )
57{
58   hop_io = (data & 0x40)>>4;
59   bell_io = (data & 0x80)>>4;
60}
61
62static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
63   AM_RANGE(0x0000, 0x7fff) AM_ROM
64
65   AM_RANGE(0xa000, 0xbfff) AM_RAM AM_BASE(&tnzs_objram)
66
67   AM_RANGE(0xc000, 0xdfff) AM_RAM
68
69   AM_RANGE(0xe000, 0xe1ff) AM_RAM AM_BASE(&tnzs_vdcram)
70   AM_RANGE(0xe200, 0xe2ff) AM_RAM AM_BASE(&tnzs_scrollram) /* scrolling info */
71   AM_RANGE(0xe300, 0xe303) AM_RAM AM_MIRROR(0xfc) AM_BASE(&tnzs_objctrl) /* control registers (0x80 mirror used by Arkanoid 2) */
72   AM_RANGE(0xe800, 0xe800) AM_WRITE(SMH_RAM) AM_BASE(&tnzs_bg_flag)   /* enable / disable background transparency */
73
74   AM_RANGE(0xf000, 0xf000) AM_READNOP AM_WRITENOP //???
75   AM_RANGE(0xf001, 0xf001) AM_READ(input_1_r) AM_WRITE(output_0_w)
76   AM_RANGE(0xf002, 0xf002) AM_READ_PORT("IN0") AM_WRITE(output_1_w)
77   AM_RANGE(0xf800, 0xf800) AM_WRITE(ay8910_control_port_0_w)
78   AM_RANGE(0xf801, 0xf801) AM_READWRITE(ay8910_read_port_0_r, ay8910_write_port_0_w)
79ADDRESS_MAP_END
80
81
82static INPUT_PORTS_START( cchance )
83   PORT_START("IN0")
84   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 )
85   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
86   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
87   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Bet SW") PORT_CODE(KEYCODE_X)
88   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Analyzer")
89   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Payout SW")  PORT_CODE(KEYCODE_L)
90   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
91   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
92   PORT_START("SP")
93   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Opt 1") PORT_CODE(KEYCODE_A)
94   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Opt 2") PORT_CODE(KEYCODE_S)
95//  PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Payout") PORT_CODE(KEYCODE_D)
96//  PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Hop Over") PORT_CODE(KEYCODE_F)
97   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Slottle") PORT_CODE(KEYCODE_Z)
98   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Drop SW") PORT_CODE(KEYCODE_H)
99   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset Key") PORT_CODE(KEYCODE_J)
100   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Last Key") PORT_CODE(KEYCODE_K)
101   PORT_START("DSW1")
102   PORT_DIPNAME( 0x01, 0x00, "DSW1" )
103   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
104   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
105   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
106   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
107   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
108   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
109   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
110   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
111   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
112   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
113   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
114   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
115   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
116   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
117   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
118   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
119   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
120   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
121   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
122   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
123   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
124   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
125   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
126   PORT_START("DSW2") //likely to be unused
127   PORT_DIPNAME( 0x01, 0x01, "DSW2" )
128   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
129   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
130   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
131   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
132   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
133   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
134   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
135   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
136   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
137   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
138   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
139   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
140   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
141   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
142   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
143   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
144   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
145   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
146   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
147   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
148   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
149   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
150   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
151INPUT_PORTS_END
152
153static const gfx_layout cchance_layout =
154{
155   16,16,
156   RGN_FRAC(1,4),
157   4,
158   { RGN_FRAC(3,4), RGN_FRAC(2,4), RGN_FRAC(1,4), RGN_FRAC(0,4) },
159   { 0, 1, 2, 3, 4, 5, 6, 7,
160         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
161   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
162         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
163   32*8
164};
165
166
167
168static GFXDECODE_START( cchance )
169   GFXDECODE_ENTRY( "gfx1", 0, cchance_layout,   0x0, 32  )
170GFXDECODE_END
171
172static READ8_HANDLER( dsw1_r )
173{
174   return input_port_read(space->machine, "DSW1");
175}
176
177static READ8_HANDLER( dsw2_r )
178{
179   return input_port_read(space->machine, "DSW2");
180}
181
182static const ay8910_interface ay8910_config =
183{
184   AY8910_LEGACY_OUTPUT,
185   AY8910_DEFAULT_LOADS,
186   dsw1_r,
187   dsw2_r,
188   NULL,
189   NULL
190};
191
192static MACHINE_DRIVER_START( cchance )
193   MDRV_CPU_ADD("main", Z80,4000000)       /* ? MHz */
194   MDRV_CPU_PROGRAM_MAP(main_map,0)
195   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
196
197   MDRV_GFXDECODE(cchance)
198
199   /* video hardware */
200   MDRV_SCREEN_ADD("main", RASTER)
201   MDRV_SCREEN_REFRESH_RATE(57.5)
202   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
203   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
204   MDRV_SCREEN_SIZE(32*8, 32*8)
205   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
206
207   MDRV_PALETTE_LENGTH(512)
208
209   MDRV_PALETTE_INIT(arknoid2)
210   MDRV_VIDEO_UPDATE(tnzs)
211   MDRV_VIDEO_EOF(tnzs)
212
213   MDRV_SPEAKER_STANDARD_MONO("mono")
214
215   MDRV_SOUND_ADD("ay", AY8910, 1500000/2)
216   MDRV_SOUND_CONFIG(ay8910_config)
217   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
218MACHINE_DRIVER_END
219
220ROM_START( cchance )
221   ROM_REGION( 0x10000, "main", 0 )
222   ROM_LOAD("chance-cccpu.bin", 0x00000, 0x10000, CRC(77531028) SHA1(6f647dea3f1c5884c32a35e04ab6c8a61688171a) )
223
224   ROM_REGION( 0x40000, "gfx1", 0 )
225   ROM_LOAD("chance-cccha0.bin", 0x30000, 0x10000, CRC(df8403cf) SHA1(997a6e07079fcbcae2fb82bbd7af0db9b90a03e0))
226   ROM_LOAD("chance-cccha1.bin", 0x20000, 0x10000, CRC(26fddc7d) SHA1(d89757c28f14dccdc7d898e19fea59f41f4fa903) )
227   ROM_LOAD("chance-cccha2.bin", 0x10000, 0x10000, CRC(fa5ccf5b) SHA1(21957a6a7b88c315d1fbb82e98a924a637a28397) )
228   ROM_LOAD("chance-cccha3.bin", 0x00000, 0x10000, CRC(2a2979c9) SHA1(5036313e219ec561fa6753f0db6bb28c6fc97963) )
229
230   ROM_REGION( 0x0400, "proms", 0 )      /* color proms */
231   ROM_LOAD( "prom1", 0x0000, 0x0200, NO_DUMP )
232   ROM_LOAD( "prom2", 0x0200, 0x0200, NO_DUMP )
233ROM_END
234
235GAME( 1987?, cchance,  0,    cchance, cchance,  0, ROT0, "unknown", "Cherry Chance", GAME_NOT_WORKING | GAME_WRONG_COLORS )
236
src/mame/drivers/m72.c
r4057r4058
24482448   ROM_LOAD( "m72_a-4d-.bin",  0x0000, 0x0001, NO_DUMP ) /* PAL16L8 at IC19 */
24492449ROM_END
24502450
2451ROM_START( rtypeb )
2452   ROM_REGION( 0x100000, "main", 0 ) /* Roms located on the M72-ROM-C rom board */
2453   ROM_LOAD16_BYTE( "7.512", 0x00001, 0x10000, CRC(eacc8024) SHA1(6bcf1d4ea182b7341eac736d2a5d5f70deec0758) )
2454   ROM_LOAD16_BYTE( "1.512", 0x00000, 0x10000, CRC(2e5fe27b) SHA1(a3364be5ab9c67aaa2152baf39ea12c571eca3cc) )
2455   ROM_LOAD16_BYTE( "8.512", 0x20001, 0x10000, CRC(22cc4950) SHA1(ada5cffc13c38391a334411632237166a6be4938) )
2456   ROM_RELOAD(                      0xe0001, 0x10000 )
2457   ROM_LOAD16_BYTE( "2.512", 0x20000, 0x10000, CRC(ada7b90e) SHA1(c9d2caed95b95d1c1718a10766bc88b2f8f51619) )
2458   ROM_RELOAD(                      0xe0000, 0x10000 )
2459
2460   ROM_REGION( 0x80000, "gfx1", ROMREGION_DISPOSE ) /* Roms located on the M72-ROM-C rom board */
2461   ROM_LOAD( "rt_r-00.1h", 0x00000, 0x10000, CRC(dad53bc0) SHA1(1e3bc498861946278a0b1fe24259f5d224e265d7) )   /* sprites */
2462   ROM_LOAD( "rt_r-01.1j", 0x10000, 0x08000, CRC(5e441e7f) SHA1(6741eb7f2d9d985b5a89eefc73ea44c3e38de6f7) )
2463   ROM_RELOAD(             0x18000, 0x08000 )
2464   ROM_LOAD( "rt_r-10.1k", 0x20000, 0x10000, CRC(d6a66298) SHA1(d2873d05aa3b257e7699c188880ac3daad672fa5) )
2465   ROM_LOAD( "rt_r-11.1l", 0x30000, 0x08000, CRC(791df4f8) SHA1(5239a97222212ac9c019177771cb2b5096b7bc17) )
2466   ROM_RELOAD(             0x38000, 0x08000 )
2467   ROM_LOAD( "rt_r-20.3h", 0x40000, 0x10000, CRC(fc247c8a) SHA1(01cf0a60f47fa5e2ed430a3f075e69e6cb762a48) )
2468   ROM_LOAD( "rt_r-21.3j", 0x50000, 0x08000, CRC(ed793841) SHA1(7e55a9a11fcd989db39bce6be48821b747c7d97f) )
2469   ROM_RELOAD(             0x58000, 0x08000 )
2470   ROM_LOAD( "rt_r-30.3k", 0x60000, 0x10000, CRC(eb02a1cb) SHA1(60a394ab53afdcbbf9e88083b8dbe8c897170d77) )
2471   ROM_LOAD( "rt_r-31.3l", 0x70000, 0x08000, CRC(8558355d) SHA1(b5467d1f22f6e5f90c5d8a8ac2d55974f287d589) )
2472   ROM_RELOAD(             0x78000, 0x08000 )
2473
2474   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE ) /* Roms located on the M72-B-D rom board */
2475   ROM_LOAD( "rt_b-a0.3c", 0x00000, 0x08000, CRC(4e212fb0) SHA1(687061ecade2ebd0bd1343c9c4a831791853f79c) )   /* tiles #1 */
2476   ROM_LOAD( "rt_b-a1.3d", 0x08000, 0x08000, CRC(8a65bdff) SHA1(130bf6af521f13247a739a95eab4bdaa24b2ac10) )
2477   ROM_LOAD( "rt_b-a2.3a", 0x10000, 0x08000, CRC(5a4ae5b9) SHA1(95c3b64f50e6f673b2bf9b40642c152da5009d25) )
2478   ROM_LOAD( "rt_b-a3.3e", 0x18000, 0x08000, CRC(73327606) SHA1(9529ecdedd30e2a0400fb1083117992cc18b5158) )
2479
2480   ROM_REGION( 0x20000, "gfx3", ROMREGION_DISPOSE ) /* Roms located on the M72-B-D rom board */
2481   ROM_LOAD( "rt_b-b0.3j", 0x00000, 0x08000, CRC(a7b17491) SHA1(5b390770e56ba2d35e108534d7eda8dca996fdf7) )   /* tiles #2 */
2482   ROM_LOAD( "rt_b-b1.3k", 0x08000, 0x08000, CRC(b9709686) SHA1(700905a3e9661e0874939f54da2909e1396ce596) )
2483   ROM_LOAD( "rt_b-b2.3h", 0x10000, 0x08000, CRC(433b229a) SHA1(14222eaa3e67e5a7f80eafcf22bac4eb2d485a9a) )
2484   ROM_LOAD( "rt_b-b3.3f", 0x18000, 0x08000, CRC(ad89b072) SHA1(e2683d0e7415f3abd147e518bf6c87e44744cd4f) )
2485ROM_END
2486
24512487ROM_START( bchopper )
24522488   ROM_REGION( 0x100000, "main", 0 )
24532489   ROM_LOAD16_BYTE( "c-h0-b.rom",   0x00001, 0x10000, CRC(f2feab16) SHA1(03ee874658e0f59957f8425e1ebf9c938737cc19) )
r4057r4058
34143450GAME( 1987, rtypej,   rtype,    rtype,    rtype,    0,        ROT0,   "Irem", "R-Type (Japan)", GAME_NO_COCKTAIL )
34153451GAME( 1987, rtypejp,  rtype,    rtype,    rtypep,   0,        ROT0,   "Irem", "R-Type (Japan prototype)", GAME_NO_COCKTAIL )
34163452GAME( 1987, rtypeu,   rtype,    rtype,    rtype,    0,        ROT0,   "Irem (Nintendo of America license)", "R-Type (US)", GAME_NO_COCKTAIL )
3453GAME( 1987, rtypeb,   rtype,    rtype,    rtype,    0,        ROT0,   "bootleg", "R-Type (World bootleg)", GAME_NO_COCKTAIL )
34173454GAME( 1987, bchopper, 0,        m72,      bchopper, bchopper, ROT0,   "Irem", "Battle Chopper", GAME_NO_COCKTAIL )
34183455GAME( 1987, mrheli,   bchopper, m72,      bchopper, mrheli,   ROT0,   "Irem", "Mr. HELI no Dai-Bouken", GAME_NO_COCKTAIL )
34193456GAME( 1988, nspirit,  0,        m72,      nspirit,  nspirit,  ROT0,   "Irem", "Ninja Spirit", GAME_NO_COCKTAIL )
src/mame/drivers/zr107.c
r4057r4058
197197extern WRITE32_HANDLER(lanc_ram_w);
198198
199199
200// defined in video/gticlub.c
201VIDEO_START( gticlub );
202VIDEO_UPDATE( gticlub );
203
204
205200// defined in drivers/nwk-tr.c
206201int K001604_vh_start(running_machine *machine, int chip);
207202void K001604_tile_update(running_machine *machine, int chip);
src/mame/drivers/ksys573.c
r4057r4058
38553855   DISK_IMAGE_READONLY( "874kaa", 0, BAD_DUMP MD5(5e02c8dba12f949ce99834e597d8d08d) SHA1(659281e1b63c5ff0616b27d7f87a4e7f1c493372) )
38563856ROM_END
38573857
3858ROM_START( dsem )
3859   ROM_REGION32_LE( 0x080000, "user1", 0 )
3860   SYS573_BIOS_A
3861
3862   ROM_REGION( 0x0000224, "user2", 0 ) /* install security cart eeprom */
3863   ROM_LOAD( "ge936ea.u1",   0x000000, 0x000224, BAD_DUMP CRC(0f5b7ae3) SHA1(646dd49da1216cc2d3d6920bc9b3447d55ebfbf0) )
3864
3865   ROM_REGION( 0x1000000, "user3", 0 ) /* onboard flash */
3866   ROM_FILL( 0x0000000, 0x1000000, 0xff )
3867
3868   ROM_REGION( 0x000008, "user9", 0 ) /* install security cart id */
3869   ROM_LOAD( "ge936ea.u6",   0x000000, 0x000008, BAD_DUMP CRC(ce84419e) SHA1(839e8ee080ecfc79021a06417d930e8b32dfc6a1) )
3870
3871   DISK_REGION( "cdrom0" )
3872   DISK_IMAGE_READONLY( "936eaa", 0, BAD_DUMP MD5(1b3fea5748aec4b8efdc0aa42a84a56a) SHA1(eb824ea9593ea4a84440ff1032055d85e6c9e025) )
3873ROM_END
3874
38583875ROM_START( dsem2 )
38593876   ROM_REGION32_LE( 0x080000, "user1", 0 )
38603877   SYS573_BIOS_A
r4057r4058
44774494GAME( 1999, drmn2mpu, drmn2m,   konami573, drmn,      drmndigital,ROT0, "Konami", "DrumMania 2nd Mix Session Power Up Kit (GE912 VER. JAB)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.5 */
44784495GAME( 2000, dncfrks,  sys573,   konami573, dmx,       dmx,        ROT0, "Konami", "Dance Freaks (G*874 VER. KAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.6 */
44794496GAME( 2000, dmx,      dncfrks,  konami573, dmx,       dmx,        ROT0, "Konami", "Dance Maniax (G*874 VER. JAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.6 */
4497GAME( 2000, dsem,     sys573,   konami573, ddr,       ddrdigital, ROT0, "Konami", "Dancing Stage Euro Mix (G*936 VER. EAA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.7 */
44804498GAME( 2000, gtrfrk3m, sys573,   konami573, gtrfrks,   gtrfrkdigital,ROT0, "Konami", "Guitar Freaks 3rd Mix (GE949 VER. JAC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.4 */
44814499GAME( 2000, gtfrk3ma, gtrfrk3m, konami573, gtrfrks,   gtrfrkdigital,ROT0, "Konami", "Guitar Freaks 3rd Mix (GE949 VER. JAB)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.4 */
44824500GAME( 2000, gtfrk3mb, gtrfrk3m, konami573, gtrfrks,   gtrfrkdigital,ROT0, "Konami", "Guitar Freaks 3rd Mix - security cassette versionup (949JAZ02)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) /* BOOT VER 1.4 */
src/mame/drivers/funworld.c
r4057r4058
10001000    - Created inputs from the scratch for jolycdib.
10011001    - Updated technical notes.
10021002
1003    [2008-12-26]
1004    - Correctly setup the MC6845 device for all systems.
1005    - Added common MC6845 device interface.
1006    - Eliminated the screen size & visible area parameters to Magic Card 2.
10031007
1008
10041009    *** TO DO ***
10051010
10061011    - Figure out the royalcdc & jokercrd encryption.
r4057r4058
19631968};
19641969
19651970
1971/************************
1972*    CRTC Interface    *
1973************************/
1974
1975static const mc6845_interface mc6845_intf =
1976{
1977   "main",   /* screen we are acting on */
1978   4,      /* number of pixels per video memory address */
1979   NULL,   /* before pixel update callback */
1980   NULL,   /* row update callback */
1981   NULL,   /* after pixel update callback */
1982   NULL,   /* callback for display state changes */
1983   NULL,   /* HSYNC callback */
1984   NULL   /* VSYNC callback */
1985};
1986
1987
19661988/**************************
19671989*     Machine Drivers     *
19681990**************************/
r4057r4058
19932015   MDRV_VIDEO_START(funworld)
19942016   MDRV_VIDEO_UPDATE(funworld)
19952017
1996   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
2018   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/8, mc6845_intf)   /* 2MHz, veryfied on jollycrd & royalcrd */
19972019
19982020    /* sound hardware */
19992021   MDRV_SPEAKER_STANDARD_MONO("mono")
r4057r4058
20092031   MDRV_CPU_REPLACE("main", M65C02, MASTER_CLOCK/8)   /* 2MHz */
20102032   MDRV_CPU_PROGRAM_MAP(magicrd2_map, 0)
20112033
2012   MDRV_SCREEN_MODIFY("main")
2013   MDRV_SCREEN_SIZE((123+1)*4, (36+1)*8)            /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1) */
2014//  MDRV_SCREEN_VISIBLE_AREA(0*4, 112*4-1, 0*8, 34*8-1) /* Taken from MC6845 init, registers 01 & 06 */
2015   MDRV_SCREEN_VISIBLE_AREA(0*4, 98*4-1, 0*8, 32*8-1)   /* adjusted to screen for testing purposes */
2016
20172034   MDRV_GFXDECODE(funworld)
20182035   MDRV_VIDEO_START(magicrd2)
20192036
src/mame/drivers/2mindril.c
r4057r4058
392392   cpu_set_input_line(device, 4, HOLD_LINE);
393393}
394394
395/* WRONG,it does something with 60000c & 700002,likely to be called when the player throws the ball.*/
395396static void irqhandler(running_machine *machine, int irq)
396397{
397   cpu_set_input_line(machine->cpu[0],5,irq ? ASSERT_LINE : CLEAR_LINE);
398//  cpu_set_input_line(machine->cpu[0],5,irq ? ASSERT_LINE : CLEAR_LINE);
398399}
399400
400401static const ym2610_interface ym2610_config =
src/mame/drivers/taitotz.c
r0r4058
1/*
2   Taito Type-Zero hardware
3
4   Skeleton driver. Requires TLCS-900 CPU core to make progress.
5
6Landing High Japan PCB info
7===========================
8
9Taito Landing High
10
11Top board
12    silkscreened        TYPE-ZERO MOTHER PCB
13
14    stickered       298100308
15                K11X0886A
16                JC101
17
18.5  29LV400BC-90        stamped E68-05-1
19.6  29LV400BC-90        stamped E68-04-1
20.24 PALV 18V8-10JC      stamped E68-06
21
22
23IC30    Taito TCG020AGP
24IC26    IDT7024 S35J V9928P
25IC10    IBM EMPPC603eBG-100
26IC53    ADV7120KP30 9926 F101764.1
27IC16,17         M54256V32A-10
28IC15,25,31,39,45,49,44  48D4811650GF-A10-9BT
29IC27,36         D4564163G5-A10n-9JF
30IC 41,46,42,47      D4516161AG5-A10B-9F
31IC43            QSV991-7JRI
3266.6667 Oscillator near IC43
33
34Bottom board
35    silkscreened        JC101 DAUGHTER PCB
36
37    stickered       K91J0775A
38                LANDING H.JAPAN
39
40                299100308
41
42                M43J0741A
43                LANDING H.JAPAN
44
45.14 27c1001     stickered   E82
46                    03*
47
48.15 27c1001     stickered   E82
49                    04*
50
51.44 PALCE16V8H  stamped     E82-01
52
53.45 PALCE22V10H stamped     E82-02
54
55IC40    Toshiba TMP95C063F
56IC55    Panasonic MN89306
57EPSON 9X5C pscillator near IC55
58IC56    HY57V161610D TC-10
59IC22    ID7133 SA70J
6025.000 oscillator near IC22
61IC11    Xilinx XC9572
62IC5 HY5118164C JC-60
63IC10    ZOOM ZSG-2
64IC20    ZOOM ZFX 2 HD 96NE2VJ
65IC26    TM TECH  UA4464V T224162B-28J
66IC7 Panasonic MN1020819DA E68-01
6720.000 oscillator near IC7
68
69*/
70
71#include "driver.h"
72#include "cpu/powerpc/ppc.h"
73
74
75static VIDEO_START( taitotz )
76{
77}
78
79static VIDEO_UPDATE( taitotz )
80{
81   return 0;
82}
83
84static ADDRESS_MAP_START( ppc603e_mem, ADDRESS_SPACE_PROGRAM, 64)
85   AM_RANGE(0x00000000, 0x00000007) AM_RAM   // Register/RAM access port? - Written 128k+256k times on boot
86   AM_RANGE(0x00000008, 0x0000000f) AM_RAM   // Register/RAM address port?
87   AM_RANGE(0x40000000, 0x400fffff) AM_RAM   // Work RAM
88   AM_RANGE(0xa8000000, 0xa8001fff) AM_RAM   // Common RAM (with TLCS-900)
89   AM_RANGE(0xa8003ff8, 0xa8003fff) AM_RAM   // TLCS-900 related?
90   AM_RANGE(0xac000000, 0xac0fffff) AM_ROM AM_REGION("user1", 0)
91   AM_RANGE(0xfff00000, 0xffffffff) AM_ROM AM_REGION("user1", 0)
92ADDRESS_MAP_END
93
94
95static INPUT_PORTS_START( taitotz )
96INPUT_PORTS_END
97
98
99static const powerpc_config ppc603e_config =
100{
101   XTAL_66_6667MHz      /* Multiplier 1.5, Bus = 66MHz, Core = 100MHz */
102};
103
104
105static MACHINE_DRIVER_START( taitotz )
106   MDRV_CPU_ADD("main", PPC603E, 100000000)
107   MDRV_CPU_CONFIG(ppc603e_config)
108   MDRV_CPU_PROGRAM_MAP(ppc603e_mem, 0)
109
110   /* TMP95C063F I/O CPU */
111   /* MN1020819DA sound CPU */
112
113   MDRV_SCREEN_ADD("main", RASTER)
114   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
115   MDRV_SCREEN_REFRESH_RATE(60)
116   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
117   MDRV_SCREEN_SIZE(512, 384)
118   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 383)
119
120   MDRV_VIDEO_START(taitotz)
121   MDRV_VIDEO_UPDATE(taitotz)
122MACHINE_DRIVER_END
123
124
125ROM_START( landhigh )
126   ROM_REGION64_BE( 0x100000, "user1", 0 )
127   ROM_LOAD32_WORD_SWAP( "e68-05-1.ic6", 0x000000, 0x080000, CRC(6ad9b006) SHA1(f05a0ae26b6abaeda9c7944aee96c72b08fff7a5) )
128   ROM_LOAD32_WORD_SWAP( "e68-04-1.ic5", 0x000002, 0x080000, CRC(c7c2dc6b) SHA1(bf88c818166c285130c5c73d6982f009da26e143) )
129
130   ROM_REGION( 0x40000, "io_cpu", 0 )
131   ROM_LOAD16_BYTE( "e82-03.ic14", 0x000000, 0x020000, CRC(0de65b4d) SHA1(932316f7435259b723a29843d58b2e3dca92e7b7) )
132   ROM_LOAD16_BYTE( "e82-04.ic15", 0x000001, 0x020000, CRC(b3cb0f3d) SHA1(80414f50a1593c6b849d9f37e94a32168699a5c1) )
133
134   ROM_REGION( 0x10000, "sound_cpu", 0 ) /* Internal ROM :( */
135   ROM_LOAD( "e68-01.ic7", 0x000000, 0x010000, NO_DUMP )
136
137   ROM_REGION( 0x500, "plds", ROMREGION_DISPOSE )
138   ROM_LOAD( "e82-01.ic44", 0x000, 0x117, CRC(49eea30f) SHA1(ef97c792358f05b9214a2f58ee1e97e8208806c4) )
139   ROM_LOAD( "e82-02.ic45", 0x117, 0x2dd, CRC(f581cff5) SHA1(468e0e6a3828f2dcda35c6d523154510f9c99db7) )
140   ROM_LOAD( "e68-06.ic24", 0x3f4, 0x100, NO_DUMP )
141
142   DISK_REGION( "ide" )
143   DISK_IMAGE( "landhigh", 0, SHA1(c6b417a546db4b82870f49aaa66c8aba74195972) MD5(46e05e74f055548d1d981be152bacf9c) )
144ROM_END
145
146GAME( 1999, landhigh, 0, taitotz, taitotz, 0, ROT0, "Taito", "Landing High Japan", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/taito_z.c
r4057r4058
46284628
46294629ROM_START( dblaxle )
46304630   ROM_REGION( 0x80000, "main", 0 )   /* 512K for 68000 code (CPU A) */
4631   ROM_LOAD16_BYTE( "c78-41.3",  0x00000, 0x20000, CRC(cf297fe4) SHA1(4875de63e8336062c27d83b55938bcb3d08a24a3) )
4632   ROM_LOAD16_BYTE( "c78-43.5",  0x00001, 0x20000, CRC(38a8bad6) SHA1(50977a6a364893549d2f7899bbc4e0c67086697e) )
4633   ROM_LOAD16_BYTE( "c78-42.4",  0x40000, 0x20000, CRC(4124ab2b) SHA1(96c3b6e01a1823259b3d7ca43e0a8631bfe33d0e) )
4634   ROM_LOAD16_BYTE( "c78-44.6",  0x40001, 0x20000, CRC(50a55b6e) SHA1(62a72d33030d50c157a5cf05f6bdc1b02c9b9ff1) )
4631   ROM_LOAD16_BYTE( "c78-41-1.2",  0x00000, 0x20000, CRC(cf297fe4) SHA1(4875de63e8336062c27d83b55938bcb3d08a24a3) )
4632   ROM_LOAD16_BYTE( "c78-43-1.4",  0x00001, 0x20000, CRC(38a8bad6) SHA1(50977a6a364893549d2f7899bbc4e0c67086697e) )
4633   ROM_LOAD16_BYTE( "c78-42-1.3",  0x40000, 0x20000, CRC(4124ab2b) SHA1(96c3b6e01a1823259b3d7ca43e0a8631bfe33d0e) )
4634   ROM_LOAD16_BYTE( "c78-44-1.5",  0x40001, 0x20000, CRC(50a55b6e) SHA1(62a72d33030d50c157a5cf05f6bdc1b02c9b9ff1) )
46354635
46364636   ROM_REGION( 0x40000, "sub", 0 )   /* 256K for 68000 code (CPU B) */
46374637   ROM_LOAD16_BYTE( "c78-30-1.35", 0x00000, 0x20000, CRC(026aac18) SHA1(f50873982b4dc0fc822060f4c20c635efdd75d7e) )
46384638   ROM_LOAD16_BYTE( "c78-31-1.36", 0x00001, 0x20000, CRC(67ce23e8) SHA1(983e998a79e3d4376b005c92ded050be236d37cc) )
46394639
46404640   ROM_REGION( 0x2c000, "audio", 0 )   /* sound cpu */
4641   ROM_LOAD    ( "ic42", 0x00000, 0x04000, CRC(f2186943) SHA1(2e9aed39fddf3aa1db7e20f8a709b6b82cc3e7df) )
4641   ROM_LOAD    ( "c78-34.c42", 0x00000, 0x04000, CRC(f2186943) SHA1(2e9aed39fddf3aa1db7e20f8a709b6b82cc3e7df) )
46424642   ROM_CONTINUE(         0x10000, 0x1c000 )   /* banked stuff */
46434643
46444644   ROM_REGION( 0x100000, "gfx1", ROMREGION_DISPOSE )
src/mame/drivers/fruit.c
r0r4058
1/*
2
3Fruit?
4
5Video Fruit Machine
6
7- Doesn't make much sense,anything (including rom load/rom dump etc.) might be bad or heavily protected.
8*/
9
10#include "driver.h"
11#include "cpu/z80/z80.h"
12
13static UINT8 *fruit_vram;
14
15static VIDEO_START(fruit)
16{
17
18}
19
20static VIDEO_UPDATE(fruit)
21{
22   const gfx_element *gfx = screen->machine->gfx[1];
23   int count = 0x0000;
24
25   int y,x;
26
27
28   for (y=0;y<64;y++)
29   {
30      for (x=0;x<64;x++)
31      {
32         int tile = (fruit_vram[count]);
33         //int colour = tile>>12;
34         drawgfx(bitmap,gfx,tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
35
36         count++;
37      }
38   }
39
40   return 0;
41}
42
43static ADDRESS_MAP_START( mainmap, ADDRESS_SPACE_PROGRAM, 8 )
44   AM_RANGE(0x0000, 0x2fff) AM_ROM
45   AM_RANGE(0xa000, 0xafff) AM_RAM
46   AM_RANGE(0xb000, 0xbfff) AM_RAM AM_BASE(&fruit_vram)
47   AM_RANGE(0xd000, 0xdfff) AM_ROM //second rom mirrors there
48   AM_RANGE(0xe000, 0xefff) AM_ROM //first rom mirrors there
49   AM_RANGE(0xf000, 0xffff) AM_RAM
50ADDRESS_MAP_END
51
52
53
54static INPUT_PORTS_START( fruit )
55INPUT_PORTS_END
56
57static const gfx_layout tiles32x32_layout =
58{
59   32,32,
60   RGN_FRAC(1,3),
61   3,
62   { RGN_FRAC(0,3),RGN_FRAC(1,3),RGN_FRAC(2,3) },
63   { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 },
64   { 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,16*32,17*32,18*32,19*32,20*32,21*32,22*32,23*32,24*32,25*32,26*32,27*32,28*32,29*32,30*32,31*32 },
65   32*32
66};
67
68static const gfx_layout tiles8x8_layout =
69{
70   8,8,
71   RGN_FRAC(1,1),
72   1,
73   { 0 },
74   { 0,1,2,3,4,5,6,7 },
75   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8},
76   8*8
77};
78static GFXDECODE_START( fruit )
79   GFXDECODE_ENTRY( "gfx1", 0, tiles32x32_layout, 0, 16 )
80   GFXDECODE_ENTRY( "gfx2", 0, tiles8x8_layout, 0, 16 )
81GFXDECODE_END
82
83static MACHINE_DRIVER_START( fruit )
84   /* basic machine hardware */
85   MDRV_CPU_ADD("main", Z80,8000000)       /* ? MHz */
86   MDRV_CPU_PROGRAM_MAP(mainmap,0)
87   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
88
89   /* video hardware */
90   MDRV_SCREEN_ADD("main", RASTER)
91   MDRV_SCREEN_REFRESH_RATE(60)
92   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
93   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
94   MDRV_SCREEN_SIZE(512, 512)
95   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 512-1)
96
97   MDRV_GFXDECODE(fruit)
98   MDRV_PALETTE_LENGTH(0x100)
99
100   MDRV_VIDEO_START(fruit)
101   MDRV_VIDEO_UPDATE(fruit)
102MACHINE_DRIVER_END
103
104
105
106ROM_START( fruit )
107   ROM_REGION( 0x10000, "main", 0 )
108   ROM_LOAD( "vp-h9.bin",  0x00000, 0x1000, CRC(f595daf7) SHA1(be5abd34fd06f73cd80f5b15902d158e33705c8f) )
109   ROM_RELOAD(             0x0e000, 0x1000 )
110   ROM_LOAD( "vp-h10.bin", 0x01000, 0x1000, CRC(b0539100) SHA1(763f31f72f55c3322b24e127b37130d37daa5216) )
111   ROM_RELOAD(             0x0d000, 0x1000 )
112   ROM_LOAD( "vp-h11.bin", 0x02000, 0x1000, CRC(fa176072) SHA1(18203278bb9c505f07390f7b95ecf9ab6d7b7122) )
113
114   ROM_REGION( 0x1800, "gfx1", 0 ) // fruits - 3bpp
115   ROM_LOAD( "vp-h5.bin", 0x00000, 0x0800, CRC(dfffe063) SHA1(1b860323fe93b7d010fa35167769555a6bd4a49c) )
116   ROM_LOAD( "vp-h6.bin", 0x00800, 0x0800, CRC(355203b8) SHA1(959f3599a24293f392e8b10061c39d3244f34c05) )
117   ROM_LOAD( "vp-h7.bin", 0x01000, 0x0800, CRC(7784de8a) SHA1(40851724c9b7ef26964462b5e97ad943df4d56e2) )
118
119   ROM_REGION( 0x800, "gfx2", 0 ) // screen layout stuff - 1bpp
120   ROM_LOAD( "vp-h8.bin", 0x00000, 0x0800, CRC(d587e541) SHA1(902b6c4673b8b989d034d60d3c47f2499f100ba2) )
121ROM_END
122
123GAME( 1987, fruit,  0,    fruit, fruit,  0, ROT270, "unknown", "Unknown Fruits Game", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/psikyosh.c
r4057r4058
373373             if (use_factory_eeprom==eeprom_GNBARICH) /* Might as well do Gnbarich as well, otherwise the highscore is incorrect */
374374                memcpy(eeprom_data+0xf0, gnbarich_eeprom, 0x10);
375375
376            if (use_factory_eeprom==eeprom_USER1) /* load a default eeprom for TGM2 / TGM2+ as it requires more data initalized */
377               memcpy(eeprom_data, memory_region(machine, "user1"), 0x100);
378
376379             if (use_factory_eeprom==eeprom_MJGTASTE) /* We don't emulate the Mahjong panel yet, so default it to joystick */
377380            {
378381                memcpy(eeprom_data+0x00, mjgtaste_eeprom, 0x10);
r4057r4058
810813   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
811814INPUT_PORTS_END
812815
816static INPUT_PORTS_START( tgm2 )
817   PORT_INCLUDE( common )
818
819   PORT_START("JP4")   /* jumper pads on the PCB */
820//  PORT_DIPNAME( 0x03000000, 0x01000000, DEF_STR( Region ) )
821//  PORT_DIPSETTING(          0x00000000, DEF_STR( Japan ) )
822//  PORT_DIPSETTING(          0x02000000, "International Ver A." )
823//  PORT_DIPSETTING(          0x01000000, "International Ver B." )
824   PORT_BIT( 0x10000000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(eeprom_bit_r, NULL)
825INPUT_PORTS_END
826
813827static INPUT_PORTS_START( mjgtaste ) /* This will need the Mahjong inputs */
814828   PORT_INCLUDE( common )
815829
r4057r4058
9941008   ROM_LOAD( "snd0.u52", 0x000000, 0x200000, CRC(7fd1b225) SHA1(6aa61021ada51393bbb34fd1aea00b8feccc8197) )
9951009ROM_END
9961010
997/* Most of the roms on this board are from Dragon Blaze and not used by the game, they're needed for the board to
998   work, but the content doesn't matter. */
1011/*
1012
1013Starting with Gunbarich and including Mahjong G-Taste, Psikyo started to "recycle" left over Dragon Blaze PCBs.
1014  Psikyo would replace some of the Dragon Blaze roms with the new game roms leaving many of the surface mounted
1015  roms intact.  The new games don't use or access the left over roms, but the PCB needs the roms filled to function.
1016
1017  The hidden rom tests in Gunbarich and Mahjong G-Teste shows the games only uses the new game roms.
1018
1019*/
1020
9991021ROM_START( gnbarich )
10001022   ROM_REGION( 0x100000, "main", 0)
10011023   ROM_LOAD32_WORD_SWAP( "2-prog_l.u21",   0x000000, 0x080000, CRC(c136cd9c) SHA1(ab66c4f5196a66a97dbb5832336a203421cf40fa) )
10021024   ROM_LOAD32_WORD_SWAP( "1-prog_h.u22",   0x000002, 0x080000, CRC(6588fc96) SHA1(3db29fcf17e8b2aee465319b557bd3e45bc966b2) )
10031025
10041026   ROM_REGION( 0x2c00000, "gfx1", ROMTEST_GFX )   /* Sprites */
1005   /* Gunbarich doesn't actually use 1-5 and 10, they're on the board, but all the gfx are in 6-9
1006       The game was an upgrade to Dragon Blaze, only some of the roms were replaced however it
1007       appears the board needs to be fully populated to work correctly so the Dragon Blaze roms
1008       were left on it.  After hooking up hidden rom test we can see only the 8 roms we load are
1009       tested */
10101027//  ROM_LOAD32_WORD( "1l.u4",  0x0400000, 0x200000, CRC(c2eb565c) SHA1(07e41b36cc03a87f28d091754fdb0d1a7316a532) ) /* From Dragon Blaze */
10111028//  ROM_LOAD32_WORD( "1h.u12", 0x0400002, 0x200000, CRC(23cb46b7) SHA1(005b7cc40eea103688a64a72c219c7535970dbfb) ) /* From Dragon Blaze */
10121029//  ROM_LOAD32_WORD( "2l.u5",  0x0800000, 0x200000, CRC(bc256aea) SHA1(1f1d678e8a63513a95f296b8a07d2ea485d1e53f) ) /* From Dragon Blaze */
r4057r4058
10321049   ROM_LOAD( "snd0.u52", 0x000000, 0x200000, CRC(7b10436b) SHA1(c731fcce024e286a677ca10a91761c1ee06094a5) )
10331050ROM_END
10341051
1035/* Most of the roms on this board are from Dragon Blaze and not used by the game, they're needed for the board to
1036   work, but the content doesn't matter. */
10371052ROM_START( mjgtaste )
10381053   ROM_REGION( 0x100000, "main", 0)
10391054   ROM_LOAD32_WORD_SWAP( "2.u21",   0x000000, 0x080000, CRC(5f2041dc) SHA1(f3862ffdb8df0cf921ce1cb0236935731e7729a7) )
10401055   ROM_LOAD32_WORD_SWAP( "1.u22",   0x000002, 0x080000, CRC(f5ff7876) SHA1(4c909db9c97f29fd79df6dacd29762688701b973) )
10411056
1042   /* exact number of gfx / sound roms may be incorrect */
10431057   ROM_REGION( 0x2c00000, "gfx1", ROMTEST_GFX | ROMREGION_ERASE00 )   /* Sprites */
10441058   ROM_LOAD32_WORD( "1l.u4",  0x0400000, 0x200000, CRC(30da42b1) SHA1(8485f2c0e7769b50b95d962afe14fa7ae74cd887) )
10451059   ROM_LOAD32_WORD( "1h.u12", 0x0400002, 0x200000, CRC(629c1d44) SHA1(61909091328bb7b6d3e6e0bff91e14c9b4b86c2c) )
r4057r4058
10621076//  ROM_LOAD32_WORD( "10l.u58",0x2800000, 0x200000, CRC(a3f5c7f8) SHA1(d17478ca3e7ef46270f350ffa35d43acb05b1185) ) /* From Dragon Blaze */
10631077//  ROM_LOAD32_WORD( "10h.u59",0x2800002, 0x200000, CRC(30e304c4) SHA1(1d866276bfe7f7524306a880d225aaf11ac2e5dd) ) /* From Dragon Blaze */
10641078
1065   ROM_REGION( 0x800000, "ymf", 0 ) /* Samples - Not Dumped */
1079   ROM_REGION( 0x800000, "ymf", 0 ) /* Samples */
10661080   ROM_LOAD( "snd0.u52", 0x000000, 0x400000, CRC(0179f018) SHA1(16ae63e021230356777342ed902e02407a1a1b82) )
10671081ROM_END
10681082
1069
1070/*
1071
1072// the following (currently unsupported) roms are known to exist on the PS5v2 PCB
10731083ROM_START( tgm2 )
1074    ROM_REGION( 0x100000, "main", 0)
1075    ROM_LOAD32_WORD_SWAP( "2.u21",   0x000000, 0x080000, CRC(b19f6c31) SHA1(c58346c575db71262aebc3993743cb031c41e4af) )
1076    ROM_LOAD32_WORD_SWAP( "1.u22",   0x000002, 0x080000, CRC(c521bf24) SHA1(0ee5b9f74b6b8bcc01b2270c53f30d99e877ed64) )
1084   ROM_REGION( 0x100000, "main", 0)
1085   ROM_LOAD32_WORD_SWAP( "2.u21",   0x000000, 0x080000, CRC(b19f6c31) SHA1(c58346c575db71262aebc3993743cb031c41e4af) )
1086   ROM_LOAD32_WORD_SWAP( "1.u22",   0x000002, 0x080000, CRC(c521bf24) SHA1(0ee5b9f74b6b8bcc01b2270c53f30d99e877ed64) )
10771087
1078    ROM_REGION( 0x3000000, "gfx1", ROMTEST_GFX )
1079    // Lower positions not populated
1080    ROM_LOAD32_WORD( "81ts_3l.u6",   0x0c00000, 0x200000, CRC(d77cff9c) SHA1(93ee48c350110ebf9a80cca95c599c90a523147d) )
1081    ROM_LOAD32_WORD( "82ts_3h.u14",  0x0c00002, 0x200000, CRC(f012b583) SHA1(907e1c93cbfa6a0285f96c53f5ccb63e313053d7) )
1082    ROM_LOAD32_WORD( "83ts_4l.u7",   0x1000000, 0x200000, CRC(078cafc3) SHA1(26e47c8f0aaa461e69e9f40ee61ce4b4cc480776) )
1083    ROM_LOAD32_WORD( "84ts_4h.u15",  0x1000002, 0x200000, CRC(1f91446b) SHA1(81b43156c6a0f4e63dcc9e7c1e9dd54bcba38240) )
1084    ROM_LOAD32_WORD( "85ts_5l.u8",   0x1400000, 0x200000, CRC(40fbd259) SHA1(6b8cbfc6232e04785fd232158b3f4d56fadb0c7d) )
1085    ROM_LOAD32_WORD( "86ts_5h.u16",  0x1400002, 0x200000, CRC(186c935f) SHA1(0cab30c2ec4df3dc35b4c9de63d29bd0bc99afdb) )
1086    ROM_LOAD32_WORD( "87ts_6l.u1",   0x1800000, 0x200000, CRC(c17dc48a) SHA1(4399bfc253fb1cd4ef1081d7350c73df3a0f7441) )
1087    ROM_LOAD32_WORD( "88ts_6h.u2",   0x1800002, 0x200000, CRC(e4dba5da) SHA1(24db1e19f4df94ba3a22fba59e4fd065921db1c5) )
1088    ROM_LOAD32_WORD( "89ts_7l.u19",  0x1c00000, 0x200000, CRC(dab1b2c5) SHA1(114fd7717b97cdfd605ab7e2a354190c41ba4a82) )
1089    ROM_LOAD32_WORD( "90ts_7h.u20",  0x1c00002, 0x200000, CRC(aae696b3) SHA1(9ac27365719c1700f647911dc324a0e2aacea172) )
1090    ROM_LOAD32_WORD( "91ts_8l.u28",  0x2000000, 0x200000, CRC(e953ace1) SHA1(c6cdfd807a7a84b86378c3585aeb7c0cb066f8a1) )
1091    ROM_LOAD32_WORD( "92ts_8h.u29",  0x2000002, 0x200000, CRC(9da3b976) SHA1(ce1e4eb93760749200ede45703412868ca29a5e7) )
1092    ROM_LOAD32_WORD( "93ts_9l.u41",  0x2400000, 0x200000, CRC(233087fe) SHA1(c4adb307ce11ef558fd23b299ce7f458de581446) )
1093    ROM_LOAD32_WORD( "94ts_9h.u42",  0x2400002, 0x200000, CRC(9da831c7) SHA1(42698697aa85df088745b2d37ec89b01adce700f) )
1094    ROM_LOAD32_WORD( "95ts_10l.u58", 0x2800000, 0x200000, CRC(303a5240) SHA1(5816d1922e85bc27a2a13cdd183d9e67c7ddb2e1) )
1095    ROM_LOAD32_WORD( "96ts_10h.u59", 0x2800002, 0x200000, CRC(2240ebf6) SHA1(b61f93a18dd9d94fb57d95745d4df2e41a0371ff) )
1088   ROM_REGION( 0x3000000, "gfx1", ROMTEST_GFX )   /* Sprites */
1089   // Lower positions not populated
1090   ROM_LOAD32_WORD( "81ts_3l.u6",   0x0c00000, 0x200000, CRC(d77cff9c) SHA1(93ee48c350110ebf9a80cca95c599c90a523147d) )
1091   ROM_LOAD32_WORD( "82ts_3h.u14",  0x0c00002, 0x200000, CRC(f012b583) SHA1(907e1c93cbfa6a0285f96c53f5ccb63e313053d7) )
1092   ROM_LOAD32_WORD( "83ts_4l.u7",   0x1000000, 0x200000, CRC(078cafc3) SHA1(26e47c8f0aaa461e69e9f40ee61ce4b4cc480776) )
1093   ROM_LOAD32_WORD( "84ts_4h.u15",  0x1000002, 0x200000, CRC(1f91446b) SHA1(81b43156c6a0f4e63dcc9e7c1e9dd54bcba38240) )
1094   ROM_LOAD32_WORD( "85ts_5l.u8",   0x1400000, 0x200000, CRC(40fbd259) SHA1(6b8cbfc6232e04785fd232158b3f4d56fadb0c7d) )
1095   ROM_LOAD32_WORD( "86ts_5h.u16",  0x1400002, 0x200000, CRC(186c935f) SHA1(0cab30c2ec4df3dc35b4c9de63d29bd0bc99afdb) )
1096   ROM_LOAD32_WORD( "87ts_6l.u1",   0x1800000, 0x200000, CRC(c17dc48a) SHA1(4399bfc253fb1cd4ef1081d7350c73df3a0f7441) )
1097   ROM_LOAD32_WORD( "88ts_6h.u2",   0x1800002, 0x200000, CRC(e4dba5da) SHA1(24db1e19f4df94ba3a22fba59e4fd065921db1c5) )
1098   ROM_LOAD32_WORD( "89ts_7l.u19",  0x1c00000, 0x200000, CRC(dab1b2c5) SHA1(114fd7717b97cdfd605ab7e2a354190c41ba4a82) )
1099   ROM_LOAD32_WORD( "90ts_7h.u20",  0x1c00002, 0x200000, CRC(aae696b3) SHA1(9ac27365719c1700f647911dc324a0e2aacea172) )
1100   ROM_LOAD32_WORD( "91ts_8l.u28",  0x2000000, 0x200000, CRC(e953ace1) SHA1(c6cdfd807a7a84b86378c3585aeb7c0cb066f8a1) )
1101   ROM_LOAD32_WORD( "92ts_8h.u29",  0x2000002, 0x200000, CRC(9da3b976) SHA1(ce1e4eb93760749200ede45703412868ca29a5e7) )
1102   ROM_LOAD32_WORD( "93ts_9l.u41",  0x2400000, 0x200000, CRC(233087fe) SHA1(c4adb307ce11ef558fd23b299ce7f458de581446) )
1103   ROM_LOAD32_WORD( "94ts_9h.u42",  0x2400002, 0x200000, CRC(9da831c7) SHA1(42698697aa85df088745b2d37ec89b01adce700f) )
1104   ROM_LOAD32_WORD( "95ts_10l.u58", 0x2800000, 0x200000, CRC(303a5240) SHA1(5816d1922e85bc27a2a13cdd183d9e67c7ddb2e1) )
1105   ROM_LOAD32_WORD( "96ts_10h.u59", 0x2800002, 0x200000, CRC(2240ebf6) SHA1(b61f93a18dd9d94fb57d95745d4df2e41a0371ff) )
10961106
1097    ROM_REGION( 0x800000, "ymf", 0 ) // Samples
1098    ROM_LOAD( "97ts_snd.u52", 0x000000, 0x400000, CRC(9155eca6) SHA1(f0b4f68462d8a465c39815d3b7fd9818788132ae) )
1107   ROM_REGION( 0x800000, "ymf", 0 ) /* Samples */
1108   ROM_LOAD( "97ts_snd.u52", 0x000000, 0x400000, CRC(9155eca6) SHA1(f0b4f68462d8a465c39815d3b7fd9818788132ae) )
10991109
1100    ROM_REGION( 0x100, "user1", 0 ) // Default Eeprom (contains scores etc.)
1101    // might need byteswapping to reprogram actual chip
1102    ROM_LOAD( "tgm2.default.nv", 0x000, 0x100, CRC(50e2348c) SHA1(d17d2739c97a1d93a95dcc9f11feb1f6f228729e) )
1110   ROM_REGION( 0x100, "user1", 0 ) /* Default Eeprom (contains scores etc.) */
1111   // might need byteswapping to reprogram actual chip
1112   ROM_LOAD( "tgm2.default.nv", 0x000, 0x100, CRC(50e2348c) SHA1(d17d2739c97a1d93a95dcc9f11feb1f6f228729e) )
11031113ROM_END
11041114
11051115ROM_START( tgm2p )
1106    ROM_REGION( 0x100000, "main", 0)
1107    ROM_LOAD32_WORD_SWAP( "2b.u21",   0x000000, 0x080000, CRC(38bc626c) SHA1(783e8413b11f1fa08d331b09ef4ed63f62b87ead) )
1108    ROM_LOAD32_WORD_SWAP( "1b.u22",   0x000002, 0x080000, CRC(7599fb19) SHA1(3f7e81756470c173cc17a7e7dee91437571fd0c3) )
1116   ROM_REGION( 0x100000, "main", 0)
1117   ROM_LOAD32_WORD_SWAP( "2b.u21",   0x000000, 0x080000, CRC(38bc626c) SHA1(783e8413b11f1fa08d331b09ef4ed63f62b87ead) )
1118   ROM_LOAD32_WORD_SWAP( "1b.u22",   0x000002, 0x080000, CRC(7599fb19) SHA1(3f7e81756470c173cc17a7e7dee91437571fd0c3) )
11091119
1110    ROM_REGION( 0x3000000, "gfx1", ROMTEST_GFX )
1111    // Lower positions not populated
1112    ROM_LOAD32_WORD( "81ts_3l.u6",   0x0c00000, 0x200000, CRC(d77cff9c) SHA1(93ee48c350110ebf9a80cca95c599c90a523147d) )
1113    ROM_LOAD32_WORD( "82ts_3h.u14",  0x0c00002, 0x200000, CRC(f012b583) SHA1(907e1c93cbfa6a0285f96c53f5ccb63e313053d7) )
1114    ROM_LOAD32_WORD( "83ts_4l.u7",   0x1000000, 0x200000, CRC(078cafc3) SHA1(26e47c8f0aaa461e69e9f40ee61ce4b4cc480776) )
1115    ROM_LOAD32_WORD( "84ts_4h.u15",  0x1000002, 0x200000, CRC(1f91446b) SHA1(81b43156c6a0f4e63dcc9e7c1e9dd54bcba38240) )
1116    ROM_LOAD32_WORD( "85ts_5l.u8",   0x1400000, 0x200000, CRC(40fbd259) SHA1(6b8cbfc6232e04785fd232158b3f4d56fadb0c7d) )
1117    ROM_LOAD32_WORD( "86ts_5h.u16",  0x1400002, 0x200000, CRC(186c935f) SHA1(0cab30c2ec4df3dc35b4c9de63d29bd0bc99afdb) )
1118    ROM_LOAD32_WORD( "87ts_6l.u1",   0x1800000, 0x200000, CRC(c17dc48a) SHA1(4399bfc253fb1cd4ef1081d7350c73df3a0f7441) )
1119    ROM_LOAD32_WORD( "88ts_6h.u2",   0x1800002, 0x200000, CRC(e4dba5da) SHA1(24db1e19f4df94ba3a22fba59e4fd065921db1c5) )
1120    ROM_LOAD32_WORD( "89ts_7l.u19",  0x1c00000, 0x200000, CRC(dab1b2c5) SHA1(114fd7717b97cdfd605ab7e2a354190c41ba4a82) )
1121    ROM_LOAD32_WORD( "90ts_7h.u20",  0x1c00002, 0x200000, CRC(aae696b3) SHA1(9ac27365719c1700f647911dc324a0e2aacea172) )
1122    ROM_LOAD32_WORD( "91ts_8l.u28",  0x2000000, 0x200000, CRC(e953ace1) SHA1(c6cdfd807a7a84b86378c3585aeb7c0cb066f8a1) )
1123    ROM_LOAD32_WORD( "92ts_8h.u29",  0x2000002, 0x200000, CRC(9da3b976) SHA1(ce1e4eb93760749200ede45703412868ca29a5e7) )
1124    ROM_LOAD32_WORD( "93ts_9l.u41",  0x2400000, 0x200000, CRC(233087fe) SHA1(c4adb307ce11ef558fd23b299ce7f458de581446) )
1125    ROM_LOAD32_WORD( "94ts_9h.u42",  0x2400002, 0x200000, CRC(9da831c7) SHA1(42698697aa85df088745b2d37ec89b01adce700f) )
1126    ROM_LOAD32_WORD( "95ts_10l.u58", 0x2800000, 0x200000, CRC(303a5240) SHA1(5816d1922e85bc27a2a13cdd183d9e67c7ddb2e1) )
1127    ROM_LOAD32_WORD( "96ts_10h.u59", 0x2800002, 0x200000, CRC(2240ebf6) SHA1(b61f93a18dd9d94fb57d95745d4df2e41a0371ff) )
1120   ROM_REGION( 0x3000000, "gfx1", ROMTEST_GFX )   /* Sprites */
1121   // Lower positions not populated
1122   ROM_LOAD32_WORD( "81ts_3l.u6",   0x0c00000, 0x200000, CRC(d77cff9c) SHA1(93ee48c350110ebf9a80cca95c599c90a523147d) )
1123   ROM_LOAD32_WORD( "82ts_3h.u14",  0x0c00002, 0x200000, CRC(f012b583) SHA1(907e1c93cbfa6a0285f96c53f5ccb63e313053d7) )
1124   ROM_LOAD32_WORD( "83ts_4l.u7",   0x1000000, 0x200000, CRC(078cafc3) SHA1(26e47c8f0aaa461e69e9f40ee61ce4b4cc480776) )
1125   ROM_LOAD32_WORD( "84ts_4h.u15",  0x1000002, 0x200000, CRC(1f91446b) SHA1(81b43156c6a0f4e63dcc9e7c1e9dd54bcba38240) )
1126   ROM_LOAD32_WORD( "85ts_5l.u8",   0x1400000, 0x200000, CRC(40fbd259) SHA1(6b8cbfc6232e04785fd232158b3f4d56fadb0c7d) )
1127   ROM_LOAD32_WORD( "86ts_5h.u16",  0x1400002, 0x200000, CRC(186c935f) SHA1(0cab30c2ec4df3dc35b4c9de63d29bd0bc99afdb) )
1128   ROM_LOAD32_WORD( "87ts_6l.u1",   0x1800000, 0x200000, CRC(c17dc48a) SHA1(4399bfc253fb1cd4ef1081d7350c73df3a0f7441) )
1129   ROM_LOAD32_WORD( "88ts_6h.u2",   0x1800002, 0x200000, CRC(e4dba5da) SHA1(24db1e19f4df94ba3a22fba59e4fd065921db1c5) )
1130   ROM_LOAD32_WORD( "89ts_7l.u19",  0x1c00000, 0x200000, CRC(dab1b2c5) SHA1(114fd7717b97cdfd605ab7e2a354190c41ba4a82) )
1131   ROM_LOAD32_WORD( "90ts_7h.u20",  0x1c00002, 0x200000, CRC(aae696b3) SHA1(9ac27365719c1700f647911dc324a0e2aacea172) )
1132   ROM_LOAD32_WORD( "91ts_8l.u28",  0x2000000, 0x200000, CRC(e953ace1) SHA1(c6cdfd807a7a84b86378c3585aeb7c0cb066f8a1) )
1133   ROM_LOAD32_WORD( "92ts_8h.u29",  0x2000002, 0x200000, CRC(9da3b976) SHA1(ce1e4eb93760749200ede45703412868ca29a5e7) )
1134   ROM_LOAD32_WORD( "93ts_9l.u41",  0x2400000, 0x200000, CRC(233087fe) SHA1(c4adb307ce11ef558fd23b299ce7f458de581446) )
1135   ROM_LOAD32_WORD( "94ts_9h.u42",  0x2400002, 0x200000, CRC(9da831c7) SHA1(42698697aa85df088745b2d37ec89b01adce700f) )
1136   ROM_LOAD32_WORD( "95ts_10l.u58", 0x2800000, 0x200000, CRC(303a5240) SHA1(5816d1922e85bc27a2a13cdd183d9e67c7ddb2e1) )
1137   ROM_LOAD32_WORD( "96ts_10h.u59", 0x2800002, 0x200000, CRC(2240ebf6) SHA1(b61f93a18dd9d94fb57d95745d4df2e41a0371ff) )
11281138
1129    ROM_REGION( 0x800000, "ymf", 0 ) // Samples
1130    ROM_LOAD( "97ts_snd.u52", 0x000000, 0x400000, CRC(9155eca6) SHA1(f0b4f68462d8a465c39815d3b7fd9818788132ae) )
1139   ROM_REGION( 0x800000, "ymf", 0 ) /* Samples */
1140   ROM_LOAD( "97ts_snd.u52", 0x000000, 0x400000, CRC(9155eca6) SHA1(f0b4f68462d8a465c39815d3b7fd9818788132ae) )
11311141
1132    ROM_REGION( 0x100, "user1", 0 ) // Default Eeprom (contains scores etc.)
1133    // might need byteswapping to reprogram actual chip/
1134    ROM_LOAD( "tgm2p.default.nv", 0x000, 0x100, CRC(b2328b40) SHA1(e6cda4d6f4e91b9f78d2ca84a5eee6c3bd03fe02) )
1142   ROM_REGION( 0x100, "user1", 0 ) /* Default Eeprom (contains scores etc.) */
1143   // might need byteswapping to reprogram actual chip
1144   ROM_LOAD( "tgm2p.default.nv", 0x000, 0x100, CRC(b2328b40) SHA1(e6cda4d6f4e91b9f78d2ca84a5eee6c3bd03fe02) )
11351145ROM_END
11361146
1137*/
11381147
1139
11401148static DRIVER_INIT( soldivid )
11411149{
11421150   device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS);
r4057r4058
11911199   use_factory_eeprom=eeprom_GNBARICH;
11921200}
11931201
1202static DRIVER_INIT( tgm2 )
1203{
1204   device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS);
1205   use_factory_eeprom=eeprom_USER1;
1206}
1207
11941208static DRIVER_INIT( mjgtaste )
11951209{
11961210   device_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_DRC_OPTIONS, SH2DRC_FASTEST_OPTIONS);
r4057r4058
12131227
12141228/* ps5v2 */
12151229GAME( 2000, dragnblz, 0,        psikyo5,     dragnblz, dragnblz, ROT270, "Psikyo", "Dragon Blaze", 0 )
1230GAME( 2000, tgm2,     0,        psikyo5_240, tgm2,     tgm2,     ROT0,   "Arika",  "Tetris the Absolute The Grand Master 2", 0 )
1231GAME( 2000, tgm2p,    tgm2,     psikyo5_240, tgm2,     tgm2,     ROT0,   "Arika",  "Tetris the Absolute The Grand Master 2 Plus", 0 )
12161232GAME( 2001, gnbarich, 0,        psikyo5,     gnbarich, gnbarich, ROT270, "Psikyo", "Gunbarich", 0 )
12171233GAME( 2002, mjgtaste, 0,        psikyo5,     mjgtaste, mjgtaste, ROT0,   "Psikyo", "Mahjong G-Taste", 0 )
src/mame/drivers/bishjan.c
r4057r4058
1/*********************************************************************************************************************
1/************************************************************************************************************
22
3Bishou Jan (Laugh World)  (C)1999 Subsino
3                                   -= Subsino Tilemaps Hardware =-
44
5driver by Luca Elia
5                                  driver by   Luca Elia (l.elia@tin.it)
66
7PCB Layout
8----------
97
10|------------------------------------------------------|
11|TDA1519A           28-WAY                             |
12|     VOL                                              |
13|                HM86171                       ULN2003 |
14|   LM324                                              |
15|           S-1                                ULN2003 |
16|                                                      |
17|                                   |-------|  DSW1(8) |
18|                       |-------|   |SUBSINO|          |
19|            2-V201.U9  |SUBSINO|   |SS9802 |          |
20|                       |SS9904 |   |       |          |
21|                       |       |   |-------|          |
22|                       |-------|                      |
23|                                                      |
24|                         44.1MHz             CXK58257 |
25|  3-V201.U25                                          |
26|                                  1-V203.U21          |
27|  4-V201.U26                                       SW1|
28|             |-------|    |-------|   |-----|         |
29|  5-V201.U27 |SUBSINO|    |SUBSINO|   |H8   |         |
30|             |SS9601 |    |SS9803 |   |3044 |         |
31|  6-V201.U28 |       |    |       |   |-----|         |
32|             |-------|    |-------|                   |
33|          62256  62256   BATTERY                      |
34|------------------------------------------------------|
35Notes:
36      H8/3044 - Subsino re-badged Hitachi H8/3044 HD6433044A22F Microcontroller (QFP100)
37                The H8/3044 is a H8/3002 with 24bit address bus and has 32k MASKROM and 2k RAM, clock input is 14.7MHz [44.1/3]
38                MD0,MD1 & MD2 are configured to MODE 6 16MByte Expanded Mode with the on-chip 32k MASKROM enabled.
39     CXK58257 - Sony CXK58257 32k x8 SRAM (SOP28)
40      HM86171 - Hualon Microelectronics HMC HM86171 VGA 256 colour RAMDAC (DIP28)
41          S-1 - ?? Probably some kind of audio OP AMP or DAC? (DIP8)
42          SW1 - Push Button Test Switch
43        HSync - 15.75kHz
44        VSync - 60Hz
8Two 1024x512 tilemaps. Tiles are 8x8x8. There is ram for 512 scroll values (line scroll).
459
46*********************************************************************************************************************/
10-------------------------------------------------------------------------------------------------------------
11Year + Game        CPU         Sound            Custom                            Other
12-------------------------------------------------------------------------------------------------------------
1398 Ying Hua Lian   AM188-EM    M6295 + YM3812?  SS9601, SS9602                    HM86171 RAMDAC, Battery
1499 Bishou Jan      H8/3044     Unknown          SS9601, SS9802, SS9803, SS9904    HM86171 RAMDAC, Battery
15-------------------------------------------------------------------------------------------------------------
4716
17To do:
18
19[bishjan]
20
21- Add sound (does it send sound commands to another cpu?).
22- Game is sometimes too fast (can it read the VBLANK state? saklove can).
23- Implement serial communication (used for protection?)
24
25[saklove]
26
27- Verify sound chip (YM3812) and its clock.
28- Remove IRQ hacks (when an AM188-EM core will be available).
29- Implement serial communication (used for protection?)
30
31************************************************************************************************************/
32
4833#include "driver.h"
4934#include "deprecat.h"
35#include "memconv.h"
5036#include "cpu/h83002/h8.h"
37#include "cpu/i86/i86.h"
38#include "sound/okim6295.h"
39#include "sound/3812intf.h"
5140
52#define BISHJAN_DEBUG   0
53
5441/***************************************************************************
55                                Video Hardware
42                              Tilemaps Access
5643***************************************************************************/
5744
58static int clr_offset;
45static UINT8   *bishjan_videoram_1_lo,   *bishjan_videoram_1_hi;
46static UINT8   *bishjan_videoram_2_lo,   *bishjan_videoram_2_hi;
5947
60static UINT16 *bishjan_scroll, *bishjan_layers;
48static tilemap   *tmap_1;
49static tilemap   *tmap_2;
6150
62static UINT16   *bishjan_videoram1,   *bishjan_videoram2;
63static tilemap   *tmap1,            *tmap2;
51static TILE_GET_INFO( get_tile_info_1 )   {   SET_TILE_INFO(0, (bishjan_videoram_1_hi[ tile_index ] << 8) + bishjan_videoram_1_lo[ tile_index ], 0, 0);   }
52static TILE_GET_INFO( get_tile_info_2 )   {   SET_TILE_INFO(0, (bishjan_videoram_2_hi[ tile_index ] << 8) + bishjan_videoram_2_lo[ tile_index ], 0, 0);   }
6453
65static TILE_GET_INFO( get_tile_info1 )   {   SET_TILE_INFO(0, bishjan_videoram1[ tile_index ], 0, 0);   }
66static TILE_GET_INFO( get_tile_info2 )   {   SET_TILE_INFO(0, bishjan_videoram2[ tile_index ], 0, 0);   }
54static UINT8 bishjan_byte_lo;
6755
68static VIDEO_START(bishjan)
56static WRITE8_HANDLER( bishjan_byte_lo_w )
6957{
70   tmap1 = tilemap_create(   machine, get_tile_info1, tilemap_scan_rows,
71                      8,8, 0x80,0x40   );
58   bishjan_byte_lo = data;
59}
7260
73   tmap2 = tilemap_create(   machine, get_tile_info2, tilemap_scan_rows,
74                      8,8, 0x80,0x40   );
61static WRITE8_HANDLER( bishjan_videoram_1_hi_w )
62{
63   bishjan_videoram_1_hi[offset] = data;
64   tilemap_mark_tile_dirty(tmap_1, offset);
65}
66static WRITE8_HANDLER( bishjan_videoram_1_lo_w )
67{
68   bishjan_videoram_1_lo[offset] = data;
69   tilemap_mark_tile_dirty(tmap_1, offset);
70}
71static WRITE8_HANDLER( bishjan_videoram_1_hi_lo_w )
72{
73   bishjan_videoram_1_hi_w(space, offset, data);
74   bishjan_videoram_1_lo_w(space, offset, bishjan_byte_lo);
75}
7576
76   tilemap_set_transparent_pen(tmap1, 0);
77   tilemap_set_transparent_pen(tmap2, 0);
7877
79   bishjan_videoram1 = (UINT16*)auto_malloc(sizeof(UINT16) * 0x80 * 0x40);
80   bishjan_videoram2 = (UINT16*)auto_malloc(sizeof(UINT16) * 0x80 * 0x40);
81
82   colorram = auto_malloc(256*3);
78static WRITE8_HANDLER( bishjan_videoram_2_hi_w )
79{
80   bishjan_videoram_2_hi[offset] = data;
81   tilemap_mark_tile_dirty(tmap_2, offset);
8382}
84
85static VIDEO_UPDATE( bishjan )
83static WRITE8_HANDLER( bishjan_videoram_2_lo_w )
8684{
87   int layers_ctrl = ~bishjan_layers[0];
85   bishjan_videoram_2_lo[offset] = data;
86   tilemap_mark_tile_dirty(tmap_2, offset);
87}
88static WRITE8_HANDLER( bishjan_videoram_2_hi_lo_w )
89{
90   bishjan_videoram_2_hi_w(space, offset, data);
91   bishjan_videoram_2_lo_w(space, offset, bishjan_byte_lo);
92}
8893
89   int scroll1_x = ((bishjan_scroll[1] & 0x0f00)>>0) | (bishjan_scroll[0] >> 8);
90   int scroll1_y = ((bishjan_scroll[1] & 0xf000)>>4) | (bishjan_scroll[0] & 0xff);
9194
92   int scroll2_x = ((bishjan_scroll[2] & 0x0f)<<8) | (bishjan_scroll[1] & 0xff);
93   int scroll2_y = ((bishjan_scroll[2] & 0xf0)<<4) | (bishjan_scroll[2] >> 8);
95static READ8_HANDLER( bishjan_videoram_1_lo_r )   {   return bishjan_videoram_1_lo[offset];   }
96static READ8_HANDLER( bishjan_videoram_1_hi_r )   {   return bishjan_videoram_1_hi[offset];   }
9497
95#if BISHJAN_DEBUG
96if (input_code_pressed(KEYCODE_Z))
97{
98   int msk = 0;
99   if (input_code_pressed(KEYCODE_Q))   msk |= 1;
100   if (input_code_pressed(KEYCODE_W))   msk |= 2;
101   if (msk != 0) layers_ctrl &= msk;
102}
103#endif
98static READ8_HANDLER( bishjan_videoram_2_lo_r )   {   return bishjan_videoram_2_lo[offset];   }
99static READ8_HANDLER( bishjan_videoram_2_hi_r )   {   return bishjan_videoram_2_hi[offset];   }
104100
105   scroll1_y += 1;
106   scroll2_y += 1;
101// 16-bit handlers for an 8-bit chip
107102
108   tilemap_set_scrollx( tmap1, 0, scroll1_x);   tilemap_set_scrolly( tmap1, 0, scroll1_y );
109   tilemap_set_scrollx( tmap2, 0, scroll2_x);   tilemap_set_scrolly( tmap2, 0, scroll2_y );
103WRITE8TO16BE_MSB( bishjan_byte_lo_msb,            bishjan_byte_lo_w );
110104
111   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
105READWRITE8TO16BE( bishjan_videoram_1_lo_word,    bishjan_videoram_1_lo_r, bishjan_videoram_1_lo_w );
106READWRITE8TO16BE( bishjan_videoram_1_hi_word,    bishjan_videoram_1_hi_r, bishjan_videoram_1_hi_w );
107WRITE8TO16BE    ( bishjan_videoram_1_hi_lo_word, bishjan_videoram_1_hi_lo_w );
112108
113   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap1, 0, 0);
114   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tmap2, 0, 0);
109READWRITE8TO16BE( bishjan_videoram_2_lo_word,    bishjan_videoram_2_lo_r, bishjan_videoram_2_lo_w );
110READWRITE8TO16BE( bishjan_videoram_2_hi_word,    bishjan_videoram_2_hi_r, bishjan_videoram_2_hi_w );
111WRITE8TO16BE    ( bishjan_videoram_2_hi_lo_word, bishjan_videoram_2_hi_lo_w );
115112
116//  popmessage("23: %03x,%03x - %03x,%03x LY: %02x", scroll1_x,scroll1_y, scroll2_x,scroll2_y, (int)*bishjan_layers);
117113
118   return 0;
119}
114/***************************************************************************
115                              Tilemaps Scroll
116***************************************************************************/
120117
121// Palette: HMC HM86171 VGA 256 colour RAMDAC
118static int bishjan_scroll_1_x, bishjan_scroll_1_y;
119static int bishjan_scroll_2_x, bishjan_scroll_2_y;
122120
123static WRITE16_HANDLER(colordac_w)
121// line scroll
122static UINT8 *bishjan_scrollram_1_lo, *bishjan_scrollram_1_hi;
123static UINT8 *bishjan_scrollram_2_lo, *bishjan_scrollram_2_hi;
124
125static WRITE8_HANDLER( bishjan_scroll_w )
124126{
125   if (ACCESSING_BITS_0_7)
127   switch ( offset )
126128   {
127      colorram[clr_offset] = data;
128      palette_set_color_rgb(space->machine, clr_offset/3,
129         pal6bit(colorram[(clr_offset/3)*3+0]),
130         pal6bit(colorram[(clr_offset/3)*3+1]),
131         pal6bit(colorram[(clr_offset/3)*3+2])
132      );
133      clr_offset = (clr_offset+1) % (256*3);
134   }
129      // tmap_1
130      case 0:   bishjan_scroll_1_x = (bishjan_scroll_1_x & 0xf00) | data;   break;            // x low
131      case 1:   bishjan_scroll_1_y = (bishjan_scroll_1_y & 0xf00) | data;   break;            // y low
132      case 2:   bishjan_scroll_1_x = (bishjan_scroll_1_x & 0x0ff) | ((data & 0x0f) << 8);      // y|x high bits
133            bishjan_scroll_1_y = (bishjan_scroll_1_y & 0x0ff) | ((data & 0xf0) << 4);   break;
135134
136   if (ACCESSING_BITS_8_15)
137   {
138      clr_offset = (data>>8) * 3;
135      // tmap_2
136      case 3:   bishjan_scroll_2_x = (bishjan_scroll_2_x & 0xf00) | data;   break;            // x low
137      case 4:   bishjan_scroll_2_y = (bishjan_scroll_2_y & 0xf00) | data;   break;            // y low
138      case 5:   bishjan_scroll_2_x = (bishjan_scroll_2_x & 0x0ff) | ((data & 0x0f) << 8);      // y|x high bits
139            bishjan_scroll_2_y = (bishjan_scroll_2_y & 0x0ff) | ((data & 0xf0) << 4);   break;
139140   }
140141}
141142
142// Tilemaps
143static READ8_HANDLER ( bishjan_scrollram_1_lo_r )   {   return bishjan_scrollram_1_lo[offset];   }
144static READ8_HANDLER ( bishjan_scrollram_1_hi_r )   {   return bishjan_scrollram_1_hi[offset];   }
145static WRITE8_HANDLER( bishjan_scrollram_1_lo_w )   {   bishjan_scrollram_1_lo[offset] = data;   }
146static WRITE8_HANDLER( bishjan_scrollram_1_hi_w )   {   bishjan_scrollram_1_hi[offset] = data;   }
143147
144static UINT16 bishjan_low;
148static READ8_HANDLER ( bishjan_scrollram_2_lo_r )   {   return bishjan_scrollram_2_lo[offset];   }
149static READ8_HANDLER ( bishjan_scrollram_2_hi_r )   {   return bishjan_scrollram_2_hi[offset];   }
150static WRITE8_HANDLER( bishjan_scrollram_2_lo_w )   {   bishjan_scrollram_2_lo[offset] = data;   }
151static WRITE8_HANDLER( bishjan_scrollram_2_hi_w )   {   bishjan_scrollram_2_hi[offset] = data;   }
145152
146static WRITE16_HANDLER( bishjan_low_w )
153static WRITE8_HANDLER( bishjan_scrollram_1_hi_lo_w )
147154{
148   if (ACCESSING_BITS_8_15)   bishjan_low = data >> 8;
155   bishjan_scrollram_1_hi[offset] = data;
156   bishjan_scrollram_1_lo[offset] = bishjan_byte_lo;
149157}
158static WRITE8_HANDLER( bishjan_scrollram_2_hi_lo_w )
159{
160   bishjan_scrollram_2_hi[offset] = data;
161   bishjan_scrollram_2_lo[offset] = bishjan_byte_lo;
162}
150163
151static WRITE16_HANDLER( bishjan_tmap1_w )
164// 16-bit handlers for an 8-bit chip
165
166WRITE8TO16BE( bishjan_scroll_word, bishjan_scroll_w );
167
168READWRITE8TO16BE( bishjan_scrollram_1_lo_word,    bishjan_scrollram_1_lo_r, bishjan_scrollram_1_lo_w );
169READWRITE8TO16BE( bishjan_scrollram_1_hi_word,    bishjan_scrollram_1_hi_r, bishjan_scrollram_1_hi_w );
170WRITE8TO16BE    ( bishjan_scrollram_1_hi_lo_word, bishjan_scrollram_1_hi_lo_w );
171
172READWRITE8TO16BE( bishjan_scrollram_2_lo_word,    bishjan_scrollram_2_lo_r, bishjan_scrollram_2_lo_w );
173READWRITE8TO16BE( bishjan_scrollram_2_hi_word,    bishjan_scrollram_2_hi_r, bishjan_scrollram_2_hi_w );
174WRITE8TO16BE    ( bishjan_scrollram_2_hi_lo_word, bishjan_scrollram_2_hi_lo_w );
175
176
177/***************************************************************************
178                              Tilemaps Disable
179***************************************************************************/
180
181static int bishjan_disable;
182
183static WRITE8_HANDLER( bishjan_disable_w )
152184{
153   if (ACCESSING_BITS_8_15)
154   {
155      bishjan_videoram1[offset*2] = data | bishjan_low;
156      tilemap_mark_tile_dirty(tmap1, offset*2);
157   }
158   if (ACCESSING_BITS_0_7)
159   {
160      bishjan_videoram1[offset*2+1] = (data << 8) | bishjan_low;
161      tilemap_mark_tile_dirty(tmap1, offset*2+1);
162   }
185   bishjan_disable = data;
163186}
164static WRITE16_HANDLER( bishjan_tmap2_w )
187
188// 16-bit handlers for an 8-bit chip
189
190WRITE8TO16BE_LSB( bishjan_disable_lsb, bishjan_disable_w );
191
192
193/***************************************************************************
194                                Video Update
195***************************************************************************/
196
197static VIDEO_START(bishjan)
165198{
166   if (ACCESSING_BITS_8_15)
199   tmap_1 = tilemap_create(   machine, get_tile_info_1, tilemap_scan_rows, 8,8, 0x80,0x40   );
200   tmap_2 = tilemap_create(   machine, get_tile_info_2, tilemap_scan_rows, 8,8, 0x80,0x40   );
201
202   tilemap_set_transparent_pen(tmap_1, 0);
203   tilemap_set_transparent_pen(tmap_2, 0);
204
205   // line scroll
206   tilemap_set_scroll_rows(tmap_1, 0x200);
207   tilemap_set_scroll_rows(tmap_2, 0x200);
208
209   tilemap_set_scrolldy( tmap_1, -1, +1 );
210   tilemap_set_scrolldy( tmap_2, -1, +1 );
211
212   bishjan_videoram_1_lo = auto_malloc(0x80 * 0x40);
213   bishjan_videoram_1_hi = auto_malloc(0x80 * 0x40);
214
215   bishjan_videoram_2_lo = auto_malloc(0x80 * 0x40);
216   bishjan_videoram_2_hi = auto_malloc(0x80 * 0x40);
217
218   bishjan_scrollram_1_lo = auto_malloc(0x200);
219   bishjan_scrollram_1_hi = auto_malloc(0x200);
220
221   bishjan_scrollram_2_lo = auto_malloc(0x200);
222   bishjan_scrollram_2_hi = auto_malloc(0x200);
223
224   bishjan_videoram_2_hi = auto_malloc(0x80 * 0x40);
225
226   colorram = auto_malloc(256*3);
227}
228
229static VIDEO_UPDATE( bishjan )
230{
231   int layers_ctrl = ~bishjan_disable;
232   int y;
233
234#ifdef MAME_DEBUG
235   if (input_code_pressed(KEYCODE_Z))
167236   {
168      bishjan_videoram2[offset*2] = data | bishjan_low;
169      tilemap_mark_tile_dirty(tmap2, offset*2);
237      int msk = 0;
238      if (input_code_pressed(KEYCODE_Q))   msk |= 1;
239      if (input_code_pressed(KEYCODE_W))   msk |= 2;
240      if (msk != 0) layers_ctrl &= msk;
170241   }
171   if (ACCESSING_BITS_0_7)
242#endif
243
244   for (y = 0; y < 0x200; y++)
172245   {
173      bishjan_videoram2[offset*2+1] = (data << 8) | bishjan_low;
174      tilemap_mark_tile_dirty(tmap2, offset*2+1);
246      // line scroll
247
248      tilemap_set_scrollx( tmap_1, y, bishjan_scroll_1_x + bishjan_scrollram_1_lo[y] + (bishjan_scrollram_1_hi[y]<<8) );
249      tilemap_set_scrolly( tmap_1, 0, bishjan_scroll_1_y );
250
251      tilemap_set_scrollx( tmap_2, y, bishjan_scroll_2_x + bishjan_scrollram_2_lo[y] + (bishjan_scrollram_2_hi[y]<<8) );
252      tilemap_set_scrolly( tmap_2, 0, bishjan_scroll_2_y );
175253   }
254
255   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
256
257   if (layers_ctrl & 1)   tilemap_draw(bitmap,cliprect, tmap_1, 0, 0);
258   if (layers_ctrl & 2)   tilemap_draw(bitmap,cliprect, tmap_2, 0, 0);
259
260//  popmessage("SCROLL: %03x,%03x - %03x,%03x DISABLE: %02x", bishjan_scroll_1_x,bishjan_scroll_1_y, bishjan_scroll_2_x,bishjan_scroll_2_y, bishjan_disable);
261
262   return 0;
176263}
177264
178static READ16_HANDLER( bishjan_tmap1_lo_r )
265
266/***************************************************************************
267                Palette: HMC HM86171 VGA 256 colour RAMDAC
268***************************************************************************/
269
270static int colordac_offs;
271
272static WRITE8_HANDLER(colordac_w)
179273{
180   return (bishjan_videoram1[offset*2+0] << 8) | (bishjan_videoram1[offset*2+1] & 0x00ff);
181}
182static READ16_HANDLER( bishjan_tmap1_hi_r )
183{
184   return (bishjan_videoram1[offset*2+0] & 0xff00) | (bishjan_videoram1[offset*2+1] >> 8);
185}
274   switch ( offset )
275   {
276      case 0:
277         colordac_offs = data * 3;
278         break;
186279
187static READ16_HANDLER( bishjan_tmap2_lo_r )
188{
189   return (bishjan_videoram2[offset*2+0] << 8) | (bishjan_videoram2[offset*2+1] & 0x00ff);
280      case 1:
281         colorram[colordac_offs] = data;
282         palette_set_color_rgb(space->machine, colordac_offs/3,
283            pal6bit(colorram[(colordac_offs/3)*3+0]),
284            pal6bit(colorram[(colordac_offs/3)*3+1]),
285            pal6bit(colorram[(colordac_offs/3)*3+2])
286         );
287         colordac_offs = (colordac_offs+1) % (256*3);
288         break;
289
290      case 2:
291         // ff?
292         break;
293
294      case 3:
295         break;
296   }
190297}
191static READ16_HANDLER( bishjan_tmap2_hi_r )
192{
193   return (bishjan_videoram2[offset*2+0] & 0xff00) | (bishjan_videoram2[offset*2+1] >> 8);
194}
195298
196// Inputs
299// 16-bit handlers for an 8-bit chip
197300
301WRITE8TO16BE( colordac_word, colordac_w );
302
303
304/***************************************************************************
305                                Memory Maps
306***************************************************************************/
307
308/***************************************************************************
309                                Bishou Jan
310***************************************************************************/
311
198312static UINT16 bishjan_sel, bishjan_input, bishjan_hopper;
199313
200314static WRITE16_HANDLER( bishjan_sel_w )
r4057r4058
202316   if (ACCESSING_BITS_8_15)   bishjan_sel = data >> 8;
203317}
204318
205static READ16_HANDLER( bishjan_unk_r )
319static READ16_HANDLER( bishjan_serial_r )
206320{
207321   return
208      (mame_rand(space->machine) & 0x9800)   |   // bit 7 eeprom?
322      (mame_rand(space->machine) & 0x9800)   |   // bit 7 - serial communication
209323      (((bishjan_sel==0x12) ? 0x40:0x00) << 8) |
210324//      (mame_rand() & 0xff);
211325//      (((video_screen_get_frame_number(space->machine->primary_screen)%60)==0)?0x18:0x00);
r4057r4058
227341      if (bishjan_input & (1 << i))
228342         res = input_port_read(space->machine, port[i]);
229343
230   return   (res << 8) |
231         input_port_read(space->machine, "SYSTEM") |
344   return   (res << 8) |                           // high byte
345         input_port_read(space->machine, "SYSTEM") |      // low byte
232346         ((bishjan_hopper && !(video_screen_get_frame_number(space->machine->primary_screen)%10)) ? 0x00 : 0x04)   // bit 2: hopper sensor
233347   ;
234348}
r4057r4058
243357   }
244358}
245359
246/***************************************************************************
247                                Memory Maps
248***************************************************************************/
249
250/*
251432000 & 436000 W + lo (80*20=1000)
252412000 & 422000 R (lo & hi)
253416000 & 426000 R (lo & hi)
254
255433000 & 437000 W
256413000 & 423000 R
257417000 & 427000 R
258*/
259
260360static ADDRESS_MAP_START( bishjan_map, ADDRESS_SPACE_PROGRAM, 16 )
261361   ADDRESS_MAP_GLOBAL_MASK(0xffffff)
262362
r4057r4058
265365
266366   AM_RANGE( 0x200000, 0x207fff ) AM_RAM AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)   // battery
267367
268   AM_RANGE( 0x412000, 0x412fff ) AM_READ( bishjan_tmap2_lo_r )   //?
269   AM_RANGE( 0x413000, 0x413fff ) AM_READ( SMH_RAM ) AM_SHARE(1)
270   AM_RANGE( 0x416000, 0x416fff ) AM_READ( bishjan_tmap1_lo_r )   //?
271   AM_RANGE( 0x417000, 0x417fff ) AM_READ( SMH_RAM ) AM_SHARE(1)
272   AM_RANGE( 0x422000, 0x422fff ) AM_READ( bishjan_tmap2_hi_r )   //?
273   AM_RANGE( 0x423000, 0x423fff ) AM_READ( SMH_RAM ) AM_SHARE(2)
274   AM_RANGE( 0x426000, 0x426fff ) AM_READ( bishjan_tmap1_hi_r )
275   AM_RANGE( 0x427000, 0x427fff ) AM_READ( SMH_RAM ) AM_SHARE(2)
276   AM_RANGE( 0x430000, 0x431fff ) AM_WRITE( bishjan_tmap2_w )
277   AM_RANGE( 0x432000, 0x432fff ) AM_WRITE( bishjan_tmap2_w )      //?
278   AM_RANGE( 0x433000, 0x433fff ) AM_WRITE( SMH_RAM ) AM_SHARE(1)
279   AM_RANGE( 0x434000, 0x435fff ) AM_WRITE( bishjan_tmap1_w )
280   AM_RANGE( 0x436000, 0x436fff ) AM_WRITE( bishjan_tmap1_w )      //?
281   AM_RANGE( 0x437000, 0x437fff ) AM_WRITE( SMH_RAM ) AM_SHARE(2)
282368
369   // read lo (2)   (only half tilemap?)
370   AM_RANGE( 0x412000, 0x412fff ) AM_READ( bishjan_videoram_2_lo_word_r )
371   AM_RANGE( 0x413000, 0x4131ff ) AM_READWRITE( bishjan_scrollram_2_lo_word_r, bishjan_scrollram_2_lo_word_w )
372   // read lo (1)
373   AM_RANGE( 0x416000, 0x416fff ) AM_READ( bishjan_videoram_1_lo_word_r )
374   AM_RANGE( 0x417000, 0x4171ff ) AM_READWRITE( bishjan_scrollram_1_lo_word_r, bishjan_scrollram_1_lo_word_w )
375
376   // read hi (2)
377   AM_RANGE( 0x422000, 0x422fff ) AM_READ( bishjan_videoram_2_hi_word_r )
378   AM_RANGE( 0x423000, 0x4231ff ) AM_READWRITE( bishjan_scrollram_2_hi_word_r, bishjan_scrollram_2_hi_word_w )
379   // read hi (1)
380   AM_RANGE( 0x426000, 0x426fff ) AM_READ( bishjan_videoram_1_hi_word_r )
381   AM_RANGE( 0x427000, 0x4271ff ) AM_READWRITE( bishjan_scrollram_1_hi_word_r, bishjan_scrollram_1_hi_word_w )
382
383   // write both (2)
384   AM_RANGE( 0x430000, 0x431fff ) AM_WRITE( bishjan_videoram_2_hi_lo_word_w )
385   AM_RANGE( 0x432000, 0x432fff ) AM_WRITE( bishjan_videoram_2_hi_lo_word_w )
386   AM_RANGE( 0x433000, 0x4331ff ) AM_WRITE( bishjan_scrollram_2_hi_lo_word_w )
387   // write both (1)
388   AM_RANGE( 0x434000, 0x435fff ) AM_WRITE( bishjan_videoram_1_hi_lo_word_w )
389   AM_RANGE( 0x436000, 0x436fff ) AM_WRITE( bishjan_videoram_1_hi_lo_word_w )
390   AM_RANGE( 0x437000, 0x4371ff ) AM_WRITE( bishjan_scrollram_1_hi_lo_word_w )
391
392
283393   AM_RANGE( 0x600000, 0x600001 ) AM_READWRITE( SMH_NOP, bishjan_sel_w )
284   AM_RANGE( 0x600060, 0x600061 ) AM_WRITE( colordac_w )
285   AM_RANGE( 0x600062, 0x600063 ) AM_WRITE( SMH_NOP )   // ff to 600062
286   AM_RANGE( 0x6000a0, 0x6000a1 ) AM_WRITE( bishjan_low_w )
394   AM_RANGE( 0x600060, 0x600063 ) AM_WRITE( colordac_word_w )
395   AM_RANGE( 0x6000a0, 0x6000a1 ) AM_WRITE( bishjan_byte_lo_msb_w )
287396
288   AM_RANGE( 0xa0001e, 0xa0001f ) AM_WRITE( SMH_RAM ) AM_BASE( &bishjan_layers )
397   AM_RANGE( 0xa0001e, 0xa0001f ) AM_WRITE( bishjan_disable_lsb_w )
289398
290   AM_RANGE( 0xa00020, 0xa00025 ) AM_WRITE( SMH_RAM ) AM_BASE( &bishjan_scroll )
399   AM_RANGE( 0xa00020, 0xa00025 ) AM_WRITE( bishjan_scroll_word_w )
291400
292   AM_RANGE( 0xc00000, 0xc00001 ) AM_READ_PORT("DSW")   // c00001 sw1
293   AM_RANGE( 0xc00002, 0xc00003 ) AM_READ_PORT("JOY") AM_WRITE( bishjan_input_w )   // in c
294   AM_RANGE( 0xc00004, 0xc00005 ) AM_READ( bishjan_input_r )   // in a & b
295   AM_RANGE( 0xc00006, 0xc00007 ) AM_READ( bishjan_unk_r )      // c00006 in d ($18)
296   AM_RANGE( 0xc00008, 0xc00009 ) AM_READ_PORT("RESET") AM_WRITE( bishjan_coin_w )   // c00009 reset
401   AM_RANGE( 0xc00000, 0xc00001 ) AM_READ_PORT("DSW")                        // SW1
402   AM_RANGE( 0xc00002, 0xc00003 ) AM_READ_PORT("JOY") AM_WRITE( bishjan_input_w )   // IN C
403   AM_RANGE( 0xc00004, 0xc00005 ) AM_READ( bishjan_input_r )                  // IN A & B
404   AM_RANGE( 0xc00006, 0xc00007 ) AM_READ( bishjan_serial_r )                  // IN D
405   AM_RANGE( 0xc00008, 0xc00009 ) AM_READ_PORT("RESET") AM_WRITE( bishjan_coin_w )
297406ADDRESS_MAP_END
298407
408/***************************************************************************
409                          Sakura Love - Ying Hua Lian
410***************************************************************************/
299411
412static UINT8 saklove_dsw_mask;
413
414static WRITE8_HANDLER( saklove_dsw_mask_w )
415{
416   saklove_dsw_mask = data;
417}
418
419static READ8_HANDLER( saklove_dsw_r )
420{
421   return   ( (input_port_read(space->machine, "DSW1") & saklove_dsw_mask) ? 0x01 : 0 ) |
422         ( (input_port_read(space->machine, "DSW2") & saklove_dsw_mask) ? 0x02 : 0 ) |
423         ( (input_port_read(space->machine, "DSW3") & saklove_dsw_mask) ? 0x04 : 0 ) |
424         ( (input_port_read(space->machine, "DSW4") & saklove_dsw_mask) ? 0x08 : 0 ) ;
425}
426
427static UINT8 *saklove_outputs;
428static WRITE8_HANDLER( saklove_outputs_w )
429{
430   saklove_outputs[offset] = data;
431
432   switch (offset)
433   {
434      case 0:
435         // bit 0 set on coin in
436         // bit 1 set on key in
437         break;
438
439      case 1:
440         break;
441
442      case 2:
443         break;
444
445      case 3:
446         // 1, 2, 4
447         break;
448   }
449
450//  popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", saklove_outputs[0], saklove_outputs[1], saklove_outputs[2], saklove_outputs[3]);
451}
452
453static WRITE8_HANDLER( saklove_oki_bank_w )
454{
455   // it writes 0x32 or 0x33
456   okim6295_set_bank_base(0, (data & 1) * 0x40000);
457}
458
459static READ8_HANDLER( saklove_vblank_r )
460{
461   return video_screen_get_vblank(space->machine->primary_screen) ? 0x04 : 0x00;
462}
463
464static UINT8 *am188em_regs;
465
466enum
467{
468   AM188EM_IMASK = 0x28
469};
470
471static READ8_HANDLER( am188em_regs_r )
472{
473   return am188em_regs[offset];
474}
475
476static WRITE8_HANDLER( am188em_regs_w )
477{
478   am188em_regs[offset] = data;
479}
480
481static MACHINE_RESET( saklove )
482{
483   // start with masked interrupts
484   am188em_regs[AM188EM_IMASK+0] = 0xfd;
485   am188em_regs[AM188EM_IMASK+1] = 0x07;
486}
487
488static ADDRESS_MAP_START( saklove_map, ADDRESS_SPACE_PROGRAM, 8 )
489   AM_RANGE(0x00000, 0x07fff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)   // battery
490
491   // read lo (2)   (only half tilemap?)
492   AM_RANGE(0x12000, 0x12fff) AM_READWRITE( bishjan_videoram_2_lo_r, bishjan_videoram_2_lo_w )
493   AM_RANGE(0x13000, 0x131ff) AM_READWRITE( bishjan_scrollram_2_lo_r, bishjan_scrollram_2_lo_w )
494   // read lo (1)
495   AM_RANGE(0x16000, 0x16fff) AM_READWRITE( bishjan_videoram_1_lo_r, bishjan_videoram_1_lo_w )
496   AM_RANGE(0x17000, 0x171ff) AM_READWRITE( bishjan_scrollram_1_lo_r, bishjan_scrollram_1_lo_w )
497
498   // read hi (2)
499   AM_RANGE(0x22000, 0x22fff) AM_READWRITE( bishjan_videoram_2_hi_r, bishjan_videoram_2_hi_w )
500   AM_RANGE(0x23000, 0x231ff) AM_READWRITE( bishjan_scrollram_2_hi_r, bishjan_scrollram_2_hi_w )
501   // read hi (1)
502   AM_RANGE(0x26000, 0x26fff) AM_READWRITE( bishjan_videoram_1_hi_r, bishjan_videoram_1_hi_w )
503   AM_RANGE(0x27000, 0x271ff) AM_READWRITE( bishjan_scrollram_1_hi_r, bishjan_scrollram_1_hi_w )
504
505   // write both (2)
506   AM_RANGE(0x30000, 0x31fff) AM_READWRITE( bishjan_videoram_2_hi_r, bishjan_videoram_2_hi_lo_w )
507   // write both (1)
508   AM_RANGE(0x34000, 0x35fff) AM_READWRITE( bishjan_videoram_1_hi_r, bishjan_videoram_1_hi_lo_w )
509
510   AM_RANGE(0xe0000, 0xfffff) AM_ROM AM_REGION("main",0)
511ADDRESS_MAP_END
512
513static ADDRESS_MAP_START( saklove_io, ADDRESS_SPACE_IO, 8 )
514   AM_RANGE(0x0020, 0x0020) AM_READWRITE( okim6295_status_0_r, okim6295_data_0_w )
515   AM_RANGE(0x0040, 0x0040) AM_WRITE( ym3812_control_port_0_w )
516   AM_RANGE(0x0041, 0x0041) AM_WRITE( ym3812_write_port_0_w )
517
518   AM_RANGE(0x0060, 0x0062) AM_WRITE( colordac_w )
519
520   AM_RANGE(0x00a0, 0x00a0) AM_WRITE( bishjan_byte_lo_w )
521
522   AM_RANGE(0x021f, 0x021f) AM_WRITE( bishjan_disable_w )
523   AM_RANGE(0x0220, 0x0225) AM_WRITE( bishjan_scroll_w )
524
525   AM_RANGE(0x0300, 0x0303) AM_WRITE( saklove_outputs_w ) AM_BASE( &saklove_outputs )
526   AM_RANGE(0x0303, 0x0303) AM_READ_PORT( "IN D" )   // 0x40 serial out, 0x80 serial in
527   AM_RANGE(0x0304, 0x0304) AM_READ_PORT( "IN A" )
528   AM_RANGE(0x0305, 0x0305) AM_READ_PORT( "IN B" )
529   AM_RANGE(0x0306, 0x0306) AM_READ_PORT( "IN C" )
530
531   AM_RANGE(0x0307, 0x0307) AM_READ ( saklove_dsw_r )
532   AM_RANGE(0x0308, 0x0308) AM_WRITE( saklove_dsw_mask_w )
533
534   AM_RANGE(0x0312, 0x0312) AM_READWRITE( saklove_vblank_r, saklove_oki_bank_w )
535
536   // Peripheral Control Block
537   AM_RANGE(0xff00, 0xffff) AM_READWRITE( am188em_regs_r, am188em_regs_w ) AM_BASE( &am188em_regs )
538ADDRESS_MAP_END
539
540
300541/***************************************************************************
301542                                Graphics Layout
302543***************************************************************************/
r4057r4058
313554};
314555
315556static GFXDECODE_START( bishjan )
316   GFXDECODE_ENTRY( "gfx1", 0, bishjan_8x8_layout, 0, 1 )
557   GFXDECODE_ENTRY( "tilemap", 0, bishjan_8x8_layout, 0, 1 )
317558GFXDECODE_END
318559
319560
r4057r4058
321562                                Input Ports
322563***************************************************************************/
323564
565/***************************************************************************
566                                Bishou Jan
567***************************************************************************/
568
324569static INPUT_PORTS_START( bishjan )
325   PORT_START("RESET")      /* IN0 - Reset */
570   PORT_START("RESET")
326571   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F1)
327572
328   PORT_START("DSW")      /* IN1 - DSW(SW1) */
573   PORT_START("DSW")   // SW1
329574   PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Controls ) )
330575   PORT_DIPSETTING(      0x0001, "Keyboard" )
331576   PORT_DIPSETTING(      0x0000, DEF_STR( Joystick ) )
r4057r4058
351596   PORT_DIPSETTING(      0x0080, DEF_STR( Off ) )
352597   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
353598
354   PORT_START("JOY")      /* IN2 - C */
599   PORT_START("JOY")   // IN C
355600   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1         ) PORT_NAME("1 Player Start (Joy Mode)")   // start (joy)
356601   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   )   // down (joy)
357602   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN      )
r4057r4058
361606   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_BET   ) PORT_NAME("P1 Mahjong Bet (Joy Mode)")   // bet (joy)
362607   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON2      )   // select (joy)
363608
364   PORT_START("SYSTEM")      /* IN3 - A */
609   PORT_START("SYSTEM") // IN A
365610   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN      )
366   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE      )   // test
611   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE      ) PORT_IMPULSE(1)   // service mode
367612   PORT_BIT( 0x0004, IP_ACTIVE_HIGH,IPT_SPECIAL      )   // hopper sensor
368613   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1      )   // stats
369614   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE2      )   // pay out? "hopper empty"
r4057r4058
371616   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SERVICE3      )   // pay out? "hopper empty"
372617   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_COIN2         )   PORT_IMPULSE(2)   // coin
373618
374   PORT_START("KEYB_0")   /* IN4 - B(1) */
619   PORT_START("KEYB_0")   // IN B(0)
375620   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A      )   // a
376621   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E      )   // e
377622   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I      )   // i
r4057r4058
381626   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN      )
382627   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN      )
383628
384   PORT_START("KEYB_1")   /* IN5 - B(2) */
629   PORT_START("KEYB_1")   // IN B(1)
385630   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B      )   // b
386631   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F      )   // f
387632   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J      )   // j
r4057r4058
391636   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN      )
392637   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN      )
393638
394   PORT_START("KEYB_2")   /* IN6 - B(3) */
639   PORT_START("KEYB_2")   // IN B(2)
395640   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C      )   // c
396641   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G      )   // g
397642   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K      )   // k
r4057r4058
401646   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN      )
402647   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN      )
403648
404   PORT_START("KEYB_3")   /* IN7 - B(4) */
649   PORT_START("KEYB_3")   // IN B(3)
405650   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D      )   // d
406651   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H      )   // h
407652   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L      )   // l
r4057r4058
411656   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN      )
412657   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN      )
413658
414   PORT_START("KEYB_4")   /* IN8 - B(5) */
659   PORT_START("KEYB_4")   // IN B(4)
415660   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN      )
416661   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN      )   // g2
417662   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN      )   // e2
r4057r4058
422667   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN      )
423668INPUT_PORTS_END
424669
670/***************************************************************************
671                          Sakura Love - Ying Hua Lian
672***************************************************************************/
425673
674static INPUT_PORTS_START( saklove )
675   PORT_START("DSW1")
676   PORT_DIPNAME( 0x07, 0x00, "Coin" )
677   PORT_DIPSETTING(    0x01, "1" )
678   PORT_DIPSETTING(    0x02, "5" )
679   PORT_DIPSETTING(    0x00, "10" )
680   PORT_DIPSETTING(    0x03, "20" )
681   PORT_DIPSETTING(    0x04, "25" )
682   PORT_DIPSETTING(    0x05, "50" )
683   PORT_DIPSETTING(    0x06, "100" )
684   PORT_DIPSETTING(    0x07, "300" )
685   PORT_DIPNAME( 0x38, 0x00, "Key In" )
686   PORT_DIPSETTING(    0x08, "10" )
687   PORT_DIPSETTING(    0x10, "20" )
688   PORT_DIPSETTING(    0x18, "25" )
689   PORT_DIPSETTING(    0x20, "50" )
690   PORT_DIPSETTING(    0x00, "100" )
691   PORT_DIPSETTING(    0x28, "300" )
692   PORT_DIPSETTING(    0x30, "500" )
693   PORT_DIPSETTING(    0x38, "1000" )
694   PORT_DIPNAME( 0x40, 0x00, "Pay Out" )
695   PORT_DIPSETTING(    0x00, "Coin" )
696   PORT_DIPSETTING(    0x40, "Key In" )
697   PORT_DIPNAME( 0x80, 0x00, "Key Out" )
698   PORT_DIPSETTING(    0x80, "Coin" )
699   PORT_DIPSETTING(    0x00, "Key In" )
700
701   PORT_START("DSW2")
702   PORT_DIPNAME( 0x03, 0x00, "Min Bet" )
703   PORT_DIPSETTING(    0x00, "1" )
704   PORT_DIPSETTING(    0x01, "5" )
705   PORT_DIPSETTING(    0x02, "10" )
706   PORT_DIPSETTING(    0x03, "20" )
707   PORT_DIPNAME( 0x0c, 0x00, "Max Bet" )
708   PORT_DIPSETTING(    0x0c, "10" )
709   PORT_DIPSETTING(    0x08, "20" )
710   PORT_DIPSETTING(    0x04, "40" )
711   PORT_DIPSETTING(    0x00, "50" )
712   PORT_DIPUNKNOWN( 0x10, 0x00 )
713   PORT_DIPUNKNOWN( 0x20, 0x00 )
714   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) )
715   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
716   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
717   PORT_DIPNAME( 0x80, 0x00, "Double Up" )
718   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
719   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
720
721   PORT_START("DSW3")
722   PORT_DIPNAME( 0x07, 0x00, "Win Rate (%)" )
723   PORT_DIPSETTING(    0x01, "55" )
724   PORT_DIPSETTING(    0x02, "60" )
725   PORT_DIPSETTING(    0x03, "65" )
726   PORT_DIPSETTING(    0x04, "70" )
727   PORT_DIPSETTING(    0x05, "75" )
728   PORT_DIPSETTING(    0x00, "80" )
729   PORT_DIPSETTING(    0x06, "85" )
730   PORT_DIPSETTING(    0x07, "90" )
731   PORT_DIPNAME( 0x18, 0x00, "Game Limit" )
732   PORT_DIPSETTING(    0x08, "10k" )
733   PORT_DIPSETTING(    0x00, "20k" )
734   PORT_DIPSETTING(    0x10, "60k" )
735   PORT_DIPSETTING(    0x18, "80k" )
736   PORT_DIPUNKNOWN( 0x20, 0x00 )
737   PORT_DIPUNKNOWN( 0x40, 0x00 )
738   PORT_DIPUNKNOWN( 0x80, 0x00 )
739
740   PORT_START("DSW4")
741   PORT_DIPNAME( 0x03, 0x00, "Double Up Level" )
742   PORT_DIPSETTING(    0x03, "0" )
743   PORT_DIPSETTING(    0x02, "1" )
744   PORT_DIPSETTING(    0x01, "2" )
745   PORT_DIPSETTING(    0x00, "3" )
746   PORT_DIPNAME( 0x0c, 0x00, "Double Up Limit" )
747   PORT_DIPSETTING(    0x00, "5k" )
748   PORT_DIPSETTING(    0x04, "10k" )
749   PORT_DIPSETTING(    0x08, "20k" )
750   PORT_DIPSETTING(    0x0c, "30k" )
751   PORT_DIPUNKNOWN( 0x10, 0x10 )
752   PORT_DIPNAME( 0x20, 0x00, "Coin Type" )
753   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
754   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
755   PORT_DIPUNKNOWN( 0x40, 0x40 )
756   PORT_DIPNAME( 0x80, 0x00, "Jamma" )
757   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
758   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
759
760   PORT_START("IN A")
761   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1  ) PORT_NAME("Bet 1")
762   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2  ) PORT_NAME("Bet 2")
763   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3  ) PORT_NAME("Bet 3")
764   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  )
765   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN  )
766   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1   ) PORT_NAME("Play")
767   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5  ) PORT_NAME("Big? / Small?")
768   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4  ) PORT_NAME("Bet Amount")   // 1-5-10
769
770   PORT_START("IN B")
771   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START2   )         // selects music in system test / exit
772   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP )   // top 10? / double up?
773   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
774   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  )
775   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6  ) PORT_NAME("Big? / Small?")   // plays sample or advances music in system test / big or small?
776   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
777   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1    )
778   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
779
780   PORT_START("IN C")
781   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics")
782   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
783   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN  )
784   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
785   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2    )   // key in
786   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
787   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE  ) PORT_IMPULSE(2)   // service mode
788   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )   // used?
789
790   PORT_START("IN D")   // bits 3 and 4 shown in test mode
791   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN  )
792   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN  )
793   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN  )
794   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN  ) // used?
795   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER    ) PORT_NAME("Reset") PORT_CODE(KEYCODE_F1)
796   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN  )
797   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN  )
798   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN  )
799INPUT_PORTS_END
800
801
426802/***************************************************************************
427803                                Machine Drivers
428804***************************************************************************/
429805
806/***************************************************************************
807                                Bishou Jan
808***************************************************************************/
809
430810static INTERRUPT_GEN( bishjan_interrupt )
431811{
432812   switch (cpu_getiloops(device))
r4057r4058
441821}
442822
443823static MACHINE_DRIVER_START( bishjan )
444   MDRV_CPU_ADD("main", H83044, 44100000/3)
824   MDRV_CPU_ADD("main", H83044, XTAL_44_1MHz / 3)
445825   MDRV_CPU_PROGRAM_MAP( bishjan_map, 0 )
446826   MDRV_CPU_VBLANK_INT_HACK(bishjan_interrupt,2)
447827
r4057r4058
462842MACHINE_DRIVER_END
463843
464844/***************************************************************************
845                          Sakura Love - Ying Hua Lian
846***************************************************************************/
847
848static INTERRUPT_GEN( saklove_interrupt )
849{
850   if ((am188em_regs[AM188EM_IMASK+0] & 0x01) == 0)   // TMR mask
851      cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x4c/4);
852}
853
854static MACHINE_DRIVER_START( saklove )
855   MDRV_CPU_ADD("main", I80188, XTAL_20MHz )   // !! AMD AM188-EM !!
856   MDRV_CPU_PROGRAM_MAP( saklove_map, 0 )
857   MDRV_CPU_IO_MAP( saklove_io, 0 )
858   MDRV_CPU_VBLANK_INT( "main", saklove_interrupt )
859
860   MDRV_MACHINE_RESET(saklove)
861   MDRV_NVRAM_HANDLER(generic_0fill)
862
863   /* video hardware */
864   MDRV_SCREEN_ADD("main", RASTER)
865   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
866   MDRV_SCREEN_SIZE( 512, 256 )
867   MDRV_SCREEN_VISIBLE_AREA( 0, 512-1, 0, 256-16-1 )
868   MDRV_SCREEN_REFRESH_RATE( 58.7270 )
869
870   MDRV_GFXDECODE(bishjan)
871   MDRV_PALETTE_LENGTH( 256 )
872
873   MDRV_VIDEO_START( bishjan )
874   MDRV_VIDEO_UPDATE( bishjan )
875
876   /* sound hardware */
877   MDRV_SPEAKER_STANDARD_MONO("mono")
878
879   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_8_4672MHz / 8)
880   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
881   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
882
883   MDRV_SOUND_ADD("ym", YM3812, XTAL_12MHz / 4)   // ? chip and clock unknown
884   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
885MACHINE_DRIVER_END
886
887
888/***************************************************************************
465889                                ROMs Loading
466890***************************************************************************/
467891
892/***************************************************************************
893
894Bishou Jan (Laugh World)
895(C)1999 Subsino
896
897PCB Layout
898----------
899
900|------------------------------------------------------|
901|TDA1519A           28-WAY                             |
902|     VOL                                              |
903|                HM86171                       ULN2003 |
904|   LM324                                              |
905|           S-1                                ULN2003 |
906|                                                      |
907|                                   |-------|  DSW1(8) |
908|                       |-------|   |SUBSINO|          |
909|            2-V201.U9  |SUBSINO|   |SS9802 |          |
910|                       |SS9904 |   |       |          |
911|                       |       |   |-------|          |
912|                       |-------|                      |
913|                                                      |
914|                         44.1MHz             CXK58257 |
915|  3-V201.U25                                          |
916|                                  1-V203.U21          |
917|  4-V201.U26                                       SW1|
918|             |-------|    |-------|   |-----|         |
919|  5-V201.U27 |SUBSINO|    |SUBSINO|   |H8   |         |
920|             |SS9601 |    |SS9803 |   |3044 |         |
921|  6-V201.U28 |       |    |       |   |-----|         |
922|             |-------|    |-------|                   |
923|          62256  62256   BATTERY                      |
924|------------------------------------------------------|
925Notes:
926      H8/3044 - Subsino re-badged Hitachi H8/3044 HD6433044A22F Microcontroller (QFP100)
927                The H8/3044 is a H8/3002 with 24bit address bus and has 32k MASKROM and 2k RAM, clock input is 14.7MHz [44.1/3]
928                MD0,MD1 & MD2 are configured to MODE 6 16MByte Expanded Mode with the on-chip 32k MASKROM enabled.
929     CXK58257 - Sony CXK58257 32k x8 SRAM (SOP28)
930      HM86171 - Hualon Microelectronics HMC HM86171 VGA 256 colour RAMDAC (DIP28)
931          S-1 - ?? Probably some kind of audio OP AMP or DAC? (DIP8)
932          SW1 - Push Button Test Switch
933        HSync - 15.75kHz
934        VSync - 60Hz
935
936***************************************************************************/
937
468938ROM_START( bishjan )
469   ROM_REGION( 0x100000, "main", 0 )      // H8/3044 program
939   ROM_REGION( 0x100000, "main", 0 )   // H8/3044
470940   ROM_LOAD( "1-v203.u21", 0x000000, 0x080000, CRC(1f891d48) SHA1(0b6a5aa8b781ba8fc133289790419aa8ea21c400) )
471941
472   ROM_REGION( 0x400000, "gfx1", 0 )      // Tiles
942   ROM_REGION( 0x400000, "tilemap", ROMREGION_DISPOSE )
473943   ROM_LOAD32_BYTE( "3-v201.u25", 0x000000, 0x100000, CRC(e013e647) SHA1(a5b0f82f3454393c1ea5e635b0d37735a25e2ea5) )
474944   ROM_LOAD32_BYTE( "4-v201.u26", 0x000001, 0x100000, CRC(e0d40ef1) SHA1(95f80889103a7b93080b46387274cb1ffe0c8768) )
475945   ROM_LOAD32_BYTE( "5-v201.u27", 0x000002, 0x100000, CRC(85067d40) SHA1(3ecf7851311a77a0dfca90775fcbf6faabe9c2ab) )
476946   ROM_LOAD32_BYTE( "6-v201.u28", 0x000003, 0x100000, CRC(430bd9d7) SHA1(dadf5a7eb90cf2dc20f97dbf20a4b6c8e7734fb1) )
477947
478   ROM_REGION( 0x100000, "samples", 0 )   // Samples
948   ROM_REGION( 0x100000, "samples", 0 )
479949   ROM_LOAD( "2-v201.u9", 0x000000, 0x100000, CRC(ea42764d) SHA1(13fe1cd30e474f4b092949c440068e9ddca79976) )
480950ROM_END
481951
r4057r4058
491961   rom[0x0CC5C/2] = 0x5670;
492962}
493963
494GAME(1999, bishjan, 0, bishjan, bishjan, bishjan, ROT0, "Subsino", "Bishou Jan", GAME_NO_SOUND)
964/***************************************************************************
965
966Sakura Love
967Subsino, 1998
968
969PCB Layout
970----------
971
972|------------------------------------|
973|     ULN2003 ULN2003 ULN2003 ULN2003|
974|LM358     HM86171     |-----|    PAL|
975| M6295       8.4672MHz|SS9602    PAL|
976| LM324                |-----|    PAL|
977|J              |-------|         PAL|
978|A              |SUBSINO|         PAL|
979|M  2   12MHz   |SS9601 |         SW5|
980|M  3   20MHz   |       |            |
981|A  4           |-------|            |
982|   5        1  LC36256              |
983|   6      AM188-EM    62256  SW3 SW4|
984|BATTERY               62256  SW1 SW2|
985|------------------------------------|
986Notes:
987      AM188-EM - AMD AM188 Main CPU (QFP100) Clock 20.0MHz
988      M6295    - clock 1.0584MHz [8.4672/8]. Pin 7 HIGH
989      SW1-SW4  - Dip switches with 8 positions
990      SW5      - Reset switch
991      VSync    - 58.7270Hz
992      HSync    - 15.3234kHz
993
994***************************************************************************/
995
996ROM_START( saklove )
997   ROM_REGION( 0x20000, "main", 0 )   // AM188-EM
998   ROM_LOAD( "1.u23", 0x00000, 0x20000, CRC(02319bfb) SHA1(1a425dcdeecae92d8b7457d1897c700ac7856a9d) )
999
1000   ROM_REGION( 0x200000, "tilemap", ROMREGION_DISPOSE )
1001   ROM_LOAD32_BYTE( "3.u27", 0x000000, 0x80000, CRC(01aa8fbd) SHA1(d1d19ef52c8077ccf17cc2fde96fd56c626e33db) )
1002   ROM_LOAD32_BYTE( "4.u28", 0x000001, 0x80000, CRC(f8db7ab6) SHA1(3af4e92ab27edc980eccecdbbbb431e1d2101059) )
1003   ROM_LOAD32_BYTE( "5.u29", 0x000002, 0x80000, CRC(c6ca1764) SHA1(92bfa19e116d358b03164f2448a28e7524e3cc62) )
1004   ROM_LOAD32_BYTE( "6.u30", 0x000003, 0x80000, CRC(5823c39e) SHA1(257e862ac736ff403ce9c70bbdeed340dfe168af) )
1005
1006   ROM_REGION( 0x80000, "oki", 0 )
1007   ROM_LOAD( "2.u10", 0x00000, 0x80000, CRC(4f70125c) SHA1(edd5e6bd47b9a4fa3c4057cb4a85544241fe483d) )
1008ROM_END
1009
1010static DRIVER_INIT(saklove)
1011{
1012   UINT8 *rom = memory_region(machine, "main");
1013
1014   // patch protection test (it always enters test mode on boot otherwise)
1015   rom[0x0e029] = 0xeb;
1016}
1017
1018
1019GAME( 1998, saklove, 0, saklove, saklove, saklove, ROT0, "Subsino", "Ying Hua Lian 2.0 (China 1.02)", 0 )
1020GAME( 1999, bishjan, 0, bishjan, bishjan, bishjan, ROT0, "Subsino", "Bishou Jan (Japan 203)",         GAME_NO_SOUND )
src/mame/drivers/neodrvr.c
r4057r4058
25052505   ROM_REGION( 0x100000, "main", 0 )
25062506   ROM_LOAD16_WORD_SWAP( "067-p1.bin", 0x000000, 0x80000, CRC(4cea8a49) SHA1(cea4a35db8de898e30eb40dd339b3cbe77ac0856) )
25072507
2508   NEO_SFIX_128K( "067-s1.bin", CRC(4f0cbd58) SHA1(509bad8416a057d5239439e775640b71ccf09ef7) )
2508   NEO_SFIX_128K( "067-s1.bin", CRC(b119e1eb) SHA1(f63a68a71aea220d3d4475847652e2a1f68b2b6f) )
25092509
2510   NEO_BIOS_AUDIO_64K( "067-m1.bin", BAD_DUMP CRC(833cdf1b) SHA1(3a92c79adbe0d37956ea46a4746d6f1cbf7d2c14) )
2510   NEO_BIOS_AUDIO_128K( "067-m1.bin", CRC(e777a234) SHA1(9f3974ac07859337bc0203f903c40ae3f60dc1fb) )
25112511
25122512   ROM_REGION( 0x80000, "ym", 0 )
25132513   ROM_LOAD( "067-v1.bin", 0x000000, 0x80000, CRC(cf23afd0) SHA1(10f87014ee10613f92b04f482f449721a6379db7) )
r4057r4058
78887888GAME( 2002, matrim,   neogeo,   neogeo,   neogeo,   matrim,   ROT0, "Noise Factory / Atlus", "Matrimelee / Shin Gouketsuji Ichizoku Toukon", 0 )
78897889GAME( 2002, matrimbl, matrim,   neogeo,   neogeo,   matrimbl, ROT0, "bootleg", "Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg)", 0 )
78907890
7891/* Breezasoft */
7891/* BrezzaSoft */
78927892GAME( 2001, jockeygp, neogeo,   neogeo,   jockeygp, jockeygp, ROT0, "Sun Amusement / BrezzaSoft", "Jockey Grand Prix", 0 )
7893GAME( 2001, vliner,   neogeo,   neogeo,   vliner,   vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 1)", 0 )
7894GAME( 2001, vlinero,  vliner,   neogeo,   vliner,   vliner,   ROT0, "Dyna / BreezaSoft", "V-Liner (set 2)", 0 )
7893GAME( 2001, vliner,   neogeo,   neogeo,   vliner,   vliner,   ROT0, "Dyna / BrezzaSoft", "V-Liner (set 1)", 0 )
7894GAME( 2001, vlinero,  vliner,   neogeo,   vliner,   vliner,   ROT0, "Dyna / BrezzaSoft", "V-Liner (set 2)", 0 )
78957895
78967896/* Kyle Hodgetts */
78977897GAME( 2000, diggerma, neogeo,   neogeo,   neogeo,   neogeo,   ROT0, "Kyle Hodgetts", "Digger Man (prototype)", 0 )
src/mame/drivers/decocass.c
r4057r4058
5454
5555#include "driver.h"
5656#include "cpu/m6502/m6502.h"
57#include "cpu/i8x41/i8x41.h"
57#include "cpu/mcs48/mcs48.h"
5858#include "machine/decocass.h"
5959#include "sound/ay8910.h"
6060
61#define MASTER_CLOCK    XTAL_12MHz
62#define HCLK         (MASTER_CLOCK/2)
63#define HCLK1         (HCLK/2)
64#define HCLK2         (HCLK1/2)
65#define HCLK4         (HCLK2/2)
66
67
6168static UINT8 *decocass_rambase;
6269
6370static UINT8 *decrypted;
r4057r4058
142149
143150
144151static ADDRESS_MAP_START( decocass_mcu_portmap, ADDRESS_SPACE_IO, 8 )
145   AM_RANGE(0x01, 0x01) AM_READWRITE(i8041_p1_r, i8041_p1_w)
146   AM_RANGE(0x02, 0x02) AM_READWRITE(i8041_p2_r, i8041_p2_w)
152   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(i8041_p1_r, i8041_p1_w)
153   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(i8041_p2_r, i8041_p2_w)
147154ADDRESS_MAP_END
148155
149156static INPUT_PORTS_START( decocass )
r4057r4058
268275
269276static const gfx_layout charlayout =
270277{
271   8,8,   /* 8*8 characters */
272   1024,   /* 1024 characters */
273   3,      /* 3 bits per pixel */
274   { 2*1024*8*8, 1024*8*8, 0 },   /* the bitplanes are separated */
275   { 0, 1, 2, 3, 4, 5, 6, 7 },
276   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
277   8*8    /* every char takes 8 consecutive bytes */
278   8,8,
279   1024,
280   3,
281   { 2*1024*8*8, 1*1024*8*8, 0*1024*8*8 },
282   { STEP8(0,1) },
283   { STEP8(0,8) },
284   8*8
278285};
279286
280287static const gfx_layout spritelayout =
281288{
282   16,16,   /* 16*16 sprites */
283   256,   /* 256 sprites */
284   3,      /* 3 bits per pixel */
285   { 2*256*16*16, 256*16*16, 0 },   /* the bitplanes are separated */
286   { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7,
287     0, 1, 2, 3, 4, 5, 6, 7 },
288   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
289     8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
290   32*8   /* every sprite takes 32 consecutive bytes */
289   16,16,
290   256,
291   3,
292   { 2*256*16*16, 1*256*16*16, 0*256*16*16 },
293   { STEP8(16*8,1), STEP8(0*8,1) },
294   { STEP16(0,8) },
295   32*8
291296};
292297
293298static const gfx_layout tilelayout =
294299{
295   16,16,   /* 16*16 characters */
296   16+1,   /* 16 tiles (+1 empty tile used in the half-width bg tilemaps) */
297   3,   /* 3 bits per pixel */
300   16,16,
301   16+1,      /* 16 tiles (+1 empty tile used in the half-width bg tilemaps) */
302   3,
298303   { 2*16*16*16+4, 2*16*16*16+0, 4 },
299   { 3*16*8+0, 3*16*8+1, 3*16*8+2, 3*16*8+3,
300     2*16*8+0, 2*16*8+1, 2*16*8+2, 2*16*8+3,
301     16*8+0, 16*8+1, 16*8+2, 16*8+3,
302     0, 1, 2, 3 },
303   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
304     8*8, 9*8,10*8,11*8,12*8,13*8,14*8,15*8 },
305   2*16*16 /* every tile takes 64 consecutive bytes */
304   { STEP4(3*16*8,1), STEP4(2*16*8,1), STEP4(1*16*8,1), STEP4(0*16*8,1) },
305   { STEP16(0,8) },
306   2*16*16
306307};
307308
308309static const UINT32 objlayout_xoffset[64] =
309310{
310   7*8+0,7*8+1,7*8+2,7*8+3,7*8+4,7*8+5,7*8+6,7*8+7,
311   6*8+0,6*8+1,6*8+2,6*8+3,6*8+4,6*8+5,6*8+6,6*8+7,
312   5*8+0,5*8+1,5*8+2,5*8+3,5*8+4,5*8+5,5*8+6,5*8+7,
313   4*8+0,4*8+1,4*8+2,4*8+3,4*8+4,4*8+5,4*8+6,4*8+7,
314   3*8+0,3*8+1,3*8+2,3*8+3,3*8+4,3*8+5,3*8+6,3*8+7,
315   2*8+0,2*8+1,2*8+2,2*8+3,2*8+4,2*8+5,2*8+6,2*8+7,
316   1*8+0,1*8+1,1*8+2,1*8+3,1*8+4,1*8+5,1*8+6,1*8+7,
317   0*8+0,0*8+1,0*8+2,0*8+3,0*8+4,0*8+5,0*8+6,0*8+7
311   STEP8(7*8,1), STEP8(6*8,1), STEP8(5*8,1), STEP8(4*8,1),
312   STEP8(3*8,1), STEP8(2*8,1), STEP8(1*8,1), STEP8(0*8,1)
318313};
319314
320315static const UINT32 objlayout_yoffset[64] =
321316{
322   63*2*64,62*2*64,61*2*64,60*2*64,59*2*64,58*2*64,57*2*64,56*2*64,
323   55*2*64,54*2*64,53*2*64,52*2*64,51*2*64,50*2*64,49*2*64,48*2*64,
324   47*2*64,46*2*64,45*2*64,44*2*64,43*2*64,42*2*64,41*2*64,40*2*64,
325   39*2*64,38*2*64,37*2*64,36*2*64,35*2*64,34*2*64,33*2*64,32*2*64,
326   31*2*64,30*2*64,29*2*64,28*2*64,27*2*64,26*2*64,25*2*64,24*2*64,
327   23*2*64,22*2*64,21*2*64,20*2*64,19*2*64,18*2*64,17*2*64,16*2*64,
328   15*2*64,14*2*64,13*2*64,12*2*64,11*2*64,10*2*64, 9*2*64, 8*2*64,
329    7*2*64, 6*2*64, 5*2*64, 4*2*64, 3*2*64, 2*2*64, 1*2*64, 0*2*64
317   STEP32(63*2*64, -1*2*64),
318   STEP32(31*2*64, -1*2*64)
330319};
331320
332321static const gfx_layout objlayout =
r4057r4058
381370static MACHINE_DRIVER_START( decocass )
382371
383372   /* basic machine hardware */
384   MDRV_CPU_ADD("main", M6502,750000)
373   MDRV_CPU_ADD("main", M6502, HCLK4)
385374   MDRV_CPU_PROGRAM_MAP(decocass_map,0)
386375
387   MDRV_CPU_ADD("audio", M6502,500000) /* 500 kHz */
376   MDRV_CPU_ADD("audio", M6502, HCLK1/3/2)
388377   MDRV_CPU_PROGRAM_MAP(decocass_sound_map,0)
378   MDRV_TIMER_ADD_SCANLINE("audionmi", decocass_audio_nmi_gen, "main", 0, 8)
389379
390   MDRV_CPU_ADD("mcu", I8041,500000*15) /* 500 kHz ( I doubt it is 400kHz Al! )*/
380   MDRV_CPU_ADD("mcu", I8041, HCLK)
391381   MDRV_CPU_IO_MAP(decocass_mcu_portmap,0)
392382
393383   MDRV_QUANTUM_TIME(HZ(4200))            /* interleave CPUs */
394384
385   MDRV_MACHINE_START(decocass)
395386   MDRV_MACHINE_RESET(decocass)
396387
388   MDRV_DECOCASS_TAPE_ADD("cassette")
389
397390   /* video hardware */
398391   MDRV_SCREEN_ADD("main", RASTER)
399   MDRV_SCREEN_REFRESH_RATE(57)
400   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3072)      /* frames per second, vblank duration */)
401392   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
402   MDRV_SCREEN_SIZE(32*8, 32*8)
403   MDRV_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 1*8, 31*8-1)
393   MDRV_SCREEN_RAW_PARAMS(HCLK, 384, 8, 248, 272, 8, 248)
404394
405395   MDRV_GFXDECODE(decocass)
406396   MDRV_PALETTE_LENGTH(32+2*8+2*4)
r4057r4058
412402   /* sound hardware */
413403   MDRV_SPEAKER_STANDARD_MONO("mono")
414404
415   MDRV_SOUND_ADD("ay1", AY8910, 1500000)
405   MDRV_SOUND_ADD("ay1", AY8910, HCLK2)
416406   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
417407
418   MDRV_SOUND_ADD("ay2", AY8910, 1500000)
408   MDRV_SOUND_ADD("ay2", AY8910, HCLK2)
419409   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
420410MACHINE_DRIVER_END
421411
r4057r4058
692682ROM_START( ctsttape )
693683   DECOCASS_COMMON_ROMS
694684
695   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
685   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
696686   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
697687
698   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
688   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
699689   ROM_LOAD( "testtape.cas", 0x0000, 0x2000, CRC(4f9d8efb) SHA1(5b77747dad1033e5703f06c0870441b54b4256c5) )
700690ROM_END
701691
702692ROM_START( chwy )
703693   DECOCASS_COMMON_ROMS
704694
705   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
695   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
706696   /* The dongle data is reverse engineered from manual decryption */
707697   ROM_LOAD( "chwy.pro",   0x0000, 0x0020, BAD_DUMP CRC(2fae678e) SHA1(4a7de851442d4c1d690de03262f0e136a52fca35) )
708698
709   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
699   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
710700   ROM_LOAD( "chwy.cas",   0x0000, 0x8000, CRC(68a48064) SHA1(7e389737972fd0c54f398d296159c561f5ec3a93) )
711701ROM_END
712702
713703ROM_START( clocknch )
714704   DECOCASS_COMMON_ROMS
715705
716   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
706   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
717707   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
718708
719   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
709   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
720710   ROM_LOAD( "clocknch.cas", 0x0000, 0x8000, CRC(c9d163a4) SHA1(3ef55a8d8f603059e263776c08eb81f2cf18b75c) )
721711ROM_END
722712
723713ROM_START( ctisland )
724714   DECOCASS_COMMON_ROMS
725715
726   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
716   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
727717   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
728718
729   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
719   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
730720   ROM_LOAD( "ctisland.cas", 0x0000, 0x8000, CRC(3f63b8f8) SHA1(2fd0679ef9750a228ebb098672ab6091fda75804) )
731721
732722   ROM_REGION( 0x4000, "user3", 0 )     /* roms from the overlay pcb */
r4057r4058
739729ROM_START( ctislnd2 )
740730   DECOCASS_COMMON_ROMS
741731
742   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
732   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
743733   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
744734
745   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
735   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
746736   ROM_LOAD( "ctislnd2.cas", 0x0000, 0x8000, CRC(2854b4c0) SHA1(d3b4e0031dbb2340fbbe396a1ff9b8fbfd63663e) )
747737
748738   ROM_REGION( 0x4000, "user3", 0 )     /* roms from the overlay pcb */
r4057r4058
755745ROM_START( ctislnd3 )
756746   DECOCASS_COMMON_ROMS
757747
758   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
748   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
759749   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
760750
761   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
751   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
762752   ROM_LOAD( "ctislnd3.cas", 0x0000, 0x8000, CRC(45464e1e) SHA1(03275694d963c7ab0e0f5525e248e69da5f9b591) )
763753
764754   ROM_REGION( 0x4000, "user3", 0 )     /* roms from the overlay pcb */
r4057r4058
771761ROM_START( csuperas )
772762   DECOCASS_COMMON_ROMS
773763
774   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
764   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
775765   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
776766
777   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
767   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
778768   ROM_LOAD( "csuperas.cas", 0x0000, 0x8000, CRC(fabcd07f) SHA1(4070c668ad6725f0710cf7fe6df0d5f80272a449) )
779769ROM_END
780770
781771ROM_START( castfant )
782772   DECOCASS_COMMON_ROMS
783773
784   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
774   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
785775   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
786776
787   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
777   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
788778   ROM_LOAD( "castfant.cas", 0x0000, 0x8000, CRC(6d77d1b5) SHA1(821bd65fbe887cbeac9281a2ad3f88595918f886) )
789779ROM_END
790780
791781ROM_START( cluckypo )
792782   DECOCASS_COMMON_ROMS
793783
794   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
784   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
795785   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
796786
797   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
787   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
798788   ROM_LOAD( "cluckypo.cas", 0x0000, 0x8000, CRC(2070c243) SHA1(cd3af309af8eb27937756c1fe6fd0504be5aaaf5) )
799789ROM_END
800790
801791ROM_START( cterrani )
802792   DECOCASS_COMMON_ROMS
803793
804   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
794   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
805795   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
806796
807   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
797   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
808798   ROM_LOAD( "cterrani.cas", 0x0000, 0x8000, CRC(eb71adbc) SHA1(67becfde39c034d4b8edc2eb100050de102773da) )
809799ROM_END
810800
811801ROM_START( cexplore )
812802   DECOCASS_COMMON_ROMS
813803
814   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
804   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
815805   /* The dongle data is reverse engineered by table analysis */
816806   ROM_LOAD( "cexplore.pro", 0x0000, 0x0020, BAD_DUMP CRC(c7a9ac8f) SHA1(b0a566d948f71a4eddcde0dd5e9e69ca96f71c36) )
817807
818   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
808   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
819809   ROM_LOAD( "cexplore.cas", 0x0000, 0x8000, CRC(fae49c66) SHA1(4ae69e2f706fdf30204f0aa1277619395cacc21b) )
820810
821811   ROM_REGION( 0x4000, "user3", 0 )     /* roms from the overlay pcb */
r4057r4058
825815ROM_START( cprogolf )
826816   DECOCASS_COMMON_ROMS
827817
828   ROM_REGION( 0x00020, "user1", 0 )     /* dongle data */
818   ROM_REGION( 0x00020, "dongle", 0 )     /* dongle data */
829819   ROM_LOAD( "de-0061.pro", 0x0000, 0x0020, CRC(e09ae5de) SHA1(7dec067d0739a6dad2607132641b66880a5b7751) )
830820
831   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
821   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
832822   ROM_LOAD( "cprogolf.cas", 0x0000, 0x8000, CRC(02123cd1) SHA1(e4c630ed293725f23d539cb43beb97953558dabd) )
833823ROM_END
834824
r4057r4058
838828ROM_START( cmissnx )
839829   DECOCASS_COMMON_ROMS
840830
841   ROM_REGION( 0x00800, "user1", 0 )     /* dongle data */
831   ROM_REGION( 0x00800, "dongle", 0 )     /* dongle data */
842832   ROM_LOAD( "cmissnx.pro",  0x0000, 0x0800, CRC(8a41c071) SHA1(7b16d933707bf21d25dcd11db6a6c28834b11c5b) )
843833
844   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
834   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
845835   ROM_LOAD( "cmissnx.cas",  0x0000, 0x8000, CRC(3a094e11) SHA1(c355fe14838187cbde19a799e5c60083c82615ac) )
846836ROM_END
847837
848838ROM_START( cdiscon1 )
849839   DECOCASS_COMMON_ROMS
850840
851   ROM_REGION( 0x00800, "user1", 0 )     /* dongle data */
841   ROM_REGION( 0x00800, "dongle", 0 )     /* dongle data */
852842   ROM_LOAD( "cdiscon1.pro", 0x0000, 0x0800, CRC(0f793fab) SHA1(331f1b1b482fcd10f42c388a503f9af62d705401) )
853843
854   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
844   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
855845   ROM_LOAD( "cdiscon1.cas", 0x0000, 0x8000, CRC(1429a397) SHA1(12f9e03fcda31dc6161a39bf5c3315a1e9e94565) )
856846ROM_END
857847
858848ROM_START( csweetht )
859849   DECOCASS_COMMON_ROMS
860850
861   ROM_REGION( 0x00800, "user1", 0 )   /* dongle data */
851   ROM_REGION( 0x00800, "dongle", 0 )   /* dongle data */
862852   ROM_LOAD( "cdiscon1.pro", 0x0000, 0x0800, CRC(0f793fab) SHA1(331f1b1b482fcd10f42c388a503f9af62d705401) )
863853
864   ROM_REGION( 0x10000, "user2", 0 )   /* (max) 64k for cassette image */
854   ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
865855   ROM_LOAD( "csweetht.cas", 0x0000, 0x8000, CRC(175ef706) SHA1(49b86233f69d0daf54a6e59b86e69b8159e8f6cc) )
866856ROM_END
867857
868858ROM_START( cptennis )
869859   DECOCASS_COMMON_ROMS
870860
871   ROM_REGION( 0x00800, "user1", 0 )     /* dongle data */
861   ROM_REGION( 0x00800, "dongle", 0 )     /* dongle data */
872862   ROM_LOAD( "cptennis.pro", 0x0000, 0x0800, CRC(59b8cede) SHA1(514861a652b5256a11477fc357bc01dfd87f712b) )
873863
874   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
864   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
875865   ROM_LOAD( "cptennis.cas", 0x0000, 0x8000, CRC(6bb257fe) SHA1(7554bf1996bc9e9c04a276aab050708d70103f54) )
876866ROM_END
877867
878868ROM_START( ctornado )
879869   DECOCASS_COMMON_ROMS
880870
881   ROM_REGION( 0x00800, "user1", 0 )     /* dongle data */
871   ROM_REGION( 0x00800, "dongle", 0 )     /* dongle data */
882872   ROM_LOAD( "ctornado.pro", 0x0000, 0x0800, CRC(c9a91697) SHA1(3f7163291edbdf1a596e3cd2b7a16bbb140ffb36) )
883873
884   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
874   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
885875   ROM_LOAD( "ctornado.cas", 0x0000, 0x8000, CRC(e4e36ce0) SHA1(48a11823121fb2e3de31ae08e453c0124fc4f7f3) )
886876ROM_END
887877
r4057r4058
891881ROM_START( cburnrub )
892882   DECOCASS_COMMON_ROMS
893883
894   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
884   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
895885   ROM_LOAD( "cburnrub.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
896886
897   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
887   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
898888   ROM_LOAD( "cburnrub.cas",   0x0000, 0x8000, CRC(4528ac22) SHA1(dc0fcc5e5fd21c1c858a90f43c175e36a24b3c3d) )
899889ROM_END
900890
901891ROM_START( cburnrb2 )
902892   DECOCASS_COMMON_ROMS
903893
904   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
894   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
905895   ROM_LOAD( "cburnrub.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
906896
907   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
897   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
908898   ROM_LOAD( "cburnrb2.cas",   0x0000, 0x8000, CRC(84a9ed66) SHA1(a9c536e46b89fc6b9c6271776292fed1241d2f3f) )
909899ROM_END
910900
911901ROM_START( cbnj )
912902   DECOCASS_COMMON_ROMS
913903
914   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
904   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
915905   ROM_LOAD( "cburnrub.pro",   0x0000, 0x1000, CRC(9f396832) SHA1(0e302fd094474ac792882948a018c73ce76e0759) )
916906
917   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
907   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
918908   ROM_LOAD( "cbnj.cas",       0x0000, 0x8000, CRC(eed41560) SHA1(85d5df76efac33cd10427f659c4259afabb3daaf) )
919909ROM_END
920910
921911ROM_START( cbtime )
922912   DECOCASS_COMMON_ROMS
923913
924   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
914   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
925915   ROM_LOAD( "cbtime.pro",   0x0000, 0x1000, CRC(25bec0f0) SHA1(9fb1f9699f37937421e26d4fb8fdbcd21a5ddc5c) )
926916
927   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
917   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
928918   ROM_LOAD( "cbtime.cas",   0x0000, 0x8000, CRC(56d7dc58) SHA1(34b2513c9ca7ab40f532b6d6d911aa3012113632) )
929919ROM_END
930920
931921ROM_START( cgraplop )
932922   DECOCASS_COMMON_ROMS
933923
934   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
924   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
935925   ROM_LOAD( "cgraplop.pro", 0x0000, 0x1000, CRC(ee93787d) SHA1(0c753d62fdce2fdbd5b329a5aa259a967d07a651) )
936926
937   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
927   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
938928   ROM_LOAD( "cgraplop.cas", 0x0000, 0x8000, CRC(d2c1c1bb) SHA1(db67304caa11540363735e7d4bf03507ccbe9980) )
939929ROM_END
940930
941931ROM_START( cgraplp2 )
942932   DECOCASS_COMMON_ROMS
943933
944   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
934   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
945935   ROM_LOAD( "cgraplop.pro", 0x0000, 0x1000, CRC(ee93787d) SHA1(0c753d62fdce2fdbd5b329a5aa259a967d07a651) ) /* is this right for this set? */
946936
947   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
937   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
948938   ROM_LOAD( "cgraplp2.cas", 0x0000, 0x8000, CRC(2e728981) SHA1(83ba90d95858d647315a1c311b8643672afea5f7) )
949939ROM_END
950940
951941ROM_START( clapapa )
952942   DECOCASS_COMMON_ROMS
953943
954   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
944   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
955945   ROM_LOAD( "clapapa.pro",  0x0000, 0x1000, CRC(e172819a) SHA1(3492775f4f0a0b31ce5a1a998076829b3f264e98) )
956946
957   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
947   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
958948   ROM_LOAD( "clapapa.cas",  0x0000, 0x8000, CRC(4ffbac24) SHA1(1ec0d7ac1886d4b430dc12be27f387e9d952d235) )
959949ROM_END
960950
961951ROM_START( clapapa2 )
962952   DECOCASS_COMMON_ROMS
963953
964   ROM_REGION( 0x01000, "user1", 0 )   /* dongle data */
954   ROM_REGION( 0x01000, "dongle", 0 )   /* dongle data */
965955   ROM_LOAD( "clapapa.pro",  0x0000, 0x1000, CRC(e172819a) SHA1(3492775f4f0a0b31ce5a1a998076829b3f264e98) )
966956
967   ROM_REGION( 0x10000, "user2", 0 )   /* (max) 64k for cassette image */
957   ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
968958   ROM_LOAD( "clapapa2.cas",  0x0000, 0x8000, CRC(069dd3c4) SHA1(5a19392c7ac5aea979187c96267e73bf5126307e) )
969959ROM_END
970960
971961ROM_START( cfghtice )
972962   DECOCASS_COMMON_ROMS
973963
974   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
964   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
975965   ROM_LOAD( "cfghtice.pro", 0x0000, 0x1000, CRC(5abd27b5) SHA1(2ab1c171adffd491759036d6ce2433706654aad2) )
976966
977   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
967   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
978968   ROM_LOAD( "cfghtice.cas", 0x0000, 0x10000, CRC(906dd7fb) SHA1(894a7970d5476ed035edd15656e5cf10d6ddcf57) )
979969ROM_END
980970
981971ROM_START( cprobowl )
982972   DECOCASS_COMMON_ROMS
983973
984   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
974   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
985975   ROM_LOAD( "cprobowl.pro", 0x0000, 0x1000, CRC(e3a88e60) SHA1(e6e9a2e5ab26e0463c63201a15f7d5a429ec836e) )
986976
987   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
977   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
988978   ROM_LOAD( "cprobowl.cas", 0x0000, 0x8000, CRC(cb86c5e1) SHA1(66c467418cff2ed6d7c121a8b1650ee97ae48fe9) )
989979ROM_END
990980
991981ROM_START( cnightst )
992982   DECOCASS_COMMON_ROMS
993983
994   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
984   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
995985   ROM_LOAD( "cnightst.pro", 0x0000, 0x1000, CRC(553b0fbc) SHA1(2cdf4560992b62e59b6de760d7996be4ed25f505) )
996986
997   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
987   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
998988   ROM_LOAD( "cnightst.cas", 0x0000, 0x8000, CRC(c6f844cb) SHA1(5fc6154c20ee4e2f4049a78df6f3cacbb96b0dc0) )
999989ROM_END
1000990
1001991ROM_START( cnights2 )
1002992   DECOCASS_COMMON_ROMS
1003993
1004   ROM_REGION( 0x01000, "user1", 0 )   /* dongle data */
994   ROM_REGION( 0x01000, "dongle", 0 )   /* dongle data */
1005995   ROM_LOAD( "cnightst.pro", 0x0000, 0x1000, CRC(553b0fbc) SHA1(2cdf4560992b62e59b6de760d7996be4ed25f505) )
1006996
1007   ROM_REGION( 0x10000, "user2", 0 )   /* (max) 64k for cassette image */
997   ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
1008998   ROM_LOAD( "cnights2.cas", 0x0000, 0x8000, CRC(1a28128c) SHA1(4b620a1919d02814f734aba995115c09dc2db930) )
1009999ROM_END
10101000
10111001ROM_START( cprosocc )
10121002   DECOCASS_COMMON_ROMS
10131003
1014   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
1004   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
10151005   ROM_LOAD( "cprosocc.pro", 0x0000, 0x1000,  CRC(919fabb2) SHA1(3d6a0676cea7b0be0fe69d06e04ca08c36b2851a) )
10161006
1017   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
1007   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
10181008   ROM_LOAD( "cprosocc.cas", 0x0000, 0x10000, CRC(76b1ad2c) SHA1(6188667e5bc001dfdf83deaf7251eae794de4702) )
10191009ROM_END
10201010
10211011ROM_START( cppicf )
10221012   DECOCASS_COMMON_ROMS
10231013
1024   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
1014   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
10251015   ROM_LOAD( "cppicf.pro",   0x0000, 0x1000, CRC(0b1a1ecb) SHA1(2106da6837c78812c102b0eaaa1127fcc21ea780) )
10261016
1027   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
1017   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
10281018   ROM_LOAD( "cppicf.cas",   0x0000, 0x8000, CRC(8c02f160) SHA1(03430dd8d4b2e6ca931986dac4d39be6965ffa6f) )
10291019ROM_END
10301020
10311021ROM_START( cppicf2 )
10321022   DECOCASS_COMMON_ROMS
10331023
1034   ROM_REGION( 0x01000, "user1", 0 )   /* dongle data */
1024   ROM_REGION( 0x01000, "dongle", 0 )   /* dongle data */
10351025   ROM_LOAD( "cppicf.pro",   0x0000, 0x1000, CRC(0b1a1ecb) SHA1(2106da6837c78812c102b0eaaa1127fcc21ea780) )
10361026
1037   ROM_REGION( 0x10000, "user2", 0 )   /* (max) 64k for cassette image */
1027   ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
10381028   ROM_LOAD( "cppicf2.cas",   0x0000, 0x8000, CRC(78ffa1bc) SHA1(d15f2a240ae7b45885d32b5f507243f82e820d4b) )
10391029ROM_END
10401030
r4057r4058
10441034ROM_START( cscrtry )
10451035   DECOCASS_COMMON_ROMS
10461036
1047   ROM_REGION( 0x08000, "user1", 0 )     /* dongle data */
1037   ROM_REGION( 0x08000, "dongle", 0 )     /* dongle data */
10481038   ROM_LOAD( "cscrtry.pro",  0x0000, 0x8000, CRC(7bc3460b) SHA1(7c5668ff9a5073e27f4a83b02d79892eb4df6b92) )
10491039
1050   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
1040   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
10511041   ROM_LOAD( "cscrtry.cas",  0x0000, 0x8000, CRC(5625f0ca) SHA1(f4b0a6f2ca908880386838f06b626479b4b74134) )
10521042ROM_END
10531043
10541044ROM_START( cscrtry2 )
10551045   DECOCASS_COMMON_ROMS
10561046
1057   ROM_REGION( 0x08000, "user1", 0 )   /* dongle data */
1047   ROM_REGION( 0x08000, "dongle", 0 )   /* dongle data */
10581048   ROM_LOAD( "cscrtry.pro",  0x0000, 0x8000, CRC(7bc3460b) SHA1(7c5668ff9a5073e27f4a83b02d79892eb4df6b92) )
10591049
1060   ROM_REGION( 0x10000, "user2", 0 )   /* (max) 64k for cassette image */
1050   ROM_REGION( 0x10000, "cassette", 0 )   /* (max) 64k for cassette image */
10611051   ROM_LOAD( "cscrtry2.cas",  0x0000, 0x8000, CRC(04597842) SHA1(7f1fc3e06b61df880debe9056bdfbbb8600af739) )
10621052ROM_END
10631053
r4057r4058
10671057ROM_START( cbdash )
10681058   DECOCASS_COMMON_ROMS
10691059
1070/*  ROM_REGION( 0x01000, "user1", 0 ) */ /* (max) 4k for dongle data */
1060/*  ROM_REGION( 0x01000, "dongle", 0 ) */ /* (max) 4k for dongle data */
10711061   /* no proms */
10721062
1073   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
1063   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
10741064   ROM_LOAD( "cbdash.cas",   0x0000, 0x8000, CRC(cba4c1af) SHA1(5d163d8e31c58b20679c6be06b1aa02df621822b) )
10751065ROM_END
10761066
r4057r4058
10811071
10821072   /* no dongle data */
10831073
1084   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
1074   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
10851075   ROM_LOAD( "cflyball.cas",   0x0000, 0x10000, CRC(cb40d043) SHA1(57698bac7e0d552167efa99d08116bf19a3b29c9) )
10861076ROM_END
10871077
r4057r4058
10911081ROM_START( czeroize )
10921082   DECOCASS_COMMON_ROMS
10931083
1094   ROM_REGION( 0x01000, "user1", 0 )     /* dongle data */
1084   ROM_REGION( 0x01000, "dongle", 0 )     /* dongle data */
10951085   ROM_LOAD( "czeroize.pro",  0x0000, 0x1000, NO_DUMP )
10961086
1097   ROM_REGION( 0x10000, "user2", 0 )     /* (max) 64k for cassette image */
1087   ROM_REGION( 0x10000, "cassette", 0 )     /* (max) 64k for cassette image */
10981088   ROM_LOAD( "czeroize.cas",   0x0000, 0x10000, CRC(3ef0a406) SHA1(645b34cd477e0bb5539c8fe937a7a2dbd8369003) )
10991089ROM_END
11001090
r4057r4058
11851175/* 39 */ GAME( 1984, cppicf2,  cppicf, cppicf,   decocass, decocass, ROT270, "Data East Corporation", "Peter Pepper's Ice Cream Factory (Cassette, set 2)", 0 )
11861176/* 40 */ GAME( 1984, cfghtice, decocass, cfghtice, decocass, decocass, ROT270, "Data East Corporation", "Fighting Ice Hockey (Cassette)", 0 )
11871177/* 44 */ GAME( 1985, cbdash,   decocass, cbdash,   decocass, decocass, ROT270, "Data East Corporation", "Boulder Dash (Cassette)", 0 )
1188         GAME( 1985, cflyball, decocass, cflyball, decocass, decocass, ROT270, "Data East Corporation", "Flying Ball (Cassette)", GAME_NO_SOUND )
1178         GAME( 1985, cflyball, decocass, cflyball, decocass, decocass, ROT270, "Data East Corporation", "Flying Ball (Cassette)", 0 )
src/mame/drivers/namcoic.c
r4057r4058
10821082      if( tile&0x0200 ) mangle |= 0x0400;
10831083      if( tile&0x0400 ) mangle |= 0x0800;
10841084      if( tile&0x0800 ) mangle |= 0x1000;
1085      tile &= 0x3fff; /* cap mask offset */
10851086      break;
10861087
10871088   default:
src/mame/drivers/segas16a.c
r4057r4058
150150#include "system16.h"
151151#include "machine/8255ppi.h"
152152#include "machine/fd1089.h"
153#include "machine/i8243.h"
153154#include "cpu/mcs48/mcs48.h"
154155#include "sound/dac.h"
155156#include "sound/2151intf.h"
r4057r4058
445446}
446447
447448
448static WRITE8_HANDLER( n7751_rom_offset_w )
449static WRITE8_DEVICE_HANDLER( n7751_rom_offset_w )
449450{
450451   /* P4 - address lines 0-3 */
451452   /* P5 - address lines 4-7 */
r4057r4058
464465}
465466
466467
467static READ8_HANDLER( n7751_command_r )
468static READ8_DEVICE_HANDLER( n7751_p2_r )
468469{
469470   /* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */
470471   /* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */
471   return 0x80 | ((n7751_command & 0x07) << 4);
472   return 0x80 | ((n7751_command & 0x07) << 4) | (i8243_p2_r(device, offset) & 0x0f);
472473}
473474
474475
475static WRITE8_HANDLER( n7751_busy_w )
476static WRITE8_DEVICE_HANDLER( n7751_p2_w )
476477{
477   /* write to P2 */
478   /* write to P2; low 4 bits go to 8243 */
479   i8243_p2_w(device, offset, data & 0x0f);
480
478481   /* output of bit $80 indicates we are ready (1) or busy (0) */
479482   /* no other outputs are used */
480483}
r4057r4058
861864 *************************************/
862865
863866static ADDRESS_MAP_START( n7751_portmap, ADDRESS_SPACE_IO, 8 )
864   AM_RANGE(MCS48_PORT_BUS,MCS48_PORT_BUS) AM_READ(n7751_rom_r)
865   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1)  AM_READ(n7751_t1_r)
866   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1)  AM_WRITE(dac_0_data_w)
867   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2)  AM_READWRITE(n7751_command_r, n7751_busy_w)
868   AM_RANGE(MCS48_PORT_P4, MCS48_PORT_P7)  AM_WRITE(n7751_rom_offset_w)
867   AM_RANGE(MCS48_PORT_BUS,  MCS48_PORT_BUS)  AM_READ(n7751_rom_r)
868   AM_RANGE(MCS48_PORT_T1,   MCS48_PORT_T1)   AM_READ(n7751_t1_r)
869   AM_RANGE(MCS48_PORT_P1,   MCS48_PORT_P1)   AM_WRITE(dac_0_data_w)
870   AM_RANGE(MCS48_PORT_P2,   MCS48_PORT_P2)   AM_DEVREADWRITE(I8243, "n7751_8243", n7751_p2_r, n7751_p2_w)
871   AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE(I8243, "n7751_8243", i8243_prog_w)
869872ADDRESS_MAP_END
870873
871874
r4057r4058
17841787   MDRV_CPU_ADD("n7751", N7751, 6000000)
17851788   MDRV_CPU_IO_MAP(n7751_portmap,0)
17861789
1790   MDRV_I8243_ADD("n7751_8243", NULL, n7751_rom_offset_w)
1791
17871792   MDRV_MACHINE_RESET(system16a)
17881793   MDRV_NVRAM_HANDLER(system16a)
17891794
src/mame/drivers/statriv2.c
r4057r4058
55* Triv Four driver by Pierpaolo Prazzoli                         *
66* Super Triv III driver by Pierpaolo Prazzoli                    *
77* Hangman driver by Pierpaolo Prazzoli                           *
8* Status Black Jack driver by Angelo Salese & Roberto Fresca     *
89*                                                                *
910******************************************************************
1011*                                                                *
r4057r4058
2425*     sound seems to make sense. Can someone with a PCB stomach  *
2526*     the game long enough to verify one way or the other?       *
2627*                                                                *
28* AS: All games in this driver needs the the PPI8255 and the     *
29*     9937 CRT Controller properly hooked up.                    *
2730******************************************************************
2831
2932******************************************************************
r4057r4058
6164#include "driver.h"
6265#include "cpu/i8085/i8085.h"
6366#include "sound/ay8910.h"
67#include "machine/8255ppi.h"
6468
6569/* Default NVram, we seem to need one or statriv2 crashes during attract
6670   attempting to display an unterminated message */
r4057r4058
419423   AM_RANGE(0xce, 0xce) AM_READ(SMH_NOP)         // ???
420424ADDRESS_MAP_END
421425
426static ADDRESS_MAP_START( statusbj_io, ADDRESS_SPACE_IO, 8 )
427   ADDRESS_MAP_GLOBAL_MASK(0xff)
428   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)
429   AM_RANGE(0xb0, 0xb0) AM_WRITE(ay8910_control_port_0_w)
430   AM_RANGE(0xb1, 0xb1) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w)
431   AM_RANGE(0xc0, 0xcf) AM_READWRITE(SMH_NOP, SMH_NOP)      /* 9927 CRT controller? */
432//  AM_RANGE(0xce,0xce) AM_READ(test_r)
433ADDRESS_MAP_END
434
435/*some sort of "simple" protection? This is just a kludge for it,coin chuts doesn't work consistantly,
436  probably sometimes it reads a protection latch,some other times reads the inputs... -AS*/
437static READ8_DEVICE_HANDLER( prot_r )
438{
439   static UINT8 x;
440
441   x^=4;
442
443   return input_port_read(device->machine, "IN1") | x;
444}
445
446
447//static WRITE8_DEVICE_HANDLER( ppi_portc_hi_w );
448//{
449//  popmessage("PPI port C out: %02X", data);
450//}
451
452
453static const ppi8255_interface ppi8255_intf[1] =
454{
455/* PPI 8255 group A & B set to Mode 0.
456   Port A, B and lower 4 bits of C set as Input.
457   High 4 bits of C set as Output
458*/
459   {
460      DEVICE8_PORT("IN0"),   /* Port A read */
461      prot_r,               /* Port B read */
462      DEVICE8_PORT("IN2"),   /* Port C read (Lower Nibble as Input) */
463      NULL,               /* Port A write */
464      NULL,                  /* Port B write */
465      NULL   //ppi_portc_hi_w                /* Port C write (High nibble as Output) */
466   }
467};
468
422469static INPUT_PORTS_START( statriv2 )
423470   PORT_START("IN0")
424471   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
r4057r4058
585632   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
586633INPUT_PORTS_END
587634
635static INPUT_PORTS_START( statusbj )
636   PORT_START("IN0")
637   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Bet")  PORT_CODE(KEYCODE_Z)
638   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1 )
639   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Hit")  PORT_CODE(KEYCODE_X)
640   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Stand")  PORT_CODE(KEYCODE_C)
641   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-5") PORT_CODE(KEYCODE_V)
642   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-6") PORT_CODE(KEYCODE_B)
643   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_N)
644   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("0-8") PORT_CODE(KEYCODE_M)
645
646   PORT_START("IN1")
647   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-1") PORT_CODE(KEYCODE_Q)
648   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-2") PORT_CODE(KEYCODE_W)
649   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
650   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-4") PORT_CODE(KEYCODE_R)
651   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-5") PORT_CODE(KEYCODE_T)
652   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-6") PORT_CODE(KEYCODE_Y)
653   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-7") PORT_CODE(KEYCODE_U)
654   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("1-8") PORT_CODE(KEYCODE_I)
655
656   PORT_START("IN2")
657   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-1") PORT_CODE(KEYCODE_A)
658   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-2") PORT_CODE(KEYCODE_S)
659   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-3") PORT_CODE(KEYCODE_D)
660   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("2-4") PORT_CODE(KEYCODE_F)
661   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )   /* only lower nibble is used */
662INPUT_PORTS_END
663
588664static const gfx_layout statriv2_tiles8x16_layout =
589665{
590666   8,16,
r4057r4058
617693   GFXDECODE_ENTRY( "gfx1", 0, statriv2_tiles16x8_layout, 0, 64 )
618694GFXDECODE_END
619695
696static MACHINE_START( statriv2 )
697{
698    state_save_register_global(machine, question_offset_low);
699    state_save_register_global(machine, question_offset_med);
700    state_save_register_global(machine, question_offset_high);
701}
620702
621703static INTERRUPT_GEN( statriv2_interrupt )
622704{
r4057r4058
627709static MACHINE_DRIVER_START( statriv2 )
628710   /* basic machine hardware */
629711   /* FIXME: The 8085A had a max clock of 6MHz, internally divided by 2! */
630   MDRV_CPU_ADD("main",8085A,12400000*2)              /* 12.4MHz / 4? */
631   MDRV_CPU_PROGRAM_MAP(statriv2_readmem,statriv2_writemem)
632   MDRV_CPU_IO_MAP(statriv2_readport,statriv2_writeport)
712    MDRV_CPU_ADD("main", 8085A, 13684000) /* 12.44MHz * 1.1, ugh, glargh, hack, but it makes one in-game second roughly one real-life second */
713   MDRV_CPU_PROGRAM_MAP(statriv2_readmem, statriv2_writemem)
714   MDRV_CPU_IO_MAP(statriv2_readport, statriv2_writeport)
633715   MDRV_CPU_VBLANK_INT("main", statriv2_interrupt)
634716
635717   MDRV_NVRAM_HANDLER(statriv2)
r4057r4058
637719   /* video hardware */
638720   MDRV_SCREEN_ADD("main", RASTER)
639721   MDRV_SCREEN_REFRESH_RATE(60)
640   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
722   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(1200))
641723   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
642724   MDRV_SCREEN_SIZE(64*8, 32*8)
643725   MDRV_SCREEN_VISIBLE_AREA(4*8, 38*8-1, 0, 32*8-1)
r4057r4058
649731   MDRV_VIDEO_START(statriv2)
650732   MDRV_VIDEO_UPDATE(statriv2)
651733
734    MDRV_MACHINE_START(statriv2)
735
652736   /* sound hardware */
653737   MDRV_SPEAKER_STANDARD_MONO("mono")
654738
r4057r4058
750834   MDRV_SCREEN_VISIBLE_AREA(1*8, 35*8-1, 0, 32*8-1)
751835MACHINE_DRIVER_END
752836
837static MACHINE_DRIVER_START( statusbj )
838   /* basic machine hardware */
839   MDRV_IMPORT_FROM(statriv2)
840
841   MDRV_CPU_REPLACE("main",8085A,12400000/4)
842   MDRV_CPU_IO_MAP(statusbj_io,0)
843
844   /* 1x 8255 */
845   MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf[0] )
846MACHINE_DRIVER_END
847
848/*
849Black Jack (Status 1981)
850
85112.44Mhz
852                          5101  5101
8538085
854                2
855                1
856      8255                 2114
857      9927                 2114
858      8255                 2114
859                           2114
860*/
861
862ROM_START( statusbj )
863   ROM_REGION( 0x10000, "main", 0 )
864   ROM_LOAD( "statusbj.1",   0x0000, 0x0800, CRC(d3faf340) SHA1(e03f7e3375a02a3bec07d9c7f4f2b1a711d4d1cc) )
865   ROM_LOAD( "statusbj.2",   0x0800, 0x0800, CRC(3f1727af) SHA1(0df12626591fc70031a9d8615c37243813d67b70) )
866   ROM_RELOAD(               0x1000, 0x0800 )
867
868   ROM_REGION( 0x800, "gfx1", ROMREGION_INVERT )
869   ROM_LOAD( "statusbj.vid",   0x0000, 0x0800, CRC(99ade7a2) SHA1(98704ca3a9fcfc4590f850c8ae24445baaed6dfa) )
870
871   //no proms?
872ROM_END
873
753874ROM_START( statriv2 )
754875   ROM_REGION( 0x10000, "main", 0 )
755876   ROM_LOAD( "trivii1c.u7", 0x00000, 0x01000, CRC(89326d7b) SHA1(4878a3aabe51a4de5ff5927a0707b2d121ff87fa) )
r4057r4058
9831104   ROM_LOAD( "dm74s282.u22", 0x0040, 0x0100, CRC(0421b8e0) SHA1(8b786eed86397a1463ad37b9b011edf83d76dd63) ) /* Soldered in */
9841105ROM_END
9851106
986GAME( 1984, hangman,  0,        hangman,   hangman,  0, ROT0, "Status Games", "Hangman", 0 )
987GAME( 1984, trivquiz, 0,        trivquiz,  statriv2, 0, ROT0, "Status Games", "Triv Quiz", 0 )
988GAME( 1984, statriv2, 0,        statriv2,  statriv2, 0, ROT0, "Status Games", "Triv Two", 0 )
989GAME( 1985, statrv2v, statriv2, statriv2v, statriv2, 0, ROT90,"Status Games", "Triv Two (Vertical)", 0 )
990GAME( 1985, statriv4, 0,        statriv4,  statriv4, 0, ROT0, "Status Games", "Triv Four", 0 )
991GAME( 1985, sextriv,  0,        sextriv,   sextriv,  0, ROT0, "Status Games", "Sex Triv", 0 )
992GAME( 1985, quaquiz2, 0,        quaquiz2,  quaquiz2, 0, ROT0, "Status Games", "Quadro Quiz II", GAME_NOT_WORKING )
993GAME( 1986, supertr2, 0,        supertr2,  supertr2, 0, ROT0, "Status Games", "Super Triv II", 0 )
994GAME( 1988, supertr3, 0,        supertr3,  supertr2, 0, ROT0, "Status Games", "Super Triv III", GAME_IMPERFECT_GRAPHICS)
1107GAME( 1981, statusbj, 0,        statusbj,  statusbj, 0, ROT0, "Status Games", "Status Black Jack (V1.0c)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_COLORS | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
1108GAME( 1984, hangman,  0,        hangman,   hangman,  0, ROT0, "Status Games", "Hangman", GAME_SUPPORTS_SAVE )
1109GAME( 1984, trivquiz, 0,        trivquiz,  statriv2, 0, ROT0, "Status Games", "Triv Quiz", GAME_SUPPORTS_SAVE )
1110GAME( 1984, statriv2, 0,        statriv2,  statriv2, 0, ROT0, "Status Games", "Triv Two", GAME_SUPPORTS_SAVE )
1111GAME( 1985, statrv2v, statriv2, statriv2v, statriv2, 0, ROT90,"Status Games", "Triv Two (Vertical)", GAME_SUPPORTS_SAVE )
1112GAME( 1985, statriv4, 0,        statriv4,  statriv4, 0, ROT0, "Status Games", "Triv Four", GAME_SUPPORTS_SAVE )
1113GAME( 1985, sextriv,  0,        sextriv,   sextriv,  0, ROT0, "Status Games", "Sex Triv", GAME_SUPPORTS_SAVE )
1114GAME( 1985, quaquiz2, 0,        quaquiz2,  quaquiz2, 0, ROT0, "Status Games", "Quadro Quiz II", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
1115GAME( 1986, supertr2, 0,        supertr2,  supertr2, 0, ROT0, "Status Games", "Super Triv II", GAME_SUPPORTS_SAVE )
1116GAME( 1988, supertr3, 0,        supertr3,  supertr2, 0, ROT0, "Status Games", "Super Triv III", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_GRAPHICS)
src/mame/drivers/carrera.c
r4057r4058
3939
4040*/
4141
42#define MASTER_CLOCK 22118400
42#define MASTER_CLOCK   XTAL_22_1184MHz
4343
4444#include "driver.h"
4545#include "cpu/z80/z80.h"
r4057r4058
284284      palette_set_color_rgb(machine, x, pal3bit(src[x] >> 0), pal3bit(src[x] >> 3), pal2bit(src[x] >> 6));
285285}
286286
287
288static const mc6845_interface mc6845_intf =
289{
290   "main",      /* screen we are acting on */
291   8,         /* number of pixels per video memory address */
292   NULL,      /* before pixel update callback */
293   NULL,      /* row update callback */
294   NULL,      /* after pixel update callback */
295   NULL,      /* callback for display state changes */
296   NULL,      /* HSYNC callback */
297   NULL      /* VSYNC callback */
298};
299
300
287301static MACHINE_DRIVER_START( carrera )
288302   /* basic machine hardware */
289   MDRV_CPU_ADD("main", Z80,MASTER_CLOCK/6)
290   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
291   MDRV_CPU_IO_MAP(io_map,0)
303   MDRV_CPU_ADD("main", Z80, MASTER_CLOCK / 6)
304   MDRV_CPU_PROGRAM_MAP(readmem, writemem)
305   MDRV_CPU_IO_MAP(io_map, 0)
292306   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
293307
294308   /* video hardware */
r4057r4058
299313   MDRV_SCREEN_SIZE(512, 256)
300314   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
301315
316   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
317
302318   MDRV_GFXDECODE(carrera)
303319   MDRV_PALETTE_LENGTH(32)
304320   MDRV_PALETTE_INIT(carrera)
305321
306322   MDRV_VIDEO_UPDATE(carrera)
307323
308   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
309
310324   /* sound hardware */
311325   MDRV_SPEAKER_STANDARD_MONO("mono")
312326
r4057r4058
316330MACHINE_DRIVER_END
317331
318332
319
320
321
322333ROM_START( carrera )
323334   ROM_REGION( 0x10000, "main", 0 )
324335   ROM_LOAD( "27512.ic22", 0x00000, 0x10000, CRC(2385b9c8) SHA1(12d4397779e074096fbb23b114985f104366b79c) )
src/mame/drivers/thunderj.c
r4057r4058
2525
2626
2727
28static UINT16 *shared_ram;
29
30
3128/*************************************
3229 *
3330 *  Initialization & interrupts
r4057r4058
4845   atarigen_interrupt_reset(update_interrupts);
4946   atarivc_reset(machine->primary_screen, atarivc_eof_data, 2);
5047   atarijsa_reset();
51   memory_set_bankptr(machine, 1, shared_ram);
5248}
5349
5450
r4057r4058
9692
9793/*************************************
9894 *
99 *  Synchronization helper
100 *
101 *************************************/
102
103static TIMER_CALLBACK( shared_sync_callback )
104{
105   if (--param)
106      timer_set(machine, ATTOTIME_IN_USEC(50), NULL, param, shared_sync_callback);
107}
108
109
110static READ16_HANDLER( shared_ram_r )
111{
112   UINT16 result = shared_ram[offset];
113
114   /* look for a byte access, and then check for the high bit and a TAS opcode */
115   if (mem_mask != 0xffff && (result & mem_mask & 0x8080))
116   {
117      offs_t ppc = cpu_get_previouspc(space->cpu);
118      if (ppc < 0xa0000)
119      {
120         UINT16 *rom_base = (UINT16 *)space->cpu->region;
121         UINT16 opcode = rom_base[ppc / 2];
122
123         /* look for TAS or BTST #$7; both CPUs spin waiting for these in order to */
124         /* coordinate communications. Some spins have timeouts that reset the machine */
125         /* if they fail, so we must make sure they are released in time */
126         if ((opcode & 0xffc0) == 0x4ac0 ||
127            ((opcode & 0xffc0) == 0x0080 && rom_base[ppc / 2 + 1] == 7))
128         {
129            timer_call_after_resynch(space->machine, NULL, 4, shared_sync_callback);
130         }
131      }
132   }
133
134   return result;
135}
136
137
138
139/*************************************
140 *
14195 *  Video Controller Hack
14296 *
14397 *************************************/
r4057r4058
184138static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
185139   AM_RANGE(0x000000, 0x09ffff) AM_ROM
186140   AM_RANGE(0x0e0000, 0x0e0fff) AM_READWRITE(atarigen_eeprom_r, atarigen_eeprom_w) AM_BASE(&atarigen_eeprom) AM_SIZE(&atarigen_eeprom_size)
187   AM_RANGE(0x160000, 0x16ffff) AM_READWRITE(shared_ram_r, SMH_BANK1) AM_BASE(&shared_ram)
141   AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE(1)
188142   AM_RANGE(0x1f0000, 0x1fffff) AM_WRITE(atarigen_eeprom_enable_w)
189143   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
190144   AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
r4057r4058
217171static ADDRESS_MAP_START( extra_map, ADDRESS_SPACE_PROGRAM, 16 )
218172   AM_RANGE(0x000000, 0x03ffff) AM_ROM
219173   AM_RANGE(0x060000, 0x07ffff) AM_ROM
220   AM_RANGE(0x160000, 0x16ffff) AM_READWRITE(shared_ram_r, SMH_BANK1)
174   AM_RANGE(0x160000, 0x16ffff) AM_RAM AM_SHARE(1)
221175   AM_RANGE(0x260000, 0x26000f) AM_READ_PORT("260000")
222176   AM_RANGE(0x260010, 0x260011) AM_READ_PORT("260010")
223177   AM_RANGE(0x260012, 0x260013) AM_READ(special_port2_r)
r4057r4058
325279
326280   MDRV_MACHINE_RESET(thunderj)
327281   MDRV_NVRAM_HANDLER(atarigen)
328   MDRV_QUANTUM_TIME(HZ(6000))
329282
283   /* perfect synchronization due to shared RAM */
284   MDRV_QUANTUM_PERFECT_CPU("main")
285
330286   /* video hardware */
331287   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
332288   MDRV_GFXDECODE(thunderj)
src/mame/drivers/gottlieb.c
r4057r4058
23812381   ROM_LOAD( "mach3fg0.bin", 0x6000, 0x2000, CRC(0bae12a5) SHA1(7bc0b82ccab0e4498a7a2a9dc85f03125f25826e) )
23822382
23832383   DISK_REGION( "laserdisc" )
2384   DISK_IMAGE_READONLY( "mach3", 0, NO_DUMP )
2384   DISK_IMAGE_READONLY( "mach3", 0, MD5(591ba5ad458a051249eb4fcfa79e7c19) SHA1(8e4ef0110832a7b7bf6dbeceb395682c1e7f8ed6) )
23852385ROM_END
23862386
23872387
r4057r4058
24352435   ROM_LOAD( "usvs.fg0",     0xc000, 0x4000, CRC(7734e53f) SHA1(c1307596ba098c98e741f3c00686b514587e1d0a) )
24362436
24372437   DISK_REGION( "laserdisc" )
2438   DISK_IMAGE_READONLY( "usvsthem", 0, NO_DUMP )
2438   DISK_IMAGE_READONLY( "usvsthem", 0, MD5(e19bd2f819de35222a41ef676a8add98) SHA1(2018dd0dce6df51a83c9300f04c43c114341d52a) )
24392439ROM_END
24402440
24412441
r4057r4058
25812581
25822582/* games using rev 2 sound board */
25832583GAME( 1983, screwloo, 0,        gottlieb2, screwloo, romtiles, ROT0,   "Mylstar", "Screw Loose (prototype)", 0 )
2584GAME( 1983, mach3,    0,        g2laser,   mach3,    romtiles, ROT0,   "Mylstar", "M.A.C.H. 3", GAME_NOT_WORKING )
2584GAME( 1983, mach3,    0,        g2laser,   mach3,    romtiles, ROT0,   "Mylstar", "M.A.C.H. 3", 0 )
25852585GAME( 1984, cobram3,  0,        g2laser,   mach3,    romtiles, ROT0,   "Data East","Cobra Command (M.A.C.H. 3 hardware)", GAME_NOT_WORKING )
2586GAME( 1984, usvsthem, 0,        g2laser,   usvsthem, romtiles, ROT0,   "Mylstar", "Us vs. Them", GAME_NOT_WORKING )
2586GAME( 1984, usvsthem, 0,        g2laser,   usvsthem, romtiles, ROT0,   "Mylstar", "Us vs. Them", 0 )
25872587GAME( 1984, 3stooges, 0,        gottlieb2, 3stooges, stooges,  ROT0,   "Mylstar", "The Three Stooges In Brides Is Brides", 0 )
25882588GAME( 1984, vidvince, 0,        gottlieb2, vidvince, vidvince, ROT0,   "Mylstar", "Video Vince and the Game Factory (prototype)", GAME_IMPERFECT_GRAPHICS ) // sprite wrapping issues
25892589GAME( 1984, wizwarz,  0,        gottlieb2, wizwarz,  romtiles, ROT0,   "Mylstar", "Wiz Warz (prototype)", 0 )
src/mame/drivers/ddragon.c
r4057r4058
8181
8282#define MAIN_CLOCK      XTAL_12MHz
8383#define SOUND_CLOCK      XTAL_3_579545MHz
84#define MCU_CLOCK      XTAL_4MHz
84#define MCU_CLOCK         MAIN_CLOCK / 3
85#define PIXEL_CLOCK      MAIN_CLOCK / 2
8586
8687
8788/* from video */
r4057r4058
9798extern UINT8 technos_video_hw;
9899/* end of extern code & data */
99100
100static emu_timer *scanline_timer;
101
102101/* private globals */
103102static UINT8 dd_sub_cpu_busy;
104103static UINT8 sprite_irq, sound_irq, ym_irq;
r4057r4058
141140      return (vcount - 0x18) | 0x100;
142141}
143142
144
145static TIMER_CALLBACK( ddragon_scanline_callback )
143static TIMER_DEVICE_CALLBACK( ddragon_scanline )
146144{
147145   int scanline = param;
148   int screen_height = video_screen_get_height(machine->primary_screen);
146   int screen_height = video_screen_get_height(timer->machine->primary_screen);
149147   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
150148   int vcount = scanline_to_vcount(scanline);
151149
152150   /* update to the current point */
153151   if (scanline > 0)
154      video_screen_update_partial(machine->primary_screen, scanline - 1);
152      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
155153
156154   /* on the rising edge of VBLK (vcount == F8), signal an NMI */
157155   if (vcount == 0xf8)
158      cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, ASSERT_LINE);
156      cpu_set_input_line(timer->machine->cpu[0], INPUT_LINE_NMI, ASSERT_LINE);
159157
160158   /* set 1ms signal on rising edge of vcount & 8 */
161159   if (!(vcount_old & 8) && (vcount & 8))
162      cpu_set_input_line(machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE);
163
164   /* adjust for next scanline */
165   if (++scanline >= screen_height)
166      scanline = 0;
167   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
160      cpu_set_input_line(timer->machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE);
168161}
169162
170163
r4057r4058
180173   /* configure banks */
181174   memory_configure_bank(machine, 1, 0, 8, memory_region(machine, "main") + 0x10000, 0x4000);
182175
183   /* allocate timer for scanlines */
184   scanline_timer = timer_alloc(machine, ddragon_scanline_callback, NULL);
185
186176   /* determine the sound CPU index */
187177   snd_cpu = cputag_get_cpu(machine, "sound");
188178
r4057r4058
201191   adpcm_end[0] = adpcm_end[1] = 0;
202192   adpcm_idle[0] = adpcm_idle[1] = 1;
203193   adpcm_data[0] = adpcm_data[1] = -1;
204   timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
205194}
206195
207196
r4057r4058
978967static MACHINE_DRIVER_START( ddragon )
979968
980969   /* basic machine hardware */
981    MDRV_CPU_ADD("main", HD6309, MAIN_CLOCK)   /* 12MHz / 4 internally */
970    MDRV_CPU_ADD("main", HD6309, MAIN_CLOCK)      /* 12 MHz / 4 internally */
982971   MDRV_CPU_PROGRAM_MAP(ddragon_map,0)
972   MDRV_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "main", 0, 1)
983973
984   MDRV_CPU_ADD("sub", HD63701, MAIN_CLOCK/2)   /* 6Mhz / 4 internally */
974   MDRV_CPU_ADD("sub", HD63701, MAIN_CLOCK / 2)   /* 6 MHz / 4 internally */
985975   MDRV_CPU_PROGRAM_MAP(sub_map,0)
986976
987    MDRV_CPU_ADD("sound", M6809, MAIN_CLOCK/2)   /* 6MHz / 4 internally */
977    MDRV_CPU_ADD("sound", M6809, MAIN_CLOCK / 8)   /* 1.5 MHz */
988978   MDRV_CPU_PROGRAM_MAP(sound_map,0)
989979
990   MDRV_QUANTUM_TIME(HZ(60000)) /* heavy interleaving to sync up sprite<->main cpu's */
980   MDRV_QUANTUM_TIME(HZ(60000))   /* heavy interleaving to sync up sprite<->main cpu's */
991981
992982   MDRV_MACHINE_START(ddragon)
993983   MDRV_MACHINE_RESET(ddragon)
r4057r4058
998988
999989   MDRV_SCREEN_ADD("main", RASTER)
1000990   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1001   MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 384, 0, 256, 272, 0, 240)
991   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 0, 240)
1002992
1003993   MDRV_VIDEO_START(ddragon)
1004994   MDRV_VIDEO_UPDATE(ddragon)
r4057r4058
10251015   MDRV_IMPORT_FROM(ddragon)
10261016
10271017   /* basic machine hardware */
1028   MDRV_CPU_REPLACE("sub", M6809, MAIN_CLOCK/2)   /* 6Mhz / 4 internally */
1018   MDRV_CPU_REPLACE("sub", M6809, MAIN_CLOCK / 8)   /* 1.5Mhz */
10291019   MDRV_CPU_PROGRAM_MAP(sub_map,0)
10301020MACHINE_DRIVER_END
10311021
r4057r4058
10341024   MDRV_IMPORT_FROM(ddragon)
10351025
10361026   /* basic machine hardware */
1037    MDRV_CPU_REPLACE("sub", M6803, MAIN_CLOCK/2)   /* 6Mhz / 4 internally */
1027    MDRV_CPU_REPLACE("sub", M6803, MAIN_CLOCK / 2)   /* 6Mhz / 4 internally */
10381028   MDRV_CPU_PROGRAM_MAP(ddragnba_sub_map,0)
10391029   MDRV_CPU_IO_MAP(ddragnba_sub_portmap,0)
10401030MACHINE_DRIVER_END
r4057r4058
10431033static MACHINE_DRIVER_START( ddgn6809 )
10441034
10451035   /* basic machine hardware */
1046    MDRV_CPU_ADD("main", M6809, MAIN_CLOCK)   /* 12MHz / 4 internally */
1036    MDRV_CPU_ADD("main", M6809, MAIN_CLOCK / 8)   /* 1.5 MHz */
10471037   MDRV_CPU_PROGRAM_MAP(ddragon_map,0)
1038   MDRV_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "main", 0, 1)
10481039
1049   MDRV_CPU_ADD("sub", M6809, MAIN_CLOCK/2)   /* 6Mhz / 4 internally */
1040   MDRV_CPU_ADD("sub", M6809, MAIN_CLOCK / 8)   /* 1.5 Mhz */
10501041   MDRV_CPU_PROGRAM_MAP(sub_map,0)
10511042
1052    MDRV_CPU_ADD("sound", M6809, MAIN_CLOCK/2)   /* 6MHz / 4 internally */
1043    MDRV_CPU_ADD("sound", M6809, MAIN_CLOCK / 8)   /* 1.5 MHz */
10531044   MDRV_CPU_PROGRAM_MAP(sound_map,0)
10541045
10551046   MDRV_QUANTUM_TIME(HZ(60000)) /* heavy interleaving to sync up sprite<->main cpu's */
r4057r4058
10631054
10641055   MDRV_SCREEN_ADD("main", RASTER)
10651056   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1066   MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 384, 0, 256, 272, 0, 240)
1057   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 0, 240)
10671058
10681059   MDRV_VIDEO_START(ddragon)
10691060   MDRV_VIDEO_UPDATE(ddragon)
r4057r4058
10891080static MACHINE_DRIVER_START( ddragon2 )
10901081
10911082   /* basic machine hardware */
1092    MDRV_CPU_ADD("main", HD6309, MAIN_CLOCK)   /* 12MHz / 4 internally */
1083    MDRV_CPU_ADD("main", HD6309, MAIN_CLOCK)      /* 12 MHz / 4 internally */
10931084   MDRV_CPU_PROGRAM_MAP(dd2_map,0)
1085   MDRV_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "main", 0, 1)
10941086
1095   MDRV_CPU_ADD("sub", Z80, MAIN_CLOCK / 3)   /* 4 MHz */
1087   MDRV_CPU_ADD("sub", Z80, MAIN_CLOCK / 3)      /* 4 MHz */
10961088   MDRV_CPU_PROGRAM_MAP(dd2_sub_map,0)
10971089
10981090   MDRV_CPU_ADD("sound", Z80, 3579545)
r4057r4058
11091101
11101102   MDRV_SCREEN_ADD("main", RASTER)
11111103   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1112   MDRV_SCREEN_RAW_PARAMS(MAIN_CLOCK/2, 384, 0, 256, 272, 0, 240)
1104   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 384, 0, 256, 272, 0, 240)
11131105
11141106   MDRV_VIDEO_START(ddragon)
11151107   MDRV_VIDEO_UPDATE(ddragon)
r4057r4058
20051997GAME( 1987, ddragnba, ddragon,  ddragnba, ddragon,  ddragon,  ROT0, "bootleg", "Double Dragon (bootleg with M6803)", GAME_SUPPORTS_SAVE )
20061998GAME( 1987, ddgn6809, ddragon,  ddgn6809, ddragon,  ddgn6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 1)", GAME_NOT_WORKING )
20071999GAME( 1987, dd6809a,  ddragon,  ddgn6809, ddragon,  ddgn6809, ROT0, "bootleg", "Double Dragon (bootleg with 3xM6809, set 2)", GAME_NOT_WORKING )
2008
2009
2010
20112000GAME( 1988, ddragon2, 0,        ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (World)", GAME_SUPPORTS_SAVE )
20122001GAME( 1988, ddragn2u, ddragon2, ddragon2, ddragon2, ddragon2, ROT0, "Technos", "Double Dragon II - The Revenge (US)", GAME_SUPPORTS_SAVE )
20132002
src/mame/drivers/goldnpkr.c
r4057r4058
578578    - Added new games: Maverik, Brasil 89 & Poker'91.
579579    - Reworked the sets parent-clone relationship (still in progress).
580580
581    [2008-12-26]
581582
583    - Correctly setup the MC6845 device for all systems.
584    - Added common MC6845 device interface.
585    - Merged witchcrd and sloco93 machine drivers.
586    - Added/corrected the 50/60 Hz. DIP switches to all games.
587      The 50hz mode needs to be corrected. Some games as most bsuerte sets have
588      the 50/60 Hz. DIP switch connection patched.
589
590
582591    TODO:
583592
584593    - Missing PIA connections.
r4057r4058
973982   PORT_DIPNAME( 0x10, 0x00, "Jacks or Better" )   PORT_DIPLOCATION("SW1:1")
974983   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
975984   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
976   PORT_DIPNAME( 0x20, 0x20, "50hz/60hz" )         PORT_DIPLOCATION("SW1:2")
985   PORT_DIPNAME( 0x20, 0x00, "50hz/60hz" )         PORT_DIPLOCATION("SW1:2")
977986   PORT_DIPSETTING(    0x20, "50hz" )
978987   PORT_DIPSETTING(    0x00, "60hz" )
979988   PORT_DIPNAME( 0x40, 0x00, "Payout Mode" )      PORT_DIPLOCATION("SW1:3")   /* listed in the manual as "Play Mode" */
r4057r4058
11121121   PORT_DIPNAME( 0x10, 0x00, "Jacks or Better" )   PORT_DIPLOCATION("SW1:1")
11131122   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
11141123   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1115   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:2")
1116   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1117   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1124   PORT_DIPNAME( 0x20, 0x00, "50hz/60hz" )         PORT_DIPLOCATION("SW1:2")
1125   PORT_DIPSETTING(    0x20, "50hz" )
1126   PORT_DIPSETTING(    0x00, "60hz" )
11181127   /* listed in the manual as "Play Mode" */
11191128   PORT_DIPNAME( 0x40, 0x00, "Payout Mode" )      PORT_DIPLOCATION("SW1:3")
11201129   PORT_DIPSETTING(    0x40, "Manual" )         /*  listed in the manual as "Out Play" */
r4057r4058
13131322   PORT_DIPNAME( 0x10, 0x00, "Jacks or Better" )   PORT_DIPLOCATION("SW1:1")
13141323   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
13151324   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1316   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:2")
1317   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
1318   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1325   PORT_DIPNAME( 0x20, 0x00, "50hz/60hz" )         PORT_DIPLOCATION("SW1:2")
1326   PORT_DIPSETTING(    0x20, "50hz" )
1327   PORT_DIPSETTING(    0x00, "60hz" )
13191328   PORT_DIPNAME( 0x40, 0x00, "Payout Mode" )      PORT_DIPLOCATION("SW1:3")
13201329   PORT_DIPSETTING(    0x40, "Manual" )
13211330   PORT_DIPSETTING(    0x00, "Auto" )
r4057r4058
16901699   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coinage ) )      PORT_DIPLOCATION("SW1:4")
16911700   PORT_DIPSETTING(    0x80, "1 Coin - 10 Credit / 1 Note - 120 Credits" )
16921701   PORT_DIPSETTING(    0x00, "1 Coin - 100 Credits / 1 Note - 100 Credits" )
1702
1703   PORT_START("SW2")
1704   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1705   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1706   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1707   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1708   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1709   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1710   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
1711   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1712   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1713   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1714   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1715   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1716   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1717   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1719   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1720   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1721   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1722   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1723   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1724   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1725   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1726   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1727   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
16931728INPUT_PORTS_END
16941729
16951730static INPUT_PORTS_START( royale )
r4057r4058
18111846   PORT_DIPNAME( 0x10, 0x00, "Par Simple" )      PORT_DIPLOCATION("SW1:1")
18121847   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
18131848   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
1814   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:2")
1815   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1816   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1849   PORT_DIPNAME( 0x20, 0x00, "50hz/60hz" )         PORT_DIPLOCATION("SW1:2")
1850   PORT_DIPSETTING(    0x20, "50hz" )
1851   PORT_DIPSETTING(    0x00, "60hz" )
18171852   PORT_DIPNAME( 0x40, 0x00, "Modo de Pago" )      PORT_DIPLOCATION("SW1:3")   /* left as 'auto' */
18181853   PORT_DIPSETTING(    0x40, "Manual" )
18191854   PORT_DIPSETTING(    0x00, "Auto" )
r4057r4058
21102145};
21112146
21122147
2148/************************
2149*    CRTC Interface    *
2150************************/
2151
2152static const mc6845_interface mc6845_intf =
2153{
2154   "main",   /* screen we are acting on */
2155   8,      /* number of pixels per video memory address */
2156   NULL,   /* before pixel update callback */
2157   NULL,   /* row update callback */
2158   NULL,   /* after pixel update callback */
2159   NULL,   /* callback for display state changes */
2160   NULL,   /* HSYNC callback */
2161   NULL   /* VSYNC callback */
2162};
2163
2164
21132165/**************************************
21142166*       Discrete Sound Routines       *
21152167***************************************
r4057r4058
22672319   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)                  /* From MC6845 init, registers 00 & 04 (programmed with value-1). */
22682320   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 29*8-1)    /* From MC6845 init, registers 01 & 06. */
22692321
2270   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
2322   MDRV_MC6845_ADD("crtc", MC6845, CPU_CLOCK, mc6845_intf)   /* 68B45 or 6845s @ CPU clock */
22712323
22722324   MDRV_GFXDECODE(goldnpkr)
22732325   MDRV_PALETTE_INIT(goldnpkr)
r4057r4058
23222374   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
23232375MACHINE_DRIVER_END
23242376
2325static MACHINE_DRIVER_START( sloco93 )
23262377
2327   MDRV_IMPORT_FROM(goldnpkr_base)
2328
2329   /* video hardware */
2330   MDRV_SCREEN_MODIFY("main")
2331   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)
2332   MDRV_SCREEN_VISIBLE_AREA(2*8, 32*8-1, 1*8, 29*8-1)
2333
2334   MDRV_PALETTE_INIT(witchcrd)
2335
2336   /* sound hardware */
2337   MDRV_SPEAKER_STANDARD_MONO("mono")
2338   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
2339   MDRV_SOUND_CONFIG_DISCRETE(goldnpkr)
2340   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
2341MACHINE_DRIVER_END
2342
2343
23442378/*************************
23452379*        Rom Load        *
23462380*************************/
r4057r4058
32403274GAME(  1991, witchcda, witchcrd, witchcrd, witchcda, pottnpkr, ROT0,   "Unknown",                   "Witch Card (spanish, witch game, set 1)", 0 )
32413275GAME(  1991, witchcdb, witchcrd, witchcrd, witchcda, pottnpkr, ROT0,   "Unknown",                   "Witch Card (spanish, witch game, set 2)", 0 )
32423276GAME(  1991, witchcdc, witchcrd, witchcrd, witchcdc, pottnpkr, ROT0,   "Unknown",                   "Witch Card (english, no witch game)",     0 )
3243GAME(  1993, sloco93,  0,        sloco93,  sloco93,  pottnpkr, ROT0,   "Unknown",                   "Super Loco 93 (spanish, set 1)",          0 )
3244GAME(  1993, sloco93a, sloco93,  sloco93,  sloco93,  pottnpkr, ROT0,   "Unknown",                   "Super Loco 93 (spanish, set 2)",          0 )
3277GAME(  1993, sloco93,  0,        witchcrd, sloco93,  pottnpkr, ROT0,   "Unknown",                   "Super Loco 93 (spanish, set 1)",          0 )
3278GAME(  1993, sloco93a, sloco93,  witchcrd, sloco93,  pottnpkr, ROT0,   "Unknown",                   "Super Loco 93 (spanish, set 2)",          0 )
32453279GAME(  198?, maverik,  0,        witchcrd, bsuerte,  pottnpkr, ROT0,   "Unknown",                   "Maverik",                                 0 )
32463280GAMEL( 1989, brasil89, 0,        witchcrd, bsuerte,  pottnpkr, ROT0,   "Unknown",                   "Brasil 89",                               0,                layout_goldnpkr )
32473281GAME(  1991, poker91,  0,        witchcrd, poker91,  pottnpkr, ROT0,   "Unknown",                   "Poker 91",                                0 )
src/mame/drivers/exidy.c
r4057r4058
768768
769769/*************************************
770770 *
771 *  Machine init
772 *
773 *************************************/
774
775static MACHINE_START( teetert )
776{
777    state_save_register_global(machine, last_dial);
778}
779
780/*************************************
781 *
771782 *  Machine drivers
772783 *
773784 *************************************/
r4057r4058
857868   MDRV_IMPORT_FROM(venture)
858869   MDRV_CPU_MODIFY("main")
859870   MDRV_CPU_VBLANK_INT_HACK(teetert_vblank_interrupt,10)
871
872    MDRV_MACHINE_START( teetert )
873
860874MACHINE_DRIVER_END
861875
862876
r4057r4058
14191433 *
14201434 *************************************/
14211435
1422GAME( 1979, sidetrac, 0,       sidetrac, sidetrac, sidetrac, ROT0, "Exidy", "Side Track", 0 )
1423GAME( 1980, targ,     0,       targ,     targ,     targ,     ROT0, "Exidy", "Targ", 0 )
1424GAME( 1980, targc,    targ,    targ,     targ,     targ,     ROT0, "Exidy", "Targ (cocktail?)", 0 )
1425GAME( 1980, spectar,  0,       spectar,  spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 3)", 0 )
1426GAME( 1980, spectar1, spectar, spectar,  spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 1?)", 0 )
1427GAME( 1980, rallys,   spectar, rallys,   rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg?)", 0 )
1428GAME( 1980, phantoma, spectar, rallys,   phantoma, phantoma, ROT0, "Jeutel","Phantomas", 0 )
1436GAME( 1979, sidetrac, 0,       sidetrac, sidetrac, sidetrac, ROT0, "Exidy", "Side Track", GAME_SUPPORTS_SAVE )
1437GAME( 1980, targ,     0,       targ,     targ,     targ,     ROT0, "Exidy", "Targ", GAME_SUPPORTS_SAVE )
1438GAME( 1980, targc,    targ,    targ,     targ,     targ,     ROT0, "Exidy", "Targ (cocktail?)", GAME_SUPPORTS_SAVE )
1439GAME( 1980, spectar,  0,       spectar,  spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 3)", GAME_SUPPORTS_SAVE )
1440GAME( 1980, spectar1, spectar, spectar,  spectar,  spectar,  ROT0, "Exidy", "Spectar (revision 1?)", GAME_SUPPORTS_SAVE )
1441GAME( 1980, rallys,   spectar, rallys,   rallys,   rallys,   ROT0, "Novar", "Rallys (bootleg?)", GAME_SUPPORTS_SAVE )
1442GAME( 1980, phantoma, spectar, rallys,   phantoma, phantoma, ROT0, "Jeutel","Phantomas", GAME_SUPPORTS_SAVE )
14291443
1430GAME( 1981, mtrap,    0,       mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 5)", 0 )
1431GAME( 1981, mtrap3,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 3)", 0 )
1432GAME( 1981, mtrap4,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 4)", 0 )
1433GAME( 1981, venture,  0,       venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 1)", 0 )
1434GAME( 1981, venture2, venture, venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 2)", 0 )
1435GAME( 1981, venture4, venture, venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 4)", 0 )
1436GAME( 1982, teetert,  0,       teetert,  teetert,  teetert,  ROT0, "Exidy", "Teeter Torture (prototype)", 0 )
1437GAME( 1982, pepper2,  0,       pepper2,  pepper2,  pepper2,  ROT0, "Exidy", "Pepper II", 0 )
1438GAME( 1982, hardhat,  0,       pepper2,  pepper2,  pepper2,  ROT0, "Exidy", "Hard Hat", 0 )
1439GAME( 1983, fax,      0,       fax,      fax,      fax,      ROT0, "Exidy", "FAX", 0 )
1440GAME( 1983, fax2,     fax,     fax,      fax,      fax,      ROT0, "Exidy", "FAX 2", 0 )
1444GAME( 1981, mtrap,    0,       mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 5)", GAME_SUPPORTS_SAVE )
1445GAME( 1981, mtrap3,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 3)", GAME_SUPPORTS_SAVE )
1446GAME( 1981, mtrap4,   mtrap,   mtrap,    mtrap,    mtrap,    ROT0, "Exidy", "Mouse Trap (version 4)", GAME_SUPPORTS_SAVE )
1447GAME( 1981, venture,  0,       venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 1)", GAME_SUPPORTS_SAVE )
1448GAME( 1981, venture2, venture, venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 5 set 2)", GAME_SUPPORTS_SAVE )
1449GAME( 1981, venture4, venture, venture,  venture,  venture,  ROT0, "Exidy", "Venture (version 4)", GAME_SUPPORTS_SAVE )
1450GAME( 1982, teetert,  0,       teetert,  teetert,  teetert,  ROT0, "Exidy", "Teeter Torture (prototype)", GAME_SUPPORTS_SAVE )
1451GAME( 1982, pepper2,  0,       pepper2,  pepper2,  pepper2,  ROT0, "Exidy", "Pepper II", GAME_SUPPORTS_SAVE )
1452GAME( 1982, hardhat,  0,       pepper2,  pepper2,  pepper2,  ROT0, "Exidy", "Hard Hat", GAME_SUPPORTS_SAVE )
1453GAME( 1983, fax,      0,       fax,      fax,      fax,      ROT0, "Exidy", "FAX", GAME_SUPPORTS_SAVE )
1454GAME( 1983, fax2,     fax,     fax,      fax,      fax,      ROT0, "Exidy", "FAX 2", GAME_SUPPORTS_SAVE )
src/mame/drivers/jokrwild.c
r4057r4058
331331   0, 0
332332};
333333
334
335/************************
336*    CRTC Interface    *
337************************/
338
339static const mc6845_interface mc6845_intf =
340{
341   "main",      /* screen we are acting on */
342   8,         /* number of pixels per video memory address */
343   NULL,      /* before pixel update callback */
344   NULL,      /* row update callback */
345   NULL,      /* after pixel update callback */
346   NULL,      /* callback for display state changes */
347   NULL,      /* HSYNC callback */
348   NULL      /* VSYNC callback */
349};
350
351
334352/*************************
335353*    Machine Drivers     *
336354*************************/
r4057r4058
358376   MDRV_VIDEO_START(jokrwild)
359377   MDRV_VIDEO_UPDATE(jokrwild)
360378
361   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
379   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */
362380
363381MACHINE_DRIVER_END
364382
src/mame/drivers/gamecstl.c
r4057r4058
578578   return r;
579579}
580580
581static MACHINE_RESET(gamecstl)
581static MACHINE_START(gamecstl)
582582{
583   memory_set_bankptr(machine, 1, memory_region(machine, "user1") + 0x30000);
584
585   cpu_set_irq_callback(machine->cpu[0], irq_callback);
586
587583   gamecstl_devices.pit8254 = device_list_find_by_tag( machine->config->devicelist, PIT8254, "pit8254" );
588584   gamecstl_devices.pic8259_1 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_1" );
589585   gamecstl_devices.pic8259_2 = device_list_find_by_tag( machine->config->devicelist, PIC8259, "pic8259_2" );
r4057r4058
591587   gamecstl_devices.dma8237_2 = device_list_find_by_tag( machine->config->devicelist, DMA8237, "dma8237_2" );
592588}
593589
590static MACHINE_RESET(gamecstl)
591{
592   memory_set_bankptr(machine, 1, memory_region(machine, "user1") + 0x30000);
594593
594   cpu_set_irq_callback(machine->cpu[0], irq_callback);
595}
596
597
595598/*************************************************************
596599 *
597600 * pic8259 configuration
r4057r4058
652655   MDRV_CPU_PROGRAM_MAP(gamecstl_map, 0)
653656   MDRV_CPU_IO_MAP(gamecstl_io, 0)
654657
658   MDRV_MACHINE_START(gamecstl)
655659   MDRV_MACHINE_RESET(gamecstl)
656660
657661   MDRV_PCI_BUS_ADD("pcibus", 0)
src/mame/drivers/wwfwfest.c
r4057r4058
351351   /* An interrupt is generated every 16 scanlines */
352352   if (scanline % 16 == 0)
353353   {
354      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
354      if (scanline > 0)
355         video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
355356      cpu_set_input_line(timer->machine->cpu[0], 2, ASSERT_LINE);
356357   }
357358
r4057r4058
361362      video_screen_update_partial(timer->machine->primary_screen, scanline - 1);
362363      cpu_set_input_line(timer->machine->cpu[0], 3, ASSERT_LINE);
363364   }
364
365   /* Adjust for next scanline */
366   if (++scanline >= video_screen_get_height(timer->machine->primary_screen))
367   {
368      scanline = 0;
369   }
370365}
371366
372367/*******************************************************************************
src/mame/drivers/circus.c
r4057r4058
541541}
542542
543543
544GAMEL(1977, circus,   0,      circus,   circus,   circus,   ROT0, "Exidy / Taito", "Circus / Acrobat TV", 0, layout_circus )
545GAMEL(1977, circusse, circus, circus,   circus,   circus,   ROT0, "[Exidy] (Sub-Electro bootleg)", "Circus (Sub-Electro bootleg)", 0, layout_circus ) // looks like a text hack, but we've seen 2 identical copies so it's worth supporting
546GAME( 1977, robotbwl, 0,      robotbwl, robotbwl, robotbwl, ROT0, "Exidy", "Robot Bowl", GAME_IMPERFECT_SOUND )
547GAMEL(1979, crash,    0,      crash,    crash,    crash,    ROT0, "Exidy", "Crash", GAME_IMPERFECT_SOUND, layout_crash )
548GAME( 1979, ripcord,  0,      ripcord,  ripcord,  ripcord,  ROT0, "Exidy", "Rip Cord", GAME_IMPERFECT_SOUND )
544GAMEL(1977, circus,   0,      circus,   circus,   circus,   ROT0, "Exidy / Taito", "Circus / Acrobat TV", GAME_SUPPORTS_SAVE, layout_circus )
545GAMEL(1977, circusse, circus, circus,   circus,   circus,   ROT0, "[Exidy] (Sub-Electro bootleg)", "Circus (Sub-Electro bootleg)", GAME_SUPPORTS_SAVE, layout_circus ) // looks like a text hack, but we've seen 2 identical copies so it's worth supporting
546GAME( 1977, robotbwl, 0,      robotbwl, robotbwl, robotbwl, ROT0, "Exidy", "Robot Bowl", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
547GAMEL(1979, crash,    0,      crash,    crash,    crash,    ROT0, "Exidy", "Crash", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND, layout_crash )
548GAME( 1979, ripcord,  0,      ripcord,  ripcord,  ripcord,  ROT0, "Exidy", "Rip Cord", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND )
src/mame/drivers/vcombat.c
r4057r4058
11/*
22Virtual Combat hardware games.
33
4Driver by Jason Eckhardt and Andrew Gardner.
5
46----
57
68There are two known games on this hardware.  Both are developed by
r4057r4058
1517
1618There are two boards to this hardware.  The upper, which contains the
1719graphics ROMs and the i860, and the lower which contains the main
18and sound CPU's.  Virtual Combat sports two upper boards which presumably
20and sound CPUs.  Virtual Combat sports two upper boards which presumably
1921output a different rasterization of the scene for each stereo eye.
2022
2123UPPER:
r4057r4058
2628    8-way DIP switch
2729    574200D x4
2830    PAL palce24v10 x2 (next to the i860)
31    Bt476 RAMDAC
2932
3033LOWER:
3134    Motorola MC68000P12 x2
r4057r4058
7073#include <stdio.h>
7174#include "driver.h"
7275#include "cpu/m68000/m68000.h"
76#include "cpu/i860/i860.h"
7377#include "video/generic.h"
78#include "video/tlc34076.h"
7479
80static UINT16* framebuffer;
81static UINT16* vid_0_shared_RAM;
82static UINT16* vid_1_shared_RAM;
83
7584static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
7685   AM_RANGE(0x000000, 0x0fffff) AM_ROM
77   AM_RANGE(0x200000, 0x201fff) AM_RAM      /* At the very least! */
86   AM_RANGE(0x200000, 0x2fffff) AM_RAM
87   AM_RANGE(0x300000, 0x3fffff) AM_RAM AM_BASE(&framebuffer) AM_SHARE(1)
88
89   AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_BASE(&vid_0_shared_RAM) AM_SHARE(2)   /* First i860 shared RAM */
90//  AM_RANGE(0x440000, 0x440003) i860 #1 com 1
91//  AM_RANGE(0x480000, 0x480003) i860 #1 com 2
92//  AM_RANGE(0x4c0000, 0x4c0003) i860 #1 stop/start/reset
93
94   AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_BASE(&vid_1_shared_RAM) AM_SHARE(3)   /* Second i860 shared RAM */
95//  AM_RANGE(0x540000, 0x540003) i860 #2 com 1
96//  AM_RANGE(0x580000, 0x580003) i860 #2 com 2
97//  AM_RANGE(0x5c0000, 0x5c0003) i860 #2 stop/start/reset
98
99   AM_RANGE(0x706000, 0x70601f) AM_READWRITE(tlc34076_lsb_r, tlc34076_lsb_w)
78100ADDRESS_MAP_END
79101
80static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 )
81   AM_RANGE(0x000000, 0x03ffff) AM_ROM
102
103/* The first i860 - middle board */
104static ADDRESS_MAP_START( vid_0_map, ADDRESS_SPACE_PROGRAM, 32 )
105   AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_SHARE(1)               /* Shared framebuffer */
106//  AM_RANGE(0x20000000, 0x20000003) com 1      (0x440000 in 68k-land)
107//  AM_RANGE(0x40000000, 0x401fffff) AM_ROM                             /* 3d data ROMs */
108//  AM_RANGE(0x80000000, 0x80000003) com 2      (0x480000 in 68k-land)
109   AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE(2)               /* Shared RAM with main */
82110ADDRESS_MAP_END
83111
84/*
85static ADDRESS_MAP_START( video_map, ADDRESS_SPACE_PROGRAM, 16 )
86    AM_RANGE(0x000000, 0x1fffff) AM_ROM
112
113/* The second i860 - top board */
114static ADDRESS_MAP_START( vid_1_map, ADDRESS_SPACE_PROGRAM, 32 )
115   AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_SHARE(1)               /* Shared framebuffer */
116//  AM_RANGE(0x20000000, 0x20000003) com 1      (0x540000 in 68k-land)
117//  AM_RANGE(0x40000000, 0x401fffff) AM_ROM                             /* 3d data ROMs */
118//  AM_RANGE(0x80000000, 0x80000003) com 2      (0x580000 in 68k-land)
119   AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE(3)               /* Shared RAM with main */
87120ADDRESS_MAP_END
88*/
89121
122
123/* Sound CPU - temprarily disabled */
124//static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 16 )
125//  AM_RANGE(0x000000, 0x03ffff) AM_ROM
126//ADDRESS_MAP_END
127
128
129static MACHINE_RESET( vcombat )
130{
131   /* Setup the Bt476 VGA RAMDAC palette chip */
132   tlc34076_reset(6);
133}
134
135static DIRECT_UPDATE_HANDLER( vid_0_direct_handler )
136{
137   if (address >= 0xfffc0000 && address <= 0xffffffff)
138   {
139      direct->raw = direct->decrypted = ((UINT8*)vid_0_shared_RAM) - 0xfffc0000;
140      return ~0;
141   }
142   return address;
143}
144
145static DIRECT_UPDATE_HANDLER( vid_1_direct_handler )
146{
147   if (address >= 0xfffc0000 && address <= 0xffffffff)
148   {
149      direct->raw = direct->decrypted = ((UINT8*)vid_1_shared_RAM) - 0xfffc0000;
150      return ~0;
151   }
152   return address;
153}
154
155static DRIVER_INIT( vcombat )
156{
157   UINT8 *ROM = memory_region(machine, "main");
158
159   /* The two i860s execute out of RAM */
160   memory_set_direct_update_handler(cputag_get_address_space(machine, "vid_0", ADDRESS_SPACE_PROGRAM), vid_0_direct_handler);
161   memory_set_direct_update_handler(cputag_get_address_space(machine, "vid_1", ADDRESS_SPACE_PROGRAM), vid_1_direct_handler);
162
163   // Hacks
164   // pc==4016 : jump 4038 ... There's something strange about how it waits at 402e (interrupts all masked out)
165   ROM[0x4017] = 0x66;
166
167   // Sound CPU comm bits
168   // pc==40fa : jump 40fc ... 600004 should be -16
169   ROM[0x40fb] = 0x67;
170   // pc==410e : jump 4110 ... 600004 should be 31
171   ROM[0x410f] = 0x67;
172
173   // pc==e220 : jump e222 ... 20119a should not be 0. (no interrupts masked)
174   // TODO: I wonder if this is an input bit that's ticked on vblank or something.  The menu selection continually crawls up.
175}
176
177
90178static INPUT_PORTS_START( vcombat )
91179INPUT_PORTS_END
92180
181
93182static VIDEO_UPDATE( vcombat )
94183{
184   int x, y;
185   int count = 0;
186   const rgb_t *pens = tlc34076_get_pens();
187
188   for(y = 0; y < 480; y++)
189   {
190      for(x = 0; x < 256; x++)
191      {
192         UINT32 color;
193
194         if (x % 2) color = (framebuffer[count] & 0xff00) >> 8;
195         else      color =  framebuffer[count] & 0x00ff;
196
197         if(x < video_screen_get_visible_area(screen)->max_x && y < video_screen_get_visible_area(screen)->max_y)
198            *BITMAP_ADDR32(bitmap, y, x) = pens[color];
199
200         if (x % 2) count++;
201      }
202   }
95203   return 0;
96204}
97205
206
207// This is just here to show that there is text in the main program ROM.  It probably won't really be a useful decode.
98208static const gfx_layout vcombat_charlayout =
99209{
100210   8, 8,
101211   0x100000 / 0x80,
102212   8,
103213   { 0,1,2,3,4,5,6,7 },
104   { 0*16,  1*16,  2*16,  3*16,  4*16,  5*16,  6*16,  7*16 },
214   { 0*16,  1*16,  2*16,  3*16,  4*16,  5*16,  6*16,   7*16 },
105215   { 0*16*8, 1*16*8, 2*16*8, 3*16*8, 4*16*8, 5*16*8, 6*16*8, 7*16*8 },
106216   8 * 0x80
107217};
108218
219
109220static GFXDECODE_START( vcombat )
110221   GFXDECODE_ENTRY( "main", 0, vcombat_charlayout, 0, 256 )
111222GFXDECODE_END
112223
224
113225static MACHINE_DRIVER_START( vcombat )
114226   MDRV_CPU_ADD("main", M68000, XTAL_12MHz)
115227   MDRV_CPU_PROGRAM_MAP(main_map,0)
116   MDRV_CPU_VBLANK_INT("main", irq7_line_hold)         /* The only un-masked irq thus far */
228   //MDRV_CPU_VBLANK_INT("main", irq7_line_hold)
117229
118   MDRV_CPU_ADD("sound", M68000, XTAL_12MHz)
119   MDRV_CPU_PROGRAM_MAP(sound_map,0)
230   /* The middle board i860 */
231   MDRV_CPU_ADD("vid_0", I860, XTAL_20MHz)
232   MDRV_CPU_PROGRAM_MAP(vid_0_map,0)
120233
121/*
122    Virtual combat has an i860 on each of its two upper boards.
123    MDRV_CPU_ADD("video", i860, XTAL_20MHz)
124    MDRV_CPU_PROGRAM_MAP(video_map,0)
125*/
234   /* The top board i860 */
235   MDRV_CPU_ADD("vid_1", I860, XTAL_20MHz)
236   MDRV_CPU_PROGRAM_MAP(vid_1_map,0)
126237
238   /* Sound CPU Disabled for now */
239   //MDRV_CPU_ADD("sound", M68000, XTAL_12MHz)
240   //MDRV_CPU_PROGRAM_MAP(sound_map,0)
241
242   MDRV_MACHINE_RESET(vcombat)
243
244   // Likely will go away
245   MDRV_GFXDECODE(vcombat)
246
127247   MDRV_SCREEN_ADD("main", RASTER)
128   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
129248   MDRV_SCREEN_REFRESH_RATE(60)
130249   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
250   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
131251   MDRV_SCREEN_SIZE(640, 480)
132   MDRV_GFXDECODE(vcombat)
133252   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
134253
135   /*MDRV_PALETTE_LENGTH(0x100)*/
136
137   MDRV_QUANTUM_TIME(HZ(120000))   /* Temporary */
138
139254   MDRV_VIDEO_UPDATE(vcombat)
140255MACHINE_DRIVER_END
141256
r4057r4058
198313   /* The second upper-board PAL couldn't be read */
199314ROM_END
200315
201/*    YEAR  NAME      PARENT  MACHINE  INPUT    INIT MONITOR COMPANY     FULLNAME           FLAGS */
202GAME( 1993, vcombat,  0,      vcombat, vcombat, 0,   ROT0,   "VR8 Inc.", "Virtual Combat",  GAME_NOT_WORKING | GAME_NO_SOUND )
203GAME( 1989, shadfgtr, 0,      vcombat, vcombat, 0,   ROT0,   "Sega?",    "Shadow Fighters", GAME_NOT_WORKING | GAME_NO_SOUND )
316/*    YEAR  NAME      PARENT  MACHINE  INPUT    INIT     MONITOR COMPANY     FULLNAME           FLAGS */
317GAME( 1993, vcombat,  0,      vcombat, vcombat, vcombat, ROT0,   "VR8 Inc.", "Virtual Combat",  GAME_NOT_WORKING | GAME_NO_SOUND )
318GAME( 1989, shadfgtr, 0,      vcombat, vcombat, 0,       ROT0,   "Sega?",    "Shadow Fighters", GAME_NOT_WORKING | GAME_NO_SOUND )
src/mame/drivers/konamim2.c
r4057r4058
221221         UINT16 *d = BITMAP_ADDR16(bitmap, j, 0);
222222         for (i=0; i < 512; i++)
223223         {
224            d[i^3] = *fb++;
224            d[i^3] = *fb++ & 0x7fff;
225225         }
226226      }
227227   }
src/mame/drivers/slotcarn.c
r0r4058
1/***************************************************************************
2
3  Slot Carnival, (1985, Wing Co,Ltd)
4
5  Driver by David Haywood & Roberto Fresca.
6
7
8  Notes:
9
10  - Very similar to merit.c
11  - We're using the MC6845 drawing code from merit.c, but it will need
12    modifications to support the reels and proper colors.
13
14
15****************************************************************************/
16
17#include "driver.h"
18#include "cpu/z80/z80.h"
19#include "sound/ay8910.h"
20#include "machine/8255ppi.h"
21#include "video/mc6845.h"
22
23#define MASTER_CLOCK         (XTAL_10MHz)
24#define CPU_CLOCK            (MASTER_CLOCK / 4)
25#define PIXEL_CLOCK            (MASTER_CLOCK / 1)
26#define CRTC_CLOCK            (MASTER_CLOCK / 8)
27#define SND_CLOCK            (MASTER_CLOCK / 8)
28
29#define NUM_PENS            (16)
30#define RAM_PALETTE_SIZE      (1024)
31
32static pen_t pens[NUM_PENS];
33
34static UINT8 *ram_attr;
35static UINT8 *ram_video;
36static UINT8 *ram_palette;
37static UINT8 *backup_ram;
38
39/*
40
41  b800-b803 = PPI (9b) III mode0 all.
42  ba00-ba03 = PPI (90) IOO mode0 all.
43  bc00-bc03 = PPI (92) IIO mode0 all.
44
45  6000 = RW
46
47*/
48
49static READ8_HANDLER( palette_r )
50{
51   int co;
52
53   co = ((ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
54   return ram_palette[co];
55}
56
57static WRITE8_HANDLER( palette_w )
58{
59   int co;
60
61   video_screen_update_now(space->machine->primary_screen);
62   data &= 0x0f;
63
64   co = ((ram_attr[offset] & 0x7F) << 3) | (offset & 0x07);
65   ram_palette[co] = data;
66
67}
68
69
70static MC6845_BEGIN_UPDATE( begin_update )
71{
72   int i;
73   int dim, bit0, bit1, bit2;
74
75   for (i=0; i < NUM_PENS; i++)
76   {
77      dim = BIT(i,3) ? 255 : 127;
78      bit0 = BIT(i,0);
79      bit1 = BIT(i,1);
80      bit2 = BIT(i,2);
81      pens[i] = MAKE_RGB(dim*bit0, dim*bit1, dim*bit2);
82   }
83
84   return pens;
85}
86
87
88static MC6845_UPDATE_ROW( update_row )
89{
90   int extra_video_bank_bit = 0; // not used?
91   int lscnblk = 0; // not used?
92
93
94   UINT8 cx;
95   pen_t *pens = (pen_t *)param;
96   UINT8 *gfx[2];
97   UINT16 x = 0;
98   int rlen;
99
100   gfx[0] = memory_region(device->machine, "gfx1");
101   gfx[1] = memory_region(device->machine, "gfx2");
102   rlen = memory_region_length(device->machine, "gfx2");
103
104   //ma = ma ^ 0x7ff;
105   for (cx = 0; cx < x_count; cx++)
106   {
107      int i;
108      int attr = ram_attr[ma & 0x7ff];
109      int region = (attr & 0x40) >> 6;
110      int addr = ((ram_video[ma & 0x7ff] | ((attr & 0x80) << 1) | (extra_video_bank_bit)) << 4) | (ra & 0x0f);
111      int colour = (attr & 0x7f) << 3;
112      UINT8   *data;
113
114      addr &= (rlen-1);
115      data = gfx[region];
116
117      for (i = 7; i>=0; i--)
118      {
119         int col = colour;
120
121         col |= (BIT(data[0x0000 | addr],i)<<2);
122         if (region==0)
123         {
124            col |= (BIT(data[rlen | addr],i)<<1);
125            col |= (BIT(data[rlen<<1 | addr],i)<<0);
126         }
127         else
128            col |= 0x03;
129
130         col = ram_palette[col & 0x3ff];
131         *BITMAP_ADDR32(bitmap, y, x) = pens[col ? col : (lscnblk ? 8 : 0)];
132
133         x++;
134      }
135      ma++;
136   }
137}
138
139
140static MC6845_ON_HSYNC_CHANGED(hsync_changed)
141{
142   /* update any video up to the current scanline */
143   video_screen_update_now(device->machine->primary_screen);
144}
145
146static MC6845_ON_VSYNC_CHANGED(vsync_changed)
147{
148   cpu_set_input_line(device->machine->cpu[0], 0, vsync ? ASSERT_LINE : CLEAR_LINE);
149}
150
151static const mc6845_interface mc6845_intf =
152{
153   "main",               /* screen we are acting on */
154   8,                  /* number of pixels per video memory address */
155   begin_update,         /* before pixel update callback */
156   update_row,            /* row update callback */
157   0,                  /* after pixel update callback */
158   0,                  /* callback for display state changes */
159   hsync_changed,         /* HSYNC callback */
160   vsync_changed         /* VSYNC callback */
161};
162
163
164/*******************************
165*          Memory Map          *
166*******************************/
167
168static ADDRESS_MAP_START( slotcarn_map, ADDRESS_SPACE_PROGRAM, 8 )
169   AM_RANGE(0x0000, 0x5fff) AM_ROM
170   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&backup_ram)
171
172   AM_RANGE(0xb000, 0xb000) AM_WRITE(ay8910_control_port_0_w)
173   AM_RANGE(0xb100, 0xb100) AM_READWRITE(ay8910_read_port_0_r,ay8910_write_port_0_w)
174
175   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE(PPI8255, "ppi8255_0", ppi8255_r, ppi8255_w)   /* Input Ports */
176   AM_RANGE(0xba00, 0xba03) AM_DEVREADWRITE(PPI8255, "ppi8255_1", ppi8255_r, ppi8255_w)   /* Input Ports */
177   AM_RANGE(0xbc00, 0xbc03) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w)   /* Input/Output Ports */
178
179   AM_RANGE(0xc000, 0xc000) AM_READ_PORT("DSW3")
180   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("DSW4")
181
182   AM_RANGE(0xd800, 0xd81f) AM_RAM // column scroll for reels?
183
184   AM_RANGE(0xe000, 0xe000) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w)
185   AM_RANGE(0xe001, 0xe001) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w)
186
187   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE(&ram_attr)
188   AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_BASE(&ram_video)
189   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
190ADDRESS_MAP_END
191
192
193/********************************
194*          Input Ports          *
195********************************/
196
197static INPUT_PORTS_START( slotcarn )
198   PORT_START("IN0")   /* b800 (ppi8255) */
199   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
200   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
201   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
202   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
203   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Key In") PORT_CODE(KEYCODE_Q)
204   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Start")  PORT_CODE(KEYCODE_N)
205   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Cancel") PORT_CODE(KEYCODE_M)
206   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Select") PORT_CODE(KEYCODE_B)
207
208   PORT_START("IN1")   /* b801 (ppi8255) */
209   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1)    PORT_IMPULSE(2)       /* Coin A */
210   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2)    PORT_IMPULSE(2)       /* Coin B */
211   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Stats")    PORT_CODE(KEYCODE_0)
212   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") PORT_CODE(KEYCODE_9)
213   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
214   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3)    PORT_IMPULSE(2)       /* Coin C */
215   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN4)    PORT_IMPULSE(2)       /* Coin D */
216   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
217
218   PORT_START("IN2")   /* b802 (ppi8255) */
219   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
220   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
221   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
222   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
223   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
224   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
225   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
226   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
227
228   PORT_START("IN3")   /* bc00 (ppi8255) */
229   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
230   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
231   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
232   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Double-Up")    PORT_CODE(KEYCODE_C)
233   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Take Score")   PORT_CODE(KEYCODE_V)
234   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet")          PORT_CODE(KEYCODE_Z)
235   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Payout")       PORT_CODE(KEYCODE_W)
236   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Empty Hopper") PORT_CODE(KEYCODE_H)
237
238   PORT_START("IN4")   /* bc01 (ppi8255) */
239   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
240   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
241   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
242   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
243   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
244   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
245   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
246   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
247
248   PORT_START("DSW1")   /* ba00 (ppi8255) */
249   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:8")
250   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
251   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
252   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:7")
253   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
254   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
255   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:6")
256   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
257   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
258   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:5")
259   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
260   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
261   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:4")
262   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
263   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
264   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW1:3")
265   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
266   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
267   PORT_DIPNAME( 0xc0, 0xc0, "D-UP Pay Rate" )      PORT_DIPLOCATION("DSW1:1,2")
268   PORT_DIPSETTING(    0xc0, "80%" )
269   PORT_DIPSETTING(    0x80, "85%" )
270   PORT_DIPSETTING(    0x40, "90%" )
271   PORT_DIPSETTING(    0x00, "95%" )
272
273   PORT_START("DSW2")   /* ay8910, port B */
274   PORT_DIPNAME( 0x01, 0x01, "FIVE LINE Pay Rate" )   PORT_DIPLOCATION("DSW2:8")
275   PORT_DIPSETTING(    0x01, "75%" )
276   PORT_DIPSETTING(    0x00, "85%" )
277   PORT_DIPNAME( 0x02, 0x02, "SUPER CONTI Pay Rate" )   PORT_DIPLOCATION("DSW2:7")
278   PORT_DIPSETTING(    0x02, "75%" )
279   PORT_DIPSETTING(    0x00, "85%" )
280   PORT_DIPNAME( 0x04, 0x04, "LUCKY BAR Pay Rate" )   PORT_DIPLOCATION("DSW2:6")
281   PORT_DIPSETTING(    0x04, "75%" )
282   PORT_DIPSETTING(    0x00, "85%" )
283   PORT_DIPNAME( 0x08, 0x08, "BONUS LINE Pay Rate" )   PORT_DIPLOCATION("DSW2:5")
284   PORT_DIPSETTING(    0x08, "75%" )
285   PORT_DIPSETTING(    0x00, "85%" )
286   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:4")
287   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
288   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
289   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:3")
290   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
292   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:2")
293   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
294   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
295   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:1")
296   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
297   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
298
299   PORT_START("DSW3")   /* c000 direct */
300   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
301   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
302   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
303   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
304   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
305   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
306   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
307   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
308   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
309   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
310   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
311   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
312   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
313   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
314   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
315   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
316   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
317   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
318   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
319   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
320   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
321   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
322   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
323   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
324
325   PORT_START("DSW4")   /* c400 direct */
326   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
327   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
328   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
329   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
330   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
331   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
332   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
333   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
334   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
335   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
336   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
338   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
339   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
340   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
341   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
342   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
343   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
344   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
345   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
346   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
347   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
348   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
349   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
350INPUT_PORTS_END
351
352
353/*************************************
354*          Graphics Layouts          *
355*************************************/
356
357static const gfx_layout slotcarntiles8x8x3_layout =
358{
359   8,8,
360   RGN_FRAC(1,3),
361   3,
362   { RGN_FRAC(0,3),RGN_FRAC(1,3),RGN_FRAC(2,3) },
363   { 0, 1, 2, 3, 4, 5, 6, 7 },
364   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
365   16*8 // the flipped tiles are mixed with normal tiles, so skip a tile each time
366};
367
368static const gfx_layout slotcarntiles8x8x1_layout =
369{
370   8,8,
371   RGN_FRAC(1,1),
372   1,
373   { 0 },
374   { 0, 1, 2, 3, 4, 5, 6, 7 },
375   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
376   16*8 // the flipped tiles are mixed with normal tiles, so skip a tile each time
377};
378
379
380/************************************
381*          Graphics Decode          *
382************************************/
383
384static GFXDECODE_START( slotcarn )
385   GFXDECODE_ENTRY( "gfx1", 0, slotcarntiles8x8x3_layout, 0, 16 )
386   GFXDECODE_ENTRY( "gfx1", 8, slotcarntiles8x8x3_layout, 0, 16 ) // flipped
387   GFXDECODE_ENTRY( "gfx2", 0, slotcarntiles8x8x1_layout, 0, 4 )
388   GFXDECODE_ENTRY( "gfx2", 8, slotcarntiles8x8x1_layout, 0, 4 ) // flipped
389GFXDECODE_END
390
391
392
393static VIDEO_UPDATE( slotcarn )
394{
395   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, "crtc");
396   mc6845_update(mc6845, bitmap, cliprect);
397
398   return 0;
399}
400
401
402static MACHINE_START(merit)
403{
404   ram_palette = auto_malloc(RAM_PALETTE_SIZE);
405   state_save_register_global_pointer(machine, ram_palette, RAM_PALETTE_SIZE);
406}
407
408
409/***************************************
410*       PPI 8255 (x3) Interfaces       *
411***************************************/
412
413static const ppi8255_interface scarn_ppi8255_intf[3] =
414{
415   {   /* A, B & C set as input */
416      DEVICE8_PORT("IN0"),   /* Port A read */
417      DEVICE8_PORT("IN1"),   /* Port B read */
418      DEVICE8_PORT("IN2"),   /* Port C read */
419      NULL,               /* Port A write */
420      NULL,               /* Port B write */
421      NULL               /* Port C write */
422   },
423   {   /* A set as input */
424      DEVICE8_PORT("DSW1"),   /* Port A read */
425      NULL,               /* Port B read */
426      NULL,               /* Port C read */
427      NULL,               /* Port A write */
428      NULL,               /* Port B write */
429      NULL               /* Port C write */
430   },
431   {   /* A & B set as input */
432      DEVICE8_PORT("IN3"),   /* Port A read */
433      DEVICE8_PORT("IN4"),   /* Port B read */
434      NULL,               /* Port C read */
435      NULL,               /* Port A write */
436      NULL,               /* Port B write */
437      NULL               /* Port C write */
438   }
439};
440
441
442/*************************************
443*          AY8910 Interface          *
444*************************************/
445
446static const ay8910_interface scarn_ay8910_config =
447{
448   AY8910_LEGACY_OUTPUT,
449   AY8910_DEFAULT_LOADS,
450   NULL,
451   input_port_6_r,   /* DSW2 */
452   NULL,
453   NULL
454};
455
456
457/***********************************
458*          Machine Driver          *
459***********************************/
460
461static MACHINE_DRIVER_START( slotcarn )
462
463   /* basic machine hardware */
464   MDRV_CPU_ADD("main", Z80, CPU_CLOCK) // 2.5 Mhz?
465   MDRV_CPU_PROGRAM_MAP(slotcarn_map,0)
466   //MDRV_CPU_IO_MAP(goldstar_readport,0)
467   //MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
468
469   /* 3x 8255 */
470   MDRV_PPI8255_ADD( "ppi8255_0", scarn_ppi8255_intf[0] )
471   MDRV_PPI8255_ADD( "ppi8255_1", scarn_ppi8255_intf[1] )
472   MDRV_PPI8255_ADD( "ppi8255_2", scarn_ppi8255_intf[2] )
473
474   MDRV_MACHINE_START(merit)
475
476   /* video hardware */
477   MDRV_SCREEN_ADD("main", RASTER)
478   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
479   MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 512, 0, 512, 256, 0, 256)   /* temporary, CRTC will configure screen */
480
481   MDRV_MC6845_ADD("crtc", MC6845, CRTC_CLOCK, mc6845_intf)
482
483   MDRV_GFXDECODE(slotcarn)
484   MDRV_PALETTE_LENGTH(0x400)
485   MDRV_VIDEO_UPDATE(slotcarn)
486
487   /* sound hardware */
488   MDRV_SPEAKER_STANDARD_MONO("mono")
489
490   MDRV_SOUND_ADD("ay",AY8910, SND_CLOCK)
491   MDRV_SOUND_CONFIG(scarn_ay8910_config)
492   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
493MACHINE_DRIVER_END
494
495
496/******************************
497*          ROMs Load          *
498******************************/
499/*
500
501Slot Carnival (c) WING 1985
502
503roms 1 - 3 M5L2764K
504roms 4 - 7 HN4827128G-30
505proms 1 X MB7051
506
507xtal 1 x 10mhz
508
509cpus
510
5111 x NEC D780C-1  (Z80)
5123 x NEC  D8255AC-5
5131 x AY-3-8910 (SOUND)
5141 X HD46505SP-1  (VIDEO?)
515
516ram
517
5182x 2114
5193x 58725
5201x 6116
521
522sound amp
523
524HA1366W
525
526(has 23 pots for volume)
527
5284 banks of dipswitches 8 switches each
529set to
530
531- off + on
532
533bank1
534++------
535bank2
536+---++++
537bank3
538-+------
539bank4
540------++
541
542board has a ton is transistors on it presumably for driving the coin hopper?
543and a battery 3.5v 50ma
544
545rom3 has mention of coin hopper and coin jam.
546
547*/
548
549ROM_START( slotcarn )
550   ROM_REGION( 0x20000, "main", 0 )
551   ROM_LOAD( "rom1.e10", 0x0000, 0x2000, CRC(a7ea6420) SHA1(4dd88f1bcaf354da93c3e88979a5e1a026105598) )
552   ROM_LOAD( "rom2.e9",  0x2000, 0x2000, CRC(8156a603) SHA1(92618ac2ac908d24adb75eb705dc2f84eef12211) )
553   ROM_LOAD( "rom3.e8",  0x4000, 0x2000, CRC(bf74ccad) SHA1(7f5049693de236790671b16dd1e1d0d2ac120e1a) )
554
555   ROM_REGION( 0xc000, "gfx1", 0 )
556   ROM_LOAD( "rom5.a4", 0x0000, 0x4000, CRC(99235fc7) SHA1(e93be11ee139f0845272a63ef2d50962e85e155a) )
557   ROM_LOAD( "rom6.a3", 0x4000, 0x4000, CRC(2a86ce1f) SHA1(6dadbed41ae4b6e6e9efdb3a9d9d1f52dc76fe13) )
558   ROM_LOAD( "rom7.a2", 0x8000, 0x4000, CRC(c8196687) SHA1(68233c3f039a01e4e25113c929f6a1b8d60af177) )
559
560   ROM_REGION( 0x04000, "gfx2", 0 ) // 1bpp (both halves identical)
561   ROM_LOAD( "rom4.a5", 0x0000, 0x4000, CRC(1428c46c) SHA1(ea30eeebcc2cc825f33e1ffeb590b047e3072b9c) )
562ROM_END
563
564
565/*********************************************
566*                Game Drivers                *
567**********************************************
568
569      YEAR  NAME      PARENT   MACHINE   INPUT     INIT   ROT    COMPANY        FULLNAME        FLAGS  */
570GAME( 1985, slotcarn, 0,       slotcarn, slotcarn, 0,     ROT0, "Wing Co.Ltd", "Slot Carnival", GAME_NOT_WORKING )
571
src/mame/drivers/bingoc.c
r0r4058
1/*******************************************************************************************
2
3Bingo Circus (c) 1989 Sega
4
5A Bingo machine with a terminal for each player,maximum 8 players can play together.
6
7preliminary driver by David Haywood & Angelo Salese
8
9TODO:
10-terminal pcb(s) roms aren't dumped,so no video can be shown,a cabinet snap is here ->
11 http://www.system16.com/hardware.php?id=840&page=1#2743 ,every player should have his own
12 screen.
13-inconsistant (likely wrong) sound banking.
14
15============================================================================================
16BINGO CIRCUS (MAIN PCB)
17(c)SEGA
18
19CPU   : MAIN 68000 SOUND Z-80
20SOUND : YM2151 uPD7759C
21
2212635A.EPR  ; MAIN PROGRAM
2312636A.EPR  ;  /
2412637.EPR   ; VOICE DATA
2512638.EPR   ;  /
2612639.EPR   ; SOUND PRG
27
28*******************************************************************************************/
29
30#include "driver.h"
31#include "cpu/m68000/m68000.h"
32#include "cpu/z80/z80.h"
33#include "sound/2151intf.h"
34#include "sound/upd7759.h"
35
36#define SOUND_TEST 0
37
38VIDEO_START(bingoc)
39{
40
41}
42
43VIDEO_UPDATE(bingoc)
44{
45   return 0;
46}
47
48static READ16_HANDLER( bingoc_rand_r )
49{
50   return 0xffff;
51}
52
53#if SOUND_TEST
54/*dirty code to test z80 + bgm/sfx*/
55/*
560x00-0x7f controls u7759 samples (command 0xff->n)
570x80-0x85 ym2151 bgm
580x90-0x9b ym2151 sfx
59*/
60static READ8_HANDLER( sound_test_r )
61{
62   static UINT8 x;
63
64   if(input_code_pressed_once(KEYCODE_Z))
65      x++;
66
67   if(input_code_pressed_once(KEYCODE_X))
68      x--;
69
70   if(input_code_pressed_once(KEYCODE_A))
71      return 0xff;
72
73   popmessage("%02x",x);
74   return x;
75}
76#else
77static WRITE16_HANDLER( main_sound_latch_w )
78{
79   soundlatch_w(space,0,data&0xff);
80   cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE);
81}
82#endif
83
84static WRITE8_HANDLER( bingoc_play_w )
85{
86   /*
87    ---- --x- sound rom banking
88    ---- ---x start-stop sample
89    */
90   UINT8 *upd = memory_region(space->machine, "upd");
91   memcpy(&upd[0x00000], &upd[0x20000 + (((data & 2)>>1) * 0x20000)], 0x20000);
92   upd7759_start_w(0, data & 1);
93//  printf("%02x\n",data);
94}
95
96static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
97   AM_RANGE(0x000000, 0x03ffff) AM_ROM
98   AM_RANGE(0x100000, 0x10007f) AM_READ(bingoc_rand_r) //comms? lamps?
99   AM_RANGE(0x180000, 0x18007f) AM_READ(bingoc_rand_r) //comms? lamps?
100#if !SOUND_TEST
101   AM_RANGE(0x180010, 0x180011) AM_WRITE(main_sound_latch_w) //WRONG there...
102#endif
103   AM_RANGE(0xff8000, 0xffffff) AM_RAM
104ADDRESS_MAP_END
105
106static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
107   AM_RANGE(0x0000, 0x4fff) AM_ROM
108   AM_RANGE(0xf800, 0xffff) AM_RAM
109ADDRESS_MAP_END
110
111static ADDRESS_MAP_START( sound_io, ADDRESS_SPACE_IO, 8 )
112   ADDRESS_MAP_GLOBAL_MASK(0xff)
113   AM_RANGE(0x00, 0x00) AM_WRITE(ym2151_register_port_0_w)
114   AM_RANGE(0x01, 0x01) AM_READWRITE(ym2151_status_port_0_r, ym2151_data_port_0_w)
115   AM_RANGE(0x40, 0x40) AM_WRITE(bingoc_play_w)
116   AM_RANGE(0x80, 0x80) AM_WRITE(upd7759_0_port_w)
117#if !SOUND_TEST
118   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r) //soundlatch
119#else
120   AM_RANGE(0xc0, 0xc0) AM_READ(sound_test_r)
121#endif
122ADDRESS_MAP_END
123
124
125static INPUT_PORTS_START( bingoc )
126INPUT_PORTS_END
127
128
129static MACHINE_DRIVER_START( bingoc )
130
131   MDRV_CPU_ADD("main", M68000,8000000)       /* ? MHz */
132   MDRV_CPU_PROGRAM_MAP(main_map,0)
133   MDRV_CPU_VBLANK_INT("main", irq2_line_hold)
134
135   MDRV_CPU_ADD("sound", Z80,4000000)       /* ? MHz */
136   MDRV_CPU_PROGRAM_MAP(sound_map,0)
137   MDRV_CPU_IO_MAP(sound_io,0)
138#if SOUND_TEST
139   MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)
140#endif
141
142   /* video hardware */
143   MDRV_SCREEN_ADD("main", RASTER)
144   MDRV_SCREEN_REFRESH_RATE(60)
145   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
146   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
147   MDRV_SCREEN_SIZE(512, 256)
148   MDRV_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
149
150   MDRV_PALETTE_LENGTH(0x100)
151
152   MDRV_VIDEO_START(bingoc)
153   MDRV_VIDEO_UPDATE(bingoc)
154
155   MDRV_SPEAKER_STANDARD_STEREO("left", "right") //might just be mono...
156
157   MDRV_SOUND_ADD("ym", YM2151, 7159160/2)
158   MDRV_SOUND_ROUTE(0, "left", 1.0)
159   MDRV_SOUND_ROUTE(1, "right", 1.0)
160
161   MDRV_SOUND_ADD("upd", UPD7759, UPD7759_STANDARD_CLOCK)
162   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "left", 1.0)
163   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "right", 1.0)
164MACHINE_DRIVER_END
165
166ROM_START( bingoc )
167   ROM_REGION( 0x40000, "main", 0 )
168   ROM_LOAD16_BYTE( "12636a.epr", 0x00000, 0x20000, CRC(ef8dccff) SHA1(9eb6e55e2000b252647fc748cbbeedf4f119aed7) )
169   ROM_LOAD16_BYTE( "12635a.epr", 0x00001, 0x20000, CRC(a94cd74e) SHA1(0c3e157a5ddf34f4f1a2d30b9758bf067896371c) )
170
171   ROM_REGION( 0x10000, "ter_1", 0 ) //just as a re-dump reminder,might be either one sub-board or eight of them...
172   ROM_LOAD( "terminal.rom", 0x00000, 0x10000, NO_DUMP )
173
174   ROM_REGION( 0x10000, "sound", 0 )
175   ROM_LOAD( "12639.epr", 0x00000, 0x10000, CRC(4307f6ba) SHA1(f568930191cd31a2112ef8d4cf5ff340826d5877) )
176
177   ROM_REGION( 0x60000, "upd", 0 )
178   ROM_LOAD( "12637.epr", 0x40000, 0x20000, CRC(164ac43f) SHA1(90160df8e927a25ea08badedb3fcd818c314b388) )
179   ROM_LOAD( "12638.epr", 0x20000, 0x20000, CRC(ef52ab73) SHA1(d14593ef88ac2acd00daaf522008405f65f67548) )
180   ROM_COPY( "upd",       0x20000, 0x00000, 0x20000 )
181ROM_END
182
183GAME( 1989, bingoc,  0,    bingoc, bingoc,  0, ROT0, "Sega", "Bingo Circus (Rev. A 891001)", GAME_NOT_WORKING )
184
src/mame/drivers/cubeqst.c
r4057r4058
128128      memset(depth_buffer, 0xff, 512);
129129
130130      /* Process all the spans on this scanline */
131      for (i = 0; i < num_entries; i += 2)
131      if (y < 256)
132132      {
133         int color = 0, depth = 0;
134         int h1 = 0, h2 = 0;
135         int x;
133         for (i = 0; i < num_entries; i += 2)
134         {
135            int color = 0, depth = 0;
136            int h1 = 0, h2 = 0;
137            int x;
136138
137         int entry1 = stk_ram[(y << 7) | ((i + 0) & 0x7f)];
138         int entry2 = stk_ram[(y << 7) | ((i + 1) & 0x7f)];
139            int entry1 = stk_ram[(y << 7) | ((i + 0) & 0x7f)];
140            int entry2 = stk_ram[(y << 7) | ((i + 1) & 0x7f)];
139141
140         /* Determine which entry is the start point and which is the stop */
141         if ( entry1 & (1 << 19) )
142         {
143            h1 = (entry2 >> 8) & 0x1ff;
144            depth = entry2 & 0xff;
142            /* Determine which entry is the start point and which is the stop */
143            if ( entry1 & (1 << 19) )
144            {
145               h1 = (entry2 >> 8) & 0x1ff;
146               depth = entry2 & 0xff;
145147
146            h2 = (entry1 >> 8) & 0x1ff;
147            color = entry1 & 0xff;
148         }
149         else if ( entry2 & (1 << 19) )
150         {
151            h1 = (entry1 >> 8) & 0x1ff;
152            depth = entry1 & 0xff;
148               h2 = (entry1 >> 8) & 0x1ff;
149               color = entry1 & 0xff;
150            }
151            else if ( entry2 & (1 << 19) )
152            {
153               h1 = (entry1 >> 8) & 0x1ff;
154               depth = entry1 & 0xff;
153155
154            h2 = (entry2 >> 8) & 0x1ff;
155            color = entry2 & 0xff;
156         }
157         else
158         {
159            // Shouldn't happen...
160         }
156               h2 = (entry2 >> 8) & 0x1ff;
157               color = entry2 & 0xff;
158            }
159            else
160            {
161               // Shouldn't happen...
162            }
161163
162         /* Draw the span, testing for depth */
163         pen = colormap[paletteram16[color]];
164         for (x = h1; x <= h2; ++x)
165         {
166            if (!(depth_buffer[x] < depth))
164            /* Draw the span, testing for depth */
165            pen = colormap[paletteram16[color]];
166            for (x = h1; x <= h2; ++x)
167167            {
168               dest[x] = pen;
169               depth_buffer[x] = depth;
168               if (!(depth_buffer[x] < depth))
169               {
170                  dest[x] = pen;
171                  depth_buffer[x] = depth;
172               }
170173            }
171174         }
172175      }
src/mame/drivers/segas18.c
r4057r4058
9292
9393static const segaic16_memory_map_entry rom_171_shad_info[] =
9494{
95   { 0x3d/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,             misc_io_w,             NULL,                  "I/O space" },
96   { 0x39/2, 0x00000, 0x02000, 0xffe000,      ~0, SMH_BANK10,          segaic16_paletteram_w, &paletteram16,         "color RAM" },
97   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, SMH_BANK11,          segaic16_tileram_0_w,  &segaic16_tileram_0,   "tile RAM" },
98   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, SMH_BANK12,          segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
99   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, SMH_BANK13,          SMH_BANK13,          &segaic16_spriteram_0, "object RAM" },
100   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, SMH_BANK14,          SMH_BANK14,          &workram,              "work RAM" },
101   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,                  NULL,                  NULL,                  "????" },
102   { 0x25/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,         genesis_vdp_w,         NULL,                  "VDP" },
103   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK17,          SMH_UNMAP,           NULL,                  "ROM 0" },
95   { 0x3d/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,      misc_io_w,             NULL,                  "I/O space" },
96   { 0x39/2, 0x00000, 0x02000, 0xffe000,      ~0, SMH_BANK10,     segaic16_paletteram_w, &paletteram16,         "color RAM" },
97   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, SMH_BANK11,     segaic16_tileram_0_w,  &segaic16_tileram_0,   "tile RAM" },
98   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, SMH_BANK12,     segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
99   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, SMH_BANK13,     SMH_BANK13,            &segaic16_spriteram_0, "object RAM" },
100   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, SMH_BANK14,     SMH_BANK14,            &workram,              "work RAM" },
101   { 0x29/2, 0x00000, 0x10000, 0xff0000,      ~0, NULL,           NULL,                  NULL,                  "????" },
102   { 0x25/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,  genesis_vdp_w,         NULL,                  "VDP" },
103   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK17,     SMH_UNMAP,             NULL,                  "ROM 0" },
104104   { 0 }
105105};
106106
107107static const segaic16_memory_map_entry rom_171_5874_info[] =
108108{
109   { 0x3d/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,             misc_io_w,             NULL,                  "I/O space" },
110   { 0x39/2, 0x00000, 0x02000, 0xffe000,      ~0, SMH_BANK10,          segaic16_paletteram_w, &paletteram16,         "color RAM" },
111   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, SMH_BANK11,          segaic16_tileram_0_w,  &segaic16_tileram_0,   "tile RAM" },
112   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, SMH_BANK12,          segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
113   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, SMH_BANK13,          SMH_BANK13,          &segaic16_spriteram_0, "object RAM" },
114   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, SMH_BANK14,          SMH_BANK14,          &workram,              "work RAM" },
115   { 0x29/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,         genesis_vdp_w,         NULL,                  "VDP" },
116   { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, SMH_BANK16,          SMH_UNMAP,           NULL,                  "ROM 1" },
117   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK17,          SMH_UNMAP,           NULL,                  "ROM 0" },
109   { 0x3d/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,      misc_io_w,             NULL,                  "I/O space" },
110   { 0x39/2, 0x00000, 0x02000, 0xffe000,      ~0, SMH_BANK10,     segaic16_paletteram_w, &paletteram16,         "color RAM" },
111   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, SMH_BANK11,     segaic16_tileram_0_w,  &segaic16_tileram_0,   "tile RAM" },
112   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, SMH_BANK12,     segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
113   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, SMH_BANK13,     SMH_BANK13,            &segaic16_spriteram_0, "object RAM" },
114   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, SMH_BANK14,     SMH_BANK14,            &workram,              "work RAM" },
115   { 0x29/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,  genesis_vdp_w,         NULL,                  "VDP" },
116   { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, SMH_BANK16,     SMH_UNMAP,             NULL,                  "ROM 1" },
117   { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK17,     SMH_UNMAP,             NULL,                  "ROM 0" },
118118   { 0 }
119119};
120120
121121static const segaic16_memory_map_entry rom_171_5987_info[] =
122122{
123   { 0x3d/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,             misc_io_w,             NULL,                  "I/O space" },
124   { 0x39/2, 0x00000, 0x02000, 0xffe000,      ~0, SMH_BANK10,          segaic16_paletteram_w, &paletteram16,         "color RAM" },
125   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, SMH_BANK11,          segaic16_tileram_0_w,  &segaic16_tileram_0,   "tile RAM" },
126   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, SMH_BANK12,          segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
127   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, SMH_BANK13,          SMH_BANK13,          &segaic16_spriteram_0, "object RAM" },
128   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, SMH_BANK14,          SMH_BANK14,          &workram,              "work RAM" },
129   { 0x29/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,         genesis_vdp_w,         NULL,                  "VDP" },
130   { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, SMH_BANK16,          rom_5987_bank_w,       NULL,                  "ROM 1/banking" },
131   { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, SMH_BANK17,          SMH_UNMAP,           NULL,                  "ROM 0" },
123   { 0x3d/2, 0x00000, 0x04000, 0xffc000,      ~0, misc_io_r,      misc_io_w,             NULL,                  "I/O space" },
124   { 0x39/2, 0x00000, 0x02000, 0xffe000,      ~0, SMH_BANK10,     segaic16_paletteram_w, &paletteram16,         "color RAM" },
125   { 0x35/2, 0x00000, 0x10000, 0xfe0000,      ~0, SMH_BANK11,     segaic16_tileram_0_w,  &segaic16_tileram_0,   "tile RAM" },
126   { 0x35/2, 0x10000, 0x01000, 0xfef000,      ~0, SMH_BANK12,     segaic16_textram_0_w,  &segaic16_textram_0,   "text RAM" },
127   { 0x31/2, 0x00000, 0x00800, 0xfff800,      ~0, SMH_BANK13,     SMH_BANK13,            &segaic16_spriteram_0, "object RAM" },
128   { 0x2d/2, 0x00000, 0x04000, 0xffc000,      ~0, SMH_BANK14,     SMH_BANK14,            &workram,              "work RAM" },
129   { 0x29/2, 0x00000, 0x00010, 0xfffff0,      ~0, genesis_vdp_r,  genesis_vdp_w,         NULL,                  "VDP" },
130   { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, SMH_BANK16,     rom_5987_bank_w,       NULL,                  "ROM 1/banking" },
131   { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, SMH_BANK17,     SMH_UNMAP,             NULL,                  "ROM 0" },
132132   { 0 }
133133};
134134
r4057r4058
561561static WRITE8_HANDLER( mcu_data_w )
562562{
563563   mcu_data = data;
564   cpu_set_input_line(space->machine->cpu[2], 1, PULSE_LINE);
564   cpu_set_input_line(space->machine->cpu[2], MCS51_INT1_LINE, HOLD_LINE);
565565}
566566
567567
r4057r4058
13111311
13121312   MDRV_CPU_ADD("mcu", I8751, 8000000)
13131313   MDRV_CPU_IO_MAP(mcu_io_map,0)
1314   MDRV_CPU_VBLANK_INT("main", irq0_line_pulse)
1314   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
13151315MACHINE_DRIVER_END
13161316
13171317
src/mame/drivers/astrocorp.c
r4057r4058
167167   );
168168}
169169
170static ADDRESS_MAP_START( astrocorp_map, ADDRESS_SPACE_PROGRAM, 16 )
170static ADDRESS_MAP_START( showhand_map, ADDRESS_SPACE_PROGRAM, 16 )
171171   AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
172172   AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_BASE( &spriteram16 ) AM_SIZE( &spriteram_size )
173173   AM_RANGE( 0x052000, 0x052001 ) AM_WRITE( SMH_NOP )
r4057r4058
182182   AM_RANGE( 0x0d0000, 0x0d0001 ) AM_READWRITE( astrocorp_unk_r, okim6295_data_0_msb_w )
183183ADDRESS_MAP_END
184184
185static ADDRESS_MAP_START( showhanc_map, ADDRESS_SPACE_PROGRAM, 16 )
186   AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
187   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE( astrocorp_palette_w ) AM_BASE( &paletteram16 )
188   AM_RANGE( 0x070000, 0x070001 ) AM_WRITE( astrocorp_sound_bank_w )
189   AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_BASE( &spriteram16 ) AM_SIZE( &spriteram_size )
190   AM_RANGE( 0x082000, 0x082001 ) AM_WRITE( SMH_NOP )
191   AM_RANGE( 0x084000, 0x084001 ) AM_READ_PORT( "INPUTS" )
192   AM_RANGE( 0x088000, 0x088001 ) AM_WRITE( astrocorp_eeprom_w )
193   AM_RANGE( 0x08a000, 0x08a001 ) AM_WRITE( astrocorp_outputs_w )
194   AM_RANGE( 0x08e000, 0x08e001 ) AM_READ( astrocorp_eeprom_r )
195   AM_RANGE( 0x090000, 0x093fff ) AM_RAM
196   AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE( astrocorp_enable_w )
197   AM_RANGE( 0x0e0000, 0x0e0001 ) AM_READWRITE( astrocorp_unk_r, okim6295_data_0_msb_w )
198ADDRESS_MAP_END
185199
186200/***************************************************************************
187201                                Input Ports
r4057r4058
190204static INPUT_PORTS_START( showhand )
191205   PORT_START("INPUTS")   // 54000
192206   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1     )   PORT_IMPULSE(1)   // coin
193   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON3   )   PORT_NAME("Payout")   PORT_CODE(KEYCODE_F1) // payout (must be 0 on startup)
207   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON5   )   PORT_NAME("Payout")   PORT_CODE(KEYCODE_F1) // payout (must be 0 on startup)
194208   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // ?
195209   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START2    )   PORT_NAME("Bet / Double")
196210   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_BUTTON3   )   PORT_NAME("Look / Small")
r4057r4058
198212   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // ?
199213   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_SPECIAL   )   // coin sensor
200214   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_BUTTON2   )   PORT_NAME("Yes / Big")
201   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_UNKNOWN   )   // hold1?
215   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_BUTTON4   )   PORT_NAME("Hold1")   // HOLD1 in test mode
202216   PORT_BIT( 0x0400, IP_ACTIVE_LOW,  IPT_BUTTON1   )   PORT_NAME("Select")
203217   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_START1    )   PORT_NAME("Start / Take")
204218   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SERVICE1  )   PORT_NAME("Reset Settings")   // when 1 in test mode: reset settings (must be 0 on startup)
r4057r4058
207221   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_SPECIAL   )   // coin sensor
208222INPUT_PORTS_END
209223
224static INPUT_PORTS_START( showhanc )
225   PORT_START("INPUTS")   // 84000
226   PORT_BIT( 0x0001, IP_ACTIVE_LOW,  IPT_COIN1     )   PORT_IMPULSE(1)   // coin
227   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON5   )   PORT_NAME("Payout")   PORT_CODE(KEYCODE_F1) // payout (must be 0 on startup)
228   PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
229   PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_START2    )   PORT_NAME("Bet / Double")
230   PORT_BIT( 0x0010, IP_ACTIVE_LOW,  IPT_BUTTON1   )   PORT_NAME("Select")
231   PORT_SERVICE_NO_TOGGLE( 0x0020,   IP_ACTIVE_LOW )   // settings
232   PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
233   PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_START1    )   PORT_NAME("Start / Take")   // HOLD1 in test mode
234   PORT_BIT( 0x0100, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
235   PORT_BIT( 0x0200, IP_ACTIVE_LOW,  IPT_BUTTON3   )   PORT_NAME("Look / Small / Exit")   // HOLD5 in test mode
236   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON4   )   PORT_NAME("Hold2")   // HOLD2 in test mode
237   PORT_BIT( 0x0800, IP_ACTIVE_LOW,  IPT_BUTTON2   )   PORT_NAME("Yes / Big")   // HOLD4 in test mode
238   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_SERVICE1  )   PORT_NAME("Reset Settings")   // when 1 in test mode: reset settings (must be 0 on startup)
239   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_SPECIAL   )   // must be 0 for inputs to work
240   PORT_BIT( 0x4000, IP_ACTIVE_LOW,  IPT_COIN2     )   PORT_IMPULSE(1)   // key in (shows an error)
241   PORT_BIT( 0x8000, IP_ACTIVE_LOW,  IPT_UNKNOWN   )
242INPUT_PORTS_END
210243
211244/***************************************************************************
212245                                Graphics Layout
r4057r4058
224257};
225258
226259static GFXDECODE_START( astrocorp )
227   GFXDECODE_ENTRY("gfx1", 0, layout_16x16x8, 0, 1)
260   GFXDECODE_ENTRY("sprites", 0, layout_16x16x8, 0, 1)
228261GFXDECODE_END
229262
230263
r4057r4058
251284   }
252285}
253286
254static MACHINE_DRIVER_START( astrocorp )
287static MACHINE_DRIVER_START( showhand )
255288   /* basic machine hardware */
256   MDRV_CPU_ADD("main", M68000, XTAL_25_601712MHz / 2)
257   MDRV_CPU_PROGRAM_MAP(astrocorp_map,0)
289   MDRV_CPU_ADD("main", M68000, XTAL_20MHz / 2)
290   MDRV_CPU_PROGRAM_MAP(showhand_map,0)
258291   MDRV_CPU_VBLANK_INT("main", irq4_line_hold)
259292
260293   MDRV_NVRAM_HANDLER(showhand)
261294
262295   /* video hardware */
263296   MDRV_SCREEN_ADD("main", RASTER)
264   MDRV_SCREEN_REFRESH_RATE(60)
297   MDRV_SCREEN_REFRESH_RATE(58.846)   // measured on pcb
265298   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
266299   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
267300   MDRV_SCREEN_SIZE(320, 240)
r4057r4058
275308   /* sound hardware */
276309   MDRV_SPEAKER_STANDARD_MONO("mono")
277310
278   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_20MHz/16)
279   MDRV_SOUND_CONFIG(okim6295_interface_pin7low)
311   MDRV_SOUND_ADD("oki", OKIM6295, XTAL_20MHz/20)
312   MDRV_SOUND_CONFIG(okim6295_interface_pin7high)
280313   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
281314MACHINE_DRIVER_END
282315
283316
317static MACHINE_DRIVER_START( showhanc )
318   MDRV_IMPORT_FROM( showhand )
319   MDRV_CPU_MODIFY("main")
320   MDRV_CPU_PROGRAM_MAP(showhanc_map,0)
321MACHINE_DRIVER_END
322
323
284324/***************************************************************************
285325                                ROMs Loading
286326***************************************************************************/
r4057r4058
321361   ROM_LOAD16_BYTE( "1-8.even.u16", 0x00000, 0x10000, CRC(cf34bf0d) SHA1(72ad7ca63ef89451b2572d64cccfa764b9d9b353) )
322362   ROM_LOAD16_BYTE( "2-8.odd.u17",  0x00001, 0x10000, CRC(dd031c36) SHA1(198d0e685dd2d824a04c787f8a17c173efa272d9) )
323363
324   ROM_REGION( 0x200000, "gfx1", 0 )
364   ROM_REGION( 0x200000, "sprites", ROMREGION_DISPOSE )
325365   ROM_LOAD16_BYTE( "4.even.u26", 0x000000, 0x100000, CRC(8a706e42) SHA1(989688ee3a5e4fc11fb502e43c9d6012488982ee) )
326366   ROM_LOAD16_BYTE( "3.odd.u26",  0x000001, 0x100000, CRC(a624b750) SHA1(fc5b09f8a10cba5fb2474e1edd62a0400177a5ad) )
327367
r4057r4058
329369   ROM_LOAD( "5", 0x00000, 0x80000, CRC(e6987122) SHA1(fb3e7c2399057c64b5c496a393f6f22a1e54c844) )
330370ROM_END
331371
372/***************************************************************************
373
374Show Hand
375Astro Corp, 199?
376
377PCB Layout
378----------
379CHE-B50-4002A
380|----------------------------------------|
381|     LATTICE    JAMMA   SW   VOL UPC1242|
382|     PLSI1016           U26             |
383|                6264                 U43|
384|                        U25    M6295    |
385|     68000                              |
386|                U17    |-----|          |
387|                       |ASTRO|          |
388|                U16    |V01  |          |
389|                       |-----|MDT2020AP/3V
390|                6264           20MHz    |
391|DSW(2)                      26.601712MHz|
392|93C46           6116  6116    KM681000  |
393|BATTERY         6116  6116    KM681000  |
394|----------------------------------------|
395Notes:
396      68000 clock - 10.000MHz [20/2]
397      M6295 clock - 1.000MHz [20/20], pin 7 HIGH
398      VSync - 58.846Hz
399      HSync - 15.354kHz
400
401Hardware info by Guru
402
403***************************************************************************/
404
405ROM_START( showhanc )
406   ROM_REGION( 0x20000, "main", 0 )
407   ROM_LOAD16_BYTE( "1even.u16", 0x00000, 0x10000, CRC(d1295bdb) SHA1(bb035ee89b21368fb11c3b9cd23164b68feb84bd) )
408   ROM_LOAD16_BYTE( "2odd.u17",  0x00001, 0x10000, CRC(bbca78e7) SHA1(a163569acad8d6b8821602ce24013fc46887aba9) )
409
410   ROM_REGION( 0x200000, "sprites", ROMREGION_DISPOSE )
411   ROM_LOAD16_BYTE( "4even.u26", 0x00000, 0x100000, CRC(285375e0) SHA1(63b47105f0751c65e528139074f5b342450495ba) )
412   ROM_LOAD16_BYTE( "3odd.u25",  0x00001, 0x100000, CRC(b93e3a91) SHA1(5192375c32518532e08bddfe000efdee587e1ecc) )
413
414   ROM_REGION( 0x80000, "oki", 0 )
415   ROM_LOAD( "5.u43", 0x00000, 0x80000, CRC(d6b70f02) SHA1(5a94680594c1f06196fe3bcf7faf56e2ed576f01) )
416ROM_END
417
418
332419static DRIVER_INIT( showhand )
333420{
334/*
335    UINT16 *rom = (UINT16*)memory_region(machine, "main");
421#if 0
422   UINT16 *rom = (UINT16*)memory_region(machine, "main");
336423
337    rom[0x0a1a/2] = 0x6000; // hopper jam
424   rom[0x0a1a/2] = 0x6000;   // hopper jam
338425
339    rom[0x1494/2] = 0x4e71; // enable full test mode
426   rom[0x1494/2] = 0x4e71;   // enable full test mode
427   rom[0x1496/2] = 0x4e71;   // ""
428   rom[0x1498/2] = 0x4e71;   // ""
340429
341    rom[0x12f6/2] = 0x6000; // rom error
342    rom[0x4916/2] = 0x6000; // rom error
343*/
430   rom[0x12f6/2] = 0x6000;   // rom error
431   rom[0x4916/2] = 0x6000;   // rom error
432#endif
344433}
345434
346GAME( 1999?, showhand, 0, astrocorp, showhand, showhand, ROT0, "Astro Corp.", "Show Hand", 0 )
435static DRIVER_INIT( showhanc )
436{
437#if 0
438   UINT16 *rom = (UINT16*)memory_region(machine, "main");
439
440   rom[0x14d4/2] = 0x4e71;   // enable full test mode
441   rom[0x14d6/2] = 0x4e71;   // ""
442   rom[0x14d8/2] = 0x4e71;   // ""
443
444   rom[0x139c/2] = 0x6000;   // rom error
445#endif
446}
447
448GAME( 1999?, showhand, 0,        showhand, showhand, showhand, ROT0, "Astro Corp.", "Show Hand (Italy)", 0 )
449GAME( 1999?, showhanc, showhand, showhanc, showhanc, showhanc, ROT0, "Astro Corp.", "Wang Pai Dui Jue",  0 )
src/mame/drivers/royalmah.c
r4057r4058
333393  Mahjong Cafe Doll     D76052208L-2         TLCS-90  Dynax              Larger palette, RTC, Undumped internal rom
343495  Mahjong Tensinhai     D10010318L1          TLCS-90  Dynax              Larger palette, RTC
353596  Janputer '96                               Z80      Dynax              Larger palette, RTC
3699  Mahjong Cafe Break    NS528-9812           TLCS-90  Nakanihon / Dynax  Undumped internal rom
3637---------------------------------------------------------------------------------------------------------------------
3738
3839TODO:
r4057r4058
481482   AM_RANGE( 0x11, 0x11 ) AM_READ_PORT("SYSTEM") AM_WRITE( input_port_select_w )
482483ADDRESS_MAP_END
483484
485
486static ADDRESS_MAP_START( janho_map, ADDRESS_SPACE_PROGRAM, 8 )
487   AM_RANGE( 0x0000, 0x6fff ) AM_READWRITE( SMH_ROM, royalmah_rom_w )
488   AM_RANGE( 0x7000, 0x7fff ) AM_RAM AM_SHARE(1) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
489   AM_RANGE( 0x8000, 0xffff ) AM_WRITE( SMH_RAM ) AM_BASE(&videoram)
490ADDRESS_MAP_END
491
492
493/* this CPU makes little sense - what is it for? why so many addresses accessed?
494  -- it puts a value in shared ram to allow the main CPU to boot, then.. ?
495*/
496static ADDRESS_MAP_START( janoh_sub_map, ADDRESS_SPACE_PROGRAM, 8 )
497   AM_RANGE( 0x0000, 0x3fff ) AM_ROM
498   AM_RANGE( 0x4100, 0x413f ) AM_RAM
499   AM_RANGE( 0x6000, 0x607f ) AM_RAM
500   AM_RANGE( 0x7000, 0x7000 ) AM_READ(SMH_NOP)
501   AM_RANGE( 0x7200, 0x7200 ) AM_WRITE(SMH_NOP)
502   AM_RANGE( 0xf000, 0xffff ) AM_RAM AM_SHARE(1)
503ADDRESS_MAP_END
504
505static ADDRESS_MAP_START( janoh_sub_iomap, ADDRESS_SPACE_IO, 8 )
506ADDRESS_MAP_END
507
484508/****************************************************************************
485509                                Janputer '96
486510****************************************************************************/
r4057r4058
22442268   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
22452269MACHINE_DRIVER_END
22462270
2271
2272static MACHINE_DRIVER_START( janoh )
2273
2274   MDRV_IMPORT_FROM(royalmah)
2275   MDRV_CPU_REPLACE("main", Z80, 8000000/2)   /* 4 MHz ? */
2276   MDRV_CPU_PROGRAM_MAP(janho_map,0)
2277
2278   MDRV_CPU_ADD("sub", Z80, 4000000)        /* 4 MHz ? */
2279   MDRV_CPU_PROGRAM_MAP(janoh_sub_map,0)
2280   MDRV_CPU_IO_MAP(janoh_sub_iomap,0)
2281   MDRV_CPU_VBLANK_INT("main", irq0_line_hold)
2282MACHINE_DRIVER_END
2283
2284
22472285static MACHINE_DRIVER_START( dondenmj )
22482286   MDRV_IMPORT_FROM(royalmah)
22492287   MDRV_CPU_REPLACE("main", Z80, 8000000/2)   /* 4 MHz ? */
r4057r4058
31483186   ROM_LOAD( "janho.color", 0x00, 0x20, NO_DUMP )
31493187ROM_END
31503188
3189/***************************************************************************
31513190
3191Mahjong Cafe Break
3192Dynax/Nakanihon, 199?
3193
3194This game runs on Royal Mahjong hardware with a Nakanihon top board
3195
3196Top PCB Layout
3197--------------
3198
3199NS528-9812
3200|-------------------------|
3201|X  NS528A2               |
3202|   NS528B2  PLCC84 528011|
3203|RGB                 DIP32|
3204|          8MHz      DIP32|
3205|DSW4(10)                 |
3206|DSW3(10)   SDIP64  6264  |
3207|DSW2(10)                 |
3208|DSW1(10)           52802 |
3209|                 A3      |
3210|BATTERY     A1   A2  Y A4|
3211|-------------------------|
3212Notes:
3213      RGB 3  - wire cable tied to mainboard
3214      X      - DIP16 socket with flat cable plugged in coming from main board PROM socket
3215      PLCC84 - unknown PLCC84 in a socket
3216      DIP32  - unpopulated DIP32 socket
3217      SDIP64 - unknown CPU, probably TLCS-90 (TMP91640)
3218      A1     - unknown DIP8 IC, possibly MB3771 reset/watchdog chip
3219      A2/A3  - unknown DIP14 ICs, probably logic
3220      A4     - unknown DIP18 IC, RTC IC
3221      Y      - 32.768kHz OSC for RTC
3222
3223***************************************************************************/
3224ROM_START( cafebrk )
3225   ROM_REGION( 0x280000, "main", 0 )
3226   ROM_LOAD( "528.tmp91640", 0x000000, 0x004000, NO_DUMP )
3227   ROM_LOAD( "528011.1f",    0x000000, 0x080000, CRC(440ae60b) SHA1(c24efd76ba73adcb614b1974e8f92592800ba53c) )
3228   /* bank switched ROMs follow */
3229   ROM_LOAD( "52802.1d",     0x080000, 0x200000, CRC(bf4760fc) SHA1(d54ab9e298800a31d95a5f8b98ab9ba5b2866acf) )
3230
3231   ROM_REGION( 0x400, "proms", 0 )
3232   ROM_LOAD( "ns528b2.4h", 0x000, 0x200, CRC(5699e69a) SHA1(fe13b93dd2c4a16865b4edcb0fee1390fdade725) )
3233   ROM_LOAD( "ns528a2.4j", 0x200, 0x200, CRC(b5a3a569) SHA1(8e31c600ae24b672b614908ee920a333ed600941) )
3234ROM_END
3235
3236/*
3237
3238Janou
3239(c)1985 Toaplan (distributed by SNK)
3240
3241RM-1C (modified Royal Mahjong hardware)
3242
3243CPU: Z80x2 (on subboard)
3244Sound: AY-3-8910
3245OSC: 18.432MHz
3246
3247ROMs:
3248JO1
3249JO2
3250JO3
3251JO4
3252JO5
3253JO6
3254JO7
3255
3256
3257Subboard GX002A
3258C8 (2764)
325918S030.44
326018S030.45
3261
3262HM6116
3263MSM2128x4
3264
3265
3266dumped by sayu
3267
3268--- Team Japump!!! ---
3269http://japump.i.am/
3270
3271*/
3272
3273ROM_START( janoha )
3274   ROM_REGION( 0x10000, "main", 0 )
3275   ROM_LOAD( "jo1",       0x0000, 0x1000, CRC(1a7dd28d) SHA1(347085c2b305861e4a4a602c3b3b0c57889f7f45) )
3276   ROM_LOAD( "jo2",       0x1000, 0x1000, CRC(e92ca79f) SHA1(9714ebee954dd98cf98b340e1dc424a4b2a78c36) )
3277   ROM_LOAD( "jo3",       0x2000, 0x1000, CRC(8e349cac) SHA1(27442fc97750ceb6e928682ee545a9ebff4511ac) )
3278   ROM_LOAD( "jo4",       0x3000, 0x1000, CRC(f2bcac9a) SHA1(46eea014edf9f260b35b5f9bd0fd0a0236da16ef) )
3279   ROM_LOAD( "jo5",       0x4000, 0x1000, CRC(16c09c73) SHA1(ea712f9ca3200ca27434e4200187b488e24f4c65) )
3280   ROM_LOAD( "jo6",       0x5000, 0x1000, CRC(92687327) SHA1(4fafba5881dca2a147616d94dd055eba6aa3c653) )
3281   ROM_LOAD( "jo7",       0x6000, 0x1000, CRC(f9a3fea6) SHA1(898c030b34f7432568e080e2814619d836d98a2f) )
3282
3283   ROM_REGION( 0x10000, "sub", 0 )
3284   ROM_LOAD( "c8",       0x0000, 0x2000, CRC(a37ed493) SHA1(a3246c635ee77f96afd96285ef7091f6fc0d7636) )
3285
3286   ROM_REGION( 0x0040, "proms", 0 )
3287   ROM_LOAD( "18s030.45",  0x0000, 0x0020, CRC(c6a24ae9) SHA1(ec7a4dee2fec2f7151ddc39e40a3eee6a1c4992d) )
3288   ROM_LOAD( "18s030.44",  0x0020, 0x0020, CRC(d4eabf78) SHA1(f14778b552ff483e36e7c30ee67e8e2075790ea2) )
3289ROM_END
3290
3291/*
3292
3293Mahjong Shiyou (BET type)
3294(c)1986 Visco
3295
3296Board:  S-0086-001-00
3297CPU:    Z80-A x2
3298Sound:  AY-3-8910
3299        M5205
3300OSC:    18.432MHz
3301        400KHz
3302
3303
33041.1K       Z80#2 prg.
33052.1G
3306
33073.3G       Z80#1 prg.
33084.3F
3309
3310COLOR.BPR  color
3311
3312*/
3313
3314ROM_START( mjsiyoub )
3315   ROM_REGION( 0x10000, "main", 0 )
3316   ROM_LOAD( "3.3g", 0x00000, 0x8000, CRC(47d0f16e) SHA1(a125be052668ba93756bf940af31a10e91a3d307) )
3317   ROM_LOAD( "4.3f", 0x08000, 0x8000, CRC(6cd6a200) SHA1(1c53e5caacdb9c660bd98f5331bf5354581f74c9) )
3318
3319   /*encrypted z80*/
3320   ROM_REGION( 0x10000, "sub", 0 )
3321   ROM_LOAD( "1.1k", 0x00000, 0x8000, CRC(a1083321) SHA1(b36772e90be60270234df16cf92d87f8d950190d) )
3322   ROM_LOAD( "2.1g", 0x08000, 0x4000, CRC(cfe5de1d) SHA1(4acf9a752aa3c02b0889b0b49d3744359fa24460) )
3323
3324   ROM_REGION( 0x40000, "proms", 0 )
3325   ROM_LOAD( "color.bpr", 0x00, 0x20,  CRC(d21367e5) SHA1(b28321ac8f99abfebe2ef4da0c751cefe9f3f3b6) )
3326ROM_END
3327
3328/*
3329
3330Mahjong Senka
3331(c)1986 Visco
3332
3333Modified Royal Mahjong Hardware
3334
3335CPU: Z80 <- wrong,they are 2 z80 CPUs -AS
3336Sound: AY-3-8910
3337OSC: 18.432MHz
3338Others: Battery
3339
3340ROMs:
33411
33422
33433
33444
33451.2L (N82S129N)
33462.2K (N82S123N)
33473.1D (N82S129N)
33484.8K (N82S123N) - color PROM
3349
3350
3351dumped by sayu
3352
3353--- Team Japump!!! ---
3354http://japump.i.am/
3355
3356*/
3357
3358ROM_START( mjsenka )
3359   ROM_REGION( 0x10000, "main", 0 )
3360   ROM_LOAD( "3",       0x0000, 0x4000, CRC(b2d8be1f) SHA1(da75e1072d271de2dbd897a551f6c32593f6421b) )
3361   ROM_LOAD( "4",       0x4000, 0x2000, CRC(e9e84999) SHA1(7b5f0edd92cf3a45e85055460e6cb00b154fd152) )
3362   ROM_LOAD( "2",       0x6000, 0x2000, CRC(cdb02fc5) SHA1(5de6b15b79ea7c4246a294b17f166e53be6a4abc) )
3363
3364   /*encrypted z80*/
3365   ROM_REGION( 0x10000, "sub", 0 )
3366   ROM_LOAD( "1",       0x0000, 0x2000, CRC(83e943d1) SHA1(c4f9b5036627ccb369e7db03a743e496b149af85) )
3367
3368   ROM_REGION( 0x0040, "proms", 0 )
3369   ROM_LOAD( "4.8k",  0x0000, 0x0020, CRC(41bd4d69) SHA1(4d2da761b338b62b2ea151c201063a24d6e4cc97) )
3370   ROM_LOAD( "2.2k",  0x0020, 0x0020, CRC(46014727) SHA1(eec451f292ee319fa6bfbbf223aaa12b231692c1) )
3371
3372   ROM_REGION( 0x0200, "user1", 0 ) //?
3373   ROM_LOAD( "1.2l",  0x0000, 0x0100, CRC(24599429) SHA1(6c93bb2e7bc9902cace0c9d482fc1584c4c1a114) )
3374   ROM_LOAD( "3.1d",  0x0100, 0x0100, CRC(86aeafd1) SHA1(c4e5c56ce5baf2be3962675ae333e28bd8108a00) )
3375ROM_END
3376
3377/*
3378
3379Mahjong Yarou
3380(c)1986 Visco/Video System
3381
3382FRM-00 (modified royal mahjong hardware)
3383
3384CPU: Z80 (on subboard) <- wrong,they are 2 z80 CPUs -AS
3385Sound: AY-3-8910
3386OSC: 18.432MHz
3387
3388ROMs:
33891(2732)
33902(2732)
33913(2732)
33924(2732)
33935(2732)
33946(2732)
33954.6K (18S030) - pin14 is connected to subboard's WS
3396                pin9 is not inserted to the socket
3397
3398Subboard:
33997(2732)
34008(2764)
3401N82S129N.IC4
3402N82S123N.IC7
3403N82S129N.IC15
3404
3405Connetor between mainboard and subboard
3406sub - main
3407 CK - LS368 (1K) pin12
3408 HD - LS08  (2E) pin1
3409 VD - LS08  (2E) pin2
3410 WS - 18S030(6K) pin14
3411 () - LS138 (3K) pin13
3412
3413
3414Mainboard
3415----------------------------------------------------------
3416    1         2       3       4       5        6       7
3417A 74LS04    74LS86  74LS153  MB8116  MB8116  74LS157
3418B 74LS161   74LS86  74LS153  MB8116  MB8116  74LS95
3419C 74LS161   74LS86  74LS153  MB8116  MB8116  74LS157
3420D 74LS74    74LS86  74LS153  MB8116  MB8116  74LS95    8
3421E 74LS161   74LS08  74LS153  MB8116  MB8116  74LS157   9
3422F 74LS161   74LS74  74LS00   MB8116  MB8116  74LS95    1
3423H 74LS74    74LS00  74LS175  MB8116  MB8116  74LS157   0
3424J 74LS107   74LS32  74LS10   MB8116  MB8116  74LS95
3425K 74LS368   74LS241 74LS138  74LS08  74LS174 4.6K
3426L 18.432MHz 74LS241 74LS138  74LS04  74LS244 74LS174
3427M (socket to subbd) 74LS367  74LS08  DIPSW   74LS368
3428N                   (74LS245)74LS138 74LS04  TC40H000P
3429
3430  1     2     3     4     5     6                      6 B
3431                                                       1 A
3432                                                       1 T
3433                                                       6 T
3434----------------------------------------------------------
3435
3436Subboard
3437-----------------------------------------------------------
343874LS42(IC21)   ?(IC22)        ?(IC23)        74LS85(IC24)
343974LS125(IC16)  74LS08(IC17)   74LS393(IC9)   82S129N(IC15)
344074LS161(IC6)   82S123N(IC7)   74LS161(IC8)   74LS157(IC14)
344182S129N(IC4)   74LS259(IC5)   74LS32(IC12)   74LS74(IC13)
34427(IC2)                        PAL20X10(IC19) 74LS00(IC20)
34438(IC3)                        74LS245(IC18)  DIPSW
3444                                             74LS32(IC11)
3445Z80A                                         74LS04(IC10)
3446                                             5pin connector
3447-----------------------------------------------------------
3448
3449
3450dumped by sayu
3451
3452--- Team Japump!!! ---
3453http://japump.i.am/
3454
3455*/
3456
3457ROM_START( mjyarou )
3458   ROM_REGION( 0x10000, "main", 0 )
3459   ROM_LOAD( "1",       0x0000, 0x1000, CRC(312c3b29) SHA1(ec2e14b392cf761f0a7079376994418fd463a06c) )
3460   ROM_LOAD( "2",       0x1000, 0x1000, CRC(98f14097) SHA1(cd1f72d6effa50f95386dfc5fa9b5056d83e554f) )
3461   ROM_LOAD( "3",       0x2000, 0x1000, CRC(295dbf40) SHA1(d6ac7bd88da849e418e750e2c91a594f65bdff39) )
3462   ROM_LOAD( "4",       0x3000, 0x1000, CRC(a6a078c8) SHA1(936be36c7c938c705e7054a42c1908bb5a5ee1bb) )
3463   ROM_LOAD( "5",       0x4000, 0x1000, CRC(3179657e) SHA1(703fc57ae71554345754267c31809cf7af7f1639) )
3464   ROM_LOAD( "6",       0x5000, 0x1000, CRC(6ccc05b4) SHA1(6eefba6023673edd86e82a0ad861a4d8f7f6652b) )
3465   ROM_LOAD( "8",       0x6000, 0x2000, CRC(1adef246) SHA1(b5f5598daf71694effffbfb486b03fcda5a593ee) ) //might be a rom for the sub cpu.
3466
3467   /*encrypted z80*/
3468   ROM_REGION( 0x10000, "sub", 0 )
3469   ROM_LOAD( "7",       0x0000, 0x1000, CRC(dd144b90) SHA1(56b2c4472aaec49d9fddc99d8aa718b17655812c) )
3470
3471   ROM_REGION( 0x0040, "proms", 0 )
3472   ROM_LOAD( "4.6k",          0x0000, 0x0020, CRC(41bd4d69) SHA1(4d2da761b338b62b2ea151c201063a24d6e4cc97) )
3473   ROM_LOAD( "82s123n.ic7",  0x0020, 0x0020, CRC(46014727) SHA1(eec451f292ee319fa6bfbbf223aaa12b231692c1) )
3474
3475   ROM_REGION( 0x0200, "user1", 0 ) //?
3476   ROM_LOAD( "82s129n.ic15",  0x0000, 0x0100, CRC(86aeafd1) SHA1(c4e5c56ce5baf2be3962675ae333e28bd8108a00) )
3477   ROM_LOAD( "82s129n.ic4",   0x0100, 0x0100, CRC(f09d3c4c) SHA1(a9e752d75e7f3ebd05add4ccf2f9f15d8f9a8d15) )
3478ROM_END
3479
31523480static DRIVER_INIT( ippatsu )   {   memory_set_bankptr(machine, 1, memory_region(machine, "main") + 0x8000 );   }
31533481
31543482static DRIVER_INIT( janptr96 )
r4057r4058
31643492GAME( 1981?, openmj,   royalmj,  royalmah, royalmah, 0,        ROT0, "Sapporo Mechanic",           "Open Mahjong [BET] (Japan)",            0 )
31653493GAME( 1982,  royalmah, royalmj,  royalmah, royalmah, 0,        ROT0, "bootleg",                    "Royal Mahjong (Falcon bootleg, v1.01)", 0 )
31663494GAME( 1983,  janyoup2, royalmj,  ippatsu,  janyoup2, 0,        ROT0, "Cosmo Denshi",               "Janyou Part II (ver 7.03, July 1 1983)",0 )
3167GAME( 1984,  janoh,    0,        royalmah, royalmah, 0,        ROT0, "Toaplan",                    "Jan Oh",                                GAME_NOT_WORKING )
3495GAME( 1984,  janoh,    0,        royalmah, royalmah, 0,        ROT0, "Toaplan",                    "Jan Oh (set 1)",                        GAME_NOT_WORKING )
3496GAME( 1984,  janoha,   janoh,    janoh,    royalmah, 0,        ROT0, "Toaplan",                    "Jan Oh (set 2)",                   GAME_NOT_WORKING ) // this one is complete?
31683497GAME( 1986,  dondenmj, 0,        dondenmj, majs101b, 0,        ROT0, "Dyna Electronics",           "Don Den Mahjong [BET] (Japan)",         0 )
31693498GAME( 1986,  ippatsu,  0,        ippatsu,  ippatsu,  ippatsu,  ROT0, "Public Software / Paradais", "Ippatsu Gyakuten [BET] (Japan)",        0 )
31703499GAME( 1986,  suzume,   0,        suzume,   suzume,   0,        ROT0, "Dyna Electronics",           "Watashiha Suzumechan (Japan)",          0 )
3500GAME( 1986,  mjsiyoub, 0,        royalmah, royalmah, 0,       ROT0, "Visco",                      "Mahjong Shiyou (Japan)",             GAME_NOT_WORKING )
3501GAME( 1986,  mjsenka,  0,        royalmah, royalmah, 0,        ROT0, "Visco",                       "Mahjong Senka (Japan)",              GAME_NOT_WORKING )
3502GAME( 1986,  mjyarou,  0,        royalmah, royalmah, 0,        ROT0, "Visco / Video System",         "Mahjong Yarou [BET] (Japan",         GAME_NOT_WORKING )
31713503GAME( 1987,  mjdiplob, 0,        mjdiplob, mjdiplob, 0,        ROT0, "Dynax",                      "Mahjong Diplomat [BET] (Japan)",        0 )
31723504GAME( 1987,  tontonb,  0,        tontonb,  tontonb,  0,        ROT0, "Dynax",                      "Tonton [BET] (Japan)",                  0 )
31733505GAME( 1988,  majs101b, 0,        majs101b, majs101b, 0,        ROT0, "Dynax",                      "Mahjong Studio 101 [BET] (Japan)",      0 )
r4057r4058
31803512GAME( 1993,  cafedoll, 0,        mjifb,    mjifb,    0,        ROT0, "Dynax",                      "Mahjong Cafe Doll (Japan)",             GAME_NOT_WORKING )
31813513GAME( 1995,  mjtensin, 0,        mjtensin, mjtensin, 0,        ROT0, "Dynax",                      "Mahjong Tensinhai (Japan)",             GAME_NOT_WORKING )
31823514GAME( 1996,  janptr96, 0,        janptr96, janptr96, janptr96, ROT0, "Dynax",                      "Janputer '96 (Japan)",                  0 )
3515GAME( 1999,  cafebrk,  0,        mjifb,    mjifb,    0,        ROT0, "Nakanihon / Dynax",          "Mahjong Cafe Break",                    GAME_NOT_WORKING )
src/mame/drivers/ajax.c
r4057r4058
303303   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for the SOUND CPU */
304304   ROM_LOAD( "770_h03.f16",   0x00000, 0x08000, CRC(2ffd2afc) SHA1(ca2ef684f87bcf9b70b3ec66ec80685edaf04b9b) )
305305
306    ROM_REGION( 0x080000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
306   ROM_REGION( 0x080000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
307307   ROM_LOAD16_BYTE( "770c13-a.f3",      0x000000, 0x010000, CRC(4ef6fff2) SHA1(0a2953f6907738b795d96184329431539386a463) )
308308   ROM_LOAD16_BYTE( "770c13-c.f4",      0x000001, 0x010000, CRC(97ffbab6) SHA1(97d9a39600eed918e12908a9abed0d4161c20ef6) )
309309   ROM_LOAD16_BYTE( "770c13-b.e3",      0x020000, 0x010000, CRC(86fdd706) SHA1(334c2720fc35aa556c6c5850d32f9bc9a6800fba) )
r4057r4058
313313   ROM_LOAD16_BYTE( "770c12-b.e5",      0x060000, 0x010000, CRC(5f221cc6) SHA1(9a7a9c7853a3b582c4034b773cef08aee5391d6e) )
314314   ROM_LOAD16_BYTE( "770c12-d.e6",      0x060001, 0x010000, CRC(f1edb2f4) SHA1(3e66cc711e25cbf6e6a747d43a9efec0710d5b7a) )
315315
316    ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
316   ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
317317   ROM_LOAD16_BYTE( "770c09-a.f8",      0x000000, 0x010000, CRC(76690fb8) SHA1(afe267a37b65d63d3765dc3b88d8a8262446f786) )
318318   ROM_LOAD16_BYTE( "770c09-e.f9",      0x000001, 0x010000, CRC(17b482c9) SHA1(3535197956f5bf5b564fec1ddbb3e3ea3bf1f7bd) )
319319   ROM_LOAD16_BYTE( "770c09-b.e8",      0x020000, 0x010000, CRC(cd1709d1) SHA1(5a835639eb2d75adcfd0103b0800dd74b2bf9503) )
r4057r4058
369369   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for the SOUND CPU */
370370   ROM_LOAD( "770_h03.f16",   0x00000, 0x08000, CRC(2ffd2afc) SHA1(ca2ef684f87bcf9b70b3ec66ec80685edaf04b9b) )
371371
372    ROM_REGION( 0x080000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
372   ROM_REGION( 0x080000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
373373   ROM_LOAD( "770c13",      0x000000, 0x040000, CRC(b859ca4e) SHA1(f58678d503683f78cca0d5ed2d79f6f68ab3495a) )   /* characters (N22) */
374374   ROM_LOAD( "770c12",      0x040000, 0x040000, CRC(50d14b72) SHA1(e3ff4a5aeefa6c10b5f7fec18297948b7c5acfdf) )   /* characters (K22) */
375375
376    ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
376   ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
377377   ROM_LOAD( "770c09",      0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) )   /* sprites (N4) */
378378   ROM_LOAD( "770c08",      0x080000, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) )   /* sprites (K4) */
379379
r4057r4058
405405   ROM_REGION( 0x10000, "audio", 0 )   /* 64k for the SOUND CPU */
406406   ROM_LOAD( "770_f03.f16",   0x00000, 0x08000, CRC(3fe914fd) SHA1(c691920402bd859e2bf765084704a8bfad302cfa) )
407407
408    ROM_REGION( 0x080000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
408   ROM_REGION( 0x080000, "gfx1", 0 )   /* graphics (addressable by the main CPU) */
409409   ROM_LOAD( "770c13",      0x000000, 0x040000, CRC(b859ca4e) SHA1(f58678d503683f78cca0d5ed2d79f6f68ab3495a) )   /* characters (N22) */
410410   ROM_LOAD( "770c12",      0x040000, 0x040000, CRC(50d14b72) SHA1(e3ff4a5aeefa6c10b5f7fec18297948b7c5acfdf) )   /* characters (K22) */
411411
412    ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
412   ROM_REGION( 0x100000, "gfx2", 0 )   /* graphics (addressable by the main CPU) */
413413   ROM_LOAD( "770c09",      0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) )   /* sprites (N4) */
414414   ROM_LOAD( "770c08",      0x080000, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) )   /* sprites (K4) */
415415
src/mame/drivers/tutankhm.c
r4057r4058
1010
1111    Sound board: uses the same board as Pooyan.
1212
13    Note:
14    * The sound board uses a 14.318 MHz xtal.
15    * The cpu/video board uses a 18.432 MHz xtal.
16
1317***************************************************************************/
1418
1519#include "driver.h"
r4057r4058
127131
128132static INPUT_PORTS_START( tutankhm )
129133   PORT_START("DSW2")
130   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
134   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )       PORT_DIPLOCATION("SW2:1,2")
131135   PORT_DIPSETTING(    0x03, "3" )
132136   PORT_DIPSETTING(    0x01, "4" )
133137   PORT_DIPSETTING(    0x02, "5" )
134138   PORT_DIPSETTING(    0x00, "256 (Cheat)")
135   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
139   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )     PORT_DIPLOCATION("SW2:3")
136140   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
137141   PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
138   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
142   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )  PORT_DIPLOCATION("SW2:4")
139143   PORT_DIPSETTING(    0x08, "30000" )
140144   PORT_DIPSETTING(    0x00, "40000" )
141   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
145   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW2:5,6")
142146   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
143   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
144   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
147   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
148   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
145149   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
146   PORT_DIPNAME( 0x40, 0x40, "Flash Bomb" )
150   PORT_DIPNAME( 0x40, 0x40, "Flash Bomb" )           PORT_DIPLOCATION("SW2:7")
147151   PORT_DIPSETTING(    0x40, "1 per Life" )
148152   PORT_DIPSETTING(    0x00, "1 per Game" )
149   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
153   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
150154   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
151155   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
152156
r4057r4058
181185   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
182186
183187   PORT_START("DSW1")
184   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
188   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("SW1:1,2,3,4")
185189   PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
186190   PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
187191   PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
r4057r4058
198202   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
199203   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
200204   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
201   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
205   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("SW1:5,6,7,8")
202206   PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
203207   PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
204208   PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
r4057r4058
258262 *
259263 *************************************/
260264
265/*
266    Tutankham
267
268    CPU/Video Board: KT-3203-1B
269    Sound Board:     KT-5112-2B
270*/
271
261272ROM_START( tutankhm )
262273   ROM_REGION( 0x20000, "main", 0 )      /* 64k for M6809 CPU code + 64k for ROM banks */
263274   ROM_LOAD( "h1.bin",       0x0a000, 0x1000, CRC(da18679f) SHA1(8d2a3665db937d0e1d19300ae22277d9db61fcbc) ) /* program ROMs */
src/mame/drivers/nmk16.c
r4057r4058
4646  Therefore, it might be another protection device, which sits in the middle
4747  between CPU and NMK004.
4848- Protection is patched in several games.
49- In hachamf it seems that the protection device shares some RAM (fe000-fefff)
50  with the main CPU, and the main CPU fetches pointers from that shared RAM to
51  do important operations like reading the input ports. Some of them are easily
52  deduced checking for similarities in macross and bjtwin; however another
53  protection check involves (see the routine at 01429a) writing data to the
54  fe100-fe1ff range, and then jumping to subroutines in that range (most likely
55  function pointers since each one is only 0x10 bytes long), and heaven knows
56  what those should do.
57  On startup, hachamf does a RAM test, then copies some stuff and jumps to
58  RAM at 0xfef00, where it sits in a loop. We patch around that by replacing the
59  reset vector with the "real" one.
60  update: simulated this,see hachamf_mcu_shared_w() & tdragon_mcu_shared_w() for
61  more info about it.
62- Hacha Mecha Fighter bg graphics are completely wrong except at the title screen &
49- Hacha Mecha Fighter: mcu simulation *might* be wrong/incorrect (see notes).
50- Hacha Mecha Fighter: bg graphics are completely wrong except at the title screen &
6351  the level 7.Likely to be a rom issue,the game activates the bgbank
64  when it is on the above two cases.Also the bomb graphics are wrong when the game
65  is in japanese mode...
52  when it is on the above two cases.
6653- Cocktail mode is supported, but tilemap.c has problems with asymmetrical
6754  visible areas.
6855- Music timing in nouryoku is a little off.
r4057r4058
7259- Input ports in Bio-ship Paladin, Strahl
7360- Sound communication in Mustang might be incorrectly implemented
7461- Incorrect OKI samples banking in Rapid Hero
62- Hacha Mecha Fighter: (BTANB) the bomb graphics are pretty weird when the game is in
63  japanese mode,but it's like this on the original game,it's just a japanese write for
64  "bomb" word (I presume)
7565
7666----
7767
r4057r4058
547537Thunder Dragon & Hacha Mecha Fighter shares some ram with the MCU,the job of the latter
548538is to provide some jsr vectors used by the game for gameplay calculations.Also it has
549539the job to give the vectors of where the inputs are to be read & to calculate the coin
550settings,the latter is in the video file to avoid sync problems.
540settings,the latter is in a TIMER_DEVICE_CALLBACK to avoid sync problems.
551541To make a long story short,this MCU is an alternative version of the same protection
552542used by the MJ-8956 games (there are even the same kind of error codes!(i.e the number
553543printed on the up-left corner of the screen)...
554544
555545Note: I'm 100% sure of the Thunder Dragon vectors because I've compared it with the
556546bootleg sets,I'm *not* 100% sure of the Hacha Mecha Fighter vectors because I don't have
557anything to compare,infact
547anything to compare and I don't know if for example an option should be there if you lose a
548life,but the game looks pretty much hard without it.
558549
559550******************************************************************************************/
560551
r4057r4058
701692   }
702693}
703694
704
705695static ADDRESS_MAP_START( hachamf_map, ADDRESS_SPACE_PROGRAM, 16 )
706696   AM_RANGE(0x000000, 0x03ffff) AM_ROM
707697   /* I/O Region */
r4057r4058
779769   }
780770}
781771
772/*coin setting MCU simulation*/
773static void mcu_run(running_machine *machine, UINT8 dsw_setting)
774{
775   static UINT8 input_pressed;
776   static UINT16 coin_input;
777   UINT8 dsw[2];
778   static UINT8 start_helper = 0;
779   static UINT8 coin_count[2],coin_count_frac[2];
780   static UINT8 i;
782781
782   /*Accept the start button but needs some m68k processing first,otherwise you can't start a play with 1 credit inserted*/
783   if(start_helper & 1 && nmk16_mainram[0x9000/2] & 0x0200) /*start 1 */
784   {
785      nmk16_mainram[0xef00/2]--;
786      start_helper = start_helper & 2;
787   }
788   if(start_helper & 2 && nmk16_mainram[0x9000/2] & 0x0100) /*start 2*/
789   {
790      nmk16_mainram[0xef00/2]--;
791      start_helper = start_helper & 1;
792   }
793
794   /*needed because of the uncompatibility of the dsw settings.*/
795   if(dsw_setting) // Thunder Dragon
796   {
797      dsw[0] = (input_port_read(machine, "DSW2") & 0x7);
798      dsw[1] = (input_port_read(machine, "DSW2") & 0x38) >> 3;
799      for(i=0;i<2;i++)
800      {
801         switch(dsw[i] & 7)
802         {
803            case 0: nmk16_mainram[0x9000/2]|=0x4000; break; //free play
804            case 1: coin_count_frac[i] = 1; coin_count[i] = 4; break;
805            case 2: coin_count_frac[i] = 1; coin_count[i] = 3; break;
806            case 3: coin_count_frac[i] = 1; coin_count[i] = 2; break;
807            case 4: coin_count_frac[i] = 4; coin_count[i] = 1; break;
808            case 5: coin_count_frac[i] = 3; coin_count[i] = 1; break;
809            case 6: coin_count_frac[i] = 2; coin_count[i] = 1; break;
810            case 7: coin_count_frac[i] = 1; coin_count[i] = 1; break;
811         }
812      }
813   }
814   else // Hacha Mecha Fighter
815   {
816      dsw[0] = (input_port_read(machine, "DSW1") & 0x0700) >> 8;
817      dsw[1] = (input_port_read(machine, "DSW1") & 0x3800) >> 11;
818      for(i=0;i<2;i++)
819      {
820         switch(dsw[i] & 7)
821         {
822            case 0: nmk16_mainram[0x9000/2]|=0x4000; break; //free play
823            case 1: coin_count_frac[i] = 4; coin_count[i] = 1; break;
824            case 2: coin_count_frac[i] = 3; coin_count[i] = 1; break;
825            case 3: coin_count_frac[i] = 2; coin_count[i] = 1; break;
826            case 4: coin_count_frac[i] = 1; coin_count[i] = 4; break;
827            case 5: coin_count_frac[i] = 1; coin_count[i] = 3; break;
828            case 6: coin_count_frac[i] = 1; coin_count[i] = 2; break;
829            case 7: coin_count_frac[i] = 1; coin_count[i] = 1; break;
830         }
831      }
832   }
833
834   /*read the coin port*/
835   coin_input = (~(input_port_read(machine, "IN0")));
836
837   if(coin_input & 0x01)//coin 1
838   {
839      if((input_pressed & 0x01) == 0)
840      {
841         if(coin_count_frac[0] != 1)
842         {
843            nmk16_mainram[0xef02/2]+=coin_count[0];
844            if(coin_count_frac[0] == nmk16_mainram[0xef02/2])
845            {
846               nmk16_mainram[0xef00/2]+=coin_count[0];
847               nmk16_mainram[0xef02/2] = 0;
848            }
849         }
850         else
851            nmk16_mainram[0xef00/2]+=coin_count[0];
852      }
853      input_pressed = (input_pressed & 0xfe) | 1;
854   }
855   else
856      input_pressed = (input_pressed & 0xfe);
857
858   if(coin_input & 0x02)//coin 2
859   {
860      if((input_pressed & 0x02) == 0)
861      {
862         if(coin_count_frac[1] != 1)
863         {
864            nmk16_mainram[0xef02/2]+=coin_count[1];
865            if(coin_count_frac[1] == nmk16_mainram[0xef02/2])
866            {
867               nmk16_mainram[0xef00/2]+=coin_count[1];
868               nmk16_mainram[0xef02/2] = 0;
869            }
870         }
871         else
872            nmk16_mainram[0xef00/2]+=coin_count[1];
873      }
874      input_pressed = (input_pressed & 0xfd) | 2;
875   }
876   else
877      input_pressed = (input_pressed & 0xfd);
878
879   if(coin_input & 0x04)//service 1
880   {
881      if((input_pressed & 0x04) == 0)
882         nmk16_mainram[0xef00/2]++;
883      input_pressed = (input_pressed & 0xfb) | 4;
884   }
885   else
886      input_pressed = (input_pressed & 0xfb);
887
888   /*The 0x9000 ram address is the status */
889   if(nmk16_mainram[0xef00/2] > 0 && nmk16_mainram[0x9000/2] & 0x8000) //enable start button
890   {
891      if(coin_input & 0x08)//start 1
892      {
893         if((input_pressed & 0x08) == 0 && (!(nmk16_mainram[0x9000/2] & 0x0200))) //start 1
894            start_helper = 1;
895
896         input_pressed = (input_pressed & 0xf7) | 8;
897      }
898      else
899         input_pressed = (input_pressed & 0xf7);
900
901      if(coin_input & 0x10)//start 2
902      {
903         /*Decrease two coins to let two players play with one start 2 button and two credits inserted at the insert coin screen.*/
904         if((input_pressed & 0x10) == 0 && (!(nmk16_mainram[0x9000/2] & 0x0100))) // start 2
905            start_helper = (nmk16_mainram[0x9000/2] == 0x8000) ? (3) : (2);
906
907         input_pressed = (input_pressed & 0xef) | 0x10;
908      }
909      else
910         input_pressed = (input_pressed & 0xef);
911   }
912}
913
914static TIMER_DEVICE_CALLBACK( tdragon_mcu_sim )
915{
916   mcu_run(timer->machine,1);
917}
918
919static TIMER_DEVICE_CALLBACK( hachamf_mcu_sim )
920{
921   mcu_run(timer->machine,0);
922}
923
783924static ADDRESS_MAP_START( tdragon_readmem, ADDRESS_SPACE_PROGRAM, 16 )
784925   AM_RANGE(0x000000, 0x03ffff) AM_READ(SMH_ROM)
785926   AM_RANGE(0x044022, 0x044023) AM_READ(SMH_NOP)  /* No Idea */
r4057r4058
39034044   MDRV_VIDEO_START(macross)
39044045   MDRV_VIDEO_EOF(nmk)
39054046   MDRV_VIDEO_UPDATE(tdragon)
4047   MDRV_TIMER_ADD_PERIODIC("coinsim", tdragon_mcu_sim, HZ(10000)) // not real, but for simulating the MCU
39064048
39074049   /* sound hardware */
39084050   MDRV_SPEAKER_STANDARD_MONO("mono")
r4057r4058
40294171   MDRV_VIDEO_START(macross)
40304172   MDRV_VIDEO_EOF(nmk)
40314173   MDRV_VIDEO_UPDATE(hachamf)
4174   MDRV_TIMER_ADD_PERIODIC("coinsim", hachamf_mcu_sim, HZ(10000)) // not real, but for simulating the MCU
40324175
40334176   /* sound hardware */
40344177   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/miniboy7.c
r4057r4058
248248GFXDECODE_END
249249
250250
251/************************
252*    CRTC Interface    *
253************************/
254
255static const mc6845_interface mc6845_intf =
256{
257   "main",      /* screen we are acting on */
258   8,         /* number of pixels per video memory address */
259   NULL,      /* before pixel update callback */
260   NULL,      /* row update callback */
261   NULL,      /* after pixel update callback */
262   NULL,      /* callback for display state changes */
263   NULL,      /* HSYNC callback */
264   NULL      /* VSYNC callback */
265};
266
267
251268/*************************
252269*    Machine Drivers     *
253270*************************/
r4057r4058
274291   MDRV_VIDEO_START(miniboy7)
275292   MDRV_VIDEO_UPDATE(miniboy7)
276293
277   MDRV_MC6845_ADD("crtc", MC6845, 0, mc6845_null_interface)
294   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/11, mc6845_intf) /* guess */
278295MACHINE_DRIVER_END
279296
280297
src/tools/ldverify.c
r4057r4058
717717   bitmap = bitmap_alloc(info.width, info.height, BITMAP_FORMAT_YUY16);
718718   if (bitmap == NULL)
719719   {
720      isavi ? close_avi(file) : close_chd(file);
720721      fprintf(stderr, "Out of memory creating %dx%d bitmap\n", info.width, info.height);
721722      return 1;
722723   }
r4057r4058
726727   rsound = malloc(info.samplerate * sizeof(*rsound));
727728   if (lsound == NULL || rsound == NULL)
728729   {
730      isavi ? close_avi(file) : close_chd(file);
731      bitmap_free(bitmap);
732      if (rsound != NULL)
733         free(rsound);
734      if (lsound != NULL)
735         free(lsound);
729736      fprintf(stderr, "Out of memory allocating sound buffers of %d bytes\n", (INT32)(info.samplerate * sizeof(*rsound)));
730737      return 1;
731738   }
src/osd/windows/winmain.c
r4057r4058
126126   { NULL,                       NULL,       OPTION_HEADER,     "WINDOWS DEBUGGING OPTIONS" },
127127   { "oslog",                    "0",        OPTION_BOOLEAN,    "output error.log data to the system debugger" },
128128   { "watchdog;wdog",            "0",        0,                 "force the program to terminate if no updates within specified number of seconds" },
129   { "debugger_font;dfont",      "Lucida Console", 0,           "specifies the font to use for debugging; defaults to Lucida Console" },
130   { "debugger_font_size;dfontsize", "9",    0,                 "specifies the font size to use for debugging; defaults to 9 pt" },
129131
130132   // performance options
131133   { NULL,                       NULL,       OPTION_HEADER,     "WINDOWS PERFORMANCE OPTIONS" },
src/osd/windows/debugwin.c
r4057r4058
2626
2727// MAMEOS headers
2828#include "debugwin.h"
29#include "winmain.h"
2930#include "window.h"
3031#include "video.h"
3132#include "input.h"
r4057r4058
390391
391392      if (temp_dc != NULL)
392393      {
393         // create a standard Lucida Console 8 font
394         debug_font = CreateFont(-MulDiv(8, GetDeviceCaps(temp_dc, LOGPIXELSY), 72), 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE,
395                  ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, TEXT("Lucida Console"));
394         int size = options_get_int(mame_options(), WINOPTION_DEBUGGER_FONT_SIZE);
395         TCHAR *t_face;
396
397         // create a standard font
398         t_face = tstring_from_utf8(options_get_string(mame_options(), WINOPTION_DEBUGGER_FONT));
399         debug_font = CreateFont(-MulDiv(size, GetDeviceCaps(temp_dc, LOGPIXELSY), 72), 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE,
400                  ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, t_face);
401         free(t_face);
402
403         // fall back to Lucida Console 8
396404         if (debug_font == NULL)
397            fatalerror("Unable to create debug font");
405         {
406            debug_font = CreateFont(-MulDiv(8, GetDeviceCaps(temp_dc, LOGPIXELSY), 72), 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE,
407                     ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, TEXT("Lucida Console"));
408            if (debug_font == NULL)
409               fatalerror("Unable to create debug font");
410         }
398411
399412         // get the metrics
400413         old_font = SelectObject(temp_dc, debug_font);
401414         if (GetTextMetrics(temp_dc, &metrics))
402415         {
403            debug_font_width = metrics.tmMaxCharWidth;
416            debug_font_width = metrics.tmAveCharWidth;
404417            debug_font_height = metrics.tmHeight;
405418            debug_font_ascent = metrics.tmAscent + metrics.tmExternalLeading;
406419         }
r4057r4058
26602673            return 1;
26612674
26622675         case ID_EXIT:
2676            if (info->focuswnd != NULL)
2677               SetFocus(info->focuswnd);
26632678            mame_schedule_exit(info->machine);
26642679            return 1;
26652680      }
src/osd/windows/window.c
r4057r4058
717717   }
718718
719719   // if we're visible and running and not in the middle of a resize, draw
720   if (window->hwnd != NULL && window->target != NULL)
720   if (window->hwnd != NULL && window->target != NULL && window->drawdata != NULL)
721721   {
722722      int got_lock = TRUE;
723723
src/osd/windows/winmain.h
r4057r4058
1212//  CONSTANTS
1313//============================================================
1414
15// debugging options
16#define WINOPTION_OSLOG               "oslog"
17#define WINOPTION_WATCHDOG            "watchdog"
18#define WINOPTION_DEBUGGER_FONT         "debugger_font"
19#define WINOPTION_DEBUGGER_FONT_SIZE   "debugger_font_size"
20
21// performance options
22#define WINOPTION_PRIORITY            "priority"
23#define WINOPTION_MULTITHREADING      "multithreading"
24
1525// video options
16#define WINOPTION_D3DVERSION         "d3dversion"
1726#define WINOPTION_VIDEO               "video"
27#define WINOPTION_NUMSCREENS         "numscreens"
28#define WINOPTION_WINDOW            "window"
29#define WINOPTION_MAXIMIZE            "maximize"
30#define WINOPTION_KEEPASPECT         "keepaspect"
1831#define WINOPTION_PRESCALE            "prescale"
19#define WINOPTION_NUMSCREENS         "numscreens"
32#define WINOPTION_EFFECT            "effect"
2033#define WINOPTION_WAITVSYNC            "waitvsync"
21#define WINOPTION_TRIPLEBUFFER         "triplebuffer"
34#define WINOPTION_SYNCREFRESH         "syncrefresh"
35
36// DirectDraw-specific options
2237#define WINOPTION_HWSTRETCH            "hwstretch"
23#define WINOPTION_SWITCHRES            "switchres"
24#define WINOPTION_KEEPASPECT         "keepaspect"
25#define WINOPTION_SYNCREFRESH         "syncrefresh"
26#define WINOPTION_FULLSCREENGAMMA      "full_screen_gamma"
27#define WINOPTION_FULLSCREENBRIGHTNESS   "full_screen_brightness"
28#define WINOPTION_FULLLSCREENCONTRAST   "full_screen_contrast"
29#define WINOPTION_EFFECT            "effect"
38
39// Direct3D-specific options
40#define WINOPTION_D3DVERSION         "d3dversion"
41#define WINOPTION_FILTER            "filter"
42
43// per-window options
44#define WINOPTION_SCREEN            "screen"
3045#define WINOPTION_ASPECT            "aspect"
3146#define WINOPTION_RESOLUTION         "resolution"
47#define WINOPTION_VIEW               "view"
48
49#define WINOPTION_SCREEN0            "screen0"
50#define WINOPTION_ASPECT0            "aspect0"
3251#define WINOPTION_RESOLUTION0         "resolution0"
52#define WINOPTION_VIEW0               "view0"
53
54#define WINOPTION_SCREEN1            "screen1"
55#define WINOPTION_ASPECT1            "aspect1"
3356#define WINOPTION_RESOLUTION1         "resolution1"
57#define WINOPTION_VIEW1               "view1"
58
59#define WINOPTION_SCREEN2            "screen2"
60#define WINOPTION_ASPECT2            "aspect2"
3461#define WINOPTION_RESOLUTION2         "resolution2"
62#define WINOPTION_VIEW2               "view2"
63
64#define WINOPTION_SCREEN3            "screen3"
65#define WINOPTION_ASPECT3            "aspect3"
3566#define WINOPTION_RESOLUTION3         "resolution3"
36#define WINOPTION_FILTER            "filter"
37#define WINOPTION_SCREEN            "screen"
67#define WINOPTION_VIEW3               "view3"
3868
39// window options
40#define WINOPTION_VIEW               "view"
41#define WINOPTION_MAXIMIZE            "maximize"
42#define WINOPTION_WINDOW            "window"
69// full screen options
70#define WINOPTION_TRIPLEBUFFER         "triplebuffer"
71#define WINOPTION_SWITCHRES            "switchres"
72#define WINOPTION_FULLSCREENBRIGHTNESS   "full_screen_brightness"
73#define WINOPTION_FULLLSCREENCONTRAST   "full_screen_contrast"
74#define WINOPTION_FULLSCREENGAMMA      "full_screen_gamma"
4375
76// sound options
77#define WINOPTION_AUDIO_LATENCY         "audio_latency"
78
4479// input options
4580#define WINOPTION_DUAL_LIGHTGUN         "dual_lightgun"
4681
47// misc options
48#define WINOPTION_AUDIO_LATENCY         "audio_latency"
49#define WINOPTION_PRIORITY            "priority"
50#define WINOPTION_MULTITHREADING      "multithreading"
51#define WINOPTION_WATCHDOG            "watchdog"
52#define WINOPTION_OSLOG               "oslog"
5382
5483
55
5684//============================================================
5785//  GLOBAL VARIABLES
5886//============================================================
src/osd/windows/drawd3d.c
r4057r4058
8989   float               vstart, vstop;            // beginning/ending V coordinates
9090   int                  rawwidth, rawheight;      // raw width/height of the texture
9191   int                  type;                  // what type of texture are we?
92   int                  borderpix;               // do we have a 1 pixel border?
92   int                  xborderpix;               // number of border pixels in X
93   int                  yborderpix;               // number of border pixels in Y
9394   int                  xprescale;               // what is our X prescale factor?
9495   int                  yprescale;               // what is our Y prescale factor?
9596   d3d_texture *         d3dtex;                  // Direct3D texture pointer
r4057r4058
17971798   int finalheight = texheight;
17981799   int finalwidth = texwidth;
17991800
1800   // if we're not wrapping, add a 1 pixel border on all sides
1801#if ENABLE_BORDER_PIX
1802   texture->borderpix = !(texture->flags & PRIMFLAG_TEXWRAP_MASK);
1803#else
1804   texture->borderpix = FALSE;
1805#endif
1806   if (texture->borderpix)
1801   // if we're not wrapping, add a 1-2 pixel border on all sides
1802   texture->xborderpix = 0;
1803   texture->yborderpix = 0;
1804   if (ENABLE_BORDER_PIX && !(texture->flags & PRIMFLAG_TEXWRAP_MASK))
18071805   {
1808      finalwidth += 2;
1809      finalheight += 2;
1806      // note we need 2 pixels in X for YUY textures
1807      texture->xborderpix = (PRIMFLAG_GET_TEXFORMAT(texture->flags) == TEXFORMAT_YUY16) ? 2 : 1;
1808      texture->yborderpix = 1;
18101809   }
18111810
1811   // compute final texture size
1812   finalwidth += 2 * texture->xborderpix;
1813   finalheight += 2 * texture->yborderpix;
1814
18121815   // round width/height up to nearest power of 2 if we need to
18131816   if (!(d3d->texture_caps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL))
18141817   {
r4057r4058
18491852      finalheight *= 2;
18501853
18511854   // if we added pixels for the border, and that just barely pushed us over, take it back
1852   if (texture->borderpix &&
1853      ((finalwidth > d3d->texture_max_width && finalwidth - 2 <= d3d->texture_max_width) ||
1854       (finalheight > d3d->texture_max_height && finalheight - 2 <= d3d->texture_max_height)))
1855   if ((finalwidth > d3d->texture_max_width && finalwidth - 2 * texture->xborderpix <= d3d->texture_max_width) ||
1856      (finalheight > d3d->texture_max_height && finalheight - 2 * texture->yborderpix <= d3d->texture_max_height))
18551857   {
1856      texture->borderpix = FALSE;
1857      finalwidth -= 2;
1858      finalheight -= 2;
1858      finalwidth -= 2 * texture->xborderpix;
1859      finalheight -= 2 * texture->yborderpix;
1860      texture->xborderpix = 0;
1861      texture->yborderpix = 0;
18591862   }
18601863
18611864   // if we're above the max width/height, do what?
r4057r4058
18671870   }
18681871
18691872   // compute the U/V scale factors
1870   if (texture->borderpix)
1871   {
1872      texture->ustart = 1.0f / (float)finalwidth;
1873      texture->ustop = (float)(texwidth + 1) / (float)finalwidth;
1874      texture->vstart = 1.0f / (float)finalheight;
1875      texture->vstop = (float)(texheight + 1) / (float)finalheight;
1876   }
1877   else
1878   {
1879      texture->ustart = 0.0f;
1880      texture->ustop = (float)texwidth / (float)finalwidth;
1881      texture->vstart = 0.0f;
1882      texture->vstop = (float)texheight / (float)finalheight;
1883   }
1873   texture->ustart = (float)texture->xborderpix / (float)finalwidth;
1874   texture->ustop = (float)(texwidth + texture->xborderpix) / (float)finalwidth;
1875   texture->vstart = (float)texture->yborderpix / (float)finalheight;
1876   texture->vstop = (float)(texheight + texture->yborderpix) / (float)finalheight;
18841877
18851878   // set the final values
18861879   texture->rawwidth = finalwidth;
r4057r4058
18931886//  copyline_palette16
18941887//============================================================
18951888
1896INLINE void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int borderpix)
1889INLINE void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix)
18971890{
18981891   int x;
18991892
1900   if (borderpix)
1893   assert(xborderpix == 0 || xborderpix == 1);
1894   if (xborderpix)
19011895      *dst++ = 0xff000000 | palette[*src];
19021896   for (x = 0; x < width; x++)
19031897      *dst++ = 0xff000000 | palette[*src++];
1904   if (borderpix)
1898   if (xborderpix)
19051899      *dst++ = 0xff000000 | palette[*--src];
19061900}
19071901
r4057r4058
19111905//  copyline_palettea16
19121906//============================================================
19131907
1914INLINE void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int borderpix)
1908INLINE void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix)
19151909{
19161910   int x;
19171911
1918   if (borderpix)
1912   assert(xborderpix == 0 || xborderpix == 1);
1913   if (xborderpix)
19191914      *dst++ = palette[*src];
19201915   for (x = 0; x < width; x++)
19211916      *dst++ = palette[*src++];
1922   if (borderpix)
1917   if (xborderpix)
19231918      *dst++ = palette[*--src];
19241919}
19251920
r4057r4058
19291924//  copyline_rgb15
19301925//============================================================
19311926
1932INLINE void copyline_rgb15(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int borderpix)
1927INLINE void copyline_rgb15(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix)
19331928{
19341929   int x;
19351930
1931   assert(xborderpix == 0 || xborderpix == 1);
1932
19361933   // palette (really RGB map) case
19371934   if (palette != NULL)
19381935   {
1939      if (borderpix)
1936      if (xborderpix)
19401937      {
19411938         UINT16 pix = *src;
19421939         *dst++ = 0xff000000 | palette[0x40 + ((pix >> 10) & 0x1f)] | palette[0x20 + ((pix >> 5) & 0x1f)] | palette[0x00 + ((pix >> 0) & 0x1f)];
r4057r4058
19461943         UINT16 pix = *src++;
19471944         *dst++ = 0xff000000 | palette[0x40 + ((pix >> 10) & 0x1f)] | palette[0x20 + ((pix >> 5) & 0x1f)] | palette[0x00 + ((pix >> 0) & 0x1f)];
19481945      }
1949      if (borderpix)
1946      if (xborderpix)
19501947      {
19511948         UINT16 pix = *--src;
19521949         *dst++ = 0xff000000 | palette[0x40 + ((pix >> 10) & 0x1f)] | palette[0x20 + ((pix >> 5) & 0x1f)] | palette[0x00 + ((pix >> 0) & 0x1f)];
r4057r4058
19561953   // direct case
19571954   else
19581955   {
1959      if (borderpix)
1956      if (xborderpix)
19601957      {
19611958         UINT16 pix = *src;
19621959         UINT32 color = ((pix & 0x7c00) << 9) | ((pix & 0x03e0) << 6) | ((pix & 0x001f) << 3);
r4057r4058
19681965         UINT32 color = ((pix & 0x7c00) << 9) | ((pix & 0x03e0) << 6) | ((pix & 0x001f) << 3);
19691966         *dst++ = 0xff000000 | color | ((color >> 5) & 0x070707);
19701967      }
1971      if (borderpix)
1968      if (xborderpix)
19721969      {
19731970         UINT16 pix = *--src;
19741971         UINT32 color = ((pix & 0x7c00) << 9) | ((pix & 0x03e0) << 6) | ((pix & 0x001f) << 3);
r4057r4058
19831980//  copyline_rgb32
19841981//============================================================
19851982
1986INLINE void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int borderpix)
1983INLINE void copyline_rgb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix)
19871984{
19881985   int x;
19891986
1987   assert(xborderpix == 0 || xborderpix == 1);
1988
19901989   // palette (really RGB map) case
19911990   if (palette != NULL)
19921991   {
1993      if (borderpix)
1992      if (xborderpix)
19941993      {
19951994         UINT32 srcpix = *src;
19961995         *dst++ = 0xff000000 | palette[0x200 + RGB_RED(srcpix)] | palette[0x100 + RGB_GREEN(srcpix)] | palette[RGB_BLUE(srcpix)];
r4057r4058
20001999         UINT32 srcpix = *src++;
20012000         *dst++ = 0xff000000 | palette[0x200 + RGB_RED(srcpix)] | palette[0x100 + RGB_GREEN(srcpix)] | palette[RGB_BLUE(srcpix)];
20022001      }
2003      if (borderpix)
2002      if (xborderpix)
20042003      {
20052004         UINT32 srcpix = *--src;
20062005         *dst++ = 0xff000000 | palette[0x200 + RGB_RED(srcpix)] | palette[0x100 + RGB_GREEN(srcpix)] | palette[RGB_BLUE(srcpix)];
r4057r4058
20102009   // direct case
20112010   else
20122011   {
2013      if (borderpix)
2012      if (xborderpix)
20142013         *dst++ = 0xff000000 | *src;
20152014      for (x = 0; x < width; x++)
20162015         *dst++ = 0xff000000 | *src++;
2017      if (borderpix)
2016      if (xborderpix)
20182017         *dst++ = 0xff000000 | *--src;
20192018   }
20202019}
r4057r4058
20252024//  copyline_argb32
20262025//============================================================
20272026
2028INLINE void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int borderpix)
2027INLINE void copyline_argb32(UINT32 *dst, const UINT32 *src, int width, const rgb_t *palette, int xborderpix)
20292028{
20302029   int x;
20312030
2031   assert(xborderpix == 0 || xborderpix == 1);
2032
20322033   // palette (really RGB map) case
20332034   if (palette != NULL)
20342035   {
2035      if (borderpix)
2036      if (xborderpix)
20362037      {
20372038         UINT32 srcpix = *src;
20382039         *dst++ = (srcpix & 0xff000000) | palette[0x200 + RGB_RED(srcpix)] | palette[0x100 + RGB_GREEN(srcpix)] | palette[RGB_BLUE(srcpix)];
r4057r4058
20422043         UINT32 srcpix = *src++;
20432044         *dst++ = (srcpix & 0xff000000) | palette[0x200 + RGB_RED(srcpix)] | palette[0x100 + RGB_GREEN(srcpix)] | palette[RGB_BLUE(srcpix)];
20442045      }
2045      if (borderpix)
2046      if (xborderpix)
20462047      {
20472048         UINT32 srcpix = *--src;
20482049         *dst++ = (srcpix & 0xff000000) | palette[0x200 + RGB_RED(srcpix)] | palette[0x100 + RGB_GREEN(srcpix)] | palette[RGB_BLUE(srcpix)];
r4057r4058
20522053   // direct case
20532054   else
20542055   {
2055      if (borderpix)
2056      if (xborderpix)
20562057         *dst++ = *src;
20572058      for (x = 0; x < width; x++)
20582059         *dst++ = *src++;
2059      if (borderpix)
2060      if (xborderpix)
20602061         *dst++ = *--src;
20612062   }
20622063}
r4057r4058
20672068//  copyline_yuy16_to_yuy2
20682069//============================================================
20692070
2070INLINE void copyline_yuy16_to_yuy2(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int borderpix)
2071INLINE void copyline_yuy16_to_yuy2(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix)
20712072{
20722073   int x;
20732074
2075   assert(xborderpix == 0 || xborderpix == 2);
2076   assert(width % 2 == 0);
2077
20742078   // palette (really RGB map) case
20752079   if (palette != NULL)
20762080   {
2077      if (borderpix)
2081      if (xborderpix)
20782082      {
2079         UINT16 srcpix = *src;
2080         *dst++ = palette[0x000 + (srcpix >> 8)] | (srcpix << 8);
2083         UINT16 srcpix0 = *src++;
2084         UINT16 srcpix1 = *src--;
2085         *dst++ = palette[0x000 + (srcpix0 >> 8)] | (srcpix0 << 8);
2086         *dst++ = palette[0x000 + (srcpix0 >> 8)] | (srcpix1 << 8);
20812087      }
2082      for (x = 0; x < width; x++)
2088      for (x = 0; x < width; x += 2)
20832089      {
2084         UINT16 srcpix = *src++;
2085         *dst++ = palette[0x000 + (srcpix >> 8)] | (srcpix << 8);
2090         UINT16 srcpix0 = *src++;
2091         UINT16 srcpix1 = *src++;
2092         *dst++ = palette[0x000 + (srcpix0 >> 8)] | (srcpix0 << 8);
2093         *dst++ = palette[0x000 + (srcpix1 >> 8)] | (srcpix1 << 8);
20862094      }
2087      if (borderpix)
2095      if (xborderpix)
20882096      {
2089         UINT16 srcpix = *--src;
2090         *dst++ = palette[0x000 + (srcpix >> 8)] | (srcpix << 8);
2097         UINT16 srcpix1 = *--src;
2098         UINT16 srcpix0 = *--src;
2099         *dst++ = palette[0x000 + (srcpix1 >> 8)] | (srcpix0 << 8);
2100         *dst++ = palette[0x000 + (srcpix1 >> 8)] | (srcpix1 << 8);
20912101      }
20922102   }
20932103
20942104   // direct case
20952105   else
20962106   {
2097      if (borderpix)
2107      if (xborderpix)
20982108      {
2099         UINT16 srcpix = *src;
2100         *dst++ = (srcpix >> 8) | (srcpix << 8);
2109         UINT16 srcpix0 = *src++;
2110         UINT16 srcpix1 = *src--;
2111         *dst++ = (srcpix0 >> 8) | (srcpix0 << 8);
2112         *dst++ = (srcpix0 >> 8) | (srcpix1 << 8);
21012113      }
2102      for (x = 0; x < width; x++)
2114      for (x = 0; x < width; x += 2)
21032115      {
2104         UINT16 srcpix = *src++;
2105         *dst++ = (srcpix >> 8) | (srcpix << 8);
2116         UINT16 srcpix0 = *src++;
2117         UINT16 srcpix1 = *src++;
2118         *dst++ = (srcpix0 >> 8) | (srcpix0 << 8);
2119         *dst++ = (srcpix1 >> 8) | (srcpix1 << 8);
21062120      }
2107      if (borderpix)
2121      if (xborderpix)
21082122      {
2109         UINT16 srcpix = *--src;
2110         *dst++ = (srcpix >> 8) | (srcpix << 8);
2123         UINT16 srcpix1 = *--src;
2124         UINT16 srcpix0 = *--src;
2125         *dst++ = (srcpix1 >> 8) | (srcpix0 << 8);
2126         *dst++ = (srcpix1 >> 8) | (srcpix1 << 8);
21112127      }
21122128   }
21132129}
r4057r4058
21182134//  copyline_yuy16_to_uyvy
21192135//============================================================
21202136
2121INLINE void copyline_yuy16_to_uyvy(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int borderpix)
2137INLINE void copyline_yuy16_to_uyvy(UINT16 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix)
21222138{
21232139   int x;
21242140
2141   assert(xborderpix == 0 || xborderpix == 2);
2142   assert(width % 2 == 0);
2143
21252144   // palette (really RGB map) case
21262145   if (palette != NULL)
21272146   {
2128      if (borderpix)
2147      if (xborderpix)
21292148      {
2130         UINT16 srcpix = *src;
2131         *dst++ = palette[0x100 + (srcpix >> 8)] | (srcpix & 0xff);
2149         UINT16 srcpix0 = *src++;
2150         UINT16 srcpix1 = *src--;
2151         *dst++ = palette[0x100 + (srcpix0 >> 8)] | (srcpix0 & 0xff);
2152         *dst++ = palette[0x100 + (srcpix0 >> 8)] | (srcpix1 & 0xff);
21322153      }
2133      for (x = 0; x < width; x++)
2154      for (x = 0; x < width; x += 2)
21342155      {
2135         UINT16 srcpix = *src++;
2136         *dst++ = palette[0x100 + (srcpix >> 8)] | (srcpix & 0xff);
2156         UINT16 srcpix0 = *src++;
2157         UINT16 srcpix1 = *src++;
2158         *dst++ = palette[0x100 + (srcpix0 >> 8)] | (srcpix0 & 0xff);
2159         *dst++ = palette[0x100 + (srcpix1 >> 8)] | (srcpix1 & 0xff);
21372160      }
2138      if (borderpix)
2161      if (xborderpix)
21392162      {
2140         UINT16 srcpix = *--src;
2141         *dst++ = palette[0x100 + (srcpix >> 8)] | (srcpix & 0xff);
2163         UINT16 srcpix1 = *--src;
2164         UINT16 srcpix0 = *--src;
2165         *dst++ = palette[0x100 + (srcpix1 >> 8)] | (srcpix0 & 0xff);
2166         *dst++ = palette[0x100 + (srcpix1 >> 8)] | (srcpix1 & 0xff);
21422167      }
21432168   }
21442169
21452170   // direct case
21462171   else
21472172   {
2148      if (borderpix)
2149         *dst++ = *src;
2150      for (x = 0; x < width; x++)
2173      if (xborderpix)
2174      {
2175         UINT16 srcpix0 = src[0];
2176         UINT16 srcpix1 = src[1];
2177         *dst++ = srcpix0;
2178         *dst++ = (srcpix0 & 0xff00) | (srcpix1 & 0x00ff);
2179      }
2180      for (x = 0; x < width; x += 2)
2181      {
21512182         *dst++ = *src++;
2152      if (borderpix)
2153         *dst++ = *--src;
2183         *dst++ = *src++;
2184      }
2185      if (xborderpix)
2186      {
2187         UINT16 srcpix1 = *--src;
2188         UINT16 srcpix0 = *--src;
2189         *dst++ = (srcpix1 & 0xff00) | (srcpix0 & 0x00ff);
2190         *dst++ = srcpix1;
2191      }
21542192   }
21552193}
21562194
r4057r4058
21602198//  copyline_yuy16_to_argb
21612199//============================================================
21622200
2163INLINE void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int borderpix)
2201INLINE void copyline_yuy16_to_argb(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette, int xborderpix)
21642202{
21652203   int x;
21662204
2205   assert(xborderpix == 0 || xborderpix == 2);
2206   assert(width % 2 == 0);
2207
21672208   // palette (really RGB map) case
21682209   if (palette != NULL)
21692210   {
2170      if (borderpix)
2211      if (xborderpix)
21712212      {
21722213         UINT16 srcpix0 = src[0];
21732214         UINT16 srcpix1 = src[1];
21742215         UINT8 cb = srcpix0 & 0xff;
21752216         UINT8 cr = srcpix1 & 0xff;
21762217         *dst++ = ycc_to_rgb(palette[0x000 + (srcpix0 >> 8)], cb, cr);
2218         *dst++ = ycc_to_rgb(palette[0x000 + (srcpix0 >> 8)], cb, cr);
21772219      }
21782220      for (x = 0; x < width / 2; x++)
21792221      {
r4057r4058
21842226         *dst++ = ycc_to_rgb(palette[0x000 + (srcpix0 >> 8)], cb, cr);
21852227         *dst++ = ycc_to_rgb(palette[0x000 + (srcpix1 >> 8)], cb, cr);
21862228      }
2187      if (borderpix)
2229      if (xborderpix)
21882230      {
21892231         UINT16 srcpix1 = *--src;
21902232         UINT16 srcpix0 = *--src;
21912233         UINT8 cb = srcpix0 & 0xff;
21922234         UINT8 cr = srcpix1 & 0xff;
21932235         *dst++ = ycc_to_rgb(palette[0x000 + (srcpix1 >> 8)], cb, cr);
2236         *dst++ = ycc_to_rgb(palette[0x000 + (srcpix1 >> 8)], cb, cr);
21942237      }
21952238   }
21962239
21972240   // direct case
21982241   else
21992242   {
2200      if (borderpix)
2243      if (xborderpix)
22012244      {
22022245         UINT16 srcpix0 = src[0];
22032246         UINT16 srcpix1 = src[1];
22042247         UINT8 cb = srcpix0 & 0xff;
22052248         UINT8 cr = srcpix1 & 0xff;
22062249         *dst++ = ycc_to_rgb(srcpix0 >> 8, cb, cr);
2250         *dst++ = ycc_to_rgb(srcpix0 >> 8, cb, cr);
22072251      }
2208      for (x = 0; x < width / 2; x++)
2252      for (x = 0; x < width; x += 2)
22092253      {
22102254         UINT16 srcpix0 = *src++;
22112255         UINT16 srcpix1 = *src++;
r4057r4058
22142258         *dst++ = ycc_to_rgb(srcpix0 >> 8, cb, cr);
22152259         *dst++ = ycc_to_rgb(srcpix1 >> 8, cb, cr);
22162260      }
2217      if (borderpix)
2261      if (xborderpix)
22182262      {
22192263         UINT16 srcpix1 = *--src;
22202264         UINT16 srcpix0 = *--src;
22212265         UINT8 cb = srcpix0 & 0xff;
22222266         UINT8 cr = srcpix1 & 0xff;
22232267         *dst++ = ycc_to_rgb(srcpix1 >> 8, cb, cr);
2268         *dst++ = ycc_to_rgb(srcpix1 >> 8, cb, cr);
22242269      }
22252270   }
22262271}
r4057r4058
22502295      return;
22512296
22522297   // loop over Y
2253   miny = 0 - texture->borderpix;
2254   maxy = texsource->height + texture->borderpix;
2298   miny = 0 - texture->yborderpix;
2299   maxy = texsource->height + texture->yborderpix;
22552300   for (dsty = miny; dsty < maxy; dsty++)
22562301   {
22572302      int srcy = (dsty < 0) ? 0 : (dsty >= texsource->height) ? texsource->height - 1 : dsty;
2258      void *dst = (BYTE *)rect.pBits + (dsty + texture->borderpix) * rect.Pitch;
2303      void *dst = (BYTE *)rect.pBits + (dsty + texture->yborderpix) * rect.Pitch;
22592304
22602305      // switch off of the format and
22612306      switch (PRIMFLAG_GET_TEXFORMAT(flags))
22622307      {
22632308         case TEXFORMAT_PALETTE16:
2264            copyline_palette16(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2309            copyline_palette16(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22652310            break;
22662311
22672312         case TEXFORMAT_PALETTEA16:
2268            copyline_palettea16(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2313            copyline_palettea16(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22692314            break;
22702315
22712316         case TEXFORMAT_RGB15:
2272            copyline_rgb15(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2317            copyline_rgb15(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22732318            break;
22742319
22752320         case TEXFORMAT_RGB32:
2276            copyline_rgb32(dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2321            copyline_rgb32(dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22772322            break;
22782323
22792324         case TEXFORMAT_ARGB32:
2280            copyline_argb32(dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2325            copyline_argb32(dst, (UINT32 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22812326            break;
22822327
22832328         case TEXFORMAT_YUY16:
22842329            if (d3d->yuv_format == D3DFMT_YUY2)
2285               copyline_yuy16_to_yuy2(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2330               copyline_yuy16_to_yuy2(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22862331            else if (d3d->yuv_format == D3DFMT_UYVY)
2287               copyline_yuy16_to_uyvy(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2332               copyline_yuy16_to_uyvy(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22882333            else
2289               copyline_yuy16_to_argb(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix);
2334               copyline_yuy16_to_argb(dst, (UINT16 *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, texture->xborderpix);
22902335            break;
22912336
22922337         default:
r4057r4058
23382383
23392384      // set the source bounds
23402385      source.left = source.top = 0;
2341      source.right = texture->texinfo.width + 2 * texture->borderpix;
2342      source.bottom = texture->texinfo.height + 2 * texture->borderpix;
2386      source.right = texture->texinfo.width + 2 * texture->xborderpix;
2387      source.bottom = texture->texinfo.height + 2 * texture->yborderpix;
23432388
23442389      // set the target bounds
23452390      dest = source;
r4057r4058
23822427      // configure the X/Y coordinates on the target surface
23832428      d3d->lockedbuf[0].x = -0.5f;
23842429      d3d->lockedbuf[0].y = -0.5f;
2385      d3d->lockedbuf[1].x = (float)((texture->texinfo.width + 2 * texture->borderpix) * texture->xprescale) - 0.5f;
2430      d3d->lockedbuf[1].x = (float)((texture->texinfo.width + 2 * texture->xborderpix) * texture->xprescale) - 0.5f;
23862431      d3d->lockedbuf[1].y = -0.5f;
23872432      d3d->lockedbuf[2].x = -0.5f;
2388      d3d->lockedbuf[2].y = (float)((texture->texinfo.height + 2 * texture->borderpix) * texture->yprescale) - 0.5f;
2389      d3d->lockedbuf[3].x = (float)((texture->texinfo.width + 2 * texture->borderpix) * texture->xprescale) - 0.5f;
2390      d3d->lockedbuf[3].y = (float)((texture->texinfo.height + 2 * texture->borderpix) * texture->yprescale) - 0.5f;
2433      d3d->lockedbuf[2].y = (float)((texture->texinfo.height + 2 * texture->yborderpix) * texture->yprescale) - 0.5f;
2434      d3d->lockedbuf[3].x = (float)((texture->texinfo.width + 2 * texture->xborderpix) * texture->xprescale) - 0.5f;
2435      d3d->lockedbuf[3].y = (float)((texture->texinfo.height + 2 * texture->yborderpix) * texture->yprescale) - 0.5f;
23912436
23922437      // configure the U/V coordintes on the source texture
23932438      d3d->lockedbuf[0].u0 = 0.0f;
23942439      d3d->lockedbuf[0].v0 = 0.0f;
2395      d3d->lockedbuf[1].u0 = (float)(texture->texinfo.width + 2 * texture->borderpix) / (float)texture->rawwidth;
2440      d3d->lockedbuf[1].u0 = (float)(texture->texinfo.width + 2 * texture->xborderpix) / (float)texture->rawwidth;
23962441      d3d->lockedbuf[1].v0 = 0.0f;
23972442      d3d->lockedbuf[2].u0 = 0.0f;
2398      d3d->lockedbuf[2].v0 = (float)(texture->texinfo.height + 2 * texture->borderpix) / (float)texture->rawheight;
2399      d3d->lockedbuf[3].u0 = (float)(texture->texinfo.width + 2 * texture->borderpix) / (float)texture->rawwidth;
2400      d3d->lockedbuf[3].v0 = (float)(texture->texinfo.height + 2 * texture->borderpix) / (float)texture->rawheight;
2443      d3d->lockedbuf[2].v0 = (float)(texture->texinfo.height + 2 * texture->yborderpix) / (float)texture->rawheight;
2444      d3d->lockedbuf[3].u0 = (float)(texture->texinfo.width + 2 * texture->xborderpix) / (float)texture->rawwidth;
2445      d3d->lockedbuf[3].v0 = (float)(texture->texinfo.height + 2 * texture->yborderpix) / (float)texture->rawheight;
24012446
24022447      // reset the remaining vertex parameters
24032448      for (i = 0; i < 4; i++)
src/osd/winui/mui_util.c
r4057r4058
3131// MAME/MAMEUI headers
3232#include "unzip.h"
3333#include "devintrf.h"
34#include "sndintrf.h"
3435#include "sound/samples.h"
3536#include "winutf8.h"
3637#include "strconv.h"
src/emu/romload.h
r4057r4058
3838   ROMENTRYTYPE_CARTRIDGE,      /* this entry specifies a cartridge (MESS) */
3939   ROMENTRYTYPE_IGNORE,      /* this entry continues loading the previous ROM but throws the data away */
4040   ROMENTRYTYPE_SYSTEM_BIOS,   /* this entry specifies a bios */
41   ROMENTRYTYPE_DEFAULT_BIOS,   /* this entry specifies a default bios */
4142   ROMENTRYTYPE_COUNT
4243};
4344
r4057r4058
140141};
141142
142143
143/* In mamecore.h: typedef struct _rom_load_data rom_load_data; */
144struct _rom_load_data
145{
146   int            warnings;         /* warning count during processing */
147   int            errors;            /* error count during processing */
148144
149   int            romsloaded;         /* current ROMs loaded count */
150   int            romstotal;         /* total number of ROMs to read */
151
152   mame_file *      file;            /* current file */
153
154   UINT8 *         regionbase;         /* base of current region */
155   UINT32         regionlength;      /* length of current region */
156
157   char         errorbuf[4096];      /* accumulated errors */
158   UINT8         tempbuf[65536];      /* temporary buffer */
159};
160
161
162
163145/***************************************************************************
164146    MACROS
165147***************************************************************************/
r4057r4058
176158#define ROMENTRY_ISCOPY(r)         (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_COPY)
177159#define ROMENTRY_ISIGNORE(r)      (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_IGNORE)
178160#define ROMENTRY_ISSYSTEM_BIOS(r)   (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_SYSTEM_BIOS)
161#define ROMENTRY_ISDEFAULT_BIOS(r)   (ROMENTRY_GETTYPE(r) == ROMENTRYTYPE_DEFAULT_BIOS)
179162#define ROMENTRY_ISREGIONEND(r)      (ROMENTRY_ISREGION(r) || ROMENTRY_ISEND(r))
180163
181164/* ----- per-region macros ----- */
r4057r4058
265248
266249/* ----- system BIOS macros ----- */
267250#define ROM_SYSTEM_BIOS(value,name,description)      { name, description, 0, 0, ROMENTRYTYPE_SYSTEM_BIOS | ROM_BIOS(value+1) },
251#define ROM_DEFAULT_BIOS(name)                  { name, NULL, 0, 0, ROMENTRYTYPE_DEFAULT_BIOS },
268252
269253
270254/* ----- disk loading macros ----- */
r4057r4058
287271    FUNCTION PROTOTYPES
288272***************************************************************************/
289273
290/* disk handling */
291chd_error open_disk_image(const game_driver *gamedrv, const rom_entry *romp, mame_file **image_file, chd_file **image_chd);
292chd_error open_disk_image_options(core_options *options, const game_driver *gamedrv, const rom_entry *romp, mame_file **image_file, chd_file **image_chd);
293chd_file *get_disk_handle(const char *region);
294void set_disk_handle(const char *region, mame_file *file, chd_file *chd);
295274
296/* ROM processing */
275/* ----- ROM processing ----- */
276
277/* load the ROMs and open the disk  images associated with the given machine */
297278void rom_init(running_machine *machine);
279
280/* return the number of warnings we generated */
298281int rom_load_warnings(void);
282
283
284
285/* ----- ROM iteration ----- */
286
287/* return pointer to first ROM source */
299288const rom_source *rom_first_source(const game_driver *drv, const machine_config *config);
289
290/* return pointer to next ROM source */
300291const rom_source *rom_next_source(const game_driver *drv, const machine_config *config, const rom_source *previous);
292
293/* return pointer to the first ROM region within a source */
301294const rom_entry *rom_first_region(const game_driver *drv, const rom_source *romp);
295
296/* return pointer to the next ROM region within a source */
302297const rom_entry *rom_next_region(const rom_entry *romp);
298
299/* return pointer to the first ROM file within a region */
303300const rom_entry *rom_first_file(const rom_entry *romp);
301
302/* return pointer to the next ROM file within a region */
304303const rom_entry *rom_next_file(const rom_entry *romp);
305const rom_entry *rom_first_chunk(const rom_entry *romp);
306const rom_entry *rom_next_chunk(const rom_entry *romp);
307304
305/* return TRUE if the given rom_source refers to the game driver itself */
308306int rom_source_is_gamedrv(const game_driver *drv, const rom_source *source);
307
308/* return the expected size of a file given the ROM description */
309UINT32 rom_file_size(const rom_entry *romp);
310
311/* return the appropriate name for a rom region */
309312astring *rom_region_name(astring *result, const game_driver *drv, const rom_source *source, const rom_entry *romp);
310313
314
315
316/* ----- disk handling ----- */
317
318/* open a disk image, searching up the parent and loading by checksum */
319chd_error open_disk_image(const game_driver *gamedrv, const rom_entry *romp, mame_file **image_file, chd_file **image_chd);
320
321/* open a disk image, searching up the parent and loading by checksum */
322chd_error open_disk_image_options(core_options *options, const game_driver *gamedrv, const rom_entry *romp, mame_file **image_file, chd_file **image_chd);
323
324/* return a pointer to the CHD file associated with the given region */
325chd_file *get_disk_handle(const char *region);
326
327/* set a pointer to the CHD file associated with the given region */
328void set_disk_handle(const char *region, mame_file *file, chd_file *chd);
329
330
311331#endif   /* __ROMLOAD_H__ */
src/emu/debug/debugcpu.c
r4057r4058
203203      info->read = (cpu_read_func)device_get_info_fct(info->device, CPUINFO_FCT_READ);
204204      info->write = (cpu_write_func)device_get_info_fct(info->device, CPUINFO_FCT_WRITE);
205205      info->readop = (cpu_readop_func)device_get_info_fct(info->device, CPUINFO_FCT_READOP);
206      info->translate = (cpu_translate_func)device_get_info_fct(info->device, CPUINFO_FCT_TRANSLATE);
207      info->disassemble = (cpu_disassemble_func)device_get_info_fct(info->device, CPUINFO_FCT_DISASSEMBLE);
206208
207209      /* allocate a symbol table */
208210      info->symtable = symtable_alloc(global->symtable, (void *)cpu);
r4057r4058
360362
361363
362364/***************************************************************************
365    MEMORY AND DISASSEMBLY HELPERS
366***************************************************************************/
367
368/*-------------------------------------------------
369    debug_cpu_translate - return the physical
370    address corresponding to the given logical
371    address
372-------------------------------------------------*/
373
374int debug_cpu_translate(const address_space *space, int intention, offs_t *address)
375{
376   cpu_debug_data *info = cpu_get_debug_data(space->cpu);
377   if (info->translate != NULL)
378      return (*info->translate)(space->cpu, space->spacenum, intention, address);
379   else
380      return TRUE;
381}
382
383
384/*-------------------------------------------------
385    debug_cpu_disassemble - disassemble a line at
386    a given PC on a given CPU
387-------------------------------------------------*/
388
389offs_t debug_cpu_disassemble(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
390{
391   cpu_debug_data *info = cpu_get_debug_data(device);
392   offs_t result = 0;
393
394   /* check for disassembler override */
395   if (info->dasm_override != NULL)
396      result = (*info->dasm_override)(device, buffer, pc, oprom, opram);
397
398   /* if we have a disassembler, run it */
399   if (result == 0 && info->disassemble != NULL)
400      result = (*info->disassemble)(device, buffer, pc, oprom, opram);
401
402   /* if we still have nothing, output vanilla bytes */
403   if (result == 0)
404   {
405      result = cpu_get_min_opcode_bytes(device);
406      switch (result)
407      {
408         case 1:
409         default:
410            sprintf(buffer, "$%02X", *(UINT8 *)oprom);
411            break;
412
413         case 2:
414            sprintf(buffer, "$%04X", *(UINT16 *)oprom);
415            break;
416
417         case 4:
418            sprintf(buffer, "$%08X", *(UINT32 *)oprom);
419            break;
420
421         case 8:
422            sprintf(buffer, "$%08X%08X", (UINT32)(*(UINT64 *)oprom >> 32), (UINT32)(*(UINT64 *)oprom >> 0));
423            break;
424      }
425   }
426
427   /* make sure we get good results */
428   assert((result & DASMFLAG_LENGTHMASK) != 0);
429#ifdef MAME_DEBUG
430{
431   const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
432   int bytes = memory_address_to_byte(space, result & DASMFLAG_LENGTHMASK);
433   assert(bytes >= cpu_get_min_opcode_bytes(device));
434   assert(bytes <= cpu_get_max_opcode_bytes(device));
435   (void) bytes; /* appease compiler */
436}
437#endif
438
439   return result;
440}
441
442
443/*-------------------------------------------------
444    debug_cpu_set_dasm_override - set an override
445    handler for disassembly
446-------------------------------------------------*/
447
448void debug_cpu_set_dasm_override(const device_config *device, cpu_disassemble_func dasm_override)
449{
450   cpu_debug_data *info = cpu_get_debug_data(device);
451   info->dasm_override = dasm_override;
452}
453
454
455
456/***************************************************************************
363457    CORE DEBUGGER HOOKS
364458***************************************************************************/
365459
r4057r4058
12551349   memory_set_debugger_access(space, global->debugger_access = TRUE);
12561350
12571351   /* translate if necessary; if not mapped, return 0xff */
1258   if (apply_translation && !memory_address_physical(space, TRANSLATE_READ_DEBUG, &address))
1352   if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
12591353      result = 0xff;
12601354
12611355   /* if there is a custom read handler, and it returns TRUE, use that value */
r4057r4058
13081402      memory_set_debugger_access(space, global->debugger_access = TRUE);
13091403
13101404      /* translate if necessary; if not mapped, return 0xffff */
1311      if (apply_translation && !memory_address_physical(space, TRANSLATE_READ_DEBUG, &address))
1405      if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
13121406         result = 0xffff;
13131407
13141408      /* if there is a custom read handler, and it returns TRUE, use that value */
r4057r4058
13631457      memory_set_debugger_access(space, global->debugger_access = TRUE);
13641458
13651459      /* translate if necessary; if not mapped, return 0xffffffff */
1366      if (apply_translation && !memory_address_physical(space, TRANSLATE_READ_DEBUG, &address))
1460      if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
13671461         result = 0xffffffff;
13681462
13691463      /* if there is a custom read handler, and it returns TRUE, use that value */
r4057r4058
14181512      memory_set_debugger_access(space, global->debugger_access = TRUE);
14191513
14201514      /* translate if necessary; if not mapped, return 0xffffffffffffffff */
1421      if (apply_translation && !memory_address_physical(space, TRANSLATE_READ_DEBUG, &address))
1515      if (apply_translation && !debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &address))
14221516         result = ~(UINT64)0;
14231517
14241518      /* if there is a custom read handler, and it returns TRUE, use that value */
r4057r4058
14541548   memory_set_debugger_access(space, global->debugger_access = TRUE);
14551549
14561550   /* translate if necessary; if not mapped, we're done */
1457   if (apply_translation && !memory_address_physical(space, TRANSLATE_WRITE_DEBUG, &address))
1551   if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
14581552      ;
14591553
14601554   /* if there is a custom write handler, and it returns TRUE, use that */
r4057r4058
15071601      memory_set_debugger_access(space, global->debugger_access = TRUE);
15081602
15091603      /* translate if necessary; if not mapped, we're done */
1510      if (apply_translation && !memory_address_physical(space, TRANSLATE_WRITE_DEBUG, &address))
1604      if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
15111605         ;
15121606
15131607      /* if there is a custom write handler, and it returns TRUE, use that */
r4057r4058
15611655      memory_set_debugger_access(space, global->debugger_access = TRUE);
15621656
15631657      /* translate if necessary; if not mapped, we're done */
1564      if (apply_translation && !memory_address_physical(space, TRANSLATE_WRITE_DEBUG, &address))
1658      if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
15651659         ;
15661660
15671661      /* if there is a custom write handler, and it returns TRUE, use that */
r4057r4058
16151709      memory_set_debugger_access(space, global->debugger_access = TRUE);
16161710
16171711      /* translate if necessary; if not mapped, we're done */
1618      if (apply_translation && !memory_address_physical(space, TRANSLATE_WRITE_DEBUG, &address))
1712      if (apply_translation && !debug_cpu_translate(space, TRANSLATE_WRITE_DEBUG, &address))
16191713         ;
16201714
16211715      /* if there is a custom write handler, and it returns TRUE, use that */
r4057r4058
16691763   }
16701764
16711765   /* translate to physical first */
1672   if (!memory_address_physical(space, TRANSLATE_FETCH_DEBUG, &address))
1766   if (!debug_cpu_translate(space, TRANSLATE_FETCH_DEBUG, &address))
16731767      return ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size));
16741768
16751769   /* keep in physical range */
r4057r4058
22622356      argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, TRUE);
22632357   }
22642358
2265   return cpu_dasm(device, buffer, pc, opbuf, argbuf);
2359   return debug_cpu_disassemble(device, buffer, pc, opbuf, argbuf);
22662360}
22672361
22682362
src/emu/debug/debugvw.c
r4057r4058
16901690{
16911691   int minlen = memory_byte_to_address(space, cpu_get_min_opcode_bytes(space->cpu));
16921692   int maxlen = memory_byte_to_address(space, cpu_get_max_opcode_bytes(space->cpu));
1693   offs_t targetpcbyte = memory_address_to_byte(space, targetpc);
1693   offs_t targetpcbyte = memory_address_to_byte(space, targetpc) & space->logbytemask;
16941694   offs_t lastgoodpc = targetpc;
16951695   offs_t fillpcbyte, curpc;
16961696   UINT8 opbuf[1024], argbuf[1024];
r4057r4058
17091709   fillpcbyte = targetpcbyte;
17101710   while (1)
17111711   {
1712      offs_t curpcbyte = memory_address_to_byte(space, curpc);
1712      offs_t curpcbyte = memory_address_to_byte(space, curpc) & space->logbytemask;
17131713      offs_t scanpc;
17141714      int instcount = 0;
17151715      int instlen;
r4057r4058
17251725      /* loop until we get past the target instruction */
17261726      for (scanpc = curpc; scanpc < targetpc; scanpc += instlen)
17271727      {
1728         offs_t scanpcbyte = memory_address_to_byte(space, scanpc);
1728         offs_t scanpcbyte = memory_address_to_byte(space, scanpc) & space->logbytemask;
17291729         offs_t physpcbyte = scanpcbyte;
17301730
17311731         /* get the disassembly, but only if mapped */
17321732         instlen = 1;
1733         if (memory_address_physical(space, TRANSLATE_FETCH, &physpcbyte))
1734            instlen = cpu_dasm(space->cpu, dasmbuffer, scanpc, &opbuf[1000 + scanpcbyte - targetpcbyte], &argbuf[1000 + scanpcbyte - targetpcbyte]) & DASMFLAG_LENGTHMASK;
1733         if (debug_cpu_translate(space, TRANSLATE_FETCH, &physpcbyte))
1734            instlen = debug_cpu_disassemble(space->cpu, dasmbuffer, scanpc, &opbuf[1000 + scanpcbyte - targetpcbyte], &argbuf[1000 + scanpcbyte - targetpcbyte]) & DASMFLAG_LENGTHMASK;
17351735
17361736         /* count this one */
17371737         instcount++;
r4057r4058
18401840   minbytes = cpu_get_min_opcode_bytes(space->cpu);
18411841   maxbytes = cpu_get_max_opcode_bytes(space->cpu);
18421842
1843   /* ensure that the PC is aligned to the minimum opcode size */
1844   pc &= ~memory_byte_to_address_end(space, minbytes - 1);
1845
18431846   /* set the width of the third column according to display mode */
18441847   if (dasmdata->right_column == DASM_RIGHTCOL_RAW || dasmdata->right_column == DASM_RIGHTCOL_ENCRYPTED)
18451848   {
r4057r4058
18791882      int numbytes = 0;
18801883
18811884      /* convert PC to a byte offset */
1882      pcbyte = memory_address_to_byte(space, pc);
1885      pcbyte = memory_address_to_byte(space, pc) & space->logbytemask;
18831886
18841887      /* save a copy of the previous line as a backup if we're only doing one line */
18851888      if (lines == 1)
r4057r4058
18911894
18921895      /* make sure we can translate the address, and then disassemble the result */
18931896      physpcbyte = pcbyte;
1894      if (memory_address_physical(space, TRANSLATE_FETCH_DEBUG, &physpcbyte))
1897      if (debug_cpu_translate(space, TRANSLATE_FETCH_DEBUG, &physpcbyte))
18951898      {
18961899         UINT8 opbuf[64], argbuf[64];
18971900
r4057r4058
19031906         }
19041907
19051908         /* disassemble the result */
1906         pc += numbytes = cpu_dasm(space->cpu, buffer, pc & space->logaddrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
1909         pc += numbytes = debug_cpu_disassemble(space->cpu, buffer, pc & space->logaddrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
19071910      }
19081911      else
19091912         strcpy(buffer, "<unmapped>");
r4057r4058
19151918      if (dasmdata->right_column == DASM_RIGHTCOL_RAW || dasmdata->right_column == DASM_RIGHTCOL_ENCRYPTED)
19161919      {
19171920         /* get the bytes */
1918         numbytes = memory_address_to_byte(space, numbytes);
1921         numbytes = memory_address_to_byte(space, numbytes) & space->logbytemask;
19191922         disasm_view_generate_bytes(space, pcbyte, numbytes, minbytes, &destbuf[dasmdata->divider2], dasmdata->allocated.x - dasmdata->divider2, dasmdata->right_column == DASM_RIGHTCOL_ENCRYPTED);
19201923      }
19211924      else if (dasmdata->right_column == DASM_RIGHTCOL_COMMENTS)
r4057r4058
19951998      exprerr = expression_execute(dasmdata->expression.parsed, &result);
19961999      if (exprerr == EXPRERR_NONE && result != dasmdata->expression.result)
19972000      {
1998         offs_t resultbyte = memory_address_to_byte(space, result);
2001         offs_t resultbyte = memory_address_to_byte(space, result) & space->logbytemask;
19992002
20002003         /* update the result */
20012004         dasmdata->expression.result = result;
r4057r4058
21032106         {
21042107            const cpu_debug_data *cpuinfo = cpu_get_debug_data(space->cpu);
21052108            for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
2106               if (dasmdata->byteaddress[effrow] == memory_address_to_byte(space, bp->address))
2109               if (dasmdata->byteaddress[effrow] == (memory_address_to_byte(space, bp->address) & space->logbytemask))
21072110                  attrib = DCA_CHANGED;
21082111         }
21092112
r4057r4058
30213024      offs_t dummyaddr = offs;
30223025      int ismapped;
30233026
3024      ismapped = memdata->no_translation ? TRUE : memory_address_physical(space, TRANSLATE_READ_DEBUG, &dummyaddr);
3027      ismapped = memdata->no_translation ? TRUE : debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &dummyaddr);
30253028      *data = ~(UINT64)0;
30263029      if (ismapped)
30273030      {
src/emu/debug/debugcpu.h
r4057r4058
100100/* In cpuintrf.h: typedef struct _cpu_debug_data cpu_debug_data; */
101101struct _cpu_debug_data
102102{
103   const device_config *device;            /* CPU device object */
104   symbol_table *   symtable;               /* symbol table for expression evaluation */
105   UINT32         flags;                  /* debugging flags for this CPU */
106   UINT8         opwidth;               /* width of an opcode */
107   offs_t         stepaddr;               /* step target address for DEBUG_FLAG_STEPPING_OVER */
108   int            stepsleft;               /* number of steps left until done */
109   offs_t         stopaddr;               /* stop address for DEBUG_FLAG_STOP_PC */
110   attotime      stoptime;               /* stop time for DEBUG_FLAG_STOP_TIME */
111   int            stopirq;               /* stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT */
112   int            stopexception;            /* stop exception number for DEBUG_FLAG_STOP_EXCEPTION */
113   attotime      endexectime;            /* ending time of the current execution */
114   debug_trace_info trace;                  /* trace info */
115   debug_cpu_breakpoint *bplist;            /* list of breakpoints */
116   debug_hotspot_entry *hotspots;            /* hotspot list */
117   offs_t         pc_history[DEBUG_HISTORY_SIZE]; /* history of recent PCs */
118   UINT32         pc_history_index;         /* current history index */
119   int            hotspot_count;            /* number of hotspots */
120   int            hotspot_threshhold;         /* threshhold for the number of hits to print */
121   cpu_read_func   read;                   /* memory read routine */
122   cpu_write_func   write;                  /* memory write routine */
123   cpu_readop_func   readop;                  /* opcode read routine */
124   debug_instruction_hook_func instrhook;      /* per-instruction callback hook */
125   debug_cpu_watchpoint *wplist[ADDRESS_SPACES]; /* watchpoint lists for each address space */
103   const device_config *   device;                  /* CPU device object */
104   symbol_table *         symtable;               /* symbol table for expression evaluation */
105   UINT32               flags;                  /* debugging flags for this CPU */
106   UINT8               opwidth;               /* width of an opcode */
107   offs_t               stepaddr;               /* step target address for DEBUG_FLAG_STEPPING_OVER */
108   int                  stepsleft;               /* number of steps left until done */
109   offs_t               stopaddr;               /* stop address for DEBUG_FLAG_STOP_PC */
110   attotime            stoptime;               /* stop time for DEBUG_FLAG_STOP_TIME */
111   int                  stopirq;               /* stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT */
112   int                  stopexception;            /* stop exception number for DEBUG_FLAG_STOP_EXCEPTION */
113   attotime            endexectime;            /* ending time of the current execution */
114   debug_trace_info       trace;                  /* trace info */
115   debug_cpu_breakpoint *   bplist;                  /* list of breakpoints */
116   debug_hotspot_entry *   hotspots;               /* hotspot list */
117   offs_t               pc_history[DEBUG_HISTORY_SIZE]; /* history of recent PCs */
118   UINT32               pc_history_index;         /* current history index */
119   int                  hotspot_count;            /* number of hotspots */
120   int                  hotspot_threshhold;         /* threshhold for the number of hits to print */
121   cpu_read_func         read;                   /* memory read routine */
122   cpu_write_func         write;                  /* memory write routine */
123   cpu_readop_func         readop;                  /* opcode read routine */
124   cpu_translate_func       translate;               /* pointer to CPU's translate function */
125   cpu_disassemble_func   disassemble;            /* pointer to CPU's dissasemble function */
126   cpu_disassemble_func    dasm_override;            /* pointer to provided override function */
127   debug_instruction_hook_func instrhook;            /* per-instruction callback hook */
128   debug_cpu_watchpoint *   wplist[ADDRESS_SPACES];      /* watchpoint lists for each address space */
126129};
127130
128131
r4057r4058
199202
200203
201204
205/* ----- memory and disassembly helpers ----- */
206
207/* return the physical address corresponding to the given logical address */
208int debug_cpu_translate(const address_space *space, int intention, offs_t *address);
209
210/* disassemble a line at a given PC on a given CPU */
211offs_t debug_cpu_disassemble(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
212
213/* set an override handler for disassembly */
214void debug_cpu_set_dasm_override(const device_config *device, cpu_disassemble_func dasm_override);
215
216
217
202218/* ----- core debugger hooks ----- */
203219
204220/* the CPU execution system calls this hook before beginning execution for the given CPU */
src/emu/debug/debugcmd.c
r4057r4058
15571557               if (i + j <= endoffset)
15581558               {
15591559                  offs_t curaddr = i + j;
1560                  if (memory_address_physical(space, TRANSLATE_READ, &curaddr))
1560                  if (debug_cpu_translate(space, TRANSLATE_READ, &curaddr))
15611561                  {
15621562                     UINT8 byte = debug_read_byte(space, i + j, TRUE);
15631563                     outdex += sprintf(&output[outdex], " %02X", byte);
r4057r4058
15761576               if (i + j <= endoffset)
15771577               {
15781578                  offs_t curaddr = i + j;
1579                  if (memory_address_physical(space, TRANSLATE_READ_DEBUG, &curaddr))
1579                  if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
15801580                  {
15811581                     UINT16 word = debug_read_word(space, i + j, TRUE);
15821582                     outdex += sprintf(&output[outdex], " %04X", word);
r4057r4058
15951595               if (i + j <= endoffset)
15961596               {
15971597                  offs_t curaddr = i + j;
1598                  if (memory_address_physical(space, TRANSLATE_READ_DEBUG, &curaddr))
1598                  if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
15991599                  {
16001600                     UINT32 dword = debug_read_dword(space, i + j, TRUE);
16011601                     outdex += sprintf(&output[outdex], " %08X", dword);
r4057r4058
16141614               if (i + j <= endoffset)
16151615               {
16161616                  offs_t curaddr = i + j;
1617                  if (memory_address_physical(space, TRANSLATE_READ_DEBUG, &curaddr))
1617                  if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
16181618                  {
16191619                     UINT64 qword = debug_read_qword(space, i + j, TRUE);
16201620                     outdex += sprintf(&output[outdex], " %08X%08X", (UINT32)(qword >> 32), (UINT32)qword);
r4057r4058
16351635         for (j = 0; j < 16 && (i + j) <= endoffset; j++)
16361636         {
16371637            offs_t curaddr = i + j;
1638            if (memory_address_physical(space, TRANSLATE_READ_DEBUG, &curaddr))
1638            if (debug_cpu_translate(space, TRANSLATE_READ_DEBUG, &curaddr))
16391639            {
16401640               UINT8 byte = debug_read_byte(space, i + j, TRUE);
16411641               outdex += sprintf(&output[outdex], "%c", (byte >= 32 && byte < 128) ? byte : '.');
r4057r4058
18091809
18101810      /* make sure we can translate the address */
18111811      tempaddr = pcbyte;
1812      if (memory_address_physical(space, TRANSLATE_FETCH_DEBUG, &tempaddr))
1812      if (debug_cpu_translate(space, TRANSLATE_FETCH_DEBUG, &tempaddr))
18131813      {
18141814         UINT8 opbuf[64], argbuf[64];
18151815
r4057r4058
18211821         }
18221822
18231823         /* disassemble the result */
1824         i += numbytes = cpu_dasm(space->cpu, disasm, offset + i, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
1824         i += numbytes = debug_cpu_disassemble(space->cpu, disasm, offset + i, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
18251825      }
18261826
18271827      /* print the bytes */
r4057r4058
20122012         argbuf[numbytes] = debug_read_opcode(space, pcbyte + numbytes, 1, TRUE);
20132013      }
20142014
2015      cpu_dasm(space->cpu, buffer, pc, opbuf, argbuf);
2015      debug_cpu_disassemble(space->cpu, buffer, pc, opbuf, argbuf);
20162016
20172017      debug_console_printf(machine, "%0*X: %s\n", space->logaddrchars, pc, buffer);
20182018   }
r4057r4058
21022102   {
21032103      static const char *const intnames[] = { "Read", "Write", "Fetch" };
21042104      taddress = memory_address_to_byte(space, address) & space->bytemask;
2105      if (memory_address_physical(space, intention, &taddress))
2105      if (debug_cpu_translate(space, intention, &taddress))
21062106      {
21072107         const char *mapname = memory_get_handler_string(space, intention == TRANSLATE_WRITE_DEBUG, taddress);
21082108         debug_console_printf(machine, "%7s: %08X logical == %08X physical -> %s\n", intnames[intention & 3], (UINT32)address, memory_byte_to_address(space, taddress), mapname);
src/emu/debug/debugcmt.c
r4057r4058
328328      argbuf[i] = debug_read_opcode(space, address + i, 1, TRUE);
329329   }
330330
331   numbytes = cpu_dasm(device, buff, address & addrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
331   numbytes = debug_cpu_disassemble(device, buff, address & addrmask, opbuf, argbuf) & DASMFLAG_LENGTHMASK;
332332   numbytes = memory_address_to_byte(space, numbytes);
333333
334334   crc = crc32(0, argbuf, numbytes);
src/emu/cpu/m6809/m6809.c
r4057r4058
373373   m68_state->irq_callback = irqcallback;
374374   m68_state->device = device;
375375
376   m68_state->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
376   m68_state->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
377377
378378   /* setup regtable */
379379
src/emu/cpu/h83002/h8_16.c
r4057r4058
212212
213213   h8->mode_8bit = 0;
214214
215   h8->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
216   h8->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
215   h8->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
216   h8->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
217217
218218   state_save_register_device_item(device, 0, h8->h8err);
219219   state_save_register_device_item_array(device, 0, h8->regs);
src/emu/cpu/h83002/h8_8.c
r4057r4058
222222
223223   h8->mode_8bit = 1;
224224
225   h8->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
226   h8->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
225   h8->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
226   h8->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
227227
228228   state_save_register_device_item(device, 0, h8->h8err);
229229   state_save_register_device_item_array(device, 0, h8->regs);
src/emu/cpu/m68000/m68000.h
r4057r4058
5151enum
5252{
5353   /* NOTE: M68K_SP fetches the current SP, be it USP, ISP, or MSP */
54   M68K_PC=1, M68K_SP, M68K_ISP, M68K_USP, M68K_MSP, M68K_SR, M68K_VBR,
54   M68K_PC, M68K_SP, M68K_ISP, M68K_USP, M68K_MSP, M68K_SR, M68K_VBR,
5555   M68K_SFC, M68K_DFC, M68K_CACR, M68K_CAAR, M68K_PREF_ADDR, M68K_PREF_DATA,
5656   M68K_D0, M68K_D1, M68K_D2, M68K_D3, M68K_D4, M68K_D5, M68K_D6, M68K_D7,
57   M68K_A0, M68K_A1, M68K_A2, M68K_A3, M68K_A4, M68K_A5, M68K_A6, M68K_A7
57   M68K_A0, M68K_A1, M68K_A2, M68K_A3, M68K_A4, M68K_A5, M68K_A6, M68K_A7,
58
59   M68K_GENPC = REG_GENPC,
60   M68K_GENSP = REG_GENSP,
61   M68K_GENPCBASE = REG_GENPCBASE
5862};
5963
6064enum
src/emu/cpu/m68000/m68kfpu.c
r4057r4058
499499      case 0x00:      // FMOVE
500500      {
501501         REG_FP[dst].f = source;
502         USE_CYCLES(m68k, 4);
502         m68k->remaining_cycles -= 4;
503503         break;
504504      }
505505      case 0x04:      // FSQRT
506506      {
507507         REG_FP[dst].f = sqrt(source);
508508         SET_CONDITION_CODES(m68k, REG_FP[dst]);
509         USE_CYCLES(m68k, 109);
509         m68k->remaining_cycles -= 109;
510510         break;
511511      }
512512      case 0x18:      // FABS
513513      {
514514         REG_FP[dst].f = fabs(source);
515515         SET_CONDITION_CODES(m68k, REG_FP[dst]);
516         USE_CYCLES(m68k, 3);
516         m68k->remaining_cycles -= 3;
517517         break;
518518      }
519519      case 0x1a:      // FNEG
520520      {
521521         REG_FP[dst].f = -source;
522522         SET_CONDITION_CODES(m68k, REG_FP[dst]);
523         USE_CYCLES(m68k, 3);
523         m68k->remaining_cycles -= 3;
524524         break;
525525      }
526526      case 0x20:      // FDIV
527527      {
528528         REG_FP[dst].f /= source;
529         USE_CYCLES(m68k, 43);
529         m68k->remaining_cycles -= 43;
530530         break;
531531      }
532532      case 0x22:      // FADD
533533      {
534534         REG_FP[dst].f += source;
535535         SET_CONDITION_CODES(m68k, REG_FP[dst]);
536         USE_CYCLES(m68k, 9);
536         m68k->remaining_cycles -= 9;
537537         break;
538538      }
539539      case 0x23:      // FMUL
540540      {
541541         REG_FP[dst].f *= source;
542542         SET_CONDITION_CODES(m68k, REG_FP[dst]);
543         USE_CYCLES(m68k, 11);
543         m68k->remaining_cycles -= 11;
544544         break;
545545      }
546546      case 0x28:      // FSUB
547547      {
548548         REG_FP[dst].f -= source;
549549         SET_CONDITION_CODES(m68k, REG_FP[dst]);
550         USE_CYCLES(m68k, 9);
550         m68k->remaining_cycles -= 9;
551551         break;
552552      }
553553      case 0x38:      // FCMP
r4057r4058
555555         fp_reg res;
556556         res.f = REG_FP[dst].f - source;
557557         SET_CONDITION_CODES(m68k, res);
558         USE_CYCLES(m68k, 7);
558         m68k->remaining_cycles -= 7;
559559         break;
560560      }
561561      case 0x3a:      // FTST
r4057r4058
563563         fp_reg res;
564564         res.f = source;
565565         SET_CONDITION_CODES(m68k, res);
566         USE_CYCLES(m68k, 7);
566         m68k->remaining_cycles -= 7;
567567         break;
568568      }
569569
r4057r4058
626626      }
627627   }
628628
629   USE_CYCLES(m68k, 12);
629   m68k->remaining_cycles -= 12;
630630}
631631
632632static void fmove_fpcr(m68ki_cpu_core *m68k, UINT16 w2)
r4057r4058
656656      }
657657   }
658658
659   USE_CYCLES(m68k, 10);
659   m68k->remaining_cycles -= 10;
660660}
661661
662662static void fmovem(m68ki_cpu_core *m68k, UINT16 w2)
r4057r4058
678678               if (reglist & (1 << i))
679679               {
680680                  WRITE_EA_FPE(m68k, ea, REG_FP[i]);
681                  USE_CYCLES(m68k, 2);
681                  m68k->remaining_cycles -= 2;
682682               }
683683            }
684684            break;
r4057r4058
698698               if (reglist & (1 << i))
699699               {
700700                  REG_FP[7-i] = READ_EA_FPE(m68k, ea);
701                  USE_CYCLES(m68k, 2);
701                  m68k->remaining_cycles -= 2;
702702               }
703703            }
704704            break;
r4057r4058
723723      m68ki_branch_16(m68k, offset-2);
724724   }
725725
726   USE_CYCLES(m68k, 7);
726   m68k->remaining_cycles -= 7;
727727}
728728
729729static void fbcc32(m68ki_cpu_core *m68k)
r4057r4058
740740      m68ki_branch_32(m68k, offset-4);
741741   }
742742
743   USE_CYCLES(m68k, 7);
743   m68k->remaining_cycles -= 7;
744744}
745745
746746
src/emu/cpu/m68000/m68kcpu.h
r4057r4058
261261      m68ki_exception_address_error(m68k); \
262262      if(m68k->stopped) \
263263      { \
264         SET_CYCLES(m68k, 0); \
264         if (m68k->remaining_cycles > 0) \
265            m68k->remaining_cycles = 0; \
265266         return m68k->initial_cycles; \
266267      } \
267268   }
r4057r4058
454455
455456
456457
457/* ---------------------------- Cycle Counting ---------------------------- */
458
459#define ADD_CYCLES(M, A)         (M)->remaining_cycles += (A)
460#define USE_CYCLES(M, A)         (M)->remaining_cycles -= (A)
461#define SET_CYCLES(M, A)         (M)->remaining_cycles = A
462#define GET_CYCLES(M)            (M)->remaining_cycles
463#define USE_ALL_CYCLES(M)          (M)->remaining_cycles = 0
464
465
466
467458/* ----------------------------- Read / Write ----------------------------- */
468459
469460/* Read from the current address space */
r4057r4058
601592   offs_t encrypted_start;
602593   offs_t encrypted_end;
603594
595   cpu_state_table state;
596   UINT32      iotemp;
597
604598   /* save state data */
605599   UINT16 save_sr;
606600   UINT8 save_stopped;
r4057r4058
989983
990984   /* Full extension format */
991985
992   USE_CYCLES(m68k, m68ki_ea_idx_cycle_table[extension&0x3f]);
986   m68k->remaining_cycles -= m68ki_ea_idx_cycle_table[extension&0x3f];
993987
994988   /* Check if base register is present */
995989   if(BIT_7(extension))                /* BS */
r4057r4058
15191513   m68ki_jump_vector(m68k, vector);
15201514
15211515   /* Use up some clock cycles */
1522   USE_CYCLES(m68k, m68k->cyc_exception[vector]);
1516   m68k->remaining_cycles -= m68k->cyc_exception[vector];
15231517}
15241518
15251519/* Trap#n stacks a 0 frame but behaves like group2 otherwise */
r4057r4058
15301524   m68ki_jump_vector(m68k, vector);
15311525
15321526   /* Use up some clock cycles */
1533   USE_CYCLES(m68k, m68k->cyc_exception[vector]);
1527   m68k->remaining_cycles -= m68k->cyc_exception[vector];
15341528}
15351529
15361530/* Exception for trace mode */
r4057r4058
15551549   m68k->stopped &= ~STOP_LEVEL_STOP;
15561550
15571551   /* Use up some clock cycles */
1558   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_TRACE]);
1552   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_TRACE];
15591553}
15601554
15611555/* Exception for privilege violation */
r4057r4058
15721566   m68ki_jump_vector(m68k, EXCEPTION_PRIVILEGE_VIOLATION);
15731567
15741568   /* Use up some clock cycles and undo the instruction's cycles */
1575   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_PRIVILEGE_VIOLATION] - m68k->cyc_instruction[m68k->ir]);
1569   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_PRIVILEGE_VIOLATION] - m68k->cyc_instruction[m68k->ir];
15761570}
15771571
15781572/* Exception for A-Line instructions */
r4057r4058
15851579   m68ki_jump_vector(m68k, EXCEPTION_1010);
15861580
15871581   /* Use up some clock cycles and undo the instruction's cycles */
1588   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_1010] - m68k->cyc_instruction[m68k->ir]);
1582   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_1010] - m68k->cyc_instruction[m68k->ir];
15891583}
15901584
15911585/* Exception for F-Line instructions */
r4057r4058
15981592   m68ki_jump_vector(m68k, EXCEPTION_1111);
15991593
16001594   /* Use up some clock cycles and undo the instruction's cycles */
1601   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_1111] - m68k->cyc_instruction[m68k->ir]);
1595   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_1111] - m68k->cyc_instruction[m68k->ir];
16021596}
16031597
16041598/* Exception for illegal instructions */
r4057r4058
16171611   m68ki_jump_vector(m68k, EXCEPTION_ILLEGAL_INSTRUCTION);
16181612
16191613   /* Use up some clock cycles and undo the instruction's cycles */
1620   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_ILLEGAL_INSTRUCTION] - m68k->cyc_instruction[m68k->ir]);
1614   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_ILLEGAL_INSTRUCTION] - m68k->cyc_instruction[m68k->ir];
16211615}
16221616
16231617/* Exception for format errror in RTE */
r4057r4058
16281622   m68ki_jump_vector(m68k, EXCEPTION_FORMAT_ERROR);
16291623
16301624   /* Use up some clock cycles and undo the instruction's cycles */
1631   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_FORMAT_ERROR] - m68k->cyc_instruction[m68k->ir]);
1625   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_FORMAT_ERROR] - m68k->cyc_instruction[m68k->ir];
16321626}
16331627
16341628/* Exception for address error */
r4057r4058
16541648   m68ki_jump_vector(m68k, EXCEPTION_ADDRESS_ERROR);
16551649
16561650   /* Use up some clock cycles and undo the instruction's cycles */
1657   USE_CYCLES(m68k, m68k->cyc_exception[EXCEPTION_ADDRESS_ERROR] - m68k->cyc_instruction[m68k->ir]);
1651   m68k->remaining_cycles -= m68k->cyc_exception[EXCEPTION_ADDRESS_ERROR] - m68k->cyc_instruction[m68k->ir];
16581652}
16591653
16601654
r4057r4058
17161710   m68ki_jump(m68k, new_pc);
17171711
17181712   /* Defer cycle counting until later */
1719   USE_CYCLES(m68k, m68k->cyc_exception[vector]);
1713   m68k->remaining_cycles -= m68k->cyc_exception[vector];
17201714}
17211715
17221716
src/emu/cpu/m68000/m68k_in.c
r4057r4058
18441844   UINT32 res = src >> shift;
18451845
18461846   if(shift != 0)
1847      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
1847      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
18481848
18491849   if(GET_MSB_8(src))
18501850      res |= m68ki_shift_8_table[shift];
r4057r4058
18661866   UINT32 res = src >> shift;
18671867
18681868   if(shift != 0)
1869      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
1869      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
18701870
18711871   if(GET_MSB_16(src))
18721872      res |= m68ki_shift_16_table[shift];
r4057r4058
18881888   UINT32 res = src >> shift;
18891889
18901890   if(shift != 0)
1891      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
1891      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
18921892
18931893   if(GET_MSB_32(src))
18941894      res |= m68ki_shift_32_table[shift];
r4057r4058
19111911
19121912   if(shift != 0)
19131913   {
1914      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
1914      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
19151915
19161916      if(shift < 8)
19171917      {
r4057r4058
19631963
19641964   if(shift != 0)
19651965   {
1966      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
1966      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
19671967
19681968      if(shift < 16)
19691969      {
r4057r4058
20152015
20162016   if(shift != 0)
20172017   {
2018      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2018      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
20192019
20202020      if(shift < 32)
20212021      {
r4057r4058
20842084   UINT32 res = MASK_OUT_ABOVE_8(src << shift);
20852085
20862086   if(shift != 0)
2087      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2087      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
20882088
20892089   *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
20902090
r4057r4058
21042104   UINT32 res = MASK_OUT_ABOVE_16(src << shift);
21052105
21062106   if(shift != 0)
2107      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2107      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
21082108
21092109   *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
21102110
r4057r4058
21242124   UINT32 res = MASK_OUT_ABOVE_32(src << shift);
21252125
21262126   if(shift != 0)
2127      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2127      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
21282128
21292129   *r_dst = res;
21302130
r4057r4058
21452145
21462146   if(shift != 0)
21472147   {
2148      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2148      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
21492149
21502150      if(shift < 8)
21512151      {
r4057r4058
21822182
21832183   if(shift != 0)
21842184   {
2185      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2185      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
21862186
21872187      if(shift < 16)
21882188      {
r4057r4058
22192219
22202220   if(shift != 0)
22212221   {
2222      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
2222      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
22232223
22242224      if(shift < 32)
22252225      {
r4057r4058
22712271      m68ki_branch_8(m68k, MASK_OUT_ABOVE_8(m68k->ir));
22722272      return;
22732273   }
2274   USE_CYCLES(m68k, m68k->cyc_bcc_notake_b);
2274   m68k->remaining_cycles -= m68k->cyc_bcc_notake_b;
22752275}
22762276
22772277
r4057r4058
22862286      return;
22872287   }
22882288   REG_PC += 2;
2289   USE_CYCLES(m68k, m68k->cyc_bcc_notake_w);
2289   m68k->remaining_cycles -= m68k->cyc_bcc_notake_w;
22902290}
22912291
22922292
r4057r4058
23132313         m68ki_branch_8(m68k, MASK_OUT_ABOVE_8(m68k->ir));
23142314         return;
23152315      }
2316      USE_CYCLES(m68k, m68k->cyc_bcc_notake_b);
2316      m68k->remaining_cycles -= m68k->cyc_bcc_notake_b;
23172317   }
23182318}
23192319
r4057r4058
31313131{
31323132   m68ki_trace_t0();               /* auto-disable (see m68kcpu.h) */
31333133   m68ki_branch_8(m68k, MASK_OUT_ABOVE_8(m68k->ir));
3134   if(REG_PC == REG_PPC)
3135      USE_ALL_CYCLES(m68k);
3134   if(REG_PC == REG_PPC && m68k->remaining_cycles > 0)
3135      m68k->remaining_cycles = 0;
31363136}
31373137
31383138
r4057r4058
31423142   REG_PC -= 2;
31433143   m68ki_trace_t0();            /* auto-disable (see m68kcpu.h) */
31443144   m68ki_branch_16(m68k, offset);
3145   if(REG_PC == REG_PPC)
3146      USE_ALL_CYCLES(m68k);
3145   if(REG_PC == REG_PPC && m68k->remaining_cycles > 0)
3146      m68k->remaining_cycles = 0;
31473147}
31483148
31493149
r4057r4058
31553155      REG_PC -= 4;
31563156      m68ki_trace_t0();            /* auto-disable (see m68kcpu.h) */
31573157      m68ki_branch_32(m68k, offset);
3158      if(REG_PC == REG_PPC)
3159         USE_ALL_CYCLES(m68k);
3158      if(REG_PC == REG_PPC && m68k->remaining_cycles > 0)
3159         m68k->remaining_cycles = 0;
31603160      return;
31613161   }
31623162   else
31633163   {
31643164      m68ki_trace_t0();               /* auto-disable (see m68kcpu.h) */
31653165      m68ki_branch_8(m68k, MASK_OUT_ABOVE_8(m68k->ir));
3166      if(REG_PC == REG_PPC)
3167         USE_ALL_CYCLES(m68k);
3166      if(REG_PC == REG_PPC && m68k->remaining_cycles > 0)
3167         m68k->remaining_cycles = 0;
31683168   }
31693169}
31703170
r4057r4058
33133313         *compare = MASK_OUT_BELOW_8(*compare) | dest;
33143314      else
33153315      {
3316         USE_CYCLES(m68k, 3);
3316         m68k->remaining_cycles -= 3;
33173317         m68ki_write_8(m68k, ea, MASK_OUT_ABOVE_8(REG_D[(word2 >> 6) & 7]));
33183318      }
33193319      return;
r4057r4058
33423342         *compare = MASK_OUT_BELOW_16(*compare) | dest;
33433343      else
33443344      {
3345         USE_CYCLES(m68k, 3);
3345         m68k->remaining_cycles -= 3;
33463346         m68ki_write_16(m68k, ea, MASK_OUT_ABOVE_16(REG_D[(word2 >> 6) & 7]));
33473347      }
33483348      return;
r4057r4058
33713371         *compare = dest;
33723372      else
33733373      {
3374         USE_CYCLES(m68k, 3);
3374         m68k->remaining_cycles -= 3;
33753375         m68ki_write_32(m68k, ea, REG_D[(word2 >> 6) & 7]);
33763376      }
33773377      return;
r4057r4058
34113411
34123412         if(COND_EQ(m68k))
34133413         {
3414            USE_CYCLES(m68k, 3);
3414            m68k->remaining_cycles -= 3;
34153415            m68ki_write_16(m68k, ea1, REG_D[(word2 >> 22) & 7]);
34163416            m68ki_write_16(m68k, ea2, REG_D[(word2 >> 6) & 7]);
34173417            return;
r4057r4058
34563456
34573457         if(COND_EQ(m68k))
34583458         {
3459            USE_CYCLES(m68k, 3);
3459            m68k->remaining_cycles -= 3;
34603460            m68ki_write_32(m68k, ea1, REG_D[(word2 >> 22) & 7]);
34613461            m68ki_write_32(m68k, ea2, REG_D[(word2 >> 6) & 7]);
34623462            return;
r4057r4058
44374437      REG_PC -= 2;
44384438      m68ki_trace_t0();            /* auto-disable (see m68kcpu.h) */
44394439      m68ki_branch_16(m68k, offset);
4440      USE_CYCLES(m68k, m68k->cyc_dbcc_f_noexp);
4440      m68k->remaining_cycles -= m68k->cyc_dbcc_f_noexp;
44414441      return;
44424442   }
44434443   REG_PC += 2;
4444   USE_CYCLES(m68k, m68k->cyc_dbcc_f_exp);
4444   m68k->remaining_cycles -= m68k->cyc_dbcc_f_exp;
44454445}
44464446
44474447
r4057r4058
44594459         REG_PC -= 2;
44604460         m68ki_trace_t0();            /* auto-disable (see m68kcpu.h) */
44614461         m68ki_branch_16(m68k, offset);
4462         USE_CYCLES(m68k, m68k->cyc_dbcc_f_noexp);
4462         m68k->remaining_cycles -= m68k->cyc_dbcc_f_noexp;
44634463         return;
44644464      }
44654465      REG_PC += 2;
4466      USE_CYCLES(m68k, m68k->cyc_dbcc_f_exp);
4466      m68k->remaining_cycles -= m68k->cyc_dbcc_f_exp;
44674467      return;
44684468   }
44694469   REG_PC += 2;
r4057r4058
49934993{
49944994   m68ki_jump(m68k, M68KMAKE_GET_EA_AY_32);
49954995   m68ki_trace_t0();               /* auto-disable (see m68kcpu.h) */
4996   if(REG_PC == REG_PPC)
4997      USE_ALL_CYCLES(m68k);
4996   if(REG_PC == REG_PPC && m68k->remaining_cycles > 0)
4997      m68k->remaining_cycles = 0;
49984998}
49994999
50005000
r4057r4058
50675067   UINT32 res = src >> shift;
50685068
50695069   if(shift != 0)
5070      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5070      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
50715071
50725072   *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
50735073
r4057r4058
50865086   UINT32 res = src >> shift;
50875087
50885088   if(shift != 0)
5089      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5089      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
50905090
50915091   *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
50925092
r4057r4058
51055105   UINT32 res = src >> shift;
51065106
51075107   if(shift != 0)
5108      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5108      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
51095109
51105110   *r_dst = res;
51115111
r4057r4058
51255125
51265126   if(shift != 0)
51275127   {
5128      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5128      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
51295129
51305130      if(shift <= 8)
51315131      {
r4057r4058
51625162
51635163   if(shift != 0)
51645164   {
5165      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5165      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
51665166
51675167      if(shift <= 16)
51685168      {
r4057r4058
51995199
52005200   if(shift != 0)
52015201   {
5202      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5202      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
52035203
52045204      if(shift < 32)
52055205      {
r4057r4058
52495249   UINT32 res = MASK_OUT_ABOVE_8(src << shift);
52505250
52515251   if(shift != 0)
5252      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5252      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
52535253
52545254   *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
52555255
r4057r4058
52685268   UINT32 res = MASK_OUT_ABOVE_16(src << shift);
52695269
52705270   if(shift != 0)
5271      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5271      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
52725272
52735273   *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
52745274
r4057r4058
52875287   UINT32 res = MASK_OUT_ABOVE_32(src << shift);
52885288
52895289   if(shift != 0)
5290      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5290      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
52915291
52925292   *r_dst = res;
52935293
r4057r4058
53075307
53085308   if(shift != 0)
53095309   {
5310      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5310      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
53115311
53125312      if(shift <= 8)
53135313      {
r4057r4058
53445344
53455345   if(shift != 0)
53465346   {
5347      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5347      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
53485348
53495349      if(shift <= 16)
53505350      {
r4057r4058
53815381
53825382   if(shift != 0)
53835383   {
5384      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
5384      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
53855385
53865386      if(shift < 32)
53875387      {
r4057r4058
68146814      }
68156815   AY = ea;
68166816
6817   USE_CYCLES(m68k, count<<m68k->cyc_movem_w);
6817   m68k->remaining_cycles -= count<<m68k->cyc_movem_w;
68186818}
68196819
68206820
r4057r4058
68336833         count++;
68346834      }
68356835
6836   USE_CYCLES(m68k, count<<m68k->cyc_movem_w);
6836   m68k->remaining_cycles -= count<<m68k->cyc_movem_w;
68376837}
68386838
68396839
r4057r4058
68546854      }
68556855   AY = ea;
68566856
6857   USE_CYCLES(m68k, count<<m68k->cyc_movem_l);
6857   m68k->remaining_cycles -= count<<m68k->cyc_movem_l;
68586858}
68596859
68606860
r4057r4058
68736873         count++;
68746874      }
68756875
6876   USE_CYCLES(m68k, count<<m68k->cyc_movem_l);
6876   m68k->remaining_cycles -= count<<m68k->cyc_movem_l;
68776877}
68786878
68796879
r4057r4058
68936893      }
68946894   AY = ea;
68956895
6896   USE_CYCLES(m68k, count<<m68k->cyc_movem_w);
6896   m68k->remaining_cycles -= count<<m68k->cyc_movem_w;
68976897}
68986898
68996899
r4057r4058
69126912         count++;
69136913      }
69146914
6915   USE_CYCLES(m68k, count<<m68k->cyc_movem_w);
6915   m68k->remaining_cycles -= count<<m68k->cyc_movem_w;
69166916}
69176917
69186918
r4057r4058
69316931         count++;
69326932      }
69336933
6934   USE_CYCLES(m68k, count<<m68k->cyc_movem_w);
6934   m68k->remaining_cycles -= count<<m68k->cyc_movem_w;
69356935}
69366936
69376937
r4057r4058
69506950         count++;
69516951      }
69526952
6953   USE_CYCLES(m68k, count<<m68k->cyc_movem_w);
6953   m68k->remaining_cycles -= count<<m68k->cyc_movem_w;
69546954}
69556955
69566956
r4057r4058
69706970      }
69716971   AY = ea;
69726972
6973   USE_CYCLES(m68k, count<<m68k->cyc_movem_l);
6973   m68k->remaining_cycles -= count<<m68k->cyc_movem_l;
69746974}
69756975
69766976
r4057r4058
69896989         count++;
69906990      }
69916991
6992   USE_CYCLES(m68k, count<<m68k->cyc_movem_l);
6992   m68k->remaining_cycles -= count<<m68k->cyc_movem_l;
69936993}
69946994
69956995
r4057r4058
70087008         count++;
70097009      }
70107010
7011   USE_CYCLES(m68k, count<<m68k->cyc_movem_l);
7011   m68k->remaining_cycles -= count<<m68k->cyc_movem_l;
70127012}
70137013
70147014
r4057r4058
70277027         count++;
70287028      }
70297029
7030   USE_CYCLES(m68k, count<<m68k->cyc_movem_l);
7030   m68k->remaining_cycles -= count<<m68k->cyc_movem_l;
70317031}
70327032
70337033
r4057r4058
70907090         {
70917091            REG_A[(word2 >> 12) & 7] = MAKE_INT_8(m68ki_read_8_fc(m68k, ea, m68k->sfc));
70927092            if(CPU_TYPE_IS_020_VARIANT(m68k->cpu_type))
7093               USE_CYCLES(m68k, 2);
7093               m68k->remaining_cycles -= 2;
70947094            return;
70957095         }
70967096         /* Memory to data register */
70977097         REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_8(REG_D[(word2 >> 12) & 7]) | m68ki_read_8_fc(m68k, ea, m68k->sfc);
70987098         if(CPU_TYPE_IS_020_VARIANT(m68k->cpu_type))
7099            USE_CYCLES(m68k, 2);
7099            m68k->remaining_cycles -= 2;
71007100         return;
71017101      }
71027102      m68ki_exception_privilege_violation(m68k);
r4057r4058
71257125         {
71267126            REG_A[(word2 >> 12) & 7] = MAKE_INT_16(m68ki_read_16_fc(m68k, ea, m68k->sfc));
71277127            if(CPU_TYPE_IS_020_VARIANT(m68k->cpu_type))
7128               USE_CYCLES(m68k, 2);
7128               m68k->remaining_cycles -= 2;
71297129            return;
71307130         }
71317131         /* Memory to data register */
71327132         REG_D[(word2 >> 12) & 7] = MASK_OUT_BELOW_16(REG_D[(word2 >> 12) & 7]) | m68ki_read_16_fc(m68k, ea, m68k->sfc);
71337133         if(CPU_TYPE_IS_020_VARIANT(m68k->cpu_type))
7134            USE_CYCLES(m68k, 2);
7134            m68k->remaining_cycles -= 2;
71357135         return;
71367136      }
71377137      m68ki_exception_privilege_violation(m68k);
r4057r4058
71557155         {
71567156            m68ki_write_32_fc(m68k, ea, m68k->dfc, REG_DA[(word2 >> 12) & 15]);
71577157            if(CPU_TYPE_IS_020_VARIANT(m68k->cpu_type))
7158               USE_CYCLES(m68k, 2);
7158               m68k->remaining_cycles -= 2;
71597159            return;
71607160         }
71617161         /* Memory to register */
71627162         REG_DA[(word2 >> 12) & 15] = m68ki_read_32_fc(m68k, ea, m68k->sfc);
71637163         if(CPU_TYPE_IS_020_VARIANT(m68k->cpu_type))
7164            USE_CYCLES(m68k, 2);
7164            m68k->remaining_cycles -= 2;
71657165         return;
71667166      }
71677167      m68ki_exception_privilege_violation(m68k);
r4057r4058
80068006   {
80078007      if (m68k->reset_instr_callback != NULL)
80088008         (*m68k->reset_instr_callback)(m68k->device);
8009      USE_CYCLES(m68k, m68k->cyc_reset);
8009      m68k->remaining_cycles -= m68k->cyc_reset;
80108010      return;
80118011   }
80128012   m68ki_exception_privilege_violation(m68k);
r4057r4058
80228022   UINT32 res = ROR_8(src, shift);
80238023
80248024   if(orig_shift != 0)
8025      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8025      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
80268026
80278027   *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
80288028
r4057r4058
80418041   UINT32 res = ROR_16(src, shift);
80428042
80438043   if(shift != 0)
8044      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8044      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
80458045
80468046   *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
80478047
r4057r4058
80608060   UINT32 res = ROR_32(src, shift);
80618061
80628062   if(shift != 0)
8063      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8063      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
80648064
80658065   *r_dst = res;
80668066
r4057r4058
80818081
80828082   if(orig_shift != 0)
80838083   {
8084      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8084      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
80858085
80868086      *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
80878087      m68k->c_flag = src << (8-((shift-1)&7));
r4057r4058
81088108
81098109   if(orig_shift != 0)
81108110   {
8111      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8111      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
81128112
81138113      *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
81148114      m68k->c_flag = (src >> ((shift - 1) & 15)) << 8;
r4057r4058
81358135
81368136   if(orig_shift != 0)
81378137   {
8138      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8138      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
81398139
81408140      *r_dst = res;
81418141      m68k->c_flag = (src >> ((shift - 1) & 31)) << 8;
r4057r4058
81768176   UINT32 res = ROL_8(src, shift);
81778177
81788178   if(orig_shift != 0)
8179      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8179      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
81808180
81818181   *r_dst = MASK_OUT_BELOW_8(*r_dst) | res;
81828182
r4057r4058
81958195   UINT32 res = ROL_16(src, shift);
81968196
81978197   if(shift != 0)
8198      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8198      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
81998199
82008200   *r_dst = MASK_OUT_BELOW_16(*r_dst) | res;
82018201
r4057r4058
82148214   UINT32 res = ROL_32(src, shift);
82158215
82168216   if(shift != 0)
8217      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8217      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
82188218
82198219   *r_dst = res;
82208220
r4057r4058
82358235
82368236   if(orig_shift != 0)
82378237   {
8238      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8238      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
82398239
82408240      if(shift != 0)
82418241      {
r4057r4058
82708270
82718271   if(orig_shift != 0)
82728272   {
8273      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8273      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
82748274
82758275      if(shift != 0)
82768276      {
r4057r4058
83058305
83068306   if(orig_shift != 0)
83078307   {
8308      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8308      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
83098309
83108310      *r_dst = res;
83118311
r4057r4058
83468346   UINT32 res = ROR_9(src | (XFLAG_AS_1(m68k) << 8), shift);
83478347
83488348   if(shift != 0)
8349      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8349      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
83508350
83518351   m68k->c_flag = m68k->x_flag = res;
83528352   res = MASK_OUT_ABOVE_8(res);
r4057r4058
83678367   UINT32 res = ROR_17(src | (XFLAG_AS_1(m68k) << 16), shift);
83688368
83698369   if(shift != 0)
8370      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8370      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
83718371
83728372   m68k->c_flag = m68k->x_flag = res >> 8;
83738373   res = MASK_OUT_ABOVE_16(res);
r4057r4058
83888388   UINT64 res   = src | (((UINT64)XFLAG_AS_1(m68k)) << 32);
83898389
83908390   if(shift != 0)
8391      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8391      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
83928392
83938393   res = ROR_33_64(res, shift);
83948394
r4057r4058
84148414      UINT32 src   = MASK_OUT_ABOVE_8(*r_dst);
84158415      UINT32 res   = ROR_9(src | (XFLAG_AS_1(m68k) << 8), shift);
84168416
8417      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8417      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
84188418
84198419      m68k->c_flag = m68k->x_flag = res;
84208420      res = MASK_OUT_ABOVE_8(res);
r4057r4058
84448444      UINT32 src   = MASK_OUT_ABOVE_16(*r_dst);
84458445      UINT32 res   = ROR_17(src | (XFLAG_AS_1(m68k) << 16), shift);
84468446
8447      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8447      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
84488448
84498449      m68k->c_flag = m68k->x_flag = res >> 8;
84508450      res = MASK_OUT_ABOVE_16(res);
r4057r4058
84768476
84778477      res = ROR_33_64(res, shift);
84788478
8479      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8479      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
84808480
84818481      m68k->c_flag = m68k->x_flag = res >> 24;
84828482      res = MASK_OUT_ABOVE_32(res);
r4057r4058
85208520   UINT32 res = ROL_9(src | (XFLAG_AS_1(m68k) << 8), shift);
85218521
85228522   if(shift != 0)
8523      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8523      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
85248524
85258525   m68k->c_flag = m68k->x_flag = res;
85268526   res = MASK_OUT_ABOVE_8(res);
r4057r4058
85418541   UINT32 res = ROL_17(src | (XFLAG_AS_1(m68k) << 16), shift);
85428542
85438543   if(shift != 0)
8544      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8544      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
85458545
85468546   m68k->c_flag = m68k->x_flag = res >> 8;
85478547   res = MASK_OUT_ABOVE_16(res);
r4057r4058
85628562   UINT64 res   = src | (((UINT64)XFLAG_AS_1(m68k)) << 32);
85638563
85648564   if(shift != 0)
8565      USE_CYCLES(m68k, shift<<m68k->cyc_shift);
8565      m68k->remaining_cycles -= shift<<m68k->cyc_shift;
85668566
85678567   res = ROL_33_64(res, shift);
85688568
r4057r4058
85898589      UINT32 src   = MASK_OUT_ABOVE_8(*r_dst);
85908590      UINT32 res   = ROL_9(src | (XFLAG_AS_1(m68k) << 8), shift);
85918591
8592      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8592      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
85938593
85948594      m68k->c_flag = m68k->x_flag = res;
85958595      res = MASK_OUT_ABOVE_8(res);
r4057r4058
86198619      UINT32 src   = MASK_OUT_ABOVE_16(*r_dst);
86208620      UINT32 res   = ROL_17(src | (XFLAG_AS_1(m68k) << 16), shift);
86218621
8622      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8622      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
86238623
86248624      m68k->c_flag = m68k->x_flag = res >> 8;
86258625      res = MASK_OUT_ABOVE_16(res);
r4057r4058
86518651
86528652      res = ROL_33_64(res, shift);
86538653
8654      USE_CYCLES(m68k, orig_shift<<m68k->cyc_shift);
8654      m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
86558655
86568656      m68k->c_flag = m68k->x_flag = res >> 24;
86578657      res = MASK_OUT_ABOVE_32(res);
r4057r4058
90069006   if(M68KMAKE_CC)
90079007   {
90089008      DY |= 0xff;
9009      USE_CYCLES(m68k, m68k->cyc_scc_r_true);
9009      m68k->remaining_cycles -= m68k->cyc_scc_r_true;
90109010      return;
90119011   }
90129012   DY &= 0xffffff00;
src/emu/cpu/m68000/m68kcpu.c
r4057r4058
403403
404404
405405
406/***************************************************************************
407    CPU STATE DESCRIPTION
408***************************************************************************/
409
410#define MASK_ALL                (CPU_TYPE_000 | CPU_TYPE_008 | CPU_TYPE_010 | CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_040)
411#define MASK_24BIT_SPACE         (CPU_TYPE_000 | CPU_TYPE_008 | CPU_TYPE_010 | CPU_TYPE_EC020)
412#define MASK_32BIT_SPACE         (CPU_TYPE_020 | CPU_TYPE_040)
413#define MASK_010_OR_LATER         (CPU_TYPE_010 | CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_040)
414#define MASK_020_OR_LATER         (CPU_TYPE_EC020 | CPU_TYPE_020 | CPU_TYPE_040)
415#define MASK_040_OR_LATER         (CPU_TYPE_040)
416
417#define M68K_STATE_ENTRY(_name, _format, _member, _datamask, _flags, _mask) \
418   CPU_STATE_ENTRY(M68K_##_name, #_name, _format, m68ki_cpu_core, _member, _datamask, _mask, _flags)
419
420static const cpu_state_entry state_array[] =
421{
422   M68K_STATE_ENTRY(PC,  "%06X", pc, 0xffffff, 0, MASK_24BIT_SPACE)
423   M68K_STATE_ENTRY(PC,  "%08X", pc, 0xffffffff, 0, MASK_32BIT_SPACE)
424   M68K_STATE_ENTRY(GENPC, "%06X", pc, 0xffffff, CPUSTATE_NOSHOW, MASK_24BIT_SPACE)
425   M68K_STATE_ENTRY(GENPC, "%08X", pc, 0xffffffff, CPUSTATE_NOSHOW, MASK_32BIT_SPACE)
426   M68K_STATE_ENTRY(GENPCBASE, "%06X", ppc, 0xffffff, CPUSTATE_NOSHOW, MASK_24BIT_SPACE)
427   M68K_STATE_ENTRY(GENPCBASE, "%08X", ppc, 0xffffffff, CPUSTATE_NOSHOW, MASK_32BIT_SPACE)
428
429   M68K_STATE_ENTRY(SP,  "%08X", dar[15], 0xffffffff, 0, MASK_ALL)
430   M68K_STATE_ENTRY(GENSP, "%08X", dar[15], 0xffffffff, CPUSTATE_NOSHOW, MASK_ALL)
431
432   M68K_STATE_ENTRY(ISP, "%08X", iotemp, 0xffffffff, CPUSTATE_IMPORT | CPUSTATE_EXPORT, MASK_ALL)
433   M68K_STATE_ENTRY(USP, "%08X", iotemp, 0xffffffff, CPUSTATE_IMPORT | CPUSTATE_EXPORT, MASK_ALL)
434   M68K_STATE_ENTRY(MSP, "%08X", iotemp, 0xffffffff, CPUSTATE_IMPORT | CPUSTATE_EXPORT, MASK_020_OR_LATER)
435   M68K_STATE_ENTRY(SR, "%04X", iotemp, 0xffff, CPUSTATE_IMPORT | CPUSTATE_EXPORT, MASK_ALL)
436
437   M68K_STATE_ENTRY(D0, "%08X", dar[0], 0xffffffff, 0, MASK_ALL)
438   M68K_STATE_ENTRY(D1, "%08X", dar[1], 0xffffffff, 0, MASK_ALL)
439   M68K_STATE_ENTRY(D2, "%08X", dar[2], 0xffffffff, 0, MASK_ALL)
440   M68K_STATE_ENTRY(D3, "%08X", dar[3], 0xffffffff, 0, MASK_ALL)
441   M68K_STATE_ENTRY(D4, "%08X", dar[4], 0xffffffff, 0, MASK_ALL)
442   M68K_STATE_ENTRY(D5, "%08X", dar[5], 0xffffffff, 0, MASK_ALL)
443   M68K_STATE_ENTRY(D6, "%08X", dar[6], 0xffffffff, 0, MASK_ALL)
444   M68K_STATE_ENTRY(D7, "%08X", dar[7], 0xffffffff, 0, MASK_ALL)
445
446   M68K_STATE_ENTRY(A0, "%08X", dar[8], 0xffffffff, 0, MASK_ALL)
447   M68K_STATE_ENTRY(A1, "%08X", dar[9], 0xffffffff, 0, MASK_ALL)
448   M68K_STATE_ENTRY(A2, "%08X", dar[10], 0xffffffff, 0, MASK_ALL)
449   M68K_STATE_ENTRY(A3, "%08X", dar[11], 0xffffffff, 0, MASK_ALL)
450   M68K_STATE_ENTRY(A4, "%08X", dar[12], 0xffffffff, 0, MASK_ALL)
451   M68K_STATE_ENTRY(A5, "%08X", dar[13], 0xffffffff, 0, MASK_ALL)
452   M68K_STATE_ENTRY(A6, "%08X", dar[14], 0xffffffff, 0, MASK_ALL)
453   M68K_STATE_ENTRY(A7, "%08X", dar[15], 0xffffffff, 0, MASK_ALL)
454
455   M68K_STATE_ENTRY(PREF_ADDR, "%06X", pref_addr, 0xffffff, 0, MASK_24BIT_SPACE)
456   M68K_STATE_ENTRY(PREF_ADDR, "%08X", pref_addr, 0xffffffff, 0, MASK_32BIT_SPACE)
457   M68K_STATE_ENTRY(PREF_DATA, "%08X", pref_data, 0xffffffff, 0, MASK_ALL)
458
459   M68K_STATE_ENTRY(SFC, "%01X", sfc, 0x7, 0, MASK_010_OR_LATER)
460   M68K_STATE_ENTRY(DFC, "%01X", dfc, 0x7, 0, MASK_010_OR_LATER)
461   M68K_STATE_ENTRY(VBR, "%08X", vbr, 0xffffffff, 0, MASK_010_OR_LATER)
462
463   M68K_STATE_ENTRY(CACR, "%08X", cacr, 0xffffffff, 0, MASK_020_OR_LATER)
464   M68K_STATE_ENTRY(CAAR, "%08X", caar, 0xffffffff, 0, MASK_020_OR_LATER)
465};
466
467static const cpu_state_table state_table_template =
468{
469   NULL,                  /* pointer to the base of state (offsets are relative to this) */
470   0,                     /* subtype this table refers to */
471   ARRAY_LENGTH(state_array),   /* number of entries */
472   state_array               /* array of entries */
473};
474
475
476
406477/* ======================================================================== */
407478/* ================================= API ================================== */
408479/* ======================================================================== */
r4057r4058
455526   m68ki_cpu_core *m68k = device->token;
456527
457528   /* Set our pool of clock cycles available */
458   SET_CYCLES(m68k, cycles);
529   m68k->remaining_cycles = cycles;
459530   m68k->initial_cycles = cycles;
460531
461532   /* See if interrupts came in */
r4057r4058
482553         /* Read an instruction and call its handler */
483554         m68k->ir = m68ki_read_imm_16(m68k);
484555         m68ki_instruction_jump_table[m68k->ir](m68k);
485         USE_CYCLES(m68k, m68k->cyc_instruction[m68k->ir]);
556         m68k->remaining_cycles -= m68k->cyc_instruction[m68k->ir];
486557
487558         /* Trace m68k_exception, if necessary */
488559         m68ki_exception_if_trace(); /* auto-disable (see m68kcpu.h) */
489      } while(GET_CYCLES(m68k) > 0);
560      } while (m68k->remaining_cycles > 0);
490561
491562      /* set previous PC to current PC for the next entry into the loop */
492563      REG_PPC = REG_PC;
493564   }
494   else
495      SET_CYCLES(m68k, 0);
565   else if (m68k->remaining_cycles > 0)
566      m68k->remaining_cycles = 0;
496567
497568   /* return how many clocks we used */
498   return m68k->initial_cycles - GET_CYCLES(m68k);
569   return m68k->initial_cycles - m68k->remaining_cycles;
499570}
500571
501572static CPU_INIT( m68k )
r4057r4058
504575   m68ki_cpu_core *m68k = device->token;
505576
506577   m68k->device = device;
507   m68k->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
578   m68k->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
508579   m68k->int_ack_callback = irqcallback;
509580
510581   /* The first call to this function initializes the opcode handler jump table */
r4057r4058
514585      emulation_initialized = 1;
515586   }
516587
588   /* set up the state table */
589   m68k->state = state_table_template;
590   m68k->state.baseptr = m68k;
591
517592   /* Note, D covers A because the dar array is common, REG_A=REG_D+8 */
518593   state_save_register_device_item_array(device, 0, REG_D);
519594   state_save_register_device_item(device, 0, REG_PPC);
r4057r4058
543618
544619   /* Clear all stop levels and eat up all remaining cycles */
545620   m68k->stopped = 0;
546   SET_CYCLES(m68k, 0);
621   if (m68k->remaining_cycles > 0)
622      m68k->remaining_cycles = 0;
547623
548624   m68k->run_mode = RUN_MODE_BERR_AERR_RESET;
549625
r4057r4058
578654   return m68k_disassemble_raw(buffer, pc, oprom, opram, m68k->dasm_type);
579655}
580656
657
658
659/**************************************************************************
660 * STATE IMPORT/EXPORT
661 **************************************************************************/
662
663static CPU_IMPORT_STATE( m68k )
664{
665   m68ki_cpu_core *m68k = device->token;
666
667   switch (entry->index)
668   {
669      case M68K_SR:
670         m68ki_set_sr(m68k, m68k->iotemp);
671         break;
672
673      case M68K_ISP:
674         if (m68k->s_flag && !m68k->m_flag)
675            REG_SP = m68k->iotemp;
676         else
677            REG_ISP = m68k->iotemp;
678         break;
679
680      case M68K_USP:
681         if (!m68k->s_flag)
682            REG_SP = m68k->iotemp;
683         else
684            REG_USP = m68k->iotemp;
685         break;
686
687      case M68K_MSP:
688         if (m68k->s_flag && m68k->m_flag)
689            REG_SP = m68k->iotemp;
690         else
691            REG_MSP = m68k->iotemp;
692         break;
693
694      default:
695         fatalerror("CPU_IMPORT_STATE(m68k) called for unexpected value\n");
696         break;
697   }
698}
699
700
701static CPU_EXPORT_STATE( m68k )
702{
703   m68ki_cpu_core *m68k = device->token;
704
705   switch (entry->index)
706   {
707      case M68K_SR:
708         m68k->iotemp = m68ki_get_sr(m68k);
709         break;
710
711      case M68K_ISP:
712         m68k->iotemp = (m68k->s_flag && !m68k->m_flag) ? REG_SP : REG_ISP;
713         break;
714
715      case M68K_USP:
716         m68k->iotemp = (!m68k->s_flag) ? REG_SP : REG_USP;
717         break;
718
719      case M68K_MSP:
720         m68k->iotemp = (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP;
721         break;
722
723      default:
724         fatalerror("CPU_EXPORT_STATE(m68k) called for unexpected value\n");
725         break;
726   }
727}
728
729static CPU_SET_INFO( m68k )
730{
731   m68ki_cpu_core *m68k = device->token;
732   switch (state)
733   {
734      /* --- the following bits of info are set as 64-bit signed integers --- */
735      case CPUINFO_INT_INPUT_STATE + 0:
736      case CPUINFO_INT_INPUT_STATE + 1:
737      case CPUINFO_INT_INPUT_STATE + 2:
738      case CPUINFO_INT_INPUT_STATE + 3:
739      case CPUINFO_INT_INPUT_STATE + 4:
740      case CPUINFO_INT_INPUT_STATE + 5:
741      case CPUINFO_INT_INPUT_STATE + 6:
742      case CPUINFO_INT_INPUT_STATE + 7:
743      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:
744         set_irq_line(m68k, state - CPUINFO_INT_INPUT_STATE, info->i);
745         break;
746
747      /* --- the following bits of info are set as pointers to data or functions --- */
748      case CPUINFO_FCT_M68K_RESET_CALLBACK:      m68k->reset_instr_callback = (m68k_reset_func)info->f; break;
749      case CPUINFO_FCT_M68K_CMPILD_CALLBACK:      m68k->cmpild_instr_callback = (m68k_cmpild_func)info->f; break;
750      case CPUINFO_FCT_M68K_RTE_CALLBACK:         m68k->rte_instr_callback = (m68k_rte_func)info->f; break;
751      case CPUINFO_FCT_M68K_TAS_CALLBACK:         m68k->tas_instr_callback = (m68k_tas_func)info->f; break;
752   }
753}
754
581755static CPU_GET_INFO( m68k )
582756{
583757   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
r4057r4058
586760   switch (state)
587761   {
588762      /* --- the following bits of info are returned as 64-bit signed integers --- */
589      case CPUINFO_INT_CONTEXT_SIZE:            info->i = sizeof(m68ki_cpu_core);            break;
590      case CPUINFO_INT_INPUT_LINES:            info->i = 8;                           break;
591      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:      info->i = -1;                           break;
592      case CPUINFO_INT_ENDIANNESS:            info->i = ENDIANNESS_BIG;                     break;
593      case CPUINFO_INT_CLOCK_MULTIPLIER:         info->i = 1;                           break;
594      case CPUINFO_INT_CLOCK_DIVIDER:            info->i = 1;                           break;
595      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:      info->i = 2;                           break;
596      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:      info->i = 10;                           break;
597      case CPUINFO_INT_MIN_CYCLES:            info->i = 4;                           break;
598      case CPUINFO_INT_MAX_CYCLES:            info->i = 158;                           break;
763      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(m68ki_cpu_core);      break;
764      case CPUINFO_INT_INPUT_LINES:               info->i = 8;                     break;
765      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = -1;                     break;
766      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_BIG;            break;
767      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
768      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
769      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 2;                     break;
770      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 10;                     break;
771      case CPUINFO_INT_MIN_CYCLES:               info->i = 4;                     break;
772      case CPUINFO_INT_MAX_CYCLES:               info->i = 158;                     break;
599773
600      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 16;                  break;
601      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24;                  break;
602      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0;                  break;
603      case CPUINFO_INT_DATABUS_WIDTH_DATA:   info->i = 0;                  break;
604      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    info->i = 0;                  break;
605      case CPUINFO_INT_ADDRBUS_SHIFT_DATA:    info->i = 0;                  break;
606      case CPUINFO_INT_DATABUS_WIDTH_IO:      info->i = 0;                  break;
607      case CPUINFO_INT_ADDRBUS_WIDTH_IO:       info->i = 0;                  break;
608      case CPUINFO_INT_ADDRBUS_SHIFT_IO:       info->i = 0;                  break;
774      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:         info->i = 16;                     break;
775      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:       info->i = 24;                     break;
776      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM:       info->i = 0;                     break;
609777
610      case CPUINFO_INT_INPUT_STATE + 0:         info->i = 0;  /* there is no level 0 */         break;
611      case CPUINFO_INT_INPUT_STATE + 1:         info->i = (m68k->virq_state >> 1) & 1;         break;
612      case CPUINFO_INT_INPUT_STATE + 2:         info->i = (m68k->virq_state >> 2) & 1;         break;
613      case CPUINFO_INT_INPUT_STATE + 3:         info->i = (m68k->virq_state >> 3) & 1;         break;
614      case CPUINFO_INT_INPUT_STATE + 4:         info->i = (m68k->virq_state >> 4) & 1;         break;
615      case CPUINFO_INT_INPUT_STATE + 5:         info->i = (m68k->virq_state >> 5) & 1;         break;
616      case CPUINFO_INT_INPUT_STATE + 6:         info->i = (m68k->virq_state >> 6) & 1;         break;
617      case CPUINFO_INT_INPUT_STATE + 7:         info->i = (m68k->virq_state >> 7) & 1;         break;
778      case CPUINFO_INT_INPUT_STATE + 0:            info->i = 0;  /* there is no level 0 */   break;
779      case CPUINFO_INT_INPUT_STATE + 1:            info->i = (m68k->virq_state >> 1) & 1;   break;
780      case CPUINFO_INT_INPUT_STATE + 2:            info->i = (m68k->virq_state >> 2) & 1;   break;
781      case CPUINFO_INT_INPUT_STATE + 3:            info->i = (m68k->virq_state >> 3) & 1;   break;
782      case CPUINFO_INT_INPUT_STATE + 4:            info->i = (m68k->virq_state >> 4) & 1;   break;
783      case CPUINFO_INT_INPUT_STATE + 5:            info->i = (m68k->virq_state >> 5) & 1;   break;
784      case CPUINFO_INT_INPUT_STATE + 6:            info->i = (m68k->virq_state >> 6) & 1;   break;
785      case CPUINFO_INT_INPUT_STATE + 7:            info->i = (m68k->virq_state >> 7) & 1;   break;
618786
619      case CPUINFO_INT_PREVIOUSPC:            info->i = REG_PPC;                        break;
787      /* --- the following bits of info are returned as pointers to functions --- */
788      case CPUINFO_FCT_SET_INFO:      info->setinfo = CPU_SET_INFO_NAME(m68k);            break;
789      case CPUINFO_FCT_INIT:         /* set per-core */                              break;
790      case CPUINFO_FCT_RESET:         info->reset = CPU_RESET_NAME(m68k);                  break;
791      case CPUINFO_FCT_EXECUTE:      info->execute = CPU_EXECUTE_NAME(m68k);               break;
792      case CPUINFO_FCT_DISASSEMBLE:   info->disassemble = CPU_DISASSEMBLE_NAME(m68k);         break;
793      case CPUINFO_FCT_IMPORT_STATE:   info->import_state = CPU_IMPORT_STATE_NAME(m68k);      break;
794      case CPUINFO_FCT_EXPORT_STATE:   info->export_state = CPU_EXPORT_STATE_NAME(m68k);      break;
620795
621      case CPUINFO_INT_PC:                  info->i = REG_PC & 0x00ffffff;                break;
622      case CPUINFO_INT_REGISTER + M68K_PC:      info->i = REG_PC;                        break;
623      case CPUINFO_INT_SP:
624      case CPUINFO_INT_REGISTER + M68K_SP:      info->i = REG_SP;                        break;
625      case CPUINFO_INT_REGISTER + M68K_ISP:      info->i = (m68k->s_flag && !m68k->m_flag) ? REG_SP : REG_ISP; break;
626      case CPUINFO_INT_REGISTER + M68K_USP:      info->i = m68k->s_flag ? REG_USP : REG_SP;       break;
627      case CPUINFO_INT_REGISTER + M68K_SR:      info->i = m68ki_get_sr(m68k);               break;
628      case CPUINFO_INT_REGISTER + M68K_D0:      info->i = REG_D[0];                        break;
629      case CPUINFO_INT_REGISTER + M68K_D1:      info->i = REG_D[1];                      break;
630      case CPUINFO_INT_REGISTER + M68K_D2:      info->i = REG_D[2];                      break;
631      case CPUINFO_INT_REGISTER + M68K_D3:      info->i = REG_D[3];                      break;
632      case CPUINFO_INT_REGISTER + M68K_D4:      info->i = REG_D[4];                      break;
633      case CPUINFO_INT_REGISTER + M68K_D5:      info->i = REG_D[5];                      break;
634      case CPUINFO_INT_REGISTER + M68K_D6:      info->i = REG_D[6];                      break;
635      case CPUINFO_INT_REGISTER + M68K_D7:      info->i = REG_D[7];                      break;
636      case CPUINFO_INT_REGISTER + M68K_A0:      info->i = REG_A[0];                      break;
637      case CPUINFO_INT_REGISTER + M68K_A1:      info->i = REG_A[1];                      break;
638      case CPUINFO_INT_REGISTER + M68K_A2:      info->i = REG_A[2];                      break;
639      case CPUINFO_INT_REGISTER + M68K_A3:      info->i = REG_A[3];                      break;
640      case CPUINFO_INT_REGISTER + M68K_A4:      info->i = REG_A[4];                      break;
641      case CPUINFO_INT_REGISTER + M68K_A5:      info->i = REG_A[5];                      break;
642      case CPUINFO_INT_REGISTER + M68K_A6:      info->i = REG_A[6];                      break;
643      case CPUINFO_INT_REGISTER + M68K_A7:      info->i = REG_A[7];                      break;
644      case CPUINFO_INT_REGISTER + M68K_PREF_ADDR:   info->i = m68k->pref_addr;                   break;
645      case CPUINFO_INT_REGISTER + M68K_PREF_DATA:   info->i = m68k->pref_data;                   break;
796      /* --- the following bits of info are returned as pointers --- */
797      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &m68k->remaining_cycles;   break;
798      case CPUINFO_PTR_STATE_TABLE:               info->state_table = &m68k->state;      break;
646799
647      /* --- the following bits of info are returned as pointers to data or functions --- */
648      case CPUINFO_FCT_SET_INFO:               /* set per-core */                        break;
649      case CPUINFO_FCT_INIT:                  /* set per-core */                        break;
650      case CPUINFO_FCT_RESET:                  info->reset = CPU_RESET_NAME(m68k);            break;
651      case CPUINFO_FCT_EXECUTE:               info->execute = CPU_EXECUTE_NAME(m68k);         break;
652      case CPUINFO_FCT_DISASSEMBLE:            info->disassemble = CPU_DISASSEMBLE_NAME(m68k);   break;
653      case CPUINFO_PTR_INSTRUCTION_COUNTER:      info->icount = &m68k->remaining_cycles;         break;
654
655800      /* --- the following bits of info are returned as NULL-terminated strings --- */
656      case CPUINFO_STR_NAME:                  /* set per-core */                        break;
657      case CPUINFO_STR_CORE_FAMILY:            strcpy(info->s, "Motorola 68K");            break;
658      case CPUINFO_STR_CORE_VERSION:            strcpy(info->s, "4.00");                  break;
659      case CPUINFO_STR_CORE_FILE:               strcpy(info->s, __FILE__);                  break;
660      case CPUINFO_STR_CORE_CREDITS:            strcpy(info->s, "Copyright Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
801      case CPUINFO_STR_NAME:                     /* set per-core */                  break;
802      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Motorola 68K");      break;
803      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "4.00");            break;
804      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
805      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Karl Stenerud. All rights reserved. (2.1 fixes HJB)"); break;
661806
662807      case CPUINFO_STR_FLAGS:
663808         sr = m68ki_get_sr(m68k);
r4057r4058
679824            sr & 0x0002 ? 'V':'.',
680825            sr & 0x0001 ? 'C':'.');
681826         break;
682
683      case CPUINFO_STR_REGISTER + M68K_PC:      sprintf(info->s, "PC :%08X", REG_PC);          break;
684      case CPUINFO_STR_REGISTER + M68K_SR:        sprintf(info->s, "SR :%04X", m68ki_get_sr(m68k)); break;
685      case CPUINFO_STR_REGISTER + M68K_SP:        sprintf(info->s, "SP :%08X", REG_SP);          break;
686      case CPUINFO_STR_REGISTER + M68K_ISP:       sprintf(info->s, "ISP:%08X", (m68k->s_flag && !m68k->m_flag) ? REG_SP : REG_ISP); break;
687      case CPUINFO_STR_REGISTER + M68K_USP:       sprintf(info->s, "USP:%08X", m68k->s_flag ? REG_USP : REG_SP); break;
688      case CPUINFO_STR_REGISTER + M68K_D0:      sprintf(info->s, "D0 :%08X", REG_D[0]);       break;
689      case CPUINFO_STR_REGISTER + M68K_D1:      sprintf(info->s, "D1 :%08X", REG_D[1]);       break;
690      case CPUINFO_STR_REGISTER + M68K_D2:      sprintf(info->s, "D2 :%08X", REG_D[2]);       break;
691      case CPUINFO_STR_REGISTER + M68K_D3:      sprintf(info->s, "D3 :%08X", REG_D[3]);       break;
692      case CPUINFO_STR_REGISTER + M68K_D4:      sprintf(info->s, "D4 :%08X", REG_D[4]);       break;
693      case CPUINFO_STR_REGISTER + M68K_D5:      sprintf(info->s, "D5 :%08X", REG_D[5]);       break;
694      case CPUINFO_STR_REGISTER + M68K_D6:      sprintf(info->s, "D6 :%08X", REG_D[6]);       break;
695      case CPUINFO_STR_REGISTER + M68K_D7:      sprintf(info->s, "D7 :%08X", REG_D[7]);       break;
696      case CPUINFO_STR_REGISTER + M68K_A0:      sprintf(info->s, "A0 :%08X", REG_A[0]);       break;
697      case CPUINFO_STR_REGISTER + M68K_A1:      sprintf(info->s, "A1 :%08X", REG_A[1]);       break;
698      case CPUINFO_STR_REGISTER + M68K_A2:      sprintf(info->s, "A2 :%08X", REG_A[2]);       break;
699      case CPUINFO_STR_REGISTER + M68K_A3:      sprintf(info->s, "A3 :%08X", REG_A[3]);       break;
700      case CPUINFO_STR_REGISTER + M68K_A4:      sprintf(info->s, "A4 :%08X", REG_A[4]);       break;
701      case CPUINFO_STR_REGISTER + M68K_A5:      sprintf(info->s, "A5 :%08X", REG_A[5]);       break;
702      case CPUINFO_STR_REGISTER + M68K_A6:      sprintf(info->s, "A6 :%08X", REG_A[6]);       break;
703      case CPUINFO_STR_REGISTER + M68K_A7:      sprintf(info->s, "A7 :%08X", REG_A[7]);       break;
704      case CPUINFO_STR_REGISTER + M68K_PREF_ADDR:   sprintf(info->s, "PAR:%08X", m68k->pref_addr);    break;
705      case CPUINFO_STR_REGISTER + M68K_PREF_DATA:   sprintf(info->s, "PDA:%08X", m68k->pref_data);    break;
706827   }
707828}
708829
709static CPU_SET_INFO( m68k )
710{
711   m68ki_cpu_core *m68k = device->token;
712   switch (state)
713   {
714      /* --- the following bits of info are set as 64-bit signed integers --- */
715      case CPUINFO_INT_INPUT_STATE + 0:         set_irq_line(m68k, 0, info->i);               break;
716      case CPUINFO_INT_INPUT_STATE + 1:         set_irq_line(m68k, 1, info->i);               break;
717      case CPUINFO_INT_INPUT_STATE + 2:         set_irq_line(m68k, 2, info->i);               break;
718      case CPUINFO_INT_INPUT_STATE + 3:         set_irq_line(m68k, 3, info->i);               break;
719      case CPUINFO_INT_INPUT_STATE + 4:         set_irq_line(m68k, 4, info->i);               break;
720      case CPUINFO_INT_INPUT_STATE + 5:         set_irq_line(m68k, 5, info->i);               break;
721      case CPUINFO_INT_INPUT_STATE + 6:         set_irq_line(m68k, 6, info->i);               break;
722      case CPUINFO_INT_INPUT_STATE + INPUT_LINE_NMI:
723      case CPUINFO_INT_INPUT_STATE + 7:         set_irq_line(m68k, 7, info->i);               break;
724830
725      case CPUINFO_INT_PC:                    m68ki_jump(m68k, info->i & 0x00ffffff);       break;
726      case CPUINFO_INT_REGISTER + M68K_PC:        m68ki_jump(m68k, info->i);                  break;
727      case CPUINFO_INT_SP:
728      case CPUINFO_INT_REGISTER + M68K_SP:        REG_SP = info->i;                        break;
729      case CPUINFO_INT_REGISTER + M68K_ISP:       if(m68k->s_flag && !m68k->m_flag)
730                                          REG_SP = info->i;
731                                       else
732                                          REG_ISP = info->i;
733                                       break;
734      case CPUINFO_INT_REGISTER + M68K_USP:       if(m68k->s_flag)
735                                          REG_USP = info->i;
736                                       else
737                                          REG_SP = info->i;
738                                       break;
739      case CPUINFO_INT_REGISTER + M68K_SR:        m68ki_set_sr(m68k, info->i);               break;
740      case CPUINFO_INT_REGISTER + M68K_D0:        REG_D[0] = info->i;                        break;
741      case CPUINFO_INT_REGISTER + M68K_D1:        REG_D[1] = info->i;                        break;
742      case CPUINFO_INT_REGISTER + M68K_D2:        REG_D[2] = info->i;                        break;
743      case CPUINFO_INT_REGISTER + M68K_D3:        REG_D[3] = info->i;                        break;
744      case CPUINFO_INT_REGISTER + M68K_D4:        REG_D[4] = info->i;                        break;
745      case CPUINFO_INT_REGISTER + M68K_D5:        REG_D[5] = info->i;                        break;
746      case CPUINFO_INT_REGISTER + M68K_D6:        REG_D[6] = info->i;                        break;
747      case CPUINFO_INT_REGISTER + M68K_D7:        REG_D[7] = info->i;                        break;
748      case CPUINFO_INT_REGISTER + M68K_A0:        REG_A[0] = info->i;                        break;
749      case CPUINFO_INT_REGISTER + M68K_A1:        REG_A[1] = info->i;                        break;
750      case CPUINFO_INT_REGISTER + M68K_A2:        REG_A[2] = info->i;                        break;
751      case CPUINFO_INT_REGISTER + M68K_A3:        REG_A[3] = info->i;                        break;
752      case CPUINFO_INT_REGISTER + M68K_A4:        REG_A[4] = info->i;                        break;
753      case CPUINFO_INT_REGISTER + M68K_A5:        REG_A[5] = info->i;                        break;
754      case CPUINFO_INT_REGISTER + M68K_A6:        REG_A[6] = info->i;                        break;
755      case CPUINFO_INT_REGISTER + M68K_A7:        REG_A[7] = info->i;                        break;
756      case CPUINFO_INT_REGISTER + M68K_PREF_ADDR:   m68k->pref_addr = info->i;                  break;
757
758      /* --- the following bits of info are set as pointers to data or functions --- */
759      case CPUINFO_FCT_M68K_RESET_CALLBACK:      m68k->reset_instr_callback = (m68k_reset_func)info->f; break;
760      case CPUINFO_FCT_M68K_CMPILD_CALLBACK:      m68k->cmpild_instr_callback = (m68k_cmpild_func)info->f; break;
761      case CPUINFO_FCT_M68K_RTE_CALLBACK:         m68k->rte_instr_callback = (m68k_rte_func)info->f; break;
762      case CPUINFO_FCT_M68K_TAS_CALLBACK:         m68k->tas_instr_callback = (m68k_tas_func)info->f; break;
763   }
764}
765
766
767831/* global access */
768832
769833void m68k_set_encrypted_opcode_range(const device_config *device, offs_t start, offs_t end)
r4057r4058
913977   CPU_INIT_CALL(m68k);
914978
915979   m68k->cpu_type         = CPU_TYPE_000;
980   m68k->state.subtypemask = m68k->cpu_type;
916981   m68k->dasm_type        = M68K_CPU_TYPE_68000;
917982   m68k->memory           = interface_d16;
918983   m68k->sr_mask          = 0xa71f; /* T1 -- S  -- -- I2 I1 I0 -- -- -- X  N  Z  V  C  */
r4057r4058
929994   m68k->cyc_reset        = 132;
930995}
931996
932static CPU_SET_INFO( m68000 )
933{
934   CPU_SET_INFO_CALL(m68k);
935}
936
937997CPU_GET_INFO( m68000 )
938998{
939999   switch (state)
9401000   {
9411001      /* --- the following bits of info are returned as pointers to data or functions --- */
942      case CPUINFO_FCT_SET_INFO:               info->setinfo = CPU_SET_INFO_NAME(m68000);      break;
9431002      case CPUINFO_FCT_INIT:                  info->init = CPU_INIT_NAME(m68000);            break;
9441003
9451004      /* --- the following bits of info are returned as NULL-terminated strings --- */
r4057r4058
9611020   CPU_INIT_CALL(m68k);
9621021
9631022   m68k->cpu_type         = CPU_TYPE_008;
1023   m68k->state.subtypemask = m68k->cpu_type;
9641024   m68k->dasm_type        = M68K_CPU_TYPE_68008;
9651025   m68k->memory           = interface_d8;
9661026   m68k->sr_mask          = 0xa71f; /* T1 -- S  -- -- I2 I1 I0 -- -- -- X  N  Z  V  C  */
r4057r4058
9771037   m68k->cyc_reset        = 132;
9781038}
9791039
980static CPU_SET_INFO( m68008 )
981{
982   CPU_SET_INFO_CALL(m68k);
983}
984
9851040CPU_GET_INFO( m68008 )
9861041{
9871042   switch (state)
9881043   {
9891044      /* --- the following bits of info are returned as 64-bit signed integers --- */
990      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 8;                  break;
991      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 22;                  break;
1045      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:         info->i = 8;                     break;
1046      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:       info->i = 22;                     break;
9921047
9931048      /* --- the following bits of info are returned as pointers to data or functions --- */
994      case CPUINFO_FCT_SET_INFO:               info->setinfo = CPU_SET_INFO_NAME(m68008);      break;
995      case CPUINFO_FCT_INIT:                  info->init = CPU_INIT_NAME(m68008);            break;
1049      case CPUINFO_FCT_INIT:         info->init = CPU_INIT_NAME(m68008);                  break;
9961050
9971051      /* --- the following bits of info are returned as NULL-terminated strings --- */
998      case CPUINFO_STR_NAME:                  strcpy(info->s, "68008");                  break;
1052      case CPUINFO_STR_NAME:                     strcpy(info->s, "68008");            break;
9991053
1000      default:                            CPU_GET_INFO_CALL(m68k);                  break;
1054      default:                               CPU_GET_INFO_CALL(m68k);            break;
10011055   }
10021056}
10031057
r4057r4058
10131067   CPU_INIT_CALL(m68k);
10141068
10151069   m68k->cpu_type         = CPU_TYPE_010;
1070   m68k->state.subtypemask = m68k->cpu_type;
10161071   m68k->dasm_type        = M68K_CPU_TYPE_68010;
10171072   m68k->memory           = interface_d16;
10181073   m68k->sr_mask          = 0xa71f; /* T1 -- S  -- -- I2 I1 I0 -- -- -- X  N  Z  V  C  */
r4057r4058
10291084   m68k->cyc_reset        = 130;
10301085}
10311086
1032static CPU_SET_INFO( m68010 )
1033{
1034   m68ki_cpu_core *m68k = device->token;
1035   switch (state)
1036   {
1037      /* --- the following bits of info are set as 64-bit signed integers --- */
1038      case CPUINFO_INT_REGISTER + M68K_VBR:        m68k->vbr = info->i;                     break;
1039      case CPUINFO_INT_REGISTER + M68K_SFC:        m68k->sfc = info->i & 7;                  break;
1040      case CPUINFO_INT_REGISTER + M68K_DFC:        m68k->dfc = info->i & 7;                  break;
1041
1042      default:                           CPU_SET_INFO_CALL(m68k);                  break;
1043   }
1044}
1045
10461087CPU_GET_INFO( m68010 )
10471088{
1048   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
10491089   switch (state)
10501090   {
1051      /* --- the following bits of info are returned as 64-bit signed integers --- */
1052      case CPUINFO_INT_REGISTER + M68K_VBR:        info->i = m68k->vbr;                     break;
1053      case CPUINFO_INT_REGISTER + M68K_SFC:        info->i = m68k->sfc;                     break;
1054      case CPUINFO_INT_REGISTER + M68K_DFC:        info->i = m68k->dfc;                     break;
1055
10561091      /* --- the following bits of info are returned as pointers to data or functions --- */
1057      case CPUINFO_FCT_SET_INFO:               info->setinfo = CPU_SET_INFO_NAME(m68010);      break;
1058      case CPUINFO_FCT_INIT:                  info->init = CPU_INIT_NAME(m68010);            break;
1092      case CPUINFO_FCT_INIT:         info->init = CPU_INIT_NAME(m68010);                  break;
10591093
10601094      /* --- the following bits of info are returned as NULL-terminated strings --- */
1061      case CPUINFO_STR_NAME:                  strcpy(info->s, "68010");                  break;
1062      case CPUINFO_STR_REGISTER + M68K_SFC:      sprintf(info->s, "SFC:%X",   m68k->sfc);       break;
1063      case CPUINFO_STR_REGISTER + M68K_DFC:      sprintf(info->s, "DFC:%X",   m68k->dfc);       break;
1064      case CPUINFO_STR_REGISTER + M68K_VBR:      sprintf(info->s, "VBR:%08X", m68k->vbr);       break;
1095      case CPUINFO_STR_NAME:                     strcpy(info->s, "68010");            break;
10651096
1066      default:                           CPU_GET_INFO_CALL(m68k);                  break;
1097      default:                              CPU_GET_INFO_CALL(m68k);            break;
10671098   }
10681099}
10691100
r4057r4058
10791110   CPU_INIT_CALL(m68k);
10801111
10811112   m68k->cpu_type         = CPU_TYPE_020;
1113   m68k->state.subtypemask = m68k->cpu_type;
10821114   m68k->dasm_type        = M68K_CPU_TYPE_68020;
10831115   m68k->memory           = interface_d32;
10841116   m68k->sr_mask          = 0xf71f; /* T1 T0 S  M  -- I2 I1 I0 -- -- -- X  N  Z  V  C  */
r4057r4058
10951127   m68k->cyc_reset        = 518;
10961128}
10971129
1098static CPU_SET_INFO( m68020 )
1099{
1100   m68ki_cpu_core *m68k = device->token;
1101   switch (state)
1102   {
1103      /* --- the following bits of info are set as 64-bit signed integers --- */
1104      case CPUINFO_INT_PC:                    m68ki_jump(m68k, info->i);                   break;
1105      case CPUINFO_INT_REGISTER + M68K_MSP:      if(m68k->s_flag && m68k->m_flag)
1106                                          REG_SP = info->i;
1107                                       else
1108                                          REG_MSP = info->i;
1109                                       break;
1110      case CPUINFO_INT_REGISTER + M68K_CACR:      m68k->cacr = info->i;                     break;
1111      case CPUINFO_INT_REGISTER + M68K_CAAR:      m68k->caar = info->i;                     break;
1112      case CPUINFO_INT_REGISTER + M68K_VBR:        m68k->vbr = info->i;                     break;
1113      case CPUINFO_INT_REGISTER + M68K_SFC:        m68k->sfc = info->i & 7;                  break;
1114      case CPUINFO_INT_REGISTER + M68K_DFC:        m68k->dfc = info->i & 7;                  break;
1115
1116      default:                           CPU_SET_INFO_CALL(m68k);                  break;
1117   }
1118}
1119
11201130CPU_GET_INFO( m68020 )
11211131{
11221132   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
r4057r4058
11251135   switch (state)
11261136   {
11271137      /* --- the following bits of info are returned as 64-bit signed integers --- */
1128      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:      info->i = 20;                           break;
1129      case CPUINFO_INT_MIN_CYCLES:            info->i = 2;                           break;
1130      case CPUINFO_INT_MAX_CYCLES:            info->i = 158;                           break;
1138      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 20;                     break;
1139      case CPUINFO_INT_MIN_CYCLES:               info->i = 2;                     break;
1140      case CPUINFO_INT_MAX_CYCLES:               info->i = 158;                     break;
11311141
1132      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 32;                  break;
1133      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32;                  break;
1142      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:         info->i = 32;                     break;
1143      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:       info->i = 32;                     break;
11341144
1135      case CPUINFO_INT_PC:                  info->i = REG_PC;                        break;
1136      case CPUINFO_INT_REGISTER + M68K_MSP:      info->i = (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP; break;
1137      case CPUINFO_INT_REGISTER + M68K_CACR:       info->i = m68k->cacr;                     break;
1138      case CPUINFO_INT_REGISTER + M68K_CAAR:       info->i = m68k->caar;                     break;
1139      case CPUINFO_INT_REGISTER + M68K_VBR:        info->i = m68k->vbr;                     break;
1140      case CPUINFO_INT_REGISTER + M68K_SFC:        info->i = m68k->sfc;                     break;
1141      case CPUINFO_INT_REGISTER + M68K_DFC:        info->i = m68k->dfc;                     break;
1142
11431145      /* --- the following bits of info are returned as pointers to data or functions --- */
1144      case CPUINFO_FCT_SET_INFO:               info->setinfo = CPU_SET_INFO_NAME(m68020);      break;
1145      case CPUINFO_FCT_INIT:                  info->init = CPU_INIT_NAME(m68020);            break;
1146      case CPUINFO_FCT_INIT:         info->init = CPU_INIT_NAME(m68020);                  break;
11461147
11471148      /* --- the following bits of info are returned as NULL-terminated strings --- */
1148      case CPUINFO_STR_NAME:                  strcpy(info->s, "68020");                  break;
1149      case CPUINFO_STR_NAME:                     strcpy(info->s, "68020");            break;
11491150
11501151      case CPUINFO_STR_FLAGS:
11511152         sr = m68ki_get_sr(m68k);
r4057r4058
11681169            sr & 0x0001 ? 'C':'.');
11691170         break;
11701171
1171      case CPUINFO_STR_REGISTER + M68K_MSP:      sprintf(info->s, "MSP:%08X", (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP); break;
1172      case CPUINFO_STR_REGISTER + M68K_CACR:      sprintf(info->s, "CCR:%08X", m68k->cacr);       break;
1173      case CPUINFO_STR_REGISTER + M68K_CAAR:      sprintf(info->s, "CAR:%08X", m68k->caar);       break;
1174      case CPUINFO_STR_REGISTER + M68K_SFC:      sprintf(info->s, "SFC:%X",   m68k->sfc);       break;
1175      case CPUINFO_STR_REGISTER + M68K_DFC:      sprintf(info->s, "DFC:%X",   m68k->dfc);       break;
1176      case CPUINFO_STR_REGISTER + M68K_VBR:      sprintf(info->s, "VBR:%08X", m68k->vbr);       break;
1177
1178      default:                           CPU_GET_INFO_CALL(m68k);                  break;
1172      default:                              CPU_GET_INFO_CALL(m68k);            break;
11791173   }
11801174}
11811175
r4057r4058
11911185   CPU_INIT_CALL(m68k);
11921186
11931187   m68k->cpu_type         = CPU_TYPE_EC020;
1188   m68k->state.subtypemask = m68k->cpu_type;
11941189   m68k->dasm_type        = M68K_CPU_TYPE_68EC020;
11951190   m68k->memory           = interface_d32;
11961191   m68k->sr_mask          = 0xf71f; /* T1 T0 S  M  -- I2 I1 I0 -- -- -- X  N  Z  V  C  */
r4057r4058
12071202   m68k->cyc_reset        = 518;
12081203}
12091204
1210static CPU_SET_INFO( m68ec020 )
1211{
1212   m68ki_cpu_core *m68k = device->token;
1213   switch (state)
1214   {
1215      /* --- the following bits of info are set as 64-bit signed integers --- */
1216      case CPUINFO_INT_PC:                    m68ki_jump(m68k, info->i & 0x00ffffff);       break;
1217
1218      default:                           CPU_SET_INFO_CALL(m68020);                  break;
1219   }
1220}
1221
12221205CPU_GET_INFO( m68ec020 )
12231206{
1224   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
12251207   switch (state)
12261208   {
12271209      /* --- the following bits of info are returned as 64-bit signed integers --- */
1228      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 24;                  break;
1229      case CPUINFO_INT_PC:                  info->i = REG_PC & 0x00ffffff;                break;
1210      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:       info->i = 24;                     break;
12301211
12311212      /* --- the following bits of info are returned as pointers to data or functions --- */
1232      case CPUINFO_FCT_SET_INFO:               info->setinfo = CPU_SET_INFO_NAME(m68ec020);   break;
1233      case CPUINFO_FCT_INIT:                  info->init = CPU_INIT_NAME(m68ec020);         break;
1213      case CPUINFO_FCT_INIT:         info->init = CPU_INIT_NAME(m68ec020);               break;
12341214
12351215      /* --- the following bits of info are returned as NULL-terminated strings --- */
1236      case CPUINFO_STR_NAME:                  strcpy(info->s, "68EC020");                  break;
1216      case CPUINFO_STR_NAME:                     strcpy(info->s, "68EC020");            break;
12371217
1238      default:                           CPU_GET_INFO_CALL(m68020);                  break;
1218      default:                              CPU_GET_INFO_CALL(m68020);            break;
12391219   }
12401220}
12411221
r4057r4058
12501230   CPU_INIT_CALL(m68k);
12511231
12521232   m68k->cpu_type         = CPU_TYPE_040;
1233   m68k->state.subtypemask = m68k->cpu_type;
12531234   m68k->dasm_type        = M68K_CPU_TYPE_68040;
12541235   m68k->memory           = interface_d32;
12551236   m68k->sr_mask          = 0xf71f; /* T1 T0 S  M  -- I2 I1 I0 -- -- -- X  N  Z  V  C  */
r4057r4058
12661247   m68k->cyc_reset        = 518;
12671248}
12681249
1269static CPU_SET_INFO( m68040 )
1270{
1271   m68ki_cpu_core *m68k = device->token;
1272   switch (state)
1273   {
1274      /* --- the following bits of info are set as 64-bit signed integers --- */
1275      case CPUINFO_INT_PC:                    m68ki_jump(m68k, info->i);                   break;
1276      case CPUINFO_INT_REGISTER + M68K_MSP:      if(m68k->s_flag && m68k->m_flag)
1277                                          REG_SP = info->i;
1278                                       else
1279                                          REG_MSP = info->i;
1280                                       break;
1281      case CPUINFO_INT_REGISTER + M68K_CACR:      m68k->cacr = info->i;                     break;
1282      case CPUINFO_INT_REGISTER + M68K_CAAR:      m68k->caar = info->i;                     break;
1283      case CPUINFO_INT_REGISTER + M68K_VBR:        m68k->vbr = info->i;                     break;
1284      case CPUINFO_INT_REGISTER + M68K_SFC:        m68k->sfc = info->i & 7;                  break;
1285      case CPUINFO_INT_REGISTER + M68K_DFC:        m68k->dfc = info->i & 7;                  break;
1286
1287      default:                           CPU_SET_INFO_CALL(m68k);                  break;
1288   }
1289}
1290
12911250CPU_GET_INFO( m68040 )
12921251{
12931252   m68ki_cpu_core *m68k = (device != NULL) ? device->token : NULL;
r4057r4058
12961255   switch (state)
12971256   {
12981257      /* --- the following bits of info are returned as 64-bit signed integers --- */
1299      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:      info->i = 20;                        break;
1300      case CPUINFO_INT_MIN_CYCLES:            info->i = 2;                        break;
1301      case CPUINFO_INT_MAX_CYCLES:            info->i = 158;                        break;
1258      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 20;                     break;
1259      case CPUINFO_INT_MIN_CYCLES:               info->i = 2;                     break;
1260      case CPUINFO_INT_MAX_CYCLES:               info->i = 158;                     break;
13021261
1303      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 32;               break;
1304      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 32;               break;
1262      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:         info->i = 32;                     break;
1263      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:       info->i = 32;                     break;
13051264
1306      case CPUINFO_INT_PC:                  info->i = REG_PC;                        break;
1307      case CPUINFO_INT_REGISTER + M68K_MSP:      info->i = (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP; break;
1308      case CPUINFO_INT_REGISTER + M68K_CACR:       info->i = m68k->cacr;                     break;
1309      case CPUINFO_INT_REGISTER + M68K_CAAR:       info->i = m68k->caar;                     break;
1310      case CPUINFO_INT_REGISTER + M68K_VBR:        info->i = m68k->vbr;                     break;
1311      case CPUINFO_INT_REGISTER + M68K_SFC:        info->i = m68k->sfc;                     break;
1312      case CPUINFO_INT_REGISTER + M68K_DFC:        info->i = m68k->dfc;                     break;
1313
13141265      /* --- the following bits of info are returned as pointers to data or functions --- */
1315      case CPUINFO_FCT_SET_INFO:                  info->setinfo = CPU_SET_INFO_NAME(m68040);      break;
1316      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(m68040);            break;
1266      case CPUINFO_FCT_INIT:         info->init = CPU_INIT_NAME(m68040);                  break;
13171267
13181268      /* --- the following bits of info are returned as NULL-terminated strings --- */
13191269      case CPUINFO_STR_NAME:                     strcpy(info->s, "68040");            break;
r4057r4058
13391289            sr & 0x0001 ? 'C':'.');
13401290         break;
13411291
1342      case CPUINFO_STR_REGISTER + M68K_MSP:      sprintf(info->s, "MSP:%08X", (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP); break;
1343      case CPUINFO_STR_REGISTER + M68K_CACR:      sprintf(info->s, "CCR:%08X", m68k->cacr);       break;
1344      case CPUINFO_STR_REGISTER + M68K_CAAR:      sprintf(info->s, "CAR:%08X", m68k->caar);       break;
1345      case CPUINFO_STR_REGISTER + M68K_SFC:      sprintf(info->s, "SFC:%X",   m68k->sfc);       break;
1346      case CPUINFO_STR_REGISTER + M68K_DFC:      sprintf(info->s, "DFC:%X",   m68k->dfc);       break;
1347      case CPUINFO_STR_REGISTER + M68K_VBR:      sprintf(info->s, "VBR:%08X", m68k->vbr);       break;
1348
1349      default:                           CPU_GET_INFO_CALL(m68k);                  break;
1292      default:                              CPU_GET_INFO_CALL(m68k);            break;
13501293   }
13511294}
src/emu/cpu/ccpu/ccpu.c
r4057r4058
191191
192192   cpustate->icount = cycles;
193193
194   while (cpustate->icount >= 0)
194   do
195195   {
196196      UINT16 tempval;
197197         UINT8 opcode;
r4057r4058
673673            NEXT_ACC_A(cpustate); CYCLES(cpustate, 1);
674674            break;
675675      }
676   }
676   } while (cpustate->icount > 0);
677677
678678   return cycles - cpustate->icount;
679679}
src/emu/cpu/tms34010/tms34010.c
r4057r4058
740740   /* the first time we are run */
741741   tms->reset_deferred = tms->config->halt_on_reset;
742742   if (tms->config->halt_on_reset)
743      tms34010_io_register_w(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff);
743      tms34010_io_register_w(memory_find_address_space(device, ADDRESS_SPACE_PROGRAM), REG_HSTCTLH, 0x8000, 0xffff);
744744}
745745
746746
r4057r4058
16361636      /* control register */
16371637      case TMS34010_HOST_CONTROL:
16381638         tms->external_host_access = TRUE;
1639         space = cpu_get_address_space(tms->device, ADDRESS_SPACE_PROGRAM);
1639         space = memory_find_address_space(tms->device, ADDRESS_SPACE_PROGRAM);
16401640         tms34010_io_register_w(space, REG_HSTCTLH, data & 0xff00, 0xffff);
16411641         tms34010_io_register_w(space, REG_HSTCTLL, data & 0x00ff, 0xffff);
16421642         tms->external_host_access = FALSE;
src/emu/cpu/tms32031/tms32031.c
r4057r4058
364364
365365   tms->irq_callback = irqcallback;
366366   tms->device = device;
367   tms->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
367   tms->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
368368
369369   /* copy in the xf write routines */
370370   tms->bootoffset = (configdata != NULL) ? configdata->bootoffset : 0;
src/emu/cpu/mcs48/mcs48.c
r4057r4058
99
1010    mcs48.c
1111
12    Intel MCS-48 Portable Emulator
12    Intel MCS-48/UPI-41 Portable Emulator
1313
1414    Copyright Mirko Buffoni
1515    Based on the original work Copyright Dan Boris, an 8048 emulator
r4057r4058
3838    8749   128   2k   27  (EPROM)
3939    M58715 128    0       (external ROM)
4040
41****************************************************************************
42
43    UPI-41/42 chips are MCS-48 derived, with some opcode changes:
44
45            MCS-48 opcode       UPI-41/42 opcode
46            -------------       ----------------
47        02: OUTL BUS,A          OUT  DBB,A
48        08: INS  BUS,A          <illegal>
49        22: <illegal>           IN   DBB,A
50        75: ENT0 CLK            <illegal>
51        80: MOVX A,@R0          <illegal>
52        81: MOVX A,@R1          <illegal>
53        86: JNI  <dest>         JOBF <dest>
54        88: ORL  BUS,#n         <illegal>
55        90: MOVX @R0,A          MOV  STS,A
56        91: MOVX @R1,A          <illegal>
57        98: ANL  BUS,#n         <illegal>
58        D6: <illegal>           JNIBF <dest>
59        E5: SEL  MB0            EN   DMA
60        F5: SEL  MB1            EN   FLAGS
61
62    Chip numbers are similar to the MCS-48 series:
63
64    Chip   RAM  ROM  I/O
65    ----   ---  ---  ---
66    8041   128   1k
67    8741   128   1k       (EPROM)
68
69    8042   256   2k
70    8242   256   2k
71    8242   256   2k
72
4173***************************************************************************/
4274
4375#include "debugger.h"
76#include "timer.h"
4477#include "mcs48.h"
4578
4679
r4057r4058
5891#define F_FLAG         0x20
5992#define B_FLAG         0x10
6093
94/* status bits (UPI-41) */
95#define STS_F1         0x08
96#define STS_F0         0x04
97#define STS_IBF         0x02
98#define STS_OBF         0x01
6199
100/* port 2 bits (UPI-41) */
101#define P2_OBF         0x10
102#define P2_NIBF         0x20
103#define P2_DRQ         0x40
104#define P2_NDACK      0x80
62105
106/* enable bits (UPI-41) */
107#define ENABLE_FLAGS   0x01
108#define ENABLE_DMA      0x02
109
110/* feature masks */
111#define MCS48_FEATURE   0x01
112#define UPI41_FEATURE   0x02
113
114
115
63116/***************************************************************************
64117    TYPE DEFINITIONS
65118***************************************************************************/
r4057r4058
68121typedef struct _mcs48_state mcs48_state;
69122struct _mcs48_state
70123{
71   PAIR      prevpc;            /* 16-bit previous program counter */
72   PAIR      pc;               /* 16-bit program counter */
124   UINT16      prevpc;            /* 16-bit previous program counter */
125   UINT16      pc;               /* 16-bit program counter */
126
73127   UINT8      a;               /* 8-bit accumulator */
74128   UINT8 *      regptr;            /* pointer to r0-r7 */
75   UINT8      psw;            /* 8-bit PSW */
129   UINT8      psw;            /* 8-bit cpustate->psw */
76130   UINT8      p1;               /* 8-bit latched port 1 */
77131   UINT8      p2;               /* 8-bit latched port 2 */
78   UINT8      f1;               /* 1-bit flag 1 */
79132   UINT8      ea;               /* 1-bit latched ea input */
80133   UINT8      timer;            /* 8-bit timer */
81134   UINT8      prescaler;         /* 5-bit timer prescaler */
82135   UINT8      t1_history;         /* 8-bit history of the T1 input */
136   UINT8      sts;            /* 8-bit status register (UPI-41 only, except for F1) */
137   UINT8      dbbi;            /* 8-bit input data buffer (UPI-41 only) */
138   UINT8      dbbo;            /* 8-bit output data buffer (UPI-41 only) */
83139
84140   UINT8      irq_state;         /* TRUE if an IRQ is pending */
85141   UINT8      irq_in_progress;   /* TRUE if an IRQ is in progress */
r4057r4058
88144   UINT8      tirq_enabled;      /* TRUE if the timer IRQ is enabled */
89145   UINT8      xirq_enabled;      /* TRUE if the external IRQ is enabled */
90146   UINT8      timecount_enabled;   /* bitmask of timer/counter enabled */
147   UINT8      flags_enabled;      /* TRUE if I/O flags have been enabled (UPI-41 only) */
148   UINT8      dma_enabled;      /* TRUE if DMA has been enabled (UPI-41 only) */
91149
92150   UINT16      a11;            /* A11 value, either 0x000 or 0x800 */
93151
r4057r4058
100158    const address_space *data;
101159    const address_space *io;
102160
103   int         inst_cycles;      /* cycles for the current instruction */
104   UINT8      cpu_feature;      /* processor feature flags */
161   UINT8      feature_mask;      /* processor feature flags */
105162   UINT16      int_rom_size;      /* internal rom size */
163
164   cpu_state_table state;         /* state table */
165   UINT8      rtemp;            /* temporary for import/export */
106166};
107167
108168
109169/* opcode table entry */
110typedef struct _mcs48_opcode mcs48_opcode;
111struct _mcs48_opcode
170typedef int (*mcs48_ophandler)(mcs48_state *state);
171
172
173
174/***************************************************************************
175    CPU STATE DESCRIPTION
176***************************************************************************/
177
178#define MCS48_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \
179   CPU_STATE_ENTRY(MCS48_##_name, #_name, _format, mcs48_state, _member, _datamask, MCS48_FEATURE | UPI41_FEATURE, _flags)
180
181#define UPI41_STATE_ENTRY(_name, _format, _member, _datamask, _flags) \
182   CPU_STATE_ENTRY(MCS48_##_name, #_name, _format, mcs48_state, _member, _datamask, UPI41_FEATURE, _flags)
183
184static const cpu_state_entry state_array[] =
112185{
113   UINT8      cycles;
114   void       (*function)(mcs48_state *);
186   MCS48_STATE_ENTRY(PC, "%03X", pc, 0xfff, 0)
187   MCS48_STATE_ENTRY(GENPC, "%03X", pc, 0xfff, CPUSTATE_NOSHOW)
188   MCS48_STATE_ENTRY(GENPCBASE, "%03X", prevpc, 0xfff, CPUSTATE_NOSHOW)
189
190   MCS48_STATE_ENTRY(GENSP, "%1X", psw, 0x7, CPUSTATE_NOSHOW)
191
192   MCS48_STATE_ENTRY(A, "%02X", a, 0xff, 0)
193   MCS48_STATE_ENTRY(TC, "%02X", timer, 0xff, 0)
194   MCS48_STATE_ENTRY(TPRE, "%02X", prescaler, 0x1f, 0)
195
196   MCS48_STATE_ENTRY(P1, "%02X", p1, 0xff, 0)
197   MCS48_STATE_ENTRY(P2, "%02X", p2, 0xff, 0)
198
199   MCS48_STATE_ENTRY(R0, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
200   MCS48_STATE_ENTRY(R1, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
201   MCS48_STATE_ENTRY(R2, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
202   MCS48_STATE_ENTRY(R3, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
203   MCS48_STATE_ENTRY(R4, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
204   MCS48_STATE_ENTRY(R5, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
205   MCS48_STATE_ENTRY(R6, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
206   MCS48_STATE_ENTRY(R7, "%02X", rtemp, 0xff, CPUSTATE_IMPORT | CPUSTATE_EXPORT)
207
208   MCS48_STATE_ENTRY(EA, "%1u", ea, 0x1, 0)
209
210   UPI41_STATE_ENTRY(STS, "%02X", sts, 0xff, 0)
211   UPI41_STATE_ENTRY(DBBI, "%02X", dbbi, 0xff, 0)
212   UPI41_STATE_ENTRY(DBBO, "%02X", dbbo, 0xff, 0)
115213};
116214
215static const cpu_state_table state_table_template =
216{
217   NULL,                  /* pointer to the base of state (offsets are relative to this) */
218   0,                     /* subtype this table refers to */
219   ARRAY_LENGTH(state_array),   /* number of entries */
220   state_array               /* array of entries */
221};
117222
118223
224
119225/***************************************************************************
120226    MACROS
121227***************************************************************************/
122228
123/*** Cycle times for the jump on condition instructions, are unusual.
124     Condition is tested during the first cycle, so if condition is not
125     met, second address fetch cycle may not really be taken. For now we
126     just use the cycle counts as listed in the i8048 user manual.
127***/
128
129#if 0
130#define ADJUST_CYCLES { inst_cycles -= 1; }   /* Possible real cycles setting */
131#else
132#define ADJUST_CYCLES { }               /* User Manual cycles setting */
133#endif
134
135
136229/* ROM is mapped to ADDRESS_SPACE_PROGRAM */
137230#define program_r(a)   memory_read_byte_8le(cpustate->program, a)
138231
r4057r4058
150243#define bus_r()         memory_read_byte_8le(cpustate->io, MCS48_PORT_BUS)
151244#define bus_w(V)      memory_write_byte_8le(cpustate->io, MCS48_PORT_BUS, V)
152245#define ea_r()         memory_read_byte_8le(cpustate->io, MCS48_PORT_EA)
246#define prog_w(V)      memory_write_byte_8le(cpustate->io, MCS48_PORT_PROG, V)
153247
154/* simplfied access to common bits */
155#undef A
156#define A            cpustate->a
157#undef PC
158#define PC            cpustate->pc.w.l
159#undef PSW
160#define PSW            cpustate->psw
161
162248/* r0-r7 map to memory via the regptr */
163#define R0            cpustate->regptr[0]
164#define R1            cpustate->regptr[1]
165#define R2            cpustate->regptr[2]
166#define R3            cpustate->regptr[3]
167#define R4            cpustate->regptr[4]
168#define R5            cpustate->regptr[5]
169#define R6            cpustate->regptr[6]
170#define R7            cpustate->regptr[7]
249#define R0            regptr[0]
250#define R1            regptr[1]
251#define R2            regptr[2]
252#define R3            regptr[3]
253#define R4            regptr[4]
254#define R5            regptr[5]
255#define R6            regptr[6]
256#define R7            regptr[7]
171257
172/* the carry flag as 0 or 1, used for carry-in */
173#define CARRYIN         ((PSW & C_FLAG) >> 7)
174258
175259
176
177260/***************************************************************************
178261    FUNCTION PROTOTYPES
179262***************************************************************************/
180263
181static void check_irqs(   mcs48_state *cpustate);
264static int check_irqs(mcs48_state *cpustate);
182265
183266
184267
r4057r4058
190273    opcode_fetch - fetch an opcode byte
191274-------------------------------------------------*/
192275
193INLINE UINT8 opcode_fetch(mcs48_state *cpustate, offs_t address)
276INLINE UINT8 opcode_fetch(mcs48_state *cpustate)
194277{
195   return memory_decrypted_read_byte(cpustate->program, address);
278   return memory_decrypted_read_byte(cpustate->program, cpustate->pc++);
196279}
197280
198281
r4057r4058
201284    byte
202285-------------------------------------------------*/
203286
204INLINE UINT8 argument_fetch(mcs48_state *cpustate, offs_t address)
287INLINE UINT8 argument_fetch(mcs48_state *cpustate)
205288{
206   return memory_raw_read_byte(cpustate->program, address);
289   return memory_raw_read_byte(cpustate->program, cpustate->pc++);
207290}
208291
209292
r4057r4058
214297
215298INLINE void update_regptr(mcs48_state *cpustate)
216299{
217   cpustate->regptr = memory_get_write_ptr(cpustate->data, (PSW & B_FLAG) ? 24 : 0);
300   cpustate->regptr = memory_get_write_ptr(cpustate->data, (cpustate->psw & B_FLAG) ? 24 : 0);
218301}
219302
220303
221304/*-------------------------------------------------
222    push_pc_psw - push the PC and PSW values onto
305    push_pc_psw - push the cpustate->pc and cpustate->psw values onto
223306    the stack
224307-------------------------------------------------*/
225308
226309INLINE void push_pc_psw(mcs48_state *cpustate)
227310{
228   UINT8 sp = PSW & 0x07;
229   ram_w(8 + 2*sp, cpustate->pc.b.l);
230   ram_w(9 + 2*sp, (cpustate->pc.b.h & 0x0f) | (PSW & 0xf0));
231   PSW = (PSW & 0xf8) | ((sp + 1) & 0x07);
311   UINT8 sp = cpustate->psw & 0x07;
312   ram_w(8 + 2*sp, cpustate->pc);
313   ram_w(9 + 2*sp, ((cpustate->pc >> 8) & 0x0f) | (cpustate->psw & 0xf0));
314   cpustate->psw = (cpustate->psw & 0xf8) | ((sp + 1) & 0x07);
232315}
233316
234317
r4057r4058
239322
240323INLINE void pull_pc_psw(mcs48_state *cpustate)
241324{
242   UINT8 sp = (PSW - 1) & 0x07;
243   cpustate->pc.b.l = ram_r(8 + 2*sp);
244   cpustate->pc.b.h = ram_r(9 + 2*sp);
245   PSW = (cpustate->pc.b.h & 0xf0) | 0x08 | sp;
246   cpustate->pc.b.h &= 0x0f;
325   UINT8 sp = (cpustate->psw - 1) & 0x07;
326   cpustate->pc = ram_r(8 + 2*sp);
327   cpustate->pc |= ram_r(9 + 2*sp) << 8;
328   cpustate->psw = ((cpustate->pc >> 8) & 0xf0) | 0x08 | sp;
329   cpustate->pc &= 0xfff;
247330   update_regptr(cpustate);
248331}
249332
r4057r4058
255338
256339INLINE void pull_pc(mcs48_state *cpustate)
257340{
258   UINT8 sp = (PSW - 1) & 0x07;
259   cpustate->pc.b.l = ram_r(8 + 2*sp);
260   cpustate->pc.b.h = ram_r(9 + 2*sp) & 0x0f;
261   PSW = (PSW & 0xf0) | 0x08 | sp;
341   UINT8 sp = (cpustate->psw - 1) & 0x07;
342   cpustate->pc = ram_r(8 + 2*sp);
343   cpustate->pc |= ram_r(9 + 2*sp) << 8;
344   cpustate->pc &= 0xfff;
345   cpustate->psw = (cpustate->psw & 0xf0) | 0x08 | sp;
262346}
263347
264348
r4057r4058
269353
270354INLINE void execute_add(mcs48_state *cpustate, UINT8 dat)
271355{
272   UINT16 temp = A + dat;
273   UINT16 temp4 = (A & 0x0f) + (dat & 0x0f);
356   UINT16 temp = cpustate->a + dat;
357   UINT16 temp4 = (cpustate->a & 0x0f) + (dat & 0x0f);
274358
275   PSW &= ~(C_FLAG | A_FLAG);
276   PSW |= (temp4 << 2) & A_FLAG;
277   PSW |= (temp >> 1) & C_FLAG;
278   A = temp;
359   cpustate->psw &= ~(C_FLAG | A_FLAG);
360   cpustate->psw |= (temp4 << 2) & A_FLAG;
361   cpustate->psw |= (temp >> 1) & C_FLAG;
362   cpustate->a = temp;
279363}
280364
281365
r4057r4058
286370
287371INLINE void execute_addc(mcs48_state *cpustate, UINT8 dat)
288372{
289   UINT16 temp = A + dat + CARRYIN;
290   UINT16 temp4 = (A & 0x0f) + (dat & 0x0f) + CARRYIN;
373   UINT8 carryin = (cpustate->psw & C_FLAG) >> 7;
374   UINT16 temp = cpustate->a + dat + carryin;
375   UINT16 temp4 = (cpustate->a & 0x0f) + (dat & 0x0f) + carryin;
291376
292   PSW &= ~(C_FLAG | A_FLAG);
293   PSW |= (temp4 << 2) & A_FLAG;
294   PSW |= (temp >> 1) & C_FLAG;
295   A = temp;
377   cpustate->psw &= ~(C_FLAG | A_FLAG);
378   cpustate->psw |= (temp4 << 2) & A_FLAG;
379   cpustate->psw |= (temp >> 1) & C_FLAG;
380   cpustate->a = temp;
296381}
297382
298383
r4057r4058
304389INLINE void execute_jmp(mcs48_state *cpustate, UINT16 address)
305390{
306391   UINT16 a11 = (cpustate->irq_in_progress) ? 0 : cpustate->a11;
307   PC = address | a11;
392   cpustate->pc = address | a11;
308393}
309394
310395
r4057r4058
327412
328413INLINE void execute_jcc(mcs48_state *cpustate, UINT8 result)
329414{
330   UINT8 offset = argument_fetch(cpustate, PC++);
415   UINT8 offset = argument_fetch(cpustate);
331416   if (result != 0)
332   {
333      PC = ((PC - 1) & 0xf00) | offset;
334   }
417      cpustate->pc = ((cpustate->pc - 1) & 0xf00) | offset;
418}
419
420
421/*-------------------------------------------------
422    p2_mask - return the mask of bits that the
423    code can directly affect
424-------------------------------------------------*/
425
426INLINE UINT8 p2_mask(mcs48_state *cpustate)
427{
428   UINT8 result = 0xff;
429   if ((cpustate->feature_mask & UPI41_FEATURE) == 0)
430      return result;
431   if (cpustate->flags_enabled)
432      result &= ~(P2_OBF | P2_NIBF);
433   if (cpustate->dma_enabled)
434      result &= ~(P2_DRQ | P2_NDACK);
435   return result;
436}
437
438
439/*-------------------------------------------------
440    expander_operation - perform an operation via
441    the 8243 expander chip
442-------------------------------------------------*/
443
444INLINE void expander_operation(mcs48_state *cpustate, UINT8 operation, UINT8 port)
445{
446   /* put opcode/data on low 4 bits of P2 */
447   port_w(2, cpustate->p2 = (cpustate->p2 & 0xf0) | (operation << 2) | (port & 3));
448
449   /* generate high-to-low transition on PROG line */
450   prog_w(0);
451
452   /* put data on low 4 bits of P2 */
453   if (operation != 0)
454      port_w(2, cpustate->p2 = (cpustate->p2 & 0xf0) | (cpustate->a & 0x0f));
335455   else
336      ADJUST_CYCLES;
456      cpustate->a = port_r(2) | 0x0f;
457
458   /* generate low-to-high transition on PROG line */
459   prog_w(1);
337460}
338461
339462
r4057r4058
342465    OPCODE HANDLERS
343466***************************************************************************/
344467
345#define OPHANDLER(_name) static void _name (mcs48_state *cpustate)
468#define OPHANDLER(_name) static int _name(mcs48_state *cpustate)
346469
470#define SPLIT_OPHANDLER(_name, _mcs48name, _upi41name) \
471OPHANDLER(_name) { return (!(cpustate->feature_mask & UPI41_FEATURE)) ? _mcs48name(cpustate) : _upi41name(cpustate); }
472
473
347474OPHANDLER( illegal )
348475{
349   logerror("I8039:  pc = %04x,  Illegal opcode = %02x\n", PC-1, program_r(PC-1));
476   logerror("MCS-48 PC:%04X - Illegal opcode = %02x\n", cpustate->pc - 1, program_r(cpustate->pc - 1));
477   return 1;
350478}
351479
352OPHANDLER( add_a_r0 )      { execute_add(cpustate, R0); }
353OPHANDLER( add_a_r1 )      { execute_add(cpustate, R1); }
354OPHANDLER( add_a_r2 )      { execute_add(cpustate, R2); }
355OPHANDLER( add_a_r3 )      { execute_add(cpustate, R3); }
356OPHANDLER( add_a_r4 )      { execute_add(cpustate, R4); }
357OPHANDLER( add_a_r5 )      { execute_add(cpustate, R5); }
358OPHANDLER( add_a_r6 )      { execute_add(cpustate, R6); }
359OPHANDLER( add_a_r7 )      { execute_add(cpustate, R7); }
360OPHANDLER( add_a_xr0 )      { execute_add(cpustate, ram_r(R0)); }
361OPHANDLER( add_a_xr1 )      { execute_add(cpustate, ram_r(R1)); }
362OPHANDLER( add_a_n )      { execute_add(cpustate, argument_fetch(cpustate, PC++)); }
480OPHANDLER( add_a_r0 )      { execute_add(cpustate, cpustate->R0); return 1; }
481OPHANDLER( add_a_r1 )      { execute_add(cpustate, cpustate->R1); return 1; }
482OPHANDLER( add_a_r2 )      { execute_add(cpustate, cpustate->R2); return 1; }
483OPHANDLER( add_a_r3 )      { execute_add(cpustate, cpustate->R3); return 1; }
484OPHANDLER( add_a_r4 )      { execute_add(cpustate, cpustate->R4); return 1; }
485OPHANDLER( add_a_r5 )      { execute_add(cpustate, cpustate->R5); return 1; }
486OPHANDLER( add_a_r6 )      { execute_add(cpustate, cpustate->R6); return 1; }
487OPHANDLER( add_a_r7 )      { execute_add(cpustate, cpustate->R7); return 1; }
488OPHANDLER( add_a_xr0 )      { execute_add(cpustate, ram_r(cpustate->R0)); return 1; }
489OPHANDLER( add_a_xr1 )      { execute_add(cpustate, ram_r(cpustate->R1)); return 1; }
490OPHANDLER( add_a_n )      { execute_add(cpustate, argument_fetch(cpustate)); return 2; }
363491
364OPHANDLER( adc_a_r0 )      { execute_addc(cpustate, R0); }
365OPHANDLER( adc_a_r1 )      { execute_addc(cpustate, R1); }
366OPHANDLER( adc_a_r2 )      { execute_addc(cpustate, R2); }
367OPHANDLER( adc_a_r3 )      { execute_addc(cpustate, R3); }
368OPHANDLER( adc_a_r4 )      { execute_addc(cpustate, R4); }
369OPHANDLER( adc_a_r5 )      { execute_addc(cpustate, R5); }
370OPHANDLER( adc_a_r6 )      { execute_addc(cpustate, R6); }
371OPHANDLER( adc_a_r7 )      { execute_addc(cpustate, R7); }
372OPHANDLER( adc_a_xr0 )      { execute_addc(cpustate, ram_r(R0)); }
373OPHANDLER( adc_a_xr1 )      { execute_addc(cpustate, ram_r(R1)); }
374OPHANDLER( adc_a_n )      { execute_addc(cpustate, argument_fetch(cpustate, PC++)); }
492OPHANDLER( adc_a_r0 )      { execute_addc(cpustate, cpustate->R0); return 1; }
493OPHANDLER( adc_a_r1 )      { execute_addc(cpustate, cpustate->R1); return 1; }
494OPHANDLER( adc_a_r2 )      { execute_addc(cpustate, cpustate->R2); return 1; }
495OPHANDLER( adc_a_r3 )      { execute_addc(cpustate, cpustate->R3); return 1; }
496OPHANDLER( adc_a_r4 )      { execute_addc(cpustate, cpustate->R4); return 1; }
497OPHANDLER( adc_a_r5 )      { execute_addc(cpustate, cpustate->R5); return 1; }
498OPHANDLER( adc_a_r6 )      { execute_addc(cpustate, cpustate->R6); return 1; }
499OPHANDLER( adc_a_r7 )      { execute_addc(cpustate, cpustate->R7); return 1; }
500OPHANDLER( adc_a_xr0 )      { execute_addc(cpustate, ram_r(cpustate->R0)); return 1; }
501OPHANDLER( adc_a_xr1 )      { execute_addc(cpustate, ram_r(cpustate->R1)); return 1; }
502OPHANDLER( adc_a_n )      { execute_addc(cpustate, argument_fetch(cpustate)); return 2; }
375503
376OPHANDLER( anl_a_r0 )      { A &= R0; }
377OPHANDLER( anl_a_r1 )      { A &= R1; }
378OPHANDLER( anl_a_r2 )      { A &= R2; }
379OPHANDLER( anl_a_r3 )      { A &= R3; }
380OPHANDLER( anl_a_r4 )      { A &= R4; }
381OPHANDLER( anl_a_r5 )      { A &= R5; }
382OPHANDLER( anl_a_r6 )      { A &= R6; }
383OPHANDLER( anl_a_r7 )      { A &= R7; }
384OPHANDLER( anl_a_xr0 )      { A &= ram_r(R0); }
385OPHANDLER( anl_a_xr1 )      { A &= ram_r(R1); }
386OPHANDLER( anl_a_n )      { A &= argument_fetch(cpustate, PC++); }
387OPHANDLER( anl_bus_n )      { bus_w(bus_r() & argument_fetch(cpustate, PC++)); }
388OPHANDLER( anl_p1_n )      { port_w(1, cpustate->p1 &= argument_fetch(cpustate, PC++)); }
389OPHANDLER( anl_p2_n )      { port_w(2, cpustate->p2 &= argument_fetch(cpustate, PC++)); }
504OPHANDLER( anl_a_r0 )      { cpustate->a &= cpustate->R0; return 1; }
505OPHANDLER( anl_a_r1 )      { cpustate->a &= cpustate->R1; return 1; }
506OPHANDLER( anl_a_r2 )      { cpustate->a &= cpustate->R2; return 1; }
507OPHANDLER( anl_a_r3 )      { cpustate->a &= cpustate->R3; return 1; }
508OPHANDLER( anl_a_r4 )      { cpustate->a &= cpustate->R4; return 1; }
509OPHANDLER( anl_a_r5 )      { cpustate->a &= cpustate->R5; return 1; }
510OPHANDLER( anl_a_r6 )      { cpustate->a &= cpustate->R6; return 1; }
511OPHANDLER( anl_a_r7 )      { cpustate->a &= cpustate->R7; return 1; }
512OPHANDLER( anl_a_xr0 )      { cpustate->a &= ram_r(cpustate->R0); return 1; }
513OPHANDLER( anl_a_xr1 )      { cpustate->a &= ram_r(cpustate->R1); return 1; }
514OPHANDLER( anl_a_n )      { cpustate->a &= argument_fetch(cpustate); return 2; }
390515
391OPHANDLER( anld_p4_a )      { port_w(4, port_r(4) & A & 0x0f); }
392OPHANDLER( anld_p5_a )      { port_w(5, port_r(5) & A & 0x0f); }
393OPHANDLER( anld_p6_a )      { port_w(6, port_r(6) & A & 0x0f); }
394OPHANDLER( anld_p7_a )      { port_w(7, port_r(7) & A & 0x0f); }
516OPHANDLER( anl_bus_n )      { bus_w(bus_r() & argument_fetch(cpustate)); return 2; }
517OPHANDLER( anl_p1_n )      { port_w(1, cpustate->p1 &= argument_fetch(cpustate)); return 2; }
518OPHANDLER( anl_p2_n )      { port_w(2, cpustate->p2 &= argument_fetch(cpustate) | ~p2_mask(cpustate)); return 2; }
519OPHANDLER( anld_p4_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_AND, 4); return 2; }
520OPHANDLER( anld_p5_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_AND, 5); return 2; }
521OPHANDLER( anld_p6_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_AND, 6); return 2; }
522OPHANDLER( anld_p7_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_AND, 7); return 2; }
395523
396OPHANDLER( call_0 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x000); }
397OPHANDLER( call_1 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x100); }
398OPHANDLER( call_2 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x200); }
399OPHANDLER( call_3 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x300); }
400OPHANDLER( call_4 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x400); }
401OPHANDLER( call_5 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x500); }
402OPHANDLER( call_6 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x600); }
403OPHANDLER( call_7 )      { execute_call(cpustate, argument_fetch(cpustate, PC++) | 0x700); }
524OPHANDLER( call_0 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x000); return 2; }
525OPHANDLER( call_1 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x100); return 2; }
526OPHANDLER( call_2 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x200); return 2; }
527OPHANDLER( call_3 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x300); return 2; }
528OPHANDLER( call_4 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x400); return 2; }
529OPHANDLER( call_5 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x500); return 2; }
530OPHANDLER( call_6 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x600); return 2; }
531OPHANDLER( call_7 )         { execute_call(cpustate, argument_fetch(cpustate) | 0x700); return 2; }
404532
405OPHANDLER( clr_a )         { A = 0; }
406OPHANDLER( clr_c )         { PSW &= ~C_FLAG; }
407OPHANDLER( clr_f0 )      { PSW &= ~F_FLAG; }
408OPHANDLER( clr_f1 )      { cpustate->f1 = 0; }
533OPHANDLER( clr_a )         { cpustate->a = 0; return 1; }
534OPHANDLER( clr_c )         { cpustate->psw &= ~C_FLAG; return 1; }
535OPHANDLER( clr_f0 )         { cpustate->psw &= ~F_FLAG; cpustate->sts &= ~STS_F0; return 1; }
536OPHANDLER( clr_f1 )         { cpustate->sts &= ~STS_F1; return 1; }
409537
410OPHANDLER( cpl_a )         { A ^= 0xff; }
411OPHANDLER( cpl_c )         { PSW ^= C_FLAG; }
412OPHANDLER( cpl_f0 )      { PSW ^= F_FLAG; }
413OPHANDLER( cpl_f1 )      { cpustate->f1 ^= 1; }
538OPHANDLER( cpl_a )         { cpustate->a ^= 0xff; return 1; }
539OPHANDLER( cpl_c )         { cpustate->psw ^= C_FLAG; return 1; }
540OPHANDLER( cpl_f0 )         { cpustate->psw ^= F_FLAG; cpustate->sts ^= STS_F0; return 1; }
541OPHANDLER( cpl_f1 )         { cpustate->sts ^= STS_F1; return 1; }
414542
415543OPHANDLER( da_a )
416544{
417   if ((A & 0x0f) > 0x09 || (PSW & A_FLAG))
545   if ((cpustate->a & 0x0f) > 0x09 || (cpustate->psw & A_FLAG))
418546   {
419      A += 0x06;
420      if ((A & 0xf0) == 0x00)
421         PSW |= C_FLAG;
547      cpustate->a += 0x06;
548      if ((cpustate->a & 0xf0) == 0x00)
549         cpustate->psw |= C_FLAG;
422550   }
423   if ((A & 0xf0) > 0x90 || (PSW & C_FLAG))
551   if ((cpustate->a & 0xf0) > 0x90 || (cpustate->psw & C_FLAG))
424552   {
425      A += 0x60;
426      PSW |= C_FLAG;
553      cpustate->a += 0x60;
554      cpustate->psw |= C_FLAG;
427555   }
428556   else
429      PSW &= ~C_FLAG;
557      cpustate->psw &= ~C_FLAG;
558   return 1;
430559}
431560
432OPHANDLER( dec_a )         { A--; }
433OPHANDLER( dec_r0 )      { R0--; }
434OPHANDLER( dec_r1 )      { R1--; }
435OPHANDLER( dec_r2 )      { R2--; }
436OPHANDLER( dec_r3 )      { R3--; }
437OPHANDLER( dec_r4 )      { R4--; }
438OPHANDLER( dec_r5 )      { R5--; }
439OPHANDLER( dec_r6 )      { R6--; }
440OPHANDLER( dec_r7 )      { R7--; }
561OPHANDLER( dec_a )         { cpustate->a--; return 1; }
562OPHANDLER( dec_r0 )         { cpustate->R0--; return 1; }
563OPHANDLER( dec_r1 )         { cpustate->R1--; return 1; }
564OPHANDLER( dec_r2 )         { cpustate->R2--; return 1; }
565OPHANDLER( dec_r3 )         { cpustate->R3--; return 1; }
566OPHANDLER( dec_r4 )         { cpustate->R4--; return 1; }
567OPHANDLER( dec_r5 )         { cpustate->R5--; return 1; }
568OPHANDLER( dec_r6 )         { cpustate->R6--; return 1; }
569OPHANDLER( dec_r7 )         { cpustate->R7--; return 1; }
441570
442OPHANDLER( dis_i )         { cpustate->xirq_enabled = FALSE; }
443OPHANDLER( dis_tcnti )      { cpustate->tirq_enabled = FALSE; cpustate->timer_overflow = FALSE; }
571OPHANDLER( dis_i )         { cpustate->xirq_enabled = FALSE; return 1; }
572OPHANDLER( dis_tcnti )      { cpustate->tirq_enabled = FALSE; cpustate->timer_overflow = FALSE; return 1; }
444573
445OPHANDLER( djnz_r0 )      { execute_jcc(cpustate, --R0 != 0); }
446OPHANDLER( djnz_r1 )      { execute_jcc(cpustate, --R1 != 0); }
447OPHANDLER( djnz_r2 )      { execute_jcc(cpustate, --R2 != 0); }
448OPHANDLER( djnz_r3 )      { execute_jcc(cpustate, --R3 != 0); }
449OPHANDLER( djnz_r4 )      { execute_jcc(cpustate, --R4 != 0); }
450OPHANDLER( djnz_r5 )      { execute_jcc(cpustate, --R5 != 0); }
451OPHANDLER( djnz_r6 )      { execute_jcc(cpustate, --R6 != 0); }
452OPHANDLER( djnz_r7 )      { execute_jcc(cpustate, --R7 != 0); }
574OPHANDLER( djnz_r0 )      { execute_jcc(cpustate, --cpustate->R0 != 0); return 2; }
575OPHANDLER( djnz_r1 )      { execute_jcc(cpustate, --cpustate->R1 != 0); return 2; }
576OPHANDLER( djnz_r2 )      { execute_jcc(cpustate, --cpustate->R2 != 0); return 2; }
577OPHANDLER( djnz_r3 )      { execute_jcc(cpustate, --cpustate->R3 != 0); return 2; }
578OPHANDLER( djnz_r4 )      { execute_jcc(cpustate, --cpustate->R4 != 0); return 2; }
579OPHANDLER( djnz_r5 )      { execute_jcc(cpustate, --cpustate->R5 != 0); return 2; }
580OPHANDLER( djnz_r6 )      { execute_jcc(cpustate, --cpustate->R6 != 0); return 2; }
581OPHANDLER( djnz_r7 )      { execute_jcc(cpustate, --cpustate->R7 != 0); return 2; }
453582
454OPHANDLER( en_i )         { cpustate->xirq_enabled = TRUE; check_irqs(cpustate); }
455OPHANDLER( en_tcnti )      { cpustate->tirq_enabled = TRUE; check_irqs(cpustate); }
583OPHANDLER( en_i )         { cpustate->xirq_enabled = TRUE; return 1 + check_irqs(cpustate); }
584OPHANDLER( en_tcnti )      { cpustate->tirq_enabled = TRUE; return 1 + check_irqs(cpustate); }
585OPHANDLER( en_dma )         { cpustate->dma_enabled = TRUE; port_w(2, cpustate->p2); return 1; }
586OPHANDLER( en_flags )      { cpustate->flags_enabled = TRUE; port_w(2, cpustate->p2); return 1; }
587OPHANDLER( ent0_clk )
588{
589   logerror("MCS-48 PC:%04X - Unimplemented opcode = %02x\n", cpustate->pc - 1, program_r(cpustate->pc - 1));
590   return 1;
591}
456592
457OPHANDLER( ento_clk )
593OPHANDLER( in_a_p1 )      { cpustate->a = port_r(1) & cpustate->p1; return 2; }
594OPHANDLER( in_a_p2 )      { cpustate->a = port_r(2) & cpustate->p2; return 2; }
595OPHANDLER( ins_a_bus )      { cpustate->a = bus_r(); return 2; }
596OPHANDLER( in_a_dbb )
458597{
459   logerror("I8039:  pc = %04x,  Unimplemented opcode = %02x\n", PC-1, program_r(PC-1));
598   /* acknowledge the IBF IRQ and clear the bit in STS */
599   if ((cpustate->sts & STS_IBF) != 0 && cpustate->irq_callback != NULL)
600      (*cpustate->irq_callback)(cpustate->device, UPI41_INPUT_IBF);
601   cpustate->sts &= ~STS_IBF;
602
603   /* if P2 flags are enabled, update the state of P2 */
604   if (cpustate->flags_enabled && (cpustate->p2 & P2_NIBF) == 0)
605      port_w(2, cpustate->p2 |= P2_NIBF);
606   cpustate->a = cpustate->dbbi;
607   return 2;
460608}
461609
462OPHANDLER( in_a_p1 )      { A = port_r(1) & cpustate->p1; }
463OPHANDLER( in_a_p2 )      { A = port_r(2) & cpustate->p2; }
464OPHANDLER( ins_a_bus )      { A = bus_r(); }
610OPHANDLER( inc_a )         { cpustate->a++; return 1; }
611OPHANDLER( inc_r0 )         { cpustate->R0++; return 1; }
612OPHANDLER( inc_r1 )         { cpustate->R1++; return 1; }
613OPHANDLER( inc_r2 )         { cpustate->R2++; return 1; }
614OPHANDLER( inc_r3 )         { cpustate->R3++; return 1; }
615OPHANDLER( inc_r4 )         { cpustate->R4++; return 1; }
616OPHANDLER( inc_r5 )         { cpustate->R5++; return 1; }
617OPHANDLER( inc_r6 )         { cpustate->R6++; return 1; }
618OPHANDLER( inc_r7 )         { cpustate->R7++; return 1; }
619OPHANDLER( inc_xr0 )      { ram_w(cpustate->R0, ram_r(cpustate->R0) + 1); return 1; }
620OPHANDLER( inc_xr1 )      { ram_w(cpustate->R1, ram_r(cpustate->R1) + 1); return 1; }
465621
466OPHANDLER( inc_a )         { A++; }
467OPHANDLER( inc_r0 )      { R0++; }
468OPHANDLER( inc_r1 )      { R1++; }
469OPHANDLER( inc_r2 )      { R2++; }
470OPHANDLER( inc_r3 )      { R3++; }
471OPHANDLER( inc_r4 )      { R4++; }
472OPHANDLER( inc_r5 )      { R5++; }
473OPHANDLER( inc_r6 )      { R6++; }
474OPHANDLER( inc_r7 )      { R7++; }
475OPHANDLER( inc_xr0 )      { ram_w(R0, ram_r(R0) + 1); }
476OPHANDLER( inc_xr1 )      { ram_w(R1, ram_r(R1) + 1); }
622OPHANDLER( jb_0 )         { execute_jcc(cpustate, (cpustate->a & 0x01) != 0); return 2; }
623OPHANDLER( jb_1 )         { execute_jcc(cpustate, (cpustate->a & 0x02) != 0); return 2; }
624OPHANDLER( jb_2 )         { execute_jcc(cpustate, (cpustate->a & 0x04) != 0); return 2; }
625OPHANDLER( jb_3 )         { execute_jcc(cpustate, (cpustate->a & 0x08) != 0); return 2; }
626OPHANDLER( jb_4 )         { execute_jcc(cpustate, (cpustate->a & 0x10) != 0); return 2; }
627OPHANDLER( jb_5 )         { execute_jcc(cpustate, (cpustate->a & 0x20) != 0); return 2; }
628OPHANDLER( jb_6 )         { execute_jcc(cpustate, (cpustate->a & 0x40) != 0); return 2; }
629OPHANDLER( jb_7 )         { execute_jcc(cpustate, (cpustate->a & 0x80) != 0); return 2; }
630OPHANDLER( jc )            { execute_jcc(cpustate, (cpustate->psw & C_FLAG) != 0); return 2; }
631OPHANDLER( jf0 )         { execute_jcc(cpustate, (cpustate->psw & F_FLAG) != 0); return 2; }
632OPHANDLER( jf1 )         { execute_jcc(cpustate, (cpustate->sts & STS_F1) != 0); return 2; }
633OPHANDLER( jnc )         { execute_jcc(cpustate, (cpustate->psw & C_FLAG) == 0); return 2; }
634OPHANDLER( jni )         { execute_jcc(cpustate, cpustate->irq_state != 0); return 2; }
635OPHANDLER( jnibf )         { execute_jcc(cpustate, (cpustate->sts & STS_IBF) == 0); return 2; }
636OPHANDLER( jnt_0 )        { execute_jcc(cpustate, test_r(0) == 0); return 2; }
637OPHANDLER( jnt_1 )        { execute_jcc(cpustate, test_r(1) == 0); return 2; }
638OPHANDLER( jnz )         { execute_jcc(cpustate, cpustate->a != 0); return 2; }
639OPHANDLER( jobf )         { execute_jcc(cpustate, (cpustate->sts & STS_OBF) != 0); return 2; }
640OPHANDLER( jtf )         { execute_jcc(cpustate, cpustate->timer_flag); cpustate->timer_flag = FALSE; return 2; }
641OPHANDLER( jt_0 )           { execute_jcc(cpustate, test_r(0) != 0); return 2; }
642OPHANDLER( jt_1 )           { execute_jcc(cpustate, test_r(1) != 0); return 2; }
643OPHANDLER( jz )            { execute_jcc(cpustate, cpustate->a == 0); return 2; }
477644
478OPHANDLER( jb_0 )         { execute_jcc(cpustate, (A & 0x01) != 0); }
479OPHANDLER( jb_1 )         { execute_jcc(cpustate, (A & 0x02) != 0); }
480OPHANDLER( jb_2 )         { execute_jcc(cpustate, (A & 0x04) != 0); }
481OPHANDLER( jb_3 )         { execute_jcc(cpustate, (A & 0x08) != 0); }
482OPHANDLER( jb_4 )         { execute_jcc(cpustate, (A & 0x10) != 0); }
483OPHANDLER( jb_5 )         { execute_jcc(cpustate, (A & 0x20) != 0); }
484OPHANDLER( jb_6 )         { execute_jcc(cpustate, (A & 0x40) != 0); }
485OPHANDLER( jb_7 )         { execute_jcc(cpustate, (A & 0x80) != 0); }
486OPHANDLER( jc )         { execute_jcc(cpustate, (PSW & C_FLAG) != 0); }
487OPHANDLER( jf0 )         { execute_jcc(cpustate, (PSW & F_FLAG) != 0); }
488OPHANDLER( jf1 )         { execute_jcc(cpustate, cpustate->f1 != 0); }
645OPHANDLER( jmp_0 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x000); return 2; }
646OPHANDLER( jmp_1 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x100); return 2; }
647OPHANDLER( jmp_2 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x200); return 2; }
648OPHANDLER( jmp_3 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x300); return 2; }
649OPHANDLER( jmp_4 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x400); return 2; }
650OPHANDLER( jmp_5 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x500); return 2; }
651OPHANDLER( jmp_6 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x600); return 2; }
652OPHANDLER( jmp_7 )         { execute_jmp(cpustate, argument_fetch(cpustate) | 0x700); return 2; }
653OPHANDLER( jmpp_xa )      { cpustate->pc &= 0xf00; cpustate->pc |= program_r(cpustate->pc | cpustate->a); return 2; }
489654
490OPHANDLER( jmp_0 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x000); }
491OPHANDLER( jmp_1 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x100); }
492OPHANDLER( jmp_2 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x200); }
493OPHANDLER( jmp_3 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x300); }
494OPHANDLER( jmp_4 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x400); }
495OPHANDLER( jmp_5 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x500); }
496OPHANDLER( jmp_6 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x600); }
497OPHANDLER( jmp_7 )         { execute_jmp(cpustate, argument_fetch(cpustate, PC) | 0x700); }
498OPHANDLER( jmpp_xa )      { PC &= 0xf00; PC |= program_r(PC | A); }
655OPHANDLER( mov_a_n )      { cpustate->a = argument_fetch(cpustate); return 2; }
656OPHANDLER( mov_a_psw )      { cpustate->a = cpustate->psw; return 1; }
657OPHANDLER( mov_a_r0 )      { cpustate->a = cpustate->R0; return 1; }
658OPHANDLER( mov_a_r1 )      { cpustate->a = cpustate->R1; return 1; }
659OPHANDLER( mov_a_r2 )      { cpustate->a = cpustate->R2; return 1; }
660OPHANDLER( mov_a_r3 )      { cpustate->a = cpustate->R3; return 1; }
661OPHANDLER( mov_a_r4 )      { cpustate->a = cpustate->R4; return 1; }
662OPHANDLER( mov_a_r5 )      { cpustate->a = cpustate->R5; return 1; }
663OPHANDLER( mov_a_r6 )      { cpustate->a = cpustate->R6; return 1; }
664OPHANDLER( mov_a_r7 )      { cpustate->a = cpustate->R7; return 1; }
665OPHANDLER( mov_a_xr0 )      { cpustate->a = ram_r(cpustate->R0); return 1; }
666OPHANDLER( mov_a_xr1 )      { cpustate->a = ram_r(cpustate->R1); return 1; }
667OPHANDLER( mov_a_t )      { cpustate->a = cpustate->timer; return 1; }
499668
500OPHANDLER( jnc )         { execute_jcc(cpustate, (PSW & C_FLAG) == 0); }
501OPHANDLER( jni )         { execute_jcc(cpustate, cpustate->irq_state != 0); }
502OPHANDLER( jnt_0 )        { execute_jcc(cpustate, test_r(0) == 0); }
503OPHANDLER( jnt_1 )        { execute_jcc(cpustate, test_r(1) == 0); }
504OPHANDLER( jnz )         { execute_jcc(cpustate, A != 0); }
505OPHANDLER( jtf )         { execute_jcc(cpustate, cpustate->timer_flag); cpustate->timer_flag = FALSE; }
506OPHANDLER( jt_0 )        { execute_jcc(cpustate, test_r(0) != 0); }
507OPHANDLER( jt_1 )        { execute_jcc(cpustate, test_r(1) != 0); }
508OPHANDLER( jz )         { execute_jcc(cpustate, A == 0); }
669OPHANDLER( mov_psw_a )      { cpustate->psw = cpustate->a; update_regptr(cpustate); return 1; }
670OPHANDLER( mov_sts_a )      { cpustate->sts = (cpustate->sts & 0x0f) | (cpustate->a & 0xf0); return 1; }
671OPHANDLER( mov_r0_a )      { cpustate->R0 = cpustate->a; return 1; }
672OPHANDLER( mov_r1_a )      { cpustate->R1 = cpustate->a; return 1; }
673OPHANDLER( mov_r2_a )      { cpustate->R2 = cpustate->a; return 1; }
674OPHANDLER( mov_r3_a )      { cpustate->R3 = cpustate->a; return 1; }
675OPHANDLER( mov_r4_a )      { cpustate->R4 = cpustate->a; return 1; }
676OPHANDLER( mov_r5_a )      { cpustate->R5 = cpustate->a; return 1; }
677OPHANDLER( mov_r6_a )      { cpustate->R6 = cpustate->a; return 1; }
678OPHANDLER( mov_r7_a )      { cpustate->R7 = cpustate->a; return 1; }
679OPHANDLER( mov_r0_n )      { cpustate->R0 = argument_fetch(cpustate); return 2; }
680OPHANDLER( mov_r1_n )      { cpustate->R1 = argument_fetch(cpustate); return 2; }
681OPHANDLER( mov_r2_n )      { cpustate->R2 = argument_fetch(cpustate); return 2; }
682OPHANDLER( mov_r3_n )      { cpustate->R3 = argument_fetch(cpustate); return 2; }
683OPHANDLER( mov_r4_n )      { cpustate->R4 = argument_fetch(cpustate); return 2; }
684OPHANDLER( mov_r5_n )      { cpustate->R5 = argument_fetch(cpustate); return 2; }
685OPHANDLER( mov_r6_n )      { cpustate->R6 = argument_fetch(cpustate); return 2; }
686OPHANDLER( mov_r7_n )      { cpustate->R7 = argument_fetch(cpustate); return 2; }
687OPHANDLER( mov_t_a )      { cpustate->timer = cpustate->a; return 1; }
688OPHANDLER( mov_xr0_a )      { ram_w(cpustate->R0, cpustate->a); return 1; }
689OPHANDLER( mov_xr1_a )      { ram_w(cpustate->R1, cpustate->a); return 1; }
690OPHANDLER( mov_xr0_n )      { ram_w(cpustate->R0, argument_fetch(cpustate)); return 2; }
691OPHANDLER( mov_xr1_n )      { ram_w(cpustate->R1, argument_fetch(cpustate)); return 2; }
509692
510OPHANDLER( mov_a_n )      { A = argument_fetch(cpustate, PC++); }
511OPHANDLER( mov_a_psw )      { A = PSW; }
512OPHANDLER( mov_a_r0 )      { A = R0; }
513OPHANDLER( mov_a_r1 )      { A = R1; }
514OPHANDLER( mov_a_r2 )      { A = R2; }
515OPHANDLER( mov_a_r3 )      { A = R3; }
516OPHANDLER( mov_a_r4 )      { A = R4; }
517OPHANDLER( mov_a_r5 )      { A = R5; }
518OPHANDLER( mov_a_r6 )      { A = R6; }
519OPHANDLER( mov_a_r7 )      { A = R7; }
520OPHANDLER( mov_a_xr0 )      { A = ram_r(R0); }
521OPHANDLER( mov_a_xr1 )      { A = ram_r(R1); }
522OPHANDLER( mov_a_t )      { A = cpustate->timer; }
693OPHANDLER( movd_a_p4 )      { expander_operation(cpustate, MCS48_EXPANDER_OP_READ, 4); return 2; }
694OPHANDLER( movd_a_p5 )      { expander_operation(cpustate, MCS48_EXPANDER_OP_READ, 5); return 2; }
695OPHANDLER( movd_a_p6 )      { expander_operation(cpustate, MCS48_EXPANDER_OP_READ, 6); return 2; }
696OPHANDLER( movd_a_p7 )      { expander_operation(cpustate, MCS48_EXPANDER_OP_READ, 7); return 2; }
697OPHANDLER( movd_p4_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_WRITE, 4); return 2; }
698OPHANDLER( movd_p5_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_WRITE, 5); return 2; }
699OPHANDLER( movd_p6_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_WRITE, 6); return 2; }
700OPHANDLER( movd_p7_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_WRITE, 7); return 2; }
523701
524OPHANDLER( mov_psw_a )      { PSW = A; update_regptr(cpustate); }
525OPHANDLER( mov_r0_a )      { R0 = A; }
526OPHANDLER( mov_r1_a )      { R1 = A; }
527OPHANDLER( mov_r2_a )      { R2 = A; }
528OPHANDLER( mov_r3_a )      { R3 = A; }
529OPHANDLER( mov_r4_a )      { R4 = A; }
530OPHANDLER( mov_r5_a )      { R5 = A; }
531OPHANDLER( mov_r6_a )      { R6 = A; }
532OPHANDLER( mov_r7_a )      { R7 = A; }
533OPHANDLER( mov_r0_n )      { R0 = argument_fetch(cpustate, PC++); }
534OPHANDLER( mov_r1_n )      { R1 = argument_fetch(cpustate, PC++); }
535OPHANDLER( mov_r2_n )      { R2 = argument_fetch(cpustate, PC++); }
536OPHANDLER( mov_r3_n )      { R3 = argument_fetch(cpustate, PC++); }
537OPHANDLER( mov_r4_n )      { R4 = argument_fetch(cpustate, PC++); }
538OPHANDLER( mov_r5_n )      { R5 = argument_fetch(cpustate, PC++); }
539OPHANDLER( mov_r6_n )      { R6 = argument_fetch(cpustate, PC++); }
540OPHANDLER( mov_r7_n )      { R7 = argument_fetch(cpustate, PC++); }
541OPHANDLER( mov_t_a )      { cpustate->timer = A; }
542OPHANDLER( mov_xr0_a )      { ram_w(R0, A); }
543OPHANDLER( mov_xr1_a )      { ram_w(R1, A); }
544OPHANDLER( mov_xr0_n )      { ram_w(R0, argument_fetch(cpustate, PC++)); }
545OPHANDLER( mov_xr1_n )      { ram_w(R1, argument_fetch(cpustate, PC++)); }
702OPHANDLER( movp_a_xa )      { cpustate->a = program_r((cpustate->pc & 0xf00) | cpustate->a); return 2; }
703OPHANDLER( movp3_a_xa )      { cpustate->a = program_r(0x300 | cpustate->a); return 2; }
546704
547OPHANDLER( movd_a_p4 )      { A = port_r(4) & 0x0f; }
548OPHANDLER( movd_a_p5 )      { A = port_r(5) & 0x0f; }
549OPHANDLER( movd_a_p6 )      { A = port_r(6) & 0x0f; }
550OPHANDLER( movd_a_p7 )      { A = port_r(7) & 0x0f; }
551OPHANDLER( movd_p4_a )      { port_w(4, A & 0x0f); }
552OPHANDLER( movd_p5_a )      { port_w(5, A & 0x0f); }
553OPHANDLER( movd_p6_a )      { port_w(6, A & 0x0f); }
554OPHANDLER( movd_p7_a )      { port_w(7, A & 0x0f); }
705OPHANDLER( movx_a_xr0 )      { cpustate->a = ext_r(cpustate->R0); return 2; }
706OPHANDLER( movx_a_xr1 )      { cpustate->a = ext_r(cpustate->R1); return 2; }
707OPHANDLER( movx_xr0_a )      { ext_w(cpustate->R0, cpustate->a); return 2; }
708OPHANDLER( movx_xr1_a )      { ext_w(cpustate->R1, cpustate->a); return 2; }
555709
556OPHANDLER( movp_a_xa )      { A = program_r((PC & 0xf00) | A); }
557OPHANDLER( movp3_a_xa )   { A = program_r(0x300 | A); }
710OPHANDLER( nop )         { return 1; }
558711
559OPHANDLER( movx_a_xr0 )   { A = ext_r(R0); }
560OPHANDLER( movx_a_xr1 )   { A = ext_r(R1); }
561OPHANDLER( movx_xr0_a )   { ext_w(R0, A); }
562OPHANDLER( movx_xr1_a )   { ext_w(R1, A); }
712OPHANDLER( orl_a_r0 )      { cpustate->a |= cpustate->R0; return 1; }
713OPHANDLER( orl_a_r1 )      { cpustate->a |= cpustate->R1; return 1; }
714OPHANDLER( orl_a_r2 )      { cpustate->a |= cpustate->R2; return 1; }
715OPHANDLER( orl_a_r3 )      { cpustate->a |= cpustate->R3; return 1; }
716OPHANDLER( orl_a_r4 )      { cpustate->a |= cpustate->R4; return 1; }
717OPHANDLER( orl_a_r5 )      { cpustate->a |= cpustate->R5; return 1; }
718OPHANDLER( orl_a_r6 )      { cpustate->a |= cpustate->R6; return 1; }
719OPHANDLER( orl_a_r7 )      { cpustate->a |= cpustate->R7; return 1; }
720OPHANDLER( orl_a_xr0 )      { cpustate->a |= ram_r(cpustate->R0); return 1; }
721OPHANDLER( orl_a_xr1 )      { cpustate->a |= ram_r(cpustate->R1); return 1; }
722OPHANDLER( orl_a_n )      { cpustate->a |= argument_fetch(cpustate); return 2; }
563723
564OPHANDLER( nop )         { }
724OPHANDLER( orl_bus_n )      { bus_w(bus_r() | argument_fetch(cpustate)); return 2; }
725OPHANDLER( orl_p1_n )      { port_w(1, cpustate->p1 |= argument_fetch(cpustate)); return 2; }
726OPHANDLER( orl_p2_n )      { port_w(2, cpustate->p2 |= argument_fetch(cpustate) & p2_mask(cpustate)); return 2; }
727OPHANDLER( orld_p4_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_OR, 4); return 2; }
728OPHANDLER( orld_p5_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_OR, 5); return 2; }
729OPHANDLER( orld_p6_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_OR, 6); return 2; }
730OPHANDLER( orld_p7_a )      { expander_operation(cpustate, MCS48_EXPANDER_OP_OR, 7); return 2; }
565731
566OPHANDLER( orl_a_r0 )      { A |= R0; }
567OPHANDLER( orl_a_r1 )      { A |= R1; }
568OPHANDLER( orl_a_r2 )      { A |= R2; }
569OPHANDLER( orl_a_r3 )      { A |= R3; }
570OPHANDLER( orl_a_r4 )      { A |= R4; }
571OPHANDLER( orl_a_r5 )      { A |= R5; }
572OPHANDLER( orl_a_r6 )      { A |= R6; }
573OPHANDLER( orl_a_r7 )      { A |= R7; }
574OPHANDLER( orl_a_xr0 )      { A |= ram_r(R0); }
575OPHANDLER( orl_a_xr1 )      { A |= ram_r(R1); }
576OPHANDLER( orl_a_n )      { A |= argument_fetch(cpustate, PC++); }
577OPHANDLER( orl_bus_n )      { bus_w(bus_r() | argument_fetch(cpustate, PC++)); }
578OPHANDLER( orl_p1_n )      { port_w(1, cpustate->p1 |= argument_fetch(cpustate, PC++)); }
579OPHANDLER( orl_p2_n )      { port_w(2, cpustate->p2 |= argument_fetch(cpustate, PC++)); }
580OPHANDLER( orld_p4_a )      { port_w(4, port_r(4) | A); }
581OPHANDLER( orld_p5_a )      { port_w(5, port_r(5) | A); }
582OPHANDLER( orld_p6_a )      { port_w(6, port_r(6) | A); }
583OPHANDLER( orld_p7_a )      { port_w(7, port_r(7) | A); }
732OPHANDLER( outl_bus_a )      { bus_w(cpustate->a); return 2; }
733OPHANDLER( outl_p1_a )      { port_w(1, cpustate->p1 = cpustate->a); return 2; }
734OPHANDLER( outl_p2_a )      { UINT8 mask = p2_mask(cpustate); port_w(2, cpustate->p2 = (cpustate->p2 & ~mask) | (cpustate->a & mask)); return 2; }
735OPHANDLER( out_dbb_a )
736{
737   /* copy to the DBBO and update the bit in STS */
738   cpustate->dbbo = cpustate->a;
739   cpustate->sts |= STS_OBF;
584740
585OPHANDLER( outl_bus_a )   { bus_w(A); }
586OPHANDLER( outl_p1_a )      { port_w(1, cpustate->p1 = A); }
587OPHANDLER( outl_p2_a )      { port_w(2, cpustate->p2 = A); }
588OPHANDLER( ret )         { pull_pc(cpustate); }
741   /* if P2 flags are enabled, update the state of P2 */
742   if (cpustate->flags_enabled && (cpustate->p2 & P2_OBF) == 0)
743      port_w(2, cpustate->p2 |= P2_OBF);
744   return 2;
745}
589746
747
748OPHANDLER( ret )         { pull_pc(cpustate); return 2; }
590749OPHANDLER( retr )
591750{
592751   pull_pc_psw(cpustate);
593752
594753   /* implicitly clear the IRQ in progress flip flop and re-check interrupts */
595754   cpustate->irq_in_progress = FALSE;
596   check_irqs(cpustate);
755   return 2 + check_irqs(cpustate);
597756}
598757
599OPHANDLER( rl_a )         { A = (A << 1) | (A >> 7); }
600OPHANDLER( rlc_a )       { UINT8 newc = A & C_FLAG; A = (A << 1) | (PSW >> 7); PSW = (PSW & ~C_FLAG) | newc; }
758OPHANDLER( rl_a )         { cpustate->a = (cpustate->a << 1) | (cpustate->a >> 7); return 1; }
759OPHANDLER( rlc_a )          { UINT8 newc = cpustate->a & C_FLAG; cpustate->a = (cpustate->a << 1) | (cpustate->psw >> 7); cpustate->psw = (cpustate->psw & ~C_FLAG) | newc; return 1; }
601760
602OPHANDLER( rr_a )         { A = (A >> 1) | (A << 7); }
603OPHANDLER( rrc_a )         { UINT8 newc = (A << 7) & C_FLAG; A = (A >> 1) | (PSW & C_FLAG); PSW = (PSW & ~C_FLAG) | newc; }
761OPHANDLER( rr_a )         { cpustate->a = (cpustate->a >> 1) | (cpustate->a << 7); return 1; }
762OPHANDLER( rrc_a )         { UINT8 newc = (cpustate->a << 7) & C_FLAG; cpustate->a = (cpustate->a >> 1) | (cpustate->psw & C_FLAG); cpustate->psw = (cpustate->psw & ~C_FLAG) | newc; return 1; }
604763
605OPHANDLER( sel_mb0 )      { cpustate->a11 = 0x000; }
606OPHANDLER( sel_mb1 )      { cpustate->a11 = 0x800; }
764OPHANDLER( sel_mb0 )      { cpustate->a11 = 0x000; return 1; }
765OPHANDLER( sel_mb1 )      { cpustate->a11 = 0x800; return 1; }
607766
608OPHANDLER( sel_rb0 )      { PSW &= ~B_FLAG; update_regptr(cpustate);  }
609OPHANDLER( sel_rb1 )      { PSW |=  B_FLAG; update_regptr(cpustate); }
767OPHANDLER( sel_rb0 )      { cpustate->psw &= ~B_FLAG; update_regptr(cpustate); return 1; }
768OPHANDLER( sel_rb1 )      { cpustate->psw |=  B_FLAG; update_regptr(cpustate); return 1; }
610769
611OPHANDLER( stop_tcnt )      { cpustate->timecount_enabled = 0; }
770OPHANDLER( stop_tcnt )      { cpustate->timecount_enabled = 0; return 1; }
612771
613OPHANDLER( strt_cnt )      { cpustate->timecount_enabled = COUNTER_ENABLED; cpustate->t1_history = test_r(1); }
614OPHANDLER( strt_t )      { cpustate->timecount_enabled = TIMER_ENABLED; cpustate->prescaler = 0; }
772OPHANDLER( strt_cnt )      { cpustate->timecount_enabled = COUNTER_ENABLED; cpustate->t1_history = test_r(1); return 1; }
773OPHANDLER( strt_t )         { cpustate->timecount_enabled = TIMER_ENABLED; cpustate->prescaler = 0; return 1; }
615774
616OPHANDLER( swap_a )      { A = (A << 4) | (A >> 4); }
775OPHANDLER( swap_a )         { cpustate->a = (cpustate->a << 4) | (cpustate->a >> 4); return 1; }
617776
618OPHANDLER( xch_a_r0 )      { UINT8 tmp = A; A = R0; R0 = tmp; }
619OPHANDLER( xch_a_r1 )      { UINT8 tmp = A; A = R1; R1 = tmp; }
620OPHANDLER( xch_a_r2 )      { UINT8 tmp = A; A = R2; R2 = tmp; }
621OPHANDLER( xch_a_r3 )      { UINT8 tmp = A; A = R3; R3 = tmp; }
622OPHANDLER( xch_a_r4 )      { UINT8 tmp = A; A = R4; R4 = tmp; }
623OPHANDLER( xch_a_r5 )      { UINT8 tmp = A; A = R5; R5 = tmp; }
624OPHANDLER( xch_a_r6 )      { UINT8 tmp = A; A = R6; R6 = tmp; }
625OPHANDLER( xch_a_r7 )      { UINT8 tmp = A; A = R7; R7 = tmp; }
626OPHANDLER( xch_a_xr0 )      { UINT8 tmp = A; A = ram_r(R0); ram_w(R0, tmp); }
627OPHANDLER( xch_a_xr1 )      { UINT8 tmp = A; A = ram_r(R1); ram_w(R1, tmp); }
777OPHANDLER( xch_a_r0 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R0; cpustate->R0 = tmp; return 1; }
778OPHANDLER( xch_a_r1 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R1; cpustate->R1 = tmp; return 1; }
779OPHANDLER( xch_a_r2 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R2; cpustate->R2 = tmp; return 1; }
780OPHANDLER( xch_a_r3 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R3; cpustate->R3 = tmp; return 1; }
781OPHANDLER( xch_a_r4 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R4; cpustate->R4 = tmp; return 1; }
782OPHANDLER( xch_a_r5 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R5; cpustate->R5 = tmp; return 1; }
783OPHANDLER( xch_a_r6 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R6; cpustate->R6 = tmp; return 1; }
784OPHANDLER( xch_a_r7 )      { UINT8 tmp = cpustate->a; cpustate->a = cpustate->R7; cpustate->R7 = tmp; return 1; }
785OPHANDLER( xch_a_xr0 )      { UINT8 tmp = cpustate->a; cpustate->a = ram_r(cpustate->R0); ram_w(cpustate->R0, tmp); return 1; }
786OPHANDLER( xch_a_xr1 )      { UINT8 tmp = cpustate->a; cpustate->a = ram_r(cpustate->R1); ram_w(cpustate->R1, tmp); return 1; }
628787
629OPHANDLER( xchd_a_xr0 )   { UINT8 oldram = ram_r(R0); ram_w(R0, (oldram & 0xf0) | (A & 0x0f)); A = (A & 0xf0) | (oldram & 0x0f); }
630OPHANDLER( xchd_a_xr1 )   { UINT8 oldram = ram_r(R1); ram_w(R1, (oldram & 0xf0) | (A & 0x0f)); A = (A & 0xf0) | (oldram & 0x0f); }
788OPHANDLER( xchd_a_xr0 )      { UINT8 oldram = ram_r(cpustate->R0); ram_w(cpustate->R0, (oldram & 0xf0) | (cpustate->a & 0x0f)); cpustate->a = (cpustate->a & 0xf0) | (oldram & 0x0f); return 1; }
789OPHANDLER( xchd_a_xr1 )      { UINT8 oldram = ram_r(cpustate->R1); ram_w(cpustate->R1, (oldram & 0xf0) | (cpustate->a & 0x0f)); cpustate->a = (cpustate->a & 0xf0) | (oldram & 0x0f); return 1; }
631790
632OPHANDLER( xrl_a_r0 )      { A ^= R0; }
633OPHANDLER( xrl_a_r1 )      { A ^= R1; }
634OPHANDLER( xrl_a_r2 )      { A ^= R2; }
635OPHANDLER( xrl_a_r3 )      { A ^= R3; }
636OPHANDLER( xrl_a_r4 )      { A ^= R4; }
637OPHANDLER( xrl_a_r5 )      { A ^= R5; }
638OPHANDLER( xrl_a_r6 )      { A ^= R6; }
639OPHANDLER( xrl_a_r7 )      { A ^= R7; }
640OPHANDLER( xrl_a_xr0 )      { A ^= ram_r(R0); }
641OPHANDLER( xrl_a_xr1 )      { A ^= ram_r(R1); }
642OPHANDLER( xrl_a_n )      { A ^= argument_fetch(cpustate, PC++); }
791OPHANDLER( xrl_a_r0 )      { cpustate->a ^= cpustate->R0; return 1; }
792OPHANDLER( xrl_a_r1 )      { cpustate->a ^= cpustate->R1; return 1; }
793OPHANDLER( xrl_a_r2 )      { cpustate->a ^= cpustate->R2; return 1; }
794OPHANDLER( xrl_a_r3 )      { cpustate->a ^= cpustate->R3; return 1; }
795OPHANDLER( xrl_a_r4 )      { cpustate->a ^= cpustate->R4; return 1; }
796OPHANDLER( xrl_a_r5 )      { cpustate->a ^= cpustate->R5; return 1; }
797OPHANDLER( xrl_a_r6 )      { cpustate->a ^= cpustate->R6; return 1; }
798OPHANDLER( xrl_a_r7 )      { cpustate->a ^= cpustate->R7; return 1; }
799OPHANDLER( xrl_a_xr0 )      { cpustate->a ^= ram_r(cpustate->R0); return 1; }
800OPHANDLER( xrl_a_xr1 )      { cpustate->a ^= ram_r(cpustate->R1); return 1; }
801OPHANDLER( xrl_a_n )      { cpustate->a ^= argument_fetch(cpustate); return 2; }
643802
803SPLIT_OPHANDLER( split_02, outl_bus_a, out_dbb_a )
804SPLIT_OPHANDLER( split_08, ins_a_bus,  illegal )
805SPLIT_OPHANDLER( split_22, illegal,    in_a_dbb )
806SPLIT_OPHANDLER( split_75, ent0_clk,   illegal )
807SPLIT_OPHANDLER( split_80, movx_a_xr0, illegal )
808SPLIT_OPHANDLER( split_81, movx_a_xr1, illegal )
809SPLIT_OPHANDLER( split_86, jni,        jobf )
810SPLIT_OPHANDLER( split_88, orl_bus_n,  illegal )
811SPLIT_OPHANDLER( split_90, movx_xr0_a, mov_sts_a )
812SPLIT_OPHANDLER( split_91, movx_xr1_a, illegal )
813SPLIT_OPHANDLER( split_98, anl_bus_n,  illegal )
814SPLIT_OPHANDLER( split_d6, illegal,    jnibf )
815SPLIT_OPHANDLER( split_e5, sel_mb0,    en_dma )
816SPLIT_OPHANDLER( split_f5, sel_mb1,    en_flags )
644817
645818
819
646820/***************************************************************************
647821    OPCODE TABLES
648822***************************************************************************/
649823
650static const mcs48_opcode opcode_table[256]=
824static const mcs48_ophandler opcode_table[256]=
651825{
652   {1, nop          },{1, illegal   },{2, outl_bus_a},{2, add_a_n   },{2, jmp_0         },{1, en_i      },{1, illegal   },{1, dec_a      },
653   {2, ins_a_bus  },{2, in_a_p1   },{2, in_a_p2   },{1, illegal   },{2, movd_a_p4 },{2, movd_a_p5   },{2, movd_a_p6   },{2, movd_a_p7 },
654   {1, inc_xr0    },{1, inc_xr1   },{2, jb_0      },{2, adc_a_n   },{2, call_0      },{1, dis_i      },{2, jtf      },{1, inc_a      },
655   {1, inc_r0      },{1, inc_r1    },{1, inc_r2   },{1, inc_r3   },{1, inc_r4   },{1, inc_r5    },{1, inc_r6   },{1, inc_r7   },
656   {1, xch_a_xr0  },{1, xch_a_xr1   },{1, illegal   },{2, mov_a_n   },{2, jmp_1         },{1, en_tcnti   },{2, jnt_0    },{1, clr_a        },
657   {1, xch_a_r0   },{1, xch_a_r1   },{1, xch_a_r2   },{1, xch_a_r3  },{1, xch_a_r4  },{1, xch_a_r5   },{1, xch_a_r6   },{1, xch_a_r7  },
658   {1, xchd_a_xr0 },{1, xchd_a_xr1   },{2, jb_1      },{1, illegal   },{2, call_1   },{1, dis_tcnti   },{2, jt_0      },{1, cpl_a        },
659   {0, illegal    },{2, outl_p1_a   },{2, outl_p2_a   },{1, illegal   },{2, movd_p4_a },{2, movd_p5_a   },{2, movd_p6_a },{2, movd_p7_a },
660   {1, orl_a_xr0  },{1, orl_a_xr1   },{1, mov_a_t   },{2, orl_a_n   },{2, jmp_2         },{1, strt_cnt   },{2, jnt_1    },{1, swap_a   },
661   {1, orl_a_r0   },{1, orl_a_r1   },{1, orl_a_r2   },{1, orl_a_r3  },{1, orl_a_r4  },{1, orl_a_r5   },{1, orl_a_r6   },{1, orl_a_r7  },
662   {1, anl_a_xr0  },{1, anl_a_xr1   },{2, jb_2      },{2, anl_a_n   },{2, call_2   },{1, strt_t    },{2, jt_1      },{1, da_a        },
663   {1, anl_a_r0   },{1, anl_a_r1   },{1, anl_a_r2   },{1, anl_a_r3  },{1, anl_a_r4  },{1, anl_a_r5   },{1, anl_a_r6   },{1, anl_a_r7  },
664   {1, add_a_xr0  },{1, add_a_xr1   },{1, mov_t_a   },{1, illegal   },{2, jmp_3         },{1, stop_tcnt   },{1, illegal   },{1, rrc_a        },
665   {1, add_a_r0   },{1, add_a_r1   },{1, add_a_r2   },{1, add_a_r3  },{1, add_a_r4  },{1, add_a_r5   },{1, add_a_r6   },{1, add_a_r7  },
666   {1, adc_a_xr0  },{1, adc_a_xr1   },{2, jb_3      },{1, illegal   },{2, call_3   },{1, ento_clk   },{2, jf1      },{1, rr_a         },
667   {1, adc_a_r0   },{1, adc_a_r1   },{1, adc_a_r2   },{1, adc_a_r3  },{1, adc_a_r4  },{1, adc_a_r5   },{1, adc_a_r6   },{1, adc_a_r7  },
668   {2, movx_a_xr0 },{2, movx_a_xr1 },{1, illegal   },{2, ret      },{2, jmp_4         },{1, clr_f0    },{2, jni      },{1, illegal   },
669   {2, orl_bus_n  },{2, orl_p1_n   },{2, orl_p2_n   },{1, illegal   },{2, orld_p4_a },{2, orld_p5_a   },{2, orld_p6_a },{2, orld_p7_a },
670   {2, movx_xr0_a },{2, movx_xr1_a },{2, jb_4      },{2, retr      },{2, call_4   },{1, cpl_f0    },{2, jnz      },{1, clr_c        },
671   {2, anl_bus_n  },{2, anl_p1_n   },{2, anl_p2_n   },{1, illegal   },{2, anld_p4_a },{2, anld_p5_a   },{2, anld_p6_a },{2, anld_p7_a },
672   {1, mov_xr0_a  },{1, mov_xr1_a   },{1, illegal   },{2, movp_a_xa },{2, jmp_5         },{1, clr_f1    },{1, illegal   },{1, cpl_c        },
673   {1, mov_r0_a   },{1, mov_r1_a   },{1, mov_r2_a   },{1, mov_r3_a  },{1, mov_r4_a  },{1, mov_r5_a   },{1, mov_r6_a   },{1, mov_r7_a  },
674   {2, mov_xr0_n  },{2, mov_xr1_n   },{2, jb_5      },{2, jmpp_xa   },{2, call_5   },{1, cpl_f1    },{2, jf0      },{1, illegal   },
675   {2, mov_r0_n   },{2, mov_r1_n   },{2, mov_r2_n   },{2, mov_r3_n  },{2, mov_r4_n  },{2, mov_r5_n   },{2, mov_r6_n   },{2, mov_r7_n  },
676   {0, illegal    },{1, illegal   },{1, illegal   },{1, illegal   },{2, jmp_6         },{1, sel_rb0   },{2, jz      },{1, mov_a_psw },
677   {1, dec_r0      },{1, dec_r1    },{1, dec_r2   },{1, dec_r3   },{1, dec_r4   },{1, dec_r5    },{1, dec_r6   },{1, dec_r7   },
678   {1, xrl_a_xr0  },{1, xrl_a_xr1   },{2, jb_6      },{2, xrl_a_n   },{2, call_6   },{1, sel_rb1   },{1, illegal   },{1, mov_psw_a },
679   {1, xrl_a_r0   },{1, xrl_a_r1   },{1, xrl_a_r2   },{1, xrl_a_r3  },{1, xrl_a_r4  },{1, xrl_a_r5   },{1, xrl_a_r6   },{1, xrl_a_r7  },
680   {0, illegal    },{1, illegal   },{1, illegal   },{2, movp3_a_xa},{2, jmp_7      },{1, sel_mb0   },{2, jnc      },{1, rl_a         },
681   {2, djnz_r0    },{2, djnz_r1   },{2, djnz_r2   },{2, djnz_r3   },{2, djnz_r4   },{2, djnz_r5   },{2, djnz_r6   },{2, djnz_r7   },
682   {1, mov_a_xr0  },{1, mov_a_xr1   },{2, jb_7      },{1, illegal   },{2, call_7   },{1, sel_mb1   },{2, jc      },{1, rlc_a        },
683   {1, mov_a_r0   },{1, mov_a_r1   },{1, mov_a_r2   },{1, mov_a_r3  },{1, mov_a_r4  },{1, mov_a_r5   },{1, mov_a_r6   },{1, mov_a_r7  }
826   nop,        illegal,    split_02,  add_a_n,   jmp_0,     en_i,       illegal,   dec_a,         /* 00 */
827   split_08,   in_a_p1,    in_a_p2,   illegal,   movd_a_p4, movd_a_p5,  movd_a_p6, movd_a_p7,
828   inc_xr0,    inc_xr1,    jb_0,      adc_a_n,   call_0,    dis_i,      jtf,       inc_a,         /* 10 */
829   inc_r0,     inc_r1,     inc_r2,    inc_r3,    inc_r4,    inc_r5,     inc_r6,    inc_r7,
830   xch_a_xr0,  xch_a_xr1,  split_22,  mov_a_n,   jmp_1,     en_tcnti,   jnt_0,     clr_a,         /* 20 */
831   xch_a_r0,   xch_a_r1,   xch_a_r2,  xch_a_r3,  xch_a_r4,  xch_a_r5,   xch_a_r6,  xch_a_r7,
832   xchd_a_xr0, xchd_a_xr1, jb_1,      illegal,   call_1,    dis_tcnti,  jt_0,      cpl_a,         /* 30 */
833   illegal,    outl_p1_a,  outl_p2_a, illegal,   movd_p4_a, movd_p5_a,  movd_p6_a, movd_p7_a,
834   orl_a_xr0,  orl_a_xr1,  mov_a_t,   orl_a_n,   jmp_2,     strt_cnt,   jnt_1,     swap_a,        /* 40 */
835   orl_a_r0,   orl_a_r1,   orl_a_r2,  orl_a_r3,  orl_a_r4,  orl_a_r5,   orl_a_r6,  orl_a_r7,
836   anl_a_xr0,  anl_a_xr1,  jb_2,      anl_a_n,   call_2,    strt_t,     jt_1,      da_a,          /* 50 */
837   anl_a_r0,   anl_a_r1,   anl_a_r2,  anl_a_r3,  anl_a_r4,  anl_a_r5,   anl_a_r6,  anl_a_r7,
838   add_a_xr0,  add_a_xr1,  mov_t_a,   illegal,   jmp_3,     stop_tcnt,  illegal,   rrc_a,         /* 60 */
839   add_a_r0,   add_a_r1,   add_a_r2,  add_a_r3,  add_a_r4,  add_a_r5,   add_a_r6,  add_a_r7,
840   adc_a_xr0,  adc_a_xr1,  jb_3,      illegal,   call_3,    split_75,   jf1,       rr_a,          /* 70 */
841   adc_a_r0,   adc_a_r1,   adc_a_r2,  adc_a_r3,  adc_a_r4,  adc_a_r5,   adc_a_r6,  adc_a_r7,
842   split_80,   split_81,   illegal,   ret,       jmp_4,     clr_f0,     split_86,  illegal,       /* 80 */
843   split_88,   orl_p1_n,   orl_p2_n,  illegal,   orld_p4_a, orld_p5_a,  orld_p6_a, orld_p7_a,
844   split_90,   split_91,   jb_4,      retr,      call_4,    cpl_f0,     jnz,       clr_c,         /* 90 */
845   split_98,   anl_p1_n,   anl_p2_n,  illegal,   anld_p4_a, anld_p5_a,  anld_p6_a, anld_p7_a,
846   mov_xr0_a,  mov_xr1_a,  illegal,   movp_a_xa, jmp_5,     clr_f1,     illegal,   cpl_c,         /* A0 */
847   mov_r0_a,   mov_r1_a,   mov_r2_a,  mov_r3_a,  mov_r4_a,  mov_r5_a,   mov_r6_a,  mov_r7_a,
848   mov_xr0_n,  mov_xr1_n,  jb_5,      jmpp_xa,   call_5,    cpl_f1,     jf0,       illegal,       /* B0 */
849   mov_r0_n,   mov_r1_n,   mov_r2_n,  mov_r3_n,  mov_r4_n,  mov_r5_n,   mov_r6_n,  mov_r7_n,
850   illegal,    illegal,    illegal,   illegal,   jmp_6,     sel_rb0,    jz,        mov_a_psw,     /* C0 */
851   dec_r0,     dec_r1,     dec_r2,    dec_r3,    dec_r4,    dec_r5,     dec_r6,    dec_r7,
852   xrl_a_xr0,  xrl_a_xr1,  jb_6,      xrl_a_n,   call_6,    sel_rb1,    split_d6,  mov_psw_a,     /* D0 */
853   xrl_a_r0,   xrl_a_r1,   xrl_a_r2,  xrl_a_r3,  xrl_a_r4,  xrl_a_r5,   xrl_a_r6,  xrl_a_r7,
854   illegal,    illegal,    illegal,   movp3_a_xa,jmp_7,     split_e5,   jnc,       rl_a,          /* E0 */
855   djnz_r0,    djnz_r1,    djnz_r2,   djnz_r3,   djnz_r4,   djnz_r5,    djnz_r6,   djnz_r7,
856   mov_a_xr0,  mov_a_xr1,  jb_7,      illegal,   call_7,    split_f5,   jc,        rlc_a,         /* F0 */
857   mov_a_r0,   mov_a_r1,   mov_a_r2,  mov_a_r3,  mov_a_r4,  mov_a_r5,   mov_a_r6,  mov_a_r7
684858};
685859
686860
r4057r4058
693867    mcs48_init - generic MCS-48 initialization
694868-------------------------------------------------*/
695869
696static void mcs48_init(const device_config *device, cpu_irq_callback irqcallback, UINT16 romsize)
870static void mcs48_init(const device_config *device, cpu_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize)
697871{
698872   mcs48_state *cpustate = device->token;
699873
r4057r4058
708882   cpustate->irq_callback = irqcallback;
709883   cpustate->device = device;
710884   cpustate->int_rom_size = romsize;
885   cpustate->feature_mask = feature_mask;
711886
712   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
713   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
714   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
887   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
888   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
889   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
715890
891   /* set up the state table */
892   cpustate->state = state_table_template;
893   cpustate->state.baseptr = cpustate;
894   cpustate->state.subtypemask = feature_mask;
895
716896   /* ensure that regptr is valid before get_info gets called */
717897   update_regptr(cpustate);
718898
719   state_save_register_device_item(device, 0, cpustate->prevpc.w.l);
720   state_save_register_device_item(device, 0, PC);
721   state_save_register_device_item(device, 0, A);
722   state_save_register_device_item(device, 0, PSW);
899   state_save_register_device_item(device, 0, cpustate->prevpc);
900   state_save_register_device_item(device, 0, cpustate->pc);
901
902   state_save_register_device_item(device, 0, cpustate->a);
903   state_save_register_device_item(device, 0, cpustate->psw);
723904   state_save_register_device_item(device, 0, cpustate->p1);
724905   state_save_register_device_item(device, 0, cpustate->p2);
725   state_save_register_device_item(device, 0, cpustate->f1);
726906   state_save_register_device_item(device, 0, cpustate->ea);
727907   state_save_register_device_item(device, 0, cpustate->timer);
728908   state_save_register_device_item(device, 0, cpustate->prescaler);
729909   state_save_register_device_item(device, 0, cpustate->t1_history);
910   state_save_register_device_item(device, 0, cpustate->sts);
911   state_save_register_device_item(device, 0, cpustate->dbbi);
912   state_save_register_device_item(device, 0, cpustate->dbbo);
913
730914   state_save_register_device_item(device, 0, cpustate->irq_state);
731915   state_save_register_device_item(device, 0, cpustate->irq_in_progress);
732916   state_save_register_device_item(device, 0, cpustate->timer_overflow);
r4057r4058
734918   state_save_register_device_item(device, 0, cpustate->tirq_enabled);
735919   state_save_register_device_item(device, 0, cpustate->xirq_enabled);
736920   state_save_register_device_item(device, 0, cpustate->timecount_enabled);
921   state_save_register_device_item(device, 0, cpustate->flags_enabled);
922   state_save_register_device_item(device, 0, cpustate->dma_enabled);
923
737924   state_save_register_device_item(device, 0, cpustate->a11);
738925}
739926
740927
741928/*-------------------------------------------------
742    i8035_init - initialization for systems with
743    0k of internal ROM and 64 bytes of internal
744    RAM
929    mcs48_norom_init - initialization for systems
930    with no internal ROM
745931-------------------------------------------------*/
746932
747#if (HAS_I8035 || HAS_MB8884)
748static CPU_INIT( i8035 )
933static CPU_INIT( mcs48_norom )
749934{
750   mcs48_init(device, irqcallback, 0x0);
935   mcs48_init(device, irqcallback, MCS48_FEATURE, 0x0);
751936}
752#endif
753937
754938
755939/*-------------------------------------------------
756    i8048_init - initialization for systems with
757    1k of internal ROM and 64 bytes of internal
758    RAM
940    mcs48_1k_rom_init - initialization for systems
941    with 1k of internal ROM
759942-------------------------------------------------*/
760943
761#if (HAS_I8048 || HAS_I8648 || HAS_I8748 || HAS_N7751)
762static CPU_INIT( i8048 )
944static CPU_INIT( mcs48_1k_rom )
763945{
764   mcs48_init(device, irqcallback, 0x400);
946   mcs48_init(device, irqcallback, MCS48_FEATURE, 0x400);
765947}
766#endif
767948
768949
769950/*-------------------------------------------------
770    i8039_init - initialization for systems with
771    0k of internal ROM and 128 bytes of internal
772    RAM
951    mcs48_2k_rom - initialization for systems
952    with 2k of internal ROM
773953-------------------------------------------------*/
774954
775#if (HAS_I8039)
776static CPU_INIT( i8039 )
955static CPU_INIT( mcs48_2k_rom )
777956{
778   mcs48_init(device, irqcallback, 0x0);
957   mcs48_init(device, irqcallback, MCS48_FEATURE, 0x800);
779958}
780#endif
781959
782960
783961/*-------------------------------------------------
784    i8049_init - initialization for systems with
785    2k of internal ROM and 128 bytes of internal
786    RAM
962    mcs48_4k_rom - initialization for systems
963    with 2k of internal ROM
787964-------------------------------------------------*/
788965
789#if (HAS_I8049 || HAS_I8749 || HAS_M58715)
790static CPU_INIT( i8049 )
966static CPU_INIT( mcs48_4k_rom )
791967{
792   mcs48_init(device, irqcallback, 0x800);
968   mcs48_init(device, irqcallback, MCS48_FEATURE, 0x1000);
793969}
794#endif
795970
796971
797972/*-------------------------------------------------
973    upi41_1k_rom_init - initialization for systems
974    with 1k of internal ROM
975-------------------------------------------------*/
976
977static CPU_INIT( upi41_1k_rom )
978{
979   mcs48_init(device, irqcallback, UPI41_FEATURE, 0x400);
980}
981
982
983/*-------------------------------------------------
984    upi41_2k_rom_init - initialization for systems
985    with 2k of internal ROM
986-------------------------------------------------*/
987
988static CPU_INIT( upi41_2k_rom )
989{
990   mcs48_init(device, irqcallback, UPI41_FEATURE, 0x800);
991}
992
993
994/*-------------------------------------------------
798995    mcs48_reset - general reset routine
799996-------------------------------------------------*/
800997
r4057r4058
8031000   mcs48_state *cpustate = device->token;
8041001
8051002   /* confirmed from reset description */
806   PC = 0;
807   PSW = (PSW & (C_FLAG | A_FLAG)) | 0x08;
1003   cpustate->pc = 0;
1004   cpustate->psw = (cpustate->psw & (C_FLAG | A_FLAG)) | 0x08;
8081005   cpustate->a11 = 0x000;
8091006   bus_w(0xff);
8101007   cpustate->p1 = 0xff;
r4057r4058
8151012   cpustate->xirq_enabled = FALSE;
8161013   cpustate->timecount_enabled = 0;
8171014   cpustate->timer_flag = FALSE;
818   cpustate->f1 = 0;
1015   cpustate->sts = 0;
1016   cpustate->flags_enabled = FALSE;
1017   cpustate->dma_enabled = FALSE;
8191018
8201019   /* confirmed from interrupt logic description */
8211020   cpustate->irq_in_progress = FALSE;
r4057r4058
8321031    check_irqs - check for and process IRQs
8331032-------------------------------------------------*/
8341033
835static void check_irqs(mcs48_state *cpustate)
1034static int check_irqs(mcs48_state *cpustate)
8361035{
8371036   /* if something is in progress, we do nothing */
8381037   if (cpustate->irq_in_progress)
839      return;
1038      return 0;
8401039
8411040   /* external interrupts take priority */
842   if (cpustate->irq_state && cpustate->xirq_enabled)
1041   if ((cpustate->irq_state || (cpustate->sts & STS_IBF) != 0) && cpustate->xirq_enabled)
8431042   {
8441043      cpustate->irq_in_progress = TRUE;
8451044
8461045      /* transfer to location 0x03 */
8471046      push_pc_psw(cpustate);
848      PC = 0x03;
849      cpustate->inst_cycles += 2;
1047      cpustate->pc = 0x03;
8501048
8511049      /* indicate we took the external IRQ */
8521050      if (cpustate->irq_callback != NULL)
8531051         (*cpustate->irq_callback)(cpustate->device, 0);
1052      return 2;
8541053   }
8551054
8561055   /* timer overflow interrupts follow */
r4057r4058
8601059
8611060      /* transfer to location 0x07 */
8621061      push_pc_psw(cpustate);
863      PC = 0x07;
864      cpustate->inst_cycles += 2;
1062      cpustate->pc = 0x07;
8651063
8661064      /* timer overflow flip-flop is reset once taken */
8671065      cpustate->timer_overflow = FALSE;
1066      return 2;
8681067   }
1068   return 0;
8691069}
8701070
8711071
r4057r4058
9201120static CPU_EXECUTE( mcs48 )
9211121{
9221122   mcs48_state *cpustate = device->token;
923   unsigned opcode;
1123   int curcycles;
9241124
9251125   update_regptr(cpustate);
9261126
9271127   cpustate->icount = cycles;
9281128
9291129   /* external interrupts may have been set since we last checked */
930   cpustate->inst_cycles = 0;
931   check_irqs(cpustate);
932   cpustate->icount -= cpustate->inst_cycles;
1130   curcycles = check_irqs(cpustate);
1131   cpustate->icount -= curcycles;
9331132   if (cpustate->timecount_enabled != 0)
934      burn_cycles(cpustate, cpustate->inst_cycles);
1133      burn_cycles(cpustate, curcycles);
9351134
9361135   /* iterate over remaining cycles, guaranteeing at least one instruction */
9371136   do
9381137   {
1138      unsigned opcode;
1139
9391140      /* fetch next opcode */
9401141      cpustate->prevpc = cpustate->pc;
941      debugger_instruction_hook(device, PC);
942      opcode = opcode_fetch(cpustate, PC++);
1142      debugger_instruction_hook(device, cpustate->pc);
1143      opcode = opcode_fetch(cpustate);
9431144
9441145      /* process opcode and count cycles */
945      cpustate->inst_cycles = opcode_table[opcode].cycles;
946      (*opcode_table[opcode].function)(cpustate);
1146      curcycles = (*opcode_table[opcode])(cpustate);
9471147
9481148      /* burn the cycles */
949      cpustate->icount -= cpustate->inst_cycles;
1149      cpustate->icount -= curcycles;
9501150      if (cpustate->timecount_enabled != 0)
951         burn_cycles(cpustate, cpustate->inst_cycles);
1151         burn_cycles(cpustate, curcycles);
9521152
9531153   } while (cpustate->icount > 0);
9541154
r4057r4058
9581158
9591159
9601160/***************************************************************************
1161    DATA ACCESS HELPERS
1162***************************************************************************/
1163
1164/*-------------------------------------------------
1165    upi41_master_r - master CPU data/status
1166    read
1167-------------------------------------------------*/
1168
1169UINT8 upi41_master_r(const device_config *device, UINT8 a0)
1170{
1171   mcs48_state *cpustate = device->token;
1172
1173   /* if just reading the status, return it */
1174   if ((a0 & 1) != 0)
1175      return cpustate->sts;
1176
1177   /* if the output buffer was full, it gets cleared now */
1178   if (cpustate->sts & STS_OBF)
1179   {
1180      cpustate->sts &= ~STS_OBF;
1181      if (cpustate->flags_enabled)
1182         port_w(2, cpustate->p2 &= ~P2_OBF);
1183   }
1184   return cpustate->dbbo;
1185}
1186
1187
1188/*-------------------------------------------------
1189    upi41_master_w - master CPU command/data
1190    write
1191-------------------------------------------------*/
1192
1193static TIMER_CALLBACK( master_callback )
1194{
1195   const device_config *device = ptr;
1196   mcs48_state *cpustate = device->token;
1197   UINT8 a0 = (param >> 8) & 1;
1198   UINT8 data = param;
1199
1200   /* data always goes to the input buffer */
1201   cpustate->dbbi = data;
1202
1203   /* set the appropriate flags */
1204   if ((cpustate->sts & STS_IBF) == 0)
1205   {
1206      cpustate->sts |= STS_IBF;
1207      if (cpustate->flags_enabled)
1208         port_w(2, cpustate->p2 &= ~P2_NIBF);
1209   }
1210
1211   /* set F1 accordingly */
1212   if (a0 == 0)
1213      cpustate->sts &= ~STS_F1;
1214   else
1215      cpustate->sts |= STS_F1;
1216}
1217
1218void upi41_master_w(const device_config *device, UINT8 a0, UINT8 data)
1219{
1220   timer_call_after_resynch(device->machine, (void *)device, (a0 << 8) | data, master_callback);
1221}
1222
1223
1224
1225/***************************************************************************
9611226    ADDRESS MAPS
9621227***************************************************************************/
9631228
9641229/* FIXME: the memory maps should probably support rom banking for EA */
9651230static ADDRESS_MAP_START(program_10bit, ADDRESS_SPACE_PROGRAM, 8)
966   AM_RANGE(0x00, 0x3ff) AM_ROM
1231   AM_RANGE(0x000, 0x3ff) AM_ROM
9671232ADDRESS_MAP_END
9681233
9691234static ADDRESS_MAP_START(program_11bit, ADDRESS_SPACE_PROGRAM, 8)
970   AM_RANGE(0x00, 0x7ff) AM_ROM
1235   AM_RANGE(0x000, 0x7ff) AM_ROM
9711236ADDRESS_MAP_END
9721237
1238static ADDRESS_MAP_START(program_12bit, ADDRESS_SPACE_PROGRAM, 8)
1239   AM_RANGE(0x000, 0xfff) AM_ROM
1240ADDRESS_MAP_END
1241
9731242static ADDRESS_MAP_START(data_6bit, ADDRESS_SPACE_DATA, 8)
9741243   AM_RANGE(0x00, 0x3f) AM_RAM
9751244ADDRESS_MAP_END
r4057r4058
9781247   AM_RANGE(0x00, 0x7f) AM_RAM
9791248ADDRESS_MAP_END
9801249
1250static ADDRESS_MAP_START(data_8bit, ADDRESS_SPACE_DATA, 8)
1251   AM_RANGE(0x00, 0xff) AM_RAM
1252ADDRESS_MAP_END
9811253
9821254
1255
9831256/***************************************************************************
9841257    GENERAL CONTEXT ACCESS
9851258***************************************************************************/
9861259
9871260/*-------------------------------------------------
1261    mcs48_import_state - import state from the
1262    debugger into our internal format
1263-------------------------------------------------*/
1264
1265static CPU_IMPORT_STATE( mcs48 )
1266{
1267   mcs48_state *cpustate = device->token;
1268
1269   switch (entry->index)
1270   {
1271      case MCS48_R0:
1272      case MCS48_R1:
1273      case MCS48_R2:
1274      case MCS48_R3:
1275      case MCS48_R4:
1276      case MCS48_R5:
1277      case MCS48_R6:
1278      case MCS48_R7:
1279         cpustate->regptr[entry->index - MCS48_R0] = cpustate->rtemp;
1280         break;
1281
1282      default:
1283         fatalerror("CPU_IMPORT_STATE(mcs48) called for unexpected value\n");
1284         break;
1285   }
1286}
1287
1288
1289/*-------------------------------------------------
1290    mcs48_export_state - prepare state for
1291    exporting to the debugger
1292-------------------------------------------------*/
1293
1294static CPU_EXPORT_STATE( mcs48 )
1295{
1296   mcs48_state *cpustate = device->token;
1297
1298   switch (entry->index)
1299   {
1300      case MCS48_R0:
1301      case MCS48_R1:
1302      case MCS48_R2:
1303      case MCS48_R3:
1304      case MCS48_R4:
1305      case MCS48_R5:
1306      case MCS48_R6:
1307      case MCS48_R7:
1308         cpustate->rtemp = cpustate->regptr[entry->index - MCS48_R0];
1309         break;
1310
1311      default:
1312         fatalerror("CPU_EXPORT_STATE(mcs48) called for unexpected value\n");
1313         break;
1314   }
1315}
1316
1317
1318/*-------------------------------------------------
9881319    mcs48_set_info - set a piece of information
9891320    on the CPU core
9901321-------------------------------------------------*/
r4057r4058
9971328   {
9981329      /* --- the following bits of info are set as 64-bit signed integers --- */
9991330      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ:   cpustate->irq_state = (info->i != CLEAR_LINE);   break;
1000      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:   cpustate->ea = (info->i != CLEAR_LINE);         break;
1001
1002      case CPUINFO_INT_PC:
1003      case CPUINFO_INT_REGISTER + MCS48_PC:         PC = info->i;                        break;
1004      case CPUINFO_INT_SP:
1005      case CPUINFO_INT_REGISTER + MCS48_PSW:         PSW = info->i;                        break;
1006      case CPUINFO_INT_REGISTER + MCS48_A:         A = info->i;                        break;
1007      case CPUINFO_INT_REGISTER + MCS48_TC:         cpustate->timer = info->i;                  break;
1008      case CPUINFO_INT_REGISTER + MCS48_P1:         cpustate->p1 = info->i;                     break;
1009      case CPUINFO_INT_REGISTER + MCS48_P2:         cpustate->p2 = info->i;                     break;
1010      case CPUINFO_INT_REGISTER + MCS48_R0:         R0 = info->i;                        break;
1011      case CPUINFO_INT_REGISTER + MCS48_R1:         R1 = info->i;                        break;
1012      case CPUINFO_INT_REGISTER + MCS48_R2:         R2 = info->i;                        break;
1013      case CPUINFO_INT_REGISTER + MCS48_R3:         R3 = info->i;                        break;
1014      case CPUINFO_INT_REGISTER + MCS48_R4:         R4 = info->i;                        break;
1015      case CPUINFO_INT_REGISTER + MCS48_R5:         R5 = info->i;                        break;
1016      case CPUINFO_INT_REGISTER + MCS48_R6:         R6 = info->i;                        break;
1017      case CPUINFO_INT_REGISTER + MCS48_R7:         R7 = info->i;                        break;
1018      case CPUINFO_INT_REGISTER + MCS48_EA:         cpustate->ea = info->i;                     break;
1331      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:   cpustate->ea = (info->i != CLEAR_LINE);   break;
10191332   }
10201333}
10211334
r4057r4058
10321345   switch (state)
10331346   {
10341347      /* --- the following bits of info are returned as 64-bit signed integers --- */
1035      case CPUINFO_INT_CONTEXT_SIZE:                     info->i = sizeof(mcs48_state);         break;
1036      case CPUINFO_INT_INPUT_LINES:                     info->i = 2;                     break;
1037      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:               info->i = MCS48_INPUT_IRQ;            break;
1038      case CPUINFO_INT_ENDIANNESS:                     info->i = ENDIANNESS_LITTLE;               break;
1039      case CPUINFO_INT_CLOCK_MULTIPLIER:                  info->i = 1;                     break;
1040      case CPUINFO_INT_CLOCK_DIVIDER:                     info->i = 3*5;                     break;
1041      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:               info->i = 1;                     break;
1042      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:               info->i = 2;                     break;
1043      case CPUINFO_INT_MIN_CYCLES:                     info->i = 1;                     break;
1044      case CPUINFO_INT_MAX_CYCLES:                     info->i = 3;                     break;
1348      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(mcs48_state);         break;
1349      case CPUINFO_INT_INPUT_LINES:               info->i = 2;                     break;
1350      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = MCS48_INPUT_IRQ;            break;
1351      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_LITTLE;         break;
1352      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
1353      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 3*5;                     break;
1354      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
1355      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
1356      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
1357      case CPUINFO_INT_MAX_CYCLES:               info->i = 3;                     break;
10451358
1046      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:   info->i = 8;                     break;
1047      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 12;                     break;
1048      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM: info->i = 0;                     break;
1049      case CPUINFO_INT_DATABUS_WIDTH_DATA:   info->i = 8;                     break;
1050      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    /*info->i = 6 or 7;*/               break;
1051      case CPUINFO_INT_ADDRBUS_SHIFT_DATA:    info->i = 0;                     break;
1052      case CPUINFO_INT_DATABUS_WIDTH_IO:      info->i = 8;                     break;
1053      case CPUINFO_INT_ADDRBUS_WIDTH_IO:       info->i = 9;                     break;
1054      case CPUINFO_INT_ADDRBUS_SHIFT_IO:       info->i = 0;                     break;
1359      case CPUINFO_INT_DATABUS_WIDTH_PROGRAM:         info->i = 8;                     break;
1360      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM:       info->i = 12;                     break;
1361      case CPUINFO_INT_ADDRBUS_SHIFT_PROGRAM:          info->i = 0;                     break;
1362      case CPUINFO_INT_DATABUS_WIDTH_DATA:         info->i = 8;                     break;
1363      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          /*info->i = 6 or 7 or 8;*/            break;
1364      case CPUINFO_INT_ADDRBUS_SHIFT_DATA:          info->i = 0;                     break;
1365      case CPUINFO_INT_DATABUS_WIDTH_IO:            info->i = 8;                     break;
1366      case CPUINFO_INT_ADDRBUS_WIDTH_IO:             info->i = 9;                     break;
1367      case CPUINFO_INT_ADDRBUS_SHIFT_IO:             info->i = 0;                     break;
10551368
1056      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ:         info->i = cpustate->irq_state ? ASSERT_LINE : CLEAR_LINE; break;
1057      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:         info->i = cpustate->ea;                  break;
1369      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_IRQ:   info->i = cpustate->irq_state ? ASSERT_LINE : CLEAR_LINE; break;
1370      case CPUINFO_INT_INPUT_STATE + MCS48_INPUT_EA:   info->i = cpustate->ea;               break;
10581371
1059      case CPUINFO_INT_PREVIOUSPC:                     info->i = cpustate->prevpc.w.l;            break;
1372      /* --- the following bits of info are returned as pointers to functions --- */
1373      case CPUINFO_FCT_SET_INFO:      info->setinfo = CPU_SET_INFO_NAME(mcs48);            break;
1374      case CPUINFO_FCT_INIT:         /* set per-core */                              break;
1375      case CPUINFO_FCT_RESET:         info->reset = CPU_RESET_NAME(mcs48);               break;
1376      case CPUINFO_FCT_EXECUTE:      info->execute = CPU_EXECUTE_NAME(mcs48);            break;
1377      case CPUINFO_FCT_DISASSEMBLE:   info->disassemble = CPU_DISASSEMBLE_NAME(mcs48);      break;
1378      case CPUINFO_FCT_IMPORT_STATE:   info->import_state = CPU_IMPORT_STATE_NAME(mcs48);      break;
1379      case CPUINFO_FCT_EXPORT_STATE:   info->export_state = CPU_EXPORT_STATE_NAME(mcs48);      break;
10601380
1061      case CPUINFO_INT_PC:
1062      case CPUINFO_INT_REGISTER + MCS48_PC:               info->i = PC;                     break;
1063      case CPUINFO_INT_REGISTER + MCS48_PSW:               info->i = PSW;                     break;
1064      case CPUINFO_INT_REGISTER + MCS48_A:               info->i = A;                     break;
1065      case CPUINFO_INT_REGISTER + MCS48_TC:               info->i = cpustate->timer;               break;
1066      case CPUINFO_INT_REGISTER + MCS48_P1:               info->i = cpustate->p1;                  break;
1067      case CPUINFO_INT_REGISTER + MCS48_P2:               info->i = cpustate->p2;                  break;
1068      case CPUINFO_INT_REGISTER + MCS48_R0:               info->i = R0;                     break;
1069      case CPUINFO_INT_REGISTER + MCS48_R1:               info->i = R1;                     break;
1070      case CPUINFO_INT_REGISTER + MCS48_R2:               info->i = R2;                     break;
1071      case CPUINFO_INT_REGISTER + MCS48_R3:               info->i = R3;                     break;
1072      case CPUINFO_INT_REGISTER + MCS48_R4:               info->i = R4;                     break;
1073      case CPUINFO_INT_REGISTER + MCS48_R5:               info->i = R5;                     break;
1074      case CPUINFO_INT_REGISTER + MCS48_R6:               info->i = R6;                     break;
1075      case CPUINFO_INT_REGISTER + MCS48_R7:               info->i = R7;                     break;
1076      case CPUINFO_INT_REGISTER + MCS48_EA:               info->i = cpustate->ea;                  break;
1381      /* --- the following bits of info are returned as pointers --- */
1382      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;      break;
1383      case CPUINFO_PTR_STATE_TABLE:               info->state_table = &cpustate->state;   break;
1384      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   /* set per-core */                  break;
1385      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       /* set per-core */                   break;
10771386
1078      /* --- the following bits of info are returned as pointers to data or functions --- */
1079      case CPUINFO_FCT_SET_INFO:                        info->setinfo = CPU_SET_INFO_NAME(mcs48);         break;
1080      case CPUINFO_FCT_INIT:                           /*info->init = CPU_INIT_NAME(i8039);*/         break;
1081      case CPUINFO_FCT_RESET:                           info->reset = CPU_RESET_NAME(mcs48);            break;
1082      case CPUINFO_FCT_EXECUTE:                        info->execute = CPU_EXECUTE_NAME(mcs48);         break;
1083      case CPUINFO_FCT_BURN:                           info->burn = NULL;                  break;
1084      case CPUINFO_FCT_DISASSEMBLE:                     info->disassemble = CPU_DISASSEMBLE_NAME(mcs48);         break;
1085      case CPUINFO_PTR_INSTRUCTION_COUNTER:               info->icount = &cpustate->icount;         break;
1086
1087      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM: /*info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);*/ break;
1088      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:    /*info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);*/ break;
1089
10901387      /* --- the following bits of info are returned as NULL-terminated strings --- */
1091      case CPUINFO_STR_NAME:                           /*strcpy(info->s, "I8039");*/         break;
1092      case CPUINFO_STR_CORE_FAMILY:                     strcpy(info->s, "Intel 8039");         break;
1093      case CPUINFO_STR_CORE_VERSION:                     strcpy(info->s, "1.2");               break;
1094      case CPUINFO_STR_CORE_FILE:                        strcpy(info->s, __FILE__);            break;
1095      case CPUINFO_STR_CORE_CREDITS:                     strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break;
1388      case CPUINFO_STR_NAME:                     /* set per-core */                  break;
1389      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Intel 8039");         break;
1390      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.2");               break;
1391      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1392      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Mirko Buffoni\nBased on the original work Copyright Dan Boris"); break;
10961393
10971394      case CPUINFO_STR_FLAGS:
10981395         sprintf(info->s, "%c%c %c%c%c%c%c%c%c%c",
10991396            cpustate->irq_state ? 'I':'.',
11001397            cpustate->a11       ? 'M':'.',
1101            PSW & 0x80 ? 'C':'.',
1102            PSW & 0x40 ? 'A':'.',
1103            PSW & 0x20 ? 'F':'.',
1104            PSW & 0x10 ? 'B':'.',
1105            PSW & 0x08 ? '?':'.',
1106            PSW & 0x04 ? '4':'.',
1107            PSW & 0x02 ? '2':'.',
1108            PSW & 0x01 ? '1':'.');
1398            cpustate->psw & 0x80 ? 'C':'.',
1399            cpustate->psw & 0x40 ? 'A':'.',
1400            cpustate->psw & 0x20 ? 'F':'.',
1401            cpustate->psw & 0x10 ? 'B':'.',
1402            cpustate->psw & 0x08 ? '?':'.',
1403            cpustate->psw & 0x04 ? '4':'.',
1404            cpustate->psw & 0x02 ? '2':'.',
1405            cpustate->psw & 0x01 ? '1':'.');
11091406         break;
1110
1111      case CPUINFO_STR_REGISTER + MCS48_PC:               sprintf(info->s, "PC:%04X", PC);       break;
1112      case CPUINFO_STR_REGISTER + MCS48_PSW:               sprintf(info->s, "PSW:%02X", PSW);       break;
1113      case CPUINFO_STR_REGISTER + MCS48_A:               sprintf(info->s, "A:%02X", A);          break;
1114      case CPUINFO_STR_REGISTER + MCS48_TC:               sprintf(info->s, "TC:%02X", cpustate->timer); break;
1115      case CPUINFO_STR_REGISTER + MCS48_P1:               sprintf(info->s, "P1:%02X", cpustate->p1);    break;
1116      case CPUINFO_STR_REGISTER + MCS48_P2:               sprintf(info->s, "P2:%02X", cpustate->p2);    break;
1117      case CPUINFO_STR_REGISTER + MCS48_R0:               sprintf(info->s, "R0:%02X", R0);      break;
1118      case CPUINFO_STR_REGISTER + MCS48_R1:               sprintf(info->s, "R1:%02X", R1);       break;
1119      case CPUINFO_STR_REGISTER + MCS48_R2:               sprintf(info->s, "R2:%02X", R2);       break;
1120      case CPUINFO_STR_REGISTER + MCS48_R3:               sprintf(info->s, "R3:%02X", R3);       break;
1121      case CPUINFO_STR_REGISTER + MCS48_R4:               sprintf(info->s, "R4:%02X", R4);       break;
1122      case CPUINFO_STR_REGISTER + MCS48_R5:               sprintf(info->s, "R5:%02X", R5);       break;
1123      case CPUINFO_STR_REGISTER + MCS48_R6:               sprintf(info->s, "R6:%02X", R6);       break;
1124      case CPUINFO_STR_REGISTER + MCS48_R7:               sprintf(info->s, "R7:%02X", R7);       break;
1125      case CPUINFO_STR_REGISTER + MCS48_EA:               sprintf(info->s, "EA:%02X", cpustate->ea);    break;
11261407   }
11271408}
11281409
r4057r4058
11321413    CPU-SPECIFIC CONTEXT ACCESS
11331414***************************************************************************/
11341415
1135#if (HAS_I8035)
1136CPU_GET_INFO( i8035 )
1416static void mcs48_generic_get_info(const device_config *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name)
11371417{
11381418   switch (state)
11391419   {
1140      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 6;                              break;
1141      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);      break;
1142      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8035);                     break;
1143      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8035");                     break;
1144      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1145   }
1146}
1147#endif
1420      /* --- the following bits of info are returned as 64-bit signed integers --- */
1421      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:
1422         if (ramsize == 64)
1423            info->i = 6;
1424         else if (ramsize == 128)
1425            info->i = 7;
1426         else if (ramsize == 256)
1427            info->i = 8;
1428         else
1429            fatalerror("mcs48_generic_get_info: Invalid RAM size");
1430         break;
11481431
1149#if (HAS_I8048)
1150CPU_GET_INFO( i8048 )
1151{
1152   switch (state)
1153   {
1154      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 6;                              break;
1155      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);   break;
1156      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);      break;
1157      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8048);                     break;
1158      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8048");                     break;
1159      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1160   }
1161}
1162#endif
1432      /* --- the following bits of info are returned as pointers to functions --- */
1433      case CPUINFO_FCT_INIT:
1434         if (romsize == 0)
1435            info->init = CPU_INIT_NAME(mcs48_norom);
1436         else if (romsize == 1024)
1437            info->init = (features == UPI41_FEATURE) ? CPU_INIT_NAME(upi41_1k_rom) : CPU_INIT_NAME(mcs48_1k_rom);
1438         else if (romsize == 2048)
1439            info->init = (features == UPI41_FEATURE) ? CPU_INIT_NAME(upi41_2k_rom) : CPU_INIT_NAME(mcs48_2k_rom);
1440         else if (romsize == 4096)
1441            info->init = CPU_INIT_NAME(mcs48_4k_rom);
1442         else
1443            fatalerror("mcs48_generic_get_info: Invalid ROM size");
1444         break;
11631445
1164#if (HAS_I8648)
1165CPU_GET_INFO( i8648 )
1166{
1167   switch (state)
1168   {
1169      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 6;                              break;
1170      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);   break;
1171      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);      break;
1172      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8048);                     break;
1173      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8648");                     break;
1174      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1175   }
1176}
1177#endif
1446      case CPUINFO_FCT_DISASSEMBLE:
1447         if (features == UPI41_FEATURE)
1448            info->disassemble = CPU_DISASSEMBLE_NAME(upi41);
1449         else
1450            info->disassemble = CPU_DISASSEMBLE_NAME(mcs48);
1451         break;
11781452
1179#if (HAS_I8748)
1180CPU_GET_INFO( i8748 )
1181{
1182   switch (state)
1183   {
1184      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 6;                              break;
1185      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);   break;
1186      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);      break;
1187      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8048);                     break;
1188      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8748");                     break;
1189      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1190   }
1191}
1192#endif
1453      /* --- the following bits of info are returned as pointers --- */
1454      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:
1455         if (romsize == 0)
1456            info->internal_map8 = NULL;
1457         else if (romsize == 1024)
1458            info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);
1459         else if (romsize == 2048)
1460            info->internal_map8 = ADDRESS_MAP_NAME(program_11bit);
1461         else if (romsize == 4096)
1462            info->internal_map8 = ADDRESS_MAP_NAME(program_12bit);
1463         else
1464            fatalerror("mcs48_generic_get_info: Invalid RAM size");
1465         break;
11931466
1194#if (HAS_MB8884)
1195CPU_GET_INFO( mb8884 )
1196{
1197   switch (state)
1198   {
1199      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 6;                              break;
1200      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);      break;
1201      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8035);                     break;
1202      case CPUINFO_STR_NAME:                                 strcpy(info->s, "MB8884");                     break;
1203      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1204   }
1205}
1206#endif
1467      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:
1468         if (ramsize == 64)
1469            info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);
1470         else if (ramsize == 128)
1471            info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);
1472         else if (ramsize == 256)
1473            info->internal_map8 = ADDRESS_MAP_NAME(data_8bit);
1474         else
1475            fatalerror("mcs48_generic_get_info: Invalid RAM size");
1476         break;
12071477
1208#if (HAS_N7751)
1209CPU_GET_INFO( n7751 )
1210{
1211   switch (state)
1212   {
1213      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 6;                              break;
1214      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_10bit);   break;
1215      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_6bit);      break;
1216      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8048);                     break;
1217      case CPUINFO_STR_NAME:                                 strcpy(info->s, "N7751");                     break;
1218      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1478      /* --- the following bits of info are returned as NULL-terminated strings --- */
1479      case CPUINFO_STR_NAME:
1480         strcpy(info->s, name);
1481         break;
1482
1483      /* default case */
1484      default:
1485         CPU_GET_INFO_CALL(mcs48);
1486         break;
12191487   }
12201488}
1221#endif
12221489
12231490
1491/* Official Intel MCS-48 parts */
1492CPU_GET_INFO( i8035 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE,    0,  64, "I8035"); }
1493CPU_GET_INFO( i8048 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024,  64, "I8048"); }
1494CPU_GET_INFO( i8648 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024,  64, "I8648"); }
1495CPU_GET_INFO( i8748 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024,  64, "I8748"); }
1496CPU_GET_INFO( i8039 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE,    0, 128, "I8039"); }
1497CPU_GET_INFO( i8049 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "I8049"); }
1498CPU_GET_INFO( i8749 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "I8749"); }
1499CPU_GET_INFO( i8040 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE,    0, 256, "I8040"); }
1500CPU_GET_INFO( i8050 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 4096, 256, "I8050"); }
12241501
1225#if (HAS_I8039)
1226CPU_GET_INFO( i8039 )
1227{
1228   switch (state)
1229   {
1230      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 7;                              break;
1231      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);      break;
1232      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8039);                     break;
1233      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8039");                     break;
1234      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1235   }
1236}
1237#endif
12381502
1239#if (HAS_I8049)
1240CPU_GET_INFO( i8049 )
1241{
1242   switch (state)
1243   {
1244      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 7;                              break;
1245      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_11bit);   break;
1246      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);      break;
1247      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8049);                     break;
1248      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8049");                     break;
1249      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1250   }
1251}
1252#endif
1503/* Official Intel UPI-41 parts */
1504CPU_GET_INFO( i8041 )  { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 1024, 128, "I8041"); }
1505CPU_GET_INFO( i8741 )  { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 1024, 128, "I8741"); }
1506CPU_GET_INFO( i8042 )  { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 2048, 256, "I8042"); }
1507CPU_GET_INFO( i8242 )  { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 2048, 256, "I8242"); }
1508CPU_GET_INFO( i8742 )  { mcs48_generic_get_info(device, state, info, UPI41_FEATURE, 2048, 256, "I8742"); }
12531509
1254#if (HAS_I8749)
1255CPU_GET_INFO( i8749 )
1256{
1257   switch (state)
1258   {
1259      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 7;                              break;
1260      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_11bit);   break;
1261      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);      break;
1262      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8049);                     break;
1263      case CPUINFO_STR_NAME:                                 strcpy(info->s, "I8749");                     break;
1264      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1265   }
1266}
1267#endif
12681510
1269#if (HAS_M58715)
1270CPU_GET_INFO( m58715 )
1271{
1272   switch (state)
1273   {
1274      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:          info->i = 7;                              break;
1275      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_11bit);   break;
1276      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:       info->internal_map8 = ADDRESS_MAP_NAME(data_7bit);      break;
1277      case CPUINFO_FCT_INIT:                                 info->init = CPU_INIT_NAME(i8049);                     break;
1278      case CPUINFO_STR_NAME:                                 strcpy(info->s, "M58715");                     break;
1279      default:                                          CPU_GET_INFO_CALL(mcs48);                     break;
1280   }
1281}
1282#endif
1511/* Clones */
1512CPU_GET_INFO( mb8884 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE,    0,  64, "MB8884"); }
1513CPU_GET_INFO( n7751 )  { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 1024,  64, "N7751"); }
1514CPU_GET_INFO( m58715 ) { mcs48_generic_get_info(device, state, info, MCS48_FEATURE, 2048, 128, "M58715"); }
src/emu/cpu/mcs48/mcs48dsm.c
r4057r4058
1/****************************************************************************
2 *
3 *      mcs48 disassembler
4 *
5 * This file is Copyright Michael Cuddy, Fen's Ende Sofware.
6 * Redistribution is allowed in source and binary form as long as both
7 * forms are distributed together with the file 'README'.  This copyright
8 * notice must also accompany the files.
9 *
10 * This software should be considered a small token to all of the
11 * emulator authors for thier dilligence in preserving our Arcade and
12 * Computer history.
13 *
14 * Michael Cuddy, Fen's Ende Software.
15 * 11/25/1996
16 *
17 * Adapted by Andrea Mazzoleni for use with MAME
18 *
19 ***************************************************************************/
1/***************************************************************************
202
21#include <ctype.h>
3    mcs48dsm.c
224
23#include "cpuintrf.h"
5    Simple MCS-48/UPI-41 disassembler.
6    Written by Aaron Giles
247
25#define mame_printf_debug printf
8***************************************************************************/
269
27typedef unsigned char byte;
10#include "cpuintrf.h"
2811
29#define FMT(a,b) a, b
30#define PTRS_PER_FORMAT 2
3112
32static const char *const Formats[] = {
33   FMT("00000011dddddddd", "add  a,#$%X"),
34   FMT("01101rrr", "add  a,%R"),
35   FMT("0110000r", "add  a,@%R"),
36   FMT("00010011dddddddd", "adc  a,#$%X"),
37   FMT("01111rrr", "adc  a,%R"),
38   FMT("0111000r", "adc  a,@%R"),
39   FMT("01010011dddddddd", "anl  a,#$%X"),
40   FMT("01011rrr", "anl  a,%R"),
41   FMT("0101000r", "anl  a,@%R"),
42   FMT("10011000dddddddd", "anl  bus,#$%X"),
43   FMT("10011001dddddddd", "anl  p1,#$%X"),
44   FMT("10011010dddddddd", "anl  p2,#$%X"),
45   FMT("100111pp", "anld %P,a"),
46   FMT("aaa10100aaaaaaaa", "!call %A"),
47   FMT("00100111", "clr  a"),
48   FMT("10010111", "clr  c"),
49   FMT("10100101", "clr  f1"),
50   FMT("10000101", "clr  f0"),
51   FMT("00110111", "cpl  a"),
52   FMT("10100111", "cpl  c"),
53   FMT("10010101", "cpl  f0"),
54   FMT("10110101", "cpl  f1"),
55   FMT("01010111", "da   a"),
56   FMT("00000111", "dec  a"),
57   FMT("11001rrr", "dec  %R"),
58   FMT("00010101", "dis  i"),
59   FMT("00110101", "dis  tcnti"),
60   FMT("11101rrraaaaaaaa", "!djnz %R,%J"),
61   FMT("00000101", "en   i"),
62   FMT("00100101", "en   tcnti"),
63   FMT("01110101", "ent0 clk"),
64   FMT("00001001", "in   a,p1"),
65   FMT("00001010", "in   a,p2"),
66   FMT("00010111", "inc  a"),
67   FMT("00011rrr", "inc  %R"),
68   FMT("0001000r", "inc  @%R"),
69   FMT("00001000", "ins  a,bus"),
70   FMT("0001 0110aaaaaaaa", "jtf  %J"),
71   FMT("0010 0110aaaaaaaa", "jnt0 %J"),
72   FMT("0011 0110aaaaaaaa", "jt0  %J"),
73   FMT("0100 0110aaaaaaaa", "jnt1 %J"),
74   FMT("0101 0110aaaaaaaa", "jt1  %J"),
75   FMT("0111 0110aaaaaaaa", "jf1  %J"),
76   FMT("1000 0110aaaaaaaa", "jni  %J"),
77   FMT("1001 0110aaaaaaaa", "jnz  %J"),
78   FMT("1011 0110aaaaaaaa", "jf0  %J"),
79   FMT("1100 0110aaaaaaaa", "jz   %J"),
80   FMT("1110 0110aaaaaaaa", "jnc  %J"),
81   FMT("1111 0110aaaaaaaa", "jc   %J"),
82   FMT("bbb10010aaaaaaaa", "jb%B  %J"),
83   FMT("aaa00100aaaaaaaa", "jmp  %A"),
84   FMT("10110011", "jmpp @a"),
85   FMT("00100011dddddddd", "mov  a,#$%X"),
86   FMT("11111rrr", "mov  a,%R"),
87   FMT("1111000r", "mov  a,@%R"),
88   FMT("11000111", "mov  a,psw"),
89   FMT("10111rrrdddddddd", "mov  %R,#$%X"),
90   FMT("10101rrr", "mov  %R,a"),
91   FMT("1010000r", "mov  @%R,a"),
92   FMT("1011000rdddddddd", "mov  @%R,#$%X"),
93   FMT("11010111", "mov  psw,a"),
94   FMT("000011pp", "movd a,%P"),
95   FMT("001111pp", "movd %P,a"),
96   FMT("01000010", "mov  a,t"),
97   FMT("01100010", "mov  t,a"),
98   FMT("11100011", "movp3 a,@a"),
99   FMT("10100011", "movp a,@a"),
100   FMT("1000000r", "movx a,@%R"),
101   FMT("1001000r", "movx @%R,a"),
102   FMT("0100 1rrr", "orl  a,%R"),
103   FMT("0100 000r", "orl  a,@%R"),
104   FMT("0100 0011dddddddd", "orl  a,#$%X"),
105   FMT("1000 1000dddddddd", "orl  bus,#$%X"),
106   FMT("1000 1001dddddddd", "orl  p1,#$%X"),
107   FMT("1000 1010dddddddd", "orl  p2,#$%X"),
108   FMT("1000 11pp", "orld %P,a"),
109   FMT("00000010", "outl bus,a"),
110   FMT("001110pp", "outl %P,a"),
111   FMT("10000011", "^ret"),
112   FMT("10010011", "^retr"),
113   FMT("11100111", "rl   a"),
114   FMT("11110111", "rlc  a"),
115   FMT("01110111", "rr   a"),
116   FMT("01100111", "rrc  a"),
117   FMT("11100101", "sel  mb0"),
118   FMT("11110101", "sel  mb1"),
119   FMT("11000101", "sel  rb0"),
120   FMT("11010101", "sel  rb1"),
121   FMT("01100101", "stop tcnt"),
122   FMT("01000101", "strt cnt"),
123   FMT("01010101", "strt t"),
124   FMT("01000111", "swap a"),
125   FMT("00101rrr", "xch  a,%R"),
126   FMT("0010000r", "xch  a,@%R"),
127   FMT("0011000r", "xchd a,@%R"),
128   FMT("1101 0011dddddddd", "xrl  a,#$%X"),
129   FMT("1101 1rrr", "xrl  a,%R"),
130   FMT("1101 000r", "xrl  a,@%R"),
131   FMT("00000000", "nop"),
132   NULL
133};
134
135#define MAX_OPS (((sizeof(Formats) / sizeof(Formats[0])) - 1) / PTRS_PER_FORMAT)
136
137typedef struct opcode {
138   byte mask;   /* instruction mask */
139   byte bits;   /* constant bits */
140   char extcode;   /* value that gets extension code */
141   const char *parse;   /* how to parse bits */
142   const char *fmt;   /* instruction format */
143   unsigned long flags;
144} M48Opcode;
145
146static M48Opcode Op[MAX_OPS+1];
147static int OpInizialized = 0;
148
149static void InitDasm8039(void)
13static UINT32 common_dasm(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int upi41)
15014{
151   const char *p;
152   const char *const *ops;
153   byte mask, bits;
154   int bit;
155   int i;
15   const UINT8 *startram = opram;
16   UINT32 flags = 0;
15617
157   ops = Formats; i = 0;
158   while (*ops) {
159   unsigned long flags = 0;
160   p = *ops;
161   mask = 0; bits = 0; bit = 7;
162   while (*p && bit >= 0) {
163      switch (*p++) {
164         case '1': mask |= 1<<bit; bits |= 1<<bit; bit--; break;
165         case '0': mask |= 1<<bit; bit--; break;
166         case ' ': break;
167         case 'b':
168         case 'a': case 'r': case 'd': case 'p':
169            bit --;
170            break;
171         default:
172            fatalerror("Invalid instruction encoding '%s %s'\n", ops[0],ops[1]);
173            break;
174      }
175   }
176   if (bit != -1 ) {
177      fatalerror("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit);
178      break;
179   }
180   while (isspace(*p)) p++;
181   if (*p) Op[i].extcode = *p;
182   Op[i].bits = bits;
183   Op[i].mask = mask;
184   Op[i].fmt = ops[1];
185   Op[i].parse = ops[0];
186
187   if (Op[i].fmt[0] == '!')
18   opram++;
19   switch (*oprom++)
18820   {
189      flags |= DASMFLAG_STEP_OVER;
190      Op[i].fmt++;
21      case 0x00:      sprintf(buffer, "nop");                                       break;
22      case 0x02:   if (!upi41)
23                  sprintf(buffer, "out  bus,a");
24               else
25                  sprintf(buffer, "out  dbb,a");                                 break;
26      case 0x03:      sprintf(buffer, "add  a,#$%02X", *opram++);                        break;
27      case 0x04:      sprintf(buffer, "jmp  $0%02X", *opram++);                        break;
28      case 0x05:      sprintf(buffer, "en   i");                                    break;
29      case 0x07:      sprintf(buffer, "dec  a");                                    break;
30      case 0x08:   if (!upi41)
31                  sprintf(buffer, "in   a,bus");
32               else
33                  sprintf(buffer, "illegal");                                    break;
34      case 0x09:      sprintf(buffer, "in   a,p1");                                 break;
35      case 0x0a:      sprintf(buffer, "in   a,p2");                                 break;
36      case 0x0c:      sprintf(buffer, "movd a,p4");                                 break;
37      case 0x0d:      sprintf(buffer, "movd a,p5");                                 break;
38      case 0x0e:      sprintf(buffer, "movd a,p6");                                 break;
39      case 0x0f:      sprintf(buffer, "movd a,p7");                                 break;
40      case 0x10:      sprintf(buffer, "inc  @r0");                                 break;
41      case 0x11:      sprintf(buffer, "inc  @r1");                                 break;
42      case 0x12:      sprintf(buffer, "jb0  $%03X", (pc & 0xf00) | *opram++);               break;
43      case 0x13:      sprintf(buffer, "addc a,#$%02X", *opram++);                        break;
44      case 0x14:      sprintf(buffer, "call $0%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
45      case 0x15:      sprintf(buffer, "dis  i");                                    break;
46      case 0x16:      sprintf(buffer, "jtf  $%03X", (pc & 0xf00) | *opram++);               break;
47      case 0x17:      sprintf(buffer, "inc  a");                                    break;
48      case 0x18:      sprintf(buffer, "inc  r0");                                    break;
49      case 0x19:      sprintf(buffer, "inc  r1");                                    break;
50      case 0x1a:      sprintf(buffer, "inc  r2");                                    break;
51      case 0x1b:      sprintf(buffer, "inc  r3");                                    break;
52      case 0x1c:      sprintf(buffer, "inc  r4");                                    break;
53      case 0x1d:      sprintf(buffer, "inc  r5");                                    break;
54      case 0x1e:      sprintf(buffer, "inc  r6");                                    break;
55      case 0x1f:      sprintf(buffer, "inc  r7");                                    break;
56      case 0x20:      sprintf(buffer, "xch  a,@r0");                                 break;
57      case 0x21:      sprintf(buffer, "xch  a,@r1");                                 break;
58      case 0x22:   if (!upi41)
59                  sprintf(buffer, "illegal");
60               else
61                  sprintf(buffer, "in   a,dbb");                                 break;
62      case 0x23:      sprintf(buffer, "mov  a,#$%02X", *opram++);                        break;
63      case 0x24:      sprintf(buffer, "jmp  $1%02X", *opram++);                        break;
64      case 0x25:      sprintf(buffer, "en   tcnti");                                 break;
65      case 0x26:      sprintf(buffer, "jnt0 $%03X", (pc & 0xf00) | *opram++);               break;
66      case 0x27:      sprintf(buffer, "clr  a");                                    break;
67      case 0x28:      sprintf(buffer, "xch  a,r0");                                 break;
68      case 0x29:      sprintf(buffer, "xch  a,r1");                                 break;
69      case 0x2a:      sprintf(buffer, "xch  a,r2");                                 break;
70      case 0x2b:      sprintf(buffer, "xch  a,r3");                                 break;
71      case 0x2c:      sprintf(buffer, "xch  a,r4");                                 break;
72      case 0x2d:      sprintf(buffer, "xch  a,r5");                                 break;
73      case 0x2e:      sprintf(buffer, "xch  a,r6");                                 break;
74      case 0x2f:      sprintf(buffer, "xch  a,r7");                                 break;
75      case 0x30:      sprintf(buffer, "xchd a,@r0");                                 break;
76      case 0x31:      sprintf(buffer, "xchd a,@r1");                                 break;
77      case 0x32:      sprintf(buffer, "jb1  $%03X", (pc & 0xf00) | *opram++);               break;
78      case 0x34:      sprintf(buffer, "call $1%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
79      case 0x35:      sprintf(buffer, "dis  tcnti");                                 break;
80      case 0x36:      sprintf(buffer, "jt0  $%03X", (pc & 0xf00) | *opram++);               break;
81      case 0x37:      sprintf(buffer, "cpl  a");                                    break;
82      case 0x39:      sprintf(buffer, "outl p1,a");                                 break;
83      case 0x3a:      sprintf(buffer, "outl p2,a");                                 break;
84      case 0x3c:      sprintf(buffer, "movd p4,a");                                 break;
85      case 0x3d:      sprintf(buffer, "movd p5,a");                                 break;
86      case 0x3e:      sprintf(buffer, "movd p6,a");                                 break;
87      case 0x3f:      sprintf(buffer, "movd p7,a");                                 break;
88      case 0x40:      sprintf(buffer, "orl  a,@r0");                                 break;
89      case 0x41:      sprintf(buffer, "orl  a,@r1");                                 break;
90      case 0x42:      sprintf(buffer, "mov  a,t");                                 break;
91      case 0x43:      sprintf(buffer, "orl  a,#$%02X", *opram++);                        break;
92      case 0x44:      sprintf(buffer, "jmp  $2%02X", *opram++);                        break;
93      case 0x45:      sprintf(buffer, "strt cnt");                                 break;
94      case 0x46:      sprintf(buffer, "jnt1 $%03X", (pc & 0xf00) | *opram++);               break;
95      case 0x47:      sprintf(buffer, "swap a");                                    break;
96      case 0x48:      sprintf(buffer, "orl  a,r0");                                 break;
97      case 0x49:      sprintf(buffer, "orl  a,r1");                                 break;
98      case 0x4a:      sprintf(buffer, "orl  a,r2");                                 break;
99      case 0x4b:      sprintf(buffer, "orl  a,r3");                                 break;
100      case 0x4c:      sprintf(buffer, "orl  a,r4");                                 break;
101      case 0x4d:      sprintf(buffer, "orl  a,r5");                                 break;
102      case 0x4e:      sprintf(buffer, "orl  a,r6");                                 break;
103      case 0x4f:      sprintf(buffer, "orl  a,r7");                                 break;
104      case 0x50:      sprintf(buffer, "anl  a,@r0");                                 break;
105      case 0x51:      sprintf(buffer, "anl  a,@r1");                                 break;
106      case 0x52:      sprintf(buffer, "jb2  $%03X", (pc & 0xf00) | *opram++);               break;
107      case 0x53:      sprintf(buffer, "anl  a,#$%02X", *opram++);                        break;
108      case 0x54:      sprintf(buffer, "call $2%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
109      case 0x55:      sprintf(buffer, "strt t");                                    break;
110      case 0x56:      sprintf(buffer, "jt1  $%03X", (pc & 0xf00) | *opram++);               break;
111      case 0x57:      sprintf(buffer, "da   a");                                    break;
112      case 0x58:      sprintf(buffer, "anl  a,r0");                                 break;
113      case 0x59:      sprintf(buffer, "anl  a,r1");                                 break;
114      case 0x5a:      sprintf(buffer, "anl  a,r2");                                 break;
115      case 0x5b:      sprintf(buffer, "anl  a,r3");                                 break;
116      case 0x5c:      sprintf(buffer, "anl  a,r4");                                 break;
117      case 0x5d:      sprintf(buffer, "anl  a,r5");                                 break;
118      case 0x5e:      sprintf(buffer, "anl  a,r6");                                 break;
119      case 0x5f:      sprintf(buffer, "anl  a,r7");                                 break;
120      case 0x60:      sprintf(buffer, "add  a,@r0");                                 break;
121      case 0x61:      sprintf(buffer, "add  a,@r1");                                 break;
122      case 0x62:      sprintf(buffer, "mov  t,a");                                 break;
123      case 0x64:      sprintf(buffer, "jmp  $3%02X", *opram++);                        break;
124      case 0x65:      sprintf(buffer, "stop tcnt");                                 break;
125      case 0x67:      sprintf(buffer, "rrc  a");                                    break;
126      case 0x68:      sprintf(buffer, "add  a,r0");                                 break;
127      case 0x69:      sprintf(buffer, "add  a,r1");                                 break;
128      case 0x6a:      sprintf(buffer, "add  a,r2");                                 break;
129      case 0x6b:      sprintf(buffer, "add  a,r3");                                 break;
130      case 0x6c:      sprintf(buffer, "add  a,r4");                                 break;
131      case 0x6d:      sprintf(buffer, "add  a,r5");                                 break;
132      case 0x6e:      sprintf(buffer, "add  a,r6");                                 break;
133      case 0x6f:      sprintf(buffer, "add  a,r7");                                 break;
134      case 0x70:      sprintf(buffer, "addc a,@r0");                                 break;
135      case 0x71:      sprintf(buffer, "addc a,@r1");                                 break;
136      case 0x72:      sprintf(buffer, "jb3  $%03X", (pc & 0xf00) | *opram++);               break;
137      case 0x74:      sprintf(buffer, "call $3%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
138      case 0x75:   if (!upi41)
139                  sprintf(buffer, "ent0 clk");
140               else
141                  sprintf(buffer, "illegal");                                    break;
142      case 0x76:      sprintf(buffer, "jf1  $%03X", (pc & 0xf00) | *opram++);               break;
143      case 0x77:      sprintf(buffer, "rr   a");                                    break;
144      case 0x78:      sprintf(buffer, "addc a,r0");                                 break;
145      case 0x79:      sprintf(buffer, "addc a,r1");                                 break;
146      case 0x7a:      sprintf(buffer, "addc a,r2");                                 break;
147      case 0x7b:      sprintf(buffer, "addc a,r3");                                 break;
148      case 0x7c:      sprintf(buffer, "addc a,r4");                                 break;
149      case 0x7d:      sprintf(buffer, "addc a,r5");                                 break;
150      case 0x7e:      sprintf(buffer, "addc a,r6");                                 break;
151      case 0x7f:      sprintf(buffer, "addc a,r7");                                 break;
152      case 0x80:   if (!upi41)
153                  sprintf(buffer, "movx a,@r0");
154               else
155                  sprintf(buffer, "illegal");                                    break;
156      case 0x81:   if (!upi41)
157                  sprintf(buffer, "movx a,@r1");
158               else
159                  sprintf(buffer, "illegal");                                    break;
160      case 0x83:      sprintf(buffer, "ret"); flags = DASMFLAG_STEP_OUT;                  break;
161      case 0x84:      sprintf(buffer, "jmp  $4%02X", *opram++);                        break;
162      case 0x85:      sprintf(buffer, "clr  f0");                                    break;
163      case 0x86:   if (!upi41)
164                  sprintf(buffer, "jni  $%03X", (pc & 0xf00) | *opram++);
165               else
166                  sprintf(buffer, "jobf $%03X", (pc & 0xf00) | *opram++);               break;
167      case 0x88:   if (!upi41)
168                  sprintf(buffer, "orl  bus,#$%02X", *opram++);
169               else
170                  sprintf(buffer, "illegal");                                    break;
171      case 0x89:      sprintf(buffer, "orl  p1,#$%02X", *opram++);                     break;
172      case 0x8a:      sprintf(buffer, "orl  p2,#$%02X", *opram++);                     break;
173      case 0x8c:      sprintf(buffer, "orld p4,a");                                 break;
174      case 0x8d:      sprintf(buffer, "orld p5,a");                                 break;
175      case 0x8e:      sprintf(buffer, "orld p6,a");                                 break;
176      case 0x8f:      sprintf(buffer, "orld p7,a");                                 break;
177      case 0x90:   if (!upi41)
178                  sprintf(buffer, "movx @r0,a");
179               else
180                  sprintf(buffer, "mov  sts,a");                                 break;
181      case 0x91:   if (!upi41)
182                  sprintf(buffer, "movx @r1,a");
183               else
184                  sprintf(buffer, "illegal");                                    break;
185      case 0x92:      sprintf(buffer, "jb4  $%03X", (pc & 0xf00) | *opram++);               break;
186      case 0x93:      sprintf(buffer, "retr"); flags = DASMFLAG_STEP_OUT;                  break;
187      case 0x94:      sprintf(buffer, "call $4%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
188      case 0x95:      sprintf(buffer, "cpl  f0");                                    break;
189      case 0x96:      sprintf(buffer, "jnz  $%03X", (pc & 0xf00) | *opram++);               break;
190      case 0x97:      sprintf(buffer, "clr  c");                                    break;
191      case 0x98:   if (!upi41)
192                  sprintf(buffer, "anl  bus,#$%02X", *opram++);
193               else
194                  sprintf(buffer, "illegal");                                    break;
195      case 0x99:      sprintf(buffer, "anl  p1,#$%02X", *opram++);                     break;
196      case 0x9a:      sprintf(buffer, "anl  p2,#$%02X", *opram++);                     break;
197      case 0x9c:      sprintf(buffer, "anld p4,a");                                 break;
198      case 0x9d:      sprintf(buffer, "anld p5,a");                                 break;
199      case 0x9e:      sprintf(buffer, "anld p6,a");                                 break;
200      case 0x9f:      sprintf(buffer, "anld p7,a");                                 break;
201      case 0xa0:      sprintf(buffer, "mov  @r0,a");                                 break;
202      case 0xa1:      sprintf(buffer, "mov  @r1,a");                                 break;
203      case 0xa3:      sprintf(buffer, "movp a,@a");                                 break;
204      case 0xa4:      sprintf(buffer, "jmp  $5%02X", *opram++);                        break;
205      case 0xa5:      sprintf(buffer, "clr  f1");                                    break;
206      case 0xa7:      sprintf(buffer, "cpl  c");                                    break;
207      case 0xa8:      sprintf(buffer, "mov  r0,a");                                 break;
208      case 0xa9:      sprintf(buffer, "mov  r1,a");                                 break;
209      case 0xaa:      sprintf(buffer, "mov  r2,a");                                 break;
210      case 0xab:      sprintf(buffer, "mov  r3,a");                                 break;
211      case 0xac:      sprintf(buffer, "mov  r4,a");                                 break;
212      case 0xad:      sprintf(buffer, "mov  r5,a");                                 break;
213      case 0xae:      sprintf(buffer, "mov  r6,a");                                 break;
214      case 0xaf:      sprintf(buffer, "mov  r7,a");                                 break;
215      case 0xb0:      sprintf(buffer, "mov  @r0,#$%02X", *opram++);                     break;
216      case 0xb1:      sprintf(buffer, "mov  @r1,#$%02X", *opram++);                     break;
217      case 0xb2:      sprintf(buffer, "jb5  $%03X", (pc & 0xf00) | *opram++);               break;
218      case 0xb3:      sprintf(buffer, "jmpp @a");                                    break;
219      case 0xb4:      sprintf(buffer, "call $5%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
220      case 0xb5:      sprintf(buffer, "cpl  f1");                                    break;
221      case 0xb6:      sprintf(buffer, "jf0  $%03X", (pc & 0xf00) | *opram++);               break;
222      case 0xb8:      sprintf(buffer, "mov  r0,#$%02X", *opram++);                     break;
223      case 0xb9:      sprintf(buffer, "mov  r1,#$%02X", *opram++);                     break;
224      case 0xba:      sprintf(buffer, "mov  r2,#$%02X", *opram++);                     break;
225      case 0xbb:      sprintf(buffer, "mov  r3,#$%02X", *opram++);                     break;
226      case 0xbc:      sprintf(buffer, "mov  r4,#$%02X", *opram++);                     break;
227      case 0xbd:      sprintf(buffer, "mov  r5,#$%02X", *opram++);                     break;
228      case 0xbe:      sprintf(buffer, "mov  r6,#$%02X", *opram++);                     break;
229      case 0xbf:      sprintf(buffer, "mov  r7,#$%02X", *opram++);                     break;
230      case 0xc4:      sprintf(buffer, "jmp  $6%02X", *opram++);                        break;
231      case 0xc5:      sprintf(buffer, "sel  rb0");                                 break;
232      case 0xc6:      sprintf(buffer, "jz   $%03X", (pc & 0xf00) | *opram++);               break;
233      case 0xc7:      sprintf(buffer, "mov  a,psw");                                 break;
234      case 0xc8:      sprintf(buffer, "dec  r0");                                    break;
235      case 0xc9:      sprintf(buffer, "dec  r1");                                    break;
236      case 0xca:      sprintf(buffer, "dec  r2");                                    break;
237      case 0xcb:      sprintf(buffer, "dec  r3");                                    break;
238      case 0xcc:      sprintf(buffer, "dec  r4");                                    break;
239      case 0xcd:      sprintf(buffer, "dec  r5");                                    break;
240      case 0xce:      sprintf(buffer, "dec  r6");                                    break;
241      case 0xcf:      sprintf(buffer, "dec  r7");                                    break;
242      case 0xd0:      sprintf(buffer, "xrl  a,@r0");                                 break;
243      case 0xd1:      sprintf(buffer, "xrl  a,@r1");                                 break;
244      case 0xd2:      sprintf(buffer, "jb6  $%03X", (pc & 0xf00) | *opram++);               break;
245      case 0xd3:      sprintf(buffer, "xrl  a,#$%02X", *opram++);                        break;
246      case 0xd4:      sprintf(buffer, "call $6%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
247      case 0xd5:      sprintf(buffer, "sel  rb1");                                 break;
248      case 0xd6:   if (!upi41)
249                  sprintf(buffer, "illegal");
250               else
251                  sprintf(buffer, "jnibf $%03X", (pc & 0xf00) | *opram++);            break;
252      case 0xd7:      sprintf(buffer, "mov  psw,a");                                 break;
253      case 0xd8:      sprintf(buffer, "xrl  a,r0");                                 break;
254      case 0xd9:      sprintf(buffer, "xrl  a,r1");                                 break;
255      case 0xda:      sprintf(buffer, "xrl  a,r2");                                 break;
256      case 0xdb:      sprintf(buffer, "xrl  a,r3");                                 break;
257      case 0xdc:      sprintf(buffer, "xrl  a,r4");                                 break;
258      case 0xdd:      sprintf(buffer, "xrl  a,r5");                                 break;
259      case 0xde:      sprintf(buffer, "xrl  a,r6");                                 break;
260      case 0xdf:      sprintf(buffer, "xrl  a,r7");                                 break;
261      case 0xe3:      sprintf(buffer, "movp3 a,@a");                                 break;
262      case 0xe4:      sprintf(buffer, "jmp  $7%02X", *opram++);                        break;
263      case 0xe5:   if (!upi41)
264                  sprintf(buffer, "sel  mb0");
265               else
266                  sprintf(buffer, "en   dma");                                 break;
267      case 0xe6:      sprintf(buffer, "jnc  $%03X", (pc & 0xf00) | *opram++);               break;
268      case 0xe7:      sprintf(buffer, "rl   a");                                    break;
269      case 0xe8:      sprintf(buffer, "djnz r0,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
270      case 0xe9:      sprintf(buffer, "djnz r1,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
271      case 0xea:      sprintf(buffer, "djnz r2,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
272      case 0xeb:      sprintf(buffer, "djnz r3,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
273      case 0xec:      sprintf(buffer, "djnz r4,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
274      case 0xed:      sprintf(buffer, "djnz r5,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
275      case 0xee:      sprintf(buffer, "djnz r6,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
276      case 0xef:      sprintf(buffer, "djnz r7,$%03X", (pc & 0xf00) | *opram++); flags = DASMFLAG_STEP_OVER; break;
277      case 0xf0:      sprintf(buffer, "mov  a,@r0");                                 break;
278      case 0xf1:      sprintf(buffer, "mov  a,@r1");                                 break;
279      case 0xf2:      sprintf(buffer, "jb7  $%03X", (pc & 0xf00) | *opram++);               break;
280      case 0xf4:      sprintf(buffer, "call $7%02X", *opram++); flags = DASMFLAG_STEP_OVER;   break;
281      case 0xf5:   if (!upi41)
282                  sprintf(buffer, "sel  mb1");
283               else
284                  sprintf(buffer, "en   flags");                                 break;
285      case 0xf6:      sprintf(buffer, "jc   $%03X", (pc & 0xf00) | *opram++);               break;
286      case 0xf7:      sprintf(buffer, "rlc  a");                                    break;
287      case 0xf8:      sprintf(buffer, "mov  a,r0");                                 break;
288      case 0xf9:      sprintf(buffer, "mov  a,r1");                                 break;
289      case 0xfa:      sprintf(buffer, "mov  a,r2");                                 break;
290      case 0xfb:      sprintf(buffer, "mov  a,r3");                                 break;
291      case 0xfc:      sprintf(buffer, "mov  a,r4");                                 break;
292      case 0xfd:      sprintf(buffer, "mov  a,r5");                                 break;
293      case 0xfe:      sprintf(buffer, "mov  a,r6");                                 break;
294      case 0xff:      sprintf(buffer, "mov  a,r7");                                 break;
191295   }
192   if (Op[i].fmt[0] == '^')
193   {
194      flags |= DASMFLAG_STEP_OUT;
195      Op[i].fmt++;
196   }
197   Op[i].flags = flags;
198296
199   ops += PTRS_PER_FORMAT;
200   i++;
201   }
202
203   OpInizialized = 1;
297   return (opram - startram) | flags | DASMFLAG_SUPPORTED;
204298}
205299
300
206301CPU_DISASSEMBLE( mcs48 )
207302{
208   int b, a, d, r, p;   /* these can all be filled in by parsing an instruction */
209   int i;
210   int op;
211   int cnt = 1;
212   int code, bit;
213   const char *cp;
303   return common_dasm(device, buffer, pc, oprom, opram, FALSE);
304}
214305
215   if (!OpInizialized) InitDasm8039();
216306
217   code = oprom[0];
218   op = -1;   /* no matching opcode */
219   for ( i = 0; i < MAX_OPS; i++)
220   {
221      if( (code & Op[i].mask) == Op[i].bits )
222      {
223         if (op != -1)
224         {
225            fprintf(stderr, "Error: opcode %02X matches %d (%s) and %d (%s)\n",
226               code,i,Op[i].fmt,op,Op[op].fmt);
227         }
228         op = i;
229      }
230   }
231
232   if (op == -1)
233   {
234      sprintf(buffer,"db   %2.2x",code);
235      return cnt | DASMFLAG_SUPPORTED;
236   }
237
238   if (Op[op].extcode)
239   {
240      cnt++;
241      code <<= 8;
242      code |= opram[1];
243      bit = 15;
244   }
245   else
246   {
247      bit = 7;
248   }
249
250   /* shift out operands */
251   cp = Op[op].parse;
252   b = a = d = r = p = 0;
253
254   while (bit >= 0)
255   {
256      /* mame_printf_debug("{%c/%d}",*cp,bit); */
257      switch(*cp)
258      {
259         case 'a': a <<=1; a |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
260         case 'b': b <<=1; b |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
261         case 'd': d <<=1; d |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
262         case 'r': r <<=1; r |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
263         case 'p': p <<=1; p |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
264         case ' ': break;
265         case '1': case '0': bit--; break;
266         case '\0': fatalerror("premature end of parse string, opcode %x, bit = %d\n",code,bit); break;
267      }
268      cp++;
269   }
270
271   /* now traverse format string */
272   cp = Op[op].fmt;
273   while (*cp)
274   {
275      if (*cp == '%')
276      {
277         char num[10], *q;
278         cp++;
279         switch (*cp++)
280         {
281            case 'A': sprintf(num,"$%03X",a); break;
282            case 'J': sprintf(num,"$%03X",((pc+1) & 0xf00) | a); break;
283            case 'B': sprintf(num,"%d",b); break;
284            case 'D': sprintf(num,"%d",d); break;
285            case 'X': sprintf(num,"%X",d); break;
286            case 'R': sprintf(num,"r%d",r); break;
287            case 'P': sprintf(num,"p%d",p); break;
288            default:
289               fatalerror("illegal escape character in format '%s'\n",Op[op].fmt);
290               break;
291         }
292         q = num; while (*q) *buffer++ = *q++;
293         *buffer = '\0';
294      }
295      else
296      {
297         *buffer++ = *cp++;
298         *buffer = '\0';
299      }
300   }
301
302   return cnt | Op[op].flags | DASMFLAG_SUPPORTED;
307CPU_DISASSEMBLE( upi41 )
308{
309   return common_dasm(device, buffer, pc, oprom, opram, TRUE);
303310}
src/emu/cpu/mcs48/mcs48.h
r4057r4058
22
33    mcs48.c
44
5    Intel MCS-48 Portable Emulator
5    Intel MCS-48/UPI-41 Portable Emulator
66
77    Copyright Mirko Buffoni
88    Based on the original work Copyright Dan Boris, an 8048 emulator
r4057r4058
1212
1313#pragma once
1414
15#ifndef __I8039_H__
16#define __I8039_H__
15#ifndef __MCS48_H__
16#define __MCS48_H__
1717
1818#include "cpuintrf.h"
1919
20
2021/***************************************************************************
2122    CONSTANTS
2223***************************************************************************/
r4057r4058
2425/* register access indexes */
2526enum
2627{
27   MCS48_PC = 1,
28   MCS48_PC,
2829   MCS48_PSW,
2930   MCS48_A,
3031   MCS48_TC,
32   MCS48_TPRE,
3133   MCS48_P1,
3234   MCS48_P2,
3335   MCS48_R0,
r4057r4058
3840   MCS48_R5,
3941   MCS48_R6,
4042   MCS48_R7,
41   MCS48_EA
43   MCS48_EA,
44   MCS48_STS,   /* UPI-41 systems only */
45   MCS48_DBBO,   /* UPI-41 systems only */
46   MCS48_DBBI,   /* UPI-41 systems only */
47
48   MCS48_GENPC = REG_GENPC,
49   MCS48_GENSP = REG_GENSP,
50   MCS48_GENPCBASE = REG_GENPCBASE
4251};
4352
4453
r4057r4058
4655enum
4756{
4857   MCS48_INPUT_IRQ = 0,
58   UPI41_INPUT_IBF = 0,
4959   MCS48_INPUT_EA
5060};
5161
r4057r4058
5666   MCS48_PORT_P0   = 0x100,   /* Not used */
5767   MCS48_PORT_P1   = 0x101,
5868   MCS48_PORT_P2   = 0x102,
59   MCS48_PORT_P4   = 0x104,
60   MCS48_PORT_P5   = 0x105,
61   MCS48_PORT_P6   = 0x106,
62   MCS48_PORT_P7   = 0x107,
6369   MCS48_PORT_T0   = 0x110,
6470   MCS48_PORT_T1   = 0x111,
65   MCS48_PORT_BUS   = 0x120
71   MCS48_PORT_BUS   = 0x120,
72   MCS48_PORT_PROG   = 0x121      /* PROG line to 8243 expander */
6673};
6774
6875
76/* 8243 expander operations */
77enum
78{
79   MCS48_EXPANDER_OP_READ = 0,
80   MCS48_EXPANDER_OP_WRITE = 1,
81   MCS48_EXPANDER_OP_OR = 2,
82   MCS48_EXPANDER_OP_AND = 3
83};
6984
85
86
7087/***************************************************************************
71    FUNCTION PROTOTYPES
88    MACROS
7289***************************************************************************/
7390
74/* variants with 64 bytes of internal RAM and up to 1k of internal ROM */
75CPU_GET_INFO( i8035 );
76CPU_GET_INFO( i8048 );
77CPU_GET_INFO( i8648 );
78CPU_GET_INFO( i8748 );
79CPU_GET_INFO( mb8884 );
80CPU_GET_INFO( n7751 );
81
8291#define CPU_I8035 CPU_GET_INFO_NAME( i8035 )
8392#define CPU_I8048 CPU_GET_INFO_NAME( i8048 )
8493#define CPU_I8648 CPU_GET_INFO_NAME( i8648 )
8594#define CPU_I8748 CPU_GET_INFO_NAME( i8748 )
86#define CPU_MB8884 CPU_GET_INFO_NAME( mb8884 )
87#define CPU_N7751 CPU_GET_INFO_NAME( n7751 )
88
89/* variants with 128 bytes of internal RAM and up to 2k of internal ROM */
90CPU_GET_INFO( i8039 );
91CPU_GET_INFO( i8049 );
92CPU_GET_INFO( i8749 );
93CPU_GET_INFO( m58715 );
94
9595#define CPU_I8039 CPU_GET_INFO_NAME( i8039 )
9696#define CPU_I8049 CPU_GET_INFO_NAME( i8049 )
9797#define CPU_I8749 CPU_GET_INFO_NAME( i8749 )
98#define CPU_I8040 CPU_GET_INFO_NAME( i8040 )
99#define CPU_I8050 CPU_GET_INFO_NAME( i8050 )
100
101#define CPU_I8041 CPU_GET_INFO_NAME( i8041 )
102#define CPU_I8741 CPU_GET_INFO_NAME( i8741 )
103#define CPU_I8042 CPU_GET_INFO_NAME( i8042 )
104#define CPU_I8242 CPU_GET_INFO_NAME( i8242 )
105#define CPU_I8742 CPU_GET_INFO_NAME( i8742 )
106
107#define CPU_MB8884 CPU_GET_INFO_NAME( mb8884 )
108#define CPU_N7751 CPU_GET_INFO_NAME( n7751 )
98109#define CPU_M58715 CPU_GET_INFO_NAME( m58715 )
99110
100/* disassembler */
111
112
113/***************************************************************************
114    FUNCTION PROTOTYPES
115***************************************************************************/
116
117/* Official Intel MCS-48 parts */
118CPU_GET_INFO( i8035 );         /* external ROM,         64 bytes internal RAM */
119CPU_GET_INFO( i8048 );         /* 1k internal ROM,      64 bytes internal RAM */
120CPU_GET_INFO( i8648 );         /* 1k internal OTP ROM,  64 bytes internal RAM */
121CPU_GET_INFO( i8748 );         /* 1k internal EEPROM,   64 bytes internal RAM */
122CPU_GET_INFO( i8039 );         /* external ROM,        128 bytes internal RAM */
123CPU_GET_INFO( i8049 );         /* 2k internal ROM,     128 bytes internal RAM */
124CPU_GET_INFO( i8749 );         /* 2k internal EEPROM,  128 bytes internal RAM */
125CPU_GET_INFO( i8040 );         /* external ROM,        256 bytes internal RAM */
126CPU_GET_INFO( i8050 );         /* 4k internal ROM,     256 bytes internal RAM */
127
128/* Official Intel UPI-41 parts */
129CPU_GET_INFO( i8041 );         /* 1k internal ROM,     128 bytes internal RAM */
130CPU_GET_INFO( i8741 );         /* 1k internal EEPROM,  128 bytes internal RAM */
131CPU_GET_INFO( i8042 );         /* 2k internal ROM,     256 bytes internal RAM */
132CPU_GET_INFO( i8242 );         /* 2k internal ROM,     256 bytes internal RAM */
133CPU_GET_INFO( i8742 );         /* 2k internal EEPROM,  256 bytes internal RAM */
134
135/* Clones */
136CPU_GET_INFO( mb8884 );         /* 8035 clone */
137CPU_GET_INFO( n7751 );         /* 8048 clone */
138CPU_GET_INFO( m58715 );         /* 8049 clone */
139
140
141/* functions for talking to the input/output buffers on the UPI41-class chips */
142UINT8 upi41_master_r(const device_config *device, UINT8 a0);
143void upi41_master_w(const device_config *device, UINT8 a0, UINT8 data);
144
145
146/* disassemblers */
101147CPU_DISASSEMBLE( mcs48 );
148CPU_DISASSEMBLE( upi41 );
102149
103#endif  /* __I8039_H__ */
150
151#endif  /* __MCS48_H__ */
src/emu/cpu/cpu.mak
r4057r4058
266266
267267
268268#-------------------------------------------------
269# Entertainment Sciences AM29116-based RIP
270#-------------------------------------------------
271
272CPUDEFS += -DHAS_ESRIP=$(if $(filter ESRIP,$(CPUS)),1,0)
273
274ifneq ($(filter ESRIP,$(CPUS)),)
275OBJDIRS += $(CPUOBJ)/esrip
276CPUOBJS += $(CPUOBJ)/esrip/esrip.o
277#DBGOBJS += $(CPUOBJ)/esrip/esrip.o
278endif
279
280$(CPUOBJ)/esrip/esrip.o:   $(CPUSRC)/esrip/esrip.c \
281                     $(CPUSRC)/esrip/esrip.h
282
283
284
285#-------------------------------------------------
269286# RCA CDP1802
270287#-------------------------------------------------
271288
r4057r4058
641658# Intel MCS-48 (8039 and derivatives)
642659#-------------------------------------------------
643660
644CPUDEFS += -DHAS_I8035=$(if $(filter I8035,$(CPUS)),1,0)
645CPUDEFS += -DHAS_I8048=$(if $(filter I8048,$(CPUS)),1,0)
646CPUDEFS += -DHAS_I8648=$(if $(filter I8648,$(CPUS)),1,0)
647CPUDEFS += -DHAS_I8748=$(if $(filter I8748,$(CPUS)),1,0)
648CPUDEFS += -DHAS_MB8884=$(if $(filter MB8884,$(CPUS)),1,0)
661CPUDEFS += -DHAS_MCS48=$(if $(filter MCS48,$(CPUS)),1,0)
649662
650CPUDEFS += -DHAS_I8039=$(if $(filter I8039,$(CPUS)),1,0)
651CPUDEFS += -DHAS_I8049=$(if $(filter I8049,$(CPUS)),1,0)
652CPUDEFS += -DHAS_I8749=$(if $(filter I8749,$(CPUS)),1,0)
653CPUDEFS += -DHAS_N7751=$(if $(filter N7751,$(CPUS)),1,0)
654CPUDEFS += -DHAS_M58715=$(if $(filter M58715,$(CPUS)),1,0)
655
656ifneq ($(filter I8035 I8048 I8648 I8748 MB8884 I8039 I8049 I8749 N7751 M58715,$(CPUS)),)
663ifneq ($(filter MCS48,$(CPUS)),)
657664OBJDIRS += $(CPUOBJ)/mcs48
658665CPUOBJS += $(CPUOBJ)/mcs48/mcs48.o
659666DBGOBJS += $(CPUOBJ)/mcs48/mcs48dsm.o
r4057r4058
665672
666673
667674#-------------------------------------------------
668# Intel 8x41
669#-------------------------------------------------
670
671CPUDEFS += -DHAS_I8041=$(if $(filter I8041,$(CPUS)),1,0)
672CPUDEFS += -DHAS_I8741=$(if $(filter I8741,$(CPUS)),1,0)
673CPUDEFS += -DHAS_I8042=$(if $(filter I8042,$(CPUS)),1,0)
674CPUDEFS += -DHAS_I8242=$(if $(filter I8242,$(CPUS)),1,0)
675CPUDEFS += -DHAS_I8742=$(if $(filter I8742,$(CPUS)),1,0)
676
677ifneq ($(filter I8041 I8741 I8042 I8242 I8742 ,$(CPUS)),)
678OBJDIRS += $(CPUOBJ)/i8x41
679CPUOBJS += $(CPUOBJ)/i8x41/i8x41.o
680DBGOBJS += $(CPUOBJ)/i8x41/8x41dasm.o
681endif
682
683$(CPUOBJ)/i8x41/i8x41.o:   $(CPUSRC)/i8x41/i8x41.c \
684                     $(CPUSRC)/i8x41/i8x41.h
685
686
687
688#-------------------------------------------------
689675# Intel 8051 and derivatives
690676#-------------------------------------------------
691677
r4057r4058
762748
763749$(CPUOBJ)/i86/i286.o:   $(CPUSRC)/i86/i286.c \
764750                  $(CPUSRC)/i86/i286.h \
751                  $(CPUSRC)/i86/instr86.c \
752                  $(CPUSRC)/i86/instr186.c \
765753                  $(CPUSRC)/i86/instr286.c \
766754                  $(I86DEPS)
767755
r4057r4058
780768
781769
782770#-------------------------------------------------
771# Intel i860
772#-------------------------------------------------
773
774CPUDEFS += -DHAS_I860=$(if $(filter I860,$(CPUS)),1,0)
775
776ifneq ($(filter I860,$(CPUS)),)
777OBJDIRS += $(CPUOBJ)/i860
778CPUOBJS += $(CPUOBJ)/i860/i860.o
779DBGOBJS += $(CPUOBJ)/i860/i860dasm.o
780endif
781
782$(CPUOBJ)/i860/i860.o:   $(CPUSRC)/i860/i860.c \
783                  $(CPUSRC)/i860/i860.h
784
785
786#-------------------------------------------------
783787# Intel i960
784788#-------------------------------------------------
785789
r4057r4058
12111215# Motorola PowerPC series
12121216#-------------------------------------------------
12131217
1214CPUDEFS += -DHAS_PPC403GA=$(if $(filter PPC403GA,$(CPUS)),1,0)
1215CPUDEFS += -DHAS_PPC403GCX=$(if $(filter PPC403GCX,$(CPUS)),1,0)
1216CPUDEFS += -DHAS_PPC601=$(if $(filter PPC601,$(CPUS)),1,0)
1217CPUDEFS += -DHAS_PPC602=$(if $(filter PPC602,$(CPUS)),1,0)
1218CPUDEFS += -DHAS_PPC603=$(if $(filter PPC603,$(CPUS)),1,0)
1219CPUDEFS += -DHAS_PPC603E=$(if $(filter PPC603E,$(CPUS)),1,0)
1220CPUDEFS += -DHAS_PPC603R=$(if $(filter PPC603R,$(CPUS)),1,0)
1221CPUDEFS += -DHAS_PPC604=$(if $(filter PPC604,$(CPUS)),1,0)
1222CPUDEFS += -DHAS_MPC8240=$(if $(filter MPC8240,$(CPUS)),1,0)
1218CPUDEFS += -DHAS_POWERPC=$(if $(filter POWERPC,$(CPUS)),1,0)
12231219
1224ifneq ($(filter PPC403GA PPC403GCX PPC601 PPC602 PPC603 PPC603E PPC603R PPC604 MPC8240,$(CPUS)),)
1220ifneq ($(filter POWERPC,$(CPUS)),)
12251221OBJDIRS += $(CPUOBJ)/powerpc
12261222CPUOBJS += $(CPUOBJ)/powerpc/ppccom.o $(CPUOBJ)/powerpc/ppcfe.o $(CPUOBJ)/powerpc/ppcdrc.o $(DRCOBJ)
12271223DBGOBJS += $(CPUOBJ)/powerpc/ppc_dasm.o
src/emu/cpu/i86/i86.c
r4057r4058
4949   INT8 nmi_state;
5050   INT8 irq_state;
5151   INT8 test_state;   /* PJB 03/05 */
52   UINT8 rep_in_progress;
5253   INT32 extra_cycles;       /* extra cycles for interrupts */
5354
5455   UINT16 ip;
r4057r4058
172173   state_save_register_device_item(device, 0, cpustate->irq_state);
173174   state_save_register_device_item(device, 0, cpustate->extra_cycles);
174175   state_save_register_device_item(device, 0, cpustate->test_state);   /* PJB 03/05 */
176   state_save_register_device_item(device, 0, cpustate->rep_in_progress);   /* PJB 03/05 */
175177}
176178
177179static CPU_INIT( i8086 )
src/emu/cpu/i86/instr86.c
r4057r4058
393393   case 0x26:  /* ES: */
394394      cpustate->seg_prefix=TRUE;
395395      cpustate->prefix_base=cpustate->base[ES];
396      ICOUNT -= timing.override;
396      if (!cpustate->rep_in_progress)
397         ICOUNT -= timing.override;
397398      PREFIX(rep)(cpustate, flagval);
398399      break;
399400   case 0x2e:  /* CS: */
400401      cpustate->seg_prefix=TRUE;
401402      cpustate->prefix_base=cpustate->base[CS];
402      ICOUNT -= timing.override;
403      if (!cpustate->rep_in_progress)
404         ICOUNT -= timing.override;
403405      PREFIX(rep)(cpustate, flagval);
404406      break;
405407   case 0x36:  /* SS: */
406408      cpustate->seg_prefix=TRUE;
407409      cpustate->prefix_base=cpustate->base[SS];
408      ICOUNT -= timing.override;
410      if (!cpustate->rep_in_progress)
411         ICOUNT -= timing.override;
409412      PREFIX(rep)(cpustate, flagval);
410413      break;
411414   case 0x3e:  /* DS: */
412415      cpustate->seg_prefix=TRUE;
413416      cpustate->prefix_base=cpustate->base[DS];
414      ICOUNT -= timing.override;
417      if (!cpustate->rep_in_progress)
418         ICOUNT -= timing.override;
415419      PREFIX(rep)(cpustate, flagval);
416420      break;
417421#ifndef I8086
418422   case 0x6c:   /* REP INSB */
419      ICOUNT -= timing.rep_ins8_base;
423      if (!cpustate->rep_in_progress)
424         ICOUNT -= timing.rep_ins8_base;
425      cpustate->rep_in_progress = FALSE;
420426      for (; count > 0; count--)
421427      {
422         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
428         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
423429         PutMemB(ES,cpustate->regs.w[DI],read_port_byte(cpustate->regs.w[DX]));
424430         cpustate->regs.w[DI] += cpustate->DirVal;
425431         ICOUNT -= timing.rep_ins8_count;
r4057r4058
427433      cpustate->regs.w[CX]=count;
428434      break;
429435   case 0x6d:  /* REP INSW */
430      ICOUNT -= timing.rep_ins16_base;
436      if (!cpustate->rep_in_progress)
437         ICOUNT -= timing.rep_ins16_base;
438      cpustate->rep_in_progress = FALSE;
431439      for (; count > 0; count--)
432440      {
433         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
441         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
434442         PutMemW(ES,cpustate->regs.w[DI],read_port_word(cpustate->regs.w[DX]));
435443         cpustate->regs.w[DI] += 2 * cpustate->DirVal;
436444         ICOUNT -= timing.rep_ins16_count;
r4057r4058
438446      cpustate->regs.w[CX]=count;
439447      break;
440448   case 0x6e:  /* REP OUTSB */
441      ICOUNT -= timing.rep_outs8_base;
449      if (!cpustate->rep_in_progress)
450         ICOUNT -= timing.rep_outs8_base;
451      cpustate->rep_in_progress = FALSE;
442452      for (; count > 0; count--)
443453      {
444         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
454         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
445455         write_port_byte(cpustate->regs.w[DX],GetMemB(DS,cpustate->regs.w[SI]));
446456         cpustate->regs.w[SI] += cpustate->DirVal; /* GOL 11/27/01 */
447457         ICOUNT -= timing.rep_outs8_count;
r4057r4058
449459      cpustate->regs.w[CX]=count;
450460      break;
451461   case 0x6f:  /* REP OUTSW */
452      ICOUNT -= timing.rep_outs16_base;
462      if (!cpustate->rep_in_progress)
463         ICOUNT -= timing.rep_outs16_base;
464      cpustate->rep_in_progress = FALSE;
453465      for (; count > 0; count--)
454466      {
455         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
467         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
456468         write_port_word(cpustate->regs.w[DX],GetMemW(DS,cpustate->regs.w[SI]));
457469         cpustate->regs.w[SI] += 2 * cpustate->DirVal; /* GOL 11/27/01 */
458470         ICOUNT -= timing.rep_outs16_count;
r4057r4058
461473      break;
462474#endif
463475   case 0xa4:  /* REP MOVSB */
464      ICOUNT -= timing.rep_movs8_base;
476      if (!cpustate->rep_in_progress)
477         ICOUNT -= timing.rep_movs8_base;
478      cpustate->rep_in_progress = FALSE;
465479      for (; count > 0; count--)
466480      {
467481         BYTE tmp;
468482
469         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
483         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
470484         tmp = GetMemB(DS,cpustate->regs.w[SI]);
471485         PutMemB(ES,cpustate->regs.w[DI], tmp);
472486         cpustate->regs.w[DI] += cpustate->DirVal;
r4057r4058
476490      cpustate->regs.w[CX]=count;
477491      break;
478492   case 0xa5:  /* REP MOVSW */
479      ICOUNT -= timing.rep_movs16_base;
493      if (!cpustate->rep_in_progress)
494         ICOUNT -= timing.rep_movs16_base;
495      cpustate->rep_in_progress = FALSE;
480496      for (; count > 0; count--)
481497      {
482498         WORD tmp;
483499
484         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
500         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
485501         tmp = GetMemW(DS,cpustate->regs.w[SI]);
486502         PutMemW(ES,cpustate->regs.w[DI], tmp);
487503         cpustate->regs.w[DI] += 2 * cpustate->DirVal;
r4057r4058
491507      cpustate->regs.w[CX]=count;
492508      break;
493509   case 0xa6:  /* REP(N)E CMPSB */
494      ICOUNT -= timing.rep_cmps8_base;
510      if (!cpustate->rep_in_progress)
511         ICOUNT -= timing.rep_cmps8_base;
512      cpustate->rep_in_progress = FALSE;
495513      for (cpustate->ZeroVal = !flagval; (ZF == flagval) && (count > 0); count--)
496514      {
497515         unsigned dst, src;
498516
499         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
517         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
500518         dst = GetMemB(ES, cpustate->regs.w[DI]);
501519         src = GetMemB(DS, cpustate->regs.w[SI]);
502520          SUBB(src,dst); /* opposite of the usual convention */
r4057r4058
507525      cpustate->regs.w[CX]=count;
508526      break;
509527   case 0xa7:  /* REP(N)E CMPSW */
510      ICOUNT -= timing.rep_cmps16_base;
528      if (!cpustate->rep_in_progress)
529         ICOUNT -= timing.rep_cmps16_base;
530      cpustate->rep_in_progress = FALSE;
511531      for (cpustate->ZeroVal = !flagval; (ZF == flagval) && (count > 0); count--)
512532      {
513533         unsigned dst, src;
514534
515         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
535         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
516536         dst = GetMemW(ES, cpustate->regs.w[DI]);
517537         src = GetMemW(DS, cpustate->regs.w[SI]);
518538          SUBW(src,dst); /* opposite of the usual convention */
r4057r4058
523543      cpustate->regs.w[CX]=count;
524544      break;
525545   case 0xaa:  /* REP STOSB */
526      ICOUNT -= timing.rep_stos8_base;
546      if (!cpustate->rep_in_progress)
547         ICOUNT -= timing.rep_stos8_base;
548      cpustate->rep_in_progress = FALSE;
527549      for (; count > 0; count--)
528550      {
529         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
551         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
530552         PutMemB(ES,cpustate->regs.w[DI],cpustate->regs.b[AL]);
531553         cpustate->regs.w[DI] += cpustate->DirVal;
532554         ICOUNT -= timing.rep_stos8_count;
r4057r4058
534556      cpustate->regs.w[CX]=count;
535557      break;
536558   case 0xab:  /* REP STOSW */
537      ICOUNT -= timing.rep_stos16_base;
559      if (!cpustate->rep_in_progress)
560         ICOUNT -= timing.rep_stos16_base;
561      cpustate->rep_in_progress = FALSE;
538562      for (; count > 0; count--)
539563      {
540         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
564         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
541565         PutMemW(ES,cpustate->regs.w[DI],cpustate->regs.w[AX]);
542566         cpustate->regs.w[DI] += 2 * cpustate->DirVal;
543567         ICOUNT -= timing.rep_stos16_count;
r4057r4058
545569      cpustate->regs.w[CX]=count;
546570      break;
547571   case 0xac:  /* REP LODSB */
548      ICOUNT -= timing.rep_lods8_base;
572      if (!cpustate->rep_in_progress)
573         ICOUNT -= timing.rep_lods8_base;
574      cpustate->rep_in_progress = FALSE;
549575      for (; count > 0; count--)
550576      {
551         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
577         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
552578         cpustate->regs.b[AL] = GetMemB(DS,cpustate->regs.w[SI]);
553579         cpustate->regs.w[SI] += cpustate->DirVal;
554580         ICOUNT -= timing.rep_lods8_count;
r4057r4058
556582      cpustate->regs.w[CX]=count;
557583      break;
558584   case 0xad:  /* REP LODSW */
559      ICOUNT -= timing.rep_lods16_base;
585      if (!cpustate->rep_in_progress)
586         ICOUNT -= timing.rep_lods16_base;
587      cpustate->rep_in_progress = FALSE;
560588      for (; count > 0; count--)
561589      {
562         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
590         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
563591         cpustate->regs.w[AX] = GetMemW(DS,cpustate->regs.w[SI]);
564592         cpustate->regs.w[SI] += 2 * cpustate->DirVal;
565593         ICOUNT -= timing.rep_lods16_count;
r4057r4058
567595      cpustate->regs.w[CX]=count;
568596      break;
569597   case 0xae:  /* REP(N)E SCASB */
570      ICOUNT -= timing.rep_scas8_base;
598      if (!cpustate->rep_in_progress)
599         ICOUNT -= timing.rep_scas8_base;
600      cpustate->rep_in_progress = FALSE;
571601      for (cpustate->ZeroVal = !flagval; (ZF == flagval) && (count > 0); count--)
572602      {
573603         unsigned src, dst;
574604
575         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
605         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
576606         src = GetMemB(ES, cpustate->regs.w[DI]);
577607         dst = cpustate->regs.b[AL];
578608          SUBB(dst,src);
r4057r4058
582612      cpustate->regs.w[CX]=count;
583613      break;
584614   case 0xaf:  /* REP(N)E SCASW */
585      ICOUNT -= timing.rep_scas16_base;
615      if (!cpustate->rep_in_progress)
616         ICOUNT -= timing.rep_scas16_base;
617      cpustate->rep_in_progress = FALSE;
586618      for (cpustate->ZeroVal = !flagval; (ZF == flagval) && (count > 0); count--)
587619      {
588620         unsigned src, dst;
589621
590         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; break; }
622         if (ICOUNT <= 0) { cpustate->pc = cpustate->prevpc; cpustate->rep_in_progress = TRUE; break; }
591623         src = GetMemW(ES, cpustate->regs.w[DI]);
592624         dst = cpustate->regs.w[AX];
593625          SUBW(dst,src);
src/emu/cpu/i86/i286.c
r4057r4058
6767   INT8   nmi_state;
6868   INT8   irq_state;
6969   INT8   test_state;      /* PJB 03/05 */
70   UINT8 rep_in_progress;
7071   INT32    extra_cycles;       /* extra cycles for interrupts */
7172
7273   memory_interface   mem;
r4057r4058
159160   cpustate->flags=2;
160161   ExpandFlags(cpustate->flags);
161162   cpustate->idtr.base=0;cpustate->idtr.limit=0x3ff;
163   cpustate->rep_in_progress = FALSE;
162164
163165   CHANGE_PC(cpustate->pc);
164166
r4057r4058
267269   state_save_register_device_item(device, 0, cpustate->nmi_state);
268270   state_save_register_device_item(device, 0, cpustate->irq_state);
269271   state_save_register_device_item(device, 0, cpustate->extra_cycles);
272   state_save_register_device_item(device, 0, cpustate->rep_in_progress);
270273
271274   cpustate->irq_callback = irqcallback;
272275   cpustate->device = device;
src/emu/cpu/v60/v60.c
r4057r4058
456456   if (cpustate->irq_line != CLEAR_LINE)
457457      v60_try_irq(cpustate);
458458
459   while (cpustate->icount >= 0)
459   while (cpustate->icount > 0)
460460   {
461461      UINT32 inc;
462462      cpustate->PPC = cpustate->PC;
src/emu/cpu/hd6309/hd6309.c
r4057r4058
513513   m68_state->irq_callback = irqcallback;
514514   m68_state->device = device;
515515
516   m68_state->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
516   m68_state->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
517517
518518   /* setup regtable */
519519
src/emu/cpu/tlcs90/tlcs90.c
r4057r4058
956956static const char *internal_registers_names(UINT16 x)
957957{
958958   int ir = x - T90_IOBASE;
959   if ( ir >= 0 && ir <= sizeof(ir_names)/sizeof(ir_names[0]) )
959   if ( ir >= 0 && ir < sizeof(ir_names)/sizeof(ir_names[0]) )
960960      return ir_names[ir];
961961   return NULL;
962962}
src/emu/cpu/cdp1802/cdp1802.c
r4057r4058
893893
894894   /* get address spaces */
895895
896   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
897   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
896   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
897   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
898898
899899   /* set initial values */
900900
src/emu/cpu/i860/i860.c
r0r4058
1#include "debugger.h"
2#include "i860.h"
3
4/**************************************************************************
5 * The core struct
6 **************************************************************************/
7typedef struct _i860_state_t i860_state_t;
8struct _i860_state_t
9{
10   const device_config *device;
11   const address_space *program;
12
13   UINT32 pc;
14   UINT32 ppc;
15
16   int icount;
17};
18
19
20/**************************************************************************
21 * Functions specified by GET_INFO
22 **************************************************************************/
23
24static CPU_INIT( i860 )
25{
26   i860_state_t *i860 = device->token;
27   i860->device = device;
28   i860->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
29}
30
31static CPU_RESET( i860 )
32{
33   logerror("i860 reset\n");
34}
35
36static CPU_EXECUTE( i860 )
37{
38   /* Just a disassembler ATM */
39   return cycles;
40}
41
42extern CPU_DISASSEMBLE( i860 );
43
44
45/**************************************************************************
46 * Generic set_info/get_info
47 **************************************************************************/
48static CPU_SET_INFO( i860 )
49{
50   i860_state_t *i860 = device->token;
51
52   switch(state)
53   {
54      /* Interfacing */
55      case CPUINFO_INT_PC:
56      case CPUINFO_INT_REGISTER + I860_PC:   i860->pc = info->i & 0xffffffff;   break;
57   }
58}
59
60CPU_GET_INFO( i860 )
61{
62   i860_state_t *i860 = (device != NULL) ? device->token : NULL;
63
64   switch (state)
65   {
66      // --- the following bits of info are returned as 64-bit signed integers ---
67      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(i860_state_t);         break;
68      case CPUINFO_INT_INPUT_LINES:               info->i = 0;                     break;
69      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0x00000000;               break;
70      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_LITTLE;         break;
71      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
72      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
73      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 4;                     break;
74      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 4;                     break;
75      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
76      case CPUINFO_INT_MAX_CYCLES:               info->i = 8;                     break;
77
78      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 32;               break;
79      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 32;               break;
80      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = 0;               break;
81      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 0;               break;
82      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 0;               break;
83      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:    info->i = 0;               break;
84      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 0;               break;
85      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;               break;
86      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;               break;
87
88      // --- the following bits of info are returned as pointers to data or functions ---
89      case CPUINFO_FCT_SET_INFO:                  info->setinfo      = CPU_SET_INFO_NAME(i860);   break;
90      case CPUINFO_FCT_INIT:                     info->init         = CPU_INIT_NAME(i860);      break;
91      case CPUINFO_FCT_RESET:                     info->reset      = CPU_RESET_NAME(i860);      break;
92      case CPUINFO_FCT_EXIT:                     info->exit         = NULL;                  break;
93      case CPUINFO_FCT_EXECUTE:                  info->execute      = CPU_EXECUTE_NAME(i860);      break;
94      case CPUINFO_FCT_BURN:                     info->burn         = NULL;                  break;
95      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(i860);   break;
96      case CPUINFO_FCT_DEBUG_INIT:               info->debug_init  = NULL;                  break;
97      case CPUINFO_FCT_TRANSLATE:                  info->translate     = NULL;                  break;
98      case CPUINFO_FCT_READ:                     info->read         = NULL;                  break;
99      case CPUINFO_FCT_WRITE:                     info->write      = NULL;                  break;
100      case CPUINFO_FCT_READOP:                  info->readop      = NULL;                  break;
101      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount      = &i860->icount;            break;
102
103      // --- the following bits of info are returned as NULL-terminated strings ---
104      case CPUINFO_STR_NAME:                     strcpy(info->s, "i860");         break;
105      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Intel");         break;
106      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "0.1");            break;
107      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);         break;
108      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Jason Eckhardt and Andrew Gardner");   break;
109
110      case CPUINFO_INT_PC:                     info->i = i860->pc;               break;
111      case CPUINFO_INT_PREVIOUSPC:               info->i = i860->ppc;            break;
112   }
113}
src/emu/cpu/i860/i860.h
r0r4058
1#pragma once
2
3#ifndef __I860_H__
4#define __I860_H__
5
6#include "cpuintrf.h"
7
8enum
9{
10   I860_PC = 0
11};
12
13CPU_GET_INFO( i860 );
14#define CPU_I860 CPU_GET_INFO_NAME( i860 )
15
16#endif /* __I860_H__ */
17
src/emu/cpu/i860/i860dasm.c
r0r4058
1#include "i860.h"
2
3/* Sub-group decoders */
4static void i860_dasm_core_dasm(const UINT32 op, char* buffer);
5static void i860_dasm_floating_point_dasm(const UINT32 op, char* buffer);
6static void i860_dasm_CTRL_dasm(const UINT32 op, char* buffer);
7
8/* REG-Format Opcodes*/
9static void i860_dasm_ldx(const UINT32 op, char* buffer);
10static void i860_dasm_stx(const UINT32 op, char* buffer);
11static void i860_dasm_ixfr(const UINT32 op, char* buffer);
12static void i860_dasm_fid_fst(const UINT32 op, char* buffer);
13static void i860_dasm_flush(const UINT32 op, char* buffer);
14static void i860_dasm_pstd(const UINT32 op, char* buffer);
15static void i860_dasm_ldc_sdc(const UINT32 op, char* buffer);
16static void i860_dasm_bri(const UINT32 op, char* buffer);
17static void i860_dasm_trap(const UINT32 op, char* buffer);
18static void i860_dasm_bte_btne(const UINT32 op, char* buffer);
19static void i860_dasm_pfidy(const UINT32 op, char* buffer);
20static void i860_dasm_addu_subu(const UINT32 op, char* buffer);
21static void i860_dasm_shl_shr(const UINT32 op, char* buffer);
22static void i860_dasm_shrd(const UINT32 op, char* buffer);
23static void i860_dasm_bla(const UINT32 op, char* buffer);
24static void i860_dasm_shra(const UINT32 op, char* buffer);
25static void i860_dasm_and_andh(const UINT32 op, char* buffer);
26static void i860_dasm_andnot_andnoth(const UINT32 op, char* buffer);
27static void i860_dasm_or_orh(const UINT32 op, char* buffer);
28static void i860_dasm_xor_xorh(const UINT32 op, char* buffer);
29
30/* CORE Escape Opcodes */
31static void i860_dasm_CORE_lock(const UINT32 op, char* buffer);
32static void i860_dasm_CORE_calli(const UINT32 op, char* buffer);
33static void i860_dasm_CORE_intovr(const UINT32 op, char* buffer);
34static void i860_dasm_CORE_unlock(const UINT32 op, char* buffer);
35
36/* CTRL-Format Opcodes */
37static void i860_dasm_CTRL_br(const UINT32 op, char* buffer);
38static void i860_dasm_CTRL_call(const UINT32 op, char* buffer);
39static void i860_dasm_CTRL_bc_bct(const UINT32 op, char* buffer);
40static void i860_dasm_CTRL_bnc_bnct(const UINT32 op, char* buffer);
41
42/* Floating-Point Instructions */
43
44
45CPU_DISASSEMBLE( i860 )
46{
47   char tempB[1024] = "";
48
49   /* Little Endian */
50   const UINT32 op = (oprom[3] << 24) | (oprom[2] << 16) | (oprom[1] << 8) | (oprom[0] << 0);
51   //const UINT32 op = (oprom[2] << 24) | (oprom[3] << 16) | (oprom[0] << 8) | (oprom[1] << 0);    /* Mixed Endian */
52   //const UINT32 op = (oprom[0] << 24) | (oprom[1] << 16) | (oprom[2] << 8) | (oprom[3] << 0);    /* Big Endian */
53   //const UINT32 op = (oprom[1] << 24) | (oprom[0] << 16) | (oprom[3] << 8) | (oprom[2] << 0);    /* Mixed Endian */
54
55   /* The opcode is the top 6 bits */
56   UINT8 opcode = (op >> 26) & 0x3f;
57
58   /* DEBUG - print this out if you feel things are going a bit wonky */
59   // sprintf(buffer, "%08x : oo %02x", op, opcode);
60
61   /* Main decode */
62   switch (opcode)
63   {
64      case 0x00:
65      case 0x01:
66      case 0x04:
67      case 0x05: i860_dasm_ldx(op, tempB);       break;
68
69      case 0x03:
70      case 0x07: i860_dasm_stx(op, tempB);       break;
71
72      case 0x02: i860_dasm_ixfr(op, tempB);       break;
73
74      case 0x06: sprintf(tempB, "(reserved)");    break;
75
76      case 0x08:
77      case 0x09:
78      case 0x0a:
79      case 0x0b: i860_dasm_fid_fst(op, tempB);    break;
80
81      case 0x0d: i860_dasm_flush(op, tempB);       break;
82
83      case 0x0f: i860_dasm_pstd(op, tempB);       break;
84
85      case 0x0c:
86      case 0x0e: i860_dasm_ldc_sdc(op, tempB);    break;
87
88      case 0x10: i860_dasm_bri(op, tempB);       break;
89
90      case 0x11: i860_dasm_trap(op, tempB);       break;
91
92      case 0x12: i860_dasm_floating_point_dasm(op, tempB); break;   /* Floating point operation sub-group */
93
94      case 0x13: i860_dasm_core_dasm(op, tempB);    break;         /* Core operation sub-group */
95
96      case 0x14:
97      case 0x15:
98      case 0x16:
99      case 0x17: i860_dasm_bte_btne(op, tempB);    break;
100
101      case 0x18:
102      case 0x19: i860_dasm_pfidy(op, tempB);       break;
103
104      case 0x1a:
105      case 0x1b:
106      case 0x1c:
107      case 0x1d:
108      case 0x1e:
109      case 0x1f: i860_dasm_CTRL_dasm(op, tempB);  break;         /* CTRL operation sub-group */
110
111      case 0x20:
112      case 0x21:
113      case 0x22:
114      case 0x23:
115      case 0x24:
116      case 0x25:
117      case 0x26:
118      case 0x27: i860_dasm_addu_subu(op, tempB);    break;
119
120      case 0x28:
121      case 0x29:
122      case 0x2a:
123      case 0x2b: i860_dasm_shl_shr(op, tempB);    break;
124
125      case 0x2c: i860_dasm_shrd(op, tempB);       break;
126
127      case 0x2d: i860_dasm_bla(op, tempB);       break;
128
129      case 0x2e:
130      case 0x2f: i860_dasm_shra(op, tempB);       break;
131
132      case 0x30:
133      case 0x31:
134      case 0x32:
135      case 0x33: i860_dasm_and_andh(op, tempB);    break;
136
137      case 0x34:
138      case 0x35:
139      case 0x36:
140      case 0x37: i860_dasm_andnot_andnoth(op, tempB); break;
141
142      case 0x38:
143      case 0x39:
144      case 0x3a:
145      case 0x3b: i860_dasm_or_orh(op, tempB);    break;
146
147      case 0x3c:
148      case 0x3d:
149      case 0x3e:
150      case 0x3f: i860_dasm_xor_xorh(op, tempB);    break;
151
152      default: sprintf(tempB, "(reserved)");       break;
153   }
154
155   /* More Debug */
156   //strcat(buffer, " : ");
157   //strcat(buffer, tempB);
158   sprintf(buffer, "%s", tempB);
159
160   /* All opcodes are 32 bits */
161   return (4 | DASMFLAG_SUPPORTED);
162}
163
164
165// BIT HELPER
166// 31   27   23   19   15   11   7    3
167// 0000 0011 1111 1111 0000 0111 1110 0000
168
169
170/**********************/
171/* Sub-group decoders */
172/**********************/
173static void i860_dasm_core_dasm(const UINT32 op, char* buffer)
174{
175   //UINT8 src1 = (op >> 11) & 0x0000001f;
176
177   /* Reserved bits must be set to 0 */
178   if ( (op & 0x000007e0) || (op & 0x03ff0000) )
179   {
180      //logerror("[i860] Reserved CORE bits must be set to 0.");
181      printf("CORE baddie\n");
182   }
183
184   switch(op & 0x0000001f)
185   {
186      case 0x01: i860_dasm_CORE_lock(op, buffer);     break;
187      case 0x02: i860_dasm_CORE_calli(op, buffer);  break;
188      case 0x04: i860_dasm_CORE_intovr(op, buffer); break;
189      case 0x07: i860_dasm_CORE_unlock(op, buffer); break;
190
191      default: sprintf(buffer, "(reserved)");        break;
192   }
193}
194
195static void i860_dasm_floating_point_dasm(const UINT32 op, char* buffer)
196{
197   sprintf(buffer, "[[F-P unit]]");
198}
199
200static void i860_dasm_CTRL_dasm(const UINT32 op, char* buffer)
201{
202   UINT8 opc = (op >> 26) & 0x07;
203
204   switch(opc)
205   {
206      case 0x02:            i860_dasm_CTRL_br(op, buffer);      break;
207      case 0x03:            i860_dasm_CTRL_call(op, buffer);      break;
208      case 0x04: case 0x05: i860_dasm_CTRL_bc_bct(op, buffer);   break;
209      case 0x06: case 0x07: i860_dasm_CTRL_bnc_bnct(op, buffer); break;
210
211      default: sprintf(buffer, "(reserved)");                  break;
212   }
213}
214
215
216/*********************/
217/* REG-Format Opcodes*/
218/*********************/
219static void i860_dasm_ldx(const UINT32 op, char* buffer)
220{
221   sprintf(buffer, "ldx");
222}
223
224static void i860_dasm_stx(const UINT32 op, char* buffer)
225{
226   sprintf(buffer, "stx");
227}
228
229static void i860_dasm_ixfr(const UINT32 op, char* buffer)
230{
231//  UINT16 val = op & 0x7ff;
232//  UINT8  opc = (op >> 26) & 0x3f;
233//  UINT8 src2 = (op >> 21) & 0x1f;
234//  UINT8 dest = (op >> 16) & 0x1f;
235//  UINT8 src1 = (op >> 11) & 0x1f;
236
237   sprintf(buffer, "ixfr");
238}
239
240static void i860_dasm_fid_fst(const UINT32 op, char* buffer)
241{
242   sprintf(buffer, "fst");
243}
244
245static void i860_dasm_flush(const UINT32 op, char* buffer)
246{
247   sprintf(buffer, "flush");
248}
249
250static void i860_dasm_pstd(const UINT32 op, char* buffer)
251{
252   sprintf(buffer, "pstd");
253}
254
255static void i860_dasm_ldc_sdc(const UINT32 op, char* buffer)
256{
257   sprintf(buffer, "ldc, sdc");
258}
259
260static void i860_dasm_bri(const UINT32 op, char* buffer)
261{
262   sprintf(buffer, "bri");
263}
264
265static void i860_dasm_trap(const UINT32 op, char* buffer)
266{
267   sprintf(buffer, "trap");
268}
269
270static void i860_dasm_bte_btne(const UINT32 op, char* buffer)
271{
272   sprintf(buffer, "bte, btne");
273}
274
275static void i860_dasm_pfidy(const UINT32 op, char* buffer)
276{
277   sprintf(buffer, "pfidy");
278}
279
280static void i860_dasm_addu_subu(const UINT32 op, char* buffer)
281{
282   sprintf(buffer, "addu, subu");
283}
284
285static void i860_dasm_shl_shr(const UINT32 op, char* buffer)
286{
287   sprintf(buffer, "shl, shr");
288}
289
290static void i860_dasm_shrd(const UINT32 op, char* buffer)
291{
292   sprintf(buffer, "shrd");
293}
294
295static void i860_dasm_bla(const UINT32 op, char* buffer)
296{
297   sprintf(buffer, "bla");
298}
299
300static void i860_dasm_shra(const UINT32 op, char* buffer)
301{
302   sprintf(buffer, "shra");
303}
304
305static void i860_dasm_and_andh(const UINT32 op, char* buffer)
306{
307   sprintf(buffer, "and, andh");
308}
309
310static void i860_dasm_andnot_andnoth(const UINT32 op, char* buffer)
311{
312   sprintf(buffer, "andnot, andnoth");
313}
314
315static void i860_dasm_or_orh(const UINT32 op, char* buffer)
316{
317   sprintf(buffer, "or, orh");
318}
319
320static void i860_dasm_xor_xorh(const UINT32 op, char* buffer)
321{
322   sprintf(buffer, "xor, xorh");
323}
324
325
326/***********************/
327/* CORE Escape Opcodes */
328/***********************/
329static void i860_dasm_CORE_lock(const UINT32 op, char* buffer)
330{
331   sprintf(buffer, "lock");
332}
333
334static void i860_dasm_CORE_calli(const UINT32 op, char* buffer)
335{
336   sprintf(buffer, "calli");
337}
338
339static void i860_dasm_CORE_intovr(const UINT32 op, char* buffer)
340{
341   sprintf(buffer, "intovr");
342}
343
344static void i860_dasm_CORE_unlock(const UINT32 op, char* buffer)
345{
346   sprintf(buffer, "unlock");
347}
348
349
350/***********************/
351/* CTRL-Format Opcodes */
352/***********************/
353static void i860_dasm_CTRL_br(const UINT32 op, char* buffer)
354{
355   sprintf(buffer, "br");
356}
357
358static void i860_dasm_CTRL_call(const UINT32 op, char* buffer)
359{
360   sprintf(buffer, "call");
361}
362
363static void i860_dasm_CTRL_bc_bct(const UINT32 op, char* buffer)
364{
365   sprintf(buffer, "bct");
366}
367
368static void i860_dasm_CTRL_bnc_bnct(const UINT32 op, char* buffer)
369{
370   sprintf(buffer, "bnct");
371}
372
373
374/*******************************/
375/* Floating-Point Instructions */
376/*******************************/
377
src/emu/cpu/mcs51/mcs51.c
r4057r4058
20502050   mcs51_state->irq_callback = irqcallback;
20512051   mcs51_state->device = device;
20522052
2053   mcs51_state->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
2054   mcs51_state->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
2055   mcs51_state->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
2053   mcs51_state->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
2054   mcs51_state->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
2055   mcs51_state->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
20562056
20572057   mcs51_state->features = FEATURE_NONE;
20582058   mcs51_state->ram_mask = 0x7F;           /* 128 bytes of ram */
src/emu/cpu/i386/i386ops.c
r4057r4058
21692169   // TODO: We need to raise an exception in protected mode and when
21702170   // the current privilege level is not zero
21712171   cpustate->halted = 1;
2172   cpustate->cycles = 0;
21732172   CYCLES(cpustate,CYCLES_HLT);
2173   if (cpustate->cycles > 0)
2174      cpustate->cycles = 0;
21742175}
21752176
21762177static void I386OP(decimal_adjust)(i386_state *cpustate, int direction)
src/emu/cpu/adsp2100/adsp2100.c
r4057r4058
685685
686686   /* fetch device parameters */
687687   adsp->device = device;
688   adsp->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
689   adsp->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
690   adsp->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
688   adsp->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
689   adsp->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
690   adsp->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
691691
692692   /* copy function pointers from the config */
693693   if (config != NULL)
src/emu/cpu/cop400/cop410.c
r4057r4058
184184
185185   /* get address spaces */
186186
187   cop400->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
188   cop400->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
189   cop400->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
187   cop400->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
188   cop400->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
189   cop400->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
190190
191191   /* set output pin masks */
192192
src/emu/cpu/cop400/cop420.c
r4057r4058
186186
187187   /* get address spaces */
188188
189   cop400->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
190   cop400->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
191   cop400->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
189   cop400->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
190   cop400->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
191   cop400->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
192192
193193   /* set output pin masks */
194194
src/emu/cpu/cop400/cop440.c
r4057r4058
198198
199199   /* get address spaces */
200200
201   cop400->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
202   cop400->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
203   cop400->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
201   cop400->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
202   cop400->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
203   cop400->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
204204
205205   /* set output pin masks */
206206
src/emu/cpu/m6502/m4510.c
r4057r4058
419419      case CPUINFO_INT_REGISTER + M4510_MEM7:         cpustate->mem[7] = info->i;               break;
420420
421421      /* --- the following bits of info are set as pointers to data or functions --- */
422      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
423      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
424      case CPUINFO_PTR_M6510_PORTREAD:            cpustate->port_read = (m6510_port_read_func) info->f; break;
425      case CPUINFO_PTR_M6510_PORTWRITE:            cpustate->port_write = (m6510_port_write_func) info->f; break;
422      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
423      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
424      case CPUINFO_FCT_M6510_PORTREAD:            cpustate->port_read = (m6510_port_read_func) info->f; break;
425      case CPUINFO_FCT_M6510_PORTWRITE:            cpustate->port_write = (m6510_port_write_func) info->f; break;
426426   }
427427}
428428
r4057r4058
502502      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;         break;
503503      case CPUINFO_PTR_INTERNAL_MEMORY_MAP:         info->internal_map8 = ADDRESS_MAP_NAME(m4510_mem); break;
504504      case CPUINFO_FCT_TRANSLATE:                  info->translate = CPU_TRANSLATE_NAME(m4510);      break;
505      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
506      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
507      case CPUINFO_PTR_M6510_PORTREAD:            info->f = (genf *) cpustate->port_read;      break;
508      case CPUINFO_PTR_M6510_PORTWRITE:            info->f = (genf *) cpustate->port_write;   break;
505      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
506      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
507      case CPUINFO_FCT_M6510_PORTREAD:            info->f = (genf *) cpustate->port_read;      break;
508      case CPUINFO_FCT_M6510_PORTWRITE:            info->f = (genf *) cpustate->port_write;   break;
509509
510510      /* --- the following bits of info are returned as NULL-terminated strings --- */
511511      case CPUINFO_STR_NAME:                     strcpy(info->s, "M4510");            break;
src/emu/cpu/m6502/ops02.h
r4057r4058
7171 *  RDOP    read an opcode
7272 ***************************************************************/
7373#define RDOP() memory_decrypted_read_byte(cpustate->space, PCW++); cpustate->icount -= 1
74#define PEEKOP() memory_decrypted_read_byte(cpustate->space, PCW)
7475
7576/***************************************************************
7677 *  RDOPARG read an opcode argument
r4057r4058
435436 ***************************************************************/
436437#define CLI                                        \
437438   if ((cpustate->irq_state != CLEAR_LINE) && (P & F_I)) {       \
438      cpustate->after_cli = 1;                           \
439      /* kludge for now until IRQ rewrite: ignore if RTI follows */ \
440      if (PEEKOP() != 0x40) \
441         cpustate->after_cli = 1;                           \
439442   }                                             \
440443   P &= ~F_I
441444
src/emu/cpu/m6502/m6502.c
r4057r4058
680680      case CPUINFO_INT_REGISTER + M6502_ZP:         cpustate->zp.w.l = info->i;               break;
681681
682682      /* --- the following bits of info are set as pointers to data or functions --- */
683      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
684      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
683      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
684      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
685685   }
686686}
687687
r4057r4058
746746      case CPUINFO_FCT_BURN:                     info->burn = NULL;                  break;
747747      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(m6502);         break;
748748      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;         break;
749      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
750      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
749      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
750      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
751751
752752      /* --- the following bits of info are returned as NULL-terminated strings --- */
753753      case CPUINFO_STR_NAME:                     strcpy(info->s, "M6502");            break;
r4057r4058
813813   switch (state)
814814   {
815815      /* --- the following bits of info are set as pointers to data or functions --- */
816      case CPUINFO_PTR_M6510_PORTREAD:   cpustate->port_read = (m6510_port_read_func) info->f;   break;
817      case CPUINFO_PTR_M6510_PORTWRITE:   cpustate->port_write = (m6510_port_write_func) info->f;   break;
816      case CPUINFO_FCT_M6510_PORTREAD:   cpustate->port_read = (m6510_port_read_func) info->f;   break;
817      case CPUINFO_FCT_M6510_PORTWRITE:   cpustate->port_write = (m6510_port_write_func) info->f;   break;
818818
819819      default:                     CPU_SET_INFO_CALL(m6502);         break;
820820   }
r4057r4058
832832      case CPUINFO_FCT_RESET:                     info->reset = CPU_RESET_NAME(m6510);            break;
833833      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(m6510);         break;
834834      case CPUINFO_PTR_INTERNAL_MEMORY_MAP:         info->internal_map8 = ADDRESS_MAP_NAME(m6510_mem); break;
835      case CPUINFO_PTR_M6510_PORTREAD:            info->f = (genf *) cpustate->port_read;      break;
836      case CPUINFO_PTR_M6510_PORTWRITE:            info->f = (genf *) cpustate->port_write;   break;
835      case CPUINFO_FCT_M6510_PORTREAD:            info->f = (genf *) cpustate->port_read;      break;
836      case CPUINFO_FCT_M6510_PORTWRITE:            info->f = (genf *) cpustate->port_write;   break;
837837
838838      /* --- the following bits of info are returned as NULL-terminated strings --- */
839839      case CPUINFO_STR_NAME:                     strcpy(info->s, "M6510");            break;
src/emu/cpu/m6502/m6502.h
r4057r4058
7070
7171enum
7272{
73   CPUINFO_PTR_M6502_READINDEXED_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC,
74   CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK,
75   CPUINFO_PTR_M6510_PORTREAD,
76   CPUINFO_PTR_M6510_PORTWRITE,
73   CPUINFO_FCT_M6502_READINDEXED_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC,
74   CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK,
75   CPUINFO_FCT_M6510_PORTREAD,
76   CPUINFO_FCT_M6510_PORTWRITE,
7777
7878   CPUINFO_INT_M6510_PORT = CPUINFO_INT_CPU_SPECIFIC
7979};
src/emu/cpu/m6502/m6509.c
r4057r4058
303303      case CPUINFO_INT_REGISTER + M6509_ZP:         cpustate->zp.w.l = info->i;               break;
304304
305305      /* --- the following bits of info are set as pointers to data or functions --- */
306      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
307      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
306      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
307      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
308308   }
309309}
310310
r4057r4058
371371      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(m6502);         break;
372372      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;         break;
373373      case CPUINFO_PTR_INTERNAL_MEMORY_MAP:         info->internal_map8 = ADDRESS_MAP_NAME(m6509_mem); break;
374      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
375      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
374      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
375      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
376376
377377      /* --- the following bits of info are returned as NULL-terminated strings --- */
378378      case CPUINFO_STR_NAME:                     strcpy(info->s, "M6509");            break;
src/emu/cpu/m6502/m65ce02.c
r4057r4058
249249      case CPUINFO_INT_REGISTER + M65CE02_ZP: cpustate->zp.b.l = info->i; break;
250250
251251      /* --- the following bits of info are set as pointers to data or functions --- */
252      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
253      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
252      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   cpustate->rdmem_id = (m6502_read_indexed_func) info->f; break;
253      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   cpustate->wrmem_id = (m6502_write_indexed_func) info->f; break;
254254   }
255255}
256256
r4057r4058
315315      case CPUINFO_FCT_BURN:                     info->burn = NULL;                  break;
316316      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(m65ce02);         break;
317317      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;         break;
318      case CPUINFO_PTR_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
319      case CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
318      case CPUINFO_FCT_M6502_READINDEXED_CALLBACK:   info->f = (genf *) cpustate->rdmem_id;      break;
319      case CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK:   info->f = (genf *) cpustate->wrmem_id;      break;
320320
321321      /* --- the following bits of info are returned as NULL-terminated strings --- */
322322      case CPUINFO_STR_NAME: strcpy(info->s, "M65CE02");  break;
src/emu/cpu/jaguar/jaguar.c
r4057r4058
409409
410410   jaguar->irq_callback = irqcallback;
411411   jaguar->device = device;
412   jaguar->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
412   jaguar->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
413413   if (configdata != NULL)
414414      jaguar->cpu_interrupt = configdata->cpu_int_callback;
415415
src/emu/cpu/powerpc/ppc_ops.c
r4057r4058
44#include <math.h>
55
66#ifndef PPC_DRC
7#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
87static void ppc_unimplemented(UINT32 op)
98{
109   fatalerror("ppc: Unimplemented opcode %08X at %08X", op, ppc.pc);
1110}
12#endif
1311
1412static void ppc_addx(UINT32 op)
1513{
r4057r4058
10631061#ifndef PPC_DRC
10641062static void ppc_sc(UINT32 op)
10651063{
1066#if (HAS_PPC603 || HAS_PPC601)
10671064   if (ppc.is603) {
10681065      ppc603_exception(EXCEPTION_SYSTEM_CALL);
10691066   }
1070#endif
1071#if (HAS_PPC602)
10721067   if (ppc.is602) {
10731068      ppc602_exception(EXCEPTION_SYSTEM_CALL);
10741069   }
1075#endif
1076#if (HAS_PPC403)
10771070   if (IS_PPC403()) {
10781071      ppc403_exception(EXCEPTION_SYSTEM_CALL);
10791072   }
1080#endif
10811073}
10821074#endif
10831075
r4057r4058
15431535   }
15441536
15451537   if (exception) {
1546#if (HAS_PPC603 || HAS_PPC601)
15471538      if (ppc.is603) {
15481539         ppc603_exception(EXCEPTION_TRAP);
15491540      }
1550#endif
1551#if (HAS_PPC602)
15521541      if (ppc.is602) {
15531542         ppc602_exception(EXCEPTION_TRAP);
15541543      }
1555#endif
1556#if (HAS_PPC403)
15571544      if (IS_PPC403()) {
15581545         ppc403_exception(EXCEPTION_TRAP);
15591546      }
1560#endif
15611547   }
15621548}
15631549#endif
r4057r4058
15871573   }
15881574
15891575   if (exception) {
1590#if (HAS_PPC603 || HAS_PPC601)
15911576      if (ppc.is603) {
15921577         ppc603_exception(EXCEPTION_TRAP);
15931578      }
1594#endif
1595#if (HAS_PPC602)
15961579      if (ppc.is602) {
15971580         ppc602_exception(EXCEPTION_TRAP);
15981581      }
1599#endif
1600#if (HAS_PPC403)
16011582      if (IS_PPC403()) {
16021583         ppc403_exception(EXCEPTION_TRAP);
16031584      }
1604#endif
16051585   }
16061586}
16071587#endif
r4057r4058
17771757
17781758
17791759
1780#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
17811760static void ppc_lfs(UINT32 op)
17821761{
17831762   UINT32 ea = SIMM16;
r4057r4058
28372816      SET_CR1();
28382817   }
28392818}
2840#endif
src/emu/cpu/powerpc/ppcdrc.c
r4057r4058
13371337      generate_update_mode(ppc, block);                                       // <update mode>
13381338
13391339      /* determine our target PC */
1340      UML_MOV(block, IREG(0), IMM(0x00000000));                                 // mov     i0,0x00000000
1340      if (ppc->flavor == PPC_MODEL_602)
1341         UML_MOV(block, IREG(0), SPR32(SPR602_IBR));                              // mov     i0,[ibr]
1342      else
1343         UML_MOV(block, IREG(0), IMM(0x00000000));                              // mov     i0,0x00000000
13411344      UML_TEST(block, MSR32, IMM(MSROEA_IP));                                    // test    [msr],IP
13421345      UML_MOVc(block, IF_NZ, IREG(0), IMM(0xfff00000));                           // mov     i0,0xfff00000,nz
13431346      UML_OR(block, IREG(0), IREG(0), IREG(3));                                 // or      i0,i0,i3
r4057r4058
37093712         else
37103713            UML_AND(block, MSR32, MSR32, IMM(~MSR_EE));                           // and     msr,msr,~MSR_EE
37113714         return TRUE;
3715
3716      case 0x254: /* ESA */
3717      case 0x274: /* DSA */
3718         /* no-op for now */
3719         return TRUE;
37123720   }
37133721
37143722   return FALSE;
r4057r4058
41894197    PPC 4XX VARIANTS
41904198***************************************************************************/
41914199
4192#if (HAS_PPC403GA || HAS_PPC403GCX)
4193
41944200/*-------------------------------------------------
41954201    ppcdrc4xx_get_info - PowerPC 4XX-specific
41964202    information getter
r4057r4058
42164222   ppc4xx_set_info(ppc, state, info);
42174223}
42184224
4219#endif
42204225
4221
4222#if (HAS_PPC403GA)
4223
42244226/*-------------------------------------------------
42254227    ppc403ga_init - PowerPC 403GA-specific
42264228    initialization
r4057r4058
42554257   }
42564258}
42574259
4258#endif
42594260
4260
4261#if (HAS_PPC403GCX)
4262
42634261/*-------------------------------------------------
42644262    ppc403gcx_init - PowerPC 403GCX-specific
42654263    initialization
r4057r4058
42944292   }
42954293}
42964294
4297#endif
42984295
42994296
4300
43014297/***************************************************************************
43024298    PPC 6XX VARIANTS
43034299***************************************************************************/
43044300
4305#if (HAS_PPC601)
4306
43074301/*-------------------------------------------------
43084302    ppc601_init - PowerPC 601-specific
43094303    initialization
r4057r4058
43374331   }
43384332}
43394333
4340#endif
43414334
4342
4343#if (HAS_PPC602)
4344
43454335/*-------------------------------------------------
43464336    ppc602_init - PowerPC 602-specific
43474337    initialization
r4057r4058
43754365   }
43764366}
43774367
4378#endif
43794368
4380
4381#if (HAS_PPC603)
4382
43834369/*-------------------------------------------------
43844370    ppc603_init - PowerPC 603-specific
43854371    initialization
r4057r4058
44134399   }
44144400}
44154401
4416#endif
44174402
4418
4419#if (HAS_PPC603E)
4420
44214403/*-------------------------------------------------
44224404    ppc603e_init - PowerPC 603e-specific
44234405    initialization
r4057r4058
44514433   }
44524434}
44534435
4454#endif
44554436
4456
4457#if (HAS_PPC603R)
4458
44594437/*-------------------------------------------------
44604438    ppc603r_init - PowerPC 603r-specific
44614439    initialization
r4057r4058
44894467   }
44904468}
44914469
4492#endif
44934470
4494
4495#if (HAS_PPC604)
4496
44974471/*-------------------------------------------------
44984472    ppc604_init - PowerPC 604-specific
44994473    initialization
r4057r4058
45274501   }
45284502}
45294503
4530#endif
45314504
45324505
4533
45344506/***************************************************************************
4535    PPC 6XX VARIANTS
4507    MPC VARIANTS
45364508***************************************************************************/
45374509
4538#if (HAS_MPC8240)
4539
45404510/*-------------------------------------------------
45414511    mpc8240_init - PowerPC MPC8240-specific
45424512    initialization
r4057r4058
45694539      default:                              CPU_GET_INFO_CALL(ppcdrc);         break;
45704540   }
45714541}
4572
4573#endif
src/emu/cpu/powerpc/ppc603.c
r4057r4058
176176   }
177177}
178178
179#if HAS_PPC603
180179static void ppc603_set_smi_line(int state)
181180{
182181   if( state ) {
183182      ppc.interrupt_pending |= 0x4;
184183   }
185184}
186#endif
187185
188186INLINE void ppc603_check_interrupts(void)
189187{
src/emu/cpu/powerpc/ppc_mem.c
r4057r4058
6666
6767/***********************************************************************/
6868
69#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
7069static UINT16 ppc_read16_unaligned(const address_space *space, UINT32 a)
7170{
7271   return ((UINT16)ppc.read8(space, a+0) << 8) | ((UINT16)ppc.read8(space, a+1) << 0);
r4057r4058
102101   ppc.write32(space, a+0, (UINT32)(d >> 32));
103102   ppc.write32(space, a+4, (UINT32)(d));
104103}
105#endif
106104
107105/***********************************************************************/
108106
r4057r4058
296294   }
297295}
298296
299#if (HAS_PPC602||HAS_PPC603)
300297static int ppc_translate_address_cb(int space, offs_t *addr)
301298{
302299   int success = 1;
r4057r4058
308305   }
309306   return success;
310307}
311#endif
312308
313309static UINT8 ppc_read8_translated(const address_space *space, offs_t address)
314310{
r4057r4058
359355}
360356
361357#ifndef PPC_DRC
362#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_MPC8240)
363358static UINT32 ppc_readop_translated(const address_space *space, offs_t address)
364359{
365360   ppc_translate_address(&address, PPC_TRANSLATE_CODE | PPC_TRANSLATE_READ);
366361   return memory_read_dword_64be(space, address);
367362}
368363#endif
369#endif
370364
371365/***********************************************************************/
372366
r4057r4058
380374
381375/***********************************************************************/
382376
383#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
384377static CPU_READOP( ppc )
385378{
386379   if (!(ppc.msr & MSR_IR))
r4057r4058
441434
442435   return 1;
443436}
444#endif
src/emu/cpu/powerpc/ppc.c
r4057r4058
7777};
7878
7979
80#if (HAS_PPC603 || HAS_PPC601 || HAS_PPC604)
8180static void ppc603_exception(int exception);
82#endif
83#if (HAS_PPC602)
8481static void ppc602_exception(int exception);
85#endif
86#if (HAS_PPC403)
8782static void ppc403_exception(int exception);
8883static UINT8 ppc403_spu_r(UINT32 a);
8984static void ppc403_spu_w(UINT32 a, UINT8 d);
90#endif
9185
9286#define RD            ((op >> 21) & 0x1F)
9387#define RT            ((op >> 21) & 0x1f)
r4057r4058
144138   if((ppc.msr & 0x2000) == 0){   \
145139   }
146140
147#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
148141static UINT32      ppc_field_xlat[256];
149#endif
150142
151143
152144
r4057r4058
323315   FPR   fpr[32];
324316   UINT32 sr[16];
325317
326#if HAS_PPC603 || HAS_PPC601 || HAS_MPC8240 || HAS_PPC604
327318   int is603;
328#endif
329#if HAS_PPC602
330319   int is602;
331#endif
332320
333321   /* PowerPC 602 specific registers */
334322   UINT32 lt;
r4057r4058
388376
389377INLINE int IS_PPC602(void)
390378{
391#if HAS_PPC602
392379   return ppc.is602;
393#else
394   return 0;
395#endif
396380}
397381
398382INLINE int IS_PPC603(void)
399383{
400#if HAS_PPC603 || HAS_PPC601 || HAS_PPC604
401384   return ppc.is603;
402#else
403   return 0;
404#endif
405385}
406386
407387INLINE int IS_PPC403(void)
408388{
409#if HAS_PPC403
410389   return !IS_PPC602() && !IS_PPC603();
411#else
412   return 0;
413#endif
414390}
415391
416392/*********************************************************************/
r4057r4058
560536      case SPR_PVR:      return;
561537   }
562538
563#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601 || HAS_PPC604)
564539   if(IS_PPC602() || IS_PPC603()) {
565540      switch(spr)
566541      {
r4057r4058
568543            if((value & 0x80000000) && !(DEC & 0x80000000))
569544            {
570545               /* trigger interrupt */
571#if HAS_PPC602
572546               if (IS_PPC602())
573547                  ppc602_exception(EXCEPTION_DECREMENTER);
574#endif
575#if HAS_PPC603 || HAS_PPC601 || HAS_PPC604
576548               if (IS_PPC603())
577549                  ppc603_exception(EXCEPTION_DECREMENTER);
578#endif
579550            }
580551            write_decrementer(value);
581552            return;
r4057r4058
629600         case SPR603E_IABR:         ppc.iabr = value; return;
630601      }
631602   }
632#endif
633603
634#if (HAS_PPC602)
635604   if (ppc.is602) {
636605      switch(spr)
637606      {
r4057r4058
643612         case SPR602_TCR:      ppc.tcr = value; return;
644613      }
645614   }
646#endif
647615
648#if (HAS_PPC403)
649616   if (IS_PPC403()) {
650617      switch(spr)
651618      {
r4057r4058
702669         case SPR403_IAC2:      ppc.iac2 = value; return;
703670      }
704671   }
705#endif
706672
707673   fatalerror("ppc: set_spr: unknown spr %d (%03X) !", spr, spr);
708674}
r4057r4058
723689      case SPR_PVR:      return ppc.pvr;
724690   }
725691
726#if (HAS_PPC403)
727692   if (IS_PPC403())
728693   {
729694      switch (spr)
r4057r4058
754719         case SPR403_IAC2:      return ppc.iac2;
755720      }
756721   }
757#endif
758722
759#if (HAS_PPC602)
760723   if (ppc.is602) {
761724      switch(spr)
762725      {
r4057r4058
769732         case SPR602_TCR:      return ppc.tcr;
770733      }
771734   }
772#endif
773735
774#if (HAS_PPC603 || HAS_PPC602 || HAS_PPC601 || HAS_PPC604)
775736   if (IS_PPC603() || IS_PPC602())
776737   {
777738      switch (spr)
r4057r4058
819780         case SPR603E_DBAT3U:   return ppc.dbat[3].u;
820781      }
821782   }
822#endif
823783
824784   fatalerror("ppc: get_spr: unknown spr %d (%03X) !", spr, spr);
825785   return 0;
r4057r4058
899859
900860#include "ppc_mem.c"
901861
902#if (HAS_PPC403)
903862#include "ppc403.c"
904#endif
905
906#if (HAS_PPC602)
907863#include "ppc602.c"
908#endif
909
910#if (HAS_PPC603 || HAS_PPC601 || HAS_MPC8240 || HAS_PPC604)
911864#include "ppc603.c"
912#endif
913865
914866/********************************************************************/
915867
r4057r4058
974926
975927
976928// !!! probably should move this stuff elsewhere !!!
977#if HAS_PPC403
978929static CPU_INIT( ppc403 )
979930{
980931   const ppc_config *configdata = device->static_config;
r4057r4058
1020971{
1021972
1022973}
1023#endif /* HAS_PPC403 */
1024974
1025
1026#if (HAS_PPC603)
1027975static CPU_INIT( ppc603 )
1028976{
1029977   const ppc_config *configdata = device->static_config;
r4057r4058
11671115{
11681116
11691117}
1170#endif
11711118
1172#if (HAS_PPC602)
11731119static CPU_INIT( ppc602 )
11741120{
11751121   float multiplier;
r4057r4058
13021248{
13031249
13041250}
1305#endif
13061251
1307#if (HAS_MPC8240)
1308
13091252static void mpc8240_tlbli(UINT32 op)
13101253{
13111254
r4057r4058
14461389{
14471390
14481391}
1449#endif
14501392
1451
1452#if (HAS_PPC601)
14531393static CPU_INIT( ppc601 )
14541394{
14551395   const ppc_config *configdata = device->static_config;
r4057r4058
15771517{
15781518
15791519}
1580#endif
15811520
1582#if (HAS_PPC604)
15831521static CPU_INIT( ppc604 )
15841522{
15851523   const ppc_config *configdata = device->static_config;
r4057r4058
17091647{
17101648
17111649}
1712#endif
17131650
17141651
17151652
r4057r4058
17661703   }
17671704}
17681705
1769#if (HAS_PPC403)
17701706static CPU_SET_INFO( ppc403 )
17711707{
17721708   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 8)
r4057r4058
17811717      default:                           ppc_set_info(state, info);            break;
17821718   }
17831719}
1784#endif
17851720
1786#if (HAS_PPC603)
17871721static CPU_SET_INFO( ppc603 )
17881722{
17891723   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
r4057r4058
17981732      default:                                 ppc_set_info(state, info);      break;
17991733   }
18001734}
1801#endif
18021735
18031736static CPU_GET_INFO( ppc )
18041737{
r4057r4058
19331866   }
19341867}
19351868
1936#if (HAS_PPC403)
19371869CPU_GET_INFO( ppc403 )
19381870{
19391871   switch(state)
r4057r4058
19591891      default:                              CPU_GET_INFO_CALL(ppc);            break;
19601892   }
19611893}
1962#endif
19631894
1964#if (HAS_PPC603)
19651895CPU_GET_INFO( ppc603 )
19661896{
19671897   switch(state)
r4057r4058
19941924      default:                              CPU_GET_INFO_CALL(ppc);            break;
19951925   }
19961926}
1997#endif
19981927
1999/* PowerPC 602 */
2000
2001#if (HAS_PPC602)
20021928static CPU_SET_INFO( ppc602 )
20031929{
20041930   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
r4057r4058
20431969      default:                              CPU_GET_INFO_CALL(ppc);            break;
20441970   }
20451971}
2046#endif
20471972
2048/* Motorola MPC8240 */
20491973
2050#if (HAS_MPC8240)
20511974static CPU_SET_INFO( mpc8240 )
20521975{
20531976   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
r4057r4058
20882011      default:                              CPU_GET_INFO_CALL(ppc);            break;
20892012   }
20902013}
2091#endif
20922014
2093/* PPC601 */
2094
2095#if (HAS_PPC601)
20962015static CPU_SET_INFO( ppc601 )
20972016{
20982017   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
r4057r4058
21332052      default:                              CPU_GET_INFO_CALL(ppc);            break;
21342053   }
21352054}
2136#endif
21372055
2138/* PPC604 */
2139
2140#if (HAS_PPC604)
21412056static CPU_SET_INFO( ppc604 )
21422057{
21432058   if (state >= CPUINFO_INT_INPUT_STATE && state <= CPUINFO_INT_INPUT_STATE + 5)
r4057r4058
21782093      default:                              CPU_GET_INFO_CALL(ppc);            break;
21792094   }
21802095}
2181#endif
src/emu/cpu/powerpc/ppccom.h
r4057r4058
8181/* exception types */
8282enum
8383{
84   EXCEPTION_RESET      = 1,
85   EXCEPTION_MACHCHECK   = 2,
86   EXCEPTION_DSI      = 3,      /* PPCCAP_OEA */
87   EXCEPTION_PROTECTION= 3,      /* PPCCAP_4XX */
88   EXCEPTION_ISI      = 4,
89   EXCEPTION_EI      = 5,
90   EXCEPTION_ALIGN      = 6,
91   EXCEPTION_PROGRAM   = 7,
92   EXCEPTION_NOFPU      = 8,
93   EXCEPTION_DECREMENT   = 9,
94   EXCEPTION_SYSCALL   = 12,
95   EXCEPTION_TRACE      = 13,
96   EXCEPTION_FPASSIST   = 14,
97   EXCEPTION_ITLBMISS   = 16,      /* PPCCAP_603_MMU */
98   EXCEPTION_DTLBMISSL   = 17,      /* PPCCAP_603_MMU */
99   EXCEPTION_DTLBMISSS   = 18,      /* PPCCAP_603_MMU */
84   EXCEPTION_RESET         = 1,
85   EXCEPTION_MACHCHECK      = 2,
86   EXCEPTION_DSI         = 3,      /* PPCCAP_OEA */
87   EXCEPTION_PROTECTION   = 3,      /* PPCCAP_4XX */
88   EXCEPTION_ISI         = 4,
89   EXCEPTION_EI         = 5,
90   EXCEPTION_ALIGN         = 6,
91   EXCEPTION_PROGRAM      = 7,
92   EXCEPTION_NOFPU         = 8,
93   EXCEPTION_DECREMENT      = 9,
94   EXCEPTION_SYSCALL      = 12,
95   EXCEPTION_TRACE         = 13,
96   EXCEPTION_FPASSIST      = 14,
97   EXCEPTION_ITLBMISS      = 16,      /* PPCCAP_603_MMU */
98   EXCEPTION_DTLBMISSL      = 17,      /* PPCCAP_603_MMU */
99   EXCEPTION_DTLBMISSS      = 18,      /* PPCCAP_603_MMU */
100100   EXCEPTION_COUNT
101101};
102102
src/emu/cpu/powerpc/ppc_dasm.c
r4057r4058
166166   { "dcread",   D_OP(31)|D_XO(486), M_RA|M_RB,               F_RT_RA_RB,      0         },
167167    { "divw",   D_OP(31)|D_XO(491), M_RT|M_RA|M_RB|M_OE|M_RC,   F_RT_RA_RB,     FL_OE|FL_RC },
168168    { "divwu",  D_OP(31)|D_XO(459), M_RT|M_RA|M_RB|M_OE|M_RC,   F_RT_RA_RB,     FL_OE|FL_RC },
169   { "dsa",   D_OP(31)|D_XO(628),   0,                     0,            0         },
169170    { "eciwx",  D_OP(31)|D_XO(310), M_RT|M_RA|M_RB,             F_RT_RA_0_RB,   0           },
170171    { "ecowx",  D_OP(31)|D_XO(438), M_RT|M_RA|M_RB,             F_RT_RA_0_RB,   0           },
171172    { "eieio",  D_OP(31)|D_XO(854), 0,                          F_NONE,         0           },
172173    { "eqv",    D_OP(31)|D_XO(284), M_RT|M_RA|M_RB|M_RC,        F_RA_RT_RB,     FL_RC       },
174   { "esa",   D_OP(31)|D_XO(596),   0,                     0,            0         },
173175    { "extsb",  D_OP(31)|D_XO(954), M_RT|M_RA|M_RC,             F_RA_RT,        FL_RC       },
174176    { "extsh",  D_OP(31)|D_XO(922), M_RT|M_RA|M_RC,             F_RA_RT,        FL_RC       },
175177    { "fabs",   D_OP(63)|D_XO(264), M_RT|M_RB|M_RC,             F_FRT_FRB,      FL_RC       },
src/emu/cpu/powerpc/ppc.h
r4057r4058
148148    PUBLIC FUNCTIONS
149149***************************************************************************/
150150
151#if (HAS_PPC403GA)
152151CPU_GET_INFO( ppc403ga );
153152#define CPU_PPC403GA CPU_GET_INFO_NAME( ppc403ga )
154#endif
155153
156#if (HAS_PPC403GCX)
157154CPU_GET_INFO( ppc403gcx );
158155#define CPU_PPC403GCX CPU_GET_INFO_NAME( ppc403gcx )
159#endif
160156
161#if (HAS_PPC601)
162157CPU_GET_INFO( ppc601 );
163158#define CPU_PPC601 CPU_GET_INFO_NAME( ppc601 )
164#endif
165159
166#if (HAS_PPC602)
167160CPU_GET_INFO( ppc602 );
168161#define CPU_PPC602 CPU_GET_INFO_NAME( ppc602 )
169#endif
170162
171#if (HAS_PPC603)
172163CPU_GET_INFO( ppc603 );
173164#define CPU_PPC603 CPU_GET_INFO_NAME( ppc603 )
174#endif
175165
176#if (HAS_PPC603E)
177166CPU_GET_INFO( ppc603e );
178167#define CPU_PPC603E CPU_GET_INFO_NAME( ppc603e )
179#endif
180168
181#if (HAS_PPC603R)
182169CPU_GET_INFO( ppc603r );
183170#define CPU_PPC603R CPU_GET_INFO_NAME( ppc603r )
184#endif
185171
186#if (HAS_PPC604)
187172CPU_GET_INFO( ppc604 );
188173#define CPU_PPC604 CPU_GET_INFO_NAME( ppc604 )
189#endif
190174
191#if (HAS_MPC8240)
192175CPU_GET_INFO( mpc8240 );
193176#define CPU_MPC8240 CPU_GET_INFO_NAME( mpc8240 )
194#endif
195177
196178
197179
src/emu/cpu/powerpc/drc_ops.c
r4057r4058
26242624   return RECOMPILE_SUCCESSFUL_CP(1,4);
26252625}
26262626
2627#if HAS_PPC403
26282627static UINT32 recompile_dccci(drc_core *drc, UINT32 op)
26292628{
26302629   return RECOMPILE_SUCCESSFUL_CP(1,4);
r4057r4058
27132712
27142713/* PowerPC 60x Recompilers */
27152714
2716#if (HAS_PPC601||HAS_PPC602||HAS_PPC603||HAS_PPC604||HAS_MPC8240)
27172715static UINT32 recompile_lfs(drc_core *drc,UINT32 op)
27182716{
27192717   emit_mov_m32_r32(DRCTOP, MABS(&ppc_icount), REG_EBP);
r4057r4058
37683766
37693767// PPC602
37703768
3771#if (HAS_PPC602)
37723769static UINT32 recompile_esa(drc_core *drc, UINT32 op)
37733770{
37743771   emit_mov_m32_r32(DRCTOP, MABS(&ppc_icount), REG_EBP);
r4057r4058
37903787
37913788   return RECOMPILE_SUCCESSFUL_CP(1,4);
37923789}
3793#endif /* HAS_PPC602 */
37943790
3795#if (HAS_PPC602 || HAS_MPC8240)
37963791static UINT32 recompile_tlbli(drc_core *drc, UINT32 op)
37973792{
37983793   return RECOMPILE_SUCCESSFUL_CP(1,4);
37993794}
3800#endif
38013795
3802#if (HAS_PPC602||HAS_PPC604||HAS_MPC8240)
38033796static UINT32 recompile_tlbld(drc_core *drc, UINT32 op)
38043797{
38053798   return RECOMPILE_SUCCESSFUL_CP(1,4);
38063799}
3807#endif
38083800
src/emu/cpu/powerpc/ppcfe.c
r4057r4058
9898
9999
100100/*-------------------------------------------------
101    is_602_class - are we one of the 602 variants?
102-------------------------------------------------*/
103
104INLINE int is_602_class(const powerpc_state *ppc)
105{
106   return (ppc->flavor == PPC_MODEL_602);
107}
108
109
110/*-------------------------------------------------
101111    is_603_class - are we one of the 603 variants?
102112-------------------------------------------------*/
103113
r4057r4058
10051015
10061016      case 0x3d2:   /* TLBLD */
10071017      case 0x3f2:   /* TLBLI */
1008         if (!(ppc->cap & PPCCAP_603_MMU))
1018         if (!(ppc->cap & PPCCAP_603_MMU) && !is_602_class(ppc))
10091019            return FALSE;
10101020         desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION;
10111021         return TRUE;
r4057r4058
11811191         if (op & MSR_EE)
11821192            desc->flags |= OPFLAG_CAN_EXPOSE_EXTERNAL_INT;
11831193         return TRUE;
1194
1195      case 0x254: /* ESA */
1196      case 0x274: /* DSA */
1197         if (!is_602_class(ppc))
1198            return FALSE;
1199         desc->flags |= OPFLAG_PRIVILEGED | OPFLAG_CAN_CAUSE_EXCEPTION;
1200         return TRUE;
11841201   }
11851202
11861203   return FALSE;
src/emu/cpu/sh2/sh2.h
r4057r4058
8080
8181enum
8282{
83   CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK = CPUINFO_PTR_CPU_SPECIFIC,
83   CPUINFO_FCT_SH2_FTCSR_READ_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC,
8484
85   CPUINFO_PTR_SH2_FASTRAM_BASE
85   CPUINFO_PTR_SH2_FASTRAM_BASE = CPUINFO_PTR_CPU_SPECIFIC
8686};
8787
8888typedef struct _sh2_cpu_core sh2_cpu_core;
src/emu/cpu/sh2/sh2drc.c
r4057r4058
33903390      case CPUINFO_INT_SH2_FRT_INPUT:               sh2_set_frt_input(device, info->i); break;
33913391
33923392      /* --- the following bits of info are set as pointers to data or functions --- */
3393      case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK:      sh2->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
3393      case CPUINFO_FCT_SH2_FTCSR_READ_CALLBACK:      sh2->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
33943394   }
33953395}
33963396
r4057r4058
35303530      case CPUINFO_STR_REGISTER + SH2_R15:         sprintf(info->s, "R15 :%08X", sh2->r[15]); break;
35313531      case CPUINFO_STR_REGISTER + SH2_EA:            sprintf(info->s, "EA  :%08X", sh2->ea);    break;
35323532
3533      case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK:      info->f = (genf*)sh2->ftcsr_read_callback; break;
3533      case CPUINFO_FCT_SH2_FTCSR_READ_CALLBACK:      info->f = (genf*)sh2->ftcsr_read_callback; break;
35343534
35353535   }
35363536}
src/emu/cpu/sh2/sh2comn.c
r4057r4058
724724   }
725725   sh2->irq_callback = irqcallback;
726726   sh2->device = device;
727   sh2->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
728   sh2->internal = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
727   sh2->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
728   sh2->internal = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
729729
730730   state_save_register_device_item(device, 0, sh2->pc);
731731   state_save_register_device_item(device, 0, sh2->r[15]);
src/emu/cpu/sh2/sh2.c
r4057r4058
23122312      case CPUINFO_INT_SH2_FRT_INPUT:               sh2_set_frt_input(device, info->i); break;
23132313
23142314      /* --- the following bits of info are set as pointers to data or functions --- */
2315      case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK:      sh2->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
2315      case CPUINFO_FCT_SH2_FTCSR_READ_CALLBACK:      sh2->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
23162316   }
23172317}
23182318
r4057r4058
24462446      case CPUINFO_STR_REGISTER + SH2_R15:         sprintf(info->s, "R15 :%08X", sh2->r[15]); break;
24472447      case CPUINFO_STR_REGISTER + SH2_EA:            sprintf(info->s, "EA  :%08X", sh2->ea);    break;
24482448
2449      case CPUINFO_PTR_SH2_FTCSR_READ_CALLBACK:      info->f = (genf*)sh2->ftcsr_read_callback; break;
2449      case CPUINFO_FCT_SH2_FTCSR_READ_CALLBACK:      info->f = (genf*)sh2->ftcsr_read_callback; break;
24502450
24512451   }
24522452}
src/emu/cpu/mb88xx/mb88xx.c
r4057r4058
220220
221221   cpustate->icount = cycles;
222222
223   while (cpustate->icount >= 0)
223   while (cpustate->icount > 0)
224224   {
225225      UINT8 opcode, arg, oc;
226226
src/emu/cpu/sh4/sh4.c
r4057r4058
32703270   sh4->ftcsr_read_callback = f;
32713271   sh4->irq_callback = save_irqcallback;
32723272   sh4->device = device;
3273   sh4->internal = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
3274   sh4->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
3275   sh4->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
3273   sh4->internal = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
3274   sh4->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
3275   sh4->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
32763276
32773277   sh4->dma_timer[0] = tsaved[0];
32783278   sh4->dma_timer[1] = tsaved[1];
r4057r4058
33833383
33843384   sh4->irq_callback = irqcallback;
33853385   sh4->device = device;
3386   sh4->internal = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
3387   sh4->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
3388   sh4->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
3386   sh4->internal = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
3387   sh4->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
3388   sh4->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
33893389   sh4_default_exception_priorities(sh4);
33903390   sh4->irln = 15;
33913391   sh4->test_irq = 0;
r4057r4058
35993599      case CPUINFO_INT_SH4_FRT_INPUT:               sh4_set_frt_input(device, info->i); break;
36003600
36013601      /* --- the following bits of info are set as pointers to data or functions --- */
3602      case CPUINFO_PTR_SH4_FTCSR_READ_CALLBACK:      sh4->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
3602      case CPUINFO_FCT_SH4_FTCSR_READ_CALLBACK:      sh4->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
36033603      case CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA:         sh4_dma_ddt(sh4, (struct sh4_ddt_dma *)info->f); break;
36043604   }
36053605}
r4057r4058
38333833      case CPUINFO_STR_REGISTER + SH4_XF14:         sprintf(info->s, "XF14 :%08X %f", FP_XS(14),(double)FP_XFS(14)); break;
38343834      case CPUINFO_STR_REGISTER + SH4_XF15:         sprintf(info->s, "XF15 :%08X %f", FP_XS(15),(double)FP_XFS(15)); break; //%01.2e
38353835#endif
3836      case CPUINFO_PTR_SH4_FTCSR_READ_CALLBACK:      info->f = (genf*)sh4->ftcsr_read_callback; break;
3836      case CPUINFO_FCT_SH4_FTCSR_READ_CALLBACK:      info->f = (genf*)sh4->ftcsr_read_callback; break;
38373837
38383838   }
38393839}
src/emu/cpu/sh4/sh4.h
r4057r4058
6262
6363enum
6464{
65   CPUINFO_PTR_SH4_FTCSR_READ_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC,
66   CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA,
65   CPUINFO_FCT_SH4_FTCSR_READ_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC,
66   CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA = CPUINFO_PTR_CPU_SPECIFIC,
6767};
6868
6969enum
src/emu/cpu/mips/psx.c
r4057r4058
11/*
22 * PlayStation CPU emulator by smf
33 *
4 * GTE divider reverse engineering by pSXAuthor.
5 *
46 * Licensed to the MAME Team for distribution under the MAME license.
57 *
68 * Known chip id's
r4057r4058
16261628
16271629   psxcpu->irq_callback = irqcallback;
16281630   psxcpu->device = device;
1629   psxcpu->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
1631   psxcpu->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
16301632
16311633   mips_state_register( "psxcpu", device );
16321634}
r4057r4058
31173119#define BFC ( psxcpu->cp2cr[ 23 ].sd )
31183120#define OFX ( psxcpu->cp2cr[ 24 ].sd )
31193121#define OFY ( psxcpu->cp2cr[ 25 ].sd )
3120#define H   ( psxcpu->cp2cr[ 26 ].w.l )
3122#define H   ( psxcpu->cp2cr[ 26 ].sw.l )
31213123#define DQA ( psxcpu->cp2cr[ 27 ].sw.l )
31223124#define DQB ( psxcpu->cp2cr[ 28 ].sd )
31233125#define ZSF3 ( psxcpu->cp2cr[ 29 ].sw.l )
r4057r4058
32673269   return n_value;
32683270}
32693271
3272static const UINT16 reciprocals[ 32768 ]=
3273{
3274   0x0,0xfffc,0xfff8,0xfff4,0xfff0,0xffec,0xffe8,0xffe4,0xffe0,0xffdc,0xffd8,0xffd4,0xffd0,0xffcc,0xffc8,0xffc4,
3275   0xffc0,0xffbc,0xffb8,0xffb4,0xffb0,0xffac,0xffa8,0xffa4,0xffa0,0xff9c,0xff98,0xff94,0xff90,0xff8c,0xff88,0xff84,
3276   0xff80,0xff7c,0xff78,0xff74,0xff70,0xff6c,0xff68,0xff64,0xff60,0xff5c,0xff58,0xff54,0xff50,0xff4c,0xff48,0xff44,
3277   0xff40,0xff3c,0xff38,0xff34,0xff30,0xff2c,0xff28,0xff24,0xff20,0xff1c,0xff18,0xff14,0xff10,0xff0c,0xff08,0xff04,
3278   0xff01,0xfefd,0xfef9,0xfef5,0xfef1,0xfeed,0xfee9,0xfee5,0xfee1,0xfedd,0xfed9,0xfed5,0xfed1,0xfecd,0xfec9,0xfec5,
3279   0xfec1,0xfebd,0xfeb9,0xfeb5,0xfeb1,0xfead,0xfea9,0xfea5,0xfea1,0xfe9d,0xfe99,0xfe95,0xfe91,0xfe8d,0xfe89,0xfe85,
3280   0xfe81,0xfe7e,0xfe7a,0xfe76,0xfe72,0xfe6e,0xfe6a,0xfe66,0xfe62,0xfe5e,0xfe5a,0xfe56,0xfe52,0xfe4e,0xfe4a,0xfe46,
3281   0xfe42,0xfe3e,0xfe3a,0xfe36,0xfe32,0xfe2e,0xfe2a,0xfe26,0xfe22,0xfe1e,0xfe1a,0xfe16,0xfe12,0xfe0e,0xfe0a,0xfe06,
3282   0xfe02,0xfdfe,0xfdfa,0xfdf6,0xfdf2,0xfdee,0xfdea,0xfde6,0xfde2,0xfdde,0xfdda,0xfdd6,0xfdd2,0xfdce,0xfdca,0xfdc6,
3283   0xfdc2,0xfdbe,0xfdba,0xfdb6,0xfdb2,0xfdae,0xfdaa,0xfda6,0xfda2,0xfd9e,0xfd9a,0xfd96,0xfd92,0xfd8e,0xfd8a,0xfd86,
3284   0xfd82,0xfd7f,0xfd7b,0xfd77,0xfd73,0xfd6f,0xfd6b,0xfd67,0xfd63,0xfd5f,0xfd5b,0xfd57,0xfd53,0xfd4f,0xfd4b,0xfd47,
3285   0xfd43,0xfd3f,0xfd3b,0xfd37,0xfd33,0xfd2f,0xfd2b,0xfd27,0xfd23,0xfd1f,0xfd1b,0xfd17,0xfd13,0xfd0f,0xfd0b,0xfd07,
3286   0xfd04,0xfd00,0xfcfc,0xfcf8,0xfcf4,0xfcf0,0xfcec,0xfce8,0xfce4,0xfce0,0xfcdc,0xfcd8,0xfcd4,0xfcd0,0xfccc,0xfcc8,
3287   0xfcc4,0xfcc0,0xfcbd,0xfcb9,0xfcb5,0xfcb1,0xfcad,0xfca9,0xfca5,0xfca1,0xfc9d,0xfc99,0xfc95,0xfc91,0xfc8d,0xfc89,
3288   0xfc87,0xfc83,0xfc7f,0xfc7b,0xfc77,0xfc73,0xfc6f,0xfc6b,0xfc67,0xfc63,0xfc5f,0xfc5b,0xfc57,0xfc53,0xfc4f,0xfc4b,
3289   0xfc47,0xfc43,0xfc40,0xfc3c,0xfc38,0xfc34,0xfc30,0xfc2c,0xfc28,0xfc24,0xfc20,0xfc1c,0xfc18,0xfc14,0xfc10,0xfc0c,
3290   0xfc08,0xfc04,0xfc00,0xfbfc,0xfbf8,0xfbf4,0xfbf0,0xfbec,0xfbe8,0xfbe4,0xfbe0,0xfbdc,0xfbd8,0xfbd4,0xfbd0,0xfbcc,
3291   0xfbc8,0xfbc4,0xfbc1,0xfbbd,0xfbb9,0xfbb5,0xfbb1,0xfbad,0xfba9,0xfba5,0xfba1,0xfb9d,0xfb99,0xfb95,0xfb91,0xfb8d,
3292   0xfb8b,0xfb87,0xfb83,0xfb7f,0xfb7b,0xfb77,0xfb73,0xfb6f,0xfb6b,0xfb67,0xfb63,0xfb5f,0xfb5b,0xfb57,0xfb53,0xfb4f,
3293   0xfb4b,0xfb47,0xfb43,0xfb40,0xfb3c,0xfb38,0xfb34,0xfb30,0xfb2c,0xfb28,0xfb24,0xfb20,0xfb1c,0xfb18,0xfb14,0xfb10,
3294   0xfb0d,0xfb09,0xfb05,0xfb01,0xfafd,0xfaf9,0xfaf5,0xfaf1,0xfaed,0xfae9,0xfae5,0xfae1,0xfadd,0xfad9,0xfad5,0xfad2,
3295   0xface,0xfaca,0xfac6,0xfac2,0xfabe,0xfaba,0xfab6,0xfab2,0xfaae,0xfaaa,0xfaa6,0xfaa2,0xfa9e,0xfa9a,0xfa96,0xfa92,
3296   0xfa8e,0xfa8a,0xfa86,0xfa82,0xfa7f,0xfa7b,0xfa77,0xfa73,0xfa6f,0xfa6b,0xfa67,0xfa65,0xfa61,0xfa5d,0xfa59,0xfa55,
3297   0xfa51,0xfa4d,0xfa49,0xfa45,0xfa41,0xfa3d,0xfa39,0xfa35,0xfa31,0xfa2d,0xfa2a,0xfa26,0xfa22,0xfa1e,0xfa1a,0xfa16,
3298   0xfa12,0xfa0e,0xfa0a,0xfa06,0xfa02,0xf9fe,0xf9fa,0xf9f6,0xf9f2,0xf9ee,0xf9ea,0xf9e6,0xf9e2,0xf9de,0xf9da,0xf9d6,
3299   0xf9d3,0xf9cf,0xf9cb,0xf9c7,0xf9c3,0xf9bf,0xf9bd,0xf9b9,0xf9b5,0xf9b1,0xf9ad,0xf9a9,0xf9a5,0xf9a1,0xf99d,0xf999,
3300   0xf995,0xf991,0xf98d,0xf989,0xf985,0xf982,0xf97e,0xf97a,0xf976,0xf972,0xf96e,0xf96a,0xf966,0xf962,0xf95e,0xf95a,
3301   0xf956,0xf952,0xf94e,0xf94a,0xf946,0xf942,0xf93e,0xf93a,0xf936,0xf932,0xf92e,0xf92b,0xf927,0xf923,0xf91f,0xf91b,
3302   0xf918,0xf914,0xf910,0xf90c,0xf908,0xf904,0xf900,0xf8fc,0xf8f8,0xf8f4,0xf8f0,0xf8ec,0xf8e8,0xf8e4,0xf8e0,0xf8dd,
3303   0xf8db,0xf8d7,0xf8d3,0xf8cf,0xf8cb,0xf8c7,0xf8c3,0xf8bf,0xf8bb,0xf8b7,0xf8b3,0xf8af,0xf8ab,0xf8a7,0xf8a3,0xf89f,
3304   0xf89c,0xf898,0xf894,0xf890,0xf88c,0xf888,0xf884,0xf880,0xf87c,0xf878,0xf874,0xf870,0xf86c,0xf868,0xf864,0xf860,
3305   0xf85f,0xf85b,0xf857,0xf853,0xf84f,0xf84b,0xf847,0xf843,0xf83f,0xf83b,0xf837,0xf833,0xf82f,0xf82b,0xf827,0xf823,
3306   0xf820,0xf81c,0xf818,0xf814,0xf810,0xf80c,0xf808,0xf804,0xf800,0xf7fc,0xf7f8,0xf7f4,0xf7f0,0xf7ec,0xf7e8,0xf7e4,
3307   0xf7e2,0xf7df,0xf7db,0xf7d7,0xf7d3,0xf7cf,0xf7cb,0xf7c7,0xf7c3,0xf7bf,0xf7bb,0xf7b7,0xf7b3,0xf7af,0xf7ab,0xf7a7,
3308   0xf7a3,0xf7a0,0xf79c,0xf798,0xf794,0xf790,0xf78c,0xf788,0xf784,0xf780,0xf77c,0xf778,0xf774,0xf770,0xf76c,0xf768,
3309   0xf766,0xf763,0xf75f,0xf75b,0xf757,0xf753,0xf74f,0xf74b,0xf747,0xf743,0xf73f,0xf73b,0xf737,0xf733,0xf72f,0xf72b,
3310   0xf728,0xf724,0xf720,0xf71c,0xf718,0xf714,0xf711,0xf70d,0xf709,0xf705,0xf701,0xf6fd,0xf6f9,0xf6f5,0xf6f1,0xf6ed,
3311   0xf6e9,0xf6e5,0xf6e2,0xf6de,0xf6da,0xf6d6,0xf6d2,0xf6ce,0xf6ca,0xf6c6,0xf6c4,0xf6c0,0xf6bc,0xf6b8,0xf6b4,0xf6b0,
3312   0xf6ad,0xf6a9,0xf6a5,0xf6a1,0xf69d,0xf699,0xf695,0xf691,0xf68d,0xf689,0xf685,0xf681,0xf67e,0xf67a,0xf676,0xf672,
3313   0xf66e,0xf66a,0xf666,0xf662,0xf660,0xf65c,0xf658,0xf654,0xf650,0xf64c,0xf649,0xf645,0xf641,0xf63d,0xf639,0xf635,
3314   0xf631,0xf62d,0xf629,0xf625,0xf621,0xf61d,0xf619,0xf616,0xf612,0xf60e,0xf60a,0xf606,0xf602,0xf600,0xf5fc,0xf5f8,
3315   0xf5f4,0xf5f0,0xf5ec,0xf5e8,0xf5e5,0xf5e1,0xf5dd,0xf5d9,0xf5d5,0xf5d1,0xf5cd,0xf5c9,0xf5c5,0xf5c1,0xf5bd,0xf5b9,
3316   0xf5b5,0xf5b2,0xf5ae,0xf5aa,0xf5a6,0xf5a2,0xf59e,0xf59c,0xf598,0xf594,0xf590,0xf58c,0xf588,0xf584,0xf581,0xf57d,
3317   0xf579,0xf575,0xf571,0xf56d,0xf569,0xf565,0xf561,0xf55d,0xf559,0xf555,0xf551,0xf54e,0xf54a,0xf546,0xf542,0xf53e,
3318   0xf53a,0xf537,0xf533,0xf52f,0xf52b,0xf527,0xf523,0xf51f,0xf51b,0xf517,0xf513,0xf511,0xf50e,0xf50a,0xf506,0xf502,
3319   0xf4fe,0xf4fa,0xf4f6,0xf4f2,0xf4ee,0xf4ea,0xf4e6,0xf4e3,0xf4df,0xf4db,0xf4d7,0xf4d3,0xf4cf,0xf4cb,0xf4c7,0xf4c3,
3320   0xf4c1,0xf4bd,0xf4ba,0xf4b6,0xf4b2,0xf4ae,0xf4aa,0xf4a6,0xf4a2,0xf49e,0xf49a,0xf496,0xf492,0xf48f,0xf48b,0xf487,
3321   0xf483,0xf47f,0xf47b,0xf477,0xf473,0xf46f,0xf46d,0xf469,0xf466,0xf462,0xf45e,0xf45a,0xf456,0xf452,0xf44e,0xf44a,
3322   0xf446,0xf442,0xf43f,0xf43b,0xf437,0xf433,0xf42f,0xf42b,0xf427,0xf423,0xf41f,0xf41d,0xf419,0xf415,0xf412,0xf40e,
3323   0xf40a,0xf406,0xf402,0xf3fe,0xf3fa,0xf3f6,0xf3f2,0xf3ee,0xf3eb,0xf3e7,0xf3e3,0xf3df,0xf3db,0xf3d7,0xf3d3,0xf3cf,
3324   0xf3cd,0xf3c9,0xf3c5,0xf3c2,0xf3be,0xf3ba,0xf3b6,0xf3b2,0xf3ae,0xf3aa,0xf3a6,0xf3a2,0xf39e,0xf39a,0xf397,0xf393,
3325   0xf38f,0xf38b,0xf387,0xf383,0xf37f,0xf37b,0xf379,0xf375,0xf371,0xf36e,0xf36a,0xf366,0xf362,0xf35e,0xf35a,0xf356,
3326   0xf352,0xf34f,0xf34b,0xf347,0xf343,0xf33f,0xf33b,0xf337,0xf333,0xf32f,0xf32c,0xf328,0xf324,0xf320,0xf31c,0xf318,
3327   0xf314,0xf310,0xf30c,0xf30b,0xf307,0xf303,0xf2ff,0xf2fb,0xf2f7,0xf2f3,0xf2ef,0xf2eb,0xf2e7,0xf2e4,0xf2e0,0xf2dc,
3328   0xf2d8,0xf2d4,0xf2d0,0xf2cc,0xf2c8,0xf2c6,0xf2c3,0xf2bf,0xf2bb,0xf2b7,0xf2b3,0xf2af,0xf2ab,0xf2a7,0xf2a3,0xf2a0,
3329   0xf29c,0xf298,0xf294,0xf290,0xf28c,0xf288,0xf284,0xf282,0xf27e,0xf27b,0xf277,0xf273,0xf26f,0xf26b,0xf267,0xf263,
3330   0xf25f,0xf25b,0xf258,0xf254,0xf250,0xf24c,0xf248,0xf244,0xf240,0xf23c,0xf23a,0xf236,0xf233,0xf22f,0xf22b,0xf227,
3331   0xf223,0xf21f,0xf21b,0xf217,0xf213,0xf210,0xf20c,0xf208,0xf204,0xf200,0xf1fc,0xf1f8,0xf1f6,0xf1f2,0xf1ee,0xf1eb,
3332   0xf1e7,0xf1e3,0xf1df,0xf1db,0xf1d7,0xf1d3,0xf1cf,0xf1cb,0xf1c8,0xf1c4,0xf1c0,0xf1bc,0xf1b8,0xf1b4,0xf1b2,0xf1ae,
3333   0xf1aa,0xf1a7,0xf1a3,0xf19f,0xf19b,0xf197,0xf193,0xf18f,0xf18b,0xf187,0xf184,0xf180,0xf17c,0xf178,0xf174,0xf170,
3334   0xf16c,0xf168,0xf165,0xf161,0xf15d,0xf159,0xf155,0xf151,0xf14f,0xf14b,0xf147,0xf144,0xf140,0xf13c,0xf138,0xf134,
3335   0xf130,0xf12c,0xf128,0xf125,0xf121,0xf11d,0xf119,0xf115,0xf113,0xf10f,0xf10b,0xf108,0xf104,0xf100,0xf0fc,0xf0f8,
3336   0xf0f4,0xf0f0,0xf0ec,0xf0e9,0xf0e5,0xf0e1,0xf0dd,0xf0d9,0xf0d7,0xf0d3,0xf0cf,0xf0cb,0xf0c8,0xf0c4,0xf0c0,0xf0bc,
3337   0xf0b8,0xf0b4,0xf0b0,0xf0ac,0xf0a9,0xf0a5,0xf0a1,0xf09d,0xf09b,0xf097,0xf093,0xf08f,0xf08c,0xf088,0xf084,0xf080,
3338   0xf07c,0xf078,0xf074,0xf070,0xf06d,0xf069,0xf065,0xf061,0xf05f,0xf05b,0xf057,0xf053,0xf04f,0xf04c,0xf048,0xf044,
3339   0xf040,0xf03c,0xf038,0xf034,0xf030,0xf02d,0xf029,0xf025,0xf023,0xf01f,0xf01b,0xf017,0xf013,0xf010,0xf00c,0xf008,
3340   0xf004,0xf000,0xeffc,0xeff8,0xeff4,0xeff1,0xefed,0xefe9,0xefe7,0xefe3,0xefdf,0xefdb,0xefd7,0xefd3,0xefd0,0xefcc,
3341   0xefc8,0xefc4,0xefc0,0xefbc,0xefb8,0xefb4,0xefb1,0xefad,0xefab,0xefa7,0xefa3,0xef9f,0xef9b,0xef97,0xef94,0xef90,
3342   0xef8b,0xef87,0xef83,0xef80,0xef7e,0xef7a,0xef76,0xef72,0xef6e,0xef6a,0xef66,0xef63,0xef5f,0xef5b,0xef57,0xef53,
3343   0xef4f,0xef4b,0xef48,0xef46,0xef42,0xef3e,0xef3a,0xef36,0xef32,0xef2e,0xef2b,0xef27,0xef23,0xef1f,0xef1b,0xef17,
3344   0xef13,0xef0f,0xef0e,0xef0a,0xef06,0xef02,0xeefe,0xeefa,0xeef6,0xeef2,0xeeef,0xeeeb,0xeee7,0xeee3,0xeedf,0xeedb,
3345   0xeed7,0xeed5,0xeed2,0xeece,0xeeca,0xeec6,0xeec2,0xeebe,0xeeba,0xeeb7,0xeeb3,0xeeaf,0xeeab,0xeea7,0xeea3,0xee9f,
3346   0xee9d,0xee9a,0xee96,0xee92,0xee8e,0xee8a,0xee86,0xee82,0xee7e,0xee7b,0xee77,0xee73,0xee6f,0xee6b,0xee67,0xee63,
3347   0xee61,0xee5e,0xee5a,0xee56,0xee52,0xee4e,0xee4a,0xee46,0xee43,0xee3f,0xee3b,0xee37,0xee33,0xee2f,0xee2b,0xee29,
3348   0xee26,0xee22,0xee1e,0xee1a,0xee16,0xee12,0xee0e,0xee0a,0xee07,0xee03,0xedff,0xedfb,0xedf7,0xedf3,0xedf1,0xeded,
3349   0xedea,0xede6,0xede2,0xedde,0xedda,0xedd6,0xedd2,0xedce,0xedcb,0xedc7,0xedc3,0xedbf,0xedbb,0xedb9,0xedb5,0xedb1,
3350   0xedad,0xeda9,0xeda6,0xeda2,0xeda0,0xed9c,0xed98,0xed94,0xed90,0xed8d,0xed89,0xed85,0xed81,0xed7d,0xed79,0xed75,
3351   0xed72,0xed70,0xed6c,0xed68,0xed64,0xed60,0xed5c,0xed59,0xed55,0xed51,0xed4d,0xed49,0xed45,0xed41,0xed3e,0xed3c,
3352   0xed38,0xed34,0xed30,0xed2c,0xed28,0xed25,0xed21,0xed1d,0xed19,0xed15,0xed11,0xed0d,0xed0c,0xed08,0xed04,0xed00,
3353   0xecfc,0xecf8,0xecf4,0xecf1,0xeced,0xece9,0xece5,0xece1,0xecdd,0xecd9,0xecd8,0xecd4,0xecd0,0xeccc,0xecc8,0xecc4,
3354   0xecc0,0xecbd,0xecb9,0xecb5,0xecb1,0xecad,0xeca9,0xeca7,0xeca4,0xeca0,0xec9c,0xec98,0xec94,0xec90,0xec8c,0xec89,
3355   0xec85,0xec81,0xec7d,0xec79,0xec75,0xec73,0xec70,0xec6c,0xec68,0xec64,0xec60,0xec5c,0xec58,0xec55,0xec51,0xec4d,
3356   0xec49,0xec45,0xec43,0xec3f,0xec3c,0xec38,0xec34,0xec30,0xec2c,0xec28,0xec24,0xec21,0xec1d,0xec19,0xec15,0xec11,
3357   0xec0f,0xec0b,0xec08,0xec04,0xec00,0xebfc,0xebf8,0xebf4,0xebf0,0xebed,0xebe9,0xebe5,0xebe1,0xebdf,0xebdb,0xebd7,
3358   0xebd3,0xebcf,0xebcb,0xebc7,0xebc6,0xebc2,0xebbe,0xebba,0xebb6,0xebb2,0xebaf,0xebab,0xeba7,0xeba3,0xeb9f,0xeb9b,
3359   0xeb99,0xeb96,0xeb92,0xeb8e,0xeb8a,0xeb86,0xeb82,0xeb7f,0xeb7b,0xeb77,0xeb73,0xeb6f,0xeb6d,0xeb69,0xeb66,0xeb62,
3360   0xeb5e,0xeb5a,0xeb56,0xeb52,0xeb4f,0xeb4b,0xeb47,0xeb43,0xeb41,0xeb3d,0xeb3a,0xeb36,0xeb32,0xeb2e,0xeb2a,0xeb26,
3361   0xeb23,0xeb1f,0xeb1b,0xeb17,0xeb15,0xeb11,0xeb0d,0xeb0a,0xeb06,0xeb02,0xeafe,0xeafa,0xeaf6,0xeaf3,0xeaef,0xeaeb,
3362   0xeae9,0xeae5,0xeae1,0xeadd,0xeada,0xead6,0xead2,0xeace,0xeaca,0xeac6,0xeac3,0xeabf,0xeabb,0xeab9,0xeab5,0xeab1,
3363   0xeaae,0xeaaa,0xeaa6,0xeaa2,0xea9e,0xea9a,0xea97,0xea93,0xea8f,0xea8d,0xea89,0xea85,0xea81,0xea7e,0xea7a,0xea76,
3364   0xea72,0xea6e,0xea6a,0xea67,0xea63,0xea61,0xea5d,0xea59,0xea55,0xea51,0xea4e,0xea4a,0xea46,0xea42,0xea3e,0xea3a,
3365   0xea37,0xea35,0xea31,0xea2d,0xea29,0xea25,0xea22,0xea1e,0xea1a,0xea16,0xea12,0xea0e,0xea0b,0xea09,0xea05,0xea01,
3366   0xe9fc,0xe9f8,0xe9f5,0xe9f3,0xe9ef,0xe9eb,0xe9e7,0xe9e3,0xe9df,0xe9dc,0xe9d8,0xe9d4,0xe9d0,0xe9cc,0xe9ca,0xe9c7,
3367   0xe9c3,0xe9bf,0xe9bb,0xe9b7,0xe9b4,0xe9b0,0xe9ac,0xe9a8,0xe9a4,0xe9a0,0xe99f,0xe99b,0xe997,0xe993,0xe98f,0xe98b,
3368   0xe988,0xe984,0xe980,0xe97c,0xe978,0xe976,0xe973,0xe96f,0xe96b,0xe967,0xe963,0xe960,0xe95c,0xe958,0xe954,0xe950,
3369   0xe94e,0xe94a,0xe947,0xe943,0xe93f,0xe93b,0xe937,0xe934,0xe930,0xe92c,0xe928,0xe926,0xe922,0xe91f,0xe91b,0xe917,
3370   0xe913,0xe90f,0xe90b,0xe908,0xe904,0xe900,0xe8fe,0xe8fa,0xe8f6,0xe8f3,0xe8ef,0xe8eb,0xe8e7,0xe8e3,0xe8e0,0xe8dc,
3371   0xe8d8,0xe8d6,0xe8d2,0xe8ce,0xe8cb,0xe8c7,0xe8c3,0xe8bf,0xe8bb,0xe8b7,0xe8b4,0xe8b0,0xe8ae,0xe8aa,0xe8a6,0xe8a2,
3372   0xe89f,0xe89b,0xe897,0xe893,0xe88f,0xe88b,0xe888,0xe886,0xe882,0xe87e,0xe87a,0xe876,0xe873,0xe86f,0xe86b,0xe867,
3373   0xe863,0xe860,0xe85c,0xe85a,0xe856,0xe852,0xe84e,0xe84b,0xe847,0xe843,0xe83f,0xe83b,0xe837,0xe834,0xe832,0xe82e,
3374   0xe829,0xe825,0xe821,0xe81f,0xe81b,0xe818,0xe814,0xe810,0xe80c,0xe808,0xe805,0xe801,0xe7fd,0xe7fb,0xe7f7,0xe7f4,
3375   0xe7f0,0xe7ec,0xe7e8,0xe7e4,0xe7e0,0xe7dd,0xe7d9,0xe7d5,0xe7d3,0xe7cf,0xe7cc,0xe7c8,0xe7c4,0xe7c0,0xe7bc,0xe7b9,
3376   0xe7b5,0xe7b1,0xe7af,0xe7ab,0xe7a7,0xe7a4,0xe7a0,0xe79c,0xe798,0xe794,0xe791,0xe78d,0xe78b,0xe787,0xe783,0xe77f,
3377   0xe77c,0xe778,0xe774,0xe770,0xe76c,0xe769,0xe767,0xe763,0xe75f,0xe75b,0xe758,0xe754,0xe750,0xe74c,0xe748,0xe744,
3378   0xe743,0xe73f,0xe73b,0xe737,0xe733,0xe730,0xe72c,0xe728,0xe724,0xe720,0xe71d,0xe71b,0xe717,0xe713,0xe70f,0xe70b,
3379   0xe708,0xe704,0xe700,0xe6fc,0xe6f8,0xe6f6,0xe6f3,0xe6ef,0xe6eb,0xe6e7,0xe6e3,0xe6e0,0xe6dc,0xe6d8,0xe6d4,0xe6d2,
3380   0xe6cf,0xe6cb,0xe6c7,0xe6c3,0xe6bf,0xe6bc,0xe6b8,0xe6b4,0xe6b0,0xe6ae,0xe6aa,0xe6a7,0xe6a3,0xe69f,0xe69b,0xe697,
3381   0xe694,0xe690,0xe68c,0xe688,0xe686,0xe682,0xe67f,0xe67b,0xe677,0xe673,0xe66f,0xe66c,0xe668,0xe664,0xe662,0xe65e,
3382   0xe659,0xe655,0xe651,0xe64f,0xe64c,0xe648,0xe644,0xe640,0xe63c,0xe639,0xe635,0xe631,0xe62f,0xe62b,0xe628,0xe624,
3383   0xe620,0xe61c,0xe618,0xe615,0xe611,0xe60d,0xe60b,0xe607,0xe604,0xe600,0xe5fc,0xe5f8,0xe5f4,0xe5f1,0xe5ed,0xe5eb,
3384   0xe5e7,0xe5e3,0xe5e0,0xe5dc,0xe5d8,0xe5d4,0xe5d0,0xe5cd,0xe5c9,0xe5c7,0xe5c3,0xe5bf,0xe5bc,0xe5b8,0xe5b4,0xe5b0,
3385   0xe5ac,0xe5a9,0xe5a7,0xe5a3,0xe59f,0xe59b,0xe598,0xe594,0xe590,0xe58c,0xe588,0xe585,0xe583,0xe57f,0xe57b,0xe577,
3386   0xe574,0xe570,0xe56c,0xe568,0xe564,0xe563,0xe55f,0xe55b,0xe557,0xe553,0xe550,0xe54c,0xe548,0xe544,0xe540,0xe53f,
3387   0xe53b,0xe537,0xe533,0xe52f,0xe52c,0xe528,0xe524,0xe520,0xe51e,0xe51b,0xe517,0xe513,0xe50f,0xe50b,0xe508,0xe504,
3388   0xe500,0xe4fc,0xe4fa,0xe4f7,0xe4f3,0xe4ef,0xe4eb,0xe4e7,0xe4e4,0xe4e0,0xe4dc,0xe4da,0xe4d6,0xe4d3,0xe4cf,0xe4cb,
3389   0xe4c7,0xe4c3,0xe4c0,0xe4bc,0xe4b8,0xe4b6,0xe4b2,0xe4af,0xe4ab,0xe4a7,0xe4a3,0xe49f,0xe49c,0xe498,0xe496,0xe492,
3390   0xe48e,0xe48a,0xe486,0xe482,0xe47f,0xe47d,0xe479,0xe475,0xe471,0xe46e,0xe46a,0xe466,0xe462,0xe45f,0xe45d,0xe459,
3391   0xe455,0xe451,0xe44e,0xe44a,0xe446,0xe442,0xe43e,0xe43d,0xe439,0xe435,0xe431,0xe42d,0xe42a,0xe426,0xe422,0xe41e,
3392   0xe41c,0xe419,0xe415,0xe411,0xe40d,0xe409,0xe406,0xe402,0xe3fe,0xe3fa,0xe3f8,0xe3f5,0xe3f1,0xe3ed,0xe3e9,0xe3e6,
3393   0xe3e2,0xe3de,0xe3da,0xe3d8,0xe3d5,0xe3d1,0xe3cd,0xe3c9,0xe3c5,0xe3c2,0xe3be,0xe3ba,0xe3b8,0xe3b4,0xe3b1,0xe3ad,
3394   0xe3a9,0xe3a5,0xe3a1,0xe39e,0xe39a,0xe398,0xe394,0xe390,0xe38d,0xe389,0xe385,0xe381,0xe37e,0xe37a,0xe378,0xe374,
3395   0xe370,0xe36d,0xe369,0xe365,0xe361,0xe35d,0xe35a,0xe358,0xe354,0xe350,0xe34c,0xe349,0xe345,0xe341,0xe33d,0xe339,
3396   0xe338,0xe334,0xe330,0xe32c,0xe328,0xe325,0xe321,0xe31d,0xe319,0xe316,0xe314,0xe310,0xe30c,0xe308,0xe305,0xe301,
3397   0xe2fd,0xe2f9,0xe2f5,0xe2f4,0xe2f0,0xe2ec,0xe2e8,0xe2e4,0xe2e1,0xe2dd,0xe2d9,0xe2d5,0xe2d3,0xe2d0,0xe2cc,0xe2c8,
3398   0xe2c6,0xe2c2,0xe2be,0xe2ba,0xe2b7,0xe2b3,0xe2af,0xe2ab,0xe2a8,0xe2a6,0xe2a2,0xe29e,0xe29a,0xe297,0xe293,0xe28f,
3399   0xe28b,0xe288,0xe286,0xe282,0xe27e,0xe27a,0xe277,0xe273,0xe26f,0xe26b,0xe269,0xe266,0xe262,0xe25e,0xe25a,0xe257,
3400   0xe253,0xe24f,0xe24b,0xe249,0xe246,0xe242,0xe23e,0xe23a,0xe237,0xe233,0xe22f,0xe22d,0xe229,0xe226,0xe222,0xe21e,
3401   0xe21a,0xe217,0xe213,0xe20f,0xe20d,0xe209,0xe206,0xe202,0xe1fe,0xe1fa,0xe1f7,0xe1f3,0xe1f1,0xe1ed,0xe1e9,0xe1e6,
3402   0xe1e2,0xe1de,0xe1da,0xe1d7,0xe1d3,0xe1d1,0xe1cd,0xe1c9,0xe1c6,0xe1c2,0xe1be,0xe1ba,0xe1b7,0xe1b5,0xe1b1,0xe1ad,
3403   0xe1a9,0xe1a6,0xe1a2,0xe19e,0xe19a,0xe197,0xe195,0xe191,0xe18d,0xe189,0xe186,0xe182,0xe17e,0xe17a,0xe178,0xe175,
3404   0xe171,0xe16d,0xe169,0xe166,0xe162,0xe15e,0xe15a,0xe158,0xe155,0xe151,0xe14d,0xe149,0xe146,0xe142,0xe13e,0xe13c,
3405   0xe138,0xe135,0xe131,0xe12d,0xe129,0xe126,0xe122,0xe11e,0xe11c,0xe118,0xe115,0xe111,0xe10d,0xe109,0xe106,0xe102,
3406   0xe0ff,0xe0fb,0xe0f8,0xe0f4,0xe0f2,0xe0ee,0xe0ea,0xe0e7,0xe0e3,0xe0df,0xe0db,0xe0d8,0xe0d6,0xe0d2,0xe0ce,0xe0cb,
3407   0xe0c7,0xe0c3,0xe0bf,0xe0bc,0xe0ba,0xe0b6,0xe0b2,0xe0ae,0xe0ab,0xe0a7,0xe0a3,0xe09f,0xe09e,0xe09a,0xe096,0xe092,
3408   0xe08f,0xe08b,0xe087,0xe083,0xe081,0xe07e,0xe07a,0xe076,0xe072,0xe06f,0xe06b,0xe067,0xe065,0xe062,0xe05e,0xe05a,
3409   0xe056,0xe053,0xe04f,0xe04b,0xe049,0xe045,0xe042,0xe03e,0xe03a,0xe036,0xe033,0xe02f,0xe02d,0xe029,0xe026,0xe022,
3410   0xe01e,0xe01a,0xe017,0xe013,0xe011,0xe00d,0xe009,0xe006,0xe002,0xdffe,0xdffa,0xdff7,0xdff5,0xdff1,0xdfed,0xdfea,
3411   0xdfe6,0xdfe2,0xdfde,0xdfdb,0xdfd9,0xdfd5,0xdfd1,0xdfcd,0xdfca,0xdfc6,0xdfc2,0xdfbe,0xdfbd,0xdfb9,0xdfb5,0xdfb1,
3412   0xdfae,0xdfaa,0xdfa6,0xdfa2,0xdfa0,0xdf9d,0xdf99,0xdf95,0xdf91,0xdf8e,0xdf8a,0xdf86,0xdf84,0xdf81,0xdf7d,0xdf79,
3413   0xdf75,0xdf72,0xdf6e,0xdf6a,0xdf68,0xdf64,0xdf61,0xdf5d,0xdf59,0xdf55,0xdf52,0xdf4e,0xdf4c,0xdf48,0xdf45,0xdf41,
3414   0xdf3d,0xdf3a,0xdf36,0xdf32,0xdf2e,0xdf2b,0xdf27,0xdf23,0xdf21,0xdf1e,0xdf1a,0xdf16,0xdf12,0xdf0f,0xdf0b,0xdf07,
3415   0xdf05,0xdf02,0xdefe,0xdefa,0xdef6,0xdef3,0xdeef,0xdeed,0xdee9,0xdee6,0xdee2,0xdede,0xdeda,0xded7,0xded3,0xded1,
3416   0xdecd,0xdeca,0xdec6,0xdec2,0xdebe,0xdebb,0xdeb9,0xdeb5,0xdeb1,0xdeae,0xdeaa,0xdea6,0xdea2,0xde9f,0xde9d,0xde99,
3417   0xde95,0xde92,0xde8e,0xde8a,0xde86,0xde85,0xde81,0xde7d,0xde79,0xde76,0xde72,0xde6e,0xde6a,0xde69,0xde65,0xde61,
3418   0xde5d,0xde5a,0xde56,0xde52,0xde50,0xde4d,0xde49,0xde45,0xde41,0xde3e,0xde3a,0xde36,0xde34,0xde31,0xde2d,0xde29,
3419   0xde25,0xde22,0xde1e,0xde1c,0xde18,0xde15,0xde11,0xde0d,0xde09,0xde06,0xde02,0xde00,0xddfc,0xddf9,0xddf5,0xddf1,
3420   0xdded,0xddea,0xdde8,0xdde4,0xdde0,0xdddd,0xddd9,0xddd5,0xddd1,0xddce,0xddcc,0xddc8,0xddc4,0xddc1,0xddbd,0xddb9,
3421   0xddb5,0xddb3,0xddb0,0xddac,0xdda8,0xdda5,0xdda1,0xdd9d,0xdd99,0xdd97,0xdd94,0xdd90,0xdd8c,0xdd89,0xdd85,0xdd81,
3422   0xdd7f,0xdd7b,0xdd77,0xdd74,0xdd70,0xdd6c,0xdd6a,0xdd66,0xdd63,0xdd5f,0xdd5b,0xdd58,0xdd54,0xdd52,0xdd4e,0xdd4b,
3423   0xdd47,0xdd43,0xdd3f,0xdd3c,0xdd38,0xdd36,0xdd32,0xdd2f,0xdd2b,0xdd27,0xdd23,0xdd20,0xdd1e,0xdd1a,0xdd16,0xdd13,
3424   0xdd0f,0xdd0b,0xdd07,0xdd06,0xdd02,0xdcfe,0xdcfa,0xdcf7,0xdcf3,0xdcef,0xdcec,0xdcea,0xdce6,0xdce2,0xdcde,0xdcdb,
3425   0xdcd7,0xdcd3,0xdcd1,0xdcce,0xdcca,0xdcc6,0xdcc3,0xdcbf,0xdcbb,0xdcb9,0xdcb5,0xdcb2,0xdcae,0xdcaa,0xdca7,0xdca3,
3426   0xdca1,0xdc9d,0xdc9a,0xdc96,0xdc92,0xdc8e,0xdc8b,0xdc87,0xdc85,0xdc81,0xdc7e,0xdc7a,0xdc76,0xdc72,0xdc6f,0xdc6d,
3427   0xdc69,0xdc65,0xdc62,0xdc5e,0xdc5a,0xdc56,0xdc55,0xdc51,0xdc4d,0xdc49,0xdc46,0xdc42,0xdc3e,0xdc3a,0xdc39,0xdc35,
3428   0xdc31,0xdc2d,0xdc2a,0xdc26,0xdc22,0xdc20,0xdc1d,0xdc19,0xdc15,0xdc12,0xdc0e,0xdc0a,0xdc08,0xdc04,0xdc01,0xdbfd,
3429   0xdbf9,0xdbf6,0xdbf2,0xdbee,0xdbec,0xdbe9,0xdbe5,0xdbe1,0xdbdd,0xdbda,0xdbd6,0xdbd4,0xdbd0,0xdbcd,0xdbc9,0xdbc5,
3430   0xdbc3,0xdbbf,0xdbbb,0xdbb8,0xdbb4,0xdbb0,0xdbae,0xdbab,0xdba7,0xdba3,0xdba0,0xdb9c,0xdb98,0xdb96,0xdb93,0xdb8f,
3431   0xdb8b,0xdb87,0xdb84,0xdb80,0xdb7e,0xdb7a,0xdb77,0xdb73,0xdb6f,0xdb6c,0xdb6a,0xdb66,0xdb62,0xdb5f,0xdb5b,0xdb57,
3432   0xdb53,0xdb52,0xdb4e,0xdb4a,0xdb47,0xdb43,0xdb3f,0xdb3b,0xdb3a,0xdb36,0xdb32,0xdb2e,0xdb2b,0xdb27,0xdb23,0xdb21,
3433   0xdb1e,0xdb1a,0xdb16,0xdb13,0xdb0f,0xdb0b,0xdb09,0xdb06,0xdb02,0xdafe,0xdafa,0xdaf7,0xdaf3,0xdaf1,0xdaed,0xdaea,
3434   0xdae6,0xdae2,0xdadf,0xdadb,0xdad9,0xdad5,0xdad2,0xdace,0xdaca,0xdac6,0xdac3,0xdac1,0xdabd,0xdab9,0xdab6,0xdab2,
3435   0xdaae,0xdaab,0xdaa9,0xdaa5,0xdaa1,0xda9e,0xda9a,0xda96,0xda93,0xda91,0xda8d,0xda89,0xda86,0xda82,0xda7e,0xda7a,
3436   0xda79,0xda75,0xda71,0xda6d,0xda6a,0xda66,0xda62,0xda60,0xda5d,0xda59,0xda55,0xda52,0xda4e,0xda4c,0xda48,0xda45,
3437   0xda41,0xda3d,0xda39,0xda36,0xda34,0xda30,0xda2c,0xda29,0xda25,0xda21,0xda1e,0xda1c,0xda18,0xda14,0xda11,0xda0d,
3438   0xda0a,0xda06,0xda03,0xd9ff,0xd9fb,0xd9f9,0xd9f6,0xd9f2,0xd9ee,0xd9eb,0xd9e7,0xd9e3,0xd9e1,0xd9de,0xd9da,0xd9d6,
3439   0xd9d3,0xd9cf,0xd9cb,0xd9c9,0xd9c6,0xd9c2,0xd9be,0xd9bb,0xd9b7,0xd9b5,0xd9b1,0xd9ae,0xd9aa,0xd9a6,0xd9a3,0xd99f,
3440   0xd99d,0xd999,0xd996,0xd992,0xd98e,0xd98b,0xd989,0xd985,0xd981,0xd97e,0xd97a,0xd976,0xd973,0xd971,0xd96d,0xd969,
3441   0xd966,0xd962,0xd95e,0xd95c,0xd959,0xd955,0xd951,0xd94e,0xd94a,0xd946,0xd944,0xd941,0xd93d,0xd939,0xd936,0xd932,
3442   0xd930,0xd92c,0xd929,0xd925,0xd921,0xd91e,0xd91a,0xd918,0xd914,0xd911,0xd90d,0xd909,0xd906,0xd902,0xd900,0xd8fc,
3443   0xd8f9,0xd8f5,0xd8f1,0xd8ee,0xd8ec,0xd8e8,0xd8e4,0xd8e1,0xd8dd,0xd8d9,0xd8d6,0xd8d4,0xd8d0,0xd8cc,0xd8c9,0xd8c5,
3444   0xd8c1,0xd8bf,0xd8bc,0xd8b8,0xd8b4,0xd8b1,0xd8ad,0xd8a9,0xd8a7,0xd8a4,0xd8a0,0xd89c,0xd899,0xd895,0xd893,0xd88f,
3445   0xd88c,0xd888,0xd884,0xd881,0xd87d,0xd87b,0xd877,0xd874,0xd870,0xd86c,0xd868,0xd865,0xd863,0xd85f,0xd85c,0xd858,
3446   0xd854,0xd851,0xd84d,0xd849,0xd846,0xd844,0xd840,0xd83c,0xd839,0xd835,0xd831,0xd830,0xd82c,0xd828,0xd825,0xd821,
3447   0xd81d,0xd819,0xd818,0xd814,0xd810,0xd80d,0xd809,0xd805,0xd803,0xd800,0xd7fc,0xd7f8,0xd7f5,0xd7f1,0xd7ef,0xd7ec,
3448   0xd7e8,0xd7e4,0xd7e0,0xd7dd,0xd7db,0xd7d7,0xd7d4,0xd7d0,0xd7cc,0xd7c9,0xd7c5,0xd7c3,0xd7bf,0xd7bc,0xd7b8,0xd7b4,
3449   0xd7b1,0xd7af,0xd7ab,0xd7a7,0xd7a4,0xd7a0,0xd79c,0xd79b,0xd797,0xd793,0xd790,0xd78c,0xd788,0xd786,0xd783,0xd77f,
3450   0xd77b,0xd778,0xd774,0xd770,0xd76e,0xd76b,0xd767,0xd763,0xd760,0xd75c,0xd75a,0xd756,0xd753,0xd74f,0xd74b,0xd748,
3451   0xd746,0xd742,0xd73f,0xd73b,0xd737,0xd734,0xd732,0xd72e,0xd72a,0xd727,0xd723,0xd71f,0xd71c,0xd71a,0xd716,0xd712,
3452   0xd70f,0xd70b,0xd707,0xd706,0xd702,0xd6fe,0xd6fa,0xd6f7,0xd6f3,0xd6f1,0xd6ee,0xd6ea,0xd6e6,0xd6e3,0xd6df,0xd6dd,
3453   0xd6d9,0xd6d6,0xd6d2,0xd6ce,0xd6cb,0xd6c7,0xd6c5,0xd6c1,0xd6be,0xd6ba,0xd6b6,0xd6b3,0xd6b1,0xd6ad,0xd6aa,0xd6a6,
3454   0xd6a3,0xd6a0,0xd69c,0xd698,0xd695,0xd691,0xd68d,0xd68c,0xd688,0xd684,0xd681,0xd67d,0xd679,0xd677,0xd674,0xd670,
3455   0xd66c,0xd669,0xd665,0xd663,0xd65f,0xd65c,0xd658,0xd654,0xd651,0xd64f,0xd64b,0xd648,0xd644,0xd640,0xd63d,0xd63b,
3456   0xd637,0xd633,0xd630,0xd62c,0xd628,0xd627,0xd623,0xd61f,0xd61c,0xd618,0xd614,0xd612,0xd60f,0xd60b,0xd607,0xd604,
3457   0xd600,0xd5fe,0xd5fa,0xd5f7,0xd5f3,0xd5ef,0xd5ec,0xd5ea,0xd5e6,0xd5e3,0xd5df,0xd5db,0xd5d8,0xd5d6,0xd5d2,0xd5ce,
3458   0xd5cb,0xd5c7,0xd5c3,0xd5c0,0xd5be,0xd5ba,0xd5b7,0xd5b3,0xd5af,0xd5ac,0xd5aa,0xd5a6,0xd5a2,0xd59f,0xd59b,0xd597,
3459   0xd596,0xd592,0xd58e,0xd58b,0xd587,0xd583,0xd581,0xd57e,0xd57a,0xd576,0xd573,0xd56f,0xd56d,0xd569,0xd566,0xd562,
3460   0xd55e,0xd55b,0xd559,0xd555,0xd552,0xd54e,0xd54a,0xd547,0xd545,0xd541,0xd53d,0xd53a,0xd536,0xd532,0xd531,0xd52d,
3461   0xd529,0xd526,0xd522,0xd51e,0xd51c,0xd519,0xd515,0xd511,0xd50e,0xd50a,0xd508,0xd504,0xd501,0xd4fd,0xd4f9,0xd4f6,
3462   0xd4f3,0xd4ef,0xd4ec,0xd4ea,0xd4e6,0xd4e3,0xd4df,0xd4db,0xd4d8,0xd4d6,0xd4d2,0xd4cf,0xd4cb,0xd4c7,0xd4c4,0xd4c2,
3463   0xd4be,0xd4ba,0xd4b7,0xd4b3,0xd4b0,0xd4ae,0xd4aa,0xd4a6,0xd4a3,0xd49f,0xd49b,0xd49a,0xd496,0xd492,0xd48f,0xd48b,
3464   0xd489,0xd485,0xd482,0xd47e,0xd47a,0xd477,0xd475,0xd471,0xd46e,0xd46a,0xd466,0xd463,0xd461,0xd45d,0xd45a,0xd456,
3465   0xd452,0xd44f,0xd44d,0xd449,0xd445,0xd442,0xd43e,0xd43b,0xd439,0xd435,0xd431,0xd42e,0xd42a,0xd426,0xd425,0xd421,
3466   0xd41d,0xd41a,0xd416,0xd414,0xd410,0xd40d,0xd409,0xd405,0xd402,0xd400,0xd3fc,0xd3f9,0xd3f5,0xd3f1,0xd3ee,0xd3ec,
3467   0xd3e8,0xd3e5,0xd3e1,0xd3dd,0xd3da,0xd3d8,0xd3d4,0xd3d0,0xd3cd,0xd3c9,0xd3c6,0xd3c4,0xd3c0,0xd3bc,0xd3b9,0xd3b5,
3468   0xd3b3,0xd3b0,0xd3ac,0xd3a8,0xd3a5,0xd3a1,0xd39f,0xd39b,0xd398,0xd394,0xd390,0xd38d,0xd38b,0xd387,0xd384,0xd380,
3469   0xd37c,0xd379,0xd377,0xd373,0xd370,0xd36c,0xd368,0xd365,0xd363,0xd35f,0xd35b,0xd358,0xd354,0xd351,0xd34f,0xd34b,
3470   0xd348,0xd344,0xd340,0xd33d,0xd339,0xd335,0xd334,0xd330,0xd32c,0xd329,0xd325,0xd321,0xd320,0xd31c,0xd318,0xd315,
3471   0xd311,0xd30f,0xd30c,0xd308,0xd304,0xd301,0xd2fd,0xd2fb,0xd2f8,0xd2f4,0xd2f0,0xd2ed,0xd2eb,0xd2e7,0xd2e4,0xd2e0,
3472   0xd2dc,0xd2d9,0xd2d7,0xd2d3,0xd2d0,0xd2cc,0xd2c8,0xd2c6,0xd2c3,0xd2bf,0xd2bb,0xd2b8,0xd2b4,0xd2b2,0xd2af,0xd2ab,
3473   0xd2a7,0xd2a4,0xd2a0,0xd29e,0xd29b,0xd297,0xd293,0xd290,0xd28e,0xd28a,0xd287,0xd283,0xd27f,0xd27c,0xd27a,0xd276,
3474   0xd273,0xd26f,0xd26b,0xd26a,0xd266,0xd262,0xd25f,0xd25b,0xd257,0xd256,0xd252,0xd24e,0xd24b,0xd247,0xd245,0xd242,
3475   0xd23e,0xd23a,0xd237,0xd233,0xd231,0xd22e,0xd22a,0xd226,0xd223,0xd21f,0xd21d,0xd219,0xd216,0xd212,0xd20f,0xd20d,
3476   0xd209,0xd205,0xd202,0xd1fe,0xd1fb,0xd1f9,0xd1f5,0xd1f1,0xd1ee,0xd1ea,0xd1e8,0xd1e5,0xd1e1,0xd1dd,0xd1da,0xd1d6,
3477   0xd1d4,0xd1d1,0xd1cd,0xd1c9,0xd1c6,0xd1c4,0xd1c0,0xd1bd,0xd1b9,0xd1b5,0xd1b2,0xd1b0,0xd1ac,0xd1a9,0xd1a5,0xd1a1,
3478   0xd19e,0xd19a,0xd199,0xd195,0xd191,0xd18e,0xd18a,0xd188,0xd185,0xd181,0xd17d,0xd17a,0xd176,0xd174,0xd171,0xd16d,
3479   0xd169,0xd166,0xd164,0xd160,0xd15d,0xd159,0xd155,0xd152,0xd150,0xd14c,0xd149,0xd145,0xd141,0xd140,0xd13c,0xd138,
3480   0xd135,0xd131,0xd12d,0xd12c,0xd128,0xd124,0xd121,0xd11d,0xd11b,0xd118,0xd114,0xd110,0xd10d,0xd10b,0xd107,0xd104,
3481   0xd100,0xd0fc,0xd0f9,0xd0f7,0xd0f3,0xd0f0,0xd0ec,0xd0e8,0xd0e7,0xd0e3,0xd0df,0xd0dc,0xd0d8,0xd0d4,0xd0d3,0xd0cf,
3482   0xd0cb,0xd0c8,0xd0c4,0xd0c2,0xd0bf,0xd0bb,0xd0b7,0xd0b4,0xd0b0,0xd0ae,0xd0ab,0xd0a7,0xd0a3,0xd0a0,0xd09e,0xd09a,
3483   0xd097,0xd093,0xd08f,0xd08c,0xd08a,0xd086,0xd083,0xd07f,0xd07b,0xd07a,0xd076,0xd072,0xd06f,0xd06b,0xd069,0xd066,
3484   0xd062,0xd05e,0xd05b,0xd057,0xd055,0xd052,0xd04e,0xd04a,0xd047,0xd045,0xd041,0xd03e,0xd03a,0xd036,0xd033,0xd031,
3485   0xd02d,0xd02a,0xd026,0xd022,0xd021,0xd01d,0xd019,0xd016,0xd012,0xd00e,0xd00d,0xd009,0xd005,0xd002,0xcffe,0xcffc,
3486   0xcff8,0xcff4,0xcff2,0xcfef,0xcfeb,0xcfe8,0xcfe4,0xcfe2,0xcfde,0xcfdb,0xcfd7,0xcfd4,0xcfd2,0xcfce,0xcfcb,0xcfc7,
3487   0xcfc3,0xcfc2,0xcfbe,0xcfba,0xcfb7,0xcfb3,0xcfaf,0xcfae,0xcfaa,0xcfa6,0xcfa3,0xcf9f,0xcf9d,0xcf9a,0xcf96,0xcf92,
3488   0xcf8f,0xcf8d,0xcf89,0xcf86,0xcf82,0xcf7f,0xcf7d,0xcf79,0xcf76,0xcf72,0xcf6e,0xcf6b,0xcf69,0xcf65,0xcf62,0xcf5e,
3489   0xcf5a,0xcf59,0xcf55,0xcf51,0xcf4e,0xcf4a,0xcf48,0xcf45,0xcf41,0xcf3d,0xcf3a,0xcf38,0xcf34,0xcf31,0xcf2d,0xcf2a,
3490   0xcf28,0xcf24,0xcf21,0xcf1d,0xcf19,0xcf16,0xcf14,0xcf10,0xcf0d,0xcf09,0xcf05,0xcf04,0xcf00,0xcefc,0xcef9,0xcef5,
3491   0xcef3,0xcef0,0xceec,0xcee8,0xcee5,0xcee3,0xcedf,0xcedc,0xced8,0xced5,0xced1,0xcecf,0xcecc,0xcec8,0xcec4,0xcec1,
3492   0xcebf,0xcebb,0xceb8,0xceb4,0xceb0,0xceaf,0xceab,0xcea7,0xcea4,0xcea0,0xce9e,0xce9b,0xce97,0xce93,0xce90,0xce8c,
3493   0xce8a,0xce87,0xce83,0xce80,0xce7c,0xce7a,0xce77,0xce73,0xce6f,0xce6c,0xce6a,0xce66,0xce63,0xce5f,0xce5b,0xce5a,
3494   0xce57,0xce53,0xce4f,0xce4c,0xce48,0xce45,0xce43,0xce3f,0xce3c,0xce38,0xce34,0xce33,0xce2f,0xce2b,0xce28,0xce24,
3495   0xce22,0xce1f,0xce1b,0xce17,0xce14,0xce12,0xce0e,0xce0b,0xce07,0xce04,0xce02,0xcdfe,0xcdfb,0xcdf7,0xcdf3,0xcdf2,
3496   0xcdee,0xcdea,0xcde7,0xcde3,0xcde1,0xcdde,0xcdda,0xcdd6,0xcdd3,0xcdd1,0xcdcd,0xcdca,0xcdc6,0xcdc3,0xcdbf,0xcdbd,
3497   0xcdba,0xcdb6,0xcdb2,0xcdaf,0xcdad,0xcda9,0xcda6,0xcda2,0xcd9f,0xcd9d,0xcd99,0xcd96,0xcd92,0xcd8e,0xcd8d,0xcd89,
3498   0xcd85,0xcd82,0xcd7e,0xcd7c,0xcd79,0xcd75,0xcd71,0xcd6e,0xcd6c,0xcd68,0xcd65,0xcd61,0xcd5e,0xcd5c,0xcd58,0xcd55,
3499   0xcd51,0xcd4d,0xcd4c,0xcd48,0xcd44,0xcd41,0xcd3d,0xcd39,0xcd38,0xcd34,0xcd30,0xcd2d,0xcd29,0xcd27,0xcd24,0xcd20,
3500   0xcd1d,0xcd19,0xcd17,0xcd14,0xcd10,0xcd0c,0xcd09,0xcd07,0xcd03,0xcd00,0xccfc,0xccf9,0xccf7,0xccf3,0xccef,0xccec,
3501   0xcce8,0xcce6,0xcce3,0xccdf,0xccdc,0xccd8,0xccd6,0xccd3,0xcccf,0xcccb,0xccc8,0xccc6,0xccc2,0xccbf,0xccbb,0xccb8,
3502   0xccb5,0xccb2,0xccae,0xccad,0xcca9,0xcca5,0xcca2,0xcc9e,0xcc9c,0xcc99,0xcc95,0xcc92,0xcc8e,0xcc8c,0xcc89,0xcc85,
3503   0xcc81,0xcc7e,0xcc7c,0xcc78,0xcc75,0xcc71,0xcc6e,0xcc6c,0xcc68,0xcc65,0xcc61,0xcc5d,0xcc5c,0xcc58,0xcc54,0xcc51,
3504   0xcc4f,0xcc4b,0xcc48,0xcc44,0xcc41,0xcc3f,0xcc3b,0xcc38,0xcc34,0xcc31,0xcc2f,0xcc2b,0xcc28,0xcc24,0xcc20,0xcc1f,
3505   0xcc1b,0xcc17,0xcc14,0xcc10,0xcc0e,0xcc0b,0xcc07,0xcc04,0xcc00,0xcbfe,0xcbfb,0xcbf7,0xcbf3,0xcbf0,0xcbee,0xcbea,
3506   0xcbe7,0xcbe3,0xcbe0,0xcbde,0xcbda,0xcbd7,0xcbd3,0xcbcf,0xcbce,0xcbca,0xcbc7,0xcbc3,0xcbbf,0xcbbe,0xcbba,0xcbb6,
3507   0xcbb3,0xcbaf,0xcbad,0xcbaa,0xcba6,0xcba3,0xcb9f,0xcb9d,0xcb9a,0xcb96,0xcb92,0xcb8f,0xcb8d,0xcb89,0xcb86,0xcb82,
3508   0xcb80,0xcb7d,0xcb79,0xcb76,0xcb72,0xcb70,0xcb6d,0xcb69,0xcb65,0xcb62,0xcb60,0xcb5c,0xcb59,0xcb55,0xcb52,0xcb50,
3509   0xcb4c,0xcb49,0xcb45,0xcb42,0xcb40,0xcb3c,0xcb39,0xcb35,0xcb31,0xcb30,0xcb2c,0xcb28,0xcb25,0xcb21,0xcb1f,0xcb1c,
3510   0xcb19,0xcb15,0xcb12,0xcb0e,0xcb0b,0xcb09,0xcb05,0xcb02,0xcafe,0xcafa,0xcaf9,0xcaf5,0xcaf2,0xcaee,0xcaea,0xcae9,
3511   0xcae5,0xcae1,0xcade,0xcadc,0xcad8,0xcad5,0xcad1,0xcace,0xcacc,0xcac8,0xcac5,0xcac1,0xcabe,0xcabc,0xcab8,0xcab5,
3512   0xcab1,0xcaae,0xcaac,0xcaa8,0xcaa5,0xcaa1,0xca9f,0xca9c,0xca98,0xca94,0xca91,0xca8f,0xca8c,0xca88,0xca84,0xca81,
3513   0xca7f,0xca7b,0xca78,0xca74,0xca71,0xca6f,0xca6b,0xca68,0xca64,0xca62,0xca5f,0xca5b,0xca58,0xca54,0xca52,0xca4f,
3514   0xca4b,0xca48,0xca44,0xca42,0xca3f,0xca3b,0xca37,0xca34,0xca32,0xca2f,0xca2b,0xca27,0xca26,0xca22,0xca1e,0xca1b,
3515   0xca17,0xca15,0xca12,0xca0e,0xca0b,0xca07,0xca05,0xca02,0xc9fe,0xc9fb,0xc9f7,0xc9f5,0xc9f2,0xc9ee,0xc9eb,0xc9e9,
3516   0xc9e5,0xc9e2,0xc9de,0xc9da,0xc9d9,0xc9d5,0xc9d1,0xc9ce,0xc9ca,0xc9c9,0xc9c5,0xc9c1,0xc9be,0xc9ba,0xc9b8,0xc9b5,
3517   0xc9b1,0xc9ae,0xc9ac,0xc9a8,0xc9a5,0xc9a1,0xc99e,0xc99c,0xc998,0xc995,0xc991,0xc98e,0xc98c,0xc988,0xc985,0xc981,
3518   0xc97f,0xc97b,0xc978,0xc974,0xc972,0xc96f,0xc96b,0xc968,0xc964,0xc962,0xc95f,0xc95b,0xc957,0xc956,0xc952,0xc94f,
3519   0xc94b,0xc947,0xc946,0xc942,0xc93e,0xc93b,0xc937,0xc936,0xc932,0xc92e,0xc92b,0xc929,0xc925,0xc922,0xc91e,0xc91b,
3520   0xc919,0xc915,0xc912,0xc90e,0xc90b,0xc909,0xc905,0xc902,0xc8fe,0xc8fc,0xc8f9,0xc8f5,0xc8f2,0xc8ee,0xc8ec,0xc8e9,
3521   0xc8e5,0xc8e2,0xc8de,0xc8dc,0xc8d9,0xc8d5,0xc8d2,0xc8d0,0xc8cc,0xc8c9,0xc8c5,0xc8c2,0xc8c0,0xc8bc,0xc8b9,0xc8b5,
3522   0xc8b3,0xc8b0,0xc8ac,0xc8a9,0xc8a5,0xc8a3,0xc8a0,0xc89c,0xc898,0xc895,0xc893,0xc890,0xc88c,0xc888,0xc887,0xc883,
3523   0xc87f,0xc87c,0xc878,0xc877,0xc873,0xc86f,0xc86c,0xc868,0xc866,0xc863,0xc85f,0xc85c,0xc85a,0xc856,0xc853,0xc84f,
3524   0xc84c,0xc84a,0xc846,0xc843,0xc83f,0xc83c,0xc83a,0xc836,0xc833,0xc82f,0xc82d,0xc82a,0xc826,0xc823,0xc81f,0xc81d,
3525   0xc81a,0xc816,0xc813,0xc80f,0xc80d,0xc80a,0xc806,0xc803,0xc801,0xc7fd,0xc7fa,0xc7f6,0xc7f2,0xc7f1,0xc7ed,0xc7ea,
3526   0xc7e7,0xc7e4,0xc7e0,0xc7dc,0xc7db,0xc7d7,0xc7d4,0xc7d0,0xc7ce,0xc7cb,0xc7c7,0xc7c4,0xc7c0,0xc7be,0xc7bb,0xc7b7,
3527   0xc7b4,0xc7b2,0xc7ae,0xc7ab,0xc7a7,0xc7a4,0xc7a2,0xc79e,0xc79b,0xc797,0xc795,0xc792,0xc78e,0xc78b,0xc787,0xc785,
3528   0xc782,0xc77e,0xc77b,0xc779,0xc775,0xc772,0xc76e,0xc76b,0xc769,0xc765,0xc762,0xc75e,0xc75c,0xc759,0xc755,0xc752,
3529   0xc74e,0xc74c,0xc749,0xc745,0xc742,0xc740,0xc73c,0xc739,0xc735,0xc732,0xc730,0xc72c,0xc729,0xc725,0xc724,0xc720,
3530   0xc71c,0xc719,0xc715,0xc714,0xc710,0xc70c,0xc709,0xc707,0xc704,0xc700,0xc6fc,0xc6f9,0xc6f7,0xc6f4,0xc6f0,0xc6ec,
3531   0xc6eb,0xc6e7,0xc6e4,0xc6e0,0xc6dc,0xc6db,0xc6d7,0xc6d4,0xc6d0,0xc6ce,0xc6cb,0xc6c7,0xc6c4,0xc6c0,0xc6be,0xc6bb,
3532   0xc6b7,0xc6b4,0xc6b2,0xc6ae,0xc6ab,0xc6a7,0xc6a4,0xc6a2,0xc69e,0xc69b,0xc697,0xc695,0xc692,0xc68e,0xc68b,0xc687,
3533   0xc685,0xc682,0xc67e,0xc67b,0xc679,0xc675,0xc672,0xc66e,0xc66b,0xc669,0xc665,0xc662,0xc65e,0xc65c,0xc659,0xc655,
3534   0xc653,0xc650,0xc64c,0xc649,0xc645,0xc643,0xc640,0xc63c,0xc639,0xc637,0xc633,0xc630,0xc62c,0xc629,0xc627,0xc623,
3535   0xc620,0xc61c,0xc61b,0xc617,0xc614,0xc610,0xc60c,0xc60b,0xc607,0xc604,0xc600,0xc5fe,0xc5fb,0xc5f7,0xc5f4,0xc5f2,
3536   0xc5ee,0xc5eb,0xc5e7,0xc5e4,0xc5e2,0xc5de,0xc5db,0xc5d7,0xc5d5,0xc5d2,0xc5ce,0xc5cb,0xc5c7,0xc5c5,0xc5c2,0xc5be,
3537   0xc5bb,0xc5b9,0xc5b6,0xc5b2,0xc5ae,0xc5ad,0xc5a9,0xc5a6,0xc5a2,0xc59e,0xc59d,0xc599,0xc596,0xc592,0xc590,0xc58d,
3538   0xc589,0xc586,0xc582,0xc580,0xc57d,0xc579,0xc576,0xc574,0xc570,0xc56d,0xc569,0xc566,0xc564,0xc560,0xc55d,0xc559,
3539   0xc558,0xc554,0xc550,0xc54d,0xc54b,0xc548,0xc544,0xc540,0xc53d,0xc53b,0xc538,0xc534,0xc531,0xc52f,0xc52b,0xc528,
3540   0xc524,0xc521,0xc51f,0xc51b,0xc518,0xc514,0xc512,0xc50f,0xc50b,0xc508,0xc506,0xc502,0xc4ff,0xc4fb,0xc4f8,0xc4f6,
3541   0xc4f2,0xc4ef,0xc4eb,0xc4ea,0xc4e6,0xc4e2,0xc4df,0xc4db,0xc4da,0xc4d6,0xc4d3,0xc4cf,0xc4cd,0xc4ca,0xc4c6,0xc4c3,
3542   0xc4c0,0xc4bd,0xc4b9,0xc4b8,0xc4b4,0xc4b1,0xc4ad,0xc4ab,0xc4a8,0xc4a4,0xc4a1,0xc49f,0xc49b,0xc498,0xc494,0xc493,
3543   0xc48f,0xc48b,0xc488,0xc484,0xc483,0xc47f,0xc47c,0xc478,0xc476,0xc473,0xc46f,0xc46c,0xc46a,0xc466,0xc463,0xc45f,
3544   0xc45e,0xc45a,0xc457,0xc453,0xc44f,0xc44e,0xc44a,0xc447,0xc443,0xc441,0xc43e,0xc43a,0xc437,0xc435,0xc431,0xc42e,
3545   0xc42a,0xc427,0xc425,0xc422,0xc41e,0xc41a,0xc419,0xc415,0xc412,0xc40e,0xc40c,0xc409,0xc405,0xc402,0xc400,0xc3fc,
3546   0xc3f9,0xc3f5,0xc3f2,0xc3f0,0xc3ed,0xc3e9,0xc3e6,0xc3e4,0xc3e0,0xc3dd,0xc3d9,0xc3d7,0xc3d4,0xc3d0,0xc3cd,0xc3cb,
3547   0xc3c8,0xc3c4,0xc3c0,0xc3bd,0xc3bb,0xc3b8,0xc3b4,0xc3b1,0xc3af,0xc3ab,0xc3a8,0xc3a4,0xc3a2,0xc39f,0xc39b,0xc398,
3548   0xc396,0xc393,0xc38f,0xc38b,0xc388,0xc386,0xc383,0xc37f,0xc37c,0xc37a,0xc376,0xc373,0xc36f,0xc36d,0xc36a,0xc366,
3549   0xc363,0xc35f,0xc35e,0xc35a,0xc357,0xc353,0xc351,0xc34e,0xc34a,0xc347,0xc345,0xc341,0xc33e,0xc33a,0xc338,0xc335,
3550   0xc332,0xc32e,0xc32b,0xc327,0xc324,0xc322,0xc31f,0xc31b,0xc317,0xc316,0xc312,0xc30f,0xc30b,0xc309,0xc306,0xc302,
3551   0xc2ff,0xc2fd,0xc2fa,0xc2f6,0xc2f3,0xc2f1,0xc2ed,0xc2ea,0xc2e6,0xc2e5,0xc2e1,0xc2dd,0xc2da,0xc2d8,0xc2d5,0xc2d1,
3552   0xc2ce,0xc2ca,0xc2c8,0xc2c5,0xc2c1,0xc2be,0xc2bc,0xc2b9,0xc2b5,0xc2b2,0xc2b0,0xc2ac,0xc2a9,0xc2a5,0xc2a3,0xc2a0,
3553   0xc29c,0xc299,0xc297,0xc294,0xc290,0xc28d,0xc28b,0xc287,0xc284,0xc280,0xc27f,0xc27b,0xc278,0xc274,0xc272,0xc26f,
3554   0xc26b,0xc268,0xc264,0xc262,0xc25f,0xc25b,0xc258,0xc256,0xc253,0xc24f,0xc24c,0xc24a,0xc246,0xc243,0xc23f,0xc23e,
3555   0xc23a,0xc236,0xc233,0xc231,0xc22e,0xc22a,0xc227,0xc225,0xc221,0xc21e,0xc21a,0xc219,0xc215,0xc212,0xc20e,0xc20c,
3556   0xc209,0xc205,0xc202,0xc1fe,0xc1fc,0xc1f9,0xc1f5,0xc1f2,0xc1f0,0xc1ed,0xc1e9,0xc1e6,0xc1e4,0xc1e0,0xc1dd,0xc1d9,
3557   0xc1d8,0xc1d4,0xc1d1,0xc1cd,0xc1cb,0xc1c8,0xc1c4,0xc1c1,0xc1bf,0xc1bb,0xc1b8,0xc1b4,0xc1b3,0xc1af,0xc1ac,0xc1a8,
3558   0xc1a5,0xc1a1,0xc1a0,0xc19c,0xc199,0xc195,0xc193,0xc190,0xc18c,0xc189,0xc187,0xc184,0xc180,0xc17d,0xc17b,0xc177,
3559   0xc174,0xc170,0xc16e,0xc16b,0xc167,0xc164,0xc162,0xc15f,0xc15b,0xc158,0xc156,0xc152,0xc14f,0xc14b,0xc14a,0xc146,
3560   0xc143,0xc13f,0xc13d,0xc13a,0xc136,0xc133,0xc131,0xc12e,0xc12a,0xc127,0xc125,0xc121,0xc11e,0xc11a,0xc119,0xc115,
3561   0xc112,0xc10e,0xc10c,0xc109,0xc105,0xc102,0xc100,0xc0fc,0xc0f9,0xc0f5,0xc0f4,0xc0f0,0xc0ed,0xc0e9,0xc0e7,0xc0e4,
3562   0xc0e0,0xc0dd,0xc0d9,0xc0d8,0xc0d4,0xc0d1,0xc0cd,0xc0cb,0xc0c8,0xc0c4,0xc0c1,0xc0bf,0xc0bc,0xc0b8,0xc0b5,0xc0b3,
3563   0xc0af,0xc0ac,0xc0a8,0xc0a7,0xc0a3,0xc0a0,0xc09c,0xc09a,0xc097,0xc093,0xc090,0xc08e,0xc08a,0xc087,0xc083,0xc082,
3564   0xc07e,0xc07b,0xc077,0xc075,0xc072,0xc06e,0xc06b,0xc069,0xc066,0xc062,0xc05f,0xc05d,0xc059,0xc056,0xc052,0xc051,
3565   0xc04d,0xc04a,0xc046,0xc044,0xc041,0xc03d,0xc03a,0xc038,0xc035,0xc031,0xc02e,0xc02c,0xc028,0xc025,0xc021,0xc020,
3566   0xc01b,0xc019,0xc016,0xc012,0xc00f,0xc00d,0xc009,0xc006,0xc002,0xc001,0xbffd,0xbffa,0xbff6,0xbff4,0xbff1,0xbfed,
3567   0xbfea,0xbfe8,0xbfe5,0xbfe1,0xbfde,0xbfdc,0xbfd9,0xbfd5,0xbfd2,0xbfd0,0xbfcc,0xbfc9,0xbfc5,0xbfc4,0xbfc0,0xbfbd,
3568   0xbfb9,0xbfb7,0xbfb4,0xbfb0,0xbfad,0xbfab,0xbfa8,0xbfa4,0xbfa1,0xbf9f,0xbf9b,0xbf98,0xbf94,0xbf93,0xbf8f,0xbf8c,
3569   0xbf88,0xbf86,0xbf83,0xbf7f,0xbf7c,0xbf7a,0xbf77,0xbf73,0xbf70,0xbf6e,0xbf6b,0xbf67,0xbf64,0xbf62,0xbf5e,0xbf5b,
3570   0xbf59,0xbf56,0xbf52,0xbf4f,0xbf4d,0xbf49,0xbf46,0xbf42,0xbf41,0xbf3d,0xbf3a,0xbf36,0xbf34,0xbf31,0xbf2d,0xbf2a,
3571   0xbf28,0xbf25,0xbf21,0xbf1e,0xbf1c,0xbf18,0xbf15,0xbf11,0xbf10,0xbf0c,0xbf09,0xbf05,0xbf03,0xbf00,0xbefd,0xbef9,
3572   0xbef7,0xbef4,0xbef0,0xbeed,0xbeeb,0xbee8,0xbee4,0xbee1,0xbedf,0xbedb,0xbed8,0xbed4,0xbed3,0xbecf,0xbecc,0xbec8,
3573   0xbec6,0xbec3,0xbebf,0xbebc,0xbeba,0xbeb7,0xbeb3,0xbeb0,0xbeae,0xbeaa,0xbea7,0xbea3,0xbea2,0xbe9e,0xbe9b,0xbe97,
3574   0xbe96,0xbe92,0xbe8f,0xbe8b,0xbe8a,0xbe86,0xbe83,0xbe7f,0xbe7d,0xbe7a,0xbe76,0xbe73,0xbe71,0xbe6e,0xbe6a,0xbe67,
3575   0xbe65,0xbe62,0xbe5e,0xbe5b,0xbe59,0xbe55,0xbe52,0xbe4e,0xbe4d,0xbe49,0xbe46,0xbe42,0xbe40,0xbe3d,0xbe39,0xbe36,
3576   0xbe34,0xbe31,0xbe2d,0xbe2c,0xbe28,0xbe25,0xbe21,0xbe1f,0xbe1c,0xbe18,0xbe15,0xbe13,0xbe10,0xbe0c,0xbe09,0xbe07,
3577   0xbe03,0xbe00,0xbdfd,0xbdfb,0xbdf7,0xbdf4,0xbdf0,0xbdef,0xbdeb,0xbde8,0xbde4,0xbde2,0xbddf,0xbddb,0xbdd8,0xbdd6,
3578   0xbdd3,0xbdcf,0xbdcd,0xbdca,0xbdc7,0xbdc3,0xbdc1,0xbdbe,0xbdba,0xbdb7,0xbdb5,0xbdb2,0xbdae,0xbdab,0xbda9,0xbda5,
3579   0xbda2,0xbd9e,0xbd9d,0xbd99,0xbd96,0xbd92,0xbd91,0xbd8d,0xbd8a,0xbd86,0xbd84,0xbd81,0xbd7d,0xbd7a,0xbd78,0xbd75,
3580   0xbd71,0xbd6f,0xbd6c,0xbd68,0xbd65,0xbd63,0xbd60,0xbd5c,0xbd59,0xbd57,0xbd54,0xbd50,0xbd4d,0xbd4b,0xbd47,0xbd44,
3581   0xbd40,0xbd3f,0xbd3b,0xbd38,0xbd34,0xbd32,0xbd2f,0xbd2b,0xbd28,0xbd26,0xbd23,0xbd1f,0xbd1c,0xbd1a,0xbd17,0xbd13,
3582   0xbd10,0xbd0d,0xbd0b,0xbd08,0xbd04,0xbd01,0xbcff,0xbcfb,0xbcf8,0xbcf5,0xbcf3,0xbcef,0xbcec,0xbce8,0xbce7,0xbce3,
3583   0xbce0,0xbcde,0xbcdb,0xbcd7,0xbcd4,0xbcd2,0xbcce,0xbccb,0xbcc7,0xbcc6,0xbcc2,0xbcbf,0xbcbb,0xbcba,0xbcb6,0xbcb3,
3584   0xbcb1,0xbcad,0xbcaa,0xbca7,0xbca5,0xbca1,0xbc9e,0xbc9a,0xbc99,0xbc95,0xbc92,0xbc8e,0xbc8c,0xbc89,0xbc86,0xbc82,
3585   0xbc80,0xbc7d,0xbc79,0xbc78,0xbc74,0xbc71,0xbc6d,0xbc6c,0xbc68,0xbc65,0xbc61,0xbc5f,0xbc5c,0xbc58,0xbc55,0xbc53,
3586   0xbc50,0xbc4c,0xbc4b,0xbc47,0xbc44,0xbc40,0xbc3e,0xbc3b,0xbc38,0xbc34,0xbc32,0xbc2f,0xbc2b,0xbc28,0xbc26,0xbc23,
3587   0xbc1f,0xbc1d,0xbc1a,0xbc17,0xbc13,0xbc11,0xbc0e,0xbc0a,0xbc07,0xbc05,0xbc02,0xbbfe,0xbbfb,0xbbf9,0xbbf6,0xbbf2,
3588   0xbbf0,0xbbed,0xbbe9,0xbbe6,0xbbe4,0xbbe1,0xbbdd,0xbbda,0xbbd8,0xbbd5,0xbbd1,0xbbce,0xbbcc,0xbbc9,0xbbc5,0xbbc2,
3589   0xbbc0,0xbbbc,0xbbb9,0xbbb7,0xbbb4,0xbbb0,0xbbad,0xbbab,0xbba8,0xbba4,0xbba1,0xbb9f,0xbb9b,0xbb98,0xbb94,0xbb93,
3590   0xbb90,0xbb8c,0xbb89,0xbb87,0xbb84,0xbb80,0xbb7d,0xbb7b,0xbb77,0xbb74,0xbb70,0xbb6f,0xbb6b,0xbb68,0xbb66,0xbb63,
3591   0xbb5f,0xbb5c,0xbb5a,0xbb57,0xbb53,0xbb50,0xbb4e,0xbb4a,0xbb47,0xbb43,0xbb42,0xbb3e,0xbb3b,0xbb39,0xbb36,0xbb32,
3592   0xbb2f,0xbb2d,0xbb2a,0xbb26,0xbb23,0xbb21,0xbb1d,0xbb1a,0xbb18,0xbb15,0xbb11,0xbb0e,0xbb0c,0xbb09,0xbb05,0xbb02,
3593   0xbb00,0xbafd,0xbaf9,0xbaf6,0xbaf4,0xbaf0,0xbaed,0xbaeb,0xbae8,0xbae4,0xbae1,0xbadf,0xbadc,0xbad8,0xbad5,0xbad3,
3594   0xbad0,0xbacc,0xbaca,0xbac7,0xbac3,0xbac0,0xbabe,0xbabb,0xbab7,0xbab4,0xbab2,0xbaaf,0xbaab,0xbaa9,0xbaa6,0xbaa3,
3595   0xba9f,0xba9d,0xba9a,0xba96,0xba93,0xba91,0xba8e,0xba8a,0xba87,0xba85,0xba82,0xba7e,0xba7c,0xba79,0xba76,0xba72,
3596   0xba70,0xba6d,0xba69,0xba66,0xba64,0xba61,0xba5d,0xba5c,0xba58,0xba55,0xba51,0xba4f,0xba4c,0xba49,0xba45,0xba43,
3597   0xba40,0xba3c,0xba39,0xba37,0xba34,0xba30,0xba2f,0xba2b,0xba28,0xba24,0xba23,0xba1f,0xba1c,0xba18,0xba16,0xba13,
3598   0xba10,0xba0d,0xba09,0xba08,0xba04,0xba01,0xb9fd,0xb9fc,0xb9f8,0xb9f5,0xb9f3,0xb9ef,0xb9ec,0xb9e9,0xb9e7,0xb9e3,
3599   0xb9e0,0xb9dd,0xb9db,0xb9d7,0xb9d4,0xb9d2,0xb9cf,0xb9cb,0xb9c8,0xb9c6,0xb9c3,0xb9bf,0xb9bd,0xb9ba,0xb9b7,0xb9b3,
3600   0xb9b1,0xb9ae,0xb9ab,0xb9a7,0xb9a5,0xb9a2,0xb99e,0xb99d,0xb999,0xb996,0xb992,0xb991,0xb98d,0xb98a,0xb988,0xb985,
3601   0xb981,0xb97e,0xb97c,0xb979,0xb975,0xb972,0xb970,0xb96d,0xb969,0xb967,0xb964,0xb960,0xb95d,0xb95b,0xb958,0xb954,
3602   0xb953,0xb94f,0xb94c,0xb948,0xb947,0xb943,0xb940,0xb93c,0xb93b,0xb937,0xb934,0xb932,0xb92f,0xb92b,0xb928,0xb926,
3603   0xb922,0xb91f,0xb91c,0xb91a,0xb916,0xb913,0xb911,0xb90e,0xb90a,0xb907,0xb905,0xb902,0xb8fe,0xb8fd,0xb8f9,0xb8f6,
3604   0xb8f2,0xb8f0,0xb8ed,0xb8ea,0xb8e6,0xb8e4,0xb8e1,0xb8de,0xb8dc,0xb8d8,0xb8d5,0xb8d1,0xb8d0,0xb8cc,0xb8c9,0xb8c7,
3605   0xb8c4,0xb8c0,0xb8bd,0xb8bb,0xb8b8,0xb8b4,0xb8b1,0xb8af,0xb8ac,0xb8a8,0xb8a6,0xb8a3,0xb8a0,0xb89c,0xb89a,0xb897,
3606   0xb894,0xb890,0xb88f,0xb88b,0xb888,0xb884,0xb883,0xb87f,0xb87c,0xb87a,0xb877,0xb873,0xb870,0xb86e,0xb86b,0xb867,
3607   0xb865,0xb862,0xb85f,0xb85b,0xb859,0xb856,0xb853,0xb84f,0xb84d,0xb84a,0xb846,0xb845,0xb841,0xb83e,0xb83a,0xb839,
3608   0xb835,0xb832,0xb830,0xb82d,0xb829,0xb826,0xb824,0xb821,0xb81d,0xb81c,0xb818,0xb815,0xb811,0xb80f,0xb80c,0xb809,
3609   0xb807,0xb803,0xb800,0xb7fd,0xb7fb,0xb7f7,0xb7f4,0xb7f1,0xb7ef,0xb7eb,0xb7e8,0xb7e6,0xb7e3,0xb7df,0xb7dc,0xb7da,
3610   0xb7d7,0xb7d3,0xb7d2,0xb7ce,0xb7cb,0xb7c7,0xb7c6,0xb7c2,0xb7bf,0xb7bd,0xb7ba,0xb7b6,0xb7b3,0xb7b1,0xb7ae,0xb7aa,
3611   0xb7a8,0xb7a5,0xb7a1,0xb79e,0xb79c,0xb799,0xb795,0xb792,0xb790,0xb78d,0xb789,0xb788,0xb784,0xb781,0xb77d,0xb77c,
3612   0xb778,0xb775,0xb773,0xb770,0xb76c,0xb769,0xb767,0xb764,0xb760,0xb75e,0xb75b,0xb758,0xb754,0xb752,0xb74f,0xb74c,
3613   0xb74a,0xb746,0xb743,0xb740,0xb73e,0xb73a,0xb737,0xb733,0xb732,0xb72e,0xb72b,0xb729,0xb726,0xb722,0xb71f,0xb71d,
3614   0xb71a,0xb717,0xb713,0xb710,0xb70e,0xb70b,0xb707,0xb706,0xb702,0xb6ff,0xb6fc,0xb6fa,0xb6f6,0xb6f3,0xb6f1,0xb6ee,
3615   0xb6ea,0xb6e7,0xb6e5,0xb6e2,0xb6de,0xb6dd,0xb6d9,0xb6d6,0xb6d2,0xb6d1,0xb6cd,0xb6ca,0xb6c8,0xb6c5,0xb6c1,0xb6be,
3616   0xb6bc,0xb6b9,0xb6b5,0xb6b4,0xb6b0,0xb6ad,0xb6a9,0xb6a8,0xb6a4,0xb6a1,0xb69f,0xb69c,0xb698,0xb697,0xb693,0xb690,
3617   0xb68c,0xb68b,0xb687,0xb684,0xb682,0xb67f,0xb67b,0xb678,0xb676,0xb673,0xb66f,0xb66e,0xb66a,0xb667,0xb663,0xb662,
3618   0xb65e,0xb65b,0xb659,0xb656,0xb652,0xb64f,0xb64d,0xb64a,0xb646,0xb644,0xb641,0xb63e,0xb63a,0xb638,0xb635,0xb632,
3619   0xb630,0xb62c,0xb629,0xb626,0xb624,0xb621,0xb61d,0xb61b,0xb618,0xb615,0xb613,0xb60f,0xb60c,0xb609,0xb607,0xb603,
3620   0xb600,0xb5fe,0xb5fb,0xb5f7,0xb5f4,0xb5f2,0xb5ef,0xb5eb,0xb5ea,0xb5e6,0xb5e3,0xb5df,0xb5de,0xb5da,0xb5d7,0xb5d5,
3621   0xb5d2,0xb5ce,0xb5cb,0xb5c9,0xb5c6,0xb5c2,0xb5c1,0xb5bd,0xb5ba,0xb5b6,0xb5b5,0xb5b1,0xb5ae,0xb5ac,0xb5a9,0xb5a5,
3622   0xb5a2,0xb5a0,0xb59d,0xb59a,0xb596,0xb595,0xb591,0xb58e,0xb58c,0xb589,0xb585,0xb582,0xb580,0xb57d,0xb579,0xb577,
3623   0xb574,0xb571,0xb56f,0xb56c,0xb568,0xb565,0xb563,0xb560,0xb55c,0xb55a,0xb557,0xb554,0xb550,0xb54f,0xb54b,0xb548,
3624   0xb546,0xb543,0xb53f,0xb53d,0xb53a,0xb537,0xb533,0xb532,0xb52e,0xb52b,0xb529,0xb526,0xb522,0xb51f,0xb51d,0xb51a,
3625   0xb516,0xb514,0xb511,0xb50e,0xb50a,0xb509,0xb505,0xb502,0xb500,0xb4fd,0xb4f9,0xb4f7,0xb4f4,0xb4f1,0xb4ed,0xb4ec,
3626   0xb4e8,0xb4e5,0xb4e3,0xb4e0,0xb4dc,0xb4d9,0xb4d7,0xb4d4,0xb4d0,0xb4ce,0xb4cb,0xb4c8,0xb4c6,0xb4c3,0xb4bf,0xb4bc,
3627   0xb4ba,0xb4b7,0xb4b3,0xb4b1,0xb4ae,0xb4ab,0xb4a7,0xb4a6,0xb4a2,0xb49f,0xb49d,0xb49a,0xb496,0xb493,0xb491,0xb48e,
3628   0xb48a,0xb489,0xb485,0xb482,0xb480,0xb47d,0xb479,0xb476,0xb474,0xb471,0xb46d,0xb46b,0xb468,0xb465,0xb461,0xb460,
3629   0xb45c,0xb459,0xb457,0xb454,0xb450,0xb44e,0xb44b,0xb448,0xb444,0xb443,0xb43f,0xb43c,0xb43a,0xb437,0xb433,0xb430,
3630   0xb42d,0xb42b,0xb428,0xb424,0xb421,0xb41f,0xb41c,0xb418,0xb417,0xb413,0xb410,0xb40e,0xb40b,0xb407,0xb404,0xb402,
3631   0xb3ff,0xb3fb,0xb3fa,0xb3f6,0xb3f3,0xb3f1,0xb3ee,0xb3ea,0xb3e7,0xb3e5,0xb3e2,0xb3df,0xb3dd,0xb3da,0xb3d6,0xb3d4,
3632   0xb3d1,0xb3ce,0xb3ca,0xb3c9,0xb3c5,0xb3c2,0xb3c0,0xb3bd,0xb3b9,0xb3b8,0xb3b4,0xb3b1,0xb3ad,0xb3ac,0xb3a8,0xb3a5,
3633   0xb3a3,0xb3a0,0xb39c,0xb39b,0xb397,0xb394,0xb390,0xb38f,0xb38b,0xb388,0xb386,0xb383,0xb37f,0xb37e,0xb37a,0xb377,
3634   0xb375,0xb372,0xb36e,0xb36b,0xb369,0xb366,0xb363,0xb361,0xb35d,0xb35a,0xb358,0xb355,0xb352,0xb34e,0xb34c,0xb349,
3635   0xb346,0xb344,0xb341,0xb33d,0xb33b,0xb338,0xb335,0xb331,0xb330,0xb32c,0xb329,0xb327,0xb324,0xb320,0xb31f,0xb31b,
3636   0xb318,0xb314,0xb313,0xb30f,0xb30c,0xb30a,0xb307,0xb303,0xb302,0xb2fe,0xb2fb,0xb2f8,0xb2f6,0xb2f2,0xb2ef,0xb2ed,
3637   0xb2ea,0xb2e7,0xb2e5,0xb2e1,0xb2de,0xb2db,0xb2d9,0xb2d6,0xb2d2,0xb2d0,0xb2cd,0xb2ca,0xb2c8,0xb2c5,0xb2c1,0xb2be,
3638   0xb2bc,0xb2b9,0xb2b5,0xb2b2,0xb2b0,0xb2ad,0xb2aa,0xb2a8,0xb2a4,0xb2a1,0xb29f,0xb29c,0xb299,0xb295,0xb293,0xb290,
3639   0xb28d,0xb28b,0xb288,0xb284,0xb283,0xb27f,0xb27c,0xb27a,0xb277,0xb273,0xb270,0xb26e,0xb26b,0xb267,0xb266,0xb262,
3640   0xb25f,0xb25d,0xb25a,0xb256,0xb253,0xb251,0xb24e,0xb24b,0xb249,0xb246,0xb242,0xb240,0xb23d,0xb23a,0xb238,0xb235,
3641   0xb231,0xb22e,0xb22c,0xb229,0xb225,0xb224,0xb220,0xb21d,0xb21b,0xb218,0xb214,0xb211,0xb20f,0xb20c,0xb208,0xb207,
3642   0xb203,0xb200,0xb1fe,0xb1fb,0xb1f8,0xb1f6,0xb1f2,0xb1ef,0xb1ec,0xb1ea,0xb1e7,0xb1e3,0xb1e1,0xb1de,0xb1db,0xb1d9,
3643   0xb1d6,0xb1d2,0xb1cf,0xb1cd,0xb1ca,0xb1c6,0xb1c5,0xb1c1,0xb1be,0xb1bc,0xb1b9,0xb1b5,0xb1b4,0xb1b0,0xb1ad,0xb1aa,
3644   0xb1a8,0xb1a4,0xb1a1,0xb19f,0xb19c,0xb199,0xb197,0xb194,0xb190,0xb18d,0xb18b,0xb188,0xb184,0xb183,0xb17f,0xb17c,
3645   0xb17a,0xb177,0xb173,0xb172,0xb16e,0xb16b,0xb167,0xb166,0xb162,0xb15f,0xb15d,0xb15a,0xb156,0xb155,0xb151,0xb14e,
3646   0xb14c,0xb149,0xb145,0xb144,0xb140,0xb13d,0xb13b,0xb138,0xb134,0xb133,0xb12f,0xb12c,0xb129,0xb127,0xb124,0xb120,
3647   0xb11e,0xb11b,0xb118,0xb116,0xb113,0xb10f,0xb10e,0xb10a,0xb107,0xb103,0xb102,0xb0fe,0xb0fb,0xb0f9,0xb0f6,0xb0f2,
3648   0xb0f1,0xb0ed,0xb0ea,0xb0e8,0xb0e5,0xb0e2,0xb0de,0xb0dc,0xb0d9,0xb0d6,0xb0d4,0xb0d1,0xb0cd,0xb0cc,0xb0c8,0xb0c5,
3649   0xb0c3,0xb0c0,0xb0bc,0xb0b9,0xb0b7,0xb0b4,0xb0b1,0xb0af,0xb0ab,0xb0a8,0xb0a6,0xb0a3,0xb0a0,0xb09e,0xb09b,0xb097,
3650   0xb095,0xb092,0xb08f,0xb08b,0xb08a,0xb086,0xb083,0xb081,0xb07e,0xb07a,0xb079,0xb075,0xb072,0xb070,0xb06d,0xb069,
3651   0xb066,0xb064,0xb061,0xb05e,0xb05c,0xb059,0xb055,0xb053,0xb050,0xb04d,0xb04b,0xb048,0xb044,0xb041,0xb03f,0xb03c,
3652   0xb038,0xb037,0xb033,0xb030,0xb02e,0xb02b,0xb028,0xb026,0xb022,0xb01f,0xb01c,0xb01a,0xb017,0xb013,0xb012,0xb00e,
3653   0xb00b,0xb009,0xb006,0xb002,0xb001,0xaffd,0xaffa,0xaff6,0xaff5,0xaff1,0xafee,0xafec,0xafe9,0xafe6,0xafe4,0xafe0,
3654   0xafde,0xafdb,0xafd8,0xafd6,0xafd2,0xafcf,0xafcd,0xafca,0xafc7,0xafc5,0xafc2,0xafbe,0xafbd,0xafb9,0xafb6,0xafb2,
3655   0xafb1,0xafad,0xafaa,0xafa8,0xafa5,0xafa2,0xafa0,0xaf9d,0xaf99,0xaf98,0xaf94,0xaf91,0xaf8f,0xaf8c,0xaf88,0xaf87,
3656   0xaf83,0xaf80,0xaf7e,0xaf7b,0xaf78,0xaf74,0xaf72,0xaf6f,0xaf6c,0xaf6a,0xaf67,0xaf63,0xaf62,0xaf5e,0xaf5b,0xaf59,
3657   0xaf56,0xaf52,0xaf51,0xaf4d,0xaf4a,0xaf48,0xaf45,0xaf42,0xaf3e,0xaf3d,0xaf39,0xaf36,0xaf34,0xaf31,0xaf2d,0xaf2c,
3658   0xaf28,0xaf25,0xaf23,0xaf20,0xaf1d,0xaf1b,0xaf18,0xaf14,0xaf13,0xaf0f,0xaf0c,0xaf08,0xaf07,0xaf03,0xaf00,0xaefe,
3659   0xaefb,0xaef8,0xaef6,0xaef3,0xaeef,0xaeed,0xaeea,0xaee7,0xaee5,0xaee2,0xaede,0xaedd,0xaed9,0xaed6,0xaed3,0xaed1,
3660   0xaecd,0xaeca,0xaec8,0xaec5,0xaec2,0xaec0,0xaebd,0xaeb9,0xaeb8,0xaeb4,0xaeb1,0xaeaf,0xaeac,0xaea8,0xaea7,0xaea3,
3661   0xaea0,0xae9e,0xae9b,0xae98,0xae94,0xae93,0xae8f,0xae8c,0xae8a,0xae87,0xae83,0xae82,0xae7e,0xae7b,0xae79,0xae76,
3662   0xae74,0xae71,0xae6d,0xae6a,0xae68,0xae65,0xae61,0xae60,0xae5c,0xae59,0xae57,0xae54,0xae51,0xae4f,0xae4c,0xae48,
3663   0xae47,0xae43,0xae40,0xae3e,0xae3b,0xae37,0xae36,0xae32,0xae2f,0xae2d,0xae2a,0xae27,0xae23,0xae22,0xae1e,0xae1b,
3664   0xae19,0xae16,0xae12,0xae11,0xae0d,0xae0a,0xae08,0xae05,0xae02,0xae00,0xadfd,0xadf9,0xadf8,0xadf4,0xadf1,0xadef,
3665   0xadec,0xade8,0xade7,0xade3,0xade0,0xaddd,0xaddb,0xadd8,0xadd4,0xadd3,0xadcf,0xadcc,0xadca,0xadc7,0xadc4,0xadc2,
3666   0xadbe,0xadbb,0xadb9,0xadb6,0xadb3,0xadb1,0xadae,0xadaa,0xada9,0xada5,0xada2,0xada0,0xad9d,0xad9a,0xad96,0xad95,
3667   0xad91,0xad8e,0xad8c,0xad89,0xad85,0xad84,0xad80,0xad7d,0xad7b,0xad78,0xad75,0xad73,0xad70,0xad6c,0xad6b,0xad67,
3668   0xad64,0xad62,0xad5f,0xad5b,0xad5a,0xad56,0xad53,0xad50,0xad4e,0xad4b,0xad47,0xad46,0xad42,0xad3f,0xad3d,0xad3a,
3669   0xad36,0xad35,0xad31,0xad2e,0xad2c,0xad29,0xad26,0xad24,0xad21,0xad1d,0xad1c,0xad18,0xad15,0xad13,0xad10,0xad0c,
3670   0xad0a,0xad06,0xad05,0xad01,0xacfe,0xacfc,0xacf9,0xacf6,0xacf4,0xacf1,0xaced,0xacec,0xace8,0xace5,0xace3,0xace0,
3671   0xacdd,0xacdb,0xacd8,0xacd4,0xacd3,0xaccf,0xaccc,0xacca,0xacc7,0xacc4,0xacc2,0xacbf,0xacbb,0xacba,0xacb6,0xacb3,
3672   0xacb1,0xacae,0xacab,0xaca7,0xaca6,0xaca2,0xac9f,0xac9d,0xac9a,0xac96,0xac95,0xac91,0xac8e,0xac8c,0xac89,0xac86,
3673   0xac84,0xac81,0xac7d,0xac7c,0xac78,0xac75,0xac73,0xac70,0xac6d,0xac6b,0xac68,0xac64,0xac63,0xac5f,0xac5c,0xac5a,
3674   0xac57,0xac54,0xac52,0xac4f,0xac4b,0xac4a,0xac46,0xac43,0xac41,0xac3e,0xac3b,0xac39,0xac36,0xac32,0xac30,0xac2d,
3675   0xac2a,0xac28,0xac25,0xac21,0xac20,0xac1c,0xac19,0xac17,0xac14,0xac11,0xac0f,0xac0c,0xac08,0xac07,0xac03,0xac00,
3676   0xabfe,0xabfb,0xabf8,0xabf4,0xabf3,0xabef,0xabec,0xabea,0xabe7,0xabe4,0xabe2,0xabdf,0xabdb,0xabda,0xabd6,0xabd3,
3677   0xabd1,0xabce,0xabcb,0xabc9,0xabc5,0xabc2,0xabc0,0xabbd,0xabba,0xabb8,0xabb5,0xabb1,0xabb0,0xabac,0xaba9,0xaba7,
3678   0xaba3,0xaba2,0xab9e,0xab9b,0xab99,0xab96,0xab93,0xab91,0xab8e,0xab8a,0xab89,0xab85,0xab82,0xab80,0xab7d,0xab7a,
3679   0xab78,0xab75,0xab71,0xab70,0xab6c,0xab69,0xab67,0xab64,0xab61,0xab5f,0xab5c,0xab58,0xab57,0xab53,0xab50,0xab4e,
3680   0xab4b,0xab48,0xab46,0xab43,0xab3f,0xab3e,0xab3a,0xab37,0xab35,0xab32,0xab2f,0xab2d,0xab2a,0xab26,0xab25,0xab21,
3681   0xab1e,0xab1c,0xab19,0xab16,0xab14,0xab11,0xab0d,0xab0c,0xab08,0xab05,0xab03,0xab00,0xaafd,0xaafb,0xaaf8,0xaaf4,
3682   0xaaf3,0xaaef,0xaaec,0xaae9,0xaae7,0xaae4,0xaae0,0xaadf,0xaadb,0xaad8,0xaad6,0xaad3,0xaad0,0xaace,0xaacb,0xaac7,
3683   0xaac6,0xaac2,0xaabf,0xaabd,0xaaba,0xaab7,0xaab5,0xaab2,0xaaae,0xaaad,0xaaa9,0xaaa6,0xaaa4,0xaaa1,0xaa9e,0xaa9c,
3684   0xaa99,0xaa95,0xaa94,0xaa90,0xaa8d,0xaa8b,0xaa88,0xaa85,0xaa83,0xaa80,0xaa7c,0xaa7b,0xaa77,0xaa74,0xaa72,0xaa6f,
3685   0xaa6c,0xaa6a,0xaa67,0xaa63,0xaa62,0xaa5e,0xaa5b,0xaa59,0xaa56,0xaa53,0xaa51,0xaa4e,0xaa4a,0xaa49,0xaa45,0xaa42,
3686   0xaa41,0xaa3e,0xaa3a,0xaa39,0xaa35,0xaa32,0xaa30,0xaa2d,0xaa2a,0xaa28,0xaa25,0xaa21,0xaa20,0xaa1c,0xaa19,0xaa17,
3687   0xaa14,0xaa11,0xaa0f,0xaa0c,0xaa08,0xaa07,0xaa03,0xaa00,0xa9fe,0xa9fb,0xa9f8,0xa9f6,0xa9f3,0xa9ef,0xa9ee,0xa9ea,
3688   0xa9e7,0xa9e5,0xa9e2,0xa9df,0xa9dd,0xa9da,0xa9d6,0xa9d5,0xa9d1,0xa9ce,0xa9cc,0xa9c9,0xa9c6,0xa9c4,0xa9c1,0xa9bd,
3689   0xa9bc,0xa9b8,0xa9b5,0xa9b3,0xa9b0,0xa9ad,0xa9ab,0xa9a8,0xa9a4,0xa9a3,0xa99f,0xa99c,0xa99a,0xa997,0xa994,0xa992,
3690   0xa98f,0xa98c,0xa98a,0xa987,0xa983,0xa982,0xa97e,0xa97b,0xa979,0xa976,0xa973,0xa971,0xa96e,0xa96a,0xa969,0xa965,
3691   0xa962,0xa960,0xa95d,0xa95a,0xa958,0xa955,0xa951,0xa950,0xa94c,0xa949,0xa947,0xa944,0xa941,0xa93f,0xa93c,0xa938,
3692   0xa937,0xa933,0xa930,0xa92e,0xa92b,0xa928,0xa926,0xa923,0xa91f,0xa91e,0xa91a,0xa917,0xa915,0xa912,0xa90f,0xa90d,
3693   0xa90a,0xa906,0xa905,0xa901,0xa8fe,0xa8fc,0xa8f9,0xa8f6,0xa8f4,0xa8f1,0xa8ed,0xa8ec,0xa8e8,0xa8e5,0xa8e3,0xa8e0,
3694   0xa8de,0xa8db,0xa8d9,0xa8d6,0xa8d2,0xa8d1,0xa8cd,0xa8ca,0xa8c8,0xa8c5,0xa8c2,0xa8c0,0xa8bd,0xa8ba,0xa8b8,0xa8b5,
3695   0xa8b3,0xa8b0,0xa8ac,0xa8ab,0xa8a7,0xa8a4,0xa8a2,0xa89f,0xa89c,0xa89a,0xa897,0xa893,0xa892,0xa88e,0xa88b,0xa889,
3696   0xa886,0xa883,0xa881,0xa87e,0xa87b,0xa879,0xa876,0xa872,0xa871,0xa86d,0xa86a,0xa868,0xa865,0xa862,0xa860,0xa85d,
3697   0xa85b,0xa858,0xa854,0xa853,0xa850,0xa84c,0xa84b,0xa847,0xa844,0xa842,0xa83f,0xa83c,0xa83a,0xa837,0xa833,0xa832,
3698   0xa82e,0xa82b,0xa829,0xa826,0xa823,0xa821,0xa81e,0xa81b,0xa819,0xa816,0xa812,0xa811,0xa80d,0xa80a,0xa808,0xa805,
3699   0xa803,0xa800,0xa7fd,0xa7fb,0xa7f8,0xa7f4,0xa7f3,0xa7ef,0xa7ec,0xa7ea,0xa7e7,0xa7e4,0xa7e2,0xa7df,0xa7dc,0xa7da,
3700   0xa7d7,0xa7d3,0xa7d2,0xa7ce,0xa7cb,0xa7c9,0xa7c6,0xa7c3,0xa7c1,0xa7be,0xa7ba,0xa7b9,0xa7b5,0xa7b2,0xa7b1,0xa7ad,
3701   0xa7ac,0xa7a8,0xa7a5,0xa7a3,0xa7a0,0xa79d,0xa79b,0xa798,0xa794,0xa793,0xa78f,0xa78c,0xa78a,0xa787,0xa784,0xa782,
3702   0xa77f,0xa77c,0xa779,0xa777,0xa774,0xa770,0xa76f,0xa76b,0xa76a,0xa766,0xa763,0xa761,0xa75e,0xa75b,0xa759,0xa756,
3703   0xa753,0xa751,0xa74e,0xa74a,0xa749,0xa745,0xa742,0xa740,0xa73d,0xa73a,0xa738,0xa735,0xa732,0xa730,0xa72d,0xa72b,
3704   0xa728,0xa724,0xa723,0xa71f,0xa71c,0xa71a,0xa717,0xa714,0xa712,0xa70f,0xa70c,0xa70a,0xa707,0xa703,0xa702,0xa6fe,
3705   0xa6fb,0xa6f9,0xa6f6,0xa6f3,0xa6f1,0xa6ee,0xa6ec,0xa6e9,0xa6e6,0xa6e4,0xa6e1,0xa6dd,0xa6dc,0xa6d8,0xa6d5,0xa6d3,
3706   0xa6d0,0xa6cd,0xa6cb,0xa6c8,0xa6c5,0xa6c3,0xa6c0,0xa6bc,0xa6bb,0xa6b7,0xa6b4,0xa6b2,0xa6af,0xa6ad,0xa6aa,0xa6a7,
3707   0xa6a5,0xa6a2,0xa69f,0xa69d,0xa69a,0xa696,0xa695,0xa691,0xa68e,0xa68c,0xa689,0xa686,0xa684,0xa681,0xa67d,0xa67c,
3708   0xa679,0xa675,0xa674,0xa670,0xa66f,0xa66b,0xa668,0xa666,0xa663,0xa660,0xa65e,0xa65b,0xa657,0xa656,0xa653,0xa64f,
3709   0xa64e,0xa64a,0xa647,0xa645,0xa642,0xa63f,0xa63d,0xa63a,0xa636,0xa635,0xa631,0xa630,0xa62d,0xa629,0xa628,0xa624,
3710   0xa621,0xa61e,0xa61b,0xa619,0xa616,0xa614,0xa611,0xa60e,0xa60c,0xa609,0xa605,0xa604,0xa601,0xa5fd,0xa5fc,0xa5f8,
3711   0xa5f5,0xa5f3,0xa5f0,0xa5ee,0xa5eb,0xa5e8,0xa5e6,0xa5e3,0xa5e0,0xa5de,0xa5db,0xa5d7,0xa5d6,0xa5d3,0xa5cf,0xa5ce,
3712   0xa5ca,0xa5c7,0xa5c5,0xa5c2,0xa5c0,0xa5bd,0xa5ba,0xa5b8,0xa5b5,0xa5b2,0xa5b0,0xa5ad,0xa5a9,0xa5a8,0xa5a4,0xa5a1,
3713   0xa5a0,0xa59c,0xa59b,0xa597,0xa594,0xa592,0xa58f,0xa58c,0xa58a,0xa587,0xa584,0xa582,0xa57f,0xa57b,0xa57a,0xa576,
3714   0xa575,0xa571,0xa56e,0xa56d,0xa569,0xa566,0xa564,0xa561,0xa55e,0xa55c,0xa559,0xa556,0xa554,0xa551,0xa54d,0xa54c,
3715   0xa548,0xa547,0xa543,0xa540,0xa53e,0xa53b,0xa538,0xa536,0xa533,0xa530,0xa52e,0xa52b,0xa527,0xa526,0xa523,0xa521,
3716   0xa51e,0xa51a,0xa519,0xa515,0xa512,0xa510,0xa50d,0xa50a,0xa508,0xa505,0xa502,0xa500,0xa4fd,0xa4f9,0xa4f8,0xa4f4,
3717   0xa4f3,0xa4f0,0xa4ec,0xa4eb,0xa4e7,0xa4e4,0xa4e2,0xa4df,0xa4dc,0xa4da,0xa4d7,0xa4d4,0xa4d2,0xa4cf,0xa4cd,0xa4ca,
3718   0xa4c7,0xa4c3,0xa4c2,0xa4be,0xa4bb,0xa4b9,0xa4b6,0xa4b4,0xa4b1,0xa4ae,0xa4ac,0xa4a9,0xa4a6,0xa4a4,0xa4a1,0xa49e,
3719   0xa49c,0xa499,0xa495,0xa494,0xa490,0xa48f,0xa48b,0xa488,0xa487,0xa483,0xa480,0xa47e,0xa47b,0xa478,0xa476,0xa473,
3720   0xa471,0xa46e,0xa46b,0xa469,0xa466,0xa462,0xa461,0xa45e,0xa45a,0xa459,0xa455,0xa452,0xa450,0xa44d,0xa44b,0xa448,
3721   0xa445,0xa443,0xa440,0xa43d,0xa43b,0xa438,0xa435,0xa433,0xa430,0xa42c,0xa42b,0xa427,0xa426,0xa422,0xa41f,0xa41e,
3722   0xa41a,0xa417,0xa415,0xa412,0xa40f,0xa40d,0xa40a,0xa408,0xa405,0xa402,0xa400,0xa3fd,0xa3f9,0xa3f8,0xa3f5,0xa3f1,
3723   0xa3f0,0xa3ec,0xa3e9,0xa3e7,0xa3e4,0xa3e2,0xa3df,0xa3dc,0xa3da,0xa3d7,0xa3d4,0xa3d2,0xa3cf,0xa3cc,0xa3ca,0xa3c7,
3724   0xa3c5,0xa3c2,0xa3be,0xa3bd,0xa3b9,0xa3b6,0xa3b5,0xa3b1,0xa3ae,0xa3ac,0xa3a9,0xa3a6,0xa3a4,0xa3a1,0xa39f,0xa39c,
3725   0xa399,0xa397,0xa394,0xa390,0xa38f,0xa38c,0xa388,0xa387,0xa383,0xa380,0xa37e,0xa37b,0xa379,0xa376,0xa373,0xa371,
3726   0xa36e,0xa36c,0xa369,0xa365,0xa364,0xa361,0xa35d,0xa35c,0xa358,0xa357,0xa353,0xa350,0xa34f,0xa34b,0xa348,0xa346,
3727   0xa343,0xa340,0xa33e,0xa33b,0xa339,0xa336,0xa333,0xa331,0xa32e,0xa32b,0xa329,0xa326,0xa322,0xa321,0xa31d,0xa31c,
3728   0xa319,0xa315,0xa314,0xa310,0xa30d,0xa30b,0xa308,0xa305,0xa303,0xa300,0xa2fe,0xa2fb,0xa2f8,0xa2f6,0xa2f3,0xa2f0,
3729   0xa2ee,0xa2eb,0xa2e7,0xa2e6,0xa2e3,0xa2e1,0xa2de,0xa2da,0xa2d9,0xa2d5,0xa2d2,0xa2d1,0xa2cd,0xa2ca,0xa2c8,0xa2c5,
3730   0xa2c3,0xa2c0,0xa2bd,0xa2bb,0xa2b8,0xa2b5,0xa2b3,0xa2b0,0xa2ad,0xa2ab,0xa2a8,0xa2a4,0xa2a3,0xa29f,0xa29e,0xa29b,
3731   0xa297,0xa296,0xa292,0xa28f,0xa28d,0xa28a,0xa287,0xa285,0xa282,0xa280,0xa27d,0xa27a,0xa278,0xa275,0xa272,0xa270,
3732   0xa26d,0xa269,0xa268,0xa265,0xa263,0xa260,0xa25c,0xa25b,0xa257,0xa254,0xa253,0xa24f,0xa24c,0xa24a,0xa247,0xa245,
3733   0xa242,0xa23f,0xa23d,0xa23a,0xa237,0xa235,0xa232,0xa22f,0xa22d,0xa22a,0xa228,0xa225,0xa221,0xa220,0xa21c,0xa219,
3734   0xa217,0xa215,0xa212,0xa20e,0xa20d,0xa20a,0xa206,0xa205,0xa201,0xa200,0xa1fc,0xa1f9,0xa1f8,0xa1f4,0xa1f1,0xa1ef,
3735   0xa1ec,0xa1eb,0xa1e7,0xa1e4,0xa1e2,0xa1df,0xa1dc,0xa1da,0xa1d7,0xa1d5,0xa1d2,0xa1cf,0xa1cd,0xa1ca,0xa1c7,0xa1c5,
3736   0xa1c2,0xa1bf,0xa1bd,0xa1ba,0xa1b8,0xa1b5,0xa1b2,0xa1b0,0xa1ad,0xa1a9,0xa1a8,0xa1a5,0xa1a3,0xa1a0,0xa19c,0xa19b,
3737   0xa197,0xa194,0xa193,0xa18f,0xa18e,0xa18a,0xa187,0xa186,0xa182,0xa17f,0xa17d,0xa17a,0xa179,0xa175,0xa172,0xa170,
3738   0xa16d,0xa16a,0xa168,0xa165,0xa162,0xa160,0xa15d,0xa15b,0xa158,0xa155,0xa153,0xa150,0xa14d,0xa14b,0xa148,0xa146,
3739   0xa143,0xa140,0xa13e,0xa13b,0xa137,0xa136,0xa132,0xa131,0xa12e,0xa12a,0xa129,0xa125,0xa122,0xa121,0xa11d,0xa11c,
3740   0xa118,0xa115,0xa114,0xa110,0xa10d,0xa10b,0xa108,0xa105,0xa103,0xa100,0xa0fe,0xa0fb,0xa0f8,0xa0f6,0xa0f3,0xa0f0,
3741   0xa0ee,0xa0eb,0xa0e9,0xa0e6,0xa0e3,0xa0e1,0xa0de,0xa0db,0xa0d9,0xa0d6,0xa0d4,0xa0d1,0xa0ce,0xa0cc,0xa0c9,0xa0c5,
3742   0xa0c3,0xa0c0,0xa0be,0xa0bb,0xa0b9,0xa0b6,0xa0b3,0xa0b1,0xa0ae,0xa0ab,0xa0a9,0xa0a6,0xa0a4,0xa0a1,0xa09e,0xa09c,
3743   0xa099,0xa096,0xa094,0xa091,0xa08f,0xa08c,0xa089,0xa087,0xa084,0xa080,0xa07f,0xa07c,0xa07a,0xa077,0xa073,0xa072,
3744   0xa06f,0xa06b,0xa06a,0xa066,0xa065,0xa062,0xa05e,0xa05d,0xa059,0xa056,0xa055,0xa051,0xa050,0xa04c,0xa049,0xa048,
3745   0xa044,0xa041,0xa03f,0xa03c,0xa03b,0xa037,0xa034,0xa032,0xa02f,0xa02c,0xa02a,0xa027,0xa025,0xa022,0xa01f,0xa01d,
3746   0xa01a,0xa017,0xa015,0xa012,0xa010,0xa00d,0xa00a,0xa008,0xa005,0xa002,0xa000,0x9ffd,0x9ffb,0x9ff8,0x9ff5,0x9ff3,
3747   0x9ff0,0x9fed,0x9feb,0x9fe8,0x9fe6,0x9fe3,0x9fe0,0x9fde,0x9fdb,0x9fd7,0x9fd6,0x9fd3,0x9fd1,0x9fce,0x9fca,0x9fc9,
3748   0x9fc6,0x9fc2,0x9fc1,0x9fbd,0x9fbc,0x9fb9,0x9fb5,0x9fb4,0x9fb0,0x9fad,0x9fac,0x9fa8,0x9fa7,0x9fa3,0x9fa0,0x9f9f,
3749   0x9f9b,0x9f98,0x9f96,0x9f93,0x9f92,0x9f8e,0x9f8b,0x9f89,0x9f86,0x9f83,0x9f81,0x9f7e,0x9f7c,0x9f79,0x9f76,0x9f74,
3750   0x9f71,0x9f6e,0x9f6d,0x9f69,0x9f66,0x9f65,0x9f61,0x9f5e,0x9f5c,0x9f59,0x9f58,0x9f54,0x9f51,0x9f4f,0x9f4c,0x9f49,
3751   0x9f47,0x9f44,0x9f42,0x9f3f,0x9f3c,0x9f3a,0x9f37,0x9f34,0x9f32,0x9f2f,0x9f2d,0x9f2a,0x9f27,0x9f25,0x9f22,0x9f1f,
3752   0x9f1d,0x9f1a,0x9f18,0x9f15,0x9f12,0x9f10,0x9f0d,0x9f0b,0x9f08,0x9f05,0x9f03,0x9f00,0x9efd,0x9efb,0x9ef8,0x9ef6,
3753   0x9ef3,0x9ef0,0x9eee,0x9eeb,0x9ee8,0x9ee6,0x9ee3,0x9ee1,0x9ede,0x9edb,0x9ed9,0x9ed6,0x9ed3,0x9ed1,0x9ece,0x9ecc,
3754   0x9ec9,0x9ec6,0x9ec4,0x9ec1,0x9ebf,0x9ebc,0x9eb9,0x9eb7,0x9eb4,0x9eb1,0x9eaf,0x9eac,0x9eaa,0x9ea7,0x9ea4,0x9ea2,
3755   0x9e9f,0x9e9b,0x9e9a,0x9e97,0x9e95,0x9e92,0x9e8f,0x9e8d,0x9e8a,0x9e86,0x9e85,0x9e82,0x9e80,0x9e7d,0x9e79,0x9e78,
3756   0x9e75,0x9e73,0x9e70,0x9e6c,0x9e6b,0x9e68,0x9e64,0x9e63,0x9e60,0x9e5e,0x9e5b,0x9e57,0x9e56,0x9e53,0x9e4f,0x9e4e,
3757   0x9e4a,0x9e49,0x9e46,0x9e42,0x9e41,0x9e3d,0x9e3a,0x9e39,0x9e35,0x9e34,0x9e31,0x9e2d,0x9e2c,0x9e28,0x9e25,0x9e24,
3758   0x9e21,0x9e1e,0x9e1c,0x9e19,0x9e15,0x9e14,0x9e11,0x9e0d,0x9e0c,0x9e09,0x9e07,0x9e04,0x9e01,0x9dff,0x9dfc,0x9dfa,
3759   0x9df7,0x9df4,0x9df2,0x9def,0x9dec,0x9dea,0x9de7,0x9de5,0x9de2,0x9ddf,0x9ddd,0x9dda,0x9dd8,0x9dd5,0x9dd2,0x9dd0,
3760   0x9dcd,0x9dcb,0x9dc8,0x9dc5,0x9dc3,0x9dc0,0x9dbd,0x9dbb,0x9db8,0x9db6,0x9db3,0x9db0,0x9dae,0x9dab,0x9da9,0x9da6,
3761   0x9da3,0x9da1,0x9d9e,0x9d9b,0x9d99,0x9d96,0x9d94,0x9d91,0x9d8e,0x9d8c,0x9d89,0x9d88,0x9d84,0x9d81,0x9d7f,0x9d7c,
3762   0x9d7b,0x9d77,0x9d74,0x9d73,0x9d6f,0x9d6c,0x9d6a,0x9d67,0x9d66,0x9d62,0x9d5f,0x9d5e,0x9d5a,0x9d59,0x9d56,0x9d52,
3763   0x9d51,0x9d4d,0x9d4a,0x9d49,0x9d45,0x9d44,0x9d41,0x9d3d,0x9d3c,0x9d38,0x9d37,0x9d34,0x9d30,0x9d2f,0x9d2c,0x9d28,
3764   0x9d27,0x9d23,0x9d22,0x9d1f,0x9d1b,0x9d1a,0x9d17,0x9d15,0x9d12,0x9d0f,0x9d0d,0x9d0a,0x9d08,0x9d05,0x9d02,0x9d00,
3765   0x9cfd,0x9cfa,0x9cf8,0x9cf5,0x9cf3,0x9cf0,0x9ced,0x9ceb,0x9ce8,0x9ce6,0x9ce3,0x9ce0,0x9cde,0x9cdb,0x9cd8,0x9cd6,
3766   0x9cd3,0x9cd0,0x9cce,0x9ccb,0x9cc9,0x9cc6,0x9cc3,0x9cc1,0x9cbe,0x9cbc,0x9cb9,0x9cb6,0x9cb4,0x9cb1,0x9cae,0x9cac,
3767   0x9ca9,0x9ca7,0x9ca4,0x9ca1,0x9c9f,0x9c9c,0x9c9b,0x9c97,0x9c94,0x9c92,0x9c8f,0x9c8e,0x9c8a,0x9c87,0x9c86,0x9c82,
3768   0x9c81,0x9c7e,0x9c7a,0x9c79,0x9c75,0x9c72,0x9c71,0x9c6d,0x9c6c,0x9c69,0x9c65,0x9c64,0x9c61,0x9c5f,0x9c5c,0x9c59,
3769   0x9c57,0x9c54,0x9c52,0x9c4f,0x9c4c,0x9c4a,0x9c47,0x9c44,0x9c42,0x9c3f,0x9c3d,0x9c3a,0x9c37,0x9c35,0x9c32,0x9c30,
3770   0x9c2d,0x9c2a,0x9c28,0x9c25,0x9c23,0x9c20,0x9c1d,0x9c1b,0x9c18,0x9c17,0x9c13,0x9c10,0x9c0e,0x9c0b,0x9c08,0x9c06,
3771   0x9c03,0x9c02,0x9bfe,0x9bfb,0x9bfa,0x9bf6,0x9bf5,0x9bf2,0x9bee,0x9bed,0x9be9,0x9be8,0x9be5,0x9be1,0x9be0,0x9bdd,
3772   0x9bdb,0x9bd8,0x9bd5,0x9bd3,0x9bd0,0x9bcd,0x9bcb,0x9bc8,0x9bc6,0x9bc3,0x9bc0,0x9bbe,0x9bbb,0x9bb9,0x9bb6,0x9bb3,
3773   0x9bb1,0x9bae,0x9bac,0x9ba9,0x9ba6,0x9ba4,0x9ba1,0x9b9e,0x9b9c,0x9b99,0x9b97,0x9b94,0x9b91,0x9b8f,0x9b8c,0x9b8b,
3774   0x9b87,0x9b85,0x9b82,0x9b7f,0x9b7d,0x9b7a,0x9b78,0x9b75,0x9b72,0x9b70,0x9b6d,0x9b6c,0x9b68,0x9b65,0x9b64,0x9b60,
3775   0x9b5f,0x9b5c,0x9b58,0x9b57,0x9b53,0x9b52,0x9b4f,0x9b4b,0x9b4a,0x9b47,0x9b45,0x9b42,0x9b3f,0x9b3d,0x9b3a,0x9b37,
3776   0x9b35,0x9b32,0x9b30,0x9b2d,0x9b2a,0x9b28,0x9b25,0x9b23,0x9b20,0x9b1d,0x9b1b,0x9b18,0x9b16,0x9b13,0x9b10,0x9b0e,
3777   0x9b0b,0x9b0a,0x9b06,0x9b03,0x9b02,0x9afe,0x9afd,0x9afa,0x9af6,0x9af5,0x9af2,0x9af0,0x9aed,0x9aea,0x9ae8,0x9ae5,
3778   0x9ae3,0x9ae0,0x9add,0x9adb,0x9ad8,0x9ad5,0x9ad3,0x9ad0,0x9ace,0x9acb,0x9ac8,0x9ac6,0x9ac3,0x9ac1,0x9abe,0x9abb,
3779   0x9ab9,0x9ab6,0x9ab5,0x9ab1,0x9aae,0x9aad,0x9aa9,0x9aa8,0x9aa4,0x9aa1,0x9aa0,0x9a9c,0x9a9b,0x9a98,0x9a94,0x9a93,
3780   0x9a90,0x9a8e,0x9a8b,0x9a88,0x9a86,0x9a83,0x9a80,0x9a7e,0x9a7b,0x9a79,0x9a76,0x9a73,0x9a71,0x9a6e,0x9a6c,0x9a69,
3781   0x9a66,0x9a64,0x9a61,0x9a5f,0x9a5c,0x9a59,0x9a57,0x9a54,0x9a53,0x9a4f,0x9a4c,0x9a4b,0x9a47,0x9a46,0x9a43,0x9a3f,
3782   0x9a3e,0x9a3b,0x9a38,0x9a36,0x9a33,0x9a30,0x9a2e,0x9a2b,0x9a2a,0x9a26,0x9a23,0x9a22,0x9a1e,0x9a1d,0x9a1a,0x9a16,
3783   0x9a15,0x9a12,0x9a10,0x9a0d,0x9a0a,0x9a08,0x9a05,0x9a03,0x9a00,0x99fd,0x99fb,0x99f8,0x99f6,0x99f3,0x99f0,0x99ee,
3784   0x99eb,0x99ea,0x99e6,0x99e3,0x99e2,0x99de,0x99dd,0x99da,0x99d6,0x99d5,0x99d2,0x99d0,0x99cd,0x99ca,0x99c8,0x99c5,
3785   0x99c3,0x99c0,0x99bd,0x99bb,0x99b8,0x99b6,0x99b3,0x99b0,0x99ae,0x99ab,0x99aa,0x99a6,0x99a3,0x99a2,0x999e,0x999d,
3786   0x999a,0x9996,0x9995,0x9991,0x9990,0x998d,0x9989,0x9988,0x9985,0x9983,0x9980,0x997d,0x997b,0x9978,0x9976,0x9973,
3787   0x9970,0x996e,0x996b,0x9969,0x9966,0x9963,0x9961,0x995e,0x995d,0x9959,0x9956,0x9955,0x9951,0x9950,0x994d,0x9949,
3788   0x9948,0x9945,0x9943,0x9940,0x993d,0x993b,0x9938,0x9936,0x9933,0x9930,0x992e,0x992b,0x9929,0x9926,0x9923,0x9921,
3789   0x991e,0x991d,0x9919,0x9916,0x9915,0x9911,0x9910,0x990d,0x9909,0x9908,0x9905,0x9903,0x9900,0x98fd,0x98fb,0x98f8,
3790   0x98f5,0x98f2,0x98f1,0x98ed,0x98ec,0x98e9,0x98e6,0x98e4,0x98e1,0x98df,0x98dc,0x98d9,0x98d7,0x98d4,0x98d2,0x98cf,
3791   0x98ce,0x98ca,0x98c7,0x98c6,0x98c2,0x98c1,0x98be,0x98ba,0x98b9,0x98b6,0x98b4,0x98b1,0x98ae,0x98ac,0x98a9,0x98a7,
3792   0x98a4,0x98a1,0x989f,0x989c,0x989b,0x9897,0x9894,0x9893,0x988f,0x988e,0x988b,0x9887,0x9886,0x9883,0x9881,0x987e,
3793   0x987c,0x9879,0x9876,0x9874,0x9871,0x9870,0x986c,0x9869,0x9868,0x9864,0x9863,0x9860,0x985c,0x985b,0x9858,0x9856,
3794   0x9853,0x9850,0x984e,0x984b,0x9849,0x9846,0x9843,0x9841,0x983e,0x983d,0x9839,0x9836,0x9835,0x9831,0x9830,0x982d,
3795   0x982b,0x9828,0x9825,0x9823,0x9820,0x981e,0x981b,0x9818,0x9816,0x9813,0x9812,0x980e,0x980b,0x980a,0x9806,0x9805,
3796   0x9802,0x97fe,0x97fd,0x97fa,0x97f8,0x97f5,0x97f2,0x97f0,0x97ed,0x97eb,0x97e8,0x97e5,0x97e3,0x97e0,0x97df,0x97db,
3797   0x97da,0x97d7,0x97d3,0x97d2,0x97cf,0x97cd,0x97ca,0x97c7,0x97c5,0x97c2,0x97c0,0x97bd,0x97ba,0x97b8,0x97b5,0x97b4,
3798   0x97b0,0x97ad,0x97ac,0x97a9,0x97a5,0x97a4,0x97a1,0x979f,0x979c,0x9799,0x9797,0x9794,0x9792,0x978f,0x978c,0x978a,
3799   0x9787,0x9786,0x9782,0x9781,0x977e,0x977a,0x9779,0x9776,0x9774,0x9771,0x976e,0x976c,0x9769,0x9767,0x9764,0x9761,
3800   0x975f,0x975c,0x975b,0x9757,0x9756,0x9753,0x974f,0x974e,0x974b,0x9749,0x9746,0x9743,0x9741,0x973e,0x973c,0x9739,
3801   0x9736,0x9734,0x9731,0x9730,0x972d,0x9729,0x9728,0x9725,0x9723,0x9720,0x971e,0x971b,0x9718,0x9716,0x9713,0x9711,
3802   0x970e,0x970b,0x970a,0x9706,0x9705,0x9702,0x96fe,0x96fd,0x96fa,0x96f8,0x96f5,0x96f3,0x96f0,0x96ed,0x96eb,0x96e8,
3803   0x96e7,0x96e3,0x96e0,0x96df,0x96db,0x96da,0x96d7,0x96d3,0x96d2,0x96cf,0x96cd,0x96ca,0x96c7,0x96c5,0x96c2,0x96c0,
3804   0x96bd,0x96bc,0x96b8,0x96b5,0x96b4,0x96b1,0x96af,0x96ac,0x96a9,0x96a7,0x96a4,0x96a2,0x969f,0x969c,0x969a,0x9697,
3805   0x9695,0x9692,0x9691,0x968e,0x968a,0x9689,0x9686,0x9684,0x9681,0x967e,0x967c,0x9679,0x9677,0x9674,0x9671,0x966f,
3806   0x966d,0x966a,0x9667,0x9666,0x9662,0x9661,0x965e,0x965a,0x9659,0x9656,0x9654,0x9651,0x964e,0x964c,0x9649,0x9647,
3807   0x9644,0x9643,0x963f,0x963c,0x963b,0x9638,0x9636,0x9633,0x9630,0x962e,0x962b,0x9629,0x9626,0x9624,0x9621,0x961e,
3808   0x961d,0x9619,0x9618,0x9615,0x9611,0x9610,0x960d,0x960b,0x9608,0x9605,0x9603,0x9600,0x95fe,0x95fb,0x95fa,0x95f6,
3809   0x95f3,0x95f2,0x95ef,0x95ed,0x95ea,0x95e7,0x95e5,0x95e2,0x95e0,0x95dd,0x95dc,0x95d8,0x95d5,0x95d4,0x95d0,0x95cf,
3810   0x95cc,0x95c8,0x95c7,0x95c4,0x95c2,0x95bf,0x95bc,0x95ba,0x95b7,0x95b5,0x95b2,0x95b1,0x95ae,0x95aa,0x95a9,0x95a6,
3811   0x95a4,0x95a1,0x959e,0x959c,0x9599,0x9597,0x9594,0x9593,0x958f,0x958c,0x958b,0x9587,0x9586,0x9583,0x9580,0x957e,
3812   0x957b,0x9579,0x9576,0x9573,0x9571,0x956e,0x956d,0x9569,0x9568,0x9565,0x9561,0x9560,0x955d,0x955b,0x9558,0x9555,
3813   0x9553,0x9550,0x954e,0x954b,0x954a,0x9546,0x9543,0x9542,0x953f,0x953d,0x953a,0x9537,0x9535,0x9532,0x9530,0x952d,
3814   0x952b,0x9529,0x9526,0x9524,0x9521,0x951e,0x951c,0x9519,0x9518,0x9515,0x9511,0x9510,0x950d,0x950b,0x9508,0x9506,
3815   0x9503,0x9500,0x94fe,0x94fb,0x94fa,0x94f7,0x94f3,0x94f2,0x94ef,0x94ed,0x94ea,0x94e8,0x94e5,0x94e2,0x94e0,0x94dd,
3816   0x94dc,0x94d8,0x94d5,0x94d4,0x94d1,0x94cf,0x94cc,0x94ca,0x94c7,0x94c4,0x94c2,0x94bf,0x94be,0x94ba,0x94b7,0x94b6,
3817   0x94b2,0x94b1,0x94ae,0x94ac,0x94a9,0x94a6,0x94a4,0x94a1,0x949f,0x949c,0x9499,0x9498,0x9494,0x9493,0x9490,0x948e,
3818   0x948b,0x9488,0x9486,0x9483,0x9481,0x947e,0x947d,0x947a,0x9476,0x9475,0x9472,0x9470,0x946d,0x946a,0x9468,0x9465,
3819   0x9463,0x9460,0x945f,0x945b,0x9458,0x9457,0x9454,0x9452,0x944f,0x944c,0x944a,0x9447,0x9445,0x9442,0x9441,0x943d,
3820   0x943a,0x9439,0x9436,0x9434,0x9431,0x942e,0x942c,0x9429,0x9427,0x9424,0x9423,0x941f,0x941c,0x941b,0x9417,0x9416,
3821   0x9413,0x9410,0x940e,0x940b,0x9409,0x9406,0x9404,0x9401,0x93fe,0x93fd,0x93f9,0x93f8,0x93f5,0x93f1,0x93f0,0x93ed,
3822   0x93eb,0x93e9,0x93e6,0x93e4,0x93e1,0x93de,0x93dc,0x93d9,0x93d8,0x93d5,0x93d3,0x93d0,0x93cd,0x93cb,0x93c8,0x93c6,
3823   0x93c3,0x93c0,0x93be,0x93bb,0x93ba,0x93b7,0x93b5,0x93b2,0x93af,0x93ad,0x93aa,0x93a8,0x93a5,0x93a4,0x93a1,0x939d,
3824   0x939c,0x9399,0x9397,0x9394,0x9392,0x938f,0x938c,0x938b,0x9387,0x9386,0x9383,0x9381,0x937e,0x937b,0x9379,0x9376,
3825   0x9374,0x9371,0x9370,0x936d,0x9369,0x9368,0x9365,0x9363,0x9360,0x935e,0x935b,0x9358,0x9357,0x9353,0x9352,0x934f,
3826   0x934d,0x934a,0x9347,0x9345,0x9342,0x9341,0x933d,0x933a,0x9339,0x9336,0x9334,0x9331,0x932f,0x932c,0x9329,0x9327,
3827   0x9324,0x9323,0x931f,0x931e,0x931b,0x9318,0x9316,0x9313,0x9311,0x930e,0x930d,0x9309,0x9306,0x9305,0x9302,0x9300,
3828   0x92fd,0x92fb,0x92f8,0x92f5,0x92f3,0x92f0,0x92ef,0x92ec,0x92ea,0x92e7,0x92e4,0x92e2,0x92df,0x92dd,0x92da,0x92d9,
3829   0x92d5,0x92d2,0x92d1,0x92ce,0x92cc,0x92c9,0x92c6,0x92c4,0x92c1,0x92bf,0x92bc,0x92bb,0x92b8,0x92b4,0x92b3,0x92b0,
3830   0x92ae,0x92ab,0x92a8,0x92a6,0x92a3,0x92a2,0x929f,0x929d,0x929a,0x9297,0x9295,0x9292,0x9290,0x928d,0x928c,0x9289,
3831   0x9285,0x9284,0x9281,0x927f,0x927c,0x927a,0x9277,0x9274,0x9273,0x926f,0x926e,0x926b,0x9269,0x9266,0x9263,0x9261,
3832   0x925e,0x925d,0x925a,0x9258,0x9255,0x9252,0x9250,0x924d,0x924b,0x9248,0x9247,0x9244,0x9240,0x923f,0x923c,0x923a,
3833   0x9237,0x9235,0x9232,0x922f,0x922e,0x922a,0x9229,0x9226,0x9224,0x9221,0x921e,0x921c,0x9219,0x9218,0x9214,0x9213,
3834   0x9210,0x920d,0x920b,0x9208,0x9206,0x9203,0x9202,0x91fe,0x91fb,0x91fa,0x91f7,0x91f5,0x91f2,0x91f0,0x91ed,0x91ea,
3835   0x91e8,0x91e5,0x91e4,0x91e1,0x91df,0x91dc,0x91d9,0x91d7,0x91d4,0x91d2,0x91cf,0x91ce,0x91cb,0x91c7,0x91c6,0x91c3,
3836   0x91c1,0x91be,0x91bc,0x91b9,0x91b6,0x91b5,0x91b1,0x91b0,0x91ad,0x91ab,0x91a8,0x91a5,0x91a3,0x91a0,0x919f,0x919c,
3837   0x919a,0x9197,0x9194,0x9192,0x918f,0x918d,0x918a,0x9189,0x9186,0x9182,0x9181,0x917e,0x917c,0x9179,0x9177,0x9174,
3838   0x9172,0x916f,0x916e,0x916b,0x9167,0x9166,0x9163,0x9161,0x915e,0x915c,0x9159,0x9158,0x9155,0x9151,0x9150,0x914d,
3839   0x914b,0x9148,0x9146,0x9143,0x9140,0x913f,0x913c,0x913a,0x9137,0x9135,0x9132,0x912f,0x912d,0x912a,0x9129,0x9126,
3840   0x9124,0x9121,0x911e,0x911c,0x9119,0x9117,0x9114,0x9113,0x9110,0x910e,0x910b,0x9108,0x9106,0x9103,0x9102,0x90fe,
3841   0x90fd,0x90fa,0x90f7,0x90f5,0x90f2,0x90f0,0x90ed,0x90ec,0x90e9,0x90e5,0x90e4,0x90e1,0x90df,0x90dc,0x90da,0x90d7,
3842   0x90d6,0x90d3,0x90cf,0x90ce,0x90cb,0x90c9,0x90c6,0x90c4,0x90c1,0x90be,0x90bd,0x90ba,0x90b8,0x90b5,0x90b3,0x90b0,
3843   0x90ad,0x90ab,0x90a8,0x90a7,0x90a4,0x90a2,0x909f,0x909c,0x909a,0x9097,0x9095,0x9092,0x9091,0x908e,0x908c,0x9089,
3844   0x9086,0x9084,0x9081,0x9080,0x907c,0x907b,0x9078,0x9075,0x9073,0x9070,0x906e,0x906b,0x906a,0x9066,0x9063,0x9062,
3845   0x905f,0x905d,0x905a,0x9058,0x9055,0x9052,0x9051,0x904d,0x904c,0x9049,0x9047,0x9044,0x9042,0x903f,0x903c,0x903b,
3846   0x9038,0x9035,0x9034,0x9030,0x902f,0x902c,0x902a,0x9027,0x9026,0x9022,0x901f,0x901e,0x901b,0x9019,0x9016,0x9014,
3847   0x9011,0x900e,0x900d,0x9009,0x9008,0x9005,0x9003,0x9000,0x8ffe,0x8ffb,0x8ff8,0x8ff7,0x8ff4,0x8ff2,0x8fef,0x8fed,
3848   0x8fea,0x8fe7,0x8fe5,0x8fe2,0x8fe1,0x8fde,0x8fdc,0x8fd9,0x8fd7,0x8fd4,0x8fd1,0x8fd0,0x8fcc,0x8fcb,0x8fc8,0x8fc6,
3849   0x8fc3,0x8fc0,0x8fbe,0x8fbb,0x8fba,0x8fb7,0x8fb5,0x8fb2,0x8fb0,0x8fad,0x8faa,0x8fa9,0x8fa5,0x8fa4,0x8fa1,0x8f9f,
3850   0x8f9c,0x8f99,0x8f97,0x8f94,0x8f93,0x8f90,0x8f8e,0x8f8b,0x8f89,0x8f86,0x8f83,0x8f81,0x8f7e,0x8f7d,0x8f7a,0x8f78,
3851   0x8f75,0x8f72,0x8f70,0x8f6d,0x8f6c,0x8f68,0x8f67,0x8f64,0x8f62,0x8f5f,0x8f5c,0x8f5a,0x8f57,0x8f56,0x8f53,0x8f51,
3852   0x8f4e,0x8f4b,0x8f49,0x8f46,0x8f45,0x8f41,0x8f40,0x8f3d,0x8f3b,0x8f38,0x8f35,0x8f33,0x8f30,0x8f2f,0x8f2c,0x8f2a,
3853   0x8f27,0x8f24,0x8f22,0x8f1f,0x8f1d,0x8f1a,0x8f19,0x8f16,0x8f14,0x8f11,0x8f0e,0x8f0c,0x8f09,0x8f08,0x8f04,0x8f03,
3854   0x8f01,0x8efd,0x8efa,0x8ef9,0x8ef6,0x8ef4,0x8ef1,0x8eef,0x8eec,0x8eeb,0x8ee8,0x8ee5,0x8ee3,0x8ee0,0x8ede,0x8edb,
3855   0x8eda,0x8ed7,0x8ed5,0x8ed2,0x8ecf,0x8ecd,0x8eca,0x8ec9,0x8ec5,0x8ec4,0x8ec1,0x8ebf,0x8ebc,0x8eb9,0x8eb7,0x8eb4,
3856   0x8eb3,0x8eb0,0x8eae,0x8eab,0x8ea9,0x8ea6,0x8ea3,0x8ea2,0x8e9f,0x8e9d,0x8e9a,0x8e98,0x8e95,0x8e94,0x8e91,0x8e8d,
3857   0x8e8c,0x8e89,0x8e87,0x8e84,0x8e83,0x8e7f,0x8e7e,0x8e7b,0x8e78,0x8e76,0x8e73,0x8e71,0x8e6e,0x8e6d,0x8e6a,0x8e68,
3858   0x8e65,0x8e62,0x8e60,0x8e5d,0x8e5c,0x8e59,0x8e57,0x8e54,0x8e52,0x8e4f,0x8e4c,0x8e4b,0x8e48,0x8e46,0x8e43,0x8e41,
3859   0x8e3e,0x8e3d,0x8e3a,0x8e36,0x8e35,0x8e32,0x8e30,0x8e2d,0x8e2c,0x8e28,0x8e27,0x8e24,0x8e21,0x8e1f,0x8e1c,0x8e1a,
3860   0x8e17,0x8e16,0x8e13,0x8e11,0x8e0e,0x8e0b,0x8e09,0x8e06,0x8e05,0x8e02,0x8e00,0x8dfd,0x8dfb,0x8df8,0x8df5,0x8df4,
3861   0x8df0,0x8def,0x8dec,0x8dea,0x8de7,0x8de6,0x8de2,0x8ddf,0x8dde,0x8ddb,0x8dd9,0x8dd6,0x8dd4,0x8dd1,0x8dd0,0x8dcd,
3862   0x8dca,0x8dc8,0x8dc5,0x8dc3,0x8dc0,0x8dbd,0x8dbc,0x8db9,0x8db7,0x8db4,0x8db2,0x8daf,0x8dae,0x8dab,0x8da9,0x8da6,
3863   0x8da3,0x8da1,0x8d9e,0x8d9d,0x8d9a,0x8d98,0x8d95,0x8d93,0x8d90,0x8d8d,0x8d8c,0x8d88,0x8d87,0x8d84,0x8d82,0x8d7f,
3864   0x8d7e,0x8d7b,0x8d79,0x8d76,0x8d73,0x8d71,0x8d6e,0x8d6d,0x8d69,0x8d68,0x8d65,0x8d63,0x8d60,0x8d5d,0x8d5b,0x8d58,
3865   0x8d57,0x8d54,0x8d52,0x8d4f,0x8d4e,0x8d4a,0x8d49,0x8d46,0x8d43,0x8d41,0x8d3e,0x8d3c,0x8d39,0x8d38,0x8d35,0x8d33,
3866   0x8d30,0x8d2d,0x8d2b,0x8d28,0x8d27,0x8d24,0x8d22,0x8d1f,0x8d1d,0x8d1a,0x8d17,0x8d16,0x8d13,0x8d11,0x8d0e,0x8d0c,
3867   0x8d09,0x8d08,0x8d05,0x8d03,0x8d00,0x8cfd,0x8cfb,0x8cf8,0x8cf7,0x8cf4,0x8cf2,0x8cef,0x8ced,0x8cea,0x8ce7,0x8ce6,
3868   0x8ce3,0x8ce1,0x8cde,0x8cdc,0x8cd9,0x8cd8,0x8cd5,0x8cd3,0x8cd0,0x8ccd,0x8ccb,0x8cc8,0x8cc7,0x8cc4,0x8cc2,0x8cbf,
3869   0x8cbd,0x8cba,0x8cb7,0x8cb6,0x8cb2,0x8cb1,0x8cae,0x8cac,0x8ca9,0x8ca8,0x8ca5,0x8ca3,0x8ca0,0x8c9d,0x8c9b,0x8c98,
3870   0x8c96,0x8c93,0x8c91,0x8c8e,0x8c8d,0x8c8a,0x8c88,0x8c85,0x8c83,0x8c80,0x8c7f,0x8c7c,0x8c79,0x8c77,0x8c74,0x8c72,
3871   0x8c6f,0x8c6e,0x8c6b,0x8c69,0x8c66,0x8c65,0x8c61,0x8c5e,0x8c5d,0x8c5a,0x8c58,0x8c55,0x8c54,0x8c50,0x8c4f,0x8c4c,
3872   0x8c4a,0x8c47,0x8c44,0x8c43,0x8c3f,0x8c3e,0x8c3b,0x8c39,0x8c36,0x8c35,0x8c32,0x8c2e,0x8c2d,0x8c2a,0x8c28,0x8c25,
3873   0x8c24,0x8c20,0x8c1f,0x8c1c,0x8c1a,0x8c17,0x8c14,0x8c13,0x8c0f,0x8c0e,0x8c0b,0x8c09,0x8c06,0x8c05,0x8c02,0x8c00,
3874   0x8bfd,0x8bfa,0x8bf8,0x8bf5,0x8bf4,0x8bf1,0x8bef,0x8bec,0x8bea,0x8be7,0x8be6,0x8be3,0x8be0,0x8bde,0x8bdb,0x8bd9,
3875   0x8bd6,0x8bd5,0x8bd2,0x8bd0,0x8bcd,0x8bcb,0x8bc8,0x8bc5,0x8bc4,0x8bc1,0x8bbf,0x8bbc,0x8bba,0x8bb7,0x8bb6,0x8bb3,
3876   0x8bb1,0x8bae,0x8bab,0x8ba9,0x8ba6,0x8ba5,0x8ba2,0x8ba0,0x8b9d,0x8b9b,0x8b98,0x8b95,0x8b94,0x8b91,0x8b8f,0x8b8c,
3877   0x8b8a,0x8b87,0x8b86,0x8b83,0x8b81,0x8b7e,0x8b7b,0x8b79,0x8b76,0x8b75,0x8b72,0x8b70,0x8b6d,0x8b6c,0x8b68,0x8b67,
3878   0x8b64,0x8b61,0x8b60,0x8b5d,0x8b5b,0x8b58,0x8b55,0x8b53,0x8b50,0x8b4f,0x8b4c,0x8b4a,0x8b47,0x8b45,0x8b42,0x8b41,
3879   0x8b3e,0x8b3c,0x8b39,0x8b36,0x8b34,0x8b31,0x8b30,0x8b2d,0x8b2b,0x8b28,0x8b27,0x8b23,0x8b22,0x8b1f,0x8b1c,0x8b1a,
3880   0x8b17,0x8b16,0x8b13,0x8b11,0x8b0e,0x8b0c,0x8b09,0x8b08,0x8b05,0x8b02,0x8b00,0x8afd,0x8afb,0x8af8,0x8af7,0x8af4,
3881   0x8af2,0x8aef,0x8aed,0x8aea,0x8ae9,0x8ae6,0x8ae3,0x8ae1,0x8ade,0x8add,0x8ad9,0x8ad8,0x8ad5,0x8ad3,0x8ad0,0x8acf,
3882   0x8acc,0x8ac8,0x8ac7,0x8ac4,0x8ac2,0x8abf,0x8abe,0x8abb,0x8ab9,0x8ab6,0x8ab4,0x8ab1,0x8aae,0x8aad,0x8aaa,0x8aa8,
3883   0x8aa5,0x8aa3,0x8aa0,0x8a9f,0x8a9c,0x8a9a,0x8a97,0x8a96,0x8a92,0x8a8f,0x8a8e,0x8a8b,0x8a89,0x8a86,0x8a85,0x8a81,
3884   0x8a80,0x8a7d,0x8a7b,0x8a78,0x8a75,0x8a74,0x8a71,0x8a6f,0x8a6c,0x8a6a,0x8a67,0x8a66,0x8a63,0x8a61,0x8a5e,0x8a5b,
3885   0x8a59,0x8a56,0x8a55,0x8a52,0x8a50,0x8a4d,0x8a4b,0x8a48,0x8a47,0x8a44,0x8a42,0x8a3f,0x8a3c,0x8a3b,0x8a37,0x8a36,
3886   0x8a34,0x8a31,0x8a2e,0x8a2d,0x8a2a,0x8a28,0x8a25,0x8a23,0x8a20,0x8a1f,0x8a1c,0x8a1a,0x8a17,0x8a14,0x8a12,0x8a0f,
3887   0x8a0e,0x8a0b,0x8a09,0x8a06,0x8a05,0x8a02,0x8a00,0x89fd,0x89fb,0x89f8,0x89f5,0x89f4,0x89f1,0x89ef,0x89ec,0x89ea,
3888   0x89e7,0x89e6,0x89e3,0x89e1,0x89de,0x89dd,0x89da,0x89d6,0x89d5,0x89d2,0x89d0,0x89cd,0x89cc,0x89c9,0x89c7,0x89c4,
3889   0x89c2,0x89bf,0x89be,0x89bb,0x89b8,0x89b6,0x89b3,0x89b2,0x89ae,0x89ad,0x89aa,0x89a8,0x89a5,0x89a4,0x89a1,0x899f,
3890   0x899c,0x8999,0x8997,0x8994,0x8993,0x8990,0x898e,0x898b,0x8989,0x8986,0x8985,0x8982,0x8980,0x897d,0x897a,0x8979,
3891   0x8975,0x8974,0x8971,0x896f,0x896c,0x896b,0x8968,0x8966,0x8963,0x8961,0x895e,0x895b,0x895a,0x8957,0x8955,0x8952,
3892   0x8951,0x894d,0x894c,0x8949,0x8947,0x8944,0x8943,0x8940,0x893d,0x893b,0x8938,0x8936,0x8933,0x8932,0x892f,0x892d,
3893   0x892a,0x8929,0x8925,0x8924,0x8921,0x891e,0x891c,0x8919,0x8918,0x8915,0x8913,0x8910,0x890e,0x890b,0x890a,0x8907,
3894   0x8904,0x8901,0x8900,0x88fd,0x88fb,0x88f8,0x88f7,0x88f3,0x88f2,0x88ef,0x88ed,0x88ea,0x88e9,0x88e6,0x88e4,0x88e1,
3895   0x88e0,0x88dd,0x88d9,0x88d8,0x88d5,0x88d3,0x88d0,0x88cf,0x88cc,0x88ca,0x88c7,0x88c6,0x88c2,0x88c1,0x88be,0x88bc,
3896   0x88b9,0x88b6,0x88b5,0x88b2,0x88b0,0x88ad,0x88ac,0x88a8,0x88a7,0x88a4,0x88a2,0x889f,0x889e,0x889b,0x8899,0x8896,
3897   0x8895,0x8891,0x888e,0x888d,0x888a,0x8888,0x8885,0x8884,0x8881,0x887f,0x887c,0x887b,0x8877,0x8876,0x8873,0x8871,
3898   0x886e,0x886b,0x886a,0x8867,0x8865,0x8862,0x8860,0x885d,0x885c,0x8859,0x8857,0x8854,0x8853,0x8850,0x884e,0x884b,
3899   0x884a,0x8846,0x8843,0x8842,0x883f,0x883d,0x883a,0x8839,0x8836,0x8834,0x8831,0x882f,0x882c,0x882b,0x8828,0x8826,
3900   0x8823,0x8820,0x881f,0x881c,0x881a,0x8817,0x8815,0x8812,0x8811,0x880e,0x880c,0x8809,0x8808,0x8805,0x8803,0x8800,
3901   0x87fe,0x87fb,0x87f8,0x87f7,0x87f4,0x87f2,0x87ef,0x87ee,0x87eb,0x87e9,0x87e6,0x87e4,0x87e1,0x87e0,0x87dd,0x87db,
3902   0x87d7,0x87d6,0x87d3,0x87d1,0x87ce,0x87cd,0x87ca,0x87c8,0x87c5,0x87c4,0x87c0,0x87bd,0x87bc,0x87b9,0x87b7,0x87b4,
3903   0x87b3,0x87b0,0x87ae,0x87ab,0x87aa,0x87a6,0x87a5,0x87a2,0x87a0,0x879d,0x879c,0x8799,0x8796,0x8794,0x8791,0x8790,
3904   0x878d,0x878b,0x8788,0x8786,0x8783,0x8782,0x877f,0x877d,0x877a,0x8779,0x8776,0x8774,0x8771,0x876f,0x876c,0x8769,
3905   0x8768,0x8765,0x8763,0x8760,0x875f,0x875c,0x875a,0x8757,0x8756,0x8752,0x8751,0x874e,0x874c,0x8749,0x8748,0x8745,
3906   0x8743,0x8740,0x873d,0x873c,0x8739,0x8737,0x8734,0x8732,0x872f,0x872e,0x872b,0x8729,0x8726,0x8725,0x8722,0x8720,
3907   0x871d,0x871b,0x8718,0x8715,0x8714,0x8711,0x870f,0x870c,0x870b,0x8708,0x8706,0x8703,0x8702,0x86fe,0x86fd,0x86fa,
3908   0x86f8,0x86f5,0x86f4,0x86f1,0x86ef,0x86ec,0x86e9,0x86e8,0x86e5,0x86e3,0x86e0,0x86de,0x86db,0x86da,0x86d7,0x86d5,
3909   0x86d2,0x86d1,0x86ce,0x86cc,0x86c9,0x86c7,0x86c4,0x86c1,0x86c0,0x86bd,0x86bb,0x86b8,0x86b7,0x86b4,0x86b2,0x86af,
3910   0x86ae,0x86ab,0x86a8,0x86a6,0x86a3,0x86a1,0x869e,0x869d,0x869a,0x8698,0x8695,0x8694,0x8691,0x868f,0x868c,0x868b,
3911   0x8688,0x8686,0x8683,0x8681,0x867e,0x867d,0x867a,0x8677,0x8675,0x8672,0x8671,0x866e,0x866c,0x8669,0x8668,0x8665,
3912   0x8663,0x8660,0x865e,0x865b,0x865a,0x8657,0x8655,0x8652,0x8651,0x864e,0x864c,0x8649,0x8646,0x8645,0x8642,0x8640,
3913   0x863d,0x863b,0x8638,0x8637,0x8634,0x8632,0x862f,0x862e,0x862b,0x8629,0x8626,0x8625,0x8622,0x8620,0x861d,0x861b,
3914   0x8618,0x8615,0x8614,0x8611,0x860f,0x860c,0x860b,0x8608,0x8606,0x8603,0x8602,0x85fe,0x85fd,0x85fa,0x85f8,0x85f5,
3915   0x85f4,0x85f1,0x85ef,0x85ec,0x85eb,0x85e8,0x85e5,0x85e3,0x85e0,0x85de,0x85db,0x85da,0x85d7,0x85d5,0x85d2,0x85d1,
3916   0x85ce,0x85cc,0x85c9,0x85c8,0x85c5,0x85c3,0x85c0,0x85be,0x85bb,0x85ba,0x85b7,0x85b4,0x85b2,0x85af,0x85ae,0x85ab,
3917   0x85a9,0x85a6,0x85a5,0x85a2,0x85a0,0x859d,0x859b,0x8598,0x8597,0x8594,0x8592,0x858f,0x858e,0x858b,0x8589,0x8586,
3918   0x8584,0x8581,0x8580,0x857d,0x857b,0x8578,0x8577,0x8573,0x8572,0x856f,0x856d,0x856a,0x8569,0x8566,0x8563,0x8561,
3919   0x855e,0x855d,0x855a,0x8558,0x8555,0x8554,0x8551,0x854f,0x854c,0x854a,0x8547,0x8546,0x8543,0x8541,0x853e,0x853d,
3920   0x853a,0x8538,0x8535,0x8534,0x8531,0x852f,0x852c,0x8529,0x8528,0x8524,0x8523,0x8520,0x851e,0x851b,0x851a,0x8517,
3921   0x8515,0x8512,0x8511,0x850e,0x850c,0x8509,0x8508,0x8505,0x8503,0x8500,0x84fe,0x84fb,0x84fa,0x84f7,0x84f5,0x84f2,
3922   0x84f1,0x84ee,0x84eb,0x84e9,0x84e6,0x84e5,0x84e2,0x84e0,0x84dd,0x84dc,0x84d8,0x84d7,0x84d4,0x84d2,0x84cf,0x84ce,
3923   0x84cb,0x84c9,0x84c6,0x84c5,0x84c2,0x84c0,0x84bd,0x84bc,0x84b9,0x84b7,0x84b4,0x84b1,0x84af,0x84ac,0x84ab,0x84a8,
3924   0x84a6,0x84a3,0x84a2,0x849f,0x849d,0x849a,0x8499,0x8496,0x8494,0x8491,0x8490,0x848d,0x848b,0x8488,0x8486,0x8483,
3925   0x8482,0x847f,0x847d,0x847a,0x8477,0x8476,0x8473,0x8471,0x846e,0x846d,0x846a,0x8468,0x8465,0x8463,0x8460,0x845f,
3926   0x845c,0x8459,0x8458,0x8455,0x8453,0x8450,0x844f,0x844c,0x844a,0x8447,0x8446,0x8443,0x8441,0x843e,0x843d,0x843a,
3927   0x8438,0x8435,0x8434,0x8431,0x842f,0x842c,0x842a,0x8427,0x8426,0x8423,0x8421,0x841e,0x841d,0x841a,0x8418,0x8415,
3928   0x8414,0x8411,0x840e,0x840c,0x8409,0x8408,0x8405,0x8403,0x8400,0x83fe,0x83fb,0x83fa,0x83f7,0x83f5,0x83f2,0x83f1,
3929   0x83ee,0x83ec,0x83e9,0x83e8,0x83e5,0x83e3,0x83e0,0x83df,0x83dc,0x83da,0x83d7,0x83d6,0x83d3,0x83d1,0x83ce,0x83cc,
3930   0x83c9,0x83c6,0x83c5,0x83c2,0x83c0,0x83bd,0x83bc,0x83b9,0x83b7,0x83b4,0x83b3,0x83b0,0x83ae,0x83ab,0x83aa,0x83a7,
3931   0x83a5,0x83a2,0x83a1,0x839d,0x839c,0x8399,0x8397,0x8394,0x8393,0x8390,0x838e,0x838b,0x838a,0x8387,0x8385,0x8382,
3932   0x8381,0x837e,0x837b,0x8379,0x8376,0x8375,0x8372,0x8370,0x836d,0x836b,0x8368,0x8367,0x8364,0x8362,0x835f,0x835e,
3933   0x835b,0x8359,0x8356,0x8355,0x8352,0x8350,0x834d,0x834c,0x8349,0x8347,0x8344,0x8343,0x8340,0x833e,0x833b,0x8339,
3934   0x8336,0x8335,0x8332,0x8330,0x832d,0x832c,0x8329,0x8327,0x8324,0x8323,0x8320,0x831e,0x831b,0x831a,0x8317,0x8315,
3935   0x8312,0x8311,0x830e,0x830c,0x8309,0x8308,0x8305,0x8302,0x8300,0x82fd,0x82fb,0x82f8,0x82f7,0x82f4,0x82f2,0x82ef,
3936   0x82ee,0x82eb,0x82e9,0x82e6,0x82e5,0x82e2,0x82e0,0x82dd,0x82dc,0x82d9,0x82d7,0x82d4,0x82d3,0x82d0,0x82ce,0x82cb,
3937   0x82ca,0x82c7,0x82c5,0x82c2,0x82c1,0x82bd,0x82bc,0x82b9,0x82b7,0x82b4,0x82b3,0x82b0,0x82ae,0x82ab,0x82aa,0x82a7,
3938   0x82a5,0x82a2,0x829f,0x829e,0x829b,0x8299,0x8296,0x8295,0x8292,0x8290,0x828d,0x828c,0x8289,0x8287,0x8284,0x8283,
3939   0x8280,0x827e,0x827b,0x8279,0x8276,0x8275,0x8272,0x8270,0x826d,0x826c,0x8269,0x8267,0x8264,0x8263,0x8260,0x825e,
3940   0x825b,0x825a,0x8257,0x8255,0x8252,0x8251,0x824e,0x824c,0x8249,0x8248,0x8245,0x8242,0x8240,0x823d,0x823b,0x8238,
3941   0x8237,0x8234,0x8232,0x822f,0x822e,0x822b,0x8229,0x8226,0x8225,0x8222,0x8220,0x821d,0x821c,0x8219,0x8217,0x8214,
3942   0x8214,0x8211,0x820e,0x820c,0x8209,0x8208,0x8205,0x8203,0x8200,0x81fe,0x81fb,0x81fa,0x81f7,0x81f5,0x81f2,0x81f1,
3943   0x81ee,0x81ec,0x81e9,0x81e8,0x81e5,0x81e3,0x81e0,0x81df,0x81dc,0x81da,0x81d7,0x81d6,0x81d3,0x81d1,0x81ce,0x81cd,
3944   0x81ca,0x81c8,0x81c5,0x81c4,0x81c1,0x81bf,0x81bc,0x81bb,0x81b8,0x81b6,0x81b3,0x81b2,0x81af,0x81ad,0x81aa,0x81a9,
3945   0x81a6,0x81a4,0x81a1,0x81a0,0x819c,0x819b,0x8198,0x8196,0x8193,0x8192,0x818f,0x818d,0x818a,0x8189,0x8186,0x8184,
3946   0x8181,0x817e,0x817d,0x817a,0x8178,0x8175,0x8174,0x8171,0x816f,0x816c,0x816b,0x8168,0x8166,0x8163,0x8162,0x815f,
3947   0x815d,0x815a,0x8159,0x8156,0x8154,0x8151,0x8150,0x814d,0x814b,0x8148,0x8147,0x8144,0x8142,0x813f,0x813d,0x813a,
3948   0x8139,0x8136,0x8134,0x8131,0x8130,0x812d,0x812b,0x8128,0x8127,0x8124,0x8122,0x811f,0x811e,0x811b,0x8119,0x8116,
3949   0x8115,0x8112,0x8110,0x810d,0x810c,0x8109,0x8107,0x8104,0x8103,0x8100,0x80fe,0x80fb,0x80fa,0x80f7,0x80f5,0x80f2,
3950   0x80f0,0x80ef,0x80ec,0x80ea,0x80e7,0x80e6,0x80e3,0x80e1,0x80de,0x80dd,0x80da,0x80d8,0x80d5,0x80d4,0x80d1,0x80cf,
3951   0x80cc,0x80cb,0x80c8,0x80c6,0x80c3,0x80c2,0x80bf,0x80bd,0x80ba,0x80b9,0x80b6,0x80b4,0x80b1,0x80b0,0x80ad,0x80ab,
3952   0x80a8,0x80a7,0x80a4,0x80a2,0x809f,0x809e,0x809b,0x8099,0x8096,0x8095,0x8092,0x8090,0x808d,0x808c,0x8089,0x8087,
3953   0x8084,0x8083,0x8080,0x807e,0x807b,0x807a,0x8077,0x8075,0x8072,0x8071,0x806e,0x806c,0x8069,0x8068,0x8065,0x8063,
3954   0x8060,0x805f,0x805c,0x805a,0x8057,0x8056,0x8053,0x8051,0x804e,0x804d,0x804a,0x8048,0x8045,0x8044,0x8041,0x803f,
3955   0x803c,0x803b,0x8038,0x8036,0x8033,0x8032,0x802f,0x802d,0x802a,0x8029,0x8026,0x8024,0x8021,0x8020,0x801d,0x801b,
3956   0x8018,0x8017,0x8014,0x8012,0x800f,0x800e,0x800b,0x8009,0x8006,0x8005,0x8002,0x8000,0x7ffd,0x7ffc,0x7ff9,0x7ff7,
3957   0x7ff4,0x7ff3,0x7ff0,0x7fee,0x7feb,0x7fea,0x7fe7,0x7fe5,0x7fe2,0x7fe1,0x7fde,0x7fdc,0x7fd9,0x7fd8,0x7fd5,0x7fd3,
3958   0x7fd0,0x7fcd,0x7fcb,0x7fc8,0x7fc7,0x7fc4,0x7fc2,0x7fc0,0x7fbe,0x7fbb,0x7fba,0x7fb7,0x7fb5,0x7fb2,0x7fb1,0x7fae,
3959   0x7fac,0x7fa9,0x7fa8,0x7fa5,0x7fa3,0x7fa0,0x7f9f,0x7f9c,0x7f9a,0x7f97,0x7f96,0x7f93,0x7f91,0x7f8e,0x7f8d,0x7f8a,
3960   0x7f88,0x7f85,0x7f84,0x7f81,0x7f7f,0x7f7c,0x7f7b,0x7f78,0x7f76,0x7f73,0x7f72,0x7f6f,0x7f6d,0x7f6a,0x7f69,0x7f66,
3961   0x7f64,0x7f61,0x7f60,0x7f5d,0x7f5b,0x7f58,0x7f57,0x7f54,0x7f52,0x7f4f,0x7f4e,0x7f4b,0x7f49,0x7f46,0x7f45,0x7f42,
3962   0x7f40,0x7f3f,0x7f3c,0x7f3a,0x7f37,0x7f36,0x7f33,0x7f31,0x7f2e,0x7f2d,0x7f2a,0x7f28,0x7f25,0x7f24,0x7f21,0x7f1f,
3963   0x7f1c,0x7f1b,0x7f18,0x7f16,0x7f13,0x7f12,0x7f0f,0x7f0d,0x7f0a,0x7f09,0x7f06,0x7f04,0x7f01,0x7f00,0x7efd,0x7efc,
3964   0x7ef9,0x7ef7,0x7ef4,0x7ef3,0x7ef0,0x7eee,0x7eeb,0x7eea,0x7ee7,0x7ee5,0x7ee2,0x7ee1,0x7ede,0x7edc,0x7ed9,0x7ed8,
3965   0x7ed5,0x7ed3,0x7ed0,0x7ecf,0x7ecc,0x7eca,0x7ec7,0x7ec6,0x7ec3,0x7ec1,0x7ebe,0x7ebd,0x7eba,0x7eb8,0x7eb5,0x7eb4,
3966   0x7eb2,0x7eaf,0x7ead,0x7eaa,0x7ea9,0x7ea6,0x7ea4,0x7ea1,0x7ea0,0x7e9d,0x7e9b,0x7e98,0x7e97,0x7e94,0x7e92,0x7e8f,
3967   0x7e8e,0x7e8b,0x7e89,0x7e86,0x7e85,0x7e82,0x7e80,0x7e7d,0x7e7c,0x7e79,0x7e77,0x7e74,0x7e73,0x7e70,0x7e6e,0x7e6b,
3968   0x7e6a,0x7e67,0x7e65,0x7e62,0x7e61,0x7e5e,0x7e5d,0x7e5a,0x7e58,0x7e55,0x7e54,0x7e51,0x7e4f,0x7e4c,0x7e4b,0x7e48,
3969   0x7e46,0x7e43,0x7e42,0x7e3f,0x7e3d,0x7e3a,0x7e39,0x7e36,0x7e34,0x7e31,0x7e30,0x7e2d,0x7e2b,0x7e28,0x7e27,0x7e24,
3970   0x7e22,0x7e21,0x7e1e,0x7e1c,0x7e19,0x7e18,0x7e15,0x7e13,0x7e10,0x7e0f,0x7e0c,0x7e0a,0x7e07,0x7e06,0x7e03,0x7e01,
3971   0x7dff,0x7dfd,0x7dfa,0x7df9,0x7df6,0x7df4,0x7df1,0x7df0,0x7ded,0x7deb,0x7de8,0x7de7,0x7de4,0x7de2,0x7ddf,0x7dde,
3972   0x7ddb,0x7dd9,0x7dd6,0x7dd5,0x7dd2,0x7dd0,0x7dcd,0x7dcc,0x7dc9,0x7dc7,0x7dc4,0x7dc3,0x7dc0,0x7dbe,0x7dbb,0x7dba,
3973   0x7db7,0x7db5,0x7db2,0x7db1,0x7dae,0x7dac,0x7da9,0x7da8,0x7da5,0x7da3,0x7da1,0x7d9f,0x7d9c,0x7d9b,0x7d98,0x7d96,
3974   0x7d93,0x7d92,0x7d8f,0x7d8d,0x7d8a,0x7d89,0x7d86,0x7d84,0x7d81,0x7d80,0x7d7d,0x7d7c,0x7d79,0x7d77,0x7d74,0x7d73,
3975   0x7d70,0x7d6e,0x7d6b,0x7d6a,0x7d67,0x7d65,0x7d64,0x7d61,0x7d5f,0x7d5c,0x7d5b,0x7d58,0x7d56,0x7d53,0x7d52,0x7d4f,
3976   0x7d4d,0x7d4a,0x7d49,0x7d46,0x7d44,0x7d41,0x7d40,0x7d3d,0x7d3c,0x7d39,0x7d37,0x7d34,0x7d33,0x7d30,0x7d2e,0x7d2b,
3977   0x7d2a,0x7d27,0x7d25,0x7d22,0x7d21,0x7d1e,0x7d1c,0x7d19,0x7d18,0x7d15,0x7d13,0x7d10,0x7d0f,0x7d0c,0x7d0a,0x7d07,
3978   0x7d06,0x7d04,0x7d01,0x7d00,0x7cfd,0x7cfc,0x7cf9,0x7cf7,0x7cf4,0x7cf3,0x7cf0,0x7cee,0x7ceb,0x7cea,0x7ce7,0x7ce5,
3979   0x7ce2,0x7ce1,0x7cde,0x7cdc,0x7cd9,0x7cd8,0x7cd5,0x7cd3,0x7cd0,0x7ccf,0x7ccc,0x7cca,0x7cc7,0x7cc6,0x7cc3,0x7cc1,
3980   0x7cbf,0x7cbd,0x7cba,0x7cb9,0x7cb6,0x7cb4,0x7cb1,0x7cb0,0x7cad,0x7cab,0x7ca8,0x7ca7,0x7ca5,0x7ca2,0x7ca1,0x7c9e,
3981   0x7c9c,0x7c99,0x7c98,0x7c95,0x7c93,0x7c90,0x7c8f,0x7c8c,0x7c8a,0x7c87,0x7c86,0x7c83,0x7c81,0x7c7f,0x7c7d,0x7c7a,
3982   0x7c78,0x7c77,0x7c74,0x7c72,0x7c6f,0x7c6e,0x7c6b,0x7c69,0x7c66,0x7c65,0x7c62,0x7c60,0x7c5e,0x7c5c,0x7c59,0x7c58,
3983   0x7c55,0x7c53,0x7c50,0x7c4f,0x7c4c,0x7c4a,0x7c47,0x7c46,0x7c43,0x7c41,0x7c3e,0x7c3d,0x7c3a,0x7c38,0x7c35,0x7c34,
3984   0x7c32,0x7c30,0x7c2e,0x7c2b,0x7c2a,0x7c27,0x7c25,0x7c22,0x7c21,0x7c1e,0x7c1c,0x7c19,0x7c18,0x7c15,0x7c13,0x7c10,
3985   0x7c0f,0x7c0c,0x7c0a,0x7c07,0x7c06,0x7c03,0x7c01,0x7bff,0x7bfd,0x7bfa,0x7bf9,0x7bf6,0x7bf4,0x7bf1,0x7bf0,0x7bed,
3986   0x7beb,0x7bea,0x7be7,0x7be5,0x7be2,0x7be1,0x7bde,0x7bdc,0x7bd9,0x7bd8,0x7bd5,0x7bd3,0x7bd1,0x7bcf,0x7bcc,0x7bcb,
3987   0x7bc8,0x7bc6,0x7bc3,0x7bc2,0x7bbf,0x7bbd,0x7bba,0x7bb9,0x7bb6,0x7bb4,0x7bb1,0x7bb0,0x7bad,0x7bab,0x7ba8,0x7ba7,
3988   0x7ba5,0x7ba2,0x7ba1,0x7b9e,0x7b9d,0x7b9a,0x7b98,0x7b95,0x7b94,0x7b91,0x7b8f,0x7b8c,0x7b8b,0x7b88,0x7b86,0x7b83,
3989   0x7b82,0x7b7f,0x7b7d,0x7b7a,0x7b79,0x7b76,0x7b74,0x7b72,0x7b70,0x7b6d,0x7b6c,0x7b69,0x7b67,0x7b64,0x7b63,0x7b60,
3990   0x7b5f,0x7b5c,0x7b5a,0x7b57,0x7b56,0x7b53,0x7b51,0x7b4e,0x7b4d,0x7b4a,0x7b49,0x7b46,0x7b44,0x7b43,0x7b40,0x7b3e,
3991   0x7b3b,0x7b3a,0x7b37,0x7b35,0x7b32,0x7b31,0x7b2e,0x7b2c,0x7b29,0x7b28,0x7b25,0x7b24,0x7b21,0x7b1f,0x7b1c,0x7b1b,
3992   0x7b18,0x7b16,0x7b13,0x7b12,0x7b0f,0x7b0d,0x7b0a,0x7b09,0x7b07,0x7b04,0x7b03,0x7b00,0x7aff,0x7afc,0x7afa,0x7af7,
3993   0x7af6,0x7af3,0x7af1,0x7aee,0x7aed,0x7aea,0x7ae8,0x7ae5,0x7ae4,0x7ae1,0x7adf,0x7adc,0x7adb,0x7ad8,0x7ad7,0x7ad4,
3994   0x7ad2,0x7ad1,0x7ace,0x7acc,0x7ac9,0x7ac8,0x7ac5,0x7ac3,0x7ac0,0x7abf,0x7abc,0x7aba,0x7ab7,0x7ab6,0x7ab3,0x7ab2,
3995   0x7aaf,0x7aad,0x7aaa,0x7aa9,0x7aa6,0x7aa4,0x7aa1,0x7aa0,0x7a9d,0x7a9b,0x7a9a,0x7a97,0x7a95,0x7a92,0x7a91,0x7a8e,
3996   0x7a8d,0x7a8a,0x7a88,0x7a85,0x7a84,0x7a81,0x7a7f,0x7a7c,0x7a7b,0x7a78,0x7a76,0x7a73,0x7a72,0x7a6f,0x7a6d,0x7a6a,
3997   0x7a69,0x7a66,0x7a65,0x7a62,0x7a60,0x7a5f,0x7a5c,0x7a5a,0x7a57,0x7a56,0x7a53,0x7a51,0x7a4e,0x7a4d,0x7a4a,0x7a48,
3998   0x7a47,0x7a44,0x7a42,0x7a3f,0x7a3e,0x7a3b,0x7a3a,0x7a37,0x7a35,0x7a32,0x7a31,0x7a2e,0x7a2c,0x7a29,0x7a28,0x7a25,
3999   0x7a23,0x7a20,0x7a1f,0x7a1c,0x7a1b,0x7a18,0x7a16,0x7a15,0x7a12,0x7a10,0x7a0d,0x7a0c,0x7a09,0x7a07,0x7a04,0x7a03,
4000   0x7a00,0x79ff,0x79fc,0x79fa,0x79f7,0x79f6,0x79f3,0x79f1,0x79ee,0x79ed,0x79ea,0x79e8,0x79e7,0x79e4,0x79e2,0x79e0,
4001   0x79de,0x79db,0x79da,0x79d7,0x79d5,0x79d2,0x79d1,0x79ce,0x79cc,0x79c9,0x79c8,0x79c5,0x79c3,0x79c1,0x79bf,0x79bc,
4002   0x79bb,0x79b9,0x79b6,0x79b5,0x79b2,0x79b0,0x79ad,0x79ac,0x79a9,0x79a7,0x79a4,0x79a3,0x79a0,0x799f,0x799c,0x799a,
4003   0x7997,0x7996,0x7993,0x7991,0x798e,0x798d,0x798b,0x7988,0x7987,0x7984,0x7982,0x7980,0x797e,0x797b,0x797a,0x7977,
4004   0x7975,0x7972,0x7971,0x796e,0x796c,0x7969,0x7968,0x7965,0x7963,0x7961,0x795f,0x795e,0x795b,0x7959,0x7956,0x7955,
4005   0x7952,0x7950,0x794d,0x794c,0x7949,0x7947,0x7944,0x7943,0x7940,0x793f,0x793c,0x793a,0x7937,0x7936,0x7933,0x7931,
4006   0x792f,0x792e,0x792b,0x7929,0x7926,0x7925,0x7922,0x7920,0x791d,0x791c,0x791b,0x7918,0x7916,0x7913,0x7912,0x790f,
4007   0x790d,0x790a,0x7909,0x7906,0x7904,0x7901,0x7900,0x78fd,0x78fc,0x78f9,0x78f7,0x78f4,0x78f3,0x78f1,0x78ee,0x78ed,
4008   0x78ea,0x78e8,0x78e5,0x78e4,0x78e1,0x78e0,0x78dd,0x78db,0x78d8,0x78d7,0x78d4,0x78d2,0x78cf,0x78ce,0x78cc,0x78ca,
4009   0x78c8,0x78c5,0x78c4,0x78c1,0x78bf,0x78bc,0x78bb,0x78b8,0x78b6,0x78b3,0x78b2,0x78af,0x78ae,0x78ab,0x78a9,0x78a6,
4010   0x78a5,0x78a3,0x78a0,0x789f,0x789c,0x789a,0x7897,0x7896,0x7893,0x7892,0x788f,0x788d,0x788a,0x7889,0x7886,0x7884,
4011   0x7881,0x7880,0x787d,0x787b,0x787a,0x7877,0x7876,0x7873,0x7871,0x786e,0x786d,0x786a,0x7868,0x7865,0x7864,0x7861,
4012   0x785f,0x785d,0x785b,0x7858,0x7857,0x7855,0x7852,0x7851,0x784e,0x784c,0x7849,0x7848,0x7845,0x7844,0x7841,0x783f,
4013   0x783c,0x783b,0x7838,0x7836,0x7833,0x7832,0x782f,0x782d,0x782c,0x7829,0x7828,0x7825,0x7823,0x7820,0x781f,0x781c,
4014   0x781a,0x7819,0x7816,0x7815,0x7812,0x7810,0x780d,0x780c,0x7809,0x7807,0x7804,0x7803,0x7800,0x77ff,0x77fc,0x77fa,
4015   0x77f9,0x77f6,0x77f4,0x77f1,0x77f0,0x77ed,0x77eb,0x77e9,0x77e7,0x77e4,0x77e3,0x77e0,0x77de,0x77db,0x77da,0x77d7,
4016   0x77d5,0x77d4,0x77d1,0x77d0,0x77cd,0x77cb,0x77c8,0x77c7,0x77c4,0x77c2,0x77bf,0x77be,0x77bb,0x77ba,0x77b7,0x77b5,
4017   0x77b4,0x77b1,0x77af,0x77ac,0x77ab,0x77a8,0x77a6,0x77a3,0x77a2,0x779f,0x779e,0x779b,0x7799,0x7796,0x7795,0x7792,
4018   0x7790,0x778f,0x778c,0x778b,0x7788,0x7786,0x7783,0x7782,0x777f,0x777d,0x777a,0x7779,0x7776,0x7774,0x7772,0x7770,
4019   0x776f,0x776c,0x776a,0x7767,0x7766,0x7763,0x7761,0x775e,0x775d,0x775a,0x7759,0x7756,0x7754,0x7751,0x7750,0x774d,
4020   0x774b,0x774a,0x7747,0x7745,0x7743,0x7741,0x773e,0x773d,0x773a,0x7738,0x7735,0x7734,0x7731,0x772f,0x772d,0x772b,
4021   0x772a,0x7727,0x7725,0x7722,0x7721,0x771e,0x771c,0x7719,0x7718,0x7715,0x7714,0x7711,0x770f,0x770c,0x770b,0x7708,
4022   0x7707,0x7704,0x7703,0x7700,0x76fe,0x76fb,0x76fa,0x76f7,0x76f5,0x76f3,0x76f1,0x76ee,0x76ed,0x76eb,0x76e8,0x76e7,
4023   0x76e4,0x76e2,0x76e0,0x76de,0x76db,0x76da,0x76d7,0x76d5,0x76d2,0x76d1,0x76cf,0x76cd,0x76cb,0x76c8,0x76c7,0x76c4,
4024   0x76c2,0x76bf,0x76be,0x76bb,0x76ba,0x76b7,0x76b5,0x76b4,0x76b1,0x76af,0x76ac,0x76ab,0x76a8,0x76a7,0x76a4,0x76a2,
4025   0x769f,0x769e,0x769b,0x7699,0x7698,0x7695,0x7694,0x7691,0x768f,0x768c,0x768b,0x7688,0x7686,0x7683,0x7682,0x767f,
4026   0x767e,0x767c,0x7679,0x7678,0x7675,0x7673,0x7670,0x766f,0x766c,0x766b,0x7668,0x7666,0x7663,0x7662,0x7660,0x765e,
4027   0x765c,0x7659,0x7658,0x7655,0x7653,0x7650,0x764f,0x764c,0x764b,0x7648,0x7646,0x7645,0x7642,0x7640,0x763d,0x763c,
4028   0x7639,0x7638,0x7635,0x7633,0x7630,0x762f,0x762c,0x762a,0x7629,0x7626,0x7625,0x7622,0x7620,0x761d,0x761c,0x7619,
4029   0x7617,0x7614,0x7613,0x7610,0x760f,0x760d,0x760a,0x7609,0x7606,0x7604,0x7601,0x7600,0x75fd,0x75fc,0x75f9,0x75f7,
4030   0x75f5,0x75f2,0x75f0,0x75ed,0x75ec,0x75e9,0x75e8,0x75e6,0x75e3,0x75e2,0x75df,0x75dd,0x75db,0x75d9,0x75d6,0x75d5,
4031   0x75d2,0x75d0,0x75cf,0x75cc,0x75cb,0x75c8,0x75c6,0x75c3,0x75c2,0x75bf,0x75bd,0x75bb,0x75b9,0x75b6,0x75b5,0x75b3,
4032   0x75b0,0x75af,0x75ac,0x75aa,0x75a8,0x75a6,0x75a3,0x75a2,0x759f,0x759d,0x759c,0x7599,0x7598,0x7595,0x7593,0x7590,
4033   0x758f,0x758c,0x758a,0x7588,0x7586,0x7585,0x7582,0x7580,0x757d,0x757c,0x7579,0x7577,0x7575,0x7573,0x7570,0x756f,
4034   0x756d,0x756a,0x7569,0x7566,0x7565,0x7562,0x7560,0x755d,0x755c,0x7559,0x7557,0x7555,0x7553,0x7552,0x754f,0x754d,
4035   0x754a,0x7549,0x7546,0x7544,0x7542,0x7540,0x753d,0x753c,0x753a,0x7537,0x7536,0x7533,0x7532,0x752f,0x752d,0x752a,
4036   0x7529,0x7526,0x7524,0x7523,0x7520,0x751f,0x751c,0x751a,0x7517,0x7516,0x7513,0x7511,0x750f,0x750d,0x750a,0x7509,
4037   0x7507,0x7504,0x7503,0x7500,0x74ff,0x74fc,0x74fa,0x74f7,0x74f6,0x74f3,0x74f1,0x74f0,0x74ed,0x74ec,0x74e9,0x74e7,
4038   0x74e4,0x74e3,0x74e0,0x74de,0x74db,0x74da,0x74d7,0x74d6,0x74d3,0x74d1,0x74ce,0x74cd,0x74cb,0x74c9,0x74c7,0x74c4,
4039   0x74c3,0x74c0,0x74be,0x74bb,0x74ba,0x74b7,0x74b6,0x74b4,0x74b1,0x74b0,0x74ad,0x74ab,0x74a9,0x74a7,0x74a4,0x74a3,
4040   0x74a1,0x749e,0x749d,0x749a,0x7499,0x7496,0x7494,0x7491,0x7490,0x748d,0x748c,0x748a,0x7487,0x7486,0x7483,0x7481,
4041   0x747e,0x747d,0x747a,0x7479,0x7476,0x7474,0x7473,0x7470,0x746e,0x746c,0x746a,0x7467,0x7466,0x7463,0x7461,0x745e,
4042   0x745d,0x745c,0x7459,0x7457,0x7454,0x7453,0x7450,0x744e,0x744c,0x744a,0x7447,0x7446,0x7444,0x7441,0x7440,0x743d,
4043   0x743c,0x7439,0x7437,0x7434,0x7433,0x7430,0x742f,0x742d,0x742a,0x7429,0x7426,0x7424,0x7421,0x7420,0x741d,0x741c,
4044   0x741a,0x7417,0x7416,0x7413,0x7411,0x740f,0x740d,0x740a,0x7409,0x7406,0x7404,0x7403,0x7400,0x73ff,0x73fc,0x73fa,
4045   0x73f7,0x73f6,0x73f3,0x73f1,0x73ef,0x73ed,0x73ec,0x73e9,0x73e7,0x73e4,0x73e3,0x73e0,0x73df,0x73dc,0x73da,0x73d7,
4046   0x73d5,0x73d4,0x73d1,0x73cf,0x73cc,0x73cb,0x73c9,0x73c7,0x73c5,0x73c2,0x73c1,0x73be,0x73bc,0x73ba,0x73b8,0x73b7,
4047   0x73b4,0x73b2,0x73af,0x73ae,0x73ab,0x73aa,0x73a7,0x73a5,0x73a2,0x73a1,0x739f,0x739d,0x739b,0x7398,0x7397,0x7394,
4048   0x7392,0x738f,0x738e,0x738d,0x738a,0x7388,0x7385,0x7384,0x7381,0x7380,0x737d,0x737b,0x7378,0x7377,0x7375,0x7372,
4049   0x7371,0x736e,0x736d,0x736a,0x7368,0x7365,0x7364,0x7363,0x7360,0x735e,0x735b,0x735a,0x7357,0x7356,0x7353,0x7351,
4050   0x7350,0x734d,0x734b,0x7348,0x7347,0x7344,0x7343,0x7340,0x733e,0x733b,0x733a,0x7339,0x7336,0x7334,0x7331,0x7330,
4051   0x732d,0x732b,0x7329,0x7327,0x7326,0x7323,0x7321,0x731e,0x731d,0x731a,0x7319,0x7316,0x7314,0x7311,0x7310,0x730e,
4052   0x730c,0x730a,0x7307,0x7306,0x7303,0x7301,0x72ff,0x72fd,0x72fc,0x72f9,0x72f7,0x72f4,0x72f3,0x72f0,0x72ef,0x72ec,
4053   0x72ea,0x72e7,0x72e6,0x72e4,0x72e2,0x72e0,0x72dd,0x72dc,0x72d9,0x72d7,0x72d5,0x72d3,0x72d2,0x72cf,0x72cd,0x72ca,
4054   0x72c9,0x72c6,0x72c5,0x72c2,0x72c0,0x72bd,0x72bc,0x72b9,0x72b8,0x72b5,0x72b3,0x72b2,0x72af,0x72ad,0x72ab,0x72a9,
4055   0x72a6,0x72a5,0x72a2,0x72a0,0x729f,0x729c,0x729b,0x7298,0x7296,0x7293,0x7292,0x728f,0x728e,0x728c,0x7289,0x7288,
4056   0x7285,0x7284,0x7281,0x727f,0x727c,0x727b,0x7279,0x7277,0x7275,0x7272,0x7271,0x726e,0x726c,0x726a,0x7268,0x7267,
4057   0x7264,0x7262,0x725f,0x725e,0x725b,0x725a,0x7257,0x7255,0x7254,0x7251,0x724f,0x724d,0x724b,0x7248,0x7247,0x7244,
4058   0x7242,0x7241,0x723e,0x723d,0x723a,0x7238,0x7235,0x7234,0x7231,0x7230,0x722e,0x722b,0x722a,0x7227,0x7226,0x7223,
4059   0x7221,0x721e,0x721d,0x721b,0x7219,0x7217,0x7214,0x7213,0x7210,0x720e,0x720c,0x720a,0x7209,0x7206,0x7204,0x7201,
4060   0x7200,0x71fd,0x71fc,0x71f9,0x71f7,0x71f6,0x71f3,0x71f2,0x71ef,0x71ed,0x71ea,0x71e9,0x71e6,0x71e5,0x71e3,0x71e0,
4061   0x71df,0x71dc,0x71da,0x71d8,0x71d6,0x71d3,0x71d2,0x71d0,0x71cd,0x71cc,0x71c9,0x71c8,0x71c5,0x71c3,0x71c0,0x71bf,
4062   0x71bd,0x71ba,0x71b9,0x71b6,0x71b4,0x71b3,0x71b0,0x71ae,0x71ac,0x71aa,0x71a7,0x71a6,0x71a3,0x71a1,0x71a0,0x719d,
4063   0x719c,0x7199,0x7197,0x7194,0x7193,0x7190,0x718f,0x718d,0x718a,0x7189,0x7186,0x7185,0x7182,0x7180,0x717f,0x717c,
4064   0x717b,0x7178,0x7176,0x7173,0x7172,0x716f,0x716e,0x716c,0x7169,0x7168,0x7165,0x7163,0x7161,0x715f,0x715c,0x715b,
4065   0x7159,0x7156,0x7155,0x7152,0x7151,0x714e,0x714c,0x714a,0x7148,0x7147,0x7144,0x7142,0x713f,0x713e,0x713b,0x713a,
4066   0x7138,0x7135,0x7134,0x7131,0x7130,0x712d,0x712b,0x7128,0x7127,0x7125,0x7123,0x7121,0x711e,0x711d,0x711a,0x7119,
4067   0x7116,0x7114,0x7113,0x7110,0x710e,0x710c,0x710a,0x7107,0x7106,0x7103,0x7101,0x7100,0x70fd,0x70fc,0x70f9,0x70f7,
4068   0x70f4,0x70f3,0x70f0,0x70ef,0x70ed,0x70ea,0x70e9,0x70e6,0x70e5,0x70e2,0x70e0,0x70df,0x70dc,0x70db,0x70d8,0x70d6,
4069   0x70d3,0x70d2,0x70cf,0x70ce,0x70cc,0x70c9,0x70c8,0x70c5,0x70c3,0x70c1,0x70bf,0x70bc,0x70bb,0x70b9,0x70b6,0x70b5,
4070   0x70b2,0x70b1,0x70ae,0x70ad,0x70aa,0x70a8,0x70a5,0x70a4,0x70a2,0x70a0,0x709e,0x709b,0x709a,0x7097,0x7096,0x7093,
4071   0x7091,0x7090,0x708d,0x708b,0x7089,0x7087,0x7084,0x7083,0x7081,0x707f,0x707d,0x707a,0x7079,0x7076,0x7074,0x7072,
4072   0x7070,0x706f,0x706c,0x706a,0x7068,0x7066,0x7063,0x7062,0x7060,0x705d,0x705c,0x7059,0x7058,0x7055,0x7053,0x7051,
4073   0x704f,0x704e,0x704b,0x7049,0x7046,0x7045,0x7042,0x7041,0x703f,0x703c,0x703b,0x7038,0x7037,0x7034,0x7032,0x702f,
4074   0x702e,0x702d,0x702a,0x7028,0x7025,0x7024,0x7021,0x7020,0x701e,0x701b,0x701a,0x7017,0x7016,0x7013,0x7011,0x700e,
4075   0x700d,0x700c,0x7009,0x7007,0x7004,0x7003,0x7000,0x6fff,0x6ffd,0x6ffa,0x6ff9,0x6ff6,0x6ff5,0x6ff2,0x6ff0,0x6fed,
4076   0x6fec,0x6fea,0x6fe8,0x6fe6,0x6fe3,0x6fe2,0x6fdf,0x6fde,0x6fdc,0x6fd9,0x6fd8,0x6fd5,0x6fd3,0x6fd1,0x6fcf,0x6fcc,
4077   0x6fcb,0x6fc9,0x6fc7,0x6fc5,0x6fc2,0x6fc1,0x6fbe,0x6fbc,0x6fbb,0x6fb8,0x6fb7,0x6fb4,0x6fb2,0x6fb0,0x6fae,0x6fab,
4078   0x6fa9,0x6fa8,0x6fa5,0x6fa3,0x6fa2,0x6f9f,0x6f9e,0x6f9b,0x6f99,0x6f97,0x6f95,0x6f92,0x6f91,0x6f8f,0x6f8c,0x6f8b,
4079   0x6f88,0x6f87,0x6f84,0x6f82,0x6f81,0x6f7e,0x6f7d,0x6f7a,0x6f78,0x6f76,0x6f74,0x6f73,0x6f70,0x6f6e,0x6f6c,0x6f6a,
4080   0x6f67,0x6f66,0x6f64,0x6f61,0x6f60,0x6f5d,0x6f5c,0x6f59,0x6f57,0x6f55,0x6f53,0x6f52,0x6f4f,0x6f4d,0x6f4b,0x6f49,
4081   0x6f46,0x6f45,0x6f43,0x6f41,0x6f3f,0x6f3c,0x6f3b,0x6f38,0x6f36,0x6f35,0x6f32,0x6f31,0x6f2e,0x6f2c,0x6f2a,0x6f28,
4082   0x6f27,0x6f24,0x6f22,0x6f20,0x6f1e,0x6f1b,0x6f1a,0x6f17,0x6f16,0x6f14,0x6f11,0x6f10,0x6f0d,0x6f0b,0x6f09,0x6f07,
4083   0x6f06,0x6f03,0x6f01,0x6eff,0x6efd,0x6efa,0x6ef9,0x6ef7,0x6ef5,0x6ef3,0x6ef0,0x6eef,0x6eec,0x6eea,0x6ee8,0x6ee6,
4084   0x6ee5,0x6ee2,0x6ee0,0x6ede,0x6edc,0x6ed9,0x6ed8,0x6ed6,0x6ed4,0x6ed2,0x6ecf,0x6ece,0x6ecb,0x6eca,0x6ec8,0x6ec5,
4085   0x6ec4,0x6ec1,0x6ebf,0x6ebd,0x6ebb,0x6eba,0x6eb7,0x6eb5,0x6eb3,0x6eb1,0x6eae,0x6ead,0x6eaa,0x6ea9,0x6ea7,0x6ea4,
4086   0x6ea3,0x6ea0,0x6e9f,0x6e9c,0x6e9a,0x6e98,0x6e96,0x6e93,0x6e92,0x6e90,0x6e8e,0x6e8c,0x6e89,0x6e88,0x6e85,0x6e84,
4087   0x6e82,0x6e7f,0x6e7e,0x6e7b,0x6e7a,0x6e77,0x6e75,0x6e74,0x6e71,0x6e70,0x6e6d,0x6e6b,0x6e68,0x6e67,0x6e66,0x6e63,
4088   0x6e61,0x6e5e,0x6e5d,0x6e5a,0x6e59,0x6e57,0x6e54,0x6e53,0x6e50,0x6e4f,0x6e4c,0x6e4a,0x6e49,0x6e46,0x6e45,0x6e42,
4089   0x6e40,0x6e3d,0x6e3c,0x6e3b,0x6e38,0x6e36,0x6e33,0x6e32,0x6e2f,0x6e2e,0x6e2c,0x6e29,0x6e28,0x6e25,0x6e24,0x6e21,
4090   0x6e1f,0x6e1e,0x6e1b,0x6e1a,0x6e17,0x6e15,0x6e13,0x6e11,0x6e10,0x6e0d,0x6e0b,0x6e09,0x6e07,0x6e04,0x6e03,0x6e01,
4091   0x6dff,0x6dfd,0x6dfa,0x6df9,0x6df6,0x6df5,0x6df3,0x6df0,0x6def,0x6dec,0x6deb,0x6de8,0x6de6,0x6de5,0x6de2,0x6de1,
4092   0x6dde,0x6ddc,0x6dd9,0x6dd8,0x6dd7,0x6dd4,0x6dd2,0x6dcf,0x6dce,0x6dcb,0x6dca,0x6dc8,0x6dc5,0x6dc4,0x6dc1,0x6dc0,
4093   0x6dbd,0x6dbb,0x6dba,0x6db7,0x6db6,0x6db3,0x6db1,0x6daf,0x6dad,0x6dac,0x6da9,0x6da7,0x6da5,0x6da3,0x6da0,0x6d9f,
4094   0x6d9d,0x6d9a,0x6d99,0x6d96,0x6d94,0x6d93,0x6d90,0x6d8f,0x6d8c,0x6d8a,0x6d87,0x6d86,0x6d85,0x6d82,0x6d80,0x6d7d,
4095   0x6d7c,0x6d7b,0x6d78,0x6d76,0x6d73,0x6d72,0x6d6f,0x6d6e,0x6d6c,0x6d6a,0x6d68,0x6d65,0x6d64,0x6d61,0x6d60,0x6d5e,
4096   0x6d5b,0x6d5a,0x6d57,0x6d56,0x6d53,0x6d51,0x6d50,0x6d4d,0x6d4c,0x6d49,0x6d47,0x6d44,0x6d43,0x6d42,0x6d3f,0x6d3d,
4097   0x6d3a,0x6d39,0x6d36,0x6d35,0x6d33,0x6d30,0x6d2f,0x6d2c,0x6d2b,0x6d28,0x6d26,0x6d25,0x6d22,0x6d21,0x6d1e,0x6d1d,
4098   0x6d1b,0x6d18,0x6d17,0x6d14,0x6d13,0x6d10,0x6d0e,0x6d0d,0x6d0a,0x6d09,0x6d06,0x6d04,0x6d01,0x6d00,0x6cff,0x6cfc,
4099   0x6cfa,0x6cf7,0x6cf6,0x6cf3,0x6cf2,0x6cf0,0x6ced,0x6cec,0x6ce9,0x6ce8,0x6ce5,0x6ce3,0x6ce2,0x6cdf,0x6cde,0x6cdb,
4100   0x6cda,0x6cd7,0x6cd5,0x6cd4,0x6cd1,0x6cd0,0x6ccd,0x6ccb,0x6cc8,0x6cc7,0x6cc6,0x6cc3,0x6cc1,0x6cbe,0x6cbd,0x6cba,
4101   0x6cb9,0x6cb7,0x6cb4,0x6cb3,0x6cb0,0x6caf,0x6cad,0x6caa,0x6ca9,0x6ca6,0x6ca5,0x6ca2,0x6ca0,0x6c9f,0x6c9c,0x6c9b,
4102   0x6c98,0x6c97,0x6c94,0x6c92,0x6c90,0x6c8e,0x6c8b,0x6c8a,0x6c89,0x6c86,0x6c84,0x6c81,0x6c80,0x6c7f,0x6c7c,0x6c7a,
4103   0x6c77,0x6c76,0x6c73,0x6c72,0x6c70,0x6c6d,0x6c6c,0x6c69,0x6c68,0x6c65,0x6c64,0x6c62,0x6c5f,0x6c5e,0x6c5b,0x6c5a,
4104   0x6c58,0x6c55,0x6c54,0x6c51,0x6c50,0x6c4d,0x6c4b,0x6c4a,0x6c47,0x6c46,0x6c43,0x6c41,0x6c3f,0x6c3d,0x6c3c,0x6c39,
4105   0x6c37,0x6c35,0x6c33,0x6c30,0x6c2f,0x6c2e,0x6c2b,0x6c29,0x6c26,0x6c25,0x6c24,0x6c21,0x6c1f,0x6c1c,0x6c1b,0x6c18,
4106   0x6c17,0x6c15,0x6c12,0x6c11,0x6c0e,0x6c0d,0x6c0a,0x6c09,0x6c07,0x6c04,0x6c03,0x6c00,0x6bff,0x6bfd,0x6bfa,0x6bf9,
4107   0x6bf6,0x6bf5,0x6bf2,0x6bf0,0x6bef,0x6bec,0x6beb,0x6be8,0x6be6,0x6be4,0x6be2,0x6be1,0x6bde,0x6bdc,0x6bda,0x6bd8,
4108   0x6bd7,0x6bd4,0x6bd3,0x6bd0,0x6bce,0x6bcb,0x6bca,0x6bc9,0x6bc6,0x6bc4,0x6bc1,0x6bc0,0x6bbd,0x6bbc,0x6bba,0x6bb7,
4109   0x6bb6,0x6bb3,0x6bb2,0x6baf,0x6bae,0x6bac,0x6ba9,0x6ba8,0x6ba5,0x6ba4,0x6ba2,0x6b9f,0x6b9e,0x6b9b,0x6b9a,0x6b97,
4110   0x6b95,0x6b93,0x6b91,0x6b8f,0x6b8e,0x6b8b,0x6b8a,0x6b87,0x6b85,0x6b82,0x6b81,0x6b80,0x6b7d,0x6b7b,0x6b79,0x6b77,
4111   0x6b76,0x6b73,0x6b71,0x6b6f,0x6b6d,0x6b6a,0x6b69,0x6b68,0x6b65,0x6b63,0x6b60,0x6b5f,0x6b5e,0x6b5b,0x6b59,0x6b56,
4112   0x6b55,0x6b52,0x6b51,0x6b4f,0x6b4d,0x6b4b,0x6b48,0x6b47,0x6b45,0x6b43,0x6b41,0x6b3e,0x6b3d,0x6b3a,0x6b39,0x6b37,
4113   0x6b34,0x6b33,0x6b30,0x6b2f,0x6b2d,0x6b2b,0x6b29,0x6b26,0x6b25,0x6b22,0x6b21,0x6b1f,0x6b1c,0x6b1b,0x6b18,0x6b17,
4114   0x6b15,0x6b12,0x6b11,0x6b0e,0x6b0d,0x6b0a,0x6b09,0x6b07,0x6b04,0x6b03,0x6b00,0x6aff,0x6afc,0x6afa,0x6af9,0x6af6,
4115   0x6af5,0x6af2,0x6af0,0x6aef,0x6aec,0x6aeb,0x6ae8,0x6ae6,0x6ae4,0x6ae2,0x6ae1,0x6ade,0x6add,0x6ada,0x6ad8,0x6ad7,
4116   0x6ad4,0x6ad3,0x6ad0,0x6ace,0x6acc,0x6aca,0x6ac9,0x6ac6,0x6ac4,0x6ac2,0x6ac0,0x6abf,0x6abc,0x6abb,0x6ab8,0x6ab6,
4117   0x6ab3,0x6ab2,0x6ab1,0x6aae,0x6aac,0x6aaa,0x6aa8,0x6aa7,0x6aa4,0x6aa2,0x6aa0,0x6a9e,0x6a9b,0x6a9a,0x6a98,0x6a96,
4118   0x6a94,0x6a92,0x6a90,0x6a8d,0x6a8c,0x6a89,0x6a88,0x6a86,0x6a84,0x6a82,0x6a7f,0x6a7e,0x6a7c,0x6a7a,0x6a78,0x6a75,
4119   0x6a74,0x6a71,0x6a70,0x6a6e,0x6a6b,0x6a6a,0x6a67,0x6a66,0x6a64,0x6a62,0x6a60,0x6a5d,0x6a5c,0x6a59,0x6a58,0x6a56,
4120   0x6a53,0x6a52,0x6a4f,0x6a4e,0x6a4c,0x6a4a,0x6a48,0x6a45,0x6a44,0x6a42,0x6a40,0x6a3e,0x6a3b,0x6a3a,0x6a37,0x6a36,
4121   0x6a34,0x6a31,0x6a30,0x6a2d,0x6a2c,0x6a2a,0x6a28,0x6a26,0x6a23,0x6a22,0x6a1f,0x6a1e,0x6a1c,0x6a19,0x6a18,0x6a15,
4122   0x6a14,0x6a12,0x6a10,0x6a0e,0x6a0b,0x6a0a,0x6a08,0x6a06,0x6a04,0x6a01,0x6a00,0x69fd,0x69fc,0x69fa,0x69f8,0x69f6,
4123   0x69f3,0x69f2,0x69f0,0x69ee,0x69ec,0x69e9,0x69e8,0x69e5,0x69e4,0x69e2,0x69df,0x69de,0x69db,0x69da,0x69d8,0x69d6,
4124   0x69d4,0x69d1,0x69d0,0x69cf,0x69cc,0x69ca,0x69c7,0x69c6,0x69c3,0x69c2,0x69c0,0x69be,0x69bc,0x69b9,0x69b8,0x69b6,
4125   0x69b4,0x69b2,0x69af,0x69ae,0x69ab,0x69aa,0x69a8,0x69a6,0x69a4,0x69a1,0x69a0,0x699e,0x699c,0x699a,0x6997,0x6996,
4126   0x6994,0x6991,0x6990,0x698e,0x698c,0x698a,0x6987,0x6986,0x6983,0x6982,0x6980,0x697e,0x697c,0x6979,0x6978,0x6976,
4127   0x6974,0x6972,0x696f,0x696e,0x696d,0x696a,0x6968,0x6966,0x6964,0x6961,0x6960,0x695e,0x695c,0x695a,0x6957,0x6956,
4128   0x6955,0x6952,0x6950,0x694e,0x694c,0x694b,0x6948,0x6947,0x6944,0x6942,0x6941,0x693e,0x693d,0x693a,0x6938,0x6936,
4129   0x6934,0x6933,0x6930,0x692f,0x692c,0x692a,0x6929,0x6926,0x6925,0x6922,0x6920,0x691f,0x691c,0x691b,0x6918,0x6917,
4130   0x6915,0x6912,0x6911,0x690e,0x690d,0x690a,0x6908,0x6907,0x6904,0x6903,0x6900,0x68ff,0x68fd,0x68fa,0x68f9,0x68f6,
4131   0x68f5,0x68f3,0x68f0,0x68ef,0x68ec,0x68eb,0x68e8,0x68e7,0x68e5,0x68e2,0x68e1,0x68de,0x68dd,0x68db,0x68d9,0x68d7,
4132   0x68d4,0x68d3,0x68d1,0x68cf,0x68cd,0x68ca,0x68c9,0x68c8,0x68c5,0x68c3,0x68c1,0x68bf,0x68bc,0x68bb,0x68b9,0x68b7,
4133   0x68b5,0x68b2,0x68b1,0x68b0,0x68ad,0x68ab,0x68a9,0x68a7,0x68a6,0x68a3,0x68a2,0x689f,0x689d,0x689a,0x6899,0x6898,
4134   0x6895,0x6894,0x6891,0x688f,0x688d,0x688b,0x688a,0x6887,0x6886,0x6883,0x6881,0x6880,0x687d,0x687c,0x6879,0x6878,
4135   0x6876,0x6873,0x6872,0x686f,0x686e,0x686b,0x6869,0x6868,0x6865,0x6864,0x6861,0x6860,0x685e,0x685b,0x685a,0x6857,
4136   0x6856,0x6854,0x6852,0x6850,0x684d,0x684c,0x684b,0x6848,0x6846,0x6844,0x6842,0x6841,0x683e,0x683c,0x683a,0x6838,
4137   0x6837,0x6834,0x6833,0x6830,0x682e,0x682c,0x682a,0x6829,0x6826,0x6825,0x6822,0x6820,0x681f,0x681c,0x681b,0x6818,
4138   0x6817,0x6815,0x6812,0x6811,0x680e,0x680d,0x680b,0x6808,0x6807,0x6804,0x6803,0x6801,0x67ff,0x67fd,0x67fa,0x67f9,
4139   0x67f8,0x67f5,0x67f3,0x67f1,0x67ef,0x67ec,0x67eb,0x67ea,0x67e7,0x67e5,0x67e2,0x67e1,0x67e0,0x67dd,0x67db,0x67d9,
4140   0x67d7,0x67d6,0x67d3,0x67d2,0x67cf,0x67cd,0x67cc,0x67c9,0x67c8,0x67c5,0x67c4,0x67c2,0x67bf,0x67be,0x67bb,0x67ba,
4141   0x67b8,0x67b5,0x67b4,0x67b1,0x67b0,0x67ad,0x67ac,0x67aa,0x67a7,0x67a6,0x67a3,0x67a2,0x67a0,0x679e,0x679c,0x6799,
4142   0x6797,0x6796,0x6793,0x6792,0x6790,0x678e,0x678c,0x6789,0x6788,0x6787,0x6784,0x6782,0x6780,0x677e,0x677d,0x677a,
4143   0x6779,0x6776,0x6774,0x6773,0x6770,0x676f,0x676c,0x676b,0x6769,0x6766,0x6765,0x6762,0x6761,0x675f,0x675d,0x675b,
4144   0x6758,0x6757,0x6756,0x6753,0x6751,0x674f,0x674d,0x674c,0x6749,0x6748,0x6745,0x6743,0x6742,0x673f,0x673e,0x673b,
4145   0x6739,0x6738,0x6735,0x6734,0x6731,0x6730,0x672e,0x672b,0x672a,0x6727,0x6726,0x6724,0x6722,0x6720,0x671d,0x671c,
4146   0x671b,0x6718,0x6716,0x6714,0x6712,0x670f,0x670e,0x670d,0x670a,0x6708,0x6706,0x6704,0x6703,0x6700,0x66ff,0x66fc,
4147   0x66fa,0x66f9,0x66f6,0x66f5,0x66f2,0x66f1,0x66ef,0x66ec,0x66eb,0x66e8,0x66e7,0x66e5,0x66e3,0x66e1,0x66de,0x66dd,
4148   0x66dc,0x66d9,0x66d7,0x66d5,0x66d3,0x66d2,0x66cf,0x66ce,0x66cb,0x66c9,0x66c8,0x66c5,0x66c4,0x66c1,0x66bf,0x66be,
4149   0x66bb,0x66ba,0x66b7,0x66b6,0x66b4,0x66b1,0x66b0,0x66ad,0x66ac,0x66aa,0x66a8,0x66a6,0x66a3,0x66a2,0x66a1,0x669e,
4150   0x669d,0x669a,0x6698,0x6696,0x6694,0x6693,0x6690,0x668f,0x668c,0x668a,0x6689,0x6686,0x6685,0x6682,0x6681,0x667f,
4151   0x667c,0x667b,0x6678,0x6677,0x6675,0x6673,0x6671,0x666e,0x666d,0x666c,0x6669,0x6667,0x6665,0x6663,0x6662,0x665f,
4152   0x665e,0x665b,0x665a,0x6658,0x6655,0x6654,0x6651,0x6650,0x664e,0x664c,0x664a,0x6647,0x6646,0x6645,0x6642,0x6640,
4153   0x663e,0x663c,0x663b,0x6638,0x6637,0x6634,0x6632,0x6631,0x662e,0x662d,0x662a,0x6629,0x6627,0x6624,0x6623,0x6620,
4154   0x661f,0x661d,0x661b,0x6619,0x6616,0x6615,0x6614,0x6611,0x660f,0x660d,0x660b,0x660a,0x6607,0x6606,0x6603,0x6601,
4155   0x6600,0x65fd,0x65fc,0x65f9,0x65f8,0x65f6,0x65f3,0x65f2,0x65ef,0x65ee,0x65ec,0x65ea,0x65e8,0x65e5,0x65e4,0x65e3,
4156   0x65e0,0x65de,0x65dc,0x65da,0x65d9,0x65d6,0x65d5,0x65d2,0x65d0,0x65cf,0x65cc,0x65cb,0x65c8,0x65c7,0x65c5,0x65c2,
4157   0x65c1,0x65be,0x65bd,0x65bb,0x65b9,0x65b7,0x65b4,0x65b3,0x65b2,0x65af,0x65ad,0x65ab,0x65a9,0x65a8,0x65a5,0x65a4,
4158   0x65a2,0x659f,0x659e,0x659c,0x6599,0x6598,0x6595,0x6594,0x6592,0x6590,0x658e,0x658b,0x658a,0x6589,0x6586,0x6584,
4159   0x6582,0x6580,0x657f,0x657c,0x657b,0x6578,0x6577,0x6575,0x6572,0x6571,0x656e,0x656d,0x656b,0x6569,0x6567,0x6566,
4160   0x6563,0x6562,0x655f,0x655d,0x655c,0x6559,0x6558,0x6555,0x6554,0x6552,0x654f,0x654e,0x654b,0x654a,0x6549,0x6546,
4161   0x6544,0x6542,0x6540,0x653f,0x653c,0x653b,0x6538,0x6536,0x6535,0x6532,0x6531,0x652e,0x652d,0x652b,0x6528,0x6527,
4162   0x6526,0x6523,0x6521,0x651f,0x651d,0x651c,0x6519,0x6518,0x6515,0x6514,0x6512,0x650f,0x650e,0x650b,0x650a,0x6508,
4163   0x6506,0x6504,0x6501,0x6500,0x64ff,0x64fc,0x64fa,0x64f8,0x64f6,0x64f5,0x64f2,0x64f1,0x64ee,0x64ec,0x64eb,0x64e8,
4164   0x64e7,0x64e4,0x64e3,0x64e1,0x64df,0x64dd,0x64dc,0x64d9,0x64d8,0x64d5,0x64d3,0x64d2,0x64cf,0x64ce,0x64cb,0x64ca,
4165   0x64c8,0x64c5,0x64c4,0x64c1,0x64c0,0x64be,0x64bc,0x64ba,0x64b7,0x64b6,0x64b5,0x64b2,0x64b1,0x64ae,0x64ac,0x64ab,
4166   0x64a8,0x64a7,0x64a4,0x64a3,0x64a0,0x649f,0x649d,0x649a,0x6499,0x6496,0x6495,0x6493,0x6491,0x648f,0x648e,0x648b,
4167   0x648a,0x6487,0x6486,0x6484,0x6481,0x6480,0x647d,0x647c,0x647a,0x6478,0x6476,0x6473,0x6472,0x6471,0x646e,0x646c,
4168   0x646b,0x6468,0x6467,0x6464,0x6463,0x6461,0x645f,0x645d,0x645a,0x6459,0x6458,0x6455,0x6453,0x6451,0x644f,0x644e,
4169   0x644b,0x644a,0x6447,0x6446,0x6444,0x6441,0x6440,0x643f,0x643c,0x643a,0x6438,0x6436,0x6435,0x6432,0x6431,0x642e,
4170   0x642d,0x642b,0x6428,0x6427,0x6424,0x6423,0x6421,0x641f,0x641d,0x641a,0x6419,0x6418,0x6415,0x6413,0x6412,0x640f,
4171   0x640e,0x640b,0x640a,0x6408,0x6406,0x6404,0x6401,0x6400,0x63ff,0x63fc,0x63fa,0x63f8,0x63f6,0x63f5,0x63f2,0x63f1,
4172   0x63ef,0x63ed,0x63eb,0x63e8,0x63e7,0x63e6,0x63e3,0x63e1,0x63df,0x63dd,0x63dc,0x63d9,0x63d8,0x63d5,0x63d4,0x63d2,
4173   0x63cf,0x63ce,0x63cb,0x63ca,0x63c8,0x63c6,0x63c4,0x63c3,0x63c0,0x63bf,0x63bc,0x63ba,0x63b9,0x63b6,0x63b5,0x63b2,
4174   0x63b0,0x63af,0x63ac,0x63ab,0x63a9,0x63a6,0x63a5,0x63a4,0x63a1,0x639f,0x639d,0x639b,0x639a,0x6397,0x6396,0x6393,
4175   0x6392,0x6390,0x638d,0x638c,0x638b,0x6388,0x6387,0x6384,0x6382,0x6381,0x637e,0x637d,0x637a,0x6379,0x6377,0x6374,
4176   0x6373,0x6370,0x636f,0x636e,0x636b,0x6369,0x6368,0x6365,0x6364,0x6361,0x6360,0x635e,0x635c,0x635a,0x6357,0x6356,
4177   0x6355,0x6352,0x6350,0x634f,0x634c,0x634b,0x6348,0x6347,0x6345,0x6343,0x6341,0x633e,0x633d,0x633c,0x6339,0x6337,
4178   0x6336,0x6333,0x6332,0x632f,0x632e,0x632c,0x632a,0x6328,0x6325,0x6324,0x6323,0x6320,0x631f,0x631c,0x631a,0x6319,
4179   0x6316,0x6315,0x6313,0x6311,0x630f,0x630c,0x630b,0x630a,0x6307,0x6306,0x6303,0x6301,0x6300,0x62fd,0x62fc,0x62fa,
4180   0x62f8,0x62f6,0x62f4,0x62f2,0x62f1,0x62ee,0x62ed,0x62ea,0x62e8,0x62e7,0x62e4,0x62e3,0x62e0,0x62df,0x62dd,0x62db,
4181   0x62d9,0x62d8,0x62d5,0x62d4,0x62d1,0x62cf,0x62ce,0x62cb,0x62ca,0x62c7,0x62c6,0x62c4,0x62c2,0x62c0,0x62bf,0x62bc,
4182   0x62bb,0x62b8,0x62b7,0x62b4,0x62b2,0x62b1,0x62ae,0x62ad,0x62aa,0x62a9,0x62a7,0x62a5,0x62a3,0x62a2,0x629f,0x629e,
4183   0x629b,0x6299,0x6298,0x6295,0x6294,0x6291,0x6290,0x628e,0x628c,0x628a,0x6289,0x6286,0x6285,0x6282,0x6281,0x627f,
4184   0x627c,0x627b,0x6278,0x6277,0x6276,0x6273,0x6271,0x6270,0x626d,0x626c,0x6269,0x6268,0x6266,0x6264,0x6262,0x6261,
4185   0x625e,0x625d,0x625a,0x6259,0x6257,0x6254,0x6253,0x6250,0x624f,0x624d,0x624b,0x6249,0x6248,0x6245,0x6244,0x6241,
4186   0x6240,0x623e,0x623b,0x623a,0x6237,0x6236,0x6235,0x6232,0x6230,0x622f,0x622c,0x622b,0x6228,0x6227,0x6225,0x6223,
4187   0x6221,0x621e,0x621d,0x621c,0x6219,0x6218,0x6216,0x6213,0x6212,0x620f,0x620e,0x620c,0x620a,0x6208,0x6207,0x6204,
4188   0x6203,0x6200,0x61ff,0x61fd,0x61fa,0x61f9,0x61f6,0x61f5,0x61f4,0x61f1,0x61ef,0x61ee,0x61eb,0x61ea,0x61e7,0x61e6,
4189   0x61e4,0x61e2,0x61e0,0x61dd,0x61dc,0x61db,0x61d8,0x61d7,0x61d5,0x61d2,0x61d1,0x61ce,0x61cd,0x61cb,0x61c9,0x61c7,
4190   0x61c5,0x61c2,0x61c1,0x61c0,0x61bd,0x61bc,0x61b9,0x61b7,0x61b6,0x61b3,0x61b2,0x61b1,0x61ae,0x61ac,0x61aa,0x61a8,
4191   0x61a7,0x61a4,0x61a3,0x61a1,0x619f,0x619d,0x619a,0x6199,0x6198,0x6195,0x6194,0x6192,0x618f,0x618e,0x618b,0x618a,
4192   0x6189,0x6186,0x6184,0x6182,0x6180,0x617f,0x617c,0x617b,0x6179,0x6177,0x6175,0x6172,0x6171,0x6170,0x616d,0x616c,
4193   0x616a,0x6167,0x6166,0x6163,0x6162,0x6161,0x615e,0x615c,0x615b,0x6158,0x6157,0x6154,0x6153,0x6151,0x614f,0x614d,
4194   0x614c,0x6149,0x6148,0x6145,0x6144,0x6142,0x613f,0x613e,0x613b,0x613a,0x6139,0x6136,0x6134,0x6133,0x6130,0x612f,
4195   0x612c,0x612b,0x6129,0x6127,0x6125,0x6124,0x6121,0x6120,0x611d,0x611c,0x611a,0x6117,0x6116,0x6115,0x6112,0x6111,
4196   0x610e,0x610c,0x610b,0x6108,0x6107,0x6104,0x6103,0x6101,0x60ff,0x60fd,0x60fc,0x60f9,0x60f8,0x60f5,0x60f4,0x60f2,
4197   0x60ef,0x60ee,0x60ed,0x60ea,0x60e9,0x60e6,0x60e4,0x60e3,0x60e0,0x60df,0x60de,0x60db,0x60d9,0x60d7,0x60d5,0x60d4,
4198   0x60d1,0x60d0,0x60cd,0x60cc,0x60ca,0x60c7,0x60c6,0x60c3,0x60c2,0x60c1,0x60be,0x60bc,0x60bb,0x60b8,0x60b7,0x60b4,
4199   0x60b3,0x60b1,0x60af,0x60ad,0x60ac,0x60a9,0x60a8,0x60a5,0x60a4,0x60a2,0x60a0,0x609e,0x609d,0x609a,0x6099,0x6096,
4200   0x6095,0x6093,0x6090,0x608f,0x608e,0x608b,0x608a,0x6087,0x6085,0x6084,0x6081,0x6080,0x607f,0x607c,0x607a,0x6078,
4201   0x6076,0x6075,0x6072,0x6071,0x606f,0x606d,0x606b,0x6069,0x6067,0x6066,0x6063,0x6062,0x6060,0x605e,0x605c,0x6059,
4202   0x6058,0x6057,0x6054,0x6053,0x6051,0x604e,0x604d,0x604a,0x6049,0x6048,0x6045,0x6043,0x6042,0x603f,0x603e,0x603b,
4203   0x603a,0x6038,0x6036,0x6034,0x6033,0x6030,0x602f,0x602c,0x602b,0x6029,0x6027,0x6025,0x6024,0x6021,0x6020,0x601d,
4204   0x601c,0x601a,0x6017,0x6016,0x6015,0x6012,0x6011,0x600e,0x600c,0x600b,0x6008,0x6007,0x6006,0x6003,0x6001,0x5fff,
4205   0x5ffd,0x5ffc,0x5ff9,0x5ff8,0x5ff6,0x5ff4,0x5ff2,0x5ff0,0x5fee,0x5fed,0x5fea,0x5fe9,0x5fe7,0x5fe5,0x5fe3,0x5fe0,
4206   0x5fde,0x5fdd,0x5fdb,0x5fd9,0x5fd7,0x5fd5,0x5fd3,0x5fd2,0x5fcf,0x5fce,0x5fcc,0x5fca,0x5fc8,0x5fc5,0x5fc4,0x5fc3,
4207   0x5fc0,0x5fbf,0x5fbd,0x5fba,0x5fb9,0x5fb6,0x5fb5,0x5fb4,0x5fb1,0x5fb0,0x5fae,0x5fab,0x5faa,0x5fa7,0x5fa6,0x5fa5,
4208   0x5fa2,0x5fa0,0x5f9f,0x5f9c,0x5f9b,0x5f9a,0x5f97,0x5f95,0x5f93,0x5f91,0x5f90,0x5f8d,0x5f8c,0x5f8a,0x5f88,0x5f86,
4209   0x5f84,0x5f82,0x5f81,0x5f7e,0x5f7d,0x5f7b,0x5f79,0x5f77,0x5f75,0x5f73,0x5f72,0x5f6f,0x5f6e,0x5f6c,0x5f6a,0x5f68,
4210   0x5f67,0x5f64,0x5f63,0x5f60,0x5f5f,0x5f5d,0x5f5a,0x5f59,0x5f58,0x5f55,0x5f54,0x5f51,0x5f50,0x5f4e,0x5f4b,0x5f4a,
4211   0x5f49,0x5f46,0x5f45,0x5f42,0x5f40,0x5f3f,0x5f3c,0x5f3b,0x5f3a,0x5f37,0x5f35,0x5f33,0x5f31,0x5f30,0x5f2d,0x5f2c,
4212   0x5f2b,0x5f28,0x5f26,0x5f25,0x5f22,0x5f21,0x5f1e,0x5f1d,0x5f1b,0x5f19,0x5f17,0x5f16,0x5f13,0x5f12,0x5f0f,0x5f0e,
4213   0x5f0c,0x5f0a,0x5f08,0x5f07,0x5f04,0x5f03,0x5f00,0x5eff,0x5efd,0x5efb,0x5ef9,0x5ef8,0x5ef5,0x5ef4,0x5ef1,0x5ef0,
4214   0x5eee,0x5eeb,0x5eea,0x5ee7,0x5ee6,0x5ee4,0x5ee2,0x5ee0,0x5edf,0x5edc,0x5edb,0x5ed8,0x5ed7,0x5ed5,0x5ed3,0x5ed1,
4215   0x5ed0,0x5ecd,0x5ecc,0x5eca,0x5ec8,0x5ec6,0x5ec4,0x5ec2,0x5ec1,0x5ebe,0x5ebd,0x5ebb,0x5eb9,0x5eb7,0x5eb4,0x5eb3,
4216   0x5eb2,0x5eaf,0x5eae,0x5eac,0x5eaa,0x5ea8,0x5ea7,0x5ea4,0x5ea3,0x5ea0,0x5e9f,0x5e9d,0x5e9a,0x5e99,0x5e98,0x5e95,
4217   0x5e94,0x5e92,0x5e90,0x5e8e,0x5e8b,0x5e8a,0x5e89,0x5e86,0x5e85,0x5e83,0x5e81,0x5e7f,0x5e7c,0x5e7b,0x5e7a,0x5e77,
4218   0x5e76,0x5e74,0x5e71,0x5e70,0x5e6f,0x5e6c,0x5e6b,0x5e68,0x5e67,0x5e65,0x5e62,0x5e61,0x5e60,0x5e5d,0x5e5c,0x5e59,
4219   0x5e58,0x5e56,0x5e53,0x5e52,0x5e51,0x5e4e,0x5e4d,0x5e4b,0x5e48,0x5e47,0x5e44,0x5e43,0x5e42,0x5e3f,0x5e3e,0x5e3c,
4220   0x5e39,0x5e38,0x5e37,0x5e34,0x5e33,0x5e30,0x5e2e,0x5e2d,0x5e2a,0x5e29,0x5e28,0x5e25,0x5e24,0x5e21,0x5e1f,0x5e1e,
4221   0x5e1b,0x5e1a,0x5e19,0x5e16,0x5e15,0x5e13,0x5e10,0x5e0f,0x5e0c,0x5e0b,0x5e0a,0x5e07,0x5e05,0x5e04,0x5e01,0x5e00,
4222   0x5dff,0x5dfc,0x5dfb,0x5df8,0x5df6,0x5df5,0x5df2,0x5df1,0x5df0,0x5ded,0x5deb,0x5de9,0x5de7,0x5de6,0x5de3,0x5de2,
4223   0x5de1,0x5dde,0x5ddc,0x5ddb,0x5dd8,0x5dd7,0x5dd4,0x5dd3,0x5dd2,0x5dcf,0x5dcd,0x5dcc,0x5dc9,0x5dc8,0x5dc5,0x5dc4,
4224   0x5dc2,0x5dc0,0x5dbe,0x5dbd,0x5dba,0x5db9,0x5db8,0x5db5,0x5db3,0x5db1,0x5daf,0x5dae,0x5dab,0x5daa,0x5da9,0x5da6,
4225   0x5da4,0x5da3,0x5da0,0x5d9f,0x5d9c,0x5d9b,0x5d99,0x5d97,0x5d95,0x5d94,0x5d91,0x5d90,0x5d8d,0x5d8c,0x5d8a,0x5d88,
4226   0x5d86,0x5d85,0x5d82,0x5d81,0x5d7f,0x5d7d,0x5d7b,0x5d79,0x5d77,0x5d76,0x5d73,0x5d72,0x5d70,0x5d6e,0x5d6c,0x5d6a,
4227   0x5d68,0x5d67,0x5d64,0x5d63,0x5d61,0x5d5f,0x5d5d,0x5d5c,0x5d59,0x5d58,0x5d55,0x5d54,0x5d52,0x5d50,0x5d4e,0x5d4d,
4228   0x5d4a,0x5d49,0x5d47,0x5d45,0x5d43,0x5d41,0x5d3f,0x5d3e,0x5d3b,0x5d3a,0x5d38,0x5d36,0x5d34,0x5d32,0x5d30,0x5d2f,
4229   0x5d2c,0x5d2b,0x5d29,0x5d27,0x5d25,0x5d24,0x5d21,0x5d20,0x5d1d,0x5d1c,0x5d1a,0x5d18,0x5d16,0x5d15,0x5d12,0x5d11,
4230   0x5d0f,0x5d0e,0x5d0c,0x5d0a,0x5d08,0x5d05,0x5d04,0x5d03,0x5d00,0x5cff,0x5cfd,0x5cfb,0x5cf9,0x5cf8,0x5cf5,0x5cf4,
4231   0x5cf1,0x5cf0,0x5cee,0x5cec,0x5cea,0x5ce9,0x5ce6,0x5ce5,0x5ce3,0x5ce1,0x5cdf,0x5cdd,0x5cdb,0x5cda,0x5cd7,0x5cd6,
4232   0x5cd4,0x5cd2,0x5cd0,0x5ccf,0x5ccc,0x5ccb,0x5cc8,0x5cc7,0x5cc5,0x5cc3,0x5cc1,0x5cc0,0x5cbd,0x5cbc,0x5cba,0x5cb8,
4233   0x5cb6,0x5cb4,0x5cb2,0x5cb1,0x5cae,0x5cad,0x5cab,0x5ca9,0x5ca7,0x5ca6,0x5ca3,0x5ca2,0x5c9f,0x5c9e,0x5c9c,0x5c9a,
4234   0x5c98,0x5c97,0x5c94,0x5c93,0x5c92,0x5c8f,0x5c8d,0x5c8b,0x5c89,0x5c88,0x5c85,0x5c84,0x5c83,0x5c80,0x5c7e,0x5c7d,
4235   0x5c7a,0x5c79,0x5c76,0x5c75,0x5c74,0x5c71,0x5c6f,0x5c6e,0x5c6b,0x5c6a,0x5c69,0x5c66,0x5c65,0x5c62,0x5c60,0x5c5f,
4236   0x5c5c,0x5c5b,0x5c5a,0x5c57,0x5c56,0x5c54,0x5c52,0x5c50,0x5c4d,0x5c4c,0x5c4b,0x5c48,0x5c47,0x5c45,0x5c43,0x5c41,
4237   0x5c40,0x5c3d,0x5c3c,0x5c39,0x5c38,0x5c36,0x5c34,0x5c32,0x5c31,0x5c2e,0x5c2d,0x5c2b,0x5c29,0x5c27,0x5c25,0x5c23,
4238   0x5c22,0x5c21,0x5c1e,0x5c1d,0x5c1b,0x5c18,0x5c17,0x5c14,0x5c13,0x5c12,0x5c0f,0x5c0e,0x5c0c,0x5c0a,0x5c08,0x5c07,
4239   0x5c04,0x5c03,0x5c01,0x5bff,0x5bfd,0x5bfb,0x5bf9,0x5bf8,0x5bf5,0x5bf4,0x5bf2,0x5bf0,0x5bee,0x5bed,0x5bea,0x5be9,
4240   0x5be8,0x5be5,0x5be3,0x5be1,0x5bdf,0x5bde,0x5bdb,0x5bda,0x5bd9,0x5bd6,0x5bd5,0x5bd3,0x5bd0,0x5bcf,0x5bcc,0x5bcb,
4241   0x5bca,0x5bc7,0x5bc6,0x5bc4,0x5bc1,0x5bc0,0x5bbf,0x5bbc,0x5bbb,0x5bb9,0x5bb7,0x5bb5,0x5bb3,0x5bb1,0x5bb0,0x5bad,
4242   0x5bac,0x5baa,0x5ba8,0x5ba6,0x5ba5,0x5ba2,0x5ba1,0x5b9e,0x5b9d,0x5b9b,0x5b99,0x5b97,0x5b96,0x5b93,0x5b92,0x5b91,
4243   0x5b8e,0x5b8c,0x5b8b,0x5b88,0x5b87,0x5b84,0x5b83,0x5b82,0x5b7f,0x5b7e,0x5b7c,0x5b79,0x5b78,0x5b77,0x5b74,0x5b73,
4244   0x5b71,0x5b6f,0x5b6d,0x5b6a,0x5b69,0x5b68,0x5b65,0x5b64,0x5b62,0x5b60,0x5b5e,0x5b5d,0x5b5a,0x5b59,0x5b56,0x5b55,
4245   0x5b53,0x5b51,0x5b4f,0x5b4e,0x5b4b,0x5b4a,0x5b48,0x5b46,0x5b44,0x5b43,0x5b40,0x5b3f,0x5b3c,0x5b3b,0x5b3a,0x5b37,
4246   0x5b36,0x5b34,0x5b32,0x5b31,0x5b2e,0x5b2d,0x5b2b,0x5b29,0x5b27,0x5b26,0x5b23,0x5b22,0x5b1f,0x5b1e,0x5b1c,0x5b1a,
4247   0x5b18,0x5b17,0x5b14,0x5b13,0x5b12,0x5b0f,0x5b0e,0x5b0c,0x5b09,0x5b08,0x5b07,0x5b04,0x5b03,0x5b00,0x5aff,0x5afd,
4248   0x5afb,0x5af9,0x5af8,0x5af5,0x5af4,0x5af2,0x5af0,0x5aee,0x5aed,0x5aea,0x5ae9,0x5ae6,0x5ae5,0x5ae4,0x5ae1,0x5adf,
4249   0x5ade,0x5adb,0x5ada,0x5ad9,0x5ad6,0x5ad5,0x5ad3,0x5ad1,0x5acf,0x5acc,0x5acb,0x5aca,0x5ac7,0x5ac6,0x5ac4,0x5ac2,
4250   0x5ac0,0x5abf,0x5abc,0x5abb,0x5aba,0x5ab7,0x5ab5,0x5ab4,0x5ab1,0x5ab0,0x5aad,0x5aac,0x5aab,0x5aa8,0x5aa7,0x5aa5,
4251   0x5aa2,0x5aa1,0x5aa0,0x5a9d,0x5a9c,0x5a9a,0x5a98,0x5a96,0x5a94,0x5a92,0x5a91,0x5a8e,0x5a8d,0x5a8b,0x5a89,0x5a87,
4252   0x5a86,0x5a83,0x5a82,0x5a81,0x5a7e,0x5a7d,0x5a7a,0x5a78,0x5a77,0x5a74,0x5a73,0x5a72,0x5a6f,0x5a6e,0x5a6c,0x5a6a,
4253   0x5a68,0x5a67,0x5a64,0x5a63,0x5a61,0x5a5f,0x5a5d,0x5a5b,0x5a59,0x5a58,0x5a55,0x5a54,0x5a53,0x5a50,0x5a4e,0x5a4d,
4254   0x5a4c,0x5a49,0x5a48,0x5a45,0x5a44,0x5a42,0x5a40,0x5a3e,0x5a3d,0x5a3a,0x5a39,0x5a37,0x5a35,0x5a33,0x5a32,0x5a2f,
4255   0x5a2e,0x5a2d,0x5a2a,0x5a29,0x5a26,0x5a24,0x5a23,0x5a20,0x5a1f,0x5a1e,0x5a1b,0x5a1a,0x5a18,0x5a16,0x5a14,0x5a13,
4256   0x5a10,0x5a0f,0x5a0e,0x5a0b,0x5a09,0x5a07,0x5a05,0x5a04,0x5a01,0x5a00,0x59ff,0x59fc,0x59fb,0x59f9,0x59f7,0x59f5,
4257   0x59f4,0x59f1,0x59f0,0x59ee,0x59ec,0x59ea,0x59e9,0x59e6,0x59e5,0x59e2,0x59e1,0x59e0,0x59dd,0x59dc,0x59da,0x59d7,
4258   0x59d6,0x59d5,0x59d2,0x59d1,0x59cf,0x59cd,0x59cb,0x59ca,0x59c7,0x59c6,0x59c3,0x59c2,0x59c0,0x59be,0x59bc,0x59bb,
4259   0x59b8,0x59b7,0x59b6,0x59b3,0x59b2,0x59b0,0x59ae,0x59ac,0x59ab,0x59a8,0x59a7,0x59a5,0x59a3,0x59a1,0x599f,0x599d,
4260   0x599c,0x5999,0x5998,0x5997,0x5994,0x5993,0x5991,0x598e,0x598d,0x598c,0x5989,0x5988,0x5986,0x5984,0x5982,0x5980,
4261   0x597e,0x597d,0x597a,0x5979,0x5977,0x5975,0x5973,0x5972,0x596f,0x596e,0x596d,0x596a,0x5969,0x5967,0x5965,0x5963,
4262   0x5961,0x5960,0x595e,0x595c,0x595a,0x5959,0x5956,0x5955,0x5952,0x5951,0x5950,0x594d,0x594b,0x594a,0x5947,0x5946,
4263   0x5945,0x5942,0x5941,0x593f,0x593d,0x593b,0x593a,0x5937,0x5936,0x5935,0x5932,0x5931,0x592f,0x592c,0x592b,0x5928,
4264   0x5927,0x5926,0x5923,0x5922,0x5920,0x591e,0x591c,0x591b,0x5918,0x5917,0x5916,0x5913,0x5912,0x5910,0x590d,0x590c,
4265   0x590b,0x5908,0x5907,0x5905,0x5903,0x5901,0x58ff,0x58fd,0x58fc,0x58f9,0x58f8,0x58f7,0x58f4,0x58f3,0x58f1,0x58ee,
4266   0x58ed,0x58ec,0x58e9,0x58e8,0x58e6,0x58e4,0x58e2,0x58e1,0x58de,0x58dd,0x58dc,0x58d9,0x58d8,0x58d5,0x58d4,0x58d2,
4267   0x58cf,0x58ce,0x58cd,0x58ca,0x58c9,0x58c7,0x58c5,0x58c3,0x58c2,0x58bf,0x58be,0x58bd,0x58ba,0x58b9,0x58b7,0x58b5,
4268   0x58b3,0x58b2,0x58af,0x58ae,0x58ab,0x58aa,0x58a8,0x58a6,0x58a4,0x58a3,0x58a0,0x589f,0x589e,0x589b,0x589a,0x5898,
4269   0x5896,0x5894,0x5893,0x5890,0x588f,0x588d,0x588b,0x5889,0x5888,0x5885,0x5884,0x5881,0x5880,0x587f,0x587c,0x587b,
4270   0x5879,0x5878,0x5875,0x5874,0x5872,0x5870,0x586e,0x586d,0x586a,0x5869,0x5867,0x5865,0x5863,0x5862,0x585f,0x585e,
4271   0x585d,0x585a,0x5859,0x5856,0x5855,0x5853,0x5851,0x584f,0x584e,0x584b,0x584a,0x5849,0x5846,0x5845,0x5843,0x5841,
4272   0x583f,0x583e,0x583b,0x583a,0x5838,0x5836,0x5834,0x5833,0x5830,0x582f,0x582e,0x582b,0x582a,0x5828,0x5826,0x5824,
4273   0x5823,0x5820,0x581f,0x581c,0x581b,0x581a,0x5817,0x5816,0x5814,0x5811,0x5810,0x580f,0x580c,0x580b,0x5809,0x5807,
4274   0x5805,0x5804,0x5801,0x5800,0x57ff,0x57fc,0x57fb,0x57f9,0x57f7,0x57f5,0x57f4,0x57f1,0x57f0,0x57ef,0x57ec,0x57eb,
4275   0x57e9,0x57e6,0x57e5,0x57e2,0x57e1,0x57e0,0x57dd,0x57dc,0x57da,0x57d8,0x57d6,0x57d5,0x57d2,0x57d1,0x57d0,0x57cd,
4276   0x57cc,0x57ca,0x57c8,0x57c6,0x57c5,0x57c2,0x57c1,0x57c0,0x57bd,0x57bb,0x57ba,0x57b7,0x57b6,0x57b5,0x57b2,0x57b1,
4277   0x57af,0x57ad,0x57ab,0x57a9,0x57a7,0x57a6,0x57a3,0x57a2,0x57a1,0x579e,0x579d,0x579b,0x5799,0x5797,0x5796,0x5793,
4278   0x5792,0x578f,0x578e,0x578d,0x578a,0x5789,0x5787,0x5785,0x5783,0x5782,0x577f,0x577e,0x577d,0x577a,0x5779,0x5777,
4279   0x5775,0x5773,0x5772,0x576f,0x576e,0x576d,0x576a,0x5769,0x5767,0x5764,0x5763,0x5762,0x575f,0x575e,0x575c,0x575a,
4280   0x5758,0x5757,0x5754,0x5753,0x5752,0x574f,0x574e,0x574b,0x574a,0x5748,0x5746,0x5744,0x5743,0x5740,0x573f,0x573e,
4281   0x573b,0x573a,0x5738,0x5736,0x5734,0x5733,0x5730,0x572f,0x572e,0x572b,0x572a,0x5728,0x5726,0x5724,0x5723,0x5720,
4282   0x571f,0x571d,0x571b,0x5719,0x5718,0x5715,0x5714,0x5713,0x5710,0x570f,0x570d,0x570b,0x5709,0x5708,0x5705,0x5704,
4283   0x5703,0x5700,0x56ff,0x56fd,0x56fb,0x56f9,0x56f8,0x56f5,0x56f4,0x56f3,0x56f0,0x56ef,0x56ec,0x56eb,0x56e9,0x56e7,
4284   0x56e5,0x56e4,0x56e1,0x56e0,0x56df,0x56dc,0x56da,0x56d9,0x56d6,0x56d5,0x56d4,0x56d1,0x56d0,0x56ce,0x56cc,0x56ca,
4285   0x56c9,0x56c6,0x56c5,0x56c4,0x56c1,0x56c0,0x56be,0x56bc,0x56ba,0x56b9,0x56b6,0x56b5,0x56b4,0x56b1,0x56b0,0x56ae,
4286   0x56ac,0x56aa,0x56a8,0x56a6,0x56a4,0x56a3,0x56a0,0x569f,0x569e,0x569b,0x569a,0x5698,0x5696,0x5694,0x5693,0x5690,
4287   0x568f,0x568e,0x568b,0x568a,0x5688,0x5686,0x5684,0x5683,0x5680,0x567f,0x567e,0x567b,0x567a,0x5678,0x5676,0x5674,
4288   0x5673,0x5670,0x566f,0x566e,0x566b,0x566a,0x5668,0x5666,0x5664,0x5663,0x5660,0x565f,0x565e,0x565b,0x565a,0x5658,
4289   0x5656,0x5654,0x5653,0x5650,0x564f,0x564d,0x564b,0x5649,0x5648,0x5645,0x5644,0x5643,0x5640,0x563f,0x563d,0x563b,
4290   0x5639,0x5638,0x5635,0x5634,0x5633,0x5630,0x562f,0x562d,0x562b,0x5629,0x5628,0x5625,0x5624,0x5623,0x5620,0x561f,
4291   0x561d,0x561b,0x5619,0x5618,0x5615,0x5614,0x5613,0x5610,0x560f,0x560d,0x560b,0x5609,0x5608,0x5605,0x5604,0x5603,
4292   0x5600,0x55ff,0x55fd,0x55fb,0x55f9,0x55f8,0x55f5,0x55f4,0x55f3,0x55f0,0x55ef,0x55ed,0x55eb,0x55e9,0x55e8,0x55e5,
4293   0x55e4,0x55e3,0x55e0,0x55df,0x55dd,0x55db,0x55d9,0x55d8,0x55d5,0x55d4,0x55d3,0x55d0,0x55cf,0x55cd,0x55cb,0x55c9,
4294   0x55c6,0x55c5,0x55c4,0x55c1,0x55c0,0x55be,0x55bc,0x55ba,0x55b9,0x55b6,0x55b5,0x55b4,0x55b1,0x55b0,0x55ae,0x55ac,
4295   0x55ab,0x55a9,0x55a7,0x55a5,0x55a4,0x55a1,0x55a0,0x559f,0x559c,0x559b,0x5599,0x5597,0x5595,0x5594,0x5591,0x5590,
4296   0x558f,0x558c,0x558b,0x5589,0x5587,0x5585,0x5584,0x5581,0x5580,0x557f,0x557c,0x557b,0x5579,0x5577,0x5575,0x5574,
4297   0x5571,0x5570,0x556f,0x556c,0x556b,0x5569,0x5567,0x5565,0x5564,0x5561,0x5560,0x555f,0x555c,0x555b,0x5559,0x5557,
4298   0x5555,0x5554,0x5551,0x5550,0x554f,0x554c,0x554b,0x5549,0x5547,0x5545,0x5544,0x5541,0x5540,0x553f,0x553c,0x553b,
4299   0x5539,0x5537,0x5535,0x5534,0x5531,0x5530,0x552f,0x552c,0x552b,0x5529,0x5527,0x5525,0x5524,0x5521,0x5520,0x551f,
4300   0x551c,0x551b,0x5519,0x5517,0x5515,0x5514,0x5511,0x5510,0x550f,0x550c,0x550b,0x5509,0x5507,0x5505,0x5504,0x5501,
4301   0x5500,0x54ff,0x54fc,0x54fb,0x54f9,0x54f7,0x54f5,0x54f4,0x54f1,0x54f0,0x54ef,0x54ec,0x54eb,0x54e9,0x54e7,0x54e5,
4302   0x54e3,0x54e2,0x54df,0x54de,0x54dc,0x54da,0x54d8,0x54d7,0x54d5,0x54d3,0x54d2,0x54cf,0x54ce,0x54cd,0x54ca,0x54c9,
4303   0x54c7,0x54c5,0x54c3,0x54c2,0x54bf,0x54be,0x54bd,0x54ba,0x54b9,0x54b7,0x54b5,0x54b3,0x54b2,0x54af,0x54ae,0x54ad,
4304   0x54ab,0x54a9,0x54a7,0x54a6,0x54a3,0x54a2,0x54a1,0x549e,0x549d,0x549b,0x5499,0x5497,0x5496,0x5493,0x5492,0x5491,
4305   0x548e,0x548d,0x548b,0x5489,0x5487,0x5486,0x5483,0x5482,0x5481,0x547e,0x547d,0x547c,0x5479,0x5478,0x5476,0x5474,
4306   0x5472,0x5471,0x546e,0x546d,0x546c,0x5469,0x5468,0x5466,0x5464,0x5462,0x5461,0x545e,0x545d,0x545c,0x5459,0x5458,
4307   0x5456,0x5454,0x5452,0x5451,0x544e,0x544d,0x544c,0x5449,0x5448,0x5446,0x5444,0x5442,0x5441,0x543e,0x543d,0x543c,
4308   0x543a,0x5438,0x5436,0x5435,0x5432,0x5431,0x5430,0x542d,0x542c,0x542b,0x5428,0x5427,0x5425,0x5423,0x5421,0x5420,
4309   0x541d,0x541c,0x541b,0x5418,0x5417,0x5415,0x5413,0x5411,0x5410,0x540d,0x540c,0x540b,0x5408,0x5407,0x5405,0x5403,
4310   0x5401,0x5400,0x53fd,0x53fc,0x53fb,0x53f8,0x53f7,0x53f5,0x53f3,0x53f1,0x53f0,0x53ed,0x53ec,0x53eb,0x53e8,0x53e7,
4311   0x53e5,0x53e3,0x53e1,0x53e0,0x53dd,0x53dc,0x53db,0x53d8,0x53d7,0x53d6,0x53d3,0x53d2,0x53d0,0x53ce,0x53cc,0x53cb,
4312   0x53ca,0x53c7,0x53c6,0x53c4,0x53c2,0x53c0,0x53bf,0x53bc,0x53bb,0x53ba,0x53b7,0x53b6,0x53b4,0x53b2,0x53b0,0x53af,
4313   0x53ac,0x53ab,0x53aa,0x53a7,0x53a6,0x53a4,0x53a2,0x53a0,0x539f,0x539c,0x539b,0x539a,0x5397,0x5396,0x5394,0x5392,
4314   0x5390,0x538f,0x538c,0x538b,0x538a,0x5387,0x5386,0x5384,0x5382,0x5381,0x537f,0x537d,0x537b,0x537a,0x5377,0x5376,
4315   0x5375,0x5372,0x5371,0x536f,0x536d,0x536b,0x536a,0x5367,0x5366,0x5365,0x5362,0x5361,0x535f,0x535d,0x535b,0x535a,
4316   0x5359,0x5356,0x5355,0x5353,0x5351,0x534f,0x534e,0x534b,0x534a,0x5349,0x5346,0x5345,0x5343,0x5341,0x533f,0x533e,
4317   0x533b,0x533a,0x5339,0x5336,0x5335,0x5333,0x5331,0x532f,0x532e,0x532c,0x532a,0x5329,0x5326,0x5325,0x5324,0x5321,
4318   0x5320,0x531e,0x531d,0x531a,0x5319,0x5318,0x5315,0x5314,0x5313,0x5310,0x530f,0x530d,0x530b,0x5309,0x5308,0x5305,
4319   0x5304,0x5303,0x5300,0x52ff,0x52fd,0x52fb,0x52f9,0x52f8,0x52f5,0x52f4,0x52f3,0x52f0,0x52ef,0x52ed,0x52ec,0x52e9,
4320   0x52e8,0x52e7,0x52e4,0x52e3,0x52e2,0x52df,0x52de,0x52dc,0x52da,0x52d8,0x52d7,0x52d4,0x52d3,0x52d2,0x52cf,0x52ce,
4321   0x52cc,0x52ca,0x52c8,0x52c7,0x52c4,0x52c3,0x52c2,0x52bf,0x52be,0x52bc,0x52ba,0x52b8,0x52b7,0x52b5,0x52b3,0x52b2,
4322   0x52b1,0x52ae,0x52ad,0x52ab,0x52a9,0x52a7,0x52a6,0x52a3,0x52a2,0x52a1,0x529e,0x529d,0x529b,0x5299,0x5297,0x5296,
4323   0x5293,0x5292,0x5291,0x528e,0x528d,0x528b,0x5289,0x5287,0x5286,0x5284,0x5282,0x5281,0x527e,0x527d,0x527c,0x5279,
4324   0x5278,0x5276,0x5274,0x5272,0x5271,0x5270,0x526d,0x526c,0x526a,0x5268,0x5266,0x5265,0x5262,0x5261,0x5260,0x525d,
4325   0x525c,0x525a,0x5258,0x5257,0x5255,0x5253,0x5251,0x5250,0x524d,0x524c,0x524b,0x5248,0x5247,0x5245,0x5243,0x5241,
4326   0x5241,0x523e,0x523d,0x523b,0x5239,0x5237,0x5236,0x5233,0x5232,0x5231,0x522e,0x522d,0x522c,0x5229,0x5228,0x5226,
4327   0x5224,0x5222,0x5221,0x521e,0x521d,0x521c,0x5219,0x5218,0x5216,0x5214,0x5212,0x5211,0x5210,0x520d,0x520c,0x520b,
4328   0x5208,0x5207,0x5205,0x5203,0x5201,0x5200,0x51fd,0x51fc,0x51fb,0x51f8,0x51f7,0x51f5,0x51f3,0x51f1,0x51f0,0x51ee,
4329   0x51ec,0x51eb,0x51e8,0x51e7,0x51e6,0x51e4,0x51e2,0x51e0,0x51df,0x51dc,0x51db,0x51da,0x51d7,0x51d6,0x51d4,0x51d2,
4330   0x51d0,0x51cf,0x51cd,0x51cb,0x51ca,0x51c7,0x51c6,0x51c5,0x51c2,0x51c1,0x51bf,0x51bd,0x51bb,0x51ba,0x51b9,0x51b6,
4331   0x51b5,0x51b3,0x51b1,0x51af,0x51ae,0x51ac,0x51aa,0x51a9,0x51a6,0x51a5,0x51a4,0x51a1,0x51a0,0x519e,0x519c,0x519a,
4332   0x5199,0x5196,0x5195,0x5194,0x5191,0x5190,0x518e,0x518d,0x518a,0x5189,0x5188,0x5185,0x5184,0x5183,0x5180,0x517f,
4333   0x517d,0x517b,0x5179,0x5178,0x5175,0x5174,0x5173,0x5170,0x516f,0x516d,0x516b,0x5169,0x5168,0x5166,0x5164,0x5163,
4334   0x5161,0x515f,0x515d,0x515c,0x515a,0x5158,0x5157,0x5156,0x5153,0x5152,0x5150,0x514e,0x514c,0x514b,0x5148,0x5147,
4335   0x5146,0x5143,0x5142,0x5141,0x513e,0x513d,0x513b,0x5139,0x5137,0x5136,0x5135,0x5132,0x5131,0x512f,0x512d,0x512b,
4336   0x512a,0x5127,0x5126,0x5125,0x5122,0x5121,0x5120,0x511d,0x511c,0x511a,0x5118,0x5116,0x5115,0x5114,0x5111,0x5110,
4337   0x510e,0x510c,0x510b,0x5109,0x5107,0x5105,0x5104,0x5101,0x5100,0x50ff,0x50fc,0x50fb,0x50f9,0x50f7,0x50f5,0x50f4,
4338   0x50f3,0x50f0,0x50ef,0x50ee,0x50eb,0x50ea,0x50e8,0x50e6,0x50e4,0x50e3,0x50e0,0x50df,0x50de,0x50db,0x50da,0x50d9,
4339   0x50d6,0x50d5,0x50d3,0x50d1,0x50cf,0x50ce,0x50cd,0x50ca,0x50c9,0x50c7,0x50c5,0x50c3,0x50c2,0x50bf,0x50be,0x50bd,
4340   0x50ba,0x50b9,0x50b8,0x50b5,0x50b4,0x50b2,0x50b0,0x50ae,0x50ad,0x50ac,0x50a9,0x50a8,0x50a6,0x50a4,0x50a3,0x50a1,
4341   0x509f,0x509d,0x509c,0x5099,0x5098,0x5097,0x5094,0x5093,0x5091,0x508f,0x508d,0x508c,0x508b,0x5088,0x5087,0x5086,
4342   0x5083,0x5082,0x507f,0x507e,0x507d,0x507a,0x5079,0x5077,0x5076,0x5074,0x5072,0x5071,0x506e,0x506d,0x506c,0x5069,
4343   0x5068,0x5066,0x5064,0x5062,0x5061,0x505f,0x505d,0x505c,0x505b,0x5058,0x5057,0x5055,0x5053,0x5051,0x5050,0x504d,
4344   0x504c,0x504b,0x5048,0x5047,0x5046,0x5043,0x5042,0x5040,0x503f,0x503c,0x503b,0x503a,0x5037,0x5036,0x5035,0x5032,
4345   0x5031,0x502f,0x502d,0x502b,0x502a,0x5027,0x5026,0x5025,0x5023,0x5021,0x5020,0x501e,0x501c,0x501a,0x5019,0x5016,
4346   0x5015,0x5014,0x5011,0x5010,0x500e,0x500c,0x500b,0x5009,0x5008,0x5005,0x5004,0x5003,0x5000,0x4fff,0x4ffd,0x4ffb,
4347   0x4ff9,0x4ff8,0x4ff6,0x4ff4,0x4ff3,0x4ff0,0x4fef,0x4fee,0x4fec,0x4fea,0x4fe8,0x4fe7,0x4fe4,0x4fe3,0x4fe2,0x4fdf,
4348   0x4fde,0x4fdd,0x4fda,0x4fd9,0x4fd7,0x4fd5,0x4fd3,0x4fd2,0x4fd1,0x4fce,0x4fcd,0x4fcc,0x4fc9,0x4fc8,0x4fc6,0x4fc4,
4349   0x4fc2,0x4fc1,0x4fbe,0x4fbd,0x4fbc,0x4fb9,0x4fb8,0x4fb7,0x4fb5,0x4fb3,0x4fb1,0x4fb0,0x4fad,0x4fac,0x4fab,0x4fa8,
4350   0x4fa6,0x4fa5,0x4fa4,0x4fa1,0x4fa0,0x4f9e,0x4f9c,0x4f9a,0x4f99,0x4f96,0x4f95,0x4f94,0x4f93,0x4f90,0x4f8f,0x4f8d,
4351   0x4f8b,0x4f89,0x4f88,0x4f85,0x4f84,0x4f83,0x4f80,0x4f7f,0x4f7e,0x4f7c,0x4f7a,0x4f78,0x4f77,0x4f74,0x4f73,0x4f72,
4352   0x4f6f,0x4f6e,0x4f6d,0x4f6a,0x4f69,0x4f67,0x4f66,0x4f63,0x4f62,0x4f61,0x4f5e,0x4f5d,0x4f5c,0x4f59,0x4f58,0x4f56,
4353   0x4f54,0x4f52,0x4f51,0x4f50,0x4f4d,0x4f4c,0x4f4b,0x4f48,0x4f47,0x4f45,0x4f43,0x4f41,0x4f40,0x4f3e,0x4f3c,0x4f3b,
4354   0x4f3a,0x4f37,0x4f36,0x4f34,0x4f32,0x4f30,0x4f2f,0x4f2c,0x4f2b,0x4f2a,0x4f27,0x4f26,0x4f25,0x4f22,0x4f21,0x4f1f,
4355   0x4f1e,0x4f1b,0x4f1a,0x4f19,0x4f16,0x4f15,0x4f14,0x4f11,0x4f10,0x4f0e,0x4f0c,0x4f0a,0x4f09,0x4f08,0x4f05,0x4f04,
4356   0x4f03,0x4f00,0x4eff,0x4efd,0x4efb,0x4ef9,0x4ef8,0x4ef6,0x4ef4,0x4ef3,0x4ef2,0x4eef,0x4eee,0x4eec,0x4eea,0x4ee8,
4357   0x4ee7,0x4ee5,0x4ee3,0x4ee2,0x4edf,0x4ede,0x4edd,0x4edb,0x4ed9,0x4ed7,0x4ed6,0x4ed4,0x4ed2,0x4ed1,0x4ece,0x4ecd,
4358   0x4ecc,0x4ec9,0x4ec8,0x4ec6,0x4ec4,0x4ec2,0x4ec1,0x4ebe,0x4ebd,0x4ebc,0x4eb9,0x4eb8,0x4eb7,0x4eb5,0x4eb3,0x4eb1,
4359   0x4eb0,0x4eae,0x4eac,0x4eab,0x4ea8,0x4ea7,0x4ea6,0x4ea3,0x4ea2,0x4ea0,0x4e9f,0x4e9d,0x4e9b,0x4e9a,0x4e97,0x4e96,
4360   0x4e95,0x4e92,0x4e91,0x4e90,0x4e8e,0x4e8c,0x4e8a,0x4e89,0x4e86,0x4e85,0x4e84,0x4e81,0x4e80,0x4e7f,0x4e7c,0x4e7b,
4361   0x4e79,0x4e78,0x4e75,0x4e74,0x4e73,0x4e70,0x4e6f,0x4e6e,0x4e6b,0x4e6a,0x4e68,0x4e67,0x4e64,0x4e63,0x4e62,0x4e5f,
4362   0x4e5e,0x4e5d,0x4e5a,0x4e59,0x4e57,0x4e55,0x4e54,0x4e52,0x4e51,0x4e4e,0x4e4d,0x4e4c,0x4e49,0x4e48,0x4e46,0x4e44,
4363   0x4e43,0x4e41,0x4e40,0x4e3d,0x4e3c,0x4e3b,0x4e38,0x4e37,0x4e35,0x4e33,0x4e32,0x4e30,0x4e2e,0x4e2c,0x4e2b,0x4e2a,
4364   0x4e27,0x4e26,0x4e25,0x4e22,0x4e21,0x4e1f,0x4e1d,0x4e1b,0x4e1a,0x4e19,0x4e16,0x4e15,0x4e14,0x4e11,0x4e10,0x4e0e,
4365   0x4e0c,0x4e0a,0x4e09,0x4e07,0x4e05,0x4e04,0x4e03,0x4e00,0x4dff,0x4dfd,0x4dfb,0x4df9,0x4df8,0x4df6,0x4df4,0x4df3,
4366   0x4df2,0x4def,0x4dee,0x4dec,0x4dea,0x4de9,0x4de7,0x4de5,0x4de3,0x4de2,0x4ddf,0x4dde,0x4ddd,0x4ddb,0x4dd9,0x4dd8,
4367   0x4dd6,0x4dd4,0x4dd2,0x4dd1,0x4dce,0x4dcd,0x4dcc,0x4dc9,0x4dc8,0x4dc7,0x4dc5,0x4dc3,0x4dc1,0x4dc0,0x4dbd,0x4dbc,
4368   0x4dbb,0x4db8,0x4db7,0x4db6,0x4db4,0x4db2,0x4db0,0x4daf,0x4dad,0x4dab,0x4daa,0x4da7,0x4da6,0x4da5,0x4da2,0x4da1,
4369   0x4d9f,0x4d9e,0x4d9c,0x4d9a,0x4d99,0x4d96,0x4d95,0x4d94,0x4d91,0x4d90,0x4d8e,0x4d8d,0x4d8b,0x4d89,0x4d88,0x4d85,
4370   0x4d84,0x4d83,0x4d80,0x4d7f,0x4d7e,0x4d7b,0x4d7a,0x4d78,0x4d77,0x4d74,0x4d73,0x4d72,0x4d6f,0x4d6e,0x4d6d,0x4d6a,
4371   0x4d69,0x4d67,0x4d66,0x4d63,0x4d62,0x4d61,0x4d5e,0x4d5d,0x4d5c,0x4d59,0x4d58,0x4d56,0x4d54,0x4d52,0x4d51,0x4d50,
4372   0x4d4d,0x4d4c,0x4d4b,0x4d48,0x4d47,0x4d45,0x4d43,0x4d42,0x4d40,0x4d3f,0x4d3c,0x4d3b,0x4d3a,0x4d37,0x4d36,0x4d34,
4373   0x4d32,0x4d31,0x4d2f,0x4d2d,0x4d2b,0x4d2a,0x4d29,0x4d26,0x4d25,0x4d24,0x4d21,0x4d20,0x4d1e,0x4d1c,0x4d1a,0x4d19,
4374   0x4d17,0x4d16,0x4d15,0x4d12,0x4d11,0x4d10,0x4d0d,0x4d0c,0x4d0a,0x4d09,0x4d07,0x4d05,0x4d04,0x4d01,0x4d00,0x4cff,
4375   0x4cfc,0x4cfb,0x4cf9,0x4cf8,0x4cf6,0x4cf4,0x4cf3,0x4cf0,0x4cef,0x4cee,0x4ceb,0x4cea,0x4ce9,0x4ce7,0x4ce5,0x4ce3,
4376   0x4ce2,0x4cdf,0x4cde,0x4cdd,0x4cda,0x4cd9,0x4cd8,0x4cd6,0x4cd4,0x4cd2,0x4cd1,0x4ccf,0x4ccd,0x4ccc,0x4cc9,0x4cc8,
4377   0x4cc7,0x4cc5,0x4cc3,0x4cc2,0x4cc0,0x4cbe,0x4cbc,0x4cbb,0x4cb8,0x4cb7,0x4cb6,0x4cb5,0x4cb2,0x4cb1,0x4caf,0x4cad,
4378   0x4cab,0x4caa,0x4ca8,0x4ca6,0x4ca5,0x4ca2,0x4ca1,0x4ca0,0x4c9e,0x4c9c,0x4c9b,0x4c99,0x4c97,0x4c95,0x4c94,0x4c91,
4379   0x4c90,0x4c8f,0x4c8e,0x4c8b,0x4c8a,0x4c88,0x4c86,0x4c84,0x4c83,0x4c81,0x4c7f,0x4c7e,0x4c7d,0x4c7a,0x4c79,0x4c77,
4380   0x4c75,0x4c74,0x4c72,0x4c70,0x4c6e,0x4c6d,0x4c6c,0x4c69,0x4c68,0x4c67,0x4c64,0x4c63,0x4c61,0x4c5f,0x4c5d,0x4c5c,
4381   0x4c5b,0x4c58,0x4c57,0x4c56,0x4c53,0x4c52,0x4c50,0x4c4e,0x4c4c,0x4c4b,0x4c4a,0x4c47,0x4c46,0x4c45,0x4c42,0x4c41,
4382   0x4c40,0x4c3e,0x4c3c,0x4c3a,0x4c39,0x4c38,0x4c35,0x4c34,0x4c33,0x4c30,0x4c2f,0x4c2d,0x4c2b,0x4c2a,0x4c28,0x4c27,
4383   0x4c24,0x4c23,0x4c22,0x4c1f,0x4c1e,0x4c1d,0x4c1a,0x4c19,0x4c17,0x4c16,0x4c13,0x4c12,0x4c11,0x4c0e,0x4c0d,0x4c0c,
4384   0x4c0a,0x4c08,0x4c06,0x4c05,0x4c03,0x4c01,0x4c00,0x4bfd,0x4bfc,0x4bfb,0x4bfa,0x4bf7,0x4bf6,0x4bf4,0x4bf2,0x4bf0,
4385   0x4bef,0x4bed,0x4beb,0x4bea,0x4be9,0x4be6,0x4be5,0x4be3,0x4be1,0x4be0,0x4bde,0x4bdc,0x4bda,0x4bd9,0x4bd8,0x4bd5,
4386   0x4bd4,0x4bd3,0x4bd0,0x4bcf,0x4bcd,0x4bcc,0x4bca,0x4bc8,0x4bc7,0x4bc4,0x4bc3,0x4bc2,0x4bbf,0x4bbe,0x4bbd,0x4bbb,
4387   0x4bb9,0x4bb7,0x4bb6,0x4bb3,0x4bb2,0x4bb1,0x4bae,0x4bad,0x4bac,0x4baa,0x4ba8,0x4ba7,0x4ba5,0x4ba3,0x4ba1,0x4ba0,
4388   0x4b9f,0x4b9c,0x4b9b,0x4b9a,0x4b97,0x4b96,0x4b94,0x4b92,0x4b90,0x4b8f,0x4b8e,0x4b8b,0x4b8a,0x4b89,0x4b86,0x4b85,
4389   0x4b84,0x4b81,0x4b80,0x4b7e,0x4b7d,0x4b7a,0x4b79,0x4b78,0x4b75,0x4b74,0x4b73,0x4b70,0x4b6f,0x4b6d,0x4b6c,0x4b6a,
4390   0x4b69,0x4b66,0x4b65,0x4b64,0x4b62,0x4b60,0x4b5e,0x4b5d,0x4b5b,0x4b59,0x4b58,0x4b57,0x4b54,0x4b53,0x4b51,0x4b4f,
4391   0x4b4e,0x4b4c,0x4b4a,0x4b48,0x4b47,0x4b46,0x4b43,0x4b42,0x4b41,0x4b3e,0x4b3d,0x4b3b,0x4b3a,0x4b38,0x4b36,0x4b35,
4392   0x4b32,0x4b31,0x4b30,0x4b2d,0x4b2c,0x4b2b,0x4b29,0x4b27,0x4b25,0x4b24,0x4b22,0x4b20,0x4b1f,0x4b1e,0x4b1b,0x4b1a,
4393   0x4b19,0x4b16,0x4b15,0x4b13,0x4b12,0x4b10,0x4b0e,0x4b0d,0x4b0a,0x4b09,0x4b08,0x4b05,0x4b04,0x4b03,0x4b01,0x4aff,
4394   0x4afd,0x4afc,0x4afa,0x4af8,0x4af7,0x4af6,0x4af3,0x4af2,0x4af0,0x4aee,0x4aed,0x4aeb,0x4ae9,0x4ae7,0x4ae6,0x4ae5,
4395   0x4ae2,0x4ae1,0x4ae0,0x4add,0x4adc,0x4adb,0x4ad9,0x4ad7,0x4ad5,0x4ad4,0x4ad1,0x4ad0,0x4acf,0x4ace,0x4acb,0x4aca,
4396   0x4ac8,0x4ac6,0x4ac5,0x4ac3,0x4ac1,0x4abf,0x4abe,0x4abd,0x4aba,0x4ab9,0x4ab8,0x4ab5,0x4ab4,0x4ab2,0x4ab1,0x4aaf,
4397   0x4aad,0x4aac,0x4aa9,0x4aa8,0x4aa7,0x4aa4,0x4aa3,0x4aa2,0x4aa0,0x4a9e,0x4a9c,0x4a9b,0x4a99,0x4a97,0x4a96,0x4a95,
4398   0x4a93,0x4a90,0x4a8f,0x4a8e,0x4a8b,0x4a8a,0x4a89,0x4a86,0x4a85,0x4a83,0x4a82,0x4a80,0x4a7e,0x4a7d,0x4a7a,0x4a79,
4399   0x4a78,0x4a77,0x4a74,0x4a73,0x4a71,0x4a6f,0x4a6e,0x4a6c,0x4a6b,0x4a68,0x4a67,0x4a66,0x4a63,0x4a62,0x4a61,0x4a5f,
4400   0x4a5d,0x4a5c,0x4a5a,0x4a58,0x4a56,0x4a55,0x4a54,0x4a51,0x4a50,0x4a4f,0x4a4c,0x4a4b,0x4a49,0x4a47,0x4a46,0x4a44,
4401   0x4a43,0x4a40,0x4a3f,0x4a3e,0x4a3b,0x4a3a,0x4a39,0x4a37,0x4a35,0x4a34,0x4a32,0x4a30,0x4a2e,0x4a2d,0x4a2c,0x4a29,
4402   0x4a28,0x4a27,0x4a24,0x4a23,0x4a22,0x4a20,0x4a1e,0x4a1c,0x4a1b,0x4a18,0x4a17,0x4a16,0x4a15,0x4a12,0x4a11,0x4a0f,
4403   0x4a0d,0x4a0c,0x4a0a,0x4a09,0x4a06,0x4a05,0x4a04,0x4a01,0x4a00,0x49ff,0x49fc,0x49fb,0x49fa,0x49f8,0x49f6,0x49f4,
4404   0x49f3,0x49f1,0x49ef,0x49ee,0x49ed,0x49ea,0x49e9,0x49e8,0x49e5,0x49e4,0x49e2,0x49e1,0x49de,0x49dd,0x49dc,0x49d9,
4405   0x49d8,0x49d7,0x49d5,0x49d3,0x49d2,0x49d0,0x49ce,0x49cc,0x49cb,0x49ca,0x49c7,0x49c6,0x49c5,0x49c2,0x49c1,0x49c0,
4406   0x49bd,0x49bc,0x49ba,0x49b8,0x49b6,0x49b5,0x49b4,0x49b1,0x49b0,0x49af,0x49ac,0x49ab,0x49aa,0x49a8,0x49a6,0x49a5,
4407   0x49a3,0x49a1,0x499f,0x499e,0x499d,0x499a,0x4999,0x4998,0x4995,0x4994,0x4993,0x4991,0x498f,0x498d,0x498c,0x498a,
4408   0x4988,0x4987,0x4986,0x4983,0x4982,0x4981,0x497e,0x497d,0x497b,0x497a,0x4978,0x4976,0x4975,0x4972,0x4971,0x4970,
4409   0x496f,0x496c,0x496b,0x4969,0x4967,0x4966,0x4964,0x4963,0x4960,0x495f,0x495e,0x495b,0x495a,0x4959,0x4957,0x4955,
4410   0x4954,0x4952,0x4950,0x494e,0x494d,0x494c,0x4949,0x4948,0x4947,0x4944,0x4943,0x4942,0x4940,0x493e,0x493c,0x493b,
4411   0x4939,0x4937,0x4936,0x4935,0x4932,0x4931,0x4930,0x492d,0x492c,0x492a,0x4929,0x4927,0x4925,0x4924,0x4921,0x4920,
4412   0x491f,0x491e,0x491b,0x491a,0x4918,0x4916,0x4915,0x4913,0x4912,0x490f,0x490e,0x490d,0x490a,0x4909,0x4908,0x4906,
4413   0x4904,0x4903,0x4901,0x48ff,0x48fd,0x48fc,0x48fb,0x48f8,0x48f7,0x48f6,0x48f3,0x48f2,0x48f1,0x48ef,0x48ed,0x48eb,
4414   0x48ea,0x48e8,0x48e6,0x48e5,0x48e4,0x48e1,0x48e0,0x48df,0x48dc,0x48db,0x48d9,0x48d8,0x48d6,0x48d4,0x48d3,0x48d0,
4415   0x48cf,0x48ce,0x48cd,0x48ca,0x48c9,0x48c7,0x48c5,0x48c4,0x48c2,0x48c1,0x48be,0x48bd,0x48bc,0x48b9,0x48b8,0x48b7,
4416   0x48b5,0x48b3,0x48b2,0x48b0,0x48ae,0x48ac,0x48ab,0x48aa,0x48a7,0x48a6,0x48a5,0x48a2,0x48a1,0x48a0,0x489e,0x489c,
4417   0x489a,0x4899,0x4897,0x4895,0x4894,0x4893,0x4890,0x488f,0x488e,0x488b,0x488a,0x4888,0x4887,0x4885,0x4883,0x4882,
4418   0x4881,0x487e,0x487d,0x487c,0x4879,0x4878,0x4876,0x4875,0x4873,0x4871,0x4870,0x486d,0x486c,0x486b,0x486a,0x4867,
4419   0x4866,0x4864,0x4862,0x4861,0x485f,0x485e,0x485c,0x485a,0x4859,0x4856,0x4855,0x4854,0x4853,0x4850,0x484f,0x484d,
4420   0x484b,0x484a,0x4848,0x4847,0x4844,0x4843,0x4842,0x483f,0x483e,0x483d,0x483b,0x4839,0x4838,0x4836,0x4834,0x4832,
4421   0x4831,0x4830,0x482d,0x482c,0x482b,0x4828,0x4827,0x4826,0x4824,0x4822,0x4820,0x481f,0x481d,0x481b,0x481a,0x4819,
4422   0x4817,0x4816,0x4813,0x4812,0x4811,0x480f,0x480d,0x480c,0x480a,0x4808,0x4806,0x4805,0x4804,0x4801,0x4800,0x47ff,
4423   0x47fd,0x47fb,0x47fa,0x47f8,0x47f6,0x47f4,0x47f3,0x47f2,0x47ef,0x47ee,0x47ed,0x47ea,0x47e9,0x47e8,0x47e6,0x47e4,
4424   0x47e3,0x47e1,0x47df,0x47dd,0x47dc,0x47db,0x47d8,0x47d7,0x47d6,0x47d3,0x47d2,0x47d1,0x47cf,0x47cd,0x47cb,0x47ca,
4425   0x47c9,0x47c6,0x47c5,0x47c4,0x47c1,0x47c0,0x47bf,0x47bd,0x47bb,0x47ba,0x47b8,0x47b6,0x47b4,0x47b3,0x47b2,0x47af,
4426   0x47ae,0x47ad,0x47aa,0x47a9,0x47a8,0x47a6,0x47a4,0x47a2,0x47a1,0x479f,0x479d,0x479c,0x479b,0x4798,0x4797,0x4796,
4427   0x4794,0x4792,0x4791,0x478f,0x478d,0x478b,0x478a,0x4789,0x4786,0x4785,0x4784,0x4781,0x4780,0x477f,0x477d,0x477b,
4428   0x4779,0x4778,0x4776,0x4774,0x4773,0x4772,0x476f,0x476e,0x476d,0x476a,0x4769,0x4768,0x4766,0x4764,0x4762,0x4761,
4429   0x4760,0x475d,0x475c,0x475b,0x4758,0x4757,0x4756,0x4754,0x4752,0x4750,0x474f,0x474d,0x474b,0x474a,0x4749,0x4746,
4430   0x4745,0x4744,0x4742,0x4740,0x473f,0x473d,0x473c,0x4739,0x4738,0x4737,0x4734,0x4733,0x4732,0x4731,0x472e,0x472d,
4431   0x472b,0x472a,0x4728,0x4726,0x4725,0x4722,0x4721,0x4720,0x471f,0x471c,0x471b,0x471a,0x4717,0x4716,0x4714,0x4713,
4432   0x4711,0x470f,0x470e,0x470d,0x470a,0x4709,0x4708,0x4705,0x4704,0x4703,0x4701,0x46ff,0x46fd,0x46fc,0x46fa,0x46f8,
4433   0x46f7,0x46f6,0x46f3,0x46f2,0x46f1,0x46ef,0x46ed,0x46ec,0x46ea,0x46e8,0x46e6,0x46e5,0x46e4,0x46e1,0x46e0,0x46df,
4434   0x46de,0x46db,0x46da,0x46d8,0x46d6,0x46d5,0x46d3,0x46d2,0x46cf,0x46ce,0x46cd,0x46ca,0x46c9,0x46c8,0x46c7,0x46c4,
4435   0x46c3,0x46c1,0x46c0,0x46be,0x46bc,0x46bb,0x46b8,0x46b7,0x46b6,0x46b5,0x46b2,0x46b1,0x46b0,0x46ad,0x46ac,0x46aa,
4436   0x46a9,0x46a7,0x46a5,0x46a4,0x46a3,0x46a0,0x469f,0x469e,0x469b,0x469a,0x4699,0x4697,0x4695,0x4693,0x4692,0x4690,
4437   0x468e,0x468d,0x468c,0x4689,0x4688,0x4687,0x4685,0x4683,0x4682,0x4680,0x467e,0x467c,0x467b,0x467a,0x4677,0x4676,
4438   0x4675,0x4673,0x4671,0x4670,0x466e,0x466c,0x466b,0x466a,0x4667,0x4666,0x4665,0x4662,0x4661,0x4660,0x465e,0x465c,
4439   0x465a,0x4659,0x4658,0x4655,0x4654,0x4653,0x4650,0x464f,0x464e,0x464c,0x464a,0x4649,0x4647,0x4646,0x4643,0x4642,
4440   0x4641,0x463e,0x463d,0x463c,0x463b,0x4638,0x4637,0x4635,0x4634,0x4632,0x4630,0x462f,0x462d,0x462b,0x462a,0x4629,
4441   0x4626,0x4625,0x4624,0x4622,0x4620,0x461f,0x461d,0x461b,0x4619,0x4618,0x4617,0x4614,0x4613,0x4612,0x4611,0x460e,
4442   0x460d,0x460b,0x4609,0x4608,0x4606,0x4605,0x4603,0x4601,0x4600,0x45ff,0x45fc,0x45fb,0x45fa,0x45f7,0x45f6,0x45f5,
4443   0x45f3,0x45f1,0x45ef,0x45ee,0x45ed,0x45ea,0x45e9,0x45e8,0x45e5,0x45e4,0x45e3,0x45e1,0x45df,0x45de,0x45dc,0x45db,
4444   0x45d9,0x45d7,0x45d6,0x45d3,0x45d2,0x45d1,0x45d0,0x45cd,0x45cc,0x45cb,0x45c9,0x45c7,0x45c5,0x45c4,0x45c2,0x45c0,
4445   0x45bf,0x45be,0x45bb,0x45ba,0x45b9,0x45b7,0x45b5,0x45b4,0x45b2,0x45b0,0x45af,0x45ad,0x45ac,0x45a9,0x45a8,0x45a7,
4446   0x45a5,0x45a3,0x45a1,0x45a0,0x459f,0x459c,0x459b,0x459a,0x4598,0x4596,0x4595,0x4593,0x4592,0x458f,0x458e,0x458d,
4447   0x458a,0x4589,0x4588,0x4587,0x4584,0x4583,0x4581,0x4580,0x457e,0x457c,0x457b,0x4579,0x4577,0x4576,0x4575,0x4572,
4448   0x4571,0x4570,0x456e,0x456c,0x456b,0x4569,0x4568,0x4566,0x4564,0x4563,0x4560,0x455f,0x455e,0x455d,0x455a,0x4559,
4449   0x4558,0x4556,0x4554,0x4553,0x4551,0x454f,0x454d,0x454c,0x454b,0x4548,0x4547,0x4546,0x4545,0x4542,0x4541,0x453f,
4450   0x453e,0x453c,0x453a,0x4539,0x4537,0x4535,0x4534,0x4533,0x4530,0x452f,0x452e,0x452c,0x452a,0x4529,0x4527,0x4525,
4451   0x4524,0x4522,0x4521,0x451e,0x451d,0x451c,0x451b,0x4518,0x4517,0x4516,0x4513,0x4512,0x4511,0x450f,0x450d,0x450b,
4452   0x450a,0x4509,0x4506,0x4505,0x4504,0x4503,0x4500,0x44ff,0x44fd,0x44fb,0x44fa,0x44f8,0x44f7,0x44f5,0x44f3,0x44f2,
4453   0x44f1,0x44ee,0x44ed,0x44ec,0x44e9,0x44e8,0x44e7,0x44e5,0x44e3,0x44e2,0x44e0,0x44df,0x44dc,0x44db,0x44da,0x44d9,
4454   0x44d6,0x44d5,0x44d2,0x44d1,0x44d0,0x44ce,0x44cc,0x44cb,0x44c9,0x44c8,0x44c5,0x44c4,0x44c3,0x44c2,0x44bf,0x44be,
4455   0x44bd,0x44ba,0x44b9,0x44b8,0x44b6,0x44b4,0x44b2,0x44b1,0x44b0,0x44ad,0x44ac,0x44ab,0x44aa,0x44a7,0x44a6,0x44a5,
4456   0x44a3,0x44a1,0x449f,0x449e,0x449c,0x449a,0x4499,0x4498,0x4495,0x4494,0x4493,0x4492,0x448f,0x448e,0x448c,0x448b,
4457   0x4489,0x4487,0x4486,0x4484,0x4482,0x4481,0x4480,0x447d,0x447c,0x447b,0x447a,0x4477,0x4476,0x4474,0x4473,0x4471,
4458   0x446f,0x446e,0x446c,0x446a,0x4469,0x4468,0x4465,0x4464,0x4463,0x4461,0x445f,0x445e,0x445c,0x445b,0x4459,0x4457,
4459   0x4456,0x4454,0x4452,0x4451,0x4450,0x444d,0x444c,0x444b,0x4449,0x4447,0x4446,0x4444,0x4443,0x4441,0x443f,0x443e,
4460   0x443d,0x443a,0x4439,0x4438,0x4435,0x4434,0x4433,0x4431,0x442f,0x442e,0x442c,0x442b,0x4429,0x4427,0x4426,0x4425,
4461   0x4422,0x4421,0x4420,0x441d,0x441c,0x441b,0x4419,0x4417,0x4416,0x4414,0x4413,0x4410,0x440f,0x440e,0x440d,0x440a,
4462   0x4409,0x4408,0x4405,0x4404,0x4403,0x4401,0x43ff,0x43fd,0x43fc,0x43fb,0x43f8,0x43f7,0x43f6,0x43f5,0x43f2,0x43f1,
4463   0x43f0,0x43ed,0x43ec,0x43ea,0x43e9,0x43e7,0x43e5,0x43e4,0x43e3,0x43e0,0x43df,0x43de,0x43dd,0x43da,0x43d9,0x43d8,
4464   0x43d6,0x43d4,0x43d2,0x43d1,0x43cf,0x43cd,0x43cc,0x43cb,0x43c8,0x43c7,0x43c6,0x43c5,0x43c2,0x43c1,0x43bf,0x43be,
4465   0x43bc,0x43ba,0x43b9,0x43b7,0x43b5,0x43b4,0x43b3,0x43b0,0x43af,0x43ae,0x43ac,0x43aa,0x43a9,0x43a7,0x43a6,0x43a4,
4466   0x43a2,0x43a1,0x439f,0x439d,0x439c,0x439b,0x4398,0x4397,0x4396,0x4394,0x4392,0x4391,0x438f,0x438e,0x438c,0x438a,
4467   0x4389,0x4387,0x4385,0x4384,0x4383,0x4380,0x437f,0x437e,0x437c,0x437a,0x4379,0x4377,0x4376,0x4374,0x4372,0x4371,
4468   0x4370,0x436d,0x436c,0x436b,0x4368,0x4367,0x4366,0x4364,0x4362,0x4361,0x435f,0x435e,0x435b,0x435a,0x4359,0x4358,
4469   0x4355,0x4354,0x4353,0x4350,0x434f,0x434e,0x434c,0x434a,0x4348,0x4347,0x4346,0x4343,0x4342,0x4341,0x4340,0x433d,
4470   0x433d,0x433a,0x4339,0x4338,0x4336,0x4334,0x4332,0x4331,0x4330,0x432d,0x432c,0x432b,0x432a,0x4327,0x4326,0x4325,
4471   0x4323,0x4321,0x4320,0x431e,0x431d,0x431a,0x4319,0x4318,0x4315,0x4314,0x4313,0x4312,0x430f,0x430e,0x430d,0x430b,
4472   0x4309,0x4308,0x4306,0x4305,0x4303,0x4301,0x4300,0x42ff,0x42fc,0x42fb,0x42fa,0x42f7,0x42f6,0x42f5,0x42f3,0x42f1,
4473   0x42f0,0x42ee,0x42ed,0x42eb,0x42e9,0x42e8,0x42e7,0x42e4,0x42e3,0x42e2,0x42e0,0x42de,0x42dd,0x42db,0x42da,0x42d8,
4474   0x42d6,0x42d5,0x42d3,0x42d1,0x42d0,0x42cf,0x42cc,0x42cb,0x42ca,0x42c8,0x42c6,0x42c5,0x42c3,0x42c2,0x42c0,0x42be,
4475   0x42bd,0x42bc,0x42b9,0x42b8,0x42b7,0x42b6,0x42b3,0x42b2,0x42b1,0x42ae,0x42ad,0x42ab,0x42aa,0x42a8,0x42a6,0x42a5,
4476   0x42a4,0x42a1,0x42a0,0x429f,0x429e,0x429b,0x429a,0x4299,0x4297,0x4295,0x4293,0x4292,0x4290,0x428e,0x428d,0x428c,
4477   0x4289,0x4288,0x4287,0x4286,0x4283,0x4282,0x4281,0x427f,0x427d,0x427c,0x427a,0x4279,0x4276,0x4275,0x4274,0x4273,
4478   0x4271,0x426f,0x426d,0x426c,0x426a,0x4268,0x4267,0x4266,0x4263,0x4262,0x4261,0x4260,0x425d,0x425c,0x425b,0x4259,
4479   0x4257,0x4256,0x4254,0x4253,0x4251,0x424f,0x424e,0x424d,0x424a,0x4249,0x4248,0x4246,0x4244,0x4243,0x4241,0x4240,
4480   0x423e,0x423c,0x423b,0x4239,0x4237,0x4236,0x4235,0x4232,0x4231,0x4230,0x422f,0x422c,0x422b,0x422a,0x4228,0x4226,
4481   0x4224,0x4223,0x4222,0x421f,0x421e,0x421d,0x421c,0x4219,0x4218,0x4217,0x4215,0x4213,0x4212,0x4210,0x420f,0x420d,
4482   0x420b,0x420a,0x4208,0x4206,0x4205,0x4204,0x4201,0x4200,0x41ff,0x41fd,0x41fb,0x41fa,0x41f8,0x41f7,0x41f5,0x41f3,
4483   0x41f2,0x41f1,0x41ee,0x41ed,0x41ec,0x41eb,0x41e8,0x41e7,0x41e6,0x41e4,0x41e2,0x41e1,0x41df,0x41de,0x41dc,0x41da,
4484   0x41d9,0x41d6,0x41d5,0x41d4,0x41d3,0x41d0,0x41cf,0x41ce,0x41cc,0x41ca,0x41c9,0x41c7,0x41c6,0x41c4,0x41c2,0x41c1,
4485   0x41c0,0x41bd,0x41bc,0x41bb,0x41ba,0x41b7,0x41b6,0x41b5,0x41b3,0x41b1,0x41b0,0x41ae,0x41ad,0x41aa,0x41a9,0x41a8,
4486   0x41a6,0x41a4,0x41a3,0x41a1,0x419f,0x419e,0x419d,0x419a,0x4199,0x4198,0x4196,0x4194,0x4193,0x4191,0x4190,0x418e,
4487   0x418c,0x418b,0x418a,0x4187,0x4186,0x4185,0x4184,0x4181,0x4180,0x417f,0x417d,0x417b,0x417a,0x4178,0x4177,0x4175,
4488   0x4173,0x4172,0x4171,0x416e,0x416d,0x416c,0x416b,0x4168,0x4167,0x4166,0x4164,0x4162,0x4161,0x415f,0x415e,0x415c,
4489   0x415a,0x4159,0x4158,0x4155,0x4154,0x4153,0x4152,0x414f,0x414e,0x414c,0x414b,0x4149,0x4147,0x4146,0x4145,0x4142,
4490   0x4141,0x4140,0x413d,0x413c,0x413b,0x413a,0x4137,0x4136,0x4135,0x4133,0x4131,0x4130,0x412e,0x412d,0x412b,0x4129,
4491   0x4128,0x4127,0x4124,0x4123,0x4122,0x4121,0x411e,0x411d,0x411c,0x411a,0x4118,0x4117,0x4115,0x4114,0x4112,0x4110,
4492   0x410f,0x410e,0x410b,0x410a,0x4109,0x4108,0x4105,0x4104,0x4103,0x4101,0x40ff,0x40fd,0x40fc,0x40fb,0x40f8,0x40f7,
4493   0x40f6,0x40f5,0x40f2,0x40f1,0x40f0,0x40ee,0x40ec,0x40eb,0x40e9,0x40e8,0x40e6,0x40e4,0x40e3,0x40e2,0x40df,0x40de,
4494   0x40dc,0x40db,0x40da,0x40d7,0x40d6,0x40d5,0x40d3,0x40d1,0x40d0,0x40ce,0x40cd,0x40cb,0x40c9,0x40c8,0x40c7,0x40c4,
4495   0x40c3,0x40c2,0x40c1,0x40be,0x40bd,0x40bc,0x40ba,0x40b8,0x40b7,0x40b5,0x40b4,0x40b2,0x40b0,0x40af,0x40ae,0x40ab,
4496   0x40aa,0x40a9,0x40a8,0x40a5,0x40a4,0x40a3,0x40a1,0x409f,0x409e,0x409c,0x409b,0x4099,0x4097,0x4096,0x4095,0x4092,
4497   0x4091,0x4090,0x408f,0x408c,0x408b,0x408a,0x4088,0x4086,0x4085,0x4083,0x4082,0x4080,0x407e,0x407d,0x407c,0x4079,
4498   0x4078,0x4077,0x4076,0x4073,0x4072,0x4071,0x406f,0x406d,0x406c,0x406a,0x4069,0x4067,0x4065,0x4064,0x4063,0x4060,
4499   0x405f,0x405e,0x405d,0x405a,0x4059,0x4058,0x4056,0x4054,0x4053,0x4051,0x4050,0x404e,0x404c,0x404b,0x404a,0x4047,
4500   0x4046,0x4045,0x4044,0x4041,0x4040,0x403f,0x403d,0x403b,0x403a,0x4038,0x4037,0x4035,0x4033,0x4032,0x4031,0x402e,
4501   0x402d,0x402c,0x402b,0x4028,0x4027,0x4026,0x4024,0x4022,0x4021,0x401f,0x401e,0x401c,0x401a,0x4019,0x4018,0x4015,
4502   0x4014,0x4013,0x4012,0x400f,0x400e,0x400d,0x400b,0x4009,0x4008,0x4006,0x4005,0x4003,0x4001,0x4000,0x3fff,0x3ffc,
4503   0x3ffb,0x3ffa,0x3ff9,0x3ff6,0x3ff5,0x3ff4,0x3ff2,0x3ff0,0x3fef,0x3fed,0x3fec,0x3fea,0x3fe8,0x3fe7,0x3fe6,0x3fe3,
4504   0x3fe2,0x3fe1,0x3fe0,0x3fdd,0x3fdc,0x3fdb,0x3fd9,0x3fd7,0x3fd6,0x3fd4,0x3fd3,0x3fd1,0x3fcf,0x3fce,0x3fcd,0x3fca,
4505   0x3fc9,0x3fc8,0x3fc7,0x3fc4,0x3fc3,0x3fc2,0x3fc0,0x3fbe,0x3fbd,0x3fbb,0x3fba,0x3fb8,0x3fb6,0x3fb5,0x3fb4,0x3fb1,
4506   0x3fb0,0x3faf,0x3fae,0x3fab,0x3faa,0x3fa9,0x3fa7,0x3fa5,0x3fa4,0x3fa2,0x3fa1,0x3f9f,0x3f9d,0x3f9c,0x3f9b,0x3f98,
4507   0x3f97,0x3f96,0x3f95,0x3f92,0x3f91,0x3f90,0x3f8e,0x3f8c,0x3f8b,0x3f89,0x3f88,0x3f86,0x3f84,0x3f83,0x3f82,0x3f7f,
4508   0x3f7e,0x3f7d,0x3f7c,0x3f79,0x3f78,0x3f77,0x3f75,0x3f73,0x3f72,0x3f70,0x3f6f,0x3f6d,0x3f6b,0x3f6a,0x3f69,0x3f66,
4509   0x3f65,0x3f64,0x3f63,0x3f60,0x3f5f,0x3f5e,0x3f5c,0x3f5a,0x3f59,0x3f57,0x3f56,0x3f54,0x3f52,0x3f51,0x3f50,0x3f4d,
4510   0x3f4c,0x3f4b,0x3f4a,0x3f48,0x3f46,0x3f45,0x3f43,0x3f42,0x3f40,0x3f3e,0x3f3d,0x3f3c,0x3f39,0x3f38,0x3f37,0x3f36,
4511   0x3f33,0x3f32,0x3f31,0x3f2f,0x3f2d,0x3f2c,0x3f2a,0x3f29,0x3f27,0x3f25,0x3f24,0x3f23,0x3f20,0x3f1f,0x3f1e,0x3f1d,
4512   0x3f1a,0x3f19,0x3f18,0x3f16,0x3f14,0x3f13,0x3f11,0x3f10,0x3f0e,0x3f0c,0x3f0b,0x3f0a,0x3f07,0x3f06,0x3f05,0x3f04,
4513   0x3f01,0x3f00,0x3eff,0x3efe,0x3efb,0x3efa,0x3ef9,0x3ef7,0x3ef5,0x3ef4,0x3ef2,0x3ef1,0x3eef,0x3eed,0x3eec,0x3eeb,
4514   0x3eea,0x3ee7,0x3ee6,0x3ee5,0x3ee3,0x3ee1,0x3ee0,0x3ede,0x3edd,0x3edb,0x3ed9,0x3ed8,0x3ed7,0x3ed4,0x3ed3,0x3ed2,
4515   0x3ed1,0x3ece,0x3ecd,0x3ecc,0x3eca,0x3ec8,0x3ec7,0x3ec5,0x3ec4,0x3ec2,0x3ec0,0x3ebf,0x3ebe,0x3ebb,0x3eba,0x3eb9,
4516   0x3eb8,0x3eb5,0x3eb4,0x3eb3,0x3eb1,0x3eaf,0x3eae,0x3ead,0x3eab,0x3ea9,0x3ea8,0x3ea6,0x3ea5,0x3ea3,0x3ea1,0x3ea0,
4517   0x3e9f,0x3e9c,0x3e9b,0x3e9a,0x3e99,0x3e96,0x3e95,0x3e94,0x3e92,0x3e90,0x3e8f,0x3e8d,0x3e8c,0x3e8a,0x3e88,0x3e87,
4518   0x3e86,0x3e84,0x3e82,0x3e81,0x3e80,0x3e7d,0x3e7c,0x3e7b,0x3e7a,0x3e77,0x3e76,0x3e75,0x3e74,0x3e71,0x3e70,0x3e6f,
4519   0x3e6d,0x3e6b,0x3e6a,0x3e68,0x3e67,0x3e65,0x3e63,0x3e62,0x3e61,0x3e5e,0x3e5d,0x3e5c,0x3e5b,0x3e58,0x3e57,0x3e56,
4520   0x3e54,0x3e53,0x3e51,0x3e50,0x3e4e,0x3e4d,0x3e4b,0x3e49,0x3e48,0x3e47,0x3e44,0x3e43,0x3e42,0x3e41,0x3e3e,0x3e3d,
4521   0x3e3c,0x3e3a,0x3e38,0x3e37,0x3e35,0x3e34,0x3e32,0x3e30,0x3e2f,0x3e2e,0x3e2b,0x3e2a,0x3e29,0x3e28,0x3e25,0x3e24,
4522   0x3e23,0x3e22,0x3e20,0x3e1e,0x3e1d,0x3e1b,0x3e1a,0x3e18,0x3e16,0x3e15,0x3e14,0x3e11,0x3e10,0x3e0f,0x3e0e,0x3e0b,
4523   0x3e0a,0x3e09,0x3e07,0x3e05,0x3e04,0x3e02,0x3e01,0x3dff,0x3dfe,0x3dfc,0x3dfb,0x3df9,0x3df7,0x3df6,0x3df5,0x3df2,
4524   0x3df1,0x3df0,0x3def,0x3ded,0x3deb,0x3dea,0x3de8,0x3de7,0x3de5,0x3de3,0x3de2,0x3de1,0x3dde,0x3ddd,0x3ddc,0x3ddb,
4525   0x3dd8,0x3dd7,0x3dd6,0x3dd5,0x3dd2,0x3dd1,0x3dd0,0x3dce,0x3dcc,0x3dcb,0x3dc9,0x3dc8,0x3dc6,0x3dc4,0x3dc3,0x3dc2,
4526   0x3dc0,0x3dbf,0x3dbc,0x3dbb,0x3dba,0x3db9,0x3db6,0x3db5,0x3db4,0x3db2,0x3db0,0x3daf,0x3dad,0x3dac,0x3daa,0x3da8,
4527   0x3da7,0x3da6,0x3da3,0x3da2,0x3da1,0x3da0,0x3d9f,0x3d9c,0x3d9b,0x3d9a,0x3d98,0x3d96,0x3d95,0x3d93,0x3d92,0x3d90,
4528   0x3d8e,0x3d8d,0x3d8c,0x3d89,0x3d88,0x3d87,0x3d86,0x3d83,0x3d82,0x3d81,0x3d80,0x3d7e,0x3d7c,0x3d7b,0x3d79,0x3d78,
4529   0x3d76,0x3d74,0x3d73,0x3d72,0x3d6f,0x3d6e,0x3d6d,0x3d6c,0x3d69,0x3d68,0x3d67,0x3d66,0x3d63,0x3d62,0x3d61,0x3d5f,
4530   0x3d5e,0x3d5c,0x3d5a,0x3d59,0x3d58,0x3d55,0x3d54,0x3d53,0x3d52,0x3d4f,0x3d4e,0x3d4d,0x3d4c,0x3d49,0x3d48,0x3d47,
4531   0x3d45,0x3d43,0x3d42,0x3d40,0x3d3f,0x3d3d,0x3d3b,0x3d3a,0x3d39,0x3d38,0x3d35,0x3d34,0x3d33,0x3d32,0x3d2f,0x3d2e,
4532   0x3d2d,0x3d2b,0x3d29,0x3d28,0x3d26,0x3d25,0x3d23,0x3d21,0x3d20,0x3d1f,0x3d1c,0x3d1b,0x3d1a,0x3d19,0x3d18,0x3d15,
4533   0x3d14,0x3d13,0x3d11,0x3d0f,0x3d0e,0x3d0c,0x3d0b,0x3d09,0x3d07,0x3d06,0x3d05,0x3d02,0x3d01,0x3d00,0x3cff,0x3cfc,
4534   0x3cfb,0x3cfa,0x3cf9,0x3cf7,0x3cf5,0x3cf4,0x3cf2,0x3cf1,0x3cef,0x3ced,0x3cec,0x3ceb,0x3ce8,0x3ce7,0x3ce6,0x3ce5,
4535   0x3ce2,0x3ce1,0x3ce0,0x3cdf,0x3cdc,0x3cdb,0x3cda,0x3cd8,0x3cd7,0x3cd5,0x3cd3,0x3cd2,0x3cd1,0x3cce,0x3ccd,0x3ccc,
4536   0x3ccb,0x3cc8,0x3cc7,0x3cc6,0x3cc5,0x3cc2,0x3cc1,0x3cc0,0x3cbe,0x3cbc,0x3cbb,0x3cb9,0x3cb8,0x3cb7,0x3cb4,0x3cb3,
4537   0x3cb2,0x3cb1,0x3cae,0x3cad,0x3cac,0x3cab,0x3ca8,0x3ca7,0x3ca6,0x3ca4,0x3ca2,0x3ca1,0x3c9f,0x3c9e,0x3c9c,0x3c9a,
4538   0x3c99,0x3c98,0x3c97,0x3c94,0x3c93,0x3c92,0x3c91,0x3c8e,0x3c8d,0x3c8c,0x3c8a,0x3c88,0x3c87,0x3c85,0x3c84,0x3c82,
4539   0x3c80,0x3c7f,0x3c7e,0x3c7c,0x3c7a,0x3c79,0x3c78,0x3c77,0x3c74,0x3c73,0x3c72,0x3c70,0x3c6e,0x3c6d,0x3c6b,0x3c6a,
4540   0x3c68,0x3c66,0x3c65,0x3c64,0x3c62,0x3c60,0x3c5f,0x3c5e,0x3c5b,0x3c5a,0x3c59,0x3c58,0x3c56,0x3c54,0x3c53,0x3c51,
4541   0x3c50,0x3c4e,0x3c4c,0x3c4b,0x3c4a,0x3c47,0x3c46,0x3c45,0x3c44,0x3c41,0x3c40,0x3c3f,0x3c3e,0x3c3b,0x3c3a,0x3c39,
4542   0x3c38,0x3c36,0x3c35,0x3c33,0x3c31,0x3c30,0x3c2f,0x3c2c,0x3c2b,0x3c2a,0x3c29,0x3c26,0x3c25,0x3c24,0x3c23,0x3c20,
4543   0x3c1f,0x3c1e,0x3c1c,0x3c1b,0x3c19,0x3c17,0x3c16,0x3c15,0x3c13,0x3c11,0x3c10,0x3c0f,0x3c0c,0x3c0b,0x3c0a,0x3c09,
4544   0x3c07,0x3c05,0x3c04,0x3c02,0x3c01,0x3bff,0x3bfe,0x3bfc,0x3bfb,0x3bf9,0x3bf7,0x3bf6,0x3bf5,0x3bf2,0x3bf1,0x3bf0,
4545   0x3bef,0x3bed,0x3beb,0x3bea,0x3be9,0x3be7,0x3be5,0x3be4,0x3be2,0x3be1,0x3bdf,0x3bdd,0x3bdc,0x3bdb,0x3bd9,0x3bd7,
4546   0x3bd6,0x3bd5,0x3bd4,0x3bd1,0x3bd0,0x3bcf,0x3bcd,0x3bcb,0x3bca,0x3bc8,0x3bc7,0x3bc5,0x3bc4,0x3bc2,0x3bc1,0x3bbf,
4547   0x3bbd,0x3bbc,0x3bbb,0x3bba,0x3bb7,0x3bb6,0x3bb5,0x3bb3,0x3bb1,0x3bb0,0x3baf,0x3bad,0x3bab,0x3baa,0x3ba8,0x3ba7,
4548   0x3ba6,0x3ba3,0x3ba2,0x3ba1,0x3ba0,0x3b9d,0x3b9c,0x3b9b,0x3b9a,0x3b97,0x3b96,0x3b95,0x3b93,0x3b91,0x3b90,0x3b8e,
4549   0x3b8d,0x3b8c,0x3b8a,0x3b88,0x3b87,0x3b86,0x3b83,0x3b82,0x3b81,0x3b80,0x3b7d,0x3b7c,0x3b7b,0x3b79,0x3b77,0x3b76,
4550   0x3b75,0x3b74,0x3b71,0x3b70,0x3b6f,0x3b6e,0x3b6b,0x3b6a,0x3b69,0x3b67,0x3b65,0x3b64,0x3b62,0x3b61,0x3b60,0x3b5e,
4551   0x3b5c,0x3b5b,0x3b5a,0x3b57,0x3b56,0x3b55,0x3b54,0x3b51,0x3b50,0x3b4f,0x3b4e,0x3b4c,0x3b4a,0x3b49,0x3b47,0x3b46,
4552   0x3b44,0x3b42,0x3b41,0x3b40,0x3b3e,0x3b3c,0x3b3b,0x3b3a,0x3b39,0x3b36,0x3b35,0x3b34,0x3b32,0x3b30,0x3b2f,0x3b2e,
4553   0x3b2c,0x3b2a,0x3b29,0x3b27,0x3b26,0x3b25,0x3b22,0x3b21,0x3b20,0x3b1f,0x3b1c,0x3b1b,0x3b1a,0x3b19,0x3b16,0x3b15,
4554   0x3b14,0x3b12,0x3b11,0x3b0f,0x3b0e,0x3b0c,0x3b0b,0x3b09,0x3b07,0x3b06,0x3b05,0x3b02,0x3b01,0x3b00,0x3aff,0x3afe,
4555   0x3afb,0x3afa,0x3af9,0x3af7,0x3af5,0x3af4,0x3af2,0x3af1,0x3aef,0x3aee,0x3aec,0x3aeb,0x3aea,0x3ae7,0x3ae6,0x3ae5,
4556   0x3ae4,0x3ae1,0x3ae0,0x3adf,0x3ade,0x3adb,0x3ada,0x3ad9,0x3ad7,0x3ad6,0x3ad4,0x3ad2,0x3ad1,0x3ad0,0x3ace,0x3acc,
4557   0x3acb,0x3aca,0x3ac7,0x3ac6,0x3ac5,0x3ac4,0x3ac2,0x3ac0,0x3abf,0x3abe,0x3abc,0x3aba,0x3ab9,0x3ab7,0x3ab6,0x3ab4,
4558   0x3ab3,0x3ab1,0x3aaf,0x3aae,0x3aad,0x3aaa,0x3aa9,0x3aa8,0x3aa7,0x3aa4,0x3aa3,0x3aa2,0x3aa1,0x3a9f,0x3a9d,0x3a9c,
4559   0x3a9b,0x3a99,0x3a97,0x3a96,0x3a94,0x3a93,0x3a92,0x3a90,0x3a8e,0x3a8d,0x3a8c,0x3a89,0x3a88,0x3a87,0x3a86,0x3a83,
4560   0x3a82,0x3a81,0x3a80,0x3a7e,0x3a7c,0x3a7b,0x3a79,0x3a78,0x3a76,0x3a75,0x3a73,0x3a72,0x3a71,0x3a6e,0x3a6d,0x3a6c,
4561   0x3a6b,0x3a68,0x3a67,0x3a66,0x3a65,0x3a62,0x3a61,0x3a60,0x3a5e,0x3a5d,0x3a5b,0x3a5a,0x3a58,0x3a57,0x3a55,0x3a53,
4562   0x3a52,0x3a51,0x3a50,0x3a4d,0x3a4c,0x3a4b,0x3a4a,0x3a47,0x3a46,0x3a45,0x3a43,0x3a42,0x3a40,0x3a3f,0x3a3d,0x3a3c,
4563   0x3a3a,0x3a38,0x3a37,0x3a36,0x3a34,0x3a32,0x3a31,0x3a30,0x3a2f,0x3a2c,0x3a2b,0x3a2a,0x3a28,0x3a26,0x3a25,0x3a24,
4564   0x3a22,0x3a21,0x3a1f,0x3a1d,0x3a1c,0x3a1b,0x3a19,0x3a17,0x3a16,0x3a15,0x3a12,0x3a11,0x3a10,0x3a0f,0x3a0d,0x3a0b,
4565   0x3a0a,0x3a09,0x3a07,0x3a05,0x3a04,0x3a02,0x3a01,0x3a00,0x39fe,0x39fc,0x39fb,0x39fa,0x39f7,0x39f6,0x39f5,0x39f4,
4566   0x39f3,0x39f0,0x39ef,0x39ee,0x39ec,0x39ea,0x39e9,0x39e7,0x39e6,0x39e4,0x39e3,0x39e1,0x39e0,0x39df,0x39dc,0x39db,
4567   0x39da,0x39d9,0x39d6,0x39d5,0x39d4,0x39d3,0x39d1,0x39cf,0x39ce,0x39cc,0x39cb,0x39c9,0x39c8,0x39c6,0x39c5,0x39c3,
4568   0x39c1,0x39c0,0x39bf,0x39be,0x39bb,0x39ba,0x39b9,0x39b8,0x39b5,0x39b4,0x39b3,0x39b2,0x39b0,0x39ae,0x39ad,0x39ab,
4569   0x39aa,0x39a8,0x39a6,0x39a5,0x39a4,0x39a2,0x39a0,0x399f,0x399e,0x399d,0x399a,0x3999,0x3998,0x3997,0x3994,0x3993,
4570   0x3992,0x3990,0x398f,0x398d,0x398b,0x398a,0x3989,0x3987,0x3985,0x3984,0x3983,0x3982,0x397f,0x397e,0x397d,0x397c,
4571   0x3979,0x3978,0x3977,0x3975,0x3973,0x3972,0x3970,0x396f,0x396e,0x396c,0x396a,0x3969,0x3968,0x3965,0x3964,0x3963,
4572   0x3962,0x3961,0x395e,0x395d,0x395c,0x395a,0x3958,0x3957,0x3956,0x3954,0x3952,0x3951,0x394f,0x394e,0x394d,0x394a,
4573   0x3949,0x3948,0x3947,0x3944,0x3943,0x3942,0x3941,0x393f,0x393d,0x393c,0x393b,0x3939,0x3937,0x3936,0x3934,0x3933,
4574   0x3932,0x3931,0x392e,0x392d,0x392c,0x392b,0x3928,0x3927,0x3926,0x3925,0x3923,0x3921,0x3920,0x391f,0x391d,0x391b,
4575   0x391a,0x3918,0x3917,0x3916,0x3914,0x3912,0x3911,0x3910,0x390d,0x390c,0x390b,0x390a,0x3909,0x3906,0x3905,0x3904,
4576   0x3902,0x3900,0x38ff,0x38fe,0x38fc,0x38fb,0x38f9,0x38f7,0x38f6,0x38f5,0x38f3,0x38f1,0x38f0,0x38ef,0x38ee,0x38eb,
4577   0x38ea,0x38e9,0x38e8,0x38e5,0x38e4,0x38e3,0x38e1,0x38e0,0x38de,0x38dd,0x38db,0x38da,0x38d8,0x38d6,0x38d5,0x38d4,
4578   0x38d3,0x38d0,0x38cf,0x38ce,0x38cd,0x38ca,0x38c9,0x38c8,0x38c7,0x38c4,0x38c3,0x38c2,0x38c0,0x38bf,0x38bd,0x38bc,
4579   0x38ba,0x38b9,0x38b7,0x38b5,0x38b4,0x38b3,0x38b2,0x38af,0x38ae,0x38ad,0x38ac,0x38a9,0x38a8,0x38a7,0x38a6,0x38a4,
4580   0x38a2,0x38a1,0x389f,0x389e,0x389c,0x389b,0x3899,0x3898,0x3897,0x3894,0x3893,0x3892,0x3891,0x388e,0x388d,0x388c,
4581   0x388b,0x3889,0x3887,0x3886,0x3885,0x3883,0x3881,0x3880,0x387e,0x387d,0x387c,0x387a,0x3878,0x3877,0x3876,0x3873,
4582   0x3873,0x3871,0x3870,0x386e,0x386c,0x386b,0x386a,0x3868,0x3866,0x3865,0x3864,0x3863,0x3860,0x385f,0x385e,0x385d,
4583   0x385b,0x3859,0x3858,0x3857,0x3855,0x3853,0x3852,0x3850,0x384f,0x384e,0x384c,0x384a,0x3849,0x3848,0x3845,0x3844,
4584   0x3843,0x3842,0x3841,0x383e,0x383d,0x383c,0x383b,0x3838,0x3837,0x3836,0x3834,0x3833,0x3831,0x3830,0x382e,0x382d,
4585   0x382c,0x3829,0x3828,0x3827,0x3826,0x3823,0x3822,0x3821,0x3820,0x381e,0x381c,0x381b,0x381a,0x3818,0x3816,0x3815,
4586   0x3814,0x3812,0x3811,0x380f,0x380d,0x380c,0x380b,0x3809,0x3807,0x3806,0x3805,0x3804,0x3801,0x3800,0x37ff,0x37fe,
4587   0x37fc,0x37fa,0x37f9,0x37f7,0x37f6,0x37f4,0x37f3,0x37f1,0x37f0,0x37ef,0x37ed,0x37eb,0x37ea,0x37e9,0x37e6,0x37e5,
4588   0x37e4,0x37e3,0x37e2,0x37df,0x37de,0x37dd,0x37db,0x37d9,0x37d8,0x37d7,0x37d5,0x37d4,0x37d2,0x37d0,0x37cf,0x37ce,
4589   0x37cd,0x37ca,0x37c9,0x37c8,0x37c7,0x37c4,0x37c3,0x37c2,0x37c1,0x37bf,0x37bd,0x37bc,0x37bb,0x37b9,0x37b7,0x37b6,
4590   0x37b4,0x37b3,0x37b1,0x37b0,0x37ae,0x37ad,0x37ab,0x37aa,0x37a9,0x37a6,0x37a5,0x37a4,0x37a3,0x37a0,0x379f,0x379e,
4591   0x379d,0x379c,0x3799,0x3798,0x3797,0x3795,0x3794,0x3792,0x3791,0x378f,0x378e,0x378c,0x378a,0x3789,0x3788,0x3787,
4592   0x3784,0x3783,0x3782,0x3781,0x3780,0x377d,0x377c,0x377b,0x3779,0x3777,0x3776,0x3775,0x3773,0x3772,0x3770,0x376f,
4593   0x376d,0x376c,0x376b,0x3768,0x3767,0x3766,0x3765,0x3762,0x3761,0x3760,0x375f,0x375e,0x375b,0x375a,0x3759,0x3757,
4594   0x3756,0x3754,0x3753,0x3751,0x3750,0x374e,0x374d,0x374b,0x374a,0x3749,0x3746,0x3745,0x3744,0x3743,0x3740,0x373f,
4595   0x373e,0x373d,0x373c,0x3739,0x3738,0x3737,0x3735,0x3734,0x3732,0x3731,0x372f,0x372e,0x372c,0x372b,0x3729,0x3728,
4596   0x3727,0x3724,0x3723,0x3722,0x3721,0x3720,0x371d,0x371c,0x371b,0x371a,0x3717,0x3716,0x3715,0x3713,0x3712,0x3710,
4597   0x370f,0x370d,0x370c,0x370b,0x3709,0x3707,0x3706,0x3705,0x3702,0x3701,0x3700,0x36ff,0x36fe,0x36fb,0x36fa,0x36f9,
4598   0x36f7,0x36f6,0x36f4,0x36f3,0x36f1,0x36f0,0x36ee,0x36ed,0x36eb,0x36ea,0x36e9,0x36e6,0x36e5,0x36e4,0x36e3,0x36e2,
4599   0x36df,0x36de,0x36dd,0x36dc,0x36d9,0x36d8,0x36d7,0x36d5,0x36d4,0x36d2,0x36d1,0x36cf,0x36ce,0x36cd,0x36cb,0x36c9,
4600   0x36c8,0x36c7,0x36c4,0x36c3,0x36c2,0x36c1,0x36c0,0x36bd,0x36bc,0x36bb,0x36ba,0x36b8,0x36b6,0x36b5,0x36b3,0x36b2,
4601   0x36b0,0x36af,0x36ad,0x36ac,0x36ab,0x36a9,0x36a7,0x36a6,0x36a5,0x36a4,0x36a1,0x36a0,0x369f,0x369e,0x369b,0x369a,
4602   0x3699,0x3698,0x3696,0x3694,0x3693,0x3691,0x3690,0x368e,0x368d,0x368b,0x368a,0x3689,0x3687,0x3685,0x3684,0x3683,
4603   0x3682,0x367f,0x367e,0x367d,0x367c,0x3679,0x3678,0x3677,0x3676,0x3674,0x3672,0x3671,0x366f,0x366e,0x366d,0x366b,
4604   0x3669,0x3668,0x3667,0x3665,0x3663,0x3662,0x3661,0x3660,0x365d,0x365c,0x365b,0x365a,0x3658,0x3656,0x3655,0x3653,
4605   0x3652,0x3650,0x364f,0x364d,0x364c,0x364b,0x3649,0x3647,0x3646,0x3645,0x3644,0x3641,0x3640,0x363f,0x363e,0x363b,
4606   0x363b,0x3639,0x3638,0x3636,0x3635,0x3633,0x3632,0x3630,0x362f,0x362e,0x362c,0x362a,0x3629,0x3628,0x3627,0x3624,
4607   0x3623,0x3622,0x3621,0x361e,0x361d,0x361c,0x361b,0x3619,0x3617,0x3616,0x3615,0x3613,0x3612,0x3610,0x360f,0x360d,
4608   0x360c,0x360b,0x3608,0x3607,0x3606,0x3605,0x3602,0x3601,0x3600,0x35ff,0x35fe,0x35fb,0x35fa,0x35f9,0x35f8,0x35f6,
4609   0x35f4,0x35f3,0x35f1,0x35f0,0x35ef,0x35ed,0x35eb,0x35ea,0x35e9,0x35e7,0x35e5,0x35e4,0x35e3,0x35e2,0x35df,0x35de,
4610   0x35dd,0x35dc,0x35da,0x35d8,0x35d7,0x35d6,0x35d4,0x35d3,0x35d1,0x35d0,0x35ce,0x35cd,0x35cb,0x35ca,0x35c8,0x35c7,
4611   0x35c6,0x35c3,0x35c2,0x35c1,0x35c0,0x35bf,0x35bc,0x35bb,0x35ba,0x35b9,0x35b7,0x35b5,0x35b4,0x35b3,0x35b1,0x35af,
4612   0x35ae,0x35ac,0x35ab,0x35aa,0x35a8,0x35a6,0x35a5,0x35a4,0x35a3,0x35a0,0x359f,0x359e,0x359d,0x359b,0x3599,0x3598,
4613   0x3597,0x3595,0x3593,0x3592,0x3591,0x358f,0x358e,0x358c,0x358b,0x3589,0x3588,0x3587,0x3584,0x3583,0x3582,0x3581,
4614   0x357f,0x357e,0x357c,0x357b,0x3579,0x3577,0x3576,0x3575,0x3574,0x3571,0x3570,0x356f,0x356e,0x356d,0x356a,0x3569,
4615   0x3568,0x3567,0x3565,0x3563,0x3562,0x3561,0x355f,0x355d,0x355c,0x355b,0x3559,0x3558,0x3556,0x3554,0x3553,0x3552,
4616   0x3551,0x354e,0x354d,0x354c,0x354b,0x354a,0x3547,0x3546,0x3545,0x3544,0x3542,0x3540,0x353f,0x353e,0x353c,0x353b,
4617   0x3539,0x3538,0x3536,0x3535,0x3533,0x3531,0x3530,0x352f,0x352e,0x352b,0x352a,0x3529,0x3528,0x3527,0x3524,0x3523,
4618   0x3522,0x3521,0x351f,0x351d,0x351c,0x351b,0x3519,0x3518,0x3516,0x3515,0x3513,0x3512,0x3511,0x350e,0x350d,0x350c,
4619   0x350b,0x3508,0x3507,0x3506,0x3505,0x3504,0x3501,0x3500,0x34ff,0x34fe,0x34fc,0x34fa,0x34f9,0x34f8,0x34f6,0x34f5,
4620   0x34f3,0x34f2,0x34f0,0x34ef,0x34ee,0x34eb,0x34ea,0x34e9,0x34e8,0x34e7,0x34e4,0x34e3,0x34e2,0x34e1,0x34de,0x34dd,
4621   0x34dc,0x34db,0x34d9,0x34d7,0x34d6,0x34d5,0x34d3,0x34d2,0x34d0,0x34cf,0x34cd,0x34cc,0x34cb,0x34c8,0x34c7,0x34c6,
4622   0x34c4,0x34c3,0x34c2,0x34bf,0x34be,0x34bd,0x34bc,0x34ba,0x34b8,0x34b7,0x34b6,0x34b4,0x34b3,0x34b1,0x34b0,0x34ae,
4623   0x34ad,0x34ac,0x34aa,0x34a8,0x34a7,0x34a6,0x34a5,0x34a2,0x34a1,0x34a0,0x349f,0x349e,0x349b,0x349a,0x3499,0x3498,
4624   0x3496,0x3494,0x3493,0x3492,0x3490,0x348e,0x348d,0x348c,0x348a,0x3489,0x3487,0x3486,0x3484,0x3483,0x3482,0x3480,
4625   0x347e,0x347d,0x347c,0x347b,0x3478,0x3477,0x3476,0x3475,0x3474,0x3471,0x3470,0x346f,0x346d,0x346c,0x346a,0x3469,
4626   0x3467,0x3466,0x3465,0x3463,0x3461,0x3460,0x345f,0x345e,0x345b,0x345a,0x3459,0x3458,0x3457,0x3454,0x3453,0x3452,
4627   0x3451,0x344f,0x344d,0x344c,0x344b,0x3449,0x3448,0x3446,0x3445,0x3443,0x3442,0x3441,0x343f,0x343d,0x343c,0x343b,
4628   0x343a,0x3437,0x3436,0x3435,0x3434,0x3431,0x3430,0x342f,0x342e,0x342d,0x342a,0x3429,0x3428,0x3427,0x3425,0x3423,
4629   0x3422,0x3420,0x341f,0x341e,0x341c,0x341a,0x3419,0x3418,0x3417,0x3414,0x3413,0x3412,0x3411,0x3410,0x340d,0x340c,
4630   0x340b,0x340a,0x3408,0x3406,0x3405,0x3404,0x3402,0x3401,0x33ff,0x33fe,0x33fc,0x33fb,0x33fa,0x33f8,0x33f6,0x33f5,
4631   0x33f4,0x33f3,0x33f0,0x33ef,0x33ee,0x33ed,0x33ec,0x33e9,0x33e8,0x33e7,0x33e6,0x33e4,0x33e2,0x33e1,0x33e0,0x33de,
4632   0x33dd,0x33db,0x33da,0x33d8,0x33d7,0x33d5,0x33d3,0x33d2,0x33d1,0x33d0,0x33cd,0x33cc,0x33cb,0x33ca,0x33c9,0x33c6,
4633   0x33c5,0x33c4,0x33c3,0x33c1,0x33bf,0x33be,0x33bd,0x33bb,0x33ba,0x33b8,0x33b7,0x33b5,0x33b4,0x33b3,0x33b1,0x33af,
4634   0x33ae,0x33ad,0x33ac,0x33a9,0x33a8,0x33a7,0x33a6,0x33a5,0x33a2,0x33a1,0x33a0,0x339f,0x339d,0x339b,0x339a,0x3399,
4635   0x3397,0x3396,0x3394,0x3393,0x3391,0x3390,0x338f,0x338d,0x338b,0x338a,0x3389,0x3388,0x3385,0x3384,0x3383,0x3382,
4636   0x3380,0x337e,0x337d,0x337c,0x337a,0x3378,0x3377,0x3376,0x3374,0x3373,0x3371,0x3370,0x336e,0x336d,0x336c,0x336a,
4637   0x3368,0x3367,0x3366,0x3365,0x3362,0x3361,0x3360,0x335f,0x335e,0x335b,0x335a,0x3359,0x3358,0x3356,0x3354,0x3353,
4638   0x3352,0x3350,0x334f,0x334e,0x334c,0x334a,0x3349,0x3348,0x3347,0x3344,0x3343,0x3342,0x3341,0x3340,0x333d,0x333c,
4639   0x333b,0x333a,0x3338,0x3336,0x3335,0x3334,0x3332,0x3331,0x332f,0x332e,0x332c,0x332b,0x332a,0x3328,0x3326,0x3325,
4640   0x3324,0x3323,0x3320,0x331f,0x331e,0x331d,0x331c,0x3319,0x3318,0x3317,0x3316,0x3314,0x3312,0x3311,0x3310,0x330e,
4641   0x330d,0x330b,0x330a,0x3308,0x3307,0x3306,0x3304,0x3302,0x3301,0x3300,0x32ff,0x32fc,0x32fb,0x32fa,0x32f9,0x32f8,
4642   0x32f6,0x32f4,0x32f3,0x32f2,0x32f0,0x32ef,0x32ed,0x32ec,0x32ea,0x32e9,0x32e8,0x32e6,0x32e4,0x32e3,0x32e2,0x32e1,
4643   0x32de,0x32dd,0x32dc,0x32db,0x32da,0x32d7,0x32d6,0x32d5,0x32d4,0x32d2,0x32d0,0x32cf,0x32ce,0x32cc,0x32cb,0x32c9,
4644   0x32c8,0x32c6,0x32c5,0x32c4,0x32c2,0x32c0,0x32bf,0x32be,0x32bd,0x32ba,0x32b9,0x32b8,0x32b7,0x32b6,0x32b3,0x32b2,
4645   0x32b1,0x32b0,0x32ae,0x32ac,0x32ab,0x32aa,0x32a8,0x32a7,0x32a5,0x32a4,0x32a2,0x32a1,0x32a0,0x329e,0x329c,0x329b,
4646   0x329a,0x3298,0x3297,0x3295,0x3294,0x3293,0x3291,0x328f,0x328e,0x328d,0x328c,0x3289,0x3288,0x3287,0x3286,0x3285,
4647   0x3282,0x3281,0x3280,0x327f,0x327e,0x327b,0x327a,0x3279,0x3278,0x3276,0x3274,0x3273,0x3272,0x3270,0x326f,0x326d,
4648   0x326c,0x326a,0x3269,0x3268,0x3266,0x3264,0x3263,0x3262,0x3261,0x325e,0x325d,0x325c,0x325b,0x325a,0x3258,0x3256,
4649   0x3255,0x3254,0x3252,0x3251,0x324f,0x324e,0x324d,0x324b,0x324a,0x3248,0x3247,0x3245,0x3244,0x3243,0x3241,0x323f,
4650   0x323e,0x323d,0x323c,0x3239,0x3238,0x3237,0x3236,0x3235,0x3232,0x3231,0x3230,0x322f,0x322d,0x322b,0x322a,0x3229,
4651   0x3227,0x3226,0x3224,0x3223,0x3221,0x3220,0x321f,0x321e,0x321b,0x321a,0x3219,0x3218,0x3217,0x3214,0x3213,0x3212,
4652   0x3211,0x3210,0x320d,0x320c,0x320b,0x320a,0x3208,0x3206,0x3205,0x3204,0x3202,0x3201,0x31ff,0x31fe,0x31fc,0x31fb,
4653   0x31fa,0x31f8,0x31f6,0x31f5,0x31f4,0x31f3,0x31f0,0x31ef,0x31ee,0x31ed,0x31ec,0x31e9,0x31e8,0x31e7,0x31e6,0x31e5,
4654   0x31e3,0x31e1,0x31e0,0x31df,0x31dd,0x31dc,0x31da,0x31d9,0x31d7,0x31d6,0x31d5,0x31d3,0x31d1,0x31d0,0x31cf,0x31ce,
4655   0x31cb,0x31ca,0x31c9,0x31c8,0x31c7,0x31c4,0x31c3,0x31c2,0x31c1,0x31bf,0x31bd,0x31bc,0x31bb,0x31b9,0x31b8,0x31b6,
4656   0x31b5,0x31b4,0x31b2,0x31b1,0x31af,0x31ae,0x31ac,0x31ab,0x31aa,0x31a8,0x31a6,0x31a5,0x31a4,0x31a3,0x31a2,0x319f,
4657   0x319e,0x319d,0x319c,0x319a,0x3198,0x3197,0x3196,0x3194,0x3193,0x3191,0x3190,0x318e,0x318d,0x318c,0x318a,0x3188,
4658   0x3187,0x3186,0x3185,0x3182,0x3181,0x3180,0x317f,0x317e,0x317b,0x317a,0x3179,0x3178,0x3177,0x3174,0x3173,0x3172,
4659   0x3171,0x316f,0x316d,0x316c,0x316b,0x3169,0x3168,0x3167,0x3165,0x3163,0x3162,0x3161,0x3160,0x315d,0x315c,0x315b,
4660   0x315a,0x3159,0x3156,0x3155,0x3154,0x3153,0x3151,0x314f,0x314e,0x314d,0x314c,0x314a,0x3148,0x3147,0x3146,0x3144,
4661   0x3143,0x3141,0x3140,0x313e,0x313d,0x313c,0x313a,0x3138,0x3137,0x3136,0x3135,0x3132,0x3131,0x3130,0x312f,0x312e,
4662   0x312c,0x312b,0x312a,0x3129,0x3126,0x3125,0x3124,0x3123,0x3121,0x3120,0x311e,0x311d,0x311b,0x311a,0x3119,0x3117,
4663   0x3115,0x3114,0x3113,0x3112,0x310f,0x310e,0x310d,0x310c,0x310b,0x3108,0x3107,0x3106,0x3105,0x3104,0x3102,0x3100,
4664   0x30ff,0x30fe,0x30fc,0x30fb,0x30f9,0x30f8,0x30f6,0x30f5,0x30f4,0x30f2,0x30f1,0x30ef,0x30ee,0x30ed,0x30eb,0x30e9,
4665   0x30e8,0x30e7,0x30e6,0x30e3,0x30e2,0x30e1,0x30e0,0x30df,0x30dd,0x30db,0x30da,0x30d9,0x30d7,0x30d6,0x30d4,0x30d3,
4666   0x30d2,0x30d0,0x30cf,0x30cd,0x30cc,0x30ca,0x30c9,0x30c8,0x30c6,0x30c4,0x30c3,0x30c2,0x30c1,0x30c0,0x30bd,0x30bc,
4667   0x30bb,0x30ba,0x30b9,0x30b6,0x30b5,0x30b4,0x30b3,0x30b1,0x30af,0x30ae,0x30ad,0x30ab,0x30aa,0x30a8,0x30a7,0x30a5,
4668   0x30a4,0x30a3,0x30a1,0x309f,0x309e,0x309d,0x309c,0x309b,0x3098,0x3097,0x3096,0x3095,0x3094,0x3091,0x3090,0x308f,
4669   0x308e,0x308c,0x308a,0x3089,0x3088,0x3086,0x3085,0x3083,0x3082,0x3081,0x307f,0x307e,0x307d,0x307b,0x3079,0x3078,
4670   0x3077,0x3076,0x3074,0x3072,0x3071,0x3070,0x306e,0x306d,0x306c,0x306a,0x3069,0x3067,0x3066,0x3065,0x3063,0x3061,
4671   0x3060,0x305f,0x305e,0x305b,0x305a,0x3059,0x3058,0x3057,0x3056,0x3053,0x3052,0x3051,0x3050,0x304e,0x304c,0x304b,
4672   0x304a,0x3048,0x3047,0x3045,0x3044,0x3043,0x3041,0x3040,0x303f,0x303d,0x303b,0x303a,0x3039,0x3038,0x3035,0x3034,
4673   0x3033,0x3032,0x3031,0x302e,0x302d,0x302c,0x302b,0x302a,0x3028,0x3026,0x3025,0x3024,0x3022,0x3021,0x301f,0x301e,
4674   0x301d,0x301b,0x301a,0x3018,0x3017,0x3015,0x3014,0x3013,0x3012,0x300f,0x300e,0x300d,0x300c,0x300b,0x3008,0x3007,
4675   0x3006,0x3005,0x3004,0x3001,0x3000,0x2fff,0x2ffe,0x2ffc,0x2ffb,0x2ff9,0x2ff8,0x2ff7,0x2ff5,0x2ff4,0x2ff2,0x2ff1,
4676   0x2fef,0x2fee,0x2fed,0x2feb,0x2fe9,0x2fe8,0x2fe7,0x2fe6,0x2fe5,0x2fe2,0x2fe1,0x2fe0,0x2fdf,0x2fde,0x2fdb,0x2fda,
4677   0x2fd9,0x2fd8,0x2fd6,0x2fd4,0x2fd3,0x2fd2,0x2fd1,0x2fcf,0x2fce,0x2fcc,0x2fcb,0x2fc9,0x2fc8,0x2fc7,0x2fc5,0x2fc3,
4678   0x2fc2,0x2fc1,0x2fbf,0x2fbd,0x2fbc,0x2fbb,0x2fba,0x2fb7,0x2fb6,0x2fb5,0x2fb4,0x2fb3,0x2fb2,0x2faf,0x2fae,0x2fad,
4679   0x2fac,0x2faa,0x2fa8,0x2fa7,0x2fa6,0x2fa5,0x2fa3,0x2fa2,0x2fa0,0x2f9f,0x2f9d,0x2f9c,0x2f9b,0x2f99,0x2f98,0x2f96,
4680   0x2f95,0x2f94,0x2f93,0x2f90,0x2f8f,0x2f8e,0x2f8d,0x2f8c,0x2f89,0x2f88,0x2f87,0x2f86,0x2f85,0x2f82,0x2f81,0x2f80,
4681   0x2f7f,0x2f7d,0x2f7c,0x2f7a,0x2f79,0x2f78,0x2f76,0x2f75,0x2f73,0x2f72,0x2f70,0x2f6f,0x2f6e,0x2f6d,0x2f6b,0x2f69,
4682   0x2f68,0x2f67,0x2f66,0x2f63,0x2f62,0x2f61,0x2f60,0x2f5f,0x2f5e,0x2f5b,0x2f5a,0x2f59,0x2f58,0x2f56,0x2f54,0x2f53,
4683   0x2f52,0x2f50,0x2f4f,0x2f4e,0x2f4c,0x2f4b,0x2f49,0x2f48,0x2f47,0x2f45,0x2f43,0x2f42,0x2f41,0x2f40,0x2f3e,0x2f3c,
4684   0x2f3b,0x2f3a,0x2f39,0x2f38,0x2f35,0x2f34,0x2f33,0x2f32,0x2f31,0x2f2e,0x2f2d,0x2f2c,0x2f2b,0x2f29,0x2f28,0x2f26,
4685   0x2f25,0x2f24,0x2f22,0x2f21,0x2f1f,0x2f1e,0x2f1c,0x2f1b,0x2f1a,0x2f19,0x2f16,0x2f15,0x2f14,0x2f13,0x2f12,0x2f0f,
4686   0x2f0e,0x2f0d,0x2f0c,0x2f0b,0x2f09,0x2f07,0x2f06,0x2f05,0x2f04,0x2f02,0x2f00,0x2eff,0x2efe,0x2efc,0x2efb,0x2ef9,
4687   0x2ef8,0x2ef7,0x2ef5,0x2ef4,0x2ef3,0x2ef1,0x2eef,0x2eee,0x2eed,0x2eec,0x2eea,0x2ee8,0x2ee7,0x2ee6,0x2ee5,0x2ee4,
4688   0x2ee1,0x2ee0,0x2edf,0x2ede,0x2edc,0x2eda,0x2ed9,0x2ed8,0x2ed7,0x2ed5,0x2ed4,0x2ed2,0x2ed1,0x2ecf,0x2ece,0x2ecd,
4689   0x2ecb,0x2eca,0x2ec8,0x2ec7,0x2ec6,0x2ec5,0x2ec2,0x2ec1,0x2ec0,0x2ebf,0x2ebe,0x2ebb,0x2eba,0x2eb9,0x2eb8,0x2eb7,
4690   0x2eb5,0x2eb3,0x2eb2,0x2eb1,0x2eb0,0x2eae,0x2eac,0x2eab,0x2eaa,0x2ea8,0x2ea7,0x2ea5,0x2ea4,0x2ea2,0x2ea1,0x2ea0,
4691   0x2e9f,0x2e9d,0x2e9b,0x2e9a,0x2e99,0x2e98,0x2e95,0x2e94,0x2e93,0x2e92,0x2e91,0x2e90,0x2e8d,0x2e8c,0x2e8b,0x2e8a,
4692   0x2e88,0x2e86,0x2e85,0x2e84,0x2e83,0x2e81,0x2e80,0x2e7e,0x2e7d,0x2e7b,0x2e7a,0x2e79,0x2e77,0x2e76,0x2e74,0x2e73,
4693   0x2e72,0x2e71,0x2e6e,0x2e6d,0x2e6c,0x2e6b,0x2e6a,0x2e67,0x2e66,0x2e65,0x2e64,0x2e63,0x2e60,0x2e5f,0x2e5e,0x2e5d,
4694   0x2e5c,0x2e5a,0x2e58,0x2e57,0x2e56,0x2e55,0x2e53,0x2e51,0x2e50,0x2e4f,0x2e4e,0x2e4d,0x2e4a,0x2e49,0x2e48,0x2e47,
4695   0x2e46,0x2e43,0x2e42,0x2e41,0x2e40,0x2e3f,0x2e3d,0x2e3b,0x2e3a,0x2e39,0x2e37,0x2e36,0x2e34,0x2e33,0x2e32,0x2e30,
4696   0x2e2f,0x2e2e,0x2e2c,0x2e2a,0x2e29,0x2e28,0x2e27,0x2e25,0x2e23,0x2e22,0x2e21,0x2e20,0x2e1f,0x2e1c,0x2e1b,0x2e1a,
4697   0x2e19,0x2e18,0x2e16,0x2e14,0x2e13,0x2e12,0x2e11,0x2e0f,0x2e0d,0x2e0c,0x2e0b,0x2e09,0x2e08,0x2e07,0x2e05,0x2e04,
4698   0x2e02,0x2e01,0x2e00,0x2dfe,0x2dfc,0x2dfb,0x2dfa,0x2df9,0x2df8,0x2df5,0x2df4,0x2df3,0x2df2,0x2df1,0x2dee,0x2ded,
4699   0x2dec,0x2deb,0x2dea,0x2de8,0x2de6,0x2de5,0x2de4,0x2de3,0x2de1,0x2de0,0x2dde,0x2ddd,0x2ddb,0x2dda,0x2dd9,0x2dd7,
4700   0x2dd6,0x2dd4,0x2dd3,0x2dd2,0x2dd1,0x2dce,0x2dcd,0x2dcc,0x2dcb,0x2dca,0x2dc7,0x2dc6,0x2dc5,0x2dc4,0x2dc3,0x2dc1,
4701   0x2dbf,0x2dbe,0x2dbd,0x2dbc,0x2dba,0x2db8,0x2db7,0x2db6,0x2db5,0x2db3,0x2db2,0x2db0,0x2daf,0x2dad,0x2dac,0x2dab,
4702   0x2da9,0x2da8,0x2da6,0x2da5,0x2da3,0x2da2,0x2da1,0x2da0,0x2d9e,0x2d9c,0x2d9b,0x2d9a,0x2d99,0x2d97,0x2d95,0x2d94,
4703   0x2d93,0x2d92,0x2d91,0x2d8e,0x2d8d,0x2d8c,0x2d8b,0x2d8a,0x2d88,0x2d86,0x2d85,0x2d84,0x2d83,0x2d81,0x2d7f,0x2d7e,
4704   0x2d7d,0x2d7b,0x2d7a,0x2d79,0x2d77,0x2d76,0x2d74,0x2d73,0x2d72,0x2d71,0x2d6f,0x2d6d,0x2d6c,0x2d6b,0x2d6a,0x2d67,
4705   0x2d66,0x2d65,0x2d64,0x2d63,0x2d62,0x2d5f,0x2d5e,0x2d5d,0x2d5c,0x2d5b,0x2d59,0x2d57,0x2d56,0x2d55,0x2d53,0x2d52,
4706   0x2d51,0x2d4f,0x2d4e,0x2d4c,0x2d4b,0x2d4a,0x2d48,0x2d47,0x2d45,0x2d44,0x2d43,0x2d42,0x2d3f,0x2d3e,0x2d3d,0x2d3c,
4707   0x2d3b,0x2d3a,0x2d37,0x2d36,0x2d35,0x2d34,0x2d33,0x2d30,0x2d2f,0x2d2e,0x2d2d,0x2d2c,0x2d2a,0x2d28,0x2d27,0x2d26,
4708   0x2d24,0x2d23,0x2d22,0x2d20,0x2d1f,0x2d1d,0x2d1c,0x2d1b,0x2d19,0x2d18,0x2d16,0x2d15,0x2d14,0x2d13,0x2d10,0x2d0f,
4709   0x2d0e,0x2d0d,0x2d0c,0x2d0b,0x2d08,0x2d07,0x2d06,0x2d05,0x2d04,0x2d01,0x2d00,0x2cff,0x2cfe,0x2cfc,0x2cfb,0x2cf9,
4710   0x2cf8,0x2cf7,0x2cf5,0x2cf4,0x2cf3,0x2cf1,0x2cf0,0x2cee,0x2ced,0x2cec,0x2cea,0x2ce8,0x2ce7,0x2ce6,0x2ce5,0x2ce4,
4711   0x2ce1,0x2ce0,0x2cdf,0x2cde,0x2cdd,0x2cdc,0x2cd9,0x2cd8,0x2cd7,0x2cd6,0x2cd4,0x2cd3,0x2cd1,0x2cd0,0x2ccf,0x2ccd,
4712   0x2ccc,0x2cca,0x2cc9,0x2cc8,0x2cc6,0x2cc5,0x2cc4,0x2cc2,0x2cc1,0x2cbf,0x2cbe,0x2cbd,0x2cbc,0x2cb9,0x2cb8,0x2cb7,
4713   0x2cb6,0x2cb5,0x2cb2,0x2cb1,0x2cb0,0x2caf,0x2cae,0x2cad,0x2caa,0x2ca9,0x2ca8,0x2ca7,0x2ca5,0x2ca4,0x2ca2,0x2ca1,
4714   0x2ca0,0x2c9e,0x2c9d,0x2c9b,0x2c9a,0x2c99,0x2c97,0x2c96,0x2c95,0x2c93,0x2c91,0x2c90,0x2c8f,0x2c8e,0x2c8d,0x2c8a,
4715   0x2c89,0x2c88,0x2c87,0x2c86,0x2c83,0x2c82,0x2c81,0x2c80,0x2c7f,0x2c7d,0x2c7b,0x2c7a,0x2c79,0x2c78,0x2c76,0x2c75,
4716   0x2c73,0x2c72,0x2c71,0x2c6f,0x2c6e,0x2c6c,0x2c6b,0x2c6a,0x2c68,0x2c67,0x2c66,0x2c64,0x2c62,0x2c61,0x2c60,0x2c5f,
4717   0x2c5e,0x2c5b,0x2c5a,0x2c59,0x2c58,0x2c57,0x2c56,0x2c53,0x2c52,0x2c51,0x2c50,0x2c4e,0x2c4c,0x2c4b,0x2c4a,0x2c49,
4718   0x2c47,0x2c46,0x2c45,0x2c43,0x2c42,0x2c40,0x2c3f,0x2c3e,0x2c3d,0x2c3b,0x2c39,0x2c38,0x2c37,0x2c36,0x2c35,0x2c32,
4719   0x2c31,0x2c30,0x2c2f,0x2c2e,0x2c2d,0x2c2a,0x2c29,0x2c28,0x2c27,0x2c26,0x2c24,0x2c22,0x2c21,0x2c20,0x2c1e,0x2c1d,
4720   0x2c1c,0x2c1a,0x2c19,0x2c17,0x2c16,0x2c15,0x2c13,0x2c12,0x2c10,0x2c0f,0x2c0e,0x2c0d,0x2c0b,0x2c09,0x2c08,0x2c07,
4721   0x2c06,0x2c05,0x2c02,0x2c01,0x2c00,0x2bff,0x2bfe,0x2bfc,0x2bfa,0x2bf9,0x2bf8,0x2bf7,0x2bf5,0x2bf4,0x2bf2,0x2bf1,
4722   0x2bf0,0x2bee,0x2bed,0x2beb,0x2bea,0x2be9,0x2be7,0x2be6,0x2be5,0x2be3,0x2be2,0x2be0,0x2bdf,0x2bde,0x2bdd,0x2bdb,
4723   0x2bd9,0x2bd8,0x2bd7,0x2bd6,0x2bd5,0x2bd2,0x2bd1,0x2bd0,0x2bcf,0x2bce,0x2bcc,0x2bca,0x2bc9,0x2bc8,0x2bc7,0x2bc5,
4724   0x2bc4,0x2bc2,0x2bc1,0x2bc0,0x2bbe,0x2bbd,0x2bbb,0x2bba,0x2bb9,0x2bb7,0x2bb6,0x2bb5,0x2bb3,0x2bb1,0x2bb0,0x2baf,
4725   0x2bae,0x2bad,0x2baa,0x2ba9,0x2ba8,0x2ba7,0x2ba6,0x2ba5,0x2ba2,0x2ba1,0x2ba0,0x2b9f,0x2b9e,0x2b9c,0x2b9a,0x2b99,
4726   0x2b98,0x2b97,0x2b94,0x2b93,0x2b92,0x2b91,0x2b90,0x2b8e,0x2b8c,0x2b8b,0x2b8a,0x2b89,0x2b87,0x2b86,0x2b84,0x2b83,
4727   0x2b82,0x2b80,0x2b7f,0x2b7e,0x2b7c,0x2b7b,0x2b79,0x2b78,0x2b77,0x2b76,0x2b74,0x2b72,0x2b71,0x2b70,0x2b6f,0x2b6e,
4728   0x2b6b,0x2b6a,0x2b69,0x2b68,0x2b67,0x2b66,0x2b63,0x2b62,0x2b61,0x2b60,0x2b5f,0x2b5d,0x2b5b,0x2b5a,0x2b59,0x2b58,
4729   0x2b56,0x2b55,0x2b53,0x2b52,0x2b51,0x2b4f,0x2b4e,0x2b4d,0x2b4b,0x2b4a,0x2b48,0x2b47,0x2b46,0x2b45,0x2b43,0x2b41,
4730   0x2b40,0x2b3f,0x2b3e,0x2b3c,0x2b3a,0x2b39,0x2b38,0x2b37,0x2b36,0x2b33,0x2b32,0x2b31,0x2b30,0x2b2f,0x2b2e,0x2b2b,
4731   0x2b2a,0x2b29,0x2b28,0x2b27,0x2b25,0x2b23,0x2b22,0x2b21,0x2b20,0x2b1e,0x2b1d,0x2b1b,0x2b1a,0x2b19,0x2b17,0x2b16,
4732   0x2b15,0x2b13,0x2b12,0x2b10,0x2b0f,0x2b0e,0x2b0d,0x2b0b,0x2b09,0x2b08,0x2b07,0x2b06,0x2b05,0x2b02,0x2b01,0x2b00,
4733   0x2aff,0x2afe,0x2afc,0x2afa,0x2af9,0x2af8,0x2af7,0x2af5,0x2af4,0x2af2,0x2af1,0x2af0,0x2aee,0x2aed,0x2aec,0x2aea,
4734   0x2ae9,0x2ae7,0x2ae6,0x2ae5,0x2ae4,0x2ae2,0x2ae0,0x2adf,0x2ade,0x2add,0x2adc,0x2ad9,0x2ad8,0x2ad7,0x2ad6,0x2ad5,
4735   0x2ad4,0x2ad1,0x2ad0,0x2acf,0x2ace,0x2acd,0x2acb,0x2ac9,0x2ac8,0x2ac7,0x2ac6,0x2ac4,0x2ac3,0x2ac1,0x2ac0,0x2abf,
4736   0x2abd,0x2abc,0x2abb,0x2ab9,0x2ab8,0x2ab6,0x2ab5,0x2ab4,0x2ab3,0x2ab1,0x2aaf,0x2aae,0x2aad,0x2aac,0x2aab,0x2aa8,
4737   0x2aa7,0x2aa6,0x2aa5,0x2aa4,0x2aa3,0x2aa0,0x2a9f,0x2a9e,0x2a9d,0x2a9c,0x2a9a,0x2a98,0x2a97,0x2a96,0x2a95,0x2a93,
4738   0x2a92,0x2a90,0x2a8f,0x2a8e,0x2a8c,0x2a8b,0x2a89,0x2a88,0x2a87,0x2a85,0x2a84,0x2a83,0x2a81,0x2a80,0x2a7e,0x2a7d,
4739   0x2a7c,0x2a7b,0x2a79,0x2a77,0x2a76,0x2a75,0x2a74,0x2a73,0x2a70,0x2a6f,0x2a6e,0x2a6d,0x2a6c,0x2a6b,0x2a68,0x2a67,
4740   0x2a66,0x2a65,0x2a63,0x2a62,0x2a60,0x2a5f,0x2a5e,0x2a5c,0x2a5b,0x2a5a,0x2a58,0x2a57,0x2a55,0x2a54,0x2a53,0x2a52,
4741   0x2a50,0x2a4e,0x2a4d,0x2a4c,0x2a4b,0x2a4a,0x2a47,0x2a46,0x2a45,0x2a44,0x2a43,0x2a42,0x2a3f,0x2a3e,0x2a3d,0x2a3c,
4742   0x2a3b,0x2a39,0x2a38,0x2a37,0x2a36,0x2a34,0x2a33,0x2a31,0x2a30,0x2a2f,0x2a2d,0x2a2c,0x2a2b,0x2a29,0x2a28,0x2a26,
4743   0x2a25,0x2a24,0x2a23,0x2a21,0x2a1f,0x2a1e,0x2a1d,0x2a1c,0x2a1b,0x2a18,0x2a17,0x2a16,0x2a15,0x2a14,0x2a13,0x2a10,
4744   0x2a0f,0x2a0e,0x2a0d,0x2a0c,0x2a0a,0x2a08,0x2a07,0x2a06,0x2a05,0x2a03,0x2a02,0x2a00,0x29ff,0x29fe,0x29fd,0x29fb,
4745   0x29fa,0x29f8,0x29f7,0x29f6,0x29f4,0x29f3,0x29f2,0x29f0,0x29ef,0x29ed,0x29ec,0x29eb,0x29ea,0x29e8,0x29e6,0x29e5,
4746   0x29e4,0x29e3,0x29e2,0x29e1,0x29de,0x29dd,0x29dc,0x29db,0x29da,0x29d8,0x29d6,0x29d5,0x29d4,0x29d3,0x29d1,0x29d0,
4747   0x29ce,0x29cd,0x29cc,0x29ca,0x29c9,0x29c8,0x29c6,0x29c5,0x29c3,0x29c2,0x29c1,0x29c0,0x29be,0x29bc,0x29bb,0x29ba,
4748   0x29b9,0x29b8,0x29b6,0x29b4,0x29b3,0x29b2,0x29b1,0x29b0,0x29ad,0x29ac,0x29ab,0x29aa,0x29a9,0x29a8,0x29a5,0x29a4,
4749   0x29a3,0x29a2,0x29a1,0x299f,0x299d,0x299c,0x299b,0x299a,0x2998,0x2997,0x2995,0x2994,0x2993,0x2991,0x2990,0x298f,
4750   0x298e,0x298c,0x298a,0x2989,0x2988,0x2987,0x2985,0x2984,0x2982,0x2981,0x2980,0x297e,0x297d,0x297c,0x297b,0x2979,
4751   0x2977,0x2976,0x2975,0x2974,0x2973,0x2971,0x296f,0x296e,0x296d,0x296c,0x296b,0x2968,0x2967,0x2966,0x2965,0x2964,
4752   0x2963,0x2960,0x295f,0x295e,0x295d,0x295c,0x295a,0x2959,0x2957,0x2956,0x2955,0x2954,0x2952,0x2951,0x294f,0x294e,
4753   0x294d,0x294b,0x294a,0x2949,0x2947,0x2946,0x2944,0x2943,0x2942,0x2941,0x293f,0x293d,0x293c,0x293b,0x293a,0x2939,
4754   0x2938,0x2935,0x2934,0x2933,0x2932,0x2931,0x2930,0x292d,0x292c,0x292b,0x292a,0x2929,0x2927,0x2925,0x2924,0x2923,
4755   0x2922,0x2920,0x291f,0x291d,0x291c,0x291b,0x291a,0x2918,0x2917,0x2915,0x2914,0x2913,0x2911,0x2910,0x290f,0x290e,
4756   0x290c,0x290a,0x2909,0x2908,0x2907,0x2906,0x2903,0x2902,0x2901,0x2900,0x28ff,0x28fe,0x28fb,0x28fa,0x28f9,0x28f8,
4757   0x28f7,0x28f6,0x28f3,0x28f2,0x28f1,0x28f0,0x28ef,0x28ed,0x28ec,0x28ea,0x28e9,0x28e8,0x28e6,0x28e5,0x28e4,0x28e2,
4758   0x28e1,0x28e0,0x28de,0x28dd,0x28dc,0x28da,0x28d9,0x28d7,0x28d6,0x28d5,0x28d4,0x28d2,0x28d0,0x28cf,0x28ce,0x28cd,
4759   0x28cc,0x28cb,0x28c8,0x28c7,0x28c6,0x28c5,0x28c4,0x28c3,0x28c0,0x28bf,0x28be,0x28bd,0x28bc,0x28ba,0x28b8,0x28b7,
4760   0x28b6,0x28b5,0x28b3,0x28b2,0x28b0,0x28af,0x28ae,0x28ac,0x28ab,0x28aa,0x28a9,0x28a7,0x28a6,0x28a4,0x28a3,0x28a2,
4761   0x28a1,0x289f,0x289d,0x289c,0x289b,0x289a,0x2899,0x2896,0x2895,0x2894,0x2893,0x2892,0x2891,0x288e,0x288d,0x288c,
4762   0x288b,0x288a,0x2889,0x2887,0x2885,0x2884,0x2883,0x2882,0x2880,0x287f,0x287d,0x287c,0x287b,0x2879,0x2878,0x2877,
4763   0x2875,0x2874,0x2872,0x2871,0x2870,0x286f,0x286d,0x286c,0x286a,0x2869,0x2868,0x2867,0x2866,0x2863,0x2862,0x2861,
4764   0x2860,0x285f,0x285e,0x285b,0x285a,0x2859,0x2858,0x2857,0x2855,0x2853,0x2852,0x2851,0x2850,0x284e,0x284d,0x284b,
4765   0x284a,0x2849,0x2848,0x2846,0x2845,0x2844,0x2842,0x2841,0x283f,0x283e,0x283d,0x283c,0x283a,0x2838,0x2837,0x2836,
4766   0x2835,0x2834,0x2833,0x2832,0x282f,0x282e,0x282d,0x282c,0x282b,0x282a,0x2827,0x2826,0x2825,0x2824,0x2823,0x2822,
4767   0x2820,0x281e,0x281d,0x281c,0x281b,0x2819,0x2818,0x2816,0x2815,0x2814,0x2813,0x2811,0x2810,0x280e,0x280d,0x280c,
4768   0x280a,0x2809,0x2808,0x2807,0x2805,0x2803,0x2802,0x2801,0x2800,0x27ff,0x27fd,0x27fb,0x27fa,0x27f9,0x27f8,0x27f7,
4769   0x27f6,0x27f3,0x27f2,0x27f1,0x27f0,0x27ef,0x27ee,0x27eb,0x27ea,0x27e9,0x27e8,0x27e7,0x27e5,0x27e3,0x27e2,0x27e1,
4770   0x27e0,0x27de,0x27dd,0x27dc,0x27da,0x27d9,0x27d8,0x27d6,0x27d5,0x27d4,0x27d2,0x27d1,0x27cf,0x27ce,0x27cd,0x27cc,
4771   0x27cb,0x27c9,0x27c7,0x27c6,0x27c5,0x27c4,0x27c3,0x27c0,0x27bf,0x27be,0x27bd,0x27bc,0x27bb,0x27b8,0x27b7,0x27b6,
4772   0x27b5,0x27b4,0x27b3,0x27b1,0x27af,0x27ae,0x27ad,0x27ac,0x27aa,0x27a9,0x27a7,0x27a6,0x27a5,0x27a4,0x27a2,0x27a1,
4773   0x27a0,0x279e,0x279d,0x279b,0x279a,0x2799,0x2798,0x2796,0x2794,0x2793,0x2792,0x2791,0x2790,0x278e,0x278c,0x278b,
4774   0x278a,0x2789,0x2787,0x2786,0x2785,0x2783,0x2782,0x2781,0x2780,0x277e,0x277c,0x277b,0x277a,0x2779,0x2778,0x2776,
4775   0x2774,0x2773,0x2772,0x2771,0x2770,0x276f,0x276c,0x276b,0x276a,0x2769,0x2768,0x2767,0x2764,0x2763,0x2762,0x2761,
4776   0x2760,0x275e,0x275d,0x275b,0x275a,0x2759,0x2758,0x2756,0x2755,0x2754,0x2752,0x2751,0x2750,0x274e,0x274d,0x274c,
4777   0x274a,0x2749,0x2747,0x2746,0x2745,0x2744,0x2743,0x2741,0x273f,0x273e,0x273d,0x273c,0x273b,0x2738,0x2737,0x2736,
4778   0x2735,0x2734,0x2733,0x2732,0x272f,0x272e,0x272d,0x272c,0x272b,0x2729,0x2727,0x2726,0x2725,0x2724,0x2723,0x2721,
4779   0x2720,0x271e,0x271d,0x271c,0x271b,0x2719,0x2718,0x2716,0x2715,0x2714,0x2712,0x2711,0x2710,0x270f,0x270d,0x270c,
4780   0x270a,0x2709,0x2708,0x2707,0x2706,0x2703,0x2702,0x2701,0x2700,0x26ff,0x26fe,0x26fb,0x26fa,0x26f9,0x26f8,0x26f7,
4781   0x26f6,0x26f4,0x26f2,0x26f1,0x26f0,0x26ef,0x26ee,0x26ec,0x26ea,0x26e9,0x26e8,0x26e7,0x26e5,0x26e4,0x26e3,0x26e1,
4782   0x26e0,0x26df,0x26dd,0x26dc,0x26db,0x26d9,0x26d8,0x26d7,0x26d5,0x26d4,0x26d3,0x26d2,0x26d0,0x26ce,0x26cd,0x26cc,
4783   0x26cb,0x26ca,0x26c9,0x26c6,0x26c5,0x26c4,0x26c3,0x26c2,0x26c1,0x26be,0x26bd,0x26bc,0x26bb,0x26ba,0x26b9,0x26b7,
4784   0x26b5,0x26b4,0x26b3,0x26b2,0x26b0,0x26af,0x26ad,0x26ac,0x26ab,0x26aa,0x26a8,0x26a7,0x26a6,0x26a4,0x26a3,0x26a2,
4785   0x26a0,0x269f,0x269e,0x269c,0x269b,0x2699,0x2698,0x2697,0x2696,0x2695,0x2693,0x2691,0x2690,0x268f,0x268e,0x268d,
4786   0x268c,0x2689,0x2688,0x2687,0x2686,0x2685,0x2684,0x2681,0x2680,0x267f,0x267e,0x267d,0x267b,0x267a,0x2678,0x2677,
4787   0x2676,0x2675,0x2673,0x2672,0x2670,0x266f,0x266e,0x266d,0x266b,0x266a,0x2669,0x2667,0x2666,0x2664,0x2663,0x2662,
4788   0x2661,0x265f,0x265e,0x265c,0x265b,0x265a,0x2659,0x2658,0x2655,0x2654,0x2653,0x2652,0x2651,0x2650,0x264d,0x264c,
4789   0x264b,0x264a,0x2649,0x2648,0x2646,0x2644,0x2643,0x2642,0x2641,0x2640,0x263e,0x263d,0x263b,0x263a,0x2639,0x2637,
4790   0x2637,0x2635,0x2634,0x2633,0x2631,0x2630,0x262f,0x262d,0x262c,0x262a,0x2629,0x2628,0x2627,0x2626,0x2624,0x2622,
4791   0x2621,0x2620,0x261f,0x261e,0x261d,0x261a,0x2619,0x2618,0x2617,0x2616,0x2615,0x2612,0x2611,0x2610,0x260f,0x260e,
4792   0x260d,0x260b,0x2609,0x2608,0x2607,0x2606,0x2605,0x2603,0x2602,0x2600,0x25ff,0x25fe,0x25fd,0x25fb,0x25fa,0x25f9,
4793   0x25f7,0x25f6,0x25f5,0x25f3,0x25f2,0x25f1,0x25ef,0x25ee,0x25ec,0x25eb,0x25ea,0x25e9,0x25e8,0x25e6,0x25e4,0x25e3,
4794   0x25e2,0x25e1,0x25e0,0x25df,0x25dc,0x25db,0x25da,0x25d9,0x25d8,0x25d7,0x25d6,0x25d3,0x25d2,0x25d1,0x25d0,0x25cf,
4795   0x25cd,0x25cb,0x25ca,0x25c9,0x25c8,0x25c7,0x25c5,0x25c4,0x25c2,0x25c1,0x25c0,0x25bf,0x25bd,0x25bc,0x25bb,0x25b9,
4796   0x25b8,0x25b7,0x25b5,0x25b4,0x25b3,0x25b2,0x25b0,0x25ae,0x25ad,0x25ac,0x25ab,0x25aa,0x25a8,0x25a6,0x25a5,0x25a4,
4797   0x25a3,0x25a2,0x25a1,0x259e,0x259d,0x259c,0x259b,0x259a,0x2599,0x2597,0x2595,0x2594,0x2593,0x2592,0x2591,0x258f,
4798   0x258e,0x258d,0x258a,0x2589,0x2588,0x2587,0x2586,0x2585,0x2584,0x2581,0x2580,0x257f,0x257e,0x257d,0x257c,0x257a,
4799   0x2578,0x2577,0x2576,0x2575,0x2574,0x2572,0x2571,0x256f,0x256e,0x256d,0x256c,0x256a,0x2569,0x2568,0x2566,0x2565,
4800   0x2564,0x2562,0x2561,0x2560,0x255f,0x255d,0x255c,0x255a,0x2559,0x2558,0x2557,0x2556,0x2554,0x2552,0x2551,0x2550,
4801   0x254f,0x254e,0x254d,0x254a,0x2549,0x2548,0x2547,0x2546,0x2545,0x2544,0x2541,0x2540,0x253f,0x253e,0x253d,0x253c,
4802   0x253a,0x2538,0x2537,0x2536,0x2535,0x2534,0x2532,0x2530,0x252f,0x252e,0x252d,0x252b,0x252a,0x2529,0x2527,0x2526,
4803   0x2525,0x2523,0x2522,0x2521,0x2520,0x251e,0x251d,0x251b,0x251a,0x2519,0x2518,0x2517,0x2515,0x2513,0x2512,0x2511,
4804   0x2510,0x250f,0x250e,0x250b,0x250a,0x2509,0x2508,0x2507,0x2506,0x2505,0x2502,0x2501,0x2500,0x24ff,0x24fe,0x24fd,
4805   0x24fb,0x24f9,0x24f8,0x24f7,0x24f6,0x24f5,0x24f3,0x24f2,0x24f0,0x24ef,0x24ee,0x24ed,0x24eb,0x24ea,0x24e9,0x24e7,
4806   0x24e6,0x24e5,0x24e3,0x24e2,0x24e1,0x24e0,0x24de,0x24dd,0x24db,0x24da,0x24d9,0x24d8,0x24d7,0x24d5,0x24d3,0x24d2,
4807   0x24d1,0x24d0,0x24cf,0x24ce,0x24cb,0x24ca,0x24c9,0x24c8,0x24c7,0x24c6,0x24c3,0x24c2,0x24c1,0x24c0,0x24bf,0x24be,
4808   0x24bc,0x24ba,0x24b9,0x24b8,0x24b7,0x24b6,0x24b4,0x24b3,0x24b1,0x24b0,0x24af,0x24ae,0x24ac,0x24ab,0x24aa,0x24a8,
4809   0x24a7,0x24a6,0x24a4,0x24a3,0x24a2,0x24a1,0x249f,0x249e,0x249c,0x249b,0x249a,0x2499,0x2498,0x2496,0x2494,0x2493,
4810   0x2492,0x2491,0x2490,0x248f,0x248c,0x248b,0x248a,0x2489,0x2488,0x2487,0x2486,0x2483,0x2482,0x2481,0x2480,0x247f,
4811   0x247e,0x247c,0x247a,0x2479,0x2478,0x2477,0x2476,0x2474,0x2473,0x2471,0x2470,0x246f,0x246e,0x246c,0x246b,0x246a,
4812   0x2468,0x2467,0x2465,0x2464,0x2463,0x2462,0x2461,0x245f,0x245d,0x245c,0x245b,0x245a,0x2459,0x2457,0x2455,0x2454,
4813   0x2453,0x2452,0x2451,0x2450,0x244d,0x244c,0x244b,0x244a,0x2449,0x2448,0x2447,0x2444,0x2443,0x2442,0x2441,0x2440,
4814   0x243f,0x243e,0x243c,0x243b,0x2439,0x2438,0x2437,0x2436,0x2434,0x2433,0x2432,0x2430,0x242f,0x242e,0x242c,0x242b,
4815   0x242a,0x2429,0x2427,0x2426,0x2425,0x2423,0x2422,0x2421,0x2420,0x241e,0x241d,0x241b,0x241a,0x2419,0x2418,0x2417,
4816   0x2416,0x2413,0x2412,0x2411,0x2410,0x240f,0x240e,0x240d,0x240a,0x2409,0x2408,0x2407,0x2406,0x2405,0x2403,0x2401,
4817   0x2400,0x23ff,0x23fe,0x23fd,0x23fb,0x23fa,0x23f8,0x23f7,0x23f6,0x23f5,0x23f3,0x23f2,0x23f1,0x23ef,0x23ee,0x23ed,
4818   0x23eb,0x23ea,0x23e9,0x23e8,0x23e6,0x23e5,0x23e3,0x23e2,0x23e1,0x23e0,0x23df,0x23dd,0x23dc,0x23da,0x23d9,0x23d8,
4819   0x23d7,0x23d6,0x23d4,0x23d2,0x23d1,0x23d0,0x23cf,0x23ce,0x23cd,0x23ca,0x23c9,0x23c8,0x23c7,0x23c6,0x23c5,0x23c4,
4820   0x23c2,0x23c0,0x23bf,0x23be,0x23bd,0x23bc,0x23ba,0x23b9,0x23b7,0x23b6,0x23b5,0x23b4,0x23b2,0x23b1,0x23b0,0x23ae,
4821   0x23ad,0x23ac,0x23aa,0x23a9,0x23a8,0x23a7,0x23a5,0x23a4,0x23a2,0x23a1,0x23a0,0x239f,0x239e,0x239c,0x239a,0x2399,
4822   0x2398,0x2397,0x2395,0x2394,0x2393,0x2392,0x2390,0x238f,0x238e,0x238d,0x238b,0x238a,0x2388,0x2387,0x2386,0x2385,
4823   0x2384,0x2382,0x2380,0x237f,0x237e,0x237d,0x237c,0x237b,0x2378,0x2377,0x2376,0x2375,0x2374,0x2373,0x2372,0x2371,
4824   0x236e,0x236d,0x236c,0x236b,0x236a,0x2369,0x2367,0x2365,0x2364,0x2363,0x2362,0x2361,0x235f,0x235e,0x235c,0x235b,
4825   0x235a,0x2359,0x2358,0x2356,0x2355,0x2354,0x2352,0x2351,0x2350,0x234e,0x234d,0x234c,0x234b,0x2349,0x2348,0x2346,
4826   0x2345,0x2344,0x2343,0x2342,0x2340,0x233f,0x233d,0x233c,0x233b,0x233a,0x2339,0x2337,0x2335,0x2334,0x2333,0x2332,
4827   0x2331,0x2330,0x232f,0x232c,0x232b,0x232a,0x2329,0x2328,0x2327,0x2326,0x2323,0x2322,0x2321,0x2320,0x231f,0x231e,
4828   0x231c,0x231a,0x2319,0x2318,0x2317,0x2316,0x2314,0x2313,0x2312,0x2310,0x230f,0x230e,0x230d,0x230b,0x230a,0x2309,
4829   0x2307,0x2306,0x2305,0x2303,0x2302,0x2301,0x2300,0x22fe,0x22fd,0x22fb,0x22fa,0x22f9,0x22f8,0x22f7,0x22f6,0x22f3,
4830   0x22f2,0x22f1,0x22f0,0x22ef,0x22ee,0x22ed,0x22ea,0x22e9,0x22e8,0x22e7,0x22e6,0x22e5,0x22e4,0x22e1,0x22e0,0x22df,
4831   0x22de,0x22dd,0x22dc,0x22da,0x22d9,0x22d7,0x22d6,0x22d5,0x22d4,0x22d3,0x22d1,0x22d0,0x22ce,0x22cd,0x22cc,0x22cb,
4832   0x22c9,0x22c8,0x22c7,0x22c5,0x22c4,0x22c3,0x22c1,0x22c0,0x22bf,0x22be,0x22bd,0x22bb,0x22ba,0x22b8,0x22b7,0x22b6,
4833   0x22b5,0x22b4,0x22b2,0x22b0,0x22af,0x22ae,0x22ad,0x22ac,0x22ab,0x22a8,0x22a7,0x22a6,0x22a5,0x22a4,0x22a3,0x22a2,
4834   0x22a1,0x229e,0x229d,0x229c,0x229b,0x229a,0x2299,0x2297,0x2295,0x2294,0x2293,0x2292,0x2291,0x228f,0x228e,0x228c,
4835   0x228b,0x228a,0x2289,0x2288,0x2286,0x2285,0x2283,0x2282,0x2281,0x2280,0x227e,0x227d,0x227c,0x227b,0x2279,0x2278,
4836   0x2276,0x2275,0x2274,0x2273,0x2272,0x2270,0x226f,0x226d,0x226c,0x226b,0x226a,0x2269,0x2267,0x2265,0x2264,0x2263,
4837   0x2262,0x2261,0x2260,0x225f,0x225c,0x225b,0x225a,0x2259,0x2258,0x2257,0x2255,0x2253,0x2252,0x2251,0x2250,0x224f,
4838   0x224e,0x224c,0x224b,0x224a,0x2249,0x2247,0x2246,0x2245,0x2243,0x2242,0x2241,0x223f,0x223e,0x223d,0x223c,0x223b,
4839   0x2239,0x2238,0x2236,0x2235,0x2234,0x2233,0x2232,0x2230,0x222e,0x222d,0x222c,0x222b,0x222a,0x2229,0x2228,0x2225,
4840   0x2224,0x2223,0x2222,0x2221,0x2220,0x221f,0x221c,0x221b,0x221a,0x2219,0x2218,0x2217,0x2216,0x2214,0x2212,0x2211,
4841   0x2210,0x220f,0x220e,0x220c,0x220b,0x2209,0x2208,0x2207,0x2206,0x2205,0x2203,0x2202,0x2201,0x21ff,0x21fe,0x21fd,
4842   0x21fb,0x21fa,0x21f9,0x21f8,0x21f6,0x21f5,0x21f4,0x21f2,0x21f1,0x21f0,0x21ef,0x21ee,0x21ec,0x21ea,0x21e9,0x21e8,
4843   0x21e7,0x21e6,0x21e5,0x21e3,0x21e1,0x21e0,0x21df,0x21de,0x21dd,0x21dc,0x21db,0x21d8,0x21d7,0x21d6,0x21d5,0x21d4,
4844   0x21d3,0x21d2,0x21cf,0x21ce,0x21cd,0x21cc,0x21cb,0x21ca,0x21c8,0x21c7,0x21c5,0x21c4,0x21c3,0x21c2,0x21c1,0x21bf,
4845   0x21be,0x21bc,0x21bb,0x21ba,0x21b9,0x21b8,0x21b6,0x21b5,0x21b4,0x21b2,0x21b1,0x21b0,0x21ae,0x21ad,0x21ac,0x21ab,
4846   0x21a9,0x21a8,0x21a6,0x21a5,0x21a4,0x21a3,0x21a1,0x21a0,0x219f,0x219e,0x219c,0x219b,0x219a,0x2198,0x2197,0x2196,
4847   0x2195,0x2194,0x2192,0x2191,0x218f,0x218e,0x218d,0x218c,0x218b,0x218a,0x2187,0x2186,0x2185,0x2184,0x2183,0x2182,
4848   0x2181,0x217e,0x217d,0x217c,0x217b,0x217a,0x2179,0x2178,0x2177,0x2174,0x2173,0x2172,0x2171,0x2170,0x216f,0x216e,
4849   0x216c,0x216a,0x2169,0x2168,0x2167,0x2166,0x2164,0x2163,0x2162,0x2160,0x215f,0x215e,0x215d,0x215b,0x215a,0x2159,
4850   0x2158,0x2156,0x2155,0x2154,0x2152,0x2151,0x2150,0x214f,0x214d,0x214c,0x214b,0x2149,0x2148,0x2147,0x2146,0x2145,
4851   0x2143,0x2141,0x2140,0x213f,0x213e,0x213d,0x213c,0x213b,0x2138,0x2137,0x2136,0x2135,0x2134,0x2133,0x2132,0x2131,
4852   0x212e,0x212d,0x212c,0x212b,0x212a,0x2129,0x2128,0x2125,0x2124,0x2123,0x2122,0x2121,0x2120,0x211e,0x211d,0x211b,
4853   0x211a,0x2119,0x2118,0x2117,0x2115,0x2114,0x2113,0x2111,0x2110,0x210f,0x210e,0x210c,0x210b,0x210a,0x2109,0x2107,
4854   0x2106,0x2105,0x2103,0x2102,0x2101,0x2100,0x20fe,0x20fd,0x20fb,0x20fa,0x20f9,0x20f8,0x20f7,0x20f6,0x20f4,0x20f2,
4855   0x20f1,0x20f0,0x20ef,0x20ee,0x20ed,0x20ec,0x20e9,0x20e8,0x20e7,0x20e6,0x20e5,0x20e4,0x20e3,0x20e2,0x20df,0x20de,
4856   0x20dd,0x20dc,0x20db,0x20da,0x20d8,0x20d6,0x20d5,0x20d4,0x20d3,0x20d2,0x20d1,0x20cf,0x20ce,0x20cc,0x20cb,0x20ca,
4857   0x20c9,0x20c8,0x20c6,0x20c5,0x20c4,0x20c2,0x20c1,0x20c0,0x20bf,0x20bd,0x20bc,0x20bb,0x20ba,0x20b8,0x20b7,0x20b5,
4858   0x20b4,0x20b3,0x20b2,0x20b1,0x20af,0x20ae,0x20ac,0x20ab,0x20aa,0x20a9,0x20a8,0x20a7,0x20a5,0x20a3,0x20a2,0x20a1,
4859   0x20a0,0x209f,0x209e,0x209d,0x209a,0x2099,0x2098,0x2097,0x2096,0x2095,0x2094,0x2092,0x2090,0x208f,0x208e,0x208d,
4860   0x208c,0x208b,0x2089,0x2087,0x2086,0x2085,0x2084,0x2083,0x2082,0x2080,0x207f,0x207d,0x207c,0x207b,0x207a,0x2079,
4861   0x2077,0x2076,0x2075,0x2073,0x2072,0x2071,0x2070,0x206e,0x206d,0x206c,0x206b,0x2069,0x2068,0x2066,0x2065,0x2064,
4862   0x2063,0x2062,0x2061,0x2060,0x205f,0x205c,0x205b,0x205a,0x2059,0x2058,0x2057,0x2056,0x2054,0x2052,0x2051,0x2050,
4863   0x204f,0x204e,0x204d,0x204b,0x204a,0x2048,0x2047,0x2046,0x2045,0x2044,0x2042,0x2041,0x2040,0x203e,0x203d,0x203c,
4864   0x203b,0x2039,0x2038,0x2037,0x2036,0x2034,0x2033,0x2032,0x2030,0x202f,0x202e,0x202d,0x202c,0x202a,0x2029,0x2027,
4865   0x2026,0x2025,0x2024,0x2023,0x2022,0x2020,0x201e,0x201d,0x201c,0x201b,0x201a,0x2019,0x2018,0x2015,0x2014,0x2013,
4866   0x2012,0x2011,0x2010,0x200f,0x200e,0x200b,0x200a,0x2009,0x2008,0x2007,0x2006,0x2005,0x2003,0x2001,0x2000,0x1fff,
4867   0x1ffe,0x1ffd,0x1ffc,0x1ffa,0x1ff9,0x1ff7,0x1ff6,0x1ff5,0x1ff4,0x1ff3,0x1ff1,0x1ff0,0x1fef,0x1fed,0x1fec,0x1feb,
4868   0x1fea,0x1fe8,0x1fe7,0x1fe6,0x1fe5,0x1fe3,0x1fe2,0x1fe1,0x1fdf,0x1fde,0x1fdd,0x1fdc,0x1fdb,0x1fd9,0x1fd8,0x1fd6,
4869   0x1fd5,0x1fd4,0x1fd3,0x1fd2,0x1fd1,0x1fcf,0x1fcd,0x1fcc,0x1fcb,0x1fca,0x1fc9,0x1fc8,0x1fc7,0x1fc4,0x1fc3,0x1fc2,
4870   0x1fc1,0x1fc0,0x1fbf,0x1fbc,0x1fbb,0x1fba,0x1fb9,0x1fb8,0x1fb7,0x1fb6,0x1fb4,0x1fb2,0x1fb1,0x1fb0,0x1faf,0x1fae,
4871   0x1fad,0x1fac,0x1faa,0x1fa8,0x1fa7,0x1fa6,0x1fa5,0x1fa4,0x1fa3,0x1fa1,0x1fa0,0x1f9e,0x1f9d,0x1f9c,0x1f9b,0x1f9a,
4872   0x1f98,0x1f97,0x1f96,0x1f95,0x1f93,0x1f92,0x1f91,0x1f90,0x1f8e,0x1f8d,0x1f8c,0x1f8b,0x1f89,0x1f88,0x1f87,0x1f85,
4873   0x1f84,0x1f83,0x1f82,0x1f81,0x1f7f,0x1f7e,0x1f7c,0x1f7b,0x1f7a,0x1f79,0x1f78,0x1f77,0x1f75,0x1f73,0x1f72,0x1f71,
4874   0x1f70,0x1f6f,0x1f6e,0x1f6d,0x1f6c,0x1f69,0x1f68,0x1f67,0x1f66,0x1f65,0x1f64,0x1f63,0x1f62,0x1f5f,0x1f5e,0x1f5d,
4875   0x1f5c,0x1f5b,0x1f5a,0x1f59,0x1f57,0x1f55,0x1f54,0x1f53,0x1f52,0x1f51,0x1f50,0x1f4e,0x1f4d,0x1f4b,0x1f4a,0x1f49,
4876   0x1f48,0x1f47,0x1f46,0x1f44,0x1f43,0x1f42,0x1f40,0x1f3f,0x1f3e,0x1f3d,0x1f3b,0x1f3a,0x1f39,0x1f38,0x1f36,0x1f35,
4877   0x1f34,0x1f32,0x1f31,0x1f30,0x1f2f,0x1f2e,0x1f2c,0x1f2b,0x1f29,0x1f28,0x1f27,0x1f26,0x1f25,0x1f24,0x1f22,0x1f21,
4878   0x1f1f,0x1f1e,0x1f1d,0x1f1c,0x1f1b,0x1f1a,0x1f19,0x1f16,0x1f15,0x1f14,0x1f13,0x1f12,0x1f11,0x1f10,0x1f0f,0x1f0c,
4879   0x1f0b,0x1f0a,0x1f09,0x1f08,0x1f07,0x1f06,0x1f04,0x1f02,0x1f01,0x1f00,0x1eff,0x1efe,0x1efd,0x1efc,0x1efa,0x1ef8,
4880   0x1ef7,0x1ef6,0x1ef5,0x1ef4,0x1ef3,0x1ef1,0x1ef0,0x1eef,0x1eed,0x1eec,0x1eeb,0x1eea,0x1ee8,0x1ee7,0x1ee6,0x1ee5,
4881   0x1ee3,0x1ee2,0x1ee1,0x1edf,0x1ede,0x1edd,0x1edc,0x1edb,0x1ed9,0x1ed8,0x1ed7,0x1ed5,0x1ed4,0x1ed3,0x1ed2,0x1ed1,
4882   0x1ed0,0x1ece,0x1ecc,0x1ecb,0x1eca,0x1ec9,0x1ec8,0x1ec7,0x1ec6,0x1ec3,0x1ec2,0x1ec1,0x1ec0,0x1ebf,0x1ebe,0x1ebd,
4883   0x1ebc,0x1eb9,0x1eb8,0x1eb7,0x1eb6,0x1eb5,0x1eb4,0x1eb3,0x1eb2,0x1eaf,0x1eae,0x1ead,0x1eac,0x1eab,0x1eaa,0x1ea9,
4884   0x1ea7,0x1ea6,0x1ea4,0x1ea3,0x1ea2,0x1ea1,0x1ea0,0x1e9e,0x1e9d,0x1e9c,0x1e9a,0x1e99,0x1e98,0x1e97,0x1e95,0x1e94,
4885   0x1e93,0x1e92,0x1e90,0x1e8f,0x1e8e,0x1e8d,0x1e8b,0x1e8a,0x1e89,0x1e88,0x1e86,0x1e85,0x1e84,0x1e82,0x1e81,0x1e80,
4886   0x1e7f,0x1e7d,0x1e7c,0x1e7b,0x1e7a,0x1e79,0x1e78,0x1e76,0x1e75,0x1e73,0x1e72,0x1e71,0x1e70,0x1e6f,0x1e6d,0x1e6c,
4887   0x1e6b,0x1e6a,0x1e68,0x1e67,0x1e66,0x1e65,0x1e63,0x1e62,0x1e61,0x1e60,0x1e5e,0x1e5d,0x1e5c,0x1e5a,0x1e59,0x1e58,
4888   0x1e57,0x1e56,0x1e55,0x1e53,0x1e52,0x1e50,0x1e4f,0x1e4e,0x1e4d,0x1e4c,0x1e4b,0x1e49,0x1e48,0x1e46,0x1e45,0x1e44,
4889   0x1e43,0x1e42,0x1e41,0x1e40,0x1e3d,0x1e3c,0x1e3b,0x1e3a,0x1e39,0x1e38,0x1e37,0x1e36,0x1e33,0x1e32,0x1e31,0x1e30,
4890   0x1e2f,0x1e2e,0x1e2d,0x1e2c,0x1e2a,0x1e28,0x1e27,0x1e26,0x1e25,0x1e24,0x1e23,0x1e22,0x1e20,0x1e1e,0x1e1d,0x1e1c,
4891   0x1e1b,0x1e1a,0x1e19,0x1e17,0x1e16,0x1e15,0x1e13,0x1e12,0x1e11,0x1e10,0x1e0f,0x1e0d,0x1e0c,0x1e0b,0x1e09,0x1e08,
4892   0x1e07,0x1e06,0x1e04,0x1e03,0x1e02,0x1e01,0x1e00,0x1dfe,0x1dfd,0x1dfc,0x1dfa,0x1df9,0x1df8,0x1df7,0x1df6,0x1df4,
4893   0x1df3,0x1df1,0x1df0,0x1def,0x1dee,0x1ded,0x1dec,0x1deb,0x1de9,0x1de7,0x1de6,0x1de5,0x1de4,0x1de3,0x1de2,0x1de1,
4894   0x1de0,0x1ddd,0x1ddc,0x1ddb,0x1dda,0x1dd9,0x1dd8,0x1dd7,0x1dd6,0x1dd3,0x1dd2,0x1dd1,0x1dd0,0x1dcf,0x1dce,0x1dcd,
4895   0x1dcb,0x1dca,0x1dc8,0x1dc7,0x1dc6,0x1dc5,0x1dc4,0x1dc3,0x1dc1,0x1dc0,0x1dbe,0x1dbd,0x1dbc,0x1dbb,0x1dba,0x1db9,
4896   0x1db7,0x1db6,0x1db5,0x1db3,0x1db2,0x1db1,0x1db0,0x1dae,0x1dad,0x1dac,0x1dab,0x1da9,0x1da8,0x1da7,0x1da6,0x1da4,
4897   0x1da3,0x1da2,0x1da1,0x1da0,0x1d9e,0x1d9d,0x1d9b,0x1d9a,0x1d99,0x1d98,0x1d97,0x1d96,0x1d94,0x1d93,0x1d91,0x1d90,
4898   0x1d8f,0x1d8e,0x1d8d,0x1d8c,0x1d8b,0x1d88,0x1d87,0x1d86,0x1d85,0x1d84,0x1d83,0x1d82,0x1d81,0x1d7e,0x1d7d,0x1d7c,
4899   0x1d7b,0x1d7a,0x1d79,0x1d78,0x1d77,0x1d75,0x1d73,0x1d72,0x1d71,0x1d70,0x1d6f,0x1d6e,0x1d6d,0x1d6b,0x1d69,0x1d68,
4900   0x1d67,0x1d66,0x1d65,0x1d64,0x1d62,0x1d61,0x1d60,0x1d5e,0x1d5d,0x1d5c,0x1d5b,0x1d5a,0x1d58,0x1d57,0x1d56,0x1d54,
4901   0x1d53,0x1d52,0x1d51,0x1d4f,0x1d4e,0x1d4d,0x1d4c,0x1d4b,0x1d49,0x1d48,0x1d47,0x1d45,0x1d44,0x1d43,0x1d42,0x1d41,
4902   0x1d3f,0x1d3e,0x1d3d,0x1d3c,0x1d3b,0x1d3a,0x1d39,0x1d37,0x1d35,0x1d34,0x1d33,0x1d32,0x1d31,0x1d30,0x1d2f,0x1d2e,
4903   0x1d2b,0x1d2a,0x1d29,0x1d28,0x1d27,0x1d26,0x1d25,0x1d24,0x1d23,0x1d20,0x1d1f,0x1d1e,0x1d1d,0x1d1c,0x1d1b,0x1d1a,
4904   0x1d18,0x1d17,0x1d15,0x1d14,0x1d13,0x1d12,0x1d11,0x1d10,0x1d0e,0x1d0d,0x1d0b,0x1d0a,0x1d09,0x1d08,0x1d07,0x1d06,
4905   0x1d04,0x1d03,0x1d02,0x1d00,0x1cff,0x1cfe,0x1cfd,0x1cfc,0x1cfa,0x1cf9,0x1cf8,0x1cf7,0x1cf5,0x1cf4,0x1cf3,0x1cf2,
4906   0x1cf0,0x1cef,0x1cee,0x1ced,0x1cec,0x1cea,0x1ce9,0x1ce8,0x1ce6,0x1ce5,0x1ce4,0x1ce3,0x1ce2,0x1ce1,0x1cdf,0x1cdd,
4907   0x1cdc,0x1cdb,0x1cda,0x1cd9,0x1cd8,0x1cd7,0x1cd6,0x1cd3,0x1cd2,0x1cd1,0x1cd0,0x1ccf,0x1cce,0x1ccd,0x1ccc,0x1cc9,
4908   0x1cc8,0x1cc7,0x1cc6,0x1cc5,0x1cc4,0x1cc3,0x1cc2,0x1cc1,0x1cbe,0x1cbd,0x1cbc,0x1cbb,0x1cba,0x1cb9,0x1cb8,0x1cb7,
4909   0x1cb5,0x1cb3,0x1cb2,0x1cb1,0x1cb0,0x1caf,0x1cae,0x1cad,0x1cab,0x1caa,0x1ca8,0x1ca7,0x1ca6,0x1ca5,0x1ca4,0x1ca2,
4910   0x1ca1,0x1ca0,0x1c9f,0x1c9e,0x1c9c,0x1c9a,0x1c99,0x1c98,0x1c97,0x1c96,0x1c95,0x1c94,0x1c92,0x1c91,0x1c8f,0x1c8e,
4911   0x1c8d,0x1c8c,0x1c8b,0x1c8a,0x1c88,0x1c87,0x1c86,0x1c84,0x1c83,0x1c82,0x1c81,0x1c80,0x1c7e,0x1c7d,0x1c7c,0x1c7b,
4912   0x1c7a,0x1c78,0x1c77,0x1c76,0x1c74,0x1c73,0x1c72,0x1c71,0x1c70,0x1c6f,0x1c6d,0x1c6c,0x1c6b,0x1c69,0x1c68,0x1c67,
4913   0x1c66,0x1c65,0x1c64,0x1c62,0x1c61,0x1c5f,0x1c5e,0x1c5d,0x1c5c,0x1c5b,0x1c5a,0x1c59,0x1c57,0x1c55,0x1c54,0x1c53,
4914   0x1c52,0x1c51,0x1c50,0x1c4f,0x1c4e,0x1c4b,0x1c4a,0x1c49,0x1c48,0x1c47,0x1c46,0x1c45,0x1c44,0x1c43,0x1c40,0x1c3f,
4915   0x1c3e,0x1c3d,0x1c3c,0x1c3b,0x1c3a,0x1c39,0x1c37,0x1c35,0x1c34,0x1c33,0x1c32,0x1c31,0x1c30,0x1c2f,0x1c2d,0x1c2c,
4916   0x1c2b,0x1c29,0x1c28,0x1c27,0x1c26,0x1c25,0x1c24,0x1c22,0x1c21,0x1c20,0x1c1e,0x1c1d,0x1c1c,0x1c1b,0x1c1a,0x1c18,
4917   0x1c17,0x1c16,0x1c15,0x1c13,0x1c12,0x1c11,0x1c10,0x1c0e,0x1c0d,0x1c0c,0x1c0b,0x1c0a,0x1c08,0x1c07,0x1c06,0x1c04,
4918   0x1c03,0x1c02,0x1c01,0x1c00,0x1bff,0x1bfd,0x1bfc,0x1bfa,0x1bf9,0x1bf8,0x1bf7,0x1bf6,0x1bf5,0x1bf4,0x1bf2,0x1bf0,
4919   0x1bef,0x1bee,0x1bed,0x1bec,0x1beb,0x1bea,0x1be9,0x1be6,0x1be5,0x1be4,0x1be3,0x1be2,0x1be1,0x1be0,0x1bdf,0x1bde,
4920   0x1bdd,0x1bda,0x1bd9,0x1bd8,0x1bd7,0x1bd6,0x1bd5,0x1bd4,0x1bd3,0x1bd1,0x1bcf,0x1bce,0x1bcd,0x1bcc,0x1bcb,0x1bca,
4921   0x1bc9,0x1bc7,0x1bc6,0x1bc4,0x1bc3,0x1bc2,0x1bc1,0x1bc0,0x1bbf,0x1bbd,0x1bbc,0x1bbb,0x1bb9,0x1bb8,0x1bb7,0x1bb6,
4922   0x1bb5,0x1bb3,0x1bb2,0x1bb1,0x1bb0,0x1bae,0x1bad,0x1bac,0x1bab,0x1ba9,0x1ba8,0x1ba7,0x1ba6,0x1ba5,0x1ba3,0x1ba2,
4923   0x1ba1,0x1b9f,0x1b9e,0x1b9d,0x1b9c,0x1b9b,0x1b9a,0x1b98,0x1b97,0x1b96,0x1b94,0x1b93,0x1b92,0x1b91,0x1b90,0x1b8f,
4924   0x1b8e,0x1b8c,0x1b8a,0x1b89,0x1b88,0x1b87,0x1b86,0x1b85,0x1b84,0x1b83,0x1b80,0x1b7f,0x1b7e,0x1b7d,0x1b7c,0x1b7b,
4925   0x1b7a,0x1b79,0x1b78,0x1b75,0x1b74,0x1b73,0x1b72,0x1b71,0x1b70,0x1b6f,0x1b6e,0x1b6c,0x1b6a,0x1b69,0x1b68,0x1b67,
4926   0x1b66,0x1b65,0x1b63,0x1b62,0x1b61,0x1b60,0x1b5f,0x1b5e,0x1b5c,0x1b5b,0x1b5a,0x1b58,0x1b57,0x1b56,0x1b55,0x1b54,
4927   0x1b53,0x1b51,0x1b50,0x1b4e,0x1b4d,0x1b4c,0x1b4b,0x1b4a,0x1b49,0x1b48,0x1b47,0x1b45,0x1b43,0x1b42,0x1b41,0x1b40,
4928   0x1b3f,0x1b3e,0x1b3d,0x1b3c,0x1b39,0x1b38,0x1b37,0x1b36,0x1b35,0x1b34,0x1b33,0x1b32,0x1b31,0x1b30,0x1b2d,0x1b2c,
4929   0x1b2b,0x1b2a,0x1b29,0x1b28,0x1b27,0x1b26,0x1b24,0x1b22,0x1b21,0x1b20,0x1b1f,0x1b1e,0x1b1d,0x1b1c,0x1b1b,0x1b19,
4930   0x1b18,0x1b16,0x1b15,0x1b14,0x1b13,0x1b12,0x1b11,0x1b0f,0x1b0e,0x1b0d,0x1b0b,0x1b0a,0x1b09,0x1b08,0x1b07,0x1b06,
4931   0x1b04,0x1b03,0x1b02,0x1b00,0x1aff,0x1afe,0x1afd,0x1afc,0x1afa,0x1af9,0x1af8,0x1af7,0x1af6,0x1af4,0x1af3,0x1af2,
4932   0x1af1,0x1aef,0x1aee,0x1aed,0x1aec,0x1aeb,0x1ae9,0x1ae8,0x1ae7,0x1ae5,0x1ae4,0x1ae3,0x1ae2,0x1ae1,0x1ae0,0x1adf,
4933   0x1add,0x1adc,0x1ada,0x1ad9,0x1ad8,0x1ad7,0x1ad6,0x1ad5,0x1ad4,0x1ad2,0x1ad0,0x1acf,0x1ace,0x1acd,0x1acc,0x1acb,
4934   0x1aca,0x1ac7,0x1ac6,0x1ac5,0x1ac4,0x1ac3,0x1ac2,0x1ac1,0x1ac0,0x1abf,0x1abc,0x1abb,0x1aba,0x1ab9,0x1ab8,0x1ab7,
4935   0x1ab6,0x1ab5,0x1ab4,0x1ab2,0x1ab0,0x1aaf,0x1aae,0x1aad,0x1aac,0x1aab,0x1aaa,0x1aa9,0x1aa7,0x1aa6,0x1aa4,0x1aa3,
4936   0x1aa2,0x1aa1,0x1aa0,0x1a9f,0x1a9e,0x1a9c,0x1a9b,0x1a9a,0x1a98,0x1a97,0x1a96,0x1a95,0x1a94,0x1a93,0x1a91,0x1a90,
4937   0x1a8f,0x1a8e,0x1a8c,0x1a8b,0x1a8a,0x1a89,0x1a87,0x1a86,0x1a85,0x1a84,0x1a83,0x1a82,0x1a80,0x1a7f,0x1a7e,0x1a7c,
4938   0x1a7b,0x1a7a,0x1a79,0x1a78,0x1a77,0x1a75,0x1a74,0x1a73,0x1a71,0x1a70,0x1a6f,0x1a6e,0x1a6d,0x1a6c,0x1a6b,0x1a69,
4939   0x1a68,0x1a66,0x1a65,0x1a64,0x1a63,0x1a62,0x1a61,0x1a60,0x1a5f,0x1a5d,0x1a5b,0x1a5a,0x1a59,0x1a58,0x1a57,0x1a56,
4940   0x1a55,0x1a54,0x1a53,0x1a50,0x1a4f,0x1a4e,0x1a4d,0x1a4c,0x1a4b,0x1a4a,0x1a49,0x1a48,0x1a47,0x1a44,0x1a43,0x1a42,
4941   0x1a41,0x1a40,0x1a3f,0x1a3e,0x1a3d,0x1a3b,0x1a3a,0x1a38,0x1a37,0x1a36,0x1a35,0x1a34,0x1a33,0x1a32,0x1a30,0x1a2f,
4942   0x1a2e,0x1a2c,0x1a2b,0x1a2a,0x1a29,0x1a28,0x1a27,0x1a25,0x1a24,0x1a23,0x1a21,0x1a20,0x1a1f,0x1a1e,0x1a1d,0x1a1c,
4943   0x1a1a,0x1a19,0x1a18,0x1a17,0x1a15,0x1a14,0x1a13,0x1a12,0x1a11,0x1a0f,0x1a0e,0x1a0d,0x1a0c,0x1a0b,0x1a09,0x1a08,
4944   0x1a07,0x1a06,0x1a04,0x1a03,0x1a02,0x1a01,0x1a00,0x19ff,0x19fd,0x19fc,0x19fa,0x19f9,0x19f8,0x19f7,0x19f6,0x19f5,
4945   0x19f4,0x19f3,0x19f1,0x19ef,0x19ee,0x19ed,0x19ec,0x19eb,0x19ea,0x19e9,0x19e8,0x19e7,0x19e4,0x19e3,0x19e2,0x19e1,
4946   0x19e0,0x19df,0x19de,0x19dd,0x19dc,0x19d9,0x19d8,0x19d7,0x19d6,0x19d5,0x19d4,0x19d3,0x19d2,0x19d1,0x19d0,0x19cd,
4947   0x19cc,0x19cb,0x19ca,0x19c9,0x19c8,0x19c7,0x19c6,0x19c5,0x19c3,0x19c1,0x19c0,0x19bf,0x19be,0x19bd,0x19bc,0x19bb,
4948   0x19ba,0x19b8,0x19b7,0x19b5,0x19b4,0x19b3,0x19b2,0x19b1,0x19b0,0x19ae,0x19ad,0x19ac,0x19ab,0x19a9,0x19a8,0x19a7,
4949   0x19a6,0x19a5,0x19a3,0x19a2,0x19a1,0x19a0,0x199f,0x199d,0x199c,0x199b,0x199a,0x1998,0x1997,0x1996,0x1995,0x1994,
4950   0x1992,0x1991,0x1990,0x198f,0x198e,0x198d,0x198b,0x198a,0x1988,0x1987,0x1986,0x1985,0x1984,0x1983,0x1982,0x1980,
4951   0x197f,0x197e,0x197c,0x197b,0x197a,0x1979,0x1978,0x1977,0x1975,0x1974,0x1973,0x1972,0x1971,0x196f,0x196e,0x196d,
4952   0x196c,0x196a,0x1969,0x1968,0x1967,0x1966,0x1965,0x1963,0x1962,0x1961,0x195f,0x195e,0x195d,0x195c,0x195b,0x195a,
4953   0x1959,0x1957,0x1956,0x1955,0x1953,0x1952,0x1951,0x1950,0x194f,0x194e,0x194d,0x194b,0x194a,0x1948,0x1947,0x1946,
4954   0x1945,0x1944,0x1943,0x1942,0x1941,0x1940,0x193d,0x193c,0x193b,0x193a,0x1939,0x1938,0x1937,0x1936,0x1935,0x1934,
4955   0x1931,0x1930,0x192f,0x192e,0x192d,0x192c,0x192b,0x192a,0x1929,0x1928,0x1925,0x1924,0x1923,0x1922,0x1921,0x1920,
4956   0x191f,0x191e,0x191d,0x191b,0x1919,0x1918,0x1917,0x1916,0x1915,0x1914,0x1913,0x1912,0x1910,0x190f,0x190e,0x190c,
4957   0x190b,0x190a,0x1909,0x1908,0x1907,0x1905,0x1904,0x1903,0x1902,0x1900,0x18ff,0x18fe,0x18fd,0x18fc,0x18fb,0x18f9,
4958   0x18f8,0x18f7,0x18f6,0x18f4,0x18f3,0x18f2,0x18f1,0x18f0,0x18ee,0x18ed,0x18ec,0x18eb,0x18ea,0x18e8,0x18e7,0x18e6,
4959   0x18e5,0x18e3,0x18e2,0x18e1,0x18e0,0x18df,0x18de,0x18dd,0x18db,0x18da,0x18d8,0x18d7,0x18d6,0x18d5,0x18d4,0x18d3,
4960   0x18d2,0x18d1,0x18cf,0x18ce,0x18cc,0x18cb,0x18ca,0x18c9,0x18c8,0x18c7,0x18c6,0x18c5,0x18c3,0x18c1,0x18c0,0x18bf,
4961   0x18be,0x18bd,0x18bc,0x18bb,0x18ba,0x18b9,0x18b6,0x18b5,0x18b4,0x18b3,0x18b2,0x18b1,0x18b0,0x18af,0x18ae,0x18ad,
4962   0x18ab,0x18a9,0x18a8,0x18a7,0x18a6,0x18a5,0x18a4,0x18a3,0x18a2,0x18a1,0x189f,0x189d,0x189c,0x189b,0x189a,0x1899,
4963   0x1898,0x1897,0x1896,0x1894,0x1893,0x1891,0x1890,0x188f,0x188e,0x188d,0x188c,0x188b,0x1889,0x1888,0x1887,0x1885,
4964   0x1884,0x1883,0x1882,0x1881,0x1880,0x187e,0x187d,0x187c,0x187b,0x1879,0x1878,0x1877,0x1876,0x1875,0x1874,0x1872,
4965   0x1871,0x1870,0x186f,0x186e,0x186c,0x186b,0x186a,0x1869,0x1867,0x1866,0x1865,0x1864,0x1863,0x1862,0x1860,0x185f,
4966   0x185e,0x185d,0x185c,0x185b,0x185a,0x1859,0x1856,0x1855,0x1854,0x1853,0x1852,0x1851,0x1850,0x184f,0x184e,0x184d,
4967   0x184b,0x1849,0x1848,0x1847,0x1846,0x1845,0x1844,0x1843,0x1842,0x1841,0x183f,0x183d,0x183c,0x183b,0x183a,0x1839,
4968   0x1838,0x1837,0x1836,0x1835,0x1833,0x1832,0x1830,0x182f,0x182e,0x182d,0x182c,0x182b,0x182a,0x1828,0x1827,0x1826,
4969   0x1825,0x1823,0x1822,0x1821,0x1820,0x181f,0x181e,0x181c,0x181b,0x181a,0x1819,0x1817,0x1816,0x1815,0x1814,0x1813,
4970   0x1812,0x1810,0x180f,0x180e,0x180d,0x180c,0x180a,0x1809,0x1808,0x1807,0x1805,0x1804,0x1803,0x1802,0x1801,0x1800,
4971   0x17ff,0x17fd,0x17fc,0x17fb,0x17f9,0x17f8,0x17f7,0x17f6,0x17f5,0x17f4,0x17f3,0x17f1,0x17f0,0x17ef,0x17ed,0x17ec,
4972   0x17eb,0x17ea,0x17e9,0x17e8,0x17e7,0x17e6,0x17e4,0x17e2,0x17e1,0x17e0,0x17df,0x17de,0x17dd,0x17dc,0x17db,0x17da,
4973   0x17d9,0x17d6,0x17d5,0x17d4,0x17d3,0x17d2,0x17d1,0x17d0,0x17cf,0x17ce,0x17cd,0x17ca,0x17c9,0x17c8,0x17c7,0x17c6,
4974   0x17c4,0x17c3,0x17c2,0x17c1,0x17c0,0x17bf,0x17be,0x17bd,0x17bb,0x17b9,0x17b8,0x17b7,0x17b6,0x17b5,0x17b4,0x17b3,
4975   0x17b2,0x17b1,0x17af,0x17ae,0x17ac,0x17ab,0x17aa,0x17a9,0x17a8,0x17a7,0x17a6,0x17a5,0x17a3,0x17a2,0x17a1,0x179f,
4976   0x179e,0x179d,0x179c,0x179b,0x179a,0x1799,0x1797,0x1796,0x1795,0x1794,0x1792,0x1791,0x1790,0x178f,0x178e,0x178d,
4977   0x178c,0x178a,0x1789,0x1788,0x1787,0x1785,0x1784,0x1783,0x1782,0x1781,0x1780,0x177e,0x177d,0x177c,0x177b,0x177a,
4978   0x1779,0x1777,0x1776,0x1775,0x1774,0x1772,0x1771,0x1770,0x176f,0x176e,0x176d,0x176c,0x176a,0x1769,0x1768,0x1766,
4979   0x1765,0x1764,0x1763,0x1762,0x1761,0x1760,0x175f,0x175d,0x175c,0x175a,0x1759,0x1758,0x1757,0x1756,0x1755,0x1754,
4980   0x1753,0x1752,0x1750,0x174e,0x174d,0x174c,0x174b,0x174a,0x1749,0x1748,0x1747,0x1746,0x1745,0x1742,0x1741,0x1740,
4981   0x173f,0x173e,0x173d,0x173c,0x173b,0x173a,0x1739,0x1738,0x1735,0x1734,0x1733,0x1732,0x1731,0x1730,0x172f,0x172e,
4982   0x172d,0x172c,0x172b,0x1728,0x1727,0x1726,0x1725,0x1724,0x1723,0x1722,0x1721,0x1720,0x171f,0x171d,0x171b,0x171a,
4983   0x1719,0x1718,0x1717,0x1716,0x1715,0x1714,0x1713,0x1711,0x1710,0x170f,0x170d,0x170c,0x170b,0x170a,0x1709,0x1708,
4984   0x1707,0x1705,0x1704,0x1703,0x1702,0x1700,0x16ff,0x16fe,0x16fd,0x16fc,0x16fb,0x16f9,0x16f8,0x16f7,0x16f6,0x16f5,
4985   0x16f3,0x16f2,0x16f1,0x16f0,0x16ef,0x16ed,0x16ec,0x16eb,0x16ea,0x16e9,0x16e8,0x16e6,0x16e5,0x16e4,0x16e3,0x16e1,
4986   0x16e0,0x16df,0x16de,0x16dd,0x16dc,0x16db,0x16d9,0x16d8,0x16d7,0x16d5,0x16d4,0x16d3,0x16d2,0x16d1,0x16d0,0x16cf,
4987   0x16ce,0x16cc,0x16cb,0x16ca,0x16c8,0x16c7,0x16c6,0x16c5,0x16c4,0x16c3,0x16c2,0x16c1,0x16bf,0x16be,0x16bc,0x16bb,
4988   0x16ba,0x16b9,0x16b8,0x16b7,0x16b6,0x16b5,0x16b4,0x16b2,0x16b0,0x16af,0x16ae,0x16ad,0x16ac,0x16ab,0x16aa,0x16a9,
4989   0x16a8,0x16a7,0x16a6,0x16a3,0x16a2,0x16a1,0x16a0,0x169f,0x169e,0x169d,0x169c,0x169b,0x169a,0x1698,0x1696,0x1695,
4990   0x1695,0x1693,0x1692,0x1690,0x168f,0x168e,0x168d,0x168c,0x168b,0x168a,0x1689,0x1688,0x1686,0x1684,0x1683,0x1682,
4991   0x1681,0x1680,0x167f,0x167e,0x167d,0x167c,0x167b,0x167a,0x1677,0x1676,0x1675,0x1674,0x1673,0x1672,0x1671,0x1670,
4992   0x166f,0x166e,0x166d,0x166a,0x1669,0x1668,0x1667,0x1666,0x1665,0x1664,0x1663,0x1662,0x1661,0x1660,0x165e,0x165c,
4993   0x165b,0x165a,0x1659,0x1658,0x1657,0x1656,0x1655,0x1654,0x1653,0x1651,0x1650,0x164e,0x164d,0x164c,0x164b,0x164a,
4994   0x1649,0x1648,0x1647,0x1646,0x1644,0x1643,0x1641,0x1640,0x163f,0x163e,0x163d,0x163c,0x163b,0x163a,0x1638,0x1637,
4995   0x1636,0x1635,0x1633,0x1632,0x1631,0x1630,0x162f,0x162e,0x162d,0x162b,0x162a,0x1629,0x1628,0x1627,0x1625,0x1624,
4996   0x1623,0x1622,0x1621,0x161f,0x161e,0x161d,0x161c,0x161b,0x161a,0x1618,0x1617,0x1616,0x1615,0x1614,0x1612,0x1611,
4997   0x1610,0x160f,0x160e,0x160d,0x160c,0x160a,0x1609,0x1608,0x1607,0x1605,0x1604,0x1603,0x1602,0x1601,0x1600,0x15ff,
4998   0x15fe,0x15fc,0x15fb,0x15f9,0x15f8,0x15f7,0x15f6,0x15f5,0x15f4,0x15f3,0x15f2,0x15f1,0x15ef,0x15ee,0x15ec,0x15eb,
4999   0x15ea,0x15e9,0x15e8,0x15e7,0x15e6,0x15e5,0x15e4,0x15e3,0x15e1,0x15df,0x15de,0x15dd,0x15dc,0x15db,0x15da,0x15d9,
5000   0x15d8,0x15d7,0x15d6,0x15d3,0x15d2,0x15d1,0x15d0,0x15cf,0x15ce,0x15cd,0x15cc,0x15cb,0x15ca,0x15c9,0x15c8,0x15c5,
5001   0x15c4,0x15c3,0x15c2,0x15c1,0x15c0,0x15bf,0x15be,0x15bd,0x15bc,0x15bb,0x15b9,0x15b7,0x15b6,0x15b5,0x15b4,0x15b3,
5002   0x15b2,0x15b1,0x15b0,0x15af,0x15ad,0x15ac,0x15aa,0x15a9,0x15a8,0x15a7,0x15a6,0x15a5,0x15a4,0x15a3,0x15a2,0x15a0,
5003   0x159f,0x159e,0x159c,0x159b,0x159a,0x1599,0x1598,0x1597,0x1596,0x1594,0x1593,0x1592,0x1591,0x1590,0x158e,0x158d,
5004   0x158c,0x158b,0x158a,0x1589,0x1587,0x1586,0x1585,0x1584,0x1583,0x1581,0x1580,0x157f,0x157e,0x157d,0x157c,0x157a,
5005   0x1579,0x1578,0x1577,0x1576,0x1575,0x1573,0x1572,0x1571,0x1570,0x156e,0x156d,0x156c,0x156b,0x156a,0x1569,0x1568,
5006   0x1567,0x1566,0x1565,0x1564,0x1561,0x1560,0x155f,0x155e,0x155d,0x155c,0x155b,0x155a,0x1559,0x1558,0x1557,0x1555,
5007   0x1553,0x1552,0x1551,0x1550,0x154f,0x154e,0x154d,0x154c,0x154b,0x154a,0x1548,0x1547,0x1545,0x1544,0x1543,0x1542,
5008   0x1541,0x1540,0x153f,0x153e,0x153d,0x153c,0x153a,0x1539,0x1537,0x1536,0x1535,0x1534,0x1533,0x1532,0x1531,0x1530,
5009   0x152f,0x152d,0x152c,0x152b,0x1529,0x1528,0x1527,0x1526,0x1525,0x1524,0x1523,0x1522,0x1520,0x151f,0x151e,0x151d,
5010   0x151c,0x151a,0x1519,0x1518,0x1517,0x1516,0x1515,0x1513,0x1512,0x1511,0x1510,0x150f,0x150e,0x150c,0x150b,0x150a,
5011   0x1509,0x1508,0x1506,0x1505,0x1504,0x1503,0x1502,0x1501,0x1500,0x14fe,0x14fd,0x14fc,0x14fb,0x14fa,0x14f8,0x14f7,
5012   0x14f6,0x14f5,0x14f4,0x14f3,0x14f2,0x14f0,0x14ef,0x14ee,0x14ed,0x14eb,0x14ea,0x14e9,0x14e8,0x14e7,0x14e6,0x14e5,
5013   0x14e4,0x14e2,0x14e1,0x14e0,0x14de,0x14dd,0x14dc,0x14db,0x14da,0x14d9,0x14d8,0x14d7,0x14d6,0x14d4,0x14d3,0x14d1,
5014   0x14d0,0x14cf,0x14ce,0x14cd,0x14cc,0x14cb,0x14ca,0x14c9,0x14c8,0x14c7,0x14c4,0x14c3,0x14c2,0x14c1,0x14c0,0x14bf,
5015   0x14be,0x14bd,0x14bc,0x14bb,0x14ba,0x14b9,0x14b6,0x14b5,0x14b4,0x14b3,0x14b2,0x14b1,0x14b0,0x14af,0x14ae,0x14ad,
5016   0x14ac,0x14ab,0x14a8,0x14a7,0x14a6,0x14a5,0x14a4,0x14a3,0x14a2,0x14a1,0x14a0,0x149f,0x149e,0x149c,0x149a,0x1499,
5017   0x1498,0x1497,0x1496,0x1495,0x1494,0x1493,0x1492,0x1491,0x148f,0x148e,0x148c,0x148b,0x148a,0x1489,0x1488,0x1487,
5018   0x1486,0x1485,0x1484,0x1482,0x1481,0x1480,0x147f,0x147d,0x147c,0x147b,0x147a,0x1479,0x1478,0x1477,0x1476,0x1474,
5019   0x1473,0x1472,0x1471,0x146f,0x146e,0x146d,0x146c,0x146b,0x146a,0x1469,0x1467,0x1466,0x1465,0x1464,0x1463,0x1461,
5020   0x1460,0x145f,0x145e,0x145d,0x145c,0x145a,0x1459,0x1458,0x1457,0x1456,0x1455,0x1453,0x1452,0x1451,0x1450,0x144f,
5021   0x144d,0x144c,0x144b,0x144a,0x1449,0x1448,0x1447,0x1445,0x1444,0x1443,0x1442,0x1440,0x143f,0x143e,0x143d,0x143c,
5022   0x143b,0x143a,0x1439,0x1438,0x1437,0x1436,0x1435,0x1433,0x1432,0x1431,0x142f,0x142e,0x142d,0x142c,0x142b,0x142a,
5023   0x1429,0x1428,0x1427,0x1426,0x1424,0x1423,0x1421,0x1420,0x141f,0x141e,0x141d,0x141c,0x141b,0x141a,0x1419,0x1418,
5024   0x1417,0x1414,0x1413,0x1412,0x1411,0x1410,0x140f,0x140e,0x140d,0x140c,0x140b,0x140a,0x1409,0x1406,0x1405,0x1404,
5025   0x1403,0x1402,0x1401,0x1400,0x13ff,0x13fe,0x13fd,0x13fc,0x13fb,0x13fa,0x13f7,0x13f6,0x13f5,0x13f4,0x13f3,0x13f2,
5026   0x13f1,0x13f0,0x13ef,0x13ee,0x13ed,0x13ec,0x13ea,0x13e8,0x13e7,0x13e6,0x13e5,0x13e4,0x13e3,0x13e2,0x13e1,0x13e0,
5027   0x13df,0x13de,0x13dc,0x13db,0x13d9,0x13d8,0x13d7,0x13d6,0x13d5,0x13d4,0x13d3,0x13d2,0x13d1,0x13cf,0x13ce,0x13cd,
5028   0x13cc,0x13ca,0x13c9,0x13c8,0x13c7,0x13c6,0x13c5,0x13c4,0x13c3,0x13c1,0x13c0,0x13bf,0x13be,0x13bc,0x13bb,0x13ba,
5029   0x13b9,0x13b8,0x13b7,0x13b6,0x13b5,0x13b3,0x13b2,0x13b1,0x13b0,0x13af,0x13ad,0x13ac,0x13ab,0x13aa,0x13a9,0x13a8,
5030   0x13a7,0x13a5,0x13a4,0x13a3,0x13a1,0x13a0,0x139f,0x139e,0x139d,0x139c,0x139b,0x139a,0x1399,0x1397,0x1396,0x1395,
5031   0x1394,0x1392,0x1391,0x1390,0x138f,0x138e,0x138d,0x138c,0x138b,0x138a,0x1388,0x1387,0x1386,0x1385,0x1384,0x1382,
5032   0x1381,0x1380,0x137f,0x137e,0x137d,0x137c,0x137a,0x1379,0x1378,0x1377,0x1376,0x1375,0x1373,0x1372,0x1371,0x1370,
5033   0x136f,0x136e,0x136c,0x136b,0x136a,0x1369,0x1368,0x1367,0x1366,0x1365,0x1363,0x1362,0x1361,0x1360,0x135f,0x135d,
5034   0x135c,0x135b,0x135a,0x1359,0x1358,0x1357,0x1356,0x1354,0x1353,0x1352,0x1351,0x134f,0x134e,0x134d,0x134c,0x134b,
5035   0x134a,0x1349,0x1348,0x1347,0x1346,0x1344,0x1343,0x1342,0x1340,0x133f,0x133e,0x133d,0x133c,0x133b,0x133a,0x1339,
5036   0x1338,0x1337,0x1335,0x1334,0x1332,0x1331,0x1330,0x132f,0x132e,0x132d,0x132c,0x132b,0x132a,0x1329,0x1328,0x1327,
5037   0x1325,0x1323,0x1322,0x1321,0x1320,0x131f,0x131e,0x131d,0x131c,0x131b,0x131a,0x1319,0x1318,0x1315,0x1314,0x1313,
5038   0x1312,0x1311,0x1310,0x130f,0x130e,0x130d,0x130c,0x130b,0x130a,0x1309,0x1308,0x1305,0x1304,0x1303,0x1302,0x1301,
5039   0x1300,0x12ff,0x12fe,0x12fd,0x12fc,0x12fb,0x12fa,0x12f8,0x12f6,0x12f5,0x12f4,0x12f3,0x12f2,0x12f1,0x12f0,0x12ef,
5040   0x12ee,0x12ed,0x12ec,0x12eb,0x12e9,0x12e8,0x12e6,0x12e5,0x12e4,0x12e3,0x12e2,0x12e1,0x12e0,0x12df,0x12de,0x12dd,
5041   0x12db,0x12da,0x12d9,0x12d7,0x12d6,0x12d5,0x12d4,0x12d3,0x12d2,0x12d1,0x12d0,0x12cf,0x12ce,0x12cc,0x12cb,0x12ca,
5042   0x12c9,0x12c7,0x12c6,0x12c5,0x12c4,0x12c3,0x12c2,0x12c1,0x12c0,0x12be,0x12bd,0x12bc,0x12bb,0x12ba,0x12b8,0x12b7,
5043   0x12b6,0x12b5,0x12b4,0x12b3,0x12b2,0x12b1,0x12af,0x12ae,0x12ad,0x12ac,0x12ab,0x12a9,0x12a8,0x12a7,0x12a6,0x12a5,
5044   0x12a4,0x12a3,0x12a1,0x12a0,0x129f,0x129e,0x129d,0x129c,0x129b,0x1299,0x1298,0x1297,0x1296,0x1295,0x1294,0x1292,
5045   0x1291,0x1290,0x128f,0x128e,0x128d,0x128c,0x128a,0x1289,0x1288,0x1287,0x1286,0x1284,0x1283,0x1282,0x1281,0x1280,
5046   0x127f,0x127d,0x127c,0x127b,0x127a,0x1279,0x1278,0x1277,0x1276,0x1275,0x1274,0x1273,0x1271,0x1270,0x126f,0x126d,
5047   0x126c,0x126b,0x126a,0x1269,0x1268,0x1267,0x1266,0x1265,0x1264,0x1262,0x1261,0x1260,0x125f,0x125d,0x125c,0x125b,
5048   0x125a,0x1259,0x1258,0x1257,0x1256,0x1255,0x1253,0x1252,0x1251,0x1250,0x124f,0x124d,0x124c,0x124b,0x124a,0x1249,
5049   0x1248,0x1247,0x1246,0x1245,0x1243,0x1242,0x1241,0x1240,0x123f,0x123d,0x123c,0x123b,0x123a,0x1239,0x1238,0x1237,
5050   0x1236,0x1234,0x1233,0x1232,0x1231,0x1230,0x122f,0x122e,0x122c,0x122b,0x122a,0x1229,0x1228,0x1227,0x1225,0x1224,
5051   0x1223,0x1222,0x1221,0x1220,0x121f,0x121e,0x121c,0x121b,0x121a,0x1219,0x1218,0x1216,0x1215,0x1214,0x1213,0x1212,
5052   0x1211,0x1210,0x120f,0x120e,0x120c,0x120b,0x120a,0x1209,0x1207,0x1206,0x1205,0x1204,0x1203,0x1202,0x1201,0x1200,
5053   0x11ff,0x11fe,0x11fc,0x11fb,0x11fa,0x11f9,0x11f7,0x11f6,0x11f5,0x11f4,0x11f3,0x11f2,0x11f1,0x11f0,0x11ef,0x11ee,
5054   0x11ed,0x11eb,0x11ea,0x11e8,0x11e7,0x11e6,0x11e5,0x11e4,0x11e3,0x11e2,0x11e1,0x11e0,0x11df,0x11de,0x11dd,0x11db,
5055   0x11d9,0x11d8,0x11d7,0x11d6,0x11d5,0x11d4,0x11d3,0x11d2,0x11d1,0x11d0,0x11cf,0x11ce,0x11cd,0x11ca,0x11c9,0x11c8,
5056   0x11c7,0x11c6,0x11c5,0x11c4,0x11c3,0x11c2,0x11c1,0x11c0,0x11bf,0x11be,0x11bd,0x11ba,0x11b9,0x11b8,0x11b7,0x11b6,
5057   0x11b5,0x11b4,0x11b3,0x11b2,0x11b1,0x11b0,0x11af,0x11ae,0x11ad,0x11aa,0x11a9,0x11a8,0x11a7,0x11a6,0x11a5,0x11a4,
5058   0x11a3,0x11a2,0x11a1,0x11a0,0x119f,0x119e,0x119c,0x119b,0x1199,0x1198,0x1197,0x1196,0x1195,0x1194,0x1193,0x1192,
5059   0x1191,0x1190,0x118f,0x118d,0x118c,0x118b,0x1189,0x1188,0x1187,0x1186,0x1185,0x1184,0x1183,0x1182,0x1181,0x1180,
5060   0x117e,0x117d,0x117c,0x117b,0x1179,0x1178,0x1177,0x1176,0x1175,0x1174,0x1173,0x1172,0x1171,0x1170,0x116e,0x116d,
5061   0x116c,0x116b,0x1169,0x1168,0x1167,0x1166,0x1165,0x1164,0x1163,0x1162,0x1161,0x115f,0x115e,0x115d,0x115c,0x115b,
5062   0x115a,0x1159,0x1157,0x1156,0x1155,0x1154,0x1153,0x1152,0x1151,0x1150,0x114f,0x114e,0x114c,0x114b,0x114a,0x1149,
5063   0x1147,0x1146,0x1145,0x1144,0x1143,0x1142,0x1141,0x1140,0x113f,0x113e,0x113d,0x113b,0x113a,0x1139,0x1137,0x1136,
5064   0x1135,0x1134,0x1133,0x1132,0x1131,0x1130,0x112f,0x112e,0x112d,0x112c,0x112a,0x1129,0x1127,0x1126,0x1125,0x1124,
5065   0x1123,0x1122,0x1121,0x1120,0x111f,0x111e,0x111d,0x111c,0x111b,0x1119,0x1117,0x1116,0x1115,0x1114,0x1113,0x1112,
5066   0x1111,0x1110,0x110f,0x110e,0x110d,0x110c,0x110b,0x110a,0x1107,0x1106,0x1105,0x1104,0x1103,0x1102,0x1101,0x1100,
5067   0x10ff,0x10fe,0x10fd,0x10fc,0x10fb,0x10fa,0x10f9,0x10f6,0x10f5,0x10f4,0x10f3,0x10f2,0x10f1,0x10f0,0x10ef,0x10ee,
5068   0x10ed,0x10ec,0x10eb,0x10ea,0x10e9,0x10e7,0x10e5,0x10e4,0x10e3,0x10e2,0x10e1,0x10e0,0x10df,0x10de,0x10dd,0x10dc,
5069   0x10db,0x10da,0x10d9,0x10d7,0x10d6,0x10d4,0x10d3,0x10d2,0x10d1,0x10d0,0x10cf,0x10ce,0x10cd,0x10cc,0x10cb,0x10ca,
5070   0x10c8,0x10c7,0x10c6,0x10c5,0x10c4,0x10c2,0x10c1,0x10c0,0x10bf,0x10bd,0x10bc,0x10bb,0x10ba,0x10b9,0x10b8,0x10b7,
5071   0x10b6,0x10b5,0x10b4,0x10b3,0x10b1,0x10b0,0x10af,0x10ae,0x10ad,0x10ab,0x10aa,0x10a9,0x10a8,0x10a7,0x10a6,0x10a5,
5072   0x10a4,0x10a3,0x10a2,0x10a0,0x109f,0x109e,0x109d,0x109c,0x109b,0x1099,0x1098,0x1097,0x1096,0x1095,0x1094,0x1093,
5073   0x1092,0x1091,0x108f,0x108e,0x108d,0x108c,0x108b,0x108a,0x1089,0x1087,0x1086,0x1085,0x1084,0x1083,0x1082,0x1081,
5074   0x1080,0x107e,0x107d,0x107c,0x107b,0x107a,0x1079,0x1078,0x1077,0x1075,0x1074,0x1073,0x1072,0x1071,0x1070,0x106f,
5075   0x106d,0x106c,0x106b,0x106a,0x1069,0x1068,0x1067,0x1066,0x1065,0x1063,0x1062,0x1061,0x1060,0x105f,0x105e,0x105c,
5076   0x105b,0x105a,0x1059,0x1058,0x1057,0x1056,0x1055,0x1054,0x1053,0x1051,0x1050,0x104f,0x104e,0x104d,0x104b,0x104a,
5077   0x1049,0x1048,0x1047,0x1046,0x1045,0x1044,0x1043,0x1042,0x1041,0x103f,0x103e,0x103d,0x103c,0x103a,0x1039,0x1038,
5078   0x1037,0x1036,0x1035,0x1034,0x1033,0x1032,0x1031,0x1030,0x102f,0x102d,0x102c,0x102b,0x1029,0x1028,0x1027,0x1026,
5079   0x1025,0x1024,0x1023,0x1022,0x1021,0x1020,0x101f,0x101e,0x101d,0x101b,0x101a,0x1018,0x1017,0x1016,0x1015,0x1014,
5080   0x1013,0x1012,0x1011,0x1010,0x100f,0x100e,0x100d,0x100c,0x100b,0x1009,0x1007,0x1006,0x1005,0x1004,0x1003,0x1002,
5081   0x1001,0x1000,0xfff,0xffe,0xffd,0xffc,0xffb,0xffa,0xff9,0xff6,0xff5,0xff4,0xff3,0xff2,0xff1,0xff0,
5082   0xfef,0xfee,0xfed,0xfec,0xfeb,0xfea,0xfe9,0xfe8,0xfe7,0xfe4,0xfe3,0xfe2,0xfe1,0xfe0,0xfdf,0xfde,
5083   0xfdd,0xfdc,0xfdb,0xfda,0xfd9,0xfd8,0xfd7,0xfd6,0xfd4,0xfd2,0xfd1,0xfd0,0xfcf,0xfce,0xfcd,0xfcc,
5084   0xfcb,0xfca,0xfc9,0xfc8,0xfc7,0xfc6,0xfc5,0xfc3,0xfc2,0xfc0,0xfbf,0xfbe,0xfbd,0xfbc,0xfbb,0xfba,
5085   0xfb9,0xfb8,0xfb7,0xfb6,0xfb5,0xfb4,0xfb2,0xfb1,0xfb0,0xfae,0xfad,0xfac,0xfab,0xfaa,0xfa9,0xfa8,
5086   0xfa6,0xfa5,0xfa4,0xfa3,0xfa2,0xfa1,0xfa0,0xf9f,0xf9e,0xf9d,0xf9c,0xf9b,0xf99,0xf97,0xf96,0xf95,
5087   0xf94,0xf93,0xf92,0xf91,0xf90,0xf8f,0xf8e,0xf8d,0xf8c,0xf8b,0xf8a,0xf89,0xf88,0xf86,0xf84,0xf83,
5088   0xf82,0xf81,0xf80,0xf7f,0xf7e,0xf7d,0xf7c,0xf7b,0xf7a,0xf79,0xf78,0xf77,0xf76,0xf74,0xf73,0xf71,
5089   0xf70,0xf6f,0xf6e,0xf6d,0xf6c,0xf6b,0xf6a,0xf69,0xf68,0xf67,0xf66,0xf65,0xf64,0xf62,0xf61,0xf60,
5090   0xf5f,0xf5d,0xf5c,0xf5b,0xf5a,0xf59,0xf58,0xf57,0xf56,0xf55,0xf54,0xf53,0xf52,0xf50,0xf4f,0xf4e,
5091   0xf4d,0xf4c,0xf4a,0xf49,0xf48,0xf47,0xf46,0xf45,0xf44,0xf43,0xf42,0xf41,0xf40,0xf3e,0xf3d,0xf3c,
5092   0xf3b,0xf3a,0xf39,0xf37,0xf36,0xf35,0xf34,0xf33,0xf32,0xf31,0xf30,0xf2f,0xf2e,0xf2c,0xf2b,0xf2a,
5093   0xf29,0xf28,0xf27,0xf26,0xf24,0xf23,0xf22,0xf21,0xf20,0xf1f,0xf1e,0xf1d,0xf1c,0xf1a,0xf19,0xf18,
5094   0xf17,0xf16,0xf15,0xf14,0xf13,0xf11,0xf10,0xf0f,0xf0e,0xf0d,0xf0c,0xf0b,0xf0a,0xf08,0xf07,0xf06,
5095   0xf05,0xf04,0xf03,0xf02,0xf01,0xf00,0xefe,0xefd,0xefc,0xefb,0xefa,0xef9,0xef8,0xef6,0xef5,0xef4,
5096   0xef3,0xef2,0xef1,0xef0,0xeef,0xeee,0xeed,0xeeb,0xeea,0xee9,0xee8,0xee7,0xee6,0xee4,0xee3,0xee2,
5097   0xee1,0xee0,0xedf,0xede,0xedd,0xedc,0xedb,0xeda,0xed8,0xed7,0xed6,0xed5,0xed4,0xed2,0xed1,0xed0,
5098   0xecf,0xece,0xecd,0xecc,0xecb,0xeca,0xec9,0xec8,0xec7,0xec5,0xec4,0xec3,0xec2,0xec0,0xebf,0xebe,
5099   0xebd,0xebc,0xebb,0xeba,0xeb9,0xeb8,0xeb7,0xeb6,0xeb5,0xeb4,0xeb2,0xeb1,0xeb0,0xeae,0xead,0xeac,
5100   0xeab,0xeaa,0xea9,0xea8,0xea7,0xea6,0xea5,0xea4,0xea3,0xea2,0xea1,0xe9f,0xe9e,0xe9c,0xe9b,0xe9a,
5101   0xe99,0xe98,0xe97,0xe96,0xe95,0xe94,0xe93,0xe92,0xe91,0xe90,0xe8f,0xe8e,0xe8c,0xe8a,0xe89,0xe88,
5102   0xe88,0xe86,0xe85,0xe84,0xe83,0xe82,0xe81,0xe80,0xe7f,0xe7e,0xe7c,0xe7b,0xe7a,0xe79,0xe78,0xe77,
5103   0xe76,0xe75,0xe74,0xe72,0xe71,0xe70,0xe6f,0xe6e,0xe6d,0xe6c,0xe6b,0xe69,0xe68,0xe67,0xe66,0xe65,
5104   0xe64,0xe63,0xe62,0xe61,0xe60,0xe5e,0xe5d,0xe5c,0xe5b,0xe5a,0xe59,0xe58,0xe56,0xe55,0xe54,0xe53,
5105   0xe52,0xe51,0xe50,0xe4f,0xe4e,0xe4d,0xe4c,0xe4a,0xe49,0xe48,0xe47,0xe46,0xe45,0xe44,0xe42,0xe41,
5106   0xe40,0xe3f,0xe3e,0xe3d,0xe3c,0xe3b,0xe3a,0xe39,0xe38,0xe37,0xe35,0xe34,0xe33,0xe32,0xe31,0xe2f,
5107   0xe2e,0xe2d,0xe2c,0xe2b,0xe2a,0xe29,0xe28,0xe27,0xe26,0xe25,0xe24,0xe23,0xe21,0xe20,0xe1f,0xe1e,
5108   0xe1c,0xe1b,0xe1a,0xe19,0xe18,0xe17,0xe16,0xe15,0xe14,0xe13,0xe12,0xe11,0xe10,0xe0f,0xe0d,0xe0c,
5109   0xe0b,0xe09,0xe08,0xe07,0xe06,0xe05,0xe04,0xe03,0xe02,0xe01,0xe00,0xdff,0xdfe,0xdfd,0xdfc,0xdfb,
5110   0xdfa,0xdf8,0xdf7,0xdf5,0xdf4,0xdf3,0xdf2,0xdf1,0xdf0,0xdef,0xdee,0xded,0xdec,0xdeb,0xdea,0xde9,
5111   0xde8,0xde7,0xde6,0xde4,0xde2,0xde1,0xde0,0xddf,0xdde,0xddd,0xddc,0xddb,0xdda,0xdd9,0xdd8,0xdd7,
5112   0xdd6,0xdd5,0xdd4,0xdd3,0xdd2,0xdcf,0xdce,0xdcd,0xdcc,0xdcb,0xdca,0xdc9,0xdc8,0xdc7,0xdc6,0xdc5,
5113   0xdc4,0xdc3,0xdc2,0xdc1,0xdc0,0xdbf,0xdbe,0xdbb,0xdba,0xdb9,0xdb8,0xdb7,0xdb6,0xdb5,0xdb4,0xdb3,
5114   0xdb2,0xdb1,0xdb0,0xdaf,0xdae,0xdad,0xdac,0xdab,0xdaa,0xda8,0xda6,0xda5,0xda4,0xda3,0xda2,0xda1,
5115   0xda0,0xd9f,0xd9e,0xd9d,0xd9c,0xd9b,0xd9a,0xd99,0xd98,0xd97,0xd95,0xd94,0xd92,0xd91,0xd90,0xd8f,
5116   0xd8e,0xd8d,0xd8c,0xd8b,0xd8a,0xd89,0xd88,0xd87,0xd86,0xd85,0xd84,0xd82,0xd81,0xd80,0xd7e,0xd7d,
5117   0xd7c,0xd7b,0xd7a,0xd79,0xd78,0xd77,0xd76,0xd75,0xd74,0xd73,0xd72,0xd71,0xd70,0xd6e,0xd6d,0xd6c,
5118   0xd6b,0xd6a,0xd69,0xd68,0xd67,0xd65,0xd64,0xd63,0xd62,0xd61,0xd60,0xd5f,0xd5e,0xd5c,0xd5b,0xd5a,
5119   0xd59,0xd58,0xd57,0xd56,0xd55,0xd54,0xd53,0xd52,0xd51,0xd4f,0xd4e,0xd4d,0xd4c,0xd4b,0xd4a,0xd49,
5120   0xd47,0xd46,0xd45,0xd44,0xd43,0xd42,0xd41,0xd40,0xd3f,0xd3e,0xd3d,0xd3c,0xd3b,0xd39,0xd38,0xd37,
5121   0xd36,0xd35,0xd33,0xd32,0xd31,0xd30,0xd2f,0xd2e,0xd2d,0xd2c,0xd2b,0xd2a,0xd29,0xd28,0xd27,0xd26,
5122   0xd25,0xd23,0xd22,0xd21,0xd20,0xd1e,0xd1d,0xd1c,0xd1b,0xd1a,0xd19,0xd18,0xd17,0xd16,0xd15,0xd14,
5123   0xd13,0xd12,0xd11,0xd10,0xd0e,0xd0d,0xd0c,0xd0b,0xd09,0xd08,0xd07,0xd06,0xd05,0xd04,0xd03,0xd02,
5124   0xd01,0xd00,0xcff,0xcfe,0xcfd,0xcfc,0xcfb,0xcfa,0xcf8,0xcf7,0xcf5,0xcf4,0xcf3,0xcf2,0xcf1,0xcf0,
5125   0xcef,0xcee,0xced,0xcec,0xceb,0xcea,0xce9,0xce8,0xce7,0xce6,0xce5,0xce4,0xce2,0xce0,0xcdf,0xcde,
5126   0xcdd,0xcdc,0xcdb,0xcda,0xcd9,0xcd8,0xcd7,0xcd6,0xcd5,0xcd4,0xcd3,0xcd2,0xcd1,0xcd0,0xccf,0xccd,
5127   0xccb,0xcca,0xcc9,0xcc8,0xcc7,0xcc6,0xcc5,0xcc4,0xcc3,0xcc2,0xcc1,0xcc0,0xcbf,0xcbe,0xcbd,0xcbc,
5128   0xcbb,0xcba,0xcb9,0xcb6,0xcb5,0xcb4,0xcb3,0xcb2,0xcb1,0xcb0,0xcaf,0xcae,0xcad,0xcac,0xcab,0xcaa,
5129   0xca9,0xca8,0xca7,0xca6,0xca5,0xca4,0xca2,0xca0,0xc9f,0xc9e,0xc9d,0xc9c,0xc9b,0xc9a,0xc99,0xc98,
5130   0xc97,0xc96,0xc95,0xc94,0xc93,0xc92,0xc91,0xc90,0xc8f,0xc8d,0xc8b,0xc8a,0xc89,0xc88,0xc87,0xc86,
5131   0xc85,0xc84,0xc83,0xc82,0xc81,0xc80,0xc7f,0xc7e,0xc7d,0xc7c,0xc7b,0xc7a,0xc78,0xc77,0xc75,0xc74,
5132   0xc73,0xc72,0xc71,0xc70,0xc6f,0xc6e,0xc6d,0xc6c,0xc6b,0xc6a,0xc69,0xc68,0xc67,0xc66,0xc64,0xc63,
5133   0xc62,0xc61,0xc5f,0xc5e,0xc5d,0xc5c,0xc5b,0xc5a,0xc59,0xc58,0xc57,0xc56,0xc55,0xc54,0xc53,0xc52,
5134   0xc51,0xc50,0xc4f,0xc4d,0xc4c,0xc4b,0xc4a,0xc49,0xc48,0xc47,0xc46,0xc44,0xc43,0xc42,0xc41,0xc40,
5135   0xc3f,0xc3e,0xc3d,0xc3c,0xc3b,0xc3a,0xc39,0xc37,0xc36,0xc35,0xc34,0xc33,0xc32,0xc31,0xc30,0xc2f,
5136   0xc2e,0xc2c,0xc2b,0xc2a,0xc29,0xc28,0xc27,0xc26,0xc25,0xc24,0xc23,0xc22,0xc20,0xc1f,0xc1e,0xc1d,
5137   0xc1c,0xc1b,0xc1a,0xc19,0xc18,0xc17,0xc15,0xc14,0xc13,0xc12,0xc11,0xc10,0xc0f,0xc0e,0xc0d,0xc0c,
5138   0xc0a,0xc09,0xc08,0xc07,0xc06,0xc05,0xc04,0xc03,0xc02,0xc01,0xc00,0xbfe,0xbfd,0xbfc,0xbfb,0xbfa,
5139   0xbf9,0xbf8,0xbf7,0xbf6,0xbf4,0xbf3,0xbf2,0xbf1,0xbf0,0xbef,0xbee,0xbed,0xbec,0xbeb,0xbea,0xbe9,
5140   0xbe8,0xbe6,0xbe5,0xbe4,0xbe3,0xbe2,0xbe1,0xbe0,0xbdf,0xbdd,0xbdc,0xbdb,0xbda,0xbd9,0xbd8,0xbd7,
5141   0xbd6,0xbd5,0xbd4,0xbd3,0xbd2,0xbd1,0xbcf,0xbce,0xbcd,0xbcc,0xbcb,0xbca,0xbc9,0xbc7,0xbc6,0xbc5,
5142   0xbc4,0xbc3,0xbc2,0xbc1,0xbc0,0xbbf,0xbbd,0xbbc,0xbbb,0xbba,0xbb9,0xbb8,0xbb7,0xbb5,0xbb4,0xbb3,
5143   0xbb2,0xbb1,0xbb0,0xbaf,0xbae,0xbad,0xbac,0xbab,0xbaa,0xba9,0xba8,0xba7,0xba6,0xba5,0xba3,0xba2,
5144   0xba1,0xba0,0xb9f,0xb9d,0xb9c,0xb9b,0xb9a,0xb99,0xb98,0xb97,0xb96,0xb95,0xb94,0xb93,0xb92,0xb91,
5145   0xb90,0xb8f,0xb8e,0xb8d,0xb8c,0xb8a,0xb89,0xb88,0xb87,0xb86,0xb84,0xb83,0xb82,0xb81,0xb80,0xb7f,
5146   0xb7e,0xb7d,0xb7c,0xb7b,0xb7a,0xb79,0xb78,0xb77,0xb76,0xb75,0xb74,0xb73,0xb71,0xb70,0xb6f,0xb6e,
5147   0xb6c,0xb6b,0xb6a,0xb69,0xb68,0xb67,0xb66,0xb65,0xb64,0xb63,0xb62,0xb61,0xb60,0xb5f,0xb5e,0xb5d,
5148   0xb5c,0xb5b,0xb5a,0xb58,0xb57,0xb56,0xb54,0xb53,0xb52,0xb51,0xb50,0xb4f,0xb4e,0xb4d,0xb4c,0xb4b,
5149   0xb4a,0xb49,0xb48,0xb47,0xb46,0xb45,0xb44,0xb43,0xb42,0xb41,0xb40,0xb3e,0xb3c,0xb3b,0xb3a,0xb39,
5150   0xb38,0xb37,0xb36,0xb35,0xb34,0xb33,0xb32,0xb31,0xb30,0xb2f,0xb2e,0xb2d,0xb2c,0xb2b,0xb2a,0xb29,
5151   0xb28,0xb27,0xb25,0xb23,0xb22,0xb21,0xb20,0xb1f,0xb1e,0xb1d,0xb1c,0xb1b,0xb1a,0xb19,0xb18,0xb17,
5152   0xb16,0xb15,0xb14,0xb13,0xb12,0xb11,0xb10,0xb0f,0xb0e,0xb0b,0xb0a,0xb09,0xb08,0xb07,0xb06,0xb05,
5153   0xb04,0xb03,0xb02,0xb01,0xb00,0xaff,0xafe,0xafd,0xafc,0xafb,0xafa,0xaf9,0xaf8,0xaf7,0xaf6,0xaf5,
5154   0xaf3,0xaf1,0xaf0,0xaef,0xaee,0xaed,0xaec,0xaeb,0xaea,0xae9,0xae8,0xae7,0xae6,0xae5,0xae4,0xae3,
5155   0xae2,0xae1,0xae0,0xadf,0xade,0xadd,0xadb,0xada,0xad8,0xad7,0xad6,0xad5,0xad4,0xad3,0xad2,0xad1,
5156   0xad0,0xacf,0xace,0xacd,0xacc,0xacb,0xaca,0xac9,0xac8,0xac7,0xac6,0xac5,0xac4,0xac2,0xac1,0xabf,
5157   0xabe,0xabd,0xabc,0xabb,0xaba,0xab9,0xab8,0xab7,0xab6,0xab5,0xab4,0xab3,0xab2,0xab1,0xab0,0xaaf,
5158   0xaae,0xaab,0xaaa,0xaa9,0xaa8,0xaa7,0xaa6,0xaa5,0xaa4,0xaa3,0xaa2,0xaa1,0xaa0,0xa9f,0xa9e,0xa9d,
5159   0xa9c,0xa9b,0xa9a,0xa99,0xa98,0xa97,0xa96,0xa95,0xa94,0xa93,0xa90,0xa8f,0xa8e,0xa8d,0xa8c,0xa8b,
5160   0xa8a,0xa89,0xa88,0xa87,0xa86,0xa85,0xa84,0xa83,0xa82,0xa81,0xa80,0xa7f,0xa7e,0xa7d,0xa7c,0xa7b,
5161   0xa7a,0xa79,0xa77,0xa76,0xa74,0xa73,0xa72,0xa71,0xa70,0xa6f,0xa6e,0xa6d,0xa6c,0xa6b,0xa6a,0xa69,
5162   0xa68,0xa67,0xa66,0xa65,0xa64,0xa63,0xa62,0xa61,0xa60,0xa5f,0xa5e,0xa5c,0xa5b,0xa59,0xa58,0xa57,
5163   0xa56,0xa55,0xa54,0xa53,0xa52,0xa51,0xa50,0xa4f,0xa4e,0xa4d,0xa4c,0xa4b,0xa4a,0xa49,0xa48,0xa47,
5164   0xa46,0xa45,0xa44,0xa43,0xa41,0xa40,0xa3f,0xa3d,0xa3c,0xa3b,0xa3a,0xa39,0xa38,0xa37,0xa36,0xa35,
5165   0xa34,0xa33,0xa32,0xa31,0xa30,0xa2f,0xa2e,0xa2d,0xa2c,0xa2b,0xa2a,0xa29,0xa27,0xa26,0xa25,0xa24,
5166   0xa23,0xa21,0xa20,0xa1f,0xa1e,0xa1d,0xa1c,0xa1b,0xa1a,0xa19,0xa18,0xa17,0xa16,0xa15,0xa14,0xa13,
5167   0xa12,0xa11,0xa10,0xa0f,0xa0e,0xa0c,0xa0b,0xa0a,0xa09,0xa08,0xa06,0xa05,0xa04,0xa03,0xa02,0xa01,
5168   0xa00,0x9ff,0x9fe,0x9fd,0x9fc,0x9fb,0x9fa,0x9f9,0x9f8,0x9f7,0x9f6,0x9f5,0x9f4,0x9f2,0x9f1,0x9f0,
5169   0x9ef,0x9ee,0x9ed,0x9ec,0x9ea,0x9e9,0x9e8,0x9e7,0x9e6,0x9e5,0x9e4,0x9e3,0x9e2,0x9e1,0x9e0,0x9df,
5170   0x9de,0x9dd,0x9dc,0x9db,0x9da,0x9d9,0x9d7,0x9d6,0x9d5,0x9d4,0x9d3,0x9d2,0x9d1,0x9cf,0x9ce,0x9cd,
5171   0x9cc,0x9cb,0x9ca,0x9c9,0x9c8,0x9c7,0x9c6,0x9c5,0x9c4,0x9c3,0x9c2,0x9c1,0x9c0,0x9bf,0x9be,0x9bc,
5172   0x9bb,0x9ba,0x9b9,0x9b8,0x9b7,0x9b6,0x9b5,0x9b3,0x9b2,0x9b1,0x9b0,0x9af,0x9ae,0x9ad,0x9ac,0x9ab,
5173   0x9aa,0x9a9,0x9a8,0x9a7,0x9a6,0x9a5,0x9a4,0x9a2,0x9a1,0x9a0,0x99f,0x99e,0x99d,0x99c,0x99b,0x99a,
5174   0x998,0x997,0x996,0x995,0x994,0x993,0x992,0x991,0x990,0x98f,0x98e,0x98d,0x98c,0x98b,0x98a,0x989,
5175   0x988,0x987,0x986,0x985,0x983,0x982,0x980,0x97f,0x97e,0x97d,0x97c,0x97b,0x97a,0x979,0x978,0x977,
5176   0x976,0x975,0x974,0x973,0x972,0x971,0x970,0x96f,0x96e,0x96d,0x96c,0x96b,0x96a,0x969,0x968,0x966,
5177   0x965,0x964,0x962,0x961,0x960,0x95f,0x95e,0x95d,0x95c,0x95b,0x95a,0x959,0x958,0x957,0x956,0x955,
5178   0x954,0x953,0x952,0x951,0x950,0x94f,0x94e,0x94d,0x94c,0x94b,0x949,0x948,0x947,0x946,0x945,0x943,
5179   0x942,0x941,0x940,0x93f,0x93e,0x93d,0x93c,0x93b,0x93a,0x939,0x938,0x937,0x936,0x935,0x934,0x933,
5180   0x932,0x931,0x930,0x92f,0x92e,0x92d,0x92b,0x92a,0x929,0x928,0x927,0x925,0x924,0x923,0x922,0x921,
5181   0x920,0x91f,0x91e,0x91d,0x91c,0x91b,0x91a,0x919,0x918,0x917,0x916,0x915,0x914,0x913,0x912,0x911,
5182   0x910,0x90e,0x90d,0x90c,0x90b,0x90a,0x909,0x908,0x906,0x905,0x904,0x903,0x902,0x901,0x900,0x8ff,
5183   0x8fe,0x8fd,0x8fc,0x8fb,0x8fa,0x8f9,0x8f8,0x8f7,0x8f6,0x8f5,0x8f4,0x8f3,0x8f2,0x8f0,0x8ef,0x8ee,
5184   0x8ed,0x8ec,0x8eb,0x8ea,0x8e8,0x8e7,0x8e6,0x8e5,0x8e4,0x8e3,0x8e2,0x8e1,0x8e0,0x8df,0x8de,0x8dd,
5185   0x8dc,0x8db,0x8da,0x8d9,0x8d8,0x8d7,0x8d6,0x8d5,0x8d3,0x8d2,0x8d1,0x8d0,0x8cf,0x8ce,0x8cd,0x8cc,
5186   0x8cb,0x8c9,0x8c8,0x8c7,0x8c6,0x8c5,0x8c4,0x8c3,0x8c2,0x8c1,0x8c0,0x8bf,0x8be,0x8bd,0x8bc,0x8bb,
5187   0x8ba,0x8b9,0x8b8,0x8b7,0x8b5,0x8b4,0x8b3,0x8b2,0x8b1,0x8b0,0x8af,0x8ae,0x8ad,0x8ab,0x8aa,0x8a9,
5188   0x8a8,0x8a7,0x8a6,0x8a5,0x8a4,0x8a3,0x8a2,0x8a1,0x8a0,0x89f,0x89e,0x89d,0x89c,0x89b,0x89a,0x898,
5189   0x897,0x896,0x895,0x894,0x893,0x892,0x891,0x890,0x88f,0x88d,0x88c,0x88b,0x88a,0x889,0x888,0x887,
5190   0x886,0x885,0x884,0x883,0x882,0x881,0x880,0x87f,0x87e,0x87d,0x87c,0x87b,0x87a,0x879,0x878,0x877,
5191   0x876,0x874,0x872,0x871,0x870,0x86f,0x86e,0x86d,0x86c,0x86b,0x86a,0x869,0x868,0x867,0x866,0x865,
5192   0x864,0x863,0x862,0x861,0x860,0x85f,0x85e,0x85d,0x85c,0x85b,0x85a,0x859,0x858,0x857,0x856,0x855,
5193   0x854,0x851,0x850,0x84f,0x84e,0x84d,0x84c,0x84b,0x84a,0x849,0x848,0x847,0x846,0x845,0x844,0x843,
5194   0x842,0x841,0x840,0x83f,0x83e,0x83d,0x83c,0x83b,0x83a,0x839,0x838,0x837,0x836,0x835,0x834,0x833,
5195   0x832,0x82f,0x82e,0x82d,0x82c,0x82b,0x82a,0x829,0x828,0x827,0x826,0x825,0x824,0x823,0x822,0x821,
5196   0x820,0x81f,0x81e,0x81d,0x81c,0x81b,0x81a,0x819,0x818,0x817,0x816,0x815,0x814,0x813,0x812,0x811,
5197   0x80f,0x80d,0x80c,0x80b,0x80a,0x809,0x808,0x807,0x806,0x805,0x804,0x803,0x802,0x801,0x800,0x7ff,
5198   0x7fe,0x7fd,0x7fc,0x7fb,0x7fa,0x7f9,0x7f8,0x7f7,0x7f6,0x7f5,0x7f4,0x7f3,0x7f2,0x7f1,0x7f0,0x7ee,
5199   0x7ed,0x7eb,0x7ea,0x7e9,0x7e8,0x7e7,0x7e6,0x7e5,0x7e4,0x7e3,0x7e2,0x7e1,0x7e0,0x7df,0x7de,0x7dd,
5200   0x7dc,0x7db,0x7da,0x7d9,0x7d8,0x7d7,0x7d6,0x7d5,0x7d4,0x7d3,0x7d2,0x7d1,0x7d0,0x7cf,0x7cd,0x7cc,
5201   0x7cb,0x7c9,0x7c8,0x7c7,0x7c6,0x7c5,0x7c4,0x7c3,0x7c2,0x7c1,0x7c0,0x7bf,0x7be,0x7bd,0x7bc,0x7bb,
5202   0x7ba,0x7b9,0x7b8,0x7b7,0x7b6,0x7b5,0x7b4,0x7b3,0x7b2,0x7b1,0x7b0,0x7af,0x7ae,0x7ac,0x7ab,0x7aa,
5203   0x7a9,0x7a7,0x7a6,0x7a5,0x7a4,0x7a3,0x7a2,0x7a1,0x7a0,0x79f,0x79e,0x79d,0x79c,0x79b,0x79a,0x799,
5204   0x798,0x797,0x796,0x795,0x794,0x793,0x792,0x791,0x790,0x78f,0x78e,0x78d,0x78b,0x78a,0x789,0x788,
5205   0x787,0x785,0x784,0x783,0x782,0x781,0x780,0x77f,0x77e,0x77d,0x77c,0x77b,0x77a,0x779,0x778,0x777,
5206   0x776,0x775,0x774,0x773,0x772,0x771,0x770,0x76f,0x76e,0x76d,0x76b,0x76a,0x769,0x768,0x767,0x766,
5207   0x765,0x764,0x763,0x762,0x761,0x760,0x75f,0x75d,0x75c,0x75b,0x75a,0x759,0x758,0x757,0x756,0x755,
5208   0x754,0x753,0x752,0x751,0x750,0x74f,0x74e,0x74d,0x74c,0x74b,0x74a,0x749,0x748,0x747,0x745,0x744,
5209   0x743,0x742,0x741,0x740,0x73f,0x73e,0x73d,0x73c,0x73b,0x73a,0x739,0x737,0x736,0x735,0x734,0x733,
5210   0x732,0x731,0x730,0x72f,0x72e,0x72d,0x72c,0x72b,0x72a,0x729,0x728,0x727,0x726,0x725,0x724,0x723,
5211   0x722,0x721,0x720,0x71e,0x71d,0x71c,0x71b,0x71a,0x719,0x718,0x717,0x716,0x715,0x714,0x712,0x711,
5212   0x710,0x70f,0x70e,0x70d,0x70c,0x70b,0x70a,0x709,0x708,0x707,0x706,0x705,0x704,0x703,0x702,0x701,
5213   0x700,0x6ff,0x6fe,0x6fd,0x6fc,0x6fb,0x6fa,0x6f8,0x6f7,0x6f6,0x6f5,0x6f4,0x6f3,0x6f2,0x6f1,0x6f0,
5214   0x6ef,0x6ee,0x6ec,0x6eb,0x6ea,0x6e9,0x6e8,0x6e7,0x6e6,0x6e5,0x6e4,0x6e3,0x6e2,0x6e1,0x6e0,0x6df,
5215   0x6de,0x6dd,0x6dc,0x6db,0x6da,0x6d9,0x6d8,0x6d7,0x6d6,0x6d5,0x6d4,0x6d3,0x6d1,0x6d0,0x6cf,0x6ce,
5216   0x6cd,0x6cc,0x6cb,0x6ca,0x6c9,0x6c7,0x6c6,0x6c5,0x6c4,0x6c3,0x6c2,0x6c1,0x6c0,0x6bf,0x6be,0x6bd,
5217   0x6bc,0x6bb,0x6ba,0x6b9,0x6b8,0x6b7,0x6b6,0x6b5,0x6b4,0x6b3,0x6b2,0x6b1,0x6b0,0x6af,0x6ae,0x6ad,
5218   0x6ac,0x6aa,0x6a9,0x6a8,0x6a7,0x6a6,0x6a5,0x6a4,0x6a3,0x6a1,0x6a0,0x69f,0x69e,0x69d,0x69c,0x69b,
5219   0x69a,0x699,0x698,0x697,0x696,0x695,0x694,0x693,0x692,0x691,0x690,0x68f,0x68e,0x68d,0x68c,0x68b,
5220   0x68a,0x689,0x688,0x687,0x686,0x684,0x683,0x682,0x681,0x680,0x67f,0x67e,0x67d,0x67b,0x67a,0x679,
5221   0x678,0x677,0x676,0x675,0x674,0x673,0x672,0x671,0x670,0x66f,0x66e,0x66d,0x66c,0x66b,0x66a,0x669,
5222   0x668,0x666,0x665,0x664,0x663,0x662,0x661,0x660,0x65f,0x65e,0x65d,0x65c,0x65b,0x65a,0x659,0x658,
5223   0x657,0x656,0x655,0x654,0x653,0x652,0x651,0x650,0x64f,0x64e,0x64d,0x64c,0x64b,0x64a,0x649,0x648,
5224   0x647,0x646,0x645,0x644,0x643,0x642,0x640,0x63f,0x63e,0x63d,0x63c,0x63a,0x639,0x638,0x637,0x636,
5225   0x635,0x634,0x633,0x632,0x631,0x630,0x62f,0x62e,0x62d,0x62c,0x62b,0x62a,0x629,0x628,0x627,0x626,
5226   0x625,0x624,0x623,0x622,0x621,0x620,0x61f,0x61e,0x61d,0x61c,0x61b,0x61a,0x619,0x618,0x617,0x615,
5227   0x614,0x613,0x612,0x611,0x610,0x60f,0x60d,0x60c,0x60b,0x60a,0x609,0x608,0x607,0x606,0x605,0x604,
5228   0x603,0x602,0x601,0x600,0x5ff,0x5fe,0x5fd,0x5fc,0x5fb,0x5fa,0x5f9,0x5f8,0x5f7,0x5f6,0x5f5,0x5f4,
5229   0x5f3,0x5f2,0x5f1,0x5f0,0x5ef,0x5ee,0x5ed,0x5ec,0x5eb,0x5e9,0x5e8,0x5e7,0x5e6,0x5e5,0x5e4,0x5e3,
5230   0x5e2,0x5e0,0x5df,0x5de,0x5dd,0x5dc,0x5db,0x5da,0x5d9,0x5d8,0x5d7,0x5d6,0x5d5,0x5d4,0x5d3,0x5d2,
5231   0x5d1,0x5d0,0x5cf,0x5ce,0x5cd,0x5cc,0x5cb,0x5ca,0x5c9,0x5c8,0x5c7,0x5c6,0x5c5,0x5c4,0x5c3,0x5c2,
5232   0x5c1,0x5c0,0x5bf,0x5bd,0x5bc,0x5bb,0x5ba,0x5b9,0x5b8,0x5b7,0x5b6,0x5b4,0x5b3,0x5b2,0x5b1,0x5b0,
5233   0x5af,0x5ae,0x5ad,0x5ac,0x5ab,0x5aa,0x5a9,0x5a8,0x5a7,0x5a6,0x5a5,0x5a4,0x5a3,0x5a2,0x5a1,0x5a0,
5234   0x59f,0x59e,0x59d,0x59c,0x59b,0x59a,0x599,0x598,0x597,0x596,0x595,0x594,0x592,0x591,0x590,0x58f,
5235   0x58e,0x58d,0x58c,0x58b,0x58a,0x589,0x587,0x586,0x585,0x584,0x583,0x582,0x581,0x580,0x57f,0x57e,
5236   0x57d,0x57c,0x57b,0x57a,0x579,0x578,0x577,0x576,0x575,0x574,0x573,0x572,0x571,0x570,0x56f,0x56e,
5237   0x56d,0x56c,0x56b,0x56a,0x569,0x568,0x566,0x565,0x564,0x563,0x562,0x561,0x560,0x55f,0x55e,0x55d,
5238   0x55c,0x55b,0x55a,0x559,0x558,0x557,0x556,0x555,0x554,0x553,0x552,0x551,0x550,0x54f,0x54d,0x54c,
5239   0x54b,0x54a,0x549,0x548,0x547,0x546,0x545,0x544,0x543,0x542,0x541,0x540,0x53f,0x53e,0x53d,0x53c,
5240   0x53b,0x53a,0x539,0x538,0x537,0x536,0x535,0x533,0x532,0x531,0x530,0x52f,0x52e,0x52d,0x52c,0x52b,
5241   0x52a,0x529,0x528,0x527,0x526,0x525,0x524,0x523,0x522,0x521,0x520,0x51f,0x51e,0x51d,0x51c,0x51b,
5242   0x519,0x518,0x517,0x516,0x515,0x514,0x513,0x512,0x511,0x510,0x50f,0x50e,0x50d,0x50c,0x50b,0x50a,
5243   0x509,0x508,0x507,0x506,0x505,0x504,0x503,0x502,0x501,0x500,0x4fe,0x4fd,0x4fc,0x4fb,0x4fa,0x4f9,
5244   0x4f8,0x4f7,0x4f6,0x4f5,0x4f4,0x4f3,0x4f2,0x4f1,0x4f0,0x4ef,0x4ee,0x4ed,0x4ec,0x4eb,0x4ea,0x4e9,
5245   0x4e8,0x4e7,0x4e5,0x4e4,0x4e3,0x4e2,0x4e1,0x4e0,0x4df,0x4de,0x4dd,0x4dc,0x4db,0x4da,0x4d9,0x4d8,
5246   0x4d7,0x4d6,0x4d5,0x4d4,0x4d3,0x4d2,0x4d1,0x4d0,0x4cf,0x4ce,0x4cd,0x4cc,0x4cb,0x4c9,0x4c8,0x4c7,
5247   0x4c6,0x4c5,0x4c4,0x4c3,0x4c2,0x4c1,0x4c0,0x4bf,0x4be,0x4bd,0x4bc,0x4bb,0x4ba,0x4b9,0x4b8,0x4b7,
5248   0x4b6,0x4b5,0x4b4,0x4b3,0x4b1,0x4b0,0x4af,0x4ae,0x4ad,0x4ac,0x4ab,0x4aa,0x4a9,0x4a8,0x4a7,0x4a6,
5249   0x4a5,0x4a4,0x4a3,0x4a2,0x4a1,0x4a0,0x49f,0x49e,0x49d,0x49c,0x49b,0x49a,0x499,0x498,0x497,0x496,
5250   0x495,0x493,0x492,0x491,0x490,0x48f,0x48e,0x48d,0x48c,0x48b,0x48a,0x489,0x488,0x487,0x486,0x485,
5251   0x484,0x483,0x482,0x481,0x480,0x47f,0x47e,0x47c,0x47b,0x47a,0x479,0x478,0x477,0x476,0x475,0x474,
5252   0x473,0x472,0x471,0x470,0x46f,0x46e,0x46d,0x46c,0x46b,0x46a,0x469,0x468,0x467,0x466,0x465,0x464,
5253   0x463,0x462,0x461,0x460,0x45e,0x45d,0x45c,0x45b,0x45a,0x459,0x458,0x457,0x456,0x455,0x454,0x453,
5254   0x452,0x451,0x450,0x44f,0x44e,0x44d,0x44c,0x44b,0x44a,0x449,0x448,0x447,0x446,0x445,0x444,0x443,
5255   0x442,0x441,0x440,0x43f,0x43e,0x43d,0x43c,0x43b,0x43a,0x439,0x438,0x437,0x436,0x435,0x434,0x433,
5256   0x432,0x430,0x42f,0x42e,0x42d,0x42c,0x42b,0x42a,0x429,0x428,0x427,0x426,0x425,0x424,0x423,0x422,
5257   0x421,0x41f,0x41e,0x41d,0x41c,0x41b,0x41a,0x419,0x418,0x417,0x416,0x415,0x414,0x413,0x412,0x411,
5258   0x410,0x40f,0x40e,0x40d,0x40c,0x40b,0x40a,0x409,0x408,0x407,0x406,0x405,0x404,0x403,0x402,0x401,
5259   0x400,0x3ff,0x3fe,0x3fd,0x3fc,0x3fb,0x3fa,0x3f9,0x3f8,0x3f7,0x3f6,0x3f5,0x3f4,0x3f3,0x3f2,0x3f1,
5260   0x3f0,0x3ee,0x3ed,0x3ec,0x3eb,0x3ea,0x3e9,0x3e8,0x3e7,0x3e6,0x3e5,0x3e4,0x3e3,0x3e2,0x3e1,0x3e0,
5261   0x3de,0x3dd,0x3dc,0x3db,0x3da,0x3d9,0x3d8,0x3d7,0x3d6,0x3d5,0x3d4,0x3d3,0x3d2,0x3d1,0x3d0,0x3cf,
5262   0x3ce,0x3cd,0x3cc,0x3cb,0x3ca,0x3c9,0x3c8,0x3c7,0x3c6,0x3c5,0x3c4,0x3c3,0x3c2,0x3c1,0x3c0,0x3bf,
5263   0x3be,0x3bd,0x3bc,0x3bb,0x3ba,0x3b9,0x3b8,0x3b7,0x3b6,0x3b5,0x3b4,0x3b3,0x3b2,0x3b1,0x3b0,0x3af,
5264   0x3ae,0x3ac,0x3ab,0x3aa,0x3a9,0x3a8,0x3a7,0x3a6,0x3a5,0x3a4,0x3a3,0x3a2,0x3a1,0x3a0,0x39f,0x39d,
5265   0x39c,0x39b,0x39a,0x399,0x398,0x397,0x396,0x395,0x394,0x393,0x392,0x391,0x390,0x38f,0x38e,0x38d,
5266   0x38c,0x38b,0x38a,0x389,0x388,0x387,0x386,0x385,0x384,0x383,0x382,0x381,0x380,0x37f,0x37e,0x37d,
5267   0x37c,0x37b,0x37a,0x379,0x378,0x377,0x376,0x375,0x374,0x373,0x372,0x371,0x370,0x36f,0x36e,0x36d,
5268   0x36c,0x36a,0x369,0x368,0x367,0x366,0x365,0x364,0x363,0x362,0x361,0x360,0x35f,0x35e,0x35c,0x35b,
5269   0x35a,0x359,0x358,0x357,0x356,0x355,0x354,0x353,0x352,0x351,0x350,0x34f,0x34e,0x34d,0x34c,0x34b,
5270   0x34b,0x34a,0x349,0x348,0x347,0x346,0x345,0x344,0x343,0x342,0x341,0x340,0x33f,0x33e,0x33d,0x33c,
5271   0x33b,0x33a,0x339,0x338,0x337,0x336,0x334,0x333,0x332,0x331,0x330,0x32f,0x32e,0x32d,0x32c,0x32a,
5272   0x329,0x328,0x327,0x326,0x325,0x324,0x323,0x322,0x321,0x320,0x31f,0x31e,0x31d,0x31c,0x31b,0x31a,
5273   0x319,0x318,0x317,0x316,0x315,0x314,0x313,0x312,0x311,0x310,0x30f,0x30e,0x30d,0x30c,0x30b,0x30a,
5274   0x309,0x308,0x307,0x306,0x305,0x304,0x303,0x302,0x301,0x300,0x2ff,0x2fe,0x2fd,0x2fc,0x2fb,0x2fa,
5275   0x2f9,0x2f8,0x2f7,0x2f6,0x2f5,0x2f4,0x2f3,0x2f2,0x2f1,0x2f0,0x2ef,0x2ee,0x2ed,0x2ec,0x2eb,0x2ea,
5276   0x2e9,0x2e8,0x2e7,0x2e6,0x2e5,0x2e4,0x2e3,0x2e2,0x2e1,0x2e0,0x2df,0x2dd,0x2dc,0x2db,0x2da,0x2d9,
5277   0x2d8,0x2d7,0x2d6,0x2d4,0x2d3,0x2d2,0x2d1,0x2d0,0x2cf,0x2ce,0x2cd,0x2cc,0x2cb,0x2ca,0x2c9,0x2c8,
5278   0x2c7,0x2c6,0x2c5,0x2c4,0x2c3,0x2c2,0x2c1,0x2c0,0x2bf,0x2be,0x2bd,0x2bc,0x2bb,0x2ba,0x2b9,0x2b8,
5279   0x2b7,0x2b6,0x2b5,0x2b4,0x2b3,0x2b2,0x2b1,0x2b0,0x2af,0x2ae,0x2ad,0x2ac,0x2ab,0x2aa,0x2a9,0x2a8,
5280   0x2a7,0x2a6,0x2a5,0x2a4,0x2a3,0x2a2,0x2a1,0x2a0,0x29f,0x29e,0x29d,0x29c,0x29b,0x29a,0x299,0x298,
5281   0x297,0x296,0x295,0x294,0x293,0x292,0x291,0x290,0x28f,0x28e,0x28d,0x28c,0x28b,0x28a,0x289,0x288,
5282   0x287,0x285,0x284,0x283,0x282,0x281,0x280,0x27f,0x27d,0x27c,0x27b,0x27a,0x279,0x278,0x277,0x276,
5283   0x275,0x274,0x273,0x272,0x271,0x270,0x26f,0x26e,0x26d,0x26c,0x26b,0x26a,0x269,0x268,0x267,0x266,
5284   0x265,0x264,0x263,0x262,0x261,0x260,0x25f,0x25e,0x25d,0x25c,0x25b,0x25a,0x259,0x258,0x257,0x256,
5285   0x255,0x254,0x253,0x252,0x251,0x250,0x24f,0x24e,0x24d,0x24c,0x24b,0x24a,0x249,0x248,0x247,0x246,
5286   0x246,0x244,0x243,0x242,0x241,0x23f,0x23e,0x23d,0x23c,0x23b,0x23a,0x239,0x238,0x237,0x236,0x235,
5287   0x234,0x233,0x232,0x231,0x230,0x22f,0x22e,0x22d,0x22c,0x22b,0x22a,0x229,0x228,0x227,0x226,0x225,
5288   0x224,0x223,0x222,0x221,0x220,0x21f,0x21e,0x21d,0x21c,0x21b,0x21a,0x219,0x218,0x217,0x216,0x215,
5289   0x214,0x213,0x212,0x211,0x210,0x20f,0x20e,0x20d,0x20c,0x20b,0x20a,0x209,0x208,0x207,0x206,0x205,
5290   0x204,0x203,0x202,0x201,0x200,0x1ff,0x1fe,0x1fd,0x1fc,0x1fb,0x1fa,0x1f9,0x1f8,0x1f7,0x1f6,0x1f5,
5291   0x1f4,0x1f3,0x1f2,0x1f1,0x1f0,0x1ef,0x1ee,0x1ed,0x1ec,0x1eb,0x1ea,0x1e9,0x1e8,0x1e7,0x1e6,0x1e5,
5292   0x1e4,0x1e3,0x1e2,0x1e1,0x1e0,0x1df,0x1de,0x1dd,0x1dc,0x1db,0x1da,0x1d9,0x1d8,0x1d7,0x1d6,0x1d5,
5293   0x1d4,0x1d3,0x1d2,0x1d1,0x1d0,0x1cf,0x1ce,0x1cd,0x1cc,0x1cb,0x1ca,0x1c9,0x1c8,0x1c7,0x1c6,0x1c5,
5294   0x1c4,0x1c2,0x1c1,0x1c0,0x1be,0x1bd,0x1bc,0x1bb,0x1ba,0x1b9,0x1b8,0x1b7,0x1b6,0x1b5,0x1b4,0x1b3,
5295   0x1b2,0x1b1,0x1b0,0x1af,0x1ae,0x1ad,0x1ac,0x1ab,0x1aa,0x1a9,0x1a8,0x1a7,0x1a6,0x1a5,0x1a4,0x1a3,
5296   0x1a2,0x1a1,0x1a0,0x19f,0x19e,0x19d,0x19c,0x19b,0x19a,0x199,0x198,0x197,0x196,0x195,0x194,0x193,
5297   0x192,0x191,0x190,0x18f,0x18e,0x18d,0x18c,0x18b,0x18a,0x189,0x188,0x187,0x186,0x185,0x184,0x183,
5298   0x182,0x181,0x180,0x17f,0x17e,0x17d,0x17c,0x17b,0x17a,0x179,0x178,0x177,0x176,0x175,0x174,0x173,
5299   0x172,0x171,0x170,0x16f,0x16e,0x16d,0x16c,0x16b,0x16a,0x169,0x168,0x167,0x166,0x165,0x164,0x163,
5300   0x162,0x161,0x160,0x15f,0x15e,0x15d,0x15c,0x15b,0x15a,0x159,0x158,0x157,0x156,0x155,0x154,0x153,
5301   0x152,0x151,0x150,0x14f,0x14e,0x14d,0x14c,0x14b,0x14a,0x149,0x148,0x147,0x146,0x145,0x144,0x143,
5302   0x141,0x140,0x13f,0x13e,0x13d,0x13c,0x13b,0x13a,0x139,0x138,0x137,0x136,0x135,0x134,0x133,0x132,
5303   0x131,0x130,0x12f,0x12e,0x12d,0x12c,0x12b,0x12a,0x129,0x128,0x127,0x126,0x125,0x124,0x123,0x122,
5304   0x121,0x120,0x11f,0x11e,0x11d,0x11c,0x11b,0x11a,0x119,0x118,0x117,0x116,0x115,0x114,0x113,0x112,
5305   0x111,0x110,0x10f,0x10e,0x10d,0x10c,0x10b,0x10a,0x109,0x108,0x107,0x106,0x105,0x104,0x103,0x102,
5306   0x101,0x100,0xff,0xfe,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8,0xf7,0xf6,0xf5,0xf4,0xf3,0xf2,
5307   0xf1,0xf0,0xef,0xee,0xed,0xec,0xeb,0xea,0xe9,0xe8,0xe7,0xe6,0xe5,0xe4,0xe3,0xe2,
5308   0xe1,0xe0,0xdf,0xde,0xdd,0xdc,0xdb,0xda,0xd9,0xd8,0xd7,0xd6,0xd5,0xd4,0xd3,0xd2,
5309   0xd1,0xd0,0xcf,0xce,0xcd,0xcc,0xcb,0xca,0xc9,0xc8,0xc7,0xc6,0xc5,0xc4,0xc3,0xc2,
5310   0xc1,0xc0,0xbf,0xbe,0xbd,0xbc,0xbb,0xba,0xb9,0xb8,0xb7,0xb6,0xb5,0xb4,0xb3,0xb2,
5311   0xb1,0xb0,0xaf,0xae,0xad,0xac,0xab,0xaa,0xa9,0xa8,0xa7,0xa6,0xa5,0xa4,0xa3,0xa2,
5312   0xa1,0xa0,0x9f,0x9e,0x9d,0x9c,0x9b,0x9a,0x99,0x98,0x97,0x96,0x95,0x94,0x93,0x92,
5313   0x91,0x90,0x8f,0x8e,0x8d,0x8c,0x8b,0x8a,0x89,0x88,0x87,0x86,0x85,0x84,0x83,0x82,
5314   0x81,0x7e,0x7d,0x7c,0x7b,0x7a,0x79,0x78,0x77,0x76,0x75,0x74,0x73,0x72,0x71,0x70,
5315   0x6f,0x6e,0x6d,0x6c,0x6b,0x6a,0x69,0x68,0x67,0x66,0x65,0x64,0x63,0x62,0x61,0x60,
5316   0x5f,0x5e,0x5d,0x5c,0x5b,0x5a,0x59,0x58,0x57,0x56,0x55,0x54,0x53,0x52,0x51,0x50,
5317   0x4f,0x4e,0x4d,0x4c,0x4b,0x4a,0x49,0x48,0x47,0x46,0x45,0x44,0x43,0x42,0x41,0x40,
5318   0x3f,0x3e,0x3d,0x3c,0x3b,0x3a,0x39,0x38,0x37,0x36,0x35,0x34,0x33,0x32,0x31,0x30,
5319   0x2f,0x2e,0x2d,0x2c,0x2b,0x2a,0x29,0x28,0x27,0x26,0x25,0x24,0x23,0x22,0x21,0x20,
5320   0x1f,0x1e,0x1d,0x1c,0x1b,0x1a,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,
5321   0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0,
5322};
5323
5324INLINE UINT32 gte_divide( INT16 numerator, UINT16 denominator )
5325{
5326   if( numerator >= 0 && numerator < ( denominator * 2 ) )
5327   {
5328      UINT32 offset = denominator;
5329      int shift = 0;
5330      UINT64 reciprocal;
5331      while( offset <= 0x8000 )
5332      {
5333         offset <<= 1;
5334         shift++;
5335      }
5336
5337      reciprocal = (UINT64)( 0x10000 | reciprocals[ offset & 0x7fff ] ) << shift;
5338
5339      return (UINT32)( ( ( reciprocal * numerator ) + 0x8000 ) >> 16 );
5340   }
5341
5342   return 0xffffffff;
5343}
5344
32705345/* Setting bits 12 & 19-22 in FLAG does not set bit 31 */
32715346
32725347#define A1( a ) BOUNDS( psxcpu, ( a ), 0x7fffffff, ( 1 << 30 ), -(INT64)0x80000000, ( 1 << 31 ) | ( 1 << 27 ) )
r4057r4058
32805355#define Lm_C3( a ) LIM( psxcpu, ( a ), 0x00ff, 0x0000, ( 1 << 19 ) )
32815356#define Lm_D( a ) LIM( psxcpu, ( a ), 0xffff, 0x0000, ( 1 << 31 ) | ( 1 << 18 ) )
32825357
3283INLINE UINT32 Lm_E( psxcpu_state *psxcpu, UINT32 n_z )
5358INLINE UINT32 Lm_E( psxcpu_state *psxcpu, UINT32 result )
32845359{
3285   if( n_z <= H / 2 )
5360   if( result > 0x1ffff )
32865361   {
3287      n_z = H / 2;
32885362      FLAG |= ( 1 << 31 ) | ( 1 << 17 );
5363      return 0x1ffff;
32895364   }
3290   if( n_z == 0 )
3291   {
3292      n_z = 1;
3293   }
3294   return n_z;
5365
5366   return result;
32955367}
32965368
32975369#define F( a ) BOUNDS( psxcpu, ( a ), 0x7fffffff, ( 1 << 31 ) | ( 1 << 16 ), -(INT64)0x80000000, ( 1 << 31 ) | ( 1 << 15 ) )
r4057r4058
33065378   int lm;
33075379   int cv;
33085380   int mx;
5381   INT32 h_over_sz3;
33095382   INT64 mac0;
33105383
33115384   switch( GTE_FUNCT( gteop ) )
r4057r4058
33265399         SZ1 = SZ2;
33275400         SZ2 = SZ3;
33285401         SZ3 = Lm_D( MAC3 );
5402         h_over_sz3 = Lm_E( psxcpu, gte_divide( H, SZ3 ) );
33295403         SXY0 = SXY1;
33305404         SXY1 = SXY2;
3331         SX2 = Lm_G1( F( (INT64) OFX + ( (INT64) IR1 * ( ( (UINT32) H << 16 ) / Lm_E( psxcpu, SZ3 ) ) ) ) >> 16 );
3332         SY2 = Lm_G2( F( (INT64) OFY + ( (INT64) IR2 * ( ( (UINT32) H << 16 ) / Lm_E( psxcpu, SZ3 ) ) ) ) >> 16 );
3333         MAC0 = F( (INT64) DQB + ( (INT64) DQA * ( ( (UINT32) H << 16 ) / Lm_E( psxcpu, SZ3 ) ) ) );
5405         SX2 = Lm_G1( F( (INT64) OFX + ( (INT64) IR1 * h_over_sz3 ) ) >> 16 );
5406         SY2 = Lm_G2( F( (INT64) OFY + ( (INT64) IR2 * h_over_sz3 ) ) >> 16 );
5407         MAC0 = F( (INT64) DQB + ( (INT64) DQA * h_over_sz3 ) );
33345408         IR0 = Lm_H( MAC0 >> 12 );
33355409         return;
33365410      }
r4057r4058
37635837            SZ1 = SZ2;
37645838            SZ2 = SZ3;
37655839            SZ3 = Lm_D( MAC3 );
5840            h_over_sz3 = Lm_E( psxcpu, gte_divide( H, SZ3 ) );
37665841            SXY0 = SXY1;
37675842            SXY1 = SXY2;
3768            SX2 = Lm_G1( F( ( (INT64) OFX + ( (INT64) IR1 * ( ( (UINT32) H << 16 ) / Lm_E( psxcpu, SZ3 ) ) ) ) >> 16 ) );
3769            SY2 = Lm_G2( F( ( (INT64) OFY + ( (INT64) IR2 * ( ( (UINT32) H << 16 ) / Lm_E( psxcpu, SZ3 ) ) ) ) >> 16 ) );
3770            MAC0 = F( (INT64) DQB + ( (INT64) DQA * ( ( (UINT32) H << 16 ) / Lm_E( psxcpu, SZ3 ) ) ) );
5843            SX2 = Lm_G1( F( ( (INT64) OFX + ( (INT64) IR1 * h_over_sz3 ) ) >> 16 ) );
5844            SY2 = Lm_G2( F( ( (INT64) OFY + ( (INT64) IR2 * h_over_sz3 ) ) >> 16 ) );
5845            MAC0 = F( (INT64) DQB + ( (INT64) DQA * h_over_sz3 ) );
37715846            IR0 = Lm_H( MAC0 >> 12 );
37725847         }
37735848         return;
src/emu/cpu/z80/z80.c
r4057r4058
34473447      z80->daisy = z80daisy_init(device, device->static_config);
34483448   z80->irq_callback = irqcallback;
34493449   z80->device = device;
3450   z80->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
3451   z80->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
3450   z80->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
3451   z80->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
34523452   z80->IX = z80->IY = 0xffff; /* IX and IY are FFFF after a reset! */
34533453   z80->F = ZF;         /* Zero flag is set */
34543454
src/emu/cpu/esrip/esrip.c
r0r4058
1/***************************************************************************
2
3    escpustate->c
4
5    Implementation of the Entertainment Sciences
6    AM29116-based Real Time Image Processor
7
8***************************************************************************/
9
10#include "debugger.h"
11#include "deprecat.h"
12#include "esrip.h"
13
14
15/***************************************************************************
16    CONSTANTS
17***************************************************************************/
18
19#define IPT_RAM_SIZE   (8192 * sizeof(UINT16))
20
21
22/***************************************************************************
23    MACROS
24***************************************************************************/
25
26#define ASSERT(x)
27//(assert(x))
28#define RIP_PC      (cpustate->pc | ((cpustate->status_out & 1) << 8))
29#define _BIT(x, n)   ((x) & (1 << (n)))
30#define RISING_EDGE(old_val, new_val, bit)   (!(old_val & (1 << bit)) && (new_val & (1 << bit)))
31
32#define UNHANDLED   do {printf("%s:UNHANDLED (%x)\n", __FUNCTION__, inst); ASSERT(0);}while(0)
33#define INVALID      do {printf("%s:INVALID (%x)\n", __FUNCTION__, inst); ASSERT(0);}while(0)
34
35#define RAM_ADDR   (inst & 0x1f)
36#define MODE      (inst & 0x8000)
37#define WORD_MODE   (inst & 0x8000)
38#define BYTE_MODE   (!WORD_MODE)
39#define N         ((inst >> 9) & 0xf)
40#define OPCODE      ((inst >> 5) & 0xf)
41#define SRC         ((inst >> 9) & 0xf)
42#define   DST         (inst & 0x1f)   // TEST
43
44#define BW_WORD      (1 << 15)
45#define   BW_BYTE      (0 << 15)
46
47#define FLAG_3      (1 << 7)
48#define FLAG_2      (1 << 6)
49#define FLAG_1      (1 << 5)
50#define L_FLAG      (1 << 4)
51#define   V_FLAG      (1 << 3)
52#define   N_FLAG      (1 << 2)
53#define   C_FLAG      (1 << 1)
54#define   Z_FLAG      (1 << 0)
55
56#define CLEAR_FLAGS(a)   (cpustate->new_status &= ~(a))
57#define SET_FLAGS(a)   (cpustate->new_status |=  (a))
58
59
60/***************************************************************************
61    STRUCTURES & TYPEDEFS
62***************************************************************************/
63
64typedef struct
65{
66   UINT16   ram[32];
67   UINT16   acc;
68   UINT16   d_latch;
69   UINT16   i_latch;
70   UINT16   result;
71   UINT8   new_status;
72   UINT8   status;
73   UINT16   inst;
74   UINT8   immflag;
75   UINT8   ct;
76   UINT8   t;
77
78   /* Instruction latches - current and previous values */
79   UINT8   l1, pl1;
80   UINT8   l2, pl2;
81   UINT8   l3, pl3;
82   UINT8   l4, pl4;
83   UINT8   l5, pl5;
84   UINT8   l6, pl6;
85   UINT8   l7, pl7;
86
87   UINT8   pc;
88   UINT8   status_out;
89
90   UINT8   x_scale;
91   UINT8   y_scale;
92   UINT8   line_latch;
93   UINT16   fig_latch;
94   UINT16   attr_latch;
95   UINT16   adl_latch;
96   UINT16   adr_latch;
97   UINT8   c_latch;
98   UINT16   iaddr;
99
100   UINT16   fdt_cnt;
101   UINT16   ipt_cnt;
102
103   UINT16   *ipt_ram;
104   UINT8   *lbrm;
105
106   UINT8   *optable;
107
108   UINT8   fig;
109   UINT16   fig_cycles;
110
111   const   device_config *device;
112   const   address_space *program;
113   int      icount;
114
115   read16_device_func   fdt_r;
116   write16_device_func   fdt_w;
117   UINT8 (*status_in)(running_machine *machine);
118   int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int line_latch);
119} esrip_state;
120
121
122/***************************************************************************
123    INITIALIZATION AND SHUTDOWN
124***************************************************************************/
125
126UINT8 get_rip_status(const device_config *cpu)
127{
128   esrip_state *cpustate = cpu->token;
129
130   return cpustate->status_out;
131}
132
133/*
134static STATE_POSTLOAD( esrip_postload )
135{
136
137}
138*/
139
140//static void esrip_state_register(int index, const char *type)
141//{
142//  state_save_register_item_pointer(type, index, cpustate->ipt_ram, IPT_RAM_SIZE / 2);
143//}
144
145
146enum
147{
148   ROTR1, TOR1, ROTR2, ROTC, ROTM, BOR2, CRCF, CRCR,
149   SVSTR, PRT, SOR, TOR2, SHFTR, TEST, NOP, SETST, RSTST,
150   ROTNR, BONR, BOR1, SONR, SHFTNR, PRTNR, TONR
151} ops;
152
153
154void make_ops(esrip_state *cpustate)
155{
156   int inst;
157
158   for (inst = 0; inst < 65536; ++inst)
159   {
160      int quad = (inst >> 13) & 3;
161
162      if (quad == 0)
163      {
164         if (((inst >> 5) & 0xc) == 0xc)
165            cpustate->optable[inst] = ROTR1;
166         else
167            cpustate->optable[inst] = TOR1;
168      }
169      else if (quad == 1)
170      {
171         if (OPCODE < 2)
172            cpustate->optable[inst] = ROTR2;
173         else if (OPCODE < 6)
174            cpustate->optable[inst] = ROTC;
175         else
176            cpustate->optable[inst] = ROTM;
177      }
178      else if (quad == 2)
179      {
180         if (OPCODE > 11)
181            cpustate->optable[inst] = BOR2;
182         else
183         {
184            int tmp = (inst >> 5) & 0xff;
185
186            if (tmp == 0x63)
187               cpustate->optable[inst] = CRCF;
188            else if (tmp == 0x69)
189               cpustate->optable[inst] = CRCR;
190            else if (tmp == 0x7a)
191               cpustate->optable[inst] = SVSTR;
192            else
193            {
194               if ((SRC > 7) && (SRC < 12))
195                  cpustate->optable[inst] = PRT;
196               else if (SRC > 11)
197                  cpustate->optable[inst] = SOR;
198               else if (SRC < 6)
199                  cpustate->optable[inst] = TOR2;
200               else
201                  cpustate->optable[inst] = SHFTR;
202            }
203         }
204      }
205      else
206      {
207         if (inst == 0x7140)
208            cpustate->optable[inst] = NOP;
209         else
210         {
211            int x = (inst & 0xffe0);
212            if (x == 0x7340)
213               cpustate->optable[inst] = TEST;
214            else if (x == 0x7740)
215               cpustate->optable[inst] = SETST;
216            else if (x == 0x7540)
217               cpustate->optable[inst] = RSTST;
218            else
219            {
220               int op = OPCODE;
221               if (op == 0xc)
222               {
223                  if ((inst & 0x18) == 0x18)
224                     cpustate->optable[inst] = ROTNR;
225                  else
226                     cpustate->optable[inst] = BONR;
227               }
228               else if ((op & 0xc) == 0xc)
229                  cpustate->optable[inst] = BOR1;
230               else
231               {
232                  int src = SRC;
233
234                  if ((src & 0xc) == 0xc)
235                     cpustate->optable[inst] = SONR;
236                  else if ((src & 0x6) == 0x6)
237                     cpustate->optable[inst] = SHFTNR;
238                  else if (src & 0x8)
239                     cpustate->optable[inst] = PRTNR;
240                  else
241                     cpustate->optable[inst] = TONR;
242               }
243            }
244         }
245      }
246   }
247}
248
249static CPU_INIT( esrip )
250{
251   esrip_state *cpustate = device->token;
252   esrip_config* _config = (esrip_config*)device->static_config;
253
254   memset(cpustate, 0, sizeof(cpustate));
255
256   /* Register configuration structure callbacks */
257   cpustate->fdt_r = _config->fdt_r;
258   cpustate->fdt_w = _config->fdt_w;
259   cpustate->lbrm = (UINT8*)memory_region(device->machine, _config->lbrm_prom);
260   cpustate->status_in = _config->status_in;
261   cpustate->draw = _config->draw;
262
263   cpustate->ipt_ram = auto_malloc(IPT_RAM_SIZE);
264//state_save_register_global_pointer(cpustate->ipt_ram, IPT_RAM_SIZE / 2);          // TODO
265
266//  esrip_state_register(index, "esrip");
267   cpustate->device = device;
268   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
269
270   /* Create the instruction decode lookup table */
271   cpustate->optable = auto_malloc(65536);
272   make_ops(cpustate);
273}
274
275
276static CPU_RESET( esrip )
277{
278   esrip_state *cpustate = device->token;
279
280   cpustate->pc = 0;
281
282   cpustate->pl1 = 0xff;
283   cpustate->pl2 = 0xff;
284   cpustate->pl3 = 0xff;
285   cpustate->pl4 = 0xff;
286   cpustate->pl5 = 0xff;
287   cpustate->pl6 = 0xff;
288   cpustate->pl7 = 0xff;
289
290   cpustate->l1 = 0xff;
291   cpustate->l2 = 0xff;
292   cpustate->l3 = 0xff;
293   cpustate->l4 = 0xff;
294   cpustate->l5 = 0xff;
295   cpustate->l6 = 0xff;
296   cpustate->l7 = 0xff;
297
298   cpustate->status_out = 0;
299   cpustate->immflag = 0;
300}
301
302
303static CPU_EXIT( esrip )
304{
305
306}
307
308
309
310static int get_hblank(running_machine *machine)
311{
312   return video_screen_get_hblank(machine->primary_screen);
313}
314
315/* Return the state of the LBRM line (Y-scaling related) */
316static int get_lbrm(esrip_state *cpustate)
317{
318   int addr = ((cpustate->y_scale & 0x3f) << 3) | ((cpustate->line_latch >> 3) & 7);
319   int sel = (cpustate->line_latch & 7);
320
321   UINT8 val = cpustate->lbrm[addr];
322
323   return (val >> sel) & 1;
324}
325
326INLINE int check_jmp(esrip_state *cpustate, running_machine *machine, UINT8 jmp_ctrl)
327{
328   int ret = 0;
329
330   if (~jmp_ctrl & 0x10)
331   {
332      switch (jmp_ctrl & 7)
333      {
334         /* CT */      case 0: ret = cpustate->ct;         break;
335         /* T1 */      case 4: ret = BIT(cpustate->t, 0);  break;
336         /* T2 */      case 2: ret = BIT(cpustate->t, 1);  break;
337         /* T3 */      case 6: ret = BIT(cpustate->t, 2);  break;
338         /* T4 */      case 1: ret = BIT(cpustate->t, 3);  break;
339         /* /LBRM */   case 5: ret = !get_lbrm(cpustate);  break;
340         /* /HBLANK */ case 3: ret = !get_hblank(machine); break;
341         /* JMP */     case 7: ret = 0;                    break;
342      }
343
344      ret ^= 1;
345   }
346   else if (~jmp_ctrl & 0x08)
347   {
348      switch (jmp_ctrl & 7)
349      {
350         /* CT */      case 0: ret = cpustate->ct;        break;
351         /* T1 */      case 4: ret = BIT(cpustate->t, 0); break;
352         /* T2 */      case 2: ret = BIT(cpustate->t, 1); break;
353         /* T3 */      case 6: ret = BIT(cpustate->t, 2); break;
354         /* T4 */      case 1: ret = BIT(cpustate->t, 3); break;
355         /* /LBRM */   case 5: ret = !get_lbrm(cpustate); break;
356         /* /FIG */    case 3: ret = !cpustate->fig;      break;
357         /* JMP */     case 7: ret = 1;                   break;
358      }
359   }
360   else
361      ASSERT(!"RIP: Invalid jump control");
362
363   return ret;
364}
365
366
367INLINE void calc_z_flag(esrip_state *cpustate, UINT16 res)
368{
369   cpustate->new_status &= ~Z_FLAG;
370   cpustate->new_status |= (res == 0);
371}
372
373INLINE void calc_c_flag_add(esrip_state *cpustate, UINT16 a, UINT16 b)
374{
375   cpustate->new_status &= ~C_FLAG;
376   cpustate->new_status |= ((UINT16)(b) > (UINT16)(~(a))) ? 2 : 0;
377}
378
379INLINE void calc_c_flag_sub(esrip_state *cpustate, UINT16 a, UINT16 b)
380{
381   cpustate->new_status &= ~C_FLAG;
382   cpustate->new_status |= ((UINT16)(b) <= (UINT16)(a)) ? 2 : 0;
383}
384
385INLINE void calc_n_flag(esrip_state *cpustate, UINT16 res)
386{
387   cpustate->new_status &= ~N_FLAG;
388   cpustate->new_status |= (res & 0x8000) ? 4 : 0;
389}
390
391INLINE void calc_v_flag_add(esrip_state *cpustate, UINT16 a, UINT16 b, UINT32 r)
392{
393   cpustate->new_status &= ~V_FLAG;
394   cpustate->new_status |= ((a ^ r) & (b ^ r) & 0x8000) ? 8 : 0;
395}
396
397INLINE void calc_v_flag_sub(esrip_state *cpustate, UINT16 a, UINT16 b, UINT32 r)
398{
399   cpustate->new_status &= ~V_FLAG;
400   cpustate->new_status |= ((a ^ b) & (r ^ b) & 0x8000) ? 8 : 0;
401}
402
403
404enum
405{
406   ACC,
407   Y_BUS,
408   STATUS,
409   RAM,
410};
411
412/*************************************
413 *
414 *  Single operand
415 *
416 *************************************/
417enum
418{
419   MOVE = 0xc,
420   COMP = 0xd,
421   INC  = 0xe,
422   NEG  = 0xf
423};
424
425enum
426{
427   SORA  = 0x0,
428   SORY  = 0x2,
429   SORS  = 0x3,
430   SOAR  = 0x4,
431   SODR  = 0x6,
432   SOIR  = 0x7,
433   SOZR  = 0x8,
434   SOZER = 0x9,
435   SOSER = 0xa,
436   SORR  = 0xb
437};
438
439static UINT16 sor_op(esrip_state *cpustate, UINT16 r, UINT16 opcode)
440{
441   UINT32 res = 0;
442
443   switch (opcode)
444   {
445      case MOVE:
446      {
447         res = r;
448         CLEAR_FLAGS(V_FLAG | C_FLAG);
449         calc_n_flag(cpustate, res);
450         calc_z_flag(cpustate, res);
451         break;
452      }
453      case COMP:
454      {
455         res = r ^ 0xffff;
456         CLEAR_FLAGS(V_FLAG | C_FLAG);
457         calc_n_flag(cpustate, res);
458         calc_z_flag(cpustate, res);
459         break;
460      }
461      case INC:
462      {
463         res = r + 1;
464         calc_v_flag_add(cpustate, r, 1, res);
465         calc_n_flag(cpustate, res);
466         calc_c_flag_add(cpustate, r, 1);
467         calc_z_flag(cpustate, res);
468         break;
469      }
470      case NEG:
471      {
472         res = (r ^ 0xffff) + 1;
473         calc_v_flag_sub(cpustate, 0, r, res);
474         calc_n_flag(cpustate, res);
475         calc_c_flag_sub(cpustate, 0, r);
476         calc_z_flag(cpustate, res);
477         break;
478      }
479      default: assert(0);
480   }
481
482   return res & 0xffff;
483}
484
485static void sor(esrip_state *cpustate, UINT16 inst)
486{
487   UINT16   r = 0;
488   UINT16   dst = 0;
489   UINT16   res = 0;
490
491   if (BYTE_MODE)
492   {
493      printf("Byte Mode! %.4x\n", inst);
494      UNHANDLED;
495   }
496
497   switch ((inst >> 5) & 0xf)
498   {
499      case SORA: r = cpustate->ram[RAM_ADDR];      dst = ACC;      break;
500      case SORY: r = cpustate->ram[RAM_ADDR];      dst = Y_BUS;   break;
501      case SORS: r = cpustate->ram[RAM_ADDR];      dst = STATUS;   break;
502      case SOAR: r = cpustate->acc;            dst = RAM;      break;
503      case SODR: r = cpustate->d_latch;         dst = RAM;      break;
504      case SOIR:
505      {
506         if (cpustate->immflag == 0)      // Macrofiy this?
507         {
508            cpustate->i_latch = inst;
509            cpustate->immflag = 1;
510            return;
511         }
512         else
513         {
514            r = cpustate->inst;
515            dst = RAM;
516            cpustate->immflag = 0;
517         }
518         break;
519      }
520      case SOZR: r = 0;                  dst = RAM;      break;
521      case SORR: r = cpustate->ram[RAM_ADDR];   dst = RAM;      break;
522      default: UNHANDLED;
523   }
524
525   /* Operation */
526   res = sor_op(cpustate, r, (inst >> 9) & 0xf);
527
528   switch (dst)
529   {
530      case Y_BUS: break;
531      case ACC: cpustate->acc = res; break;
532      case RAM: cpustate->ram[RAM_ADDR] = res; break;
533      default: UNHANDLED;
534   }
535
536   cpustate->result = res;
537}
538
539enum
540{
541   SOA  = 0x4,
542   SOD  = 0x6,
543   SOI  = 0x7,
544   SOZ  = 0x8,
545   SOZE = 0x9,
546   SOSE = 0xa,
547};
548
549enum
550{
551   NRY  = 0,
552   NRA  = 1,
553   NRS  = 4,
554   NRAS = 5,
555};
556
557static void sonr(esrip_state *cpustate, UINT16 inst)
558{
559   UINT16   r = 0;
560   UINT16   res = 0;
561
562   switch ((inst >> 5) & 0xf)
563   {
564      case SOA:   r = cpustate->acc;      break;
565      case SOD:   r = cpustate->d_latch;   break;
566      case SOI:
567      {
568         if (cpustate->immflag == 0)
569         {
570            cpustate->i_latch = inst;
571            cpustate->immflag = 1;
572            return;
573         }
574         else
575         {
576            r = cpustate->inst;
577            cpustate->immflag = 0;
578         }
579         break;
580      }
581      case SOZ:   r = 0; break;
582      default: INVALID;
583   }
584
585   /* Operation */
586   res = sor_op(cpustate, r, (inst >> 9) & 0xf);
587
588   /* Destination */
589   switch (inst & 0x1f)
590   {
591      case NRY: break;
592      case NRA: cpustate->acc = res; break;
593      default: UNHANDLED;
594   }
595
596   cpustate->result = res;
597}
598
599/*************************************
600 *
601 *  Two operand
602 *
603 *************************************/
604
605enum
606{
607   SUBR  = 0x0,
608   SUBRC = 0x1,
609   SUBS  = 0x2,
610   SUBSC = 0x3,
611   ADD   = 0x4,
612   ADDC  = 0x5,
613   AND   = 0x6,
614   NAND  = 0x7,
615   EXOR  = 0x8,
616   NOR   = 0x9,
617   OR    = 0xa,
618   EXNOR = 0xb
619};
620
621static UINT16 tor_op(esrip_state *cpustate, UINT16 r, UINT16 s, int opcode)
622{
623   UINT32 res = 0;
624
625   switch (opcode)
626   {
627      case SUBR:
628      {
629         res = s - r;
630         calc_v_flag_sub(cpustate, s, r, res);
631         calc_n_flag(cpustate, res);
632         calc_c_flag_sub(cpustate, s, r);
633         calc_z_flag(cpustate, res);
634         break;
635      }
636      case SUBRC: assert(0); break;
637      case SUBS:
638      {
639         res = r - s;
640         calc_v_flag_sub(cpustate, r, s, res);
641         calc_n_flag(cpustate, res);
642         calc_c_flag_sub(cpustate, r, s);
643         calc_z_flag(cpustate, res);
644         break;
645      }
646      case SUBSC: assert(0); break;
647      case ADD:
648      {
649         res = r + s;
650         calc_v_flag_add(cpustate, r, s, res);
651         calc_n_flag(cpustate, res);
652         calc_c_flag_add(cpustate, r, s);
653         calc_z_flag(cpustate, res);
654         break;
655      }
656      case ADDC:
657      {
658         // TODO TODO CHECK ME ETC
659         res = r + s + ((cpustate->status >> 1) & 1);
660         calc_v_flag_add(cpustate, r, s, res);
661         calc_n_flag(cpustate, res);
662         calc_c_flag_add(cpustate, r, s);
663         calc_z_flag(cpustate, res);
664         break;
665      }
666      case AND:
667      {
668         res = r & s;
669         CLEAR_FLAGS(V_FLAG | C_FLAG);
670         calc_n_flag(cpustate, res);
671         calc_z_flag(cpustate, res);
672         break;
673      }
674      case NAND:
675      {
676         res = (r & s) ^ 0xffff;
677         CLEAR_FLAGS(V_FLAG | C_FLAG);
678         calc_n_flag(cpustate, res);
679         calc_z_flag(cpustate, res);
680         break;
681      }
682      case EXOR:
683      {
684         res = r ^ s;
685         CLEAR_FLAGS(V_FLAG | C_FLAG);
686         calc_n_flag(cpustate, res);
687         calc_z_flag(cpustate, res);
688         break;
689      }
690      case NOR:
691      {
692         res = (r | s) ^ 0xffff;
693         CLEAR_FLAGS(V_FLAG | C_FLAG);
694         calc_n_flag(cpustate, res);
695         calc_z_flag(cpustate, res);
696         break;
697      }
698      case OR:
699      {
700         res = r | s;
701         CLEAR_FLAGS(V_FLAG | C_FLAG);
702         calc_n_flag(cpustate, res);
703         calc_z_flag(cpustate, res);
704         break;
705      }
706      case EXNOR:
707      {
708         res = (r ^ s) ^ 0xffff;
709         CLEAR_FLAGS(V_FLAG | N_FLAG | C_FLAG);
710         calc_z_flag(cpustate, res);
711         break;
712      }
713      default: assert(0);
714   }
715
716   return res & 0xffff;
717}
718
719static void tor1(esrip_state *cpustate, UINT16 inst)
720{
721   UINT16 r = 0;
722   UINT16 s = 0;
723   UINT16 dst = 0;
724   UINT16   res = 0;
725
726   enum
727   {
728      TORAA = 0x0,
729      TORIA = 0x2,
730      TODRA = 0x3,
731      TORAY = 0x8,
732      TORIY = 0xa,
733      TODRY = 0xb,
734      TORAR = 0xc,
735      TORIR = 0xe,
736      TODRR = 0xf,
737   };
738
739   switch (SRC)
740   {
741      case TORAA: r = cpustate->ram[RAM_ADDR];   s = cpustate->acc;   dst = ACC;   break;
742      case TORIA:
743      {
744         if (cpustate->immflag == 0)
745         {
746            cpustate->i_latch = inst;
747            cpustate->immflag = 1;
748            return;
749         }
750         else
751         {
752            r = cpustate->ram[RAM_ADDR];
753            s = cpustate->inst;
754            dst = ACC;
755            cpustate->immflag = 0;
756         }
757         break;
758      }
759      case TODRA: r = cpustate->d_latch;      s = cpustate->ram[RAM_ADDR];   dst = ACC;   break;
760      case TORAY: r = cpustate->ram[RAM_ADDR];   s = cpustate->acc;         dst = Y_BUS;break;
761      case TORIY:
762      {
763         if (cpustate->immflag == 0)
764         {
765            cpustate->i_latch = inst;
766            cpustate->immflag = 1;
767            return;
768         }
769         else
770         {
771            r = cpustate->ram[RAM_ADDR];
772            s = cpustate->inst;
773            dst = Y_BUS;
774            cpustate->immflag = 0;
775         }
776         break;
777      }
778      case TODRY: r = cpustate->d_latch;      s = cpustate->ram[RAM_ADDR];   dst = Y_BUS;break;
779      case TORAR: r = cpustate->ram[RAM_ADDR];   s = cpustate->acc;         dst = RAM;   break;
780      case TORIR:
781      {
782         if (cpustate->immflag == 0)
783         {
784            cpustate->i_latch = inst;
785            cpustate->immflag = 1;
786            return;
787         }
788         else
789         {
790            r = cpustate->ram[RAM_ADDR];
791            s = cpustate->inst;
792            dst = RAM;
793            cpustate->immflag = 0;
794         }
795         break;
796      }
797      case TODRR: r = cpustate->d_latch;      s = cpustate->ram[RAM_ADDR];   dst = RAM;   break;
798      default: INVALID;
799   }
800
801   /* Operation */
802   res = tor_op(cpustate, r, s, (inst >> 5) & 0xf);
803
804   /* Destination */
805   switch (dst)
806   {
807      case ACC:   cpustate->acc = res; break;
808      case Y_BUS:   break;
809      case RAM:   cpustate->ram[RAM_ADDR] = res; break;
810      default:   INVALID;
811   }
812
813   cpustate->result = res;
814}
815
816static void tor2(esrip_state *cpustate, UINT16 inst)
817{
818   UINT16 r = 0;
819   UINT16 s = 0;
820   UINT32 res = 0;
821
822   enum
823   {
824      TODAR = 0x1,
825      TOAIR = 0x2,
826      TODIR = 0x5,
827   };
828
829   switch (SRC)
830   {
831      case TODAR: r = cpustate->d_latch;   s = cpustate->acc;   break;
832      case TOAIR:
833      {
834         if (cpustate->immflag == 0)
835         {
836            cpustate->i_latch = inst;
837            cpustate->immflag = 1;
838            return;
839         }
840         else
841         {
842            r = cpustate->acc;
843            s = cpustate->inst;
844            cpustate->immflag = 0;
845         }
846         break;
847      }
848      case TODIR:
849      {
850         if (cpustate->immflag == 0)
851         {
852            cpustate->i_latch = inst;
853            cpustate->immflag = 1;
854            return;
855         }
856         else
857         {
858            r = cpustate->d_latch;
859            s = cpustate->inst;
860            cpustate->immflag = 0;
861         }
862         break;
863      }
864      default: INVALID;
865   }
866
867   /* Operation */
868   res = tor_op(cpustate, r, s, (inst >> 5) & 0xf);
869
870   /* Destination is always RAM */
871   cpustate->ram[RAM_ADDR] = res;
872
873   cpustate->result = res;
874}
875
876static void tonr(esrip_state *cpustate, UINT16 inst)
877{
878   enum
879   {
880      TODA  = 0x1,
881      TOAI  = 0x2,
882      TODI  = 0x5
883   };
884
885   enum
886   {
887      NRY = 0,
888      NRA = 1,
889      NRS = 4,
890      NRAS = 5,
891   };
892
893   UINT16 r = 0;
894   UINT16 s = 0;
895   UINT16   res = 0;
896
897   switch (SRC)
898   {
899      case TODA:
900      {
901         r = cpustate->d_latch;
902         s = cpustate->acc;
903         break;
904      }
905      case TOAI:
906      {
907         break;
908      }
909      case TODI:
910      {
911         if (cpustate->immflag == 0)
912         {
913            cpustate->i_latch = inst;
914            cpustate->immflag = 1;
915            return;
916         }
917         else
918         {
919            r = cpustate->d_latch;
920            s = cpustate->inst;
921            cpustate->immflag = 0;
922         }
923         break;
924      }
925      default: INVALID;
926   }
927
928   /* Operation */
929   res = tor_op(cpustate, r, s, (inst >> 5) & 0xf);
930
931   /* Destination */
932   switch (DST)
933   {
934      case NRY:
935         break;
936      case NRA:
937         cpustate->acc = res;
938         break;
939      case NRS:
940         UNHANDLED;
941         break;
942      case NRAS:
943         UNHANDLED;
944         break;
945      default:
946         INVALID;
947   }
948   cpustate->result = res;
949}
950
951/*************************************
952 *
953 *  Bit operation
954 *
955 *************************************/
956
957static void bonr(esrip_state *cpustate, UINT16 inst)
958{
959   enum
960   {
961      TSTNA  = 0x00,
962      RSTNA  = 0x01,
963      SETNA  = 0x02,
964      A2NA   = 0x04,
965      S2NA   = 0x05,
966      LD2NA  = 0x06,
967      LDC2NA = 0x07,
968      TSTND  = 0x10,
969      RSTND  = 0x11,
970      SETND  = 0x12,
971      A2NDY  = 0x14,
972      S2NDY  = 0x15,
973      LD2NY  = 0x16,
974      LDC2NY = 0x17,
975   };
976
977   UINT16   res = 0;
978
979   switch (inst & 0x1f)
980   {
981      case TSTNA:
982      {
983         res = cpustate->acc & (1 << N);
984         CLEAR_FLAGS(V_FLAG | C_FLAG);
985         calc_n_flag(cpustate, res);
986         calc_z_flag(cpustate, res);
987         break;
988      }
989      case RSTNA:
990      {
991         res = cpustate->acc & ~(1 << N);
992         CLEAR_FLAGS(V_FLAG | C_FLAG);
993         calc_n_flag(cpustate, res);
994         calc_z_flag(cpustate, res);
995         cpustate->acc = res;
996         break;
997      }
998      case SETNA:
999      {
1000         res = cpustate->acc | (1 << N);
1001         CLEAR_FLAGS(V_FLAG | C_FLAG | Z_FLAG);
1002         calc_n_flag(cpustate, res);
1003         cpustate->acc = res;
1004         break;
1005      }
1006      case A2NA:
1007      {
1008         UINT16 r = cpustate->acc;
1009         UINT16 s = 1 << N;
1010         res = r + s;
1011         calc_z_flag(cpustate, res);
1012         calc_n_flag(cpustate, res);
1013         calc_c_flag_add(cpustate, r, s);
1014         calc_v_flag_add(cpustate, r, s, res);
1015         cpustate->acc = res;
1016         break;
1017      }
1018      case S2NA:
1019      {
1020         UINT16 r = cpustate->acc;
1021         UINT16 s = 1 << N;
1022         res = r - s;
1023         calc_z_flag(cpustate, res);
1024         calc_n_flag(cpustate, res);
1025         calc_c_flag_sub(cpustate, r, s);
1026         calc_v_flag_sub(cpustate, r, s, res);
1027         cpustate->acc = res;
1028         break;
1029      }
1030
1031      case TSTND:
1032      {
1033         res = cpustate->d_latch & (1 << N);
1034         CLEAR_FLAGS(V_FLAG | C_FLAG);
1035         calc_n_flag(cpustate, res);
1036         calc_z_flag(cpustate, res);
1037         break;
1038      }
1039
1040      case SETND:
1041      {
1042         UINT16 r = cpustate->d_latch;
1043         res = r | (1 << N);
1044         cpustate->d_latch = res;
1045
1046         CLEAR_FLAGS(V_FLAG | C_FLAG | Z_FLAG);
1047         calc_n_flag(cpustate, res);
1048         break;
1049      }
1050      case LD2NY:
1051      {
1052         res = (1 << N);
1053         CLEAR_FLAGS(V_FLAG | C_FLAG | Z_FLAG);
1054         calc_n_flag(cpustate, res);
1055         break;
1056      }
1057      case LDC2NY:
1058      {
1059         res = (1 << N) ^ 0xffff;
1060         CLEAR_FLAGS(Z_FLAG | C_FLAG | V_FLAG);
1061         calc_n_flag(cpustate, res);
1062         break;
1063      }
1064
1065      case A2NDY:
1066      {
1067         UINT16 r = cpustate->d_latch;
1068         UINT16 s = 1 << N;
1069         res = r + s;
1070
1071         calc_z_flag(cpustate, res);
1072         calc_n_flag(cpustate, res);
1073         calc_c_flag_add(cpustate, r, s);
1074         calc_v_flag_add(cpustate, r, s, res);
1075         break;
1076      }
1077
1078      default:
1079         UNHANDLED;
1080   }
1081
1082   cpustate->result = res;
1083}
1084
1085static void bor1(esrip_state *cpustate, UINT16 inst)
1086{
1087   enum
1088   {
1089      SETNR  = 0xd,
1090      RSTNR  = 0xe,
1091      TSTNR  = 0xf,
1092   };
1093
1094   UINT16   res = 0;
1095
1096   switch ((inst >> 5) & 0xf)
1097   {
1098      case SETNR:
1099      {
1100         res = cpustate->ram[RAM_ADDR] | (1 << N);
1101         cpustate->ram[RAM_ADDR] = res;
1102         CLEAR_FLAGS(V_FLAG | C_FLAG | Z_FLAG);
1103         calc_n_flag(cpustate, res);
1104         break;
1105      }
1106      case RSTNR:
1107      {
1108         res = cpustate->ram[RAM_ADDR] & ~(1 << N);
1109         cpustate->ram[RAM_ADDR] = res;
1110         CLEAR_FLAGS(V_FLAG | C_FLAG);
1111         calc_n_flag(cpustate, res);
1112         calc_z_flag(cpustate, res);
1113         break;
1114      }
1115      case TSTNR:
1116      {
1117         res = cpustate->ram[RAM_ADDR] & (1 << N);
1118         CLEAR_FLAGS(V_FLAG | C_FLAG);
1119         calc_n_flag(cpustate, res);
1120         calc_z_flag(cpustate, res);
1121         break;
1122      }
1123      default: INVALID;
1124   }
1125
1126   cpustate->result = res;
1127}
1128
1129
1130
1131static void bor2(esrip_state *cpustate, UINT16 inst)
1132{
1133   enum
1134   {
1135      LD2NR  = 0xc,
1136      LDC2NR = 0xd,
1137      A2NR   = 0xe,
1138      S2NR   = 0xf,
1139   };
1140
1141   UINT32 res = 0;
1142
1143   switch ((inst >> 5) & 0xf)
1144   {
1145      case LD2NR:
1146      {
1147         res = 1 << N;
1148         CLEAR_FLAGS(V_FLAG | C_FLAG | Z_FLAG);
1149         calc_n_flag(cpustate, res);
1150         break;
1151      }
1152      case LDC2NR:
1153      {
1154         res = (1 << N) ^ 0xffff;
1155         CLEAR_FLAGS(V_FLAG | C_FLAG | Z_FLAG);
1156         calc_n_flag(cpustate, res);
1157         break;
1158      }
1159      case A2NR:
1160      {
1161         UINT16 r = cpustate->ram[RAM_ADDR];
1162         UINT16 s = 1 << N;
1163
1164         res = r + s;
1165         calc_v_flag_add(cpustate, r, s, res);
1166         calc_n_flag(cpustate, res);
1167         calc_c_flag_add(cpustate, r, s);
1168         calc_z_flag(cpustate, res);
1169         break;
1170      }
1171      case S2NR:
1172      {
1173         UINT16 r = cpustate->ram[RAM_ADDR];
1174         UINT16 s = 1 << N;
1175
1176         res = r - s;
1177         calc_v_flag_sub(cpustate, r, s, res);
1178         calc_n_flag(cpustate, res);
1179         calc_c_flag_sub(cpustate, r, s);
1180         calc_z_flag(cpustate, res);
1181         break;
1182      }
1183      default: INVALID;
1184   }
1185
1186   /* Destination is RAM */
1187   cpustate->ram[RAM_ADDR] = res;
1188   cpustate->result = res;
1189}
1190
1191/*************************************
1192 *
1193 *  Rotate
1194 *
1195 *************************************/
1196
1197/* TODO Combine these */
1198static void rotr1(esrip_state *cpustate, UINT16 inst)
1199{
1200   enum
1201   {
1202      RTRA = 0xc,
1203      RTRY = 0xd,
1204      RTRR = 0xf,
1205   };
1206
1207   UINT16   u = 0;
1208   UINT16   dst = 0;
1209   UINT16   res = 0;
1210   int      n = N;
1211
1212   switch ((inst >> 5) & 0xf)
1213   {
1214      case RTRA: u = cpustate->ram[RAM_ADDR];   dst = ACC;      break;
1215      case RTRY: u = cpustate->ram[RAM_ADDR];   dst = Y_BUS;   break;
1216      case RTRR: u = cpustate->ram[RAM_ADDR];   dst = RAM;      break;
1217      default: INVALID;
1218   }
1219
1220   res = (u << n) | (u >> (16 - n));
1221   CLEAR_FLAGS(V_FLAG | C_FLAG);
1222   calc_n_flag(cpustate, res);
1223   calc_z_flag(cpustate, res);
1224
1225   switch (dst)
1226   {
1227      case ACC: cpustate->acc = res; break;
1228      case RAM: cpustate->ram[RAM_ADDR] = res; break;
1229   }
1230
1231   cpustate->result = res;
1232}
1233
1234static void rotr2(esrip_state *cpustate, UINT16 inst)
1235{
1236   enum
1237   {
1238      RTAR = 0,
1239      RTDR = 1,
1240   };
1241
1242   UINT16   u = 0;
1243   UINT16   res = 0;
1244
1245   switch ((inst >> 5) & 0xf)
1246   {
1247      case RTAR: u = cpustate->acc;      break;
1248      case RTDR: u = cpustate->d_latch;   break;
1249      default: INVALID;
1250   }
1251
1252   res = (u << N) | (u >> (16 - N));
1253   CLEAR_FLAGS(V_FLAG | C_FLAG);
1254   calc_n_flag(cpustate, res);
1255   calc_z_flag(cpustate, res);
1256   cpustate->ram[RAM_ADDR] = res;
1257
1258   cpustate->result = res;
1259}
1260
1261static void rotnr(esrip_state *cpustate, UINT16 inst)
1262{
1263   enum
1264   {
1265      RTDY = 0x18,
1266      RTDA = 0x19,
1267      RTAY = 0x1c,
1268      RTAA = 0x1d,
1269   };
1270
1271   UINT16   u = 0;
1272   UINT16   res = 0;
1273   UINT16   dst = 0;
1274
1275   switch (inst & 0x1f)
1276   {
1277      case RTDY: u = cpustate->d_latch;   dst = Y_BUS;   break;
1278      case RTDA: u = cpustate->d_latch;   dst = ACC;      break;
1279      case RTAY: u = cpustate->acc;      dst = Y_BUS;   break;
1280      case RTAA: u = cpustate->acc;      dst = ACC;      break;
1281      default: INVALID;
1282   }
1283
1284   res = (u << N) | (u >> (16 - N));
1285   CLEAR_FLAGS(V_FLAG | C_FLAG);
1286   calc_n_flag(cpustate, res);
1287   calc_z_flag(cpustate, res);
1288
1289   switch (dst)
1290   {
1291      case Y_BUS: break;
1292      case ACC: cpustate->acc = res; break;
1293      case RAM: cpustate->ram[RAM_ADDR] = res; break;
1294      default: UNHANDLED;
1295   }
1296
1297   cpustate->result = res;
1298}
1299
1300/*************************************
1301 *
1302 *  Rotate and compare
1303 *
1304 *************************************/
1305
1306static void rotc(esrip_state *cpustate, UINT16 inst)
1307{
1308   UNHANDLED;
1309}
1310
1311/*************************************
1312 *
1313 *  Rotate and merge
1314 *
1315 *************************************/
1316
1317static void rotm(esrip_state *cpustate, UINT16 inst)
1318{
1319   UNHANDLED;
1320}
1321
1322/*************************************
1323 *
1324 *  Prioritize
1325 *
1326 *************************************/
1327
1328static void prt(esrip_state *cpustate, UINT16 inst)
1329{
1330   UNHANDLED;
1331}
1332
1333static void prtnr(esrip_state *cpustate, UINT16 inst)
1334{
1335   UNHANDLED;
1336}
1337
1338
1339/*************************************
1340 *
1341 *  CRC
1342 *
1343 *************************************/
1344
1345static void crcf(esrip_state *cpustate, UINT16 inst)
1346{
1347   UNHANDLED;
1348}
1349
1350static void crcr(esrip_state *cpustate, UINT16 inst)
1351{
1352   UNHANDLED;
1353}
1354
1355/*************************************
1356 *
1357 *  Single bit shift
1358 *
1359 *************************************/
1360
1361enum
1362{
1363   SHUPZ  = 0,
1364   SHUP1  = 1,
1365   SHUPL  = 2,
1366   SHDNZ  = 4,
1367   SHDN1  = 5,
1368   SHDNL  = 6,
1369   SHDNC  = 7,
1370   SHDNOV = 8,
1371};
1372
1373#define   SET_LINK_flag(cpustate, x)   (cpustate->new_status &= ~L_FLAG); \
1374                     (cpustate->new_status |= x ? L_FLAG : 0)
1375
1376static UINT16 shift_op(esrip_state *cpustate, UINT16 u, int opcode)
1377{
1378   UINT32 res = 0;
1379
1380   switch (opcode)
1381   {
1382      case SHUPZ:
1383      {
1384         res = (u << 1);
1385         SET_LINK_flag(cpustate, u & 0x8000);
1386         CLEAR_FLAGS(V_FLAG | C_FLAG);
1387         calc_n_flag(cpustate, res);
1388         calc_z_flag(cpustate, res);
1389         break;
1390      }
1391      case SHUP1:
1392      {
1393         res = (u << 1) | 1;
1394         SET_LINK_flag(cpustate, u & 0x8000);
1395         CLEAR_FLAGS(V_FLAG | C_FLAG);
1396         calc_n_flag(cpustate, res);
1397         calc_z_flag(cpustate, res);
1398         break;
1399      }
1400      case SHUPL:
1401      {
1402         res = (u << 1) | ((cpustate->status & L_FLAG) ? 1 : 0);
1403         SET_LINK_flag(cpustate, u & 0x8000);
1404         CLEAR_FLAGS(V_FLAG | C_FLAG);
1405         calc_n_flag(cpustate, res);
1406         calc_z_flag(cpustate, res);
1407         break;
1408      }
1409
1410      case SHDNZ:
1411      case SHDN1:
1412      case SHDNL:
1413      case SHDNC:
1414      case SHDNOV:
1415      default: assert(0);
1416   }
1417
1418   return res;
1419}
1420
1421static void shftr(esrip_state *cpustate, UINT16 inst)
1422{
1423   enum
1424   {
1425      SHRR = 6,
1426      SHDR = 7,
1427   };
1428
1429   UINT16   u = 0;
1430   UINT16   res = 0;
1431
1432   switch ((inst >> 9) & 0xf)
1433   {
1434      case SHRR: u = cpustate->ram[RAM_ADDR];   break;
1435      case SHDR: u = cpustate->d_latch;         break;
1436      default: INVALID;
1437   }
1438
1439   res = shift_op(cpustate, u, (inst >> 5) & 0xf);
1440
1441   /* Destination is always RAM */
1442   cpustate->ram[RAM_ADDR] = res;
1443   cpustate->result = res;
1444}
1445
1446static void shftnr(esrip_state *cpustate, UINT16 inst)
1447{
1448   enum
1449   {
1450      SHA = 6,
1451      SHD = 7,
1452   };
1453
1454   UINT16   u = 0;
1455   UINT16   res = 0;
1456
1457   switch ((inst >> 9) & 0xf)
1458   {
1459      case SHA: u = cpustate->acc;         break;
1460      case SHD: u = cpustate->d_latch;      break;
1461      default: INVALID;
1462   }
1463
1464   res = shift_op(cpustate, u, (inst >> 5) & 0xf);
1465
1466   switch (DST)
1467   {
1468      case NRY:   break;
1469      case NRA:   cpustate->acc = res; break;
1470      default:   INVALID;
1471   }
1472   cpustate->result = res;
1473}
1474
1475
1476/*************************************
1477 *
1478 *  Status
1479 *
1480 *************************************/
1481
1482static void svstr(esrip_state *cpustate, UINT16 inst)
1483{
1484   UNHANDLED;
1485}
1486
1487static void rstst(esrip_state *cpustate, UINT16 inst)
1488{
1489   enum
1490   {
1491      RONCZ = 0x3,
1492      RL    = 0x5,
1493      RF1   = 0x6,
1494      RF2   = 0x9,
1495      RF3   = 0xa,
1496   };
1497
1498   switch (inst & 0x1f)
1499   {
1500      case RONCZ: CLEAR_FLAGS(V_FLAG | N_FLAG | C_FLAG | Z_FLAG); break;
1501      case RL:   CLEAR_FLAGS(L_FLAG); break;
1502      case RF1:   CLEAR_FLAGS(FLAG_1); break;
1503      case RF2:   CLEAR_FLAGS(FLAG_2); break;
1504      case RF3:   CLEAR_FLAGS(FLAG_3); break;
1505   }
1506
1507   cpustate->result = 0;
1508}
1509
1510static void setst(esrip_state *cpustate, UINT16 inst)
1511{
1512   enum
1513   {
1514      SONCZ = 0x3,
1515      SL    = 0x5,
1516      SF1   = 0x6,
1517      SF2   = 0x9,
1518      SF3   = 0xa,
1519   };
1520
1521   switch (inst & 0x1f)
1522   {
1523      case SONCZ: SET_FLAGS(V_FLAG | N_FLAG | C_FLAG | Z_FLAG); break;
1524      case SL:   SET_FLAGS(L_FLAG); break;
1525      case SF1:   SET_FLAGS(FLAG_1); break;
1526      case SF2:   SET_FLAGS(FLAG_2); break;
1527      case SF3:   SET_FLAGS(FLAG_3); break;
1528   }
1529
1530   cpustate->result = 0xffff;
1531}
1532
1533static void test(esrip_state *cpustate, UINT16 inst)
1534{
1535   enum
1536   {
1537      TNOZ = 0x00,
1538      TNO  = 0x02,
1539      TZ   = 0x04,
1540      TOVR = 0x06,
1541      TLOW = 0x08,
1542      TC   = 0x0a,
1543      TZC  = 0x0c,
1544      TN   = 0x0e,
1545      TL   = 0x10,
1546      TF1  = 0x12,
1547      TF2  = 0x14,
1548      TF3  = 0x16
1549   };
1550
1551   UINT32 res = 0;
1552
1553   switch (inst & 0x1f)
1554   {
1555      case TNOZ: UNHANDLED; break;
1556      case TNO:  UNHANDLED; break;
1557      case TZ:   res = cpustate->status & (Z_FLAG); break;
1558      case TOVR: res = cpustate->status & (V_FLAG); break;
1559      case TLOW: UNHANDLED; break;
1560      case TC:   res = cpustate->status & (C_FLAG); break;
1561      case TZC:  UNHANDLED; break;
1562      case TN:   res = cpustate->status & (N_FLAG); break;
1563      case TL:   res = cpustate->status & (L_FLAG); break;
1564      case TF1:  res = cpustate->status & (FLAG_1); break;
1565      case TF2:  res = cpustate->status & (FLAG_2); break;
1566      case TF3:  res = cpustate->status & (FLAG_3); break;
1567      default:   INVALID;
1568   }
1569
1570   cpustate->ct = res && 1;
1571}
1572
1573
1574/*************************************
1575 *
1576 *  No operation
1577 *
1578 *************************************/
1579
1580static void nop(esrip_state *cpustate, UINT16 inst)
1581{
1582   cpustate->result = 0xff;   // Undefined
1583}
1584
1585static void (*const operations[24])(esrip_state *cpustate, UINT16 inst) =
1586{
1587   rotr1, tor1, rotr2, rotc, rotm, bor2, crcf, crcr,
1588   svstr, prt, sor, tor2, shftr, test, nop, setst, rstst,
1589   rotnr, bonr, bor1, sonr, shftnr, prtnr, tonr
1590};
1591
1592INLINE void am29116_execute(esrip_state *cpustate, UINT16 inst, int _sre)
1593{
1594   /* Status register shadow */
1595   cpustate->new_status = cpustate->status;
1596
1597   /* Required for immediate source instructions */
1598   cpustate->inst = inst;
1599
1600   if (cpustate->immflag == 1)
1601      inst = cpustate->i_latch;
1602
1603   (*operations[cpustate->optable[inst]])(cpustate, inst);
1604
1605   if (!_sre)
1606   {
1607      cpustate->status = cpustate->new_status;
1608      cpustate->t = cpustate->status;
1609   }
1610}
1611
1612
1613static CPU_EXECUTE( esrip )
1614{
1615   esrip_state *cpustate = device->token;
1616   int calldebugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
1617   UINT16 status = cpustate->status_in(device->machine);
1618
1619   cpustate->icount = cycles;
1620
1621   /* Core execution loop */
1622   do
1623   {
1624      UINT64   inst;
1625      UINT8   next_pc;
1626      UINT16   x_bus = 0;
1627      UINT16   ipt_bus = 0;
1628      UINT16   y_bus = 0;
1629
1630      int yoe = _BIT(cpustate->l5, 1);
1631      int bl46 = BIT(cpustate->l4, 6);
1632      int bl44 = BIT(cpustate->l4, 4);
1633
1634      UINT32 in_h;
1635      UINT32 in_l;
1636
1637      if (cpustate->fig_cycles)
1638      {
1639         if(--cpustate->fig_cycles == 0)
1640            cpustate->fig = 0;
1641      }
1642
1643      /* /OEY = 1 : Y-bus is high imped */
1644      if (yoe)
1645      {
1646         /* Status In */
1647         if (!_BIT(cpustate->l2, 0))
1648            y_bus = status | (!cpustate->fig << 3);
1649
1650         /* FDT RAM: /Enable, Direction and /RAM OE */
1651         else if (!bl44 && !_BIT(cpustate->l2, 3) && bl46)
1652            y_bus = cpustate->fdt_r(device, cpustate->fdt_cnt, 0);
1653
1654         /* IPT RAM: /Enable and /READ */
1655         else if (!_BIT(cpustate->l2, 6) && !_BIT(cpustate->l4, 5))
1656            y_bus = cpustate->ipt_ram[cpustate->ipt_cnt];
1657
1658         /* DLE  - latch the value on the Y-BUS into the data latch */
1659         if (_BIT(cpustate->l5, 0))
1660            cpustate->d_latch = y_bus;
1661
1662         /* Now execute the AM29116 instruction */
1663         am29116_execute(cpustate, (cpustate->l7 << 8) | cpustate->l6, BIT(cpustate->l5, 2));
1664      }
1665      else
1666      {
1667         am29116_execute(cpustate, (cpustate->l7 << 8) | cpustate->l6, BIT(cpustate->l5, 2));
1668
1669         y_bus = cpustate->result;
1670
1671         if (BIT(cpustate->l5, 0))
1672            cpustate->d_latch = y_bus;
1673      }
1674
1675      /* Determine what value is on the X-Bus */
1676
1677      /* FDT RAM */
1678      if (!bl44)
1679         x_bus = cpustate->fdt_r(device, cpustate->fdt_cnt, 0);
1680
1681      /* Buffer is enabled - write direction */
1682      else if (!BIT(cpustate->l2, 3) && !bl46)
1683      {
1684         if (!yoe)
1685            x_bus = y_bus;
1686         else if ( !BIT(cpustate->l2, 6) && !BIT(cpustate->l4, 5) )
1687            x_bus = cpustate->ipt_ram[cpustate->ipt_cnt];
1688      }
1689
1690      /* IPT BUS */
1691      if (!BIT(cpustate->l2, 6))
1692         ipt_bus = cpustate->ipt_ram[cpustate->ipt_cnt];
1693      else if (!BIT(cpustate->l4, 5))
1694      {
1695         if (!BIT(cpustate->l5, 1))
1696            ipt_bus = y_bus;
1697         else
1698            ipt_bus = x_bus;
1699      }
1700
1701
1702      /* Write FDT RAM: /Enable, Direction and WRITE */
1703      if (!BIT(cpustate->l2, 3) && !bl46 && !BIT(cpustate->l4, 3))
1704         cpustate->fdt_w(device, cpustate->fdt_cnt, x_bus, 0);
1705
1706      /* Write IPT RAM: /Enable and /WR */
1707      if (!BIT(cpustate->l2, 7) && !BIT(cpustate->l4, 5))
1708         cpustate->ipt_ram[cpustate->ipt_cnt] = ipt_bus;
1709
1710
1711      if ((((cpustate->l5 >> 3) & 0x1f) & 0x18) != 0x18)
1712      {
1713         if ( check_jmp(cpustate, device->machine, (cpustate->l5 >> 3) & 0x1f) )
1714            next_pc = cpustate->l1;
1715         else
1716            next_pc = cpustate->pc + 1;
1717      }
1718      else
1719         next_pc = cpustate->pc + 1;
1720
1721      cpustate->pl1 = cpustate->l1;
1722      cpustate->pl2 = cpustate->l2;
1723      cpustate->pl3 = cpustate->l3;
1724      cpustate->pl4 = cpustate->l4;
1725      cpustate->pl5 = cpustate->l5;
1726      cpustate->pl6 = cpustate->l6;
1727      cpustate->pl7 = cpustate->l7;
1728
1729      /* Latch instruction */
1730      inst = memory_decrypted_read_qword(cpustate->program, RIP_PC << 3);
1731
1732      in_h = inst >> 32;
1733      in_l = inst & 0xffffffff;
1734
1735      cpustate->l1 = (in_l >> 8);
1736      cpustate->l2 = (in_l >> 16);
1737      cpustate->l3 = (in_l >> 24);
1738
1739      cpustate->l4 = (in_h >> 0);
1740      cpustate->l5 = (in_h >> 8);
1741      cpustate->l6 = (in_h >> 16);
1742      cpustate->l7 = (in_h >> 24);
1743
1744//      if (RISING_EDGE(cpustate->pl7, cpustate->l2, 7))
1745
1746      /* Colour latch */
1747      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 0))
1748         cpustate->c_latch = (x_bus >> 12) & 0xf;
1749
1750      /* Right pixel line buffer address */
1751      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 1))
1752         cpustate->adr_latch = x_bus & 0xfff;
1753
1754      /* Left pixel line buffer address */
1755      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 2))
1756         cpustate->adl_latch = x_bus & 0xfff;
1757
1758      /* FIGLD: Start the DMA */
1759      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 3))
1760      {
1761         cpustate->attr_latch = x_bus;
1762
1763         cpustate->fig = 1;
1764         cpustate->fig_cycles = cpustate->draw(device->machine, cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr, cpustate->c_latch, cpustate->x_scale, cpustate->line_latch);
1765      }
1766
1767      /* X-scale */
1768      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 4))
1769         cpustate->x_scale = x_bus >> 8;
1770
1771      /* Y-scale. Something else uses this too? */
1772      if (RISING_EDGE(cpustate->pl4, cpustate->l4, 2))
1773         cpustate->y_scale = x_bus & 0xff;
1774
1775      /* Unknown */
1776//      if (RISING_EDGE(cpustate->pl4, cpustate->l4, 7))
1777
1778      /* Image ROM address */
1779      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 5))
1780         cpustate->iaddr = y_bus;
1781
1782      /* IXLLD */
1783      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 6))
1784      {
1785         cpustate->line_latch = ipt_bus >> 10;
1786         cpustate->fig_latch  = ipt_bus & 0x3ff;
1787      }
1788
1789      /* Status write */
1790      if (RISING_EDGE(cpustate->pl3, cpustate->l3, 7))
1791         cpustate->status_out = y_bus & 0xff;
1792
1793      /* FDT address counter */
1794      if (!BIT(cpustate->pl2, 1))
1795         cpustate->fdt_cnt = y_bus & 0xfff;
1796      else if (BIT(cpustate->pl2, 2))
1797         cpustate->fdt_cnt = (cpustate->fdt_cnt + 1) & 0xfff;
1798
1799      /* Now we can alter the IPT address counter */
1800      if (!BIT(cpustate->pl2, 4))
1801         cpustate->ipt_cnt = y_bus & 0x1fff;
1802      else if (BIT(cpustate->pl2, 5))
1803         cpustate->ipt_cnt = (cpustate->ipt_cnt + 1) & 0x1fff;
1804
1805      if (calldebugger)
1806         debugger_instruction_hook(device, RIP_PC);
1807
1808      cpustate->pc = next_pc;
1809
1810      cpustate->icount--;
1811   } while (cpustate->icount > 0);
1812
1813   return cycles - cpustate->icount;
1814}
1815
1816
1817/***************************************************************************
1818    DISASSEMBLY HOOK
1819***************************************************************************/
1820
1821static CPU_DISASSEMBLE( esrip )
1822{
1823#if 0
1824   static const char* const jmp_types[] =
1825   {
1826      "JCT",
1827      "JT1",
1828      "JT2",
1829      "JT3",
1830      "JT4",
1831      "JLBRM",
1832      "J#HBLANK",
1833      "JMP",
1834   };
1835
1836   static const char* const njmp_types[] =
1837   {
1838      "JNCT",
1839      "JNT1",
1840      "JNT2",
1841      "JNT3",
1842      "JNT4",
1843      "JNLBRM",
1844      "J#HBLANK",
1845      "  ",
1846   };
1847#endif
1848
1849   UINT64 inst = BIG_ENDIANIZE_INT64(*(UINT64 *)oprom);
1850
1851   UINT32 inst_hi = inst >> 32;
1852   UINT32 inst_lo = inst & 0xffffffff;
1853
1854   UINT16 ins = (inst_hi >> 16) & 0xffff;
1855   UINT8  ctrl = (inst_hi >> 8) & 0xff;
1856   UINT8  jmp_dest = (inst_lo >> 8) & 0xff;
1857
1858   UINT8 jmp_ctrl = (ctrl >> 3) & 0x1f;
1859
1860   UINT8 ctrl1 = (inst_lo >> 16) & 0xff;
1861   UINT8 ctrl2 = (inst_lo >> 24) & 0xff;
1862   UINT8 ctrl3 = (inst_hi) & 0xff;
1863
1864   sprintf(buffer, "%.4x %c%c%c%c %.2x %s%s%s%s%s%s%s%s %c%s%s%s %c%c%c%c%c%c%c%c\n",
1865      ins,
1866      ctrl & 1 ? 'D' : ' ',
1867      ctrl & 2 ? ' ' : 'Y',
1868      ctrl & 4 ? 'S' : ' ',
1869      (~jmp_ctrl & 0x18) ? 'J' : ' ',
1870      jmp_dest,
1871      ctrl1 & 0x01 ? "  " : "I ",
1872      ctrl1 & 0x02 ? "  " : "FL",
1873      ctrl1 & 0x04 ? "FE" : "  ",
1874      ctrl1 & 0x08 ? "  " : "FR",
1875      ctrl1 & 0x10 ? "  " : "IL",
1876      ctrl1 & 0x20 ? "IE" : "  ",
1877      ctrl1 & 0x40 ? "  " : "IR",
1878      ctrl1 & 0x80 ? "  " : "IW",
1879
1880      ctrl2 & 0x80 ? ' ' : 'O',
1881      ctrl2 & 0x40 ? "     " : "IXLLD",
1882      ctrl2 & 0x20 ? "     " : "IADLD",
1883      ctrl2 & 0x10 ? "     " : "SCALD",
1884
1885      ctrl3 & 0x01 ? ' ' : '0',
1886      ctrl3 & 0x02 ? ' ' : '1',
1887      ctrl3 & 0x04 ? ' ' : '2',
1888      ctrl3 & 0x08 ? ' ' : '3',
1889      ctrl3 & 0x10 ? ' ' : '4',
1890      ctrl3 & 0x20 ? ' ' : '5',
1891      ctrl3 & 0x40 ? ' ' : '6',
1892      ctrl3 & 0x80 ? ' ' : '7'
1893      );
1894
1895   return 1 | DASMFLAG_SUPPORTED;
1896}
1897
1898/**************************************************************************
1899 * set_info
1900 **************************************************************************/
1901
1902CPU_SET_INFO( esrip )
1903{
1904   esrip_state *cpustate = device->token;
1905
1906   switch (state)
1907   {
1908      /* --- the following bits of info are set as 64-bit signed integers --- */
1909      case CPUINFO_INT_PC:
1910      case CPUINFO_INT_REGISTER + ESRIP_PC:   cpustate->pc = info->i & 0xff;
1911                                    cpustate->status_out &= ~1;
1912                                    cpustate->status_out |= ((info->i >> 8) & 1);
1913                                    break;
1914   }
1915}
1916
1917/**************************************************************************
1918 * get_info
1919 **************************************************************************/
1920
1921CPU_GET_INFO( esrip )
1922{
1923   esrip_state *cpustate = device->token;
1924
1925   switch (state)
1926   {
1927      /* --- the following bits of info are returned as 64-bit signed integers --- */
1928      case CPUINFO_INT_CONTEXT_SIZE:               info->i = sizeof(esrip_state);   break;
1929      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_BIG;      break;
1930      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;               break;
1931      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;               break;
1932      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 8;               break;
1933      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 8;               break;
1934      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;               break;
1935      case CPUINFO_INT_MAX_CYCLES:               info->i = 1;               break;
1936
1937      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_PROGRAM:   info->i = 64;         break;
1938      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_PROGRAM: info->i = 9;         break;
1939      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_PROGRAM: info->i = -3;         break;
1940      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_DATA:   info->i = 0;         break;
1941      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_DATA:    info->i = 0;         break;
1942      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_DATA:    info->i = 0;         break;
1943      case CPUINFO_INT_DATABUS_WIDTH + ADDRESS_SPACE_IO:      info->i = 0;         break;
1944      case CPUINFO_INT_ADDRBUS_WIDTH + ADDRESS_SPACE_IO:       info->i = 0;         break;
1945      case CPUINFO_INT_ADDRBUS_SHIFT + ADDRESS_SPACE_IO:       info->i = 0;         break;
1946
1947      case CPUINFO_INT_REGISTER:
1948      case CPUINFO_INT_PC:                     info->i = RIP_PC;   break;
1949      case CPUINFO_INT_REGISTER + ESRIP_STATW:      info->i = cpustate->status_out; break;
1950      case CPUINFO_INT_REGISTER + ESRIP_FDTC:         info->i = cpustate->fdt_cnt; break;
1951      case CPUINFO_INT_REGISTER + ESRIP_IPTC:         info->i = cpustate->ipt_cnt; break;
1952
1953      /* --- the following bits of info are returned as pointers to data or functions --- */
1954      case CPUINFO_FCT_SET_INFO:                  info->setinfo = CPU_SET_INFO_NAME(esrip);      break;
1955      case CPUINFO_FCT_INIT:                     info->init = CPU_INIT_NAME(esrip);         break;
1956      case CPUINFO_FCT_RESET:                     info->reset = CPU_RESET_NAME(esrip);         break;
1957      case CPUINFO_FCT_EXIT:                     info->exit = CPU_EXIT_NAME(esrip);         break;
1958      case CPUINFO_FCT_EXECUTE:                  info->execute = CPU_EXECUTE_NAME(esrip);      break;
1959      case CPUINFO_FCT_BURN:                     info->burn = NULL;                  break;
1960      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(esrip);      break;
1961      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;      break;
1962
1963      /* --- the following bits of info are returned as NULL-terminated strings --- */
1964      case CPUINFO_STR_NAME:                     strcpy(info->s, "Real Time Image Processor");      break;
1965      case CPUINFO_STR_CORE_FAMILY:               strcpy(info->s, "Entertainment Sciences");         break;
1966      case CPUINFO_STR_CORE_VERSION:               strcpy(info->s, "1.0");               break;
1967      case CPUINFO_STR_CORE_FILE:                  strcpy(info->s, __FILE__);            break;
1968      case CPUINFO_STR_CORE_CREDITS:               strcpy(info->s, "Copyright Philip J Bennett"); break;
1969
1970      case CPUINFO_STR_FLAGS:                     sprintf(info->s, "%c%c%c%c%c%c%c%c%c",
1971                                                      cpustate->status & 0x80 ? '3' : '.',
1972                                                      cpustate->status & 0x40 ? '2' : '.',
1973                                                      cpustate->status & 0x20 ? '1' : '.',
1974                                                      cpustate->status & 0x10 ? 'L' : '.',
1975                                                      cpustate->status & 0x08 ? 'V' : '.',
1976                                                      cpustate->status & 0x04 ? 'N' : '.',
1977                                                      cpustate->status & 0x02 ? 'C' : '.',
1978                                                      cpustate->status & 0x01 ? 'Z' : '.',
1979                                                      get_hblank(device->machine) ? 'H' : '.'); break;
1980
1981      case CPUINFO_STR_REGISTER + ESRIP_PC:         sprintf(info->s, "PC: %04X", RIP_PC); break;
1982      case CPUINFO_STR_REGISTER + ESRIP_ACC:         sprintf(info->s, "ACC: %04X", cpustate->acc); break;
1983      case CPUINFO_STR_REGISTER + ESRIP_DLATCH:      sprintf(info->s, "DLATCH: %04X", cpustate->d_latch); break;
1984      case CPUINFO_STR_REGISTER + ESRIP_ILATCH:      sprintf(info->s, "ILATCH: %04X", cpustate->i_latch); break;
1985      case CPUINFO_STR_REGISTER + ESRIP_RAM00:      sprintf(info->s, "RAM[00]: %04X", cpustate->ram[0x00]); break;
1986      case CPUINFO_STR_REGISTER + ESRIP_RAM01:      sprintf(info->s, "RAM[01]: %04X", cpustate->ram[0x01]); break;
1987      case CPUINFO_STR_REGISTER + ESRIP_RAM02:      sprintf(info->s, "RAM[02]: %04X", cpustate->ram[0x02]); break;
1988      case CPUINFO_STR_REGISTER + ESRIP_RAM03:      sprintf(info->s, "RAM[03]: %04X", cpustate->ram[0x03]); break;
1989      case CPUINFO_STR_REGISTER + ESRIP_RAM04:      sprintf(info->s, "RAM[04]: %04X", cpustate->ram[0x04]); break;
1990      case CPUINFO_STR_REGISTER + ESRIP_RAM05:      sprintf(info->s, "RAM[05]: %04X", cpustate->ram[0x05]); break;
1991      case CPUINFO_STR_REGISTER + ESRIP_RAM06:      sprintf(info->s, "RAM[06]: %04X", cpustate->ram[0x06]); break;
1992      case CPUINFO_STR_REGISTER + ESRIP_RAM07:      sprintf(info->s, "RAM[07]: %04X", cpustate->ram[0x07]); break;
1993      case CPUINFO_STR_REGISTER + ESRIP_RAM08:      sprintf(info->s, "RAM[08]: %04X", cpustate->ram[0x08]); break;
1994      case CPUINFO_STR_REGISTER + ESRIP_RAM09:      sprintf(info->s, "RAM[09]: %04X", cpustate->ram[0x09]); break;
1995      case CPUINFO_STR_REGISTER + ESRIP_RAM0A:      sprintf(info->s, "RAM[0A]: %04X", cpustate->ram[0x0a]); break;
1996      case CPUINFO_STR_REGISTER + ESRIP_RAM0B:      sprintf(info->s, "RAM[0B]: %04X", cpustate->ram[0x0b]); break;
1997      case CPUINFO_STR_REGISTER + ESRIP_RAM0C:      sprintf(info->s, "RAM[0C]: %04X", cpustate->ram[0x0c]); break;
1998      case CPUINFO_STR_REGISTER + ESRIP_RAM0D:      sprintf(info->s, "RAM[0D]: %04X", cpustate->ram[0x0d]); break;
1999      case CPUINFO_STR_REGISTER + ESRIP_RAM0E:      sprintf(info->s, "RAM[0E]: %04X", cpustate->ram[0x0e]); break;
2000      case CPUINFO_STR_REGISTER + ESRIP_RAM0F:      sprintf(info->s, "RAM[0F]: %04X", cpustate->ram[0x0f]); break;
2001      case CPUINFO_STR_REGISTER + ESRIP_RAM10:      sprintf(info->s, "RAM[10]: %04X", cpustate->ram[0x10]); break;
2002      case CPUINFO_STR_REGISTER + ESRIP_RAM11:      sprintf(info->s, "RAM[11]: %04X", cpustate->ram[0x11]); break;
2003      case CPUINFO_STR_REGISTER + ESRIP_RAM12:      sprintf(info->s, "RAM[12]: %04X", cpustate->ram[0x12]); break;
2004      case CPUINFO_STR_REGISTER + ESRIP_RAM13:      sprintf(info->s, "RAM[13]: %04X", cpustate->ram[0x13]); break;
2005      case CPUINFO_STR_REGISTER + ESRIP_RAM14:      sprintf(info->s, "RAM[14]: %04X", cpustate->ram[0x14]); break;
2006      case CPUINFO_STR_REGISTER + ESRIP_RAM15:      sprintf(info->s, "RAM[15]: %04X", cpustate->ram[0x15]); break;
2007      case CPUINFO_STR_REGISTER + ESRIP_RAM16:      sprintf(info->s, "RAM[16]: %04X", cpustate->ram[0x16]); break;
2008      case CPUINFO_STR_REGISTER + ESRIP_RAM17:      sprintf(info->s, "RAM[17]: %04X", cpustate->ram[0x17]); break;
2009      case CPUINFO_STR_REGISTER + ESRIP_RAM18:      sprintf(info->s, "RAM[18]: %04X", cpustate->ram[0x18]); break;
2010      case CPUINFO_STR_REGISTER + ESRIP_RAM19:      sprintf(info->s, "RAM[19]: %04X", cpustate->ram[0x19]); break;
2011      case CPUINFO_STR_REGISTER + ESRIP_RAM1A:      sprintf(info->s, "RAM[1A]: %04X", cpustate->ram[0x1a]); break;
2012      case CPUINFO_STR_REGISTER + ESRIP_RAM1B:      sprintf(info->s, "RAM[1B]: %04X", cpustate->ram[0x1b]); break;
2013      case CPUINFO_STR_REGISTER + ESRIP_RAM1C:      sprintf(info->s, "RAM[1C]: %04X", cpustate->ram[0x1c]); break;
2014      case CPUINFO_STR_REGISTER + ESRIP_RAM1D:      sprintf(info->s, "RAM[1D]: %04X", cpustate->ram[0x1d]); break;
2015      case CPUINFO_STR_REGISTER + ESRIP_RAM1E:      sprintf(info->s, "RAM[1E]: %04X", cpustate->ram[0x1e]); break;
2016      case CPUINFO_STR_REGISTER + ESRIP_RAM1F:      sprintf(info->s, "RAM[1F]: %04X", cpustate->ram[0x1f]); break;
2017      case CPUINFO_STR_REGISTER + ESRIP_STATW:      sprintf(info->s, "STAT: %04X", cpustate->status_out); break;
2018      case CPUINFO_STR_REGISTER + ESRIP_FDTC:         sprintf(info->s, "FDTC: %04X", cpustate->fdt_cnt); break;
2019      case CPUINFO_STR_REGISTER + ESRIP_IPTC:         sprintf(info->s, "IPTC: %04X", cpustate->ipt_cnt); break;
2020      case CPUINFO_STR_REGISTER + ESRIP_XSCALE:      sprintf(info->s, "XSCL: %04X", cpustate->x_scale); break;
2021      case CPUINFO_STR_REGISTER + ESRIP_YSCALE:      sprintf(info->s, "YSCL: %04X", cpustate->y_scale); break;
2022      case CPUINFO_STR_REGISTER + ESRIP_LINE:         sprintf(info->s, "LINE: %04X", cpustate->line_latch); break;
2023      case CPUINFO_STR_REGISTER + ESRIP_FIG:         sprintf(info->s, "FIG: %04X", cpustate->fig_latch); break;
2024      case CPUINFO_STR_REGISTER + ESRIP_ATTR:         sprintf(info->s, "ATTR: %04X", cpustate->attr_latch); break;
2025      case CPUINFO_STR_REGISTER + ESRIP_ADRL:         sprintf(info->s, "ADRL: %04X", cpustate->adl_latch); break;
2026      case CPUINFO_STR_REGISTER + ESRIP_ADRR:         sprintf(info->s, "ADRR: %04X", cpustate->adr_latch); break;
2027      case CPUINFO_STR_REGISTER + ESRIP_COLR:         sprintf(info->s, "COLR: %04X", cpustate->c_latch); break;
2028      case CPUINFO_STR_REGISTER + ESRIP_IADDR:      sprintf(info->s, "IADR: %04X", cpustate->iaddr); break;
2029   }
2030}
src/emu/cpu/esrip/esrip.h
r0r4058
1/***************************************************************************
2
3    esrip.h
4    Interface file for the Entertainment Sciences RIP
5    Written by Phil Bennett
6
7***************************************************************************/
8
9#ifndef _ESRIP_H
10#define _ESRIP_H
11
12#include "cpuintrf.h"
13
14
15/***************************************************************************
16    COMPILE-TIME DEFINITIONS
17***************************************************************************/
18
19
20/***************************************************************************
21    GLOBAL CONSTANTS
22***************************************************************************/
23
24
25/***************************************************************************
26    REGISTER ENUMERATION
27***************************************************************************/
28
29enum
30{
31   ESRIP_PC = 1,
32   ESRIP_ACC,
33   ESRIP_DLATCH,
34   ESRIP_ILATCH,
35   ESRIP_RAM00,
36   ESRIP_RAM01,
37   ESRIP_RAM02,
38   ESRIP_RAM03,
39   ESRIP_RAM04,
40   ESRIP_RAM05,
41   ESRIP_RAM06,
42   ESRIP_RAM07,
43   ESRIP_RAM08,
44   ESRIP_RAM09,
45   ESRIP_RAM0A,
46   ESRIP_RAM0B,
47   ESRIP_RAM0C,
48   ESRIP_RAM0D,
49   ESRIP_RAM0E,
50   ESRIP_RAM0F,
51   ESRIP_RAM10,
52   ESRIP_RAM11,
53   ESRIP_RAM12,
54   ESRIP_RAM13,
55   ESRIP_RAM14,
56   ESRIP_RAM15,
57   ESRIP_RAM16,
58   ESRIP_RAM17,
59   ESRIP_RAM18,
60   ESRIP_RAM19,
61   ESRIP_RAM1A,
62   ESRIP_RAM1B,
63   ESRIP_RAM1C,
64   ESRIP_RAM1D,
65   ESRIP_RAM1E,
66   ESRIP_RAM1F,
67   ESRIP_STATW,
68   ESRIP_FDTC,
69   ESRIP_IPTC,
70   ESRIP_XSCALE,
71   ESRIP_YSCALE,
72   ESRIP_LINE,
73   ESRIP_FIG,
74   ESRIP_ATTR,
75   ESRIP_ADRL,
76   ESRIP_ADRR,
77   ESRIP_COLR,
78   ESRIP_IADDR,
79};
80
81/***************************************************************************
82    CONFIGURATION STRUCTURE
83***************************************************************************/
84typedef struct _esrip_config_ esrip_config;
85struct _esrip_config_
86{
87   read16_device_func   fdt_r;
88   write16_device_func   fdt_w;
89   UINT8 (*status_in)(running_machine *machine);
90   int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int line_latch);
91   const char* const lbrm_prom;
92};
93
94/***************************************************************************
95    PUBLIC FUNCTIONS
96***************************************************************************/
97
98CPU_GET_INFO( esrip );
99
100#define CPU_ESRIP CPU_GET_INFO_NAME( esrip )
101
102extern UINT8 get_rip_status(const device_config *cpu);
103
104#endif /* _ESRIP_H */
src/emu/cpu/asap/asap.c
r4057r4058
429429      asap->src2val[i] = i;
430430   asap->irq_callback = irqcallback;
431431   asap->device = device;
432   asap->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
432   asap->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
433433}
434434
435435static CPU_RESET( asap )
src/emu/cpu/i960/i960.c
r4057r4058
19511951
19521952   i960->icount = cycles;
19531953   check_irqs(i960);
1954   while(i960->icount >= 0) {
1954   while(i960->icount > 0) {
19551955      i960->PIP = i960->IP;
19561956      debugger_instruction_hook(device, i960->IP);
19571957
src/emu/cpu/v810/v810.c
r4057r4058
10181018   v810_state *cpustate = device->token;
10191019
10201020   cpustate->icount = cycles;
1021   while(cpustate->icount>=0)
1021   while(cpustate->icount>0)
10221022   {
10231023      UINT32 op;
10241024
src/emu/cpu/arm7/arm7.c
r4057r4058
8181
8282   cpustate->irq_callback = irqcallback;
8383   cpustate->device = device;
84   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
84   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
8585
8686#if TEST_COPROC_FUNCS
8787   // setup co-proc callbacks example
src/emu/cpu/m6800/m6800.c
r4057r4058
886886{
887887   m6800_state *cpustate = device->token;
888888
889   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
890   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
891   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
889   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
890   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
891   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
892892
893893   //  cpustate->subtype   = SUBTYPE_M6800;
894894   cpustate->insn = m6800_insn;
r4057r4058
12831283   cpustate->irq_callback = irqcallback;
12841284   cpustate->device = device;
12851285
1286   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
1287   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
1288   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
1286   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
1287   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
1288   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
12891289
12901290   cpustate->clock = device->clock / 4;
12911291   cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate);
r4057r4058
13081308   cpustate->irq_callback = irqcallback;
13091309   cpustate->device = device;
13101310
1311   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
1312   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
1313   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
1311   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
1312   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
1313   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
13141314
13151315   state_register(cpustate, "m6802");
13161316}
r4057r4058
13291329   cpustate->irq_callback = irqcallback;
13301330   cpustate->device = device;
13311331
1332   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
1333   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
1334   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
1332   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
1333   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
1334   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
13351335
13361336   cpustate->clock = device->clock / 4;
13371337   cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate);
r4057r4058
16691669   cpustate->irq_callback = irqcallback;
16701670   cpustate->device = device;
16711671
1672   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
1673   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
1674   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
1672   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
1673   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
1674   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
16751675
16761676   state_register(cpustate, "m6808");
16771677}
r4057r4058
16911691   cpustate->irq_callback = irqcallback;
16921692   cpustate->device = device;
16931693
1694   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
1695   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
1696   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
1694   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
1695   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
1696   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
16971697
16981698   cpustate->clock = device->clock / 4;
16991699   cpustate->m6800_rx_timer = timer_alloc(device->machine, m6800_rx_tick, cpustate);
r4057r4058
20412041   //  cpustate->subtype = SUBTYPE_NSC8105;
20422042   cpustate->device = device;
20432043
2044   cpustate->program = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
2045   cpustate->data = cpu_get_address_space(device, ADDRESS_SPACE_DATA);
2046   cpustate->io = cpu_get_address_space(device, ADDRESS_SPACE_IO);
2044   cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
2045   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
2046   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
20472047
20482048   cpustate->insn = nsc8105_insn;
20492049   cpustate->cycles = cycles_nsc8105;
src/emu/cpu/cp1610/cp1610.h
r4057r4058
3131};
3232
3333#define CP1610_INT_NONE      0
34#define CP1610_INT_INTRM   1            /* Maskable */
34#define CP1610_INT_INTRM   1               /* Maskable */
3535#define CP1610_RESET      INPUT_LINE_RESET   /* Non-Maskable */
36#define CP1610_INT_INTR      INPUT_LINE_NMI   /* Non-Maskable */
36#define CP1610_INT_INTR      INPUT_LINE_NMI      /* Non-Maskable */
3737
3838
3939CPU_GET_INFO( cp1610 );
src/emu/memconv.h
r4057r4058
566566WRITE##bits##_HANDLER( name##_w )                        \
567567{                                                \
568568   if (cond)                                       \
569      return func(handler, space, offset, data, mem_mask);   \
569      func(handler, space, offset, data, mem_mask);         \
570570}
571571
572572
src/emu/streams.c
r4057r4058
4545
4646#include "driver.h"
4747#include "streams.h"
48#include "profiler.h"
4849
4950
5051
r4057r4058
473474   INT32 update_sampindex = time_to_sampindex(strdata, stream, timer_get_time(machine));
474475
475476   /* generate samples to get us up to the appropriate time */
477   profiler_mark(PROFILER_SOUND);
476478   assert(stream->output_sampindex - stream->output_base_sampindex >= 0);
477479   assert(update_sampindex - stream->output_base_sampindex <= stream->output_bufalloc);
478480   generate_samples(stream, update_sampindex - stream->output_sampindex);
481   profiler_mark(PROFILER_END);
479482
480483   /* remember this info for next time */
481484   stream->output_sampindex = update_sampindex;
src/emu/info.c
r4057r4058
386386               const char *name = ROM_GETNAME(rom);
387387               int offset = ROM_GETOFFSET(rom);
388388               const rom_entry *parent_rom = NULL;
389               const rom_entry *chunk;
390389               char bios_name[100];
391               int length;
392390
393391               /* BIOS ROMs only apply to bioses */
394392               if ((is_bios && rom_type != 0) || (!is_bios && rom_type == 0))
395393                  continue;
396394
397               /* compute the total length of all chunks */
398               length = 0;
399               for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
400                  length += ROM_GETLENGTH(chunk);
401
402395               /* if we have a valid ROM and we are a clone, see if we can find the parent ROM */
403396               if (!ROM_NOGOODDUMP(rom) && clone_of != NULL)
404397               {
r4057r4058
443436               if (bios_name[0] != 0)
444437                  fprintf(out, " bios=\"%s\"", xml_normalize_string(bios_name));
445438               if (!is_disk)
446                  fprintf(out, " size=\"%d\"", length);
439                  fprintf(out, " size=\"%d\"", rom_file_size(rom));
447440
448441               /* dump checksum information only if there is a known dump */
449442               if (!hash_data_has_info(ROM_GETHASHDATA(rom), HASH_INFO_NO_DUMP))
src/emu/tilemap.c
r4057r4058
297297   int group;
298298
299299   /* allocate the tilemap itself */
300   tmap = malloc_or_die(sizeof(tilemap));
301   memset(tmap, 0, sizeof(tilemap));
300   tmap = malloc_or_die(sizeof(*tmap));
301   memset(tmap, 0, sizeof(*tmap));
302302
303303   /* fill in the basic metrics */
304304   tmap->machine = machine;
r4057r4058
338338   tmap->tileflags = malloc_or_die(tmap->max_logical_index);
339339   tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8);
340340   tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
341   memset(tmap->pen_to_flags, 0, sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
341342   for (group = 0; group < TILEMAP_NUM_GROUPS; group++)
342343      tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
343344
src/emu/uimenu.c
r4057r4058
27792779         break;
27802780   }
27812781
2782   ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height());
2782   ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height() + 2.0f * UI_BOX_TB_BORDER);
27832783   astring_free(tempstring);
27842784}
27852785
r4057r4058
27942794   const slider_state *curslider = selectedref;
27952795   if (curslider != NULL)
27962796   {
2797      astring *tempstring = astring_alloc();
2798      INT32 curval = (*curslider->update)(machine, curslider->arg, tempstring, SLIDER_NOCHANGE);
2799      float percentage = (float)(curval - curslider->minval) / (float)(curslider->maxval - curslider->minval);
2800      float default_percentage = (float)(curslider->defval - curslider->minval) / (float)(curslider->maxval - curslider->minval);
28012797      float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x;
2802      float space_width = ui_get_char_width(' ');
28032798      float line_height = ui_get_line_height();
2804      float ui_width, ui_height;
2799      astring *tempstring = astring_alloc();
2800      float percentage, default_percentage;
28052801      float text_height;
2802      INT32 curval;
28062803
2807      /* finish assembling the text */
2804      /* determine the current value and text */
2805      curval = (*curslider->update)(machine, curslider->arg, tempstring, SLIDER_NOCHANGE);
2806
2807      /* compute the current and default percentages */
2808      percentage = (float)(curval - curslider->minval) / (float)(curslider->maxval - curslider->minval);
2809      default_percentage = (float)(curslider->defval - curslider->minval) / (float)(curslider->maxval - curslider->minval);
2810
2811      /* assemble the the text */
28082812      astring_insc(tempstring, 0, " ");
28092813      astring_insc(tempstring, 0, curslider->description);
28102814
2811      /* leave a spaces' worth of room along the left/right sides, and a lines' worth on the top/bottom */
2812      ui_width = 1.0f - 2.0f * space_width;
2813      ui_height = 1.0f - 2.0f * line_height;
2815      /* move us to the bottom of the screen, and expand to full width */
2816      y2 = 1.0f - UI_BOX_TB_BORDER;
2817      y1 = y2 - bottom;
2818      x1 = UI_BOX_LR_BORDER;
2819      x2 = 1.0f - UI_BOX_LR_BORDER;
28142820
2821      /* draw extra menu area */
2822      ui_draw_outlined_box(x1, y1, x2, y2, UI_FILLCOLOR);
2823      y1 += UI_BOX_TB_BORDER;
2824
28152825      /* determine the text height */
2816      ui_draw_text_full(astring_c(tempstring), 0, 0, ui_width - 2 * UI_BOX_LR_BORDER,
2817               JUSTIFY_CENTER, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
2826      ui_draw_text_full(astring_c(tempstring), 0, 0, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
2827               JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
28182828
2819      /* add a box around the whole area */
2820      ui_draw_outlined_box(space_width,
2821                   line_height + ui_height - text_height - line_height - 2 * UI_BOX_TB_BORDER,
2822                   space_width + ui_width,
2823                   line_height + ui_height, UI_FILLCOLOR);
2824
28252829      /* draw the thermometer */
2826      bar_left = 2.0f * space_width;
2827      bar_area_top = line_height + ui_height - UI_BOX_TB_BORDER - text_height - line_height * 0.75f;
2828      bar_width = ui_width - 2.0f * space_width;
2829      bar_area_height = line_height * 0.75f;
2830      bar_left = x1 + UI_BOX_LR_BORDER;
2831      bar_area_top = y1;
2832      bar_width = x2 - x1 - 2.0f * UI_BOX_LR_BORDER;
2833      bar_area_height = line_height;
28302834
28312835      /* compute positions */
28322836      bar_top = bar_area_top + 0.125f * bar_area_height;
r4057r4058
28462850      render_ui_add_line(default_x, bar_bottom, default_x, bar_area_top + bar_area_height, UI_LINE_WIDTH, ARGB_WHITE, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
28472851
28482852      /* draw the actual text */
2849      ui_draw_text_full(astring_c(tempstring), space_width + UI_BOX_LR_BORDER, line_height + ui_height - UI_BOX_TB_BORDER - text_height, ui_width - 2.0f * UI_BOX_LR_BORDER,
2853      ui_draw_text_full(astring_c(tempstring), x1 + UI_BOX_LR_BORDER, y1 + line_height, x2 - x1 - 2.0f * UI_BOX_LR_BORDER,
28502854               JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, NULL, &text_height);
28512855
28522856      astring_free(tempstring);
src/emu/audit.c
r4057r4058
329329static int audit_one_rom(core_options *options, const rom_entry *rom, const char *regiontag, const game_driver *gamedrv, UINT32 validation, audit_record *record)
330330{
331331   const game_driver *drv;
332   const rom_entry *chunk;
333332   UINT32 crc = 0;
334333   UINT8 crcs[4];
335334   int has_crc;
r4057r4058
339338   record->name = ROM_GETNAME(rom);
340339   record->exphash = ROM_GETHASHDATA(rom);
341340   record->length = 0;
341   record->explength = rom_file_size(rom);
342342
343   /* compute the expected length by summing the chunks */
344   for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
345      record->explength += ROM_GETLENGTH(chunk);
346
347343   /* see if we have a CRC and extract it if so */
348344   has_crc = hash_data_extract_binary_checksum(record->exphash, HASH_CRC, crcs);
349345   if (has_crc)
src/emu/memory.c
r4057r4058
13171317
13181318
13191319/***************************************************************************
1320    MISCELLANEOUS UTILITIES
1321***************************************************************************/
1322
1323/*-------------------------------------------------
1324    memory_address_physical - return the physical
1325    address corresponding to the given logical
1326    address
1327-------------------------------------------------*/
1328
1329int memory_address_physical(const address_space *space, int intention, offs_t *address)
1330{
1331   cpu_class_header *classheader = cpu_get_class_header(space->cpu);
1332   if (classheader->translate != NULL)
1333      return (*classheader->translate)(space->cpu, space->spacenum, intention, address);
1334   else
1335      return TRUE;
1336}
1337
1338
1339
1340/***************************************************************************
13411320    DEBUGGER HELPERS
13421321***************************************************************************/
13431322
src/emu/emu.mak
r4057r4058
4242   $(EMUOBJ)/clifront.o \
4343   $(EMUOBJ)/config.o \
4444   $(EMUOBJ)/cpuexec.o \
45   $(EMUOBJ)/cpuintrf.o \
4645   $(EMUOBJ)/crsshair.o \
4746   $(EMUOBJ)/debugger.o \
4847   $(EMUOBJ)/devintrf.o \
r4057r4058
135134   $(EMUMACHINE)/eeprom.o \
136135   $(EMUMACHINE)/f3853.o \
137136   $(EMUMACHINE)/generic.o \
137   $(EMUMACHINE)/i8243.o \
138138   $(EMUMACHINE)/i2cmem.o \
139139    $(EMUMACHINE)/idectrl.o \
140140    $(EMUMACHINE)/intelfsh.o \
src/emu/memory.h
r4057r4058
940940
941941
942942
943/* ----- miscellaneous utilities ----- */
944
945/* return the physical address corresponding to the given logical address */
946int memory_address_physical(const address_space *space, int intention, offs_t *address);
947
948
949
950943/* ----- debugger helpers ----- */
951944
952945/* return a string describing the handler at a particular offset */
src/emu/restrack.c
r4057r4058
199199
200200void *auto_malloc_file_line(size_t size, const char *file, int line)
201201{
202   return pool_malloc_file_line(current_pool(), size, file, line);
202   void *result = pool_malloc_file_line(current_pool(), size, file, line);
203#ifdef MAME_DEBUG
204   rand_memory(result, size);
205#endif
206   return result;
203207}
204208
205209
r4057r4058
273277
274278/*-------------------------------------------------
275279    validate_auto_malloc_memory - validate that a
276    block of memory has been allocated by auto_malloc()
280    block of memory has been allocated by
281    auto_malloc()
277282-------------------------------------------------*/
278283
279284void validate_auto_malloc_memory(void *memory, size_t memory_size)
src/emu/mame.c
r4057r4058
16151615   /* now we're running */
16161616   mame->current_phase = MAME_PHASE_RUNNING;
16171617
1618   /* set the global time to the current time */
1619   /* this allows 0-time queued callbacks to run before any CPUs execute */
1620   timer_set_global_time(machine, timer_get_time(machine));
1618   /* allow 0-time queued callbacks to run before any CPUs execute */
1619   timer_execute_timers(machine);
16211620}
16221621
16231622
src/emu/inptport.c
r4057r4058
20332033
20342034   /* perform the mouse hit test */
20352035   mouse_target = ui_input_find_mouse(machine, &mouse_target_x, &mouse_target_y, &mouse_button);
2036   if (mouse_button)
2036   if (mouse_button && mouse_target)
20372037   {
20382038      const char *tag = NULL;
20392039      input_port_value mask;
src/emu/machine/74148.c
r4057r4058
167167
168168
169169
170void TTL74148_config(int which, const struct TTL74148_interface *intf)
170void TTL74148_config(running_machine *machine, int which, const struct TTL74148_interface *intf)
171171{
172172   if (which >= MAX_TTL74148)
173173   {
r4057r4058
176176   }
177177
178178
179   chips[which].output_cb = (intf ? intf->output_cb : 0);
180   chips[which].enable_input = 1;
181   chips[which].input_lines[0] = 1;
182   chips[which].input_lines[1] = 1;
183   chips[which].input_lines[2] = 1;
184   chips[which].input_lines[3] = 1;
185   chips[which].input_lines[4] = 1;
186   chips[which].input_lines[5] = 1;
187   chips[which].input_lines[6] = 1;
188   chips[which].input_lines[7] = 1;
179    chips[which].output_cb = (intf ? intf->output_cb : 0);
180    chips[which].enable_input = 1;
181    chips[which].input_lines[0] = 1;
182    chips[which].input_lines[1] = 1;
183    chips[which].input_lines[2] = 1;
184    chips[which].input_lines[3] = 1;
185    chips[which].input_lines[4] = 1;
186    chips[which].input_lines[5] = 1;
187    chips[which].input_lines[6] = 1;
188    chips[which].input_lines[7] = 1;
189189
190   chips[which].last_output = -1;
191   chips[which].last_output_valid = -1;
192   chips[which].last_enable_output = -1;
190    chips[which].last_output = -1;
191    chips[which].last_output_valid = -1;
192    chips[which].last_enable_output = -1;
193
194    state_save_register_item_array(machine, "ttl74148", NULL, which, chips[which].input_lines);
195    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].enable_input);
196    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].output);
197    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].output_valid);
198    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].enable_output);
199    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].last_output);
200    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].last_output_valid);
201    state_save_register_item(machine, "ttl74148", NULL, which, chips[which].last_enable_output);
193202}
src/emu/machine/74148.h
r4057r4058
4949};
5050
5151
52void TTL74148_config(int which, const struct TTL74148_interface *intf);
52void TTL74148_config(running_machine *machine, int which, const struct TTL74148_interface *intf);
5353
5454/* must call TTL74148_update() after setting the inputs */
5555void TTL74148_update(running_machine *machine, int which);
src/emu/machine/7474.c
r4057r4058
140140
141141void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf)
142142{
143   struct TTL7474 *chip = &chips[which];
144
145143   if (which >= MAX_TTL7474)
146144   {
147145      logerror("Only %d 7474's are supported at this time.\n", MAX_TTL7474);
r4057r4058
149147   }
150148
151149
152   chip->output_cb = (intf ? intf->output_cb : 0);
150    chips[which].output_cb = (intf ? intf->output_cb : 0);
153151
154152   /* all inputs are open first */
155    chip->clear = 1;
156    chip->preset = 1;
157    chip->clock = 1;
158    chip->d = 1;
153    chips[which].clear = 1;
154    chips[which].preset = 1;
155    chips[which].clock = 1;
156    chips[which].d = 1;
159157
160    chip->last_clock = 1;
161    chip->last_output = -1;
162    chip->last_output_comp = -1;
158    chips[which].last_clock = 1;
159    chips[which].last_output = -1;
160    chips[which].last_output_comp = -1;
163161
164    state_save_register_item(machine, "ttl7474", NULL, which, chip->clear);
165    state_save_register_item(machine, "ttl7474", NULL, which, chip->preset);
166    state_save_register_item(machine, "ttl7474", NULL, which, chip->clock);
167    state_save_register_item(machine, "ttl7474", NULL, which, chip->d);
168    state_save_register_item(machine, "ttl7474", NULL, which, chip->output);
169    state_save_register_item(machine, "ttl7474", NULL, which, chip->output_comp);
170    state_save_register_item(machine, "ttl7474", NULL, which, chip->last_clock);
171    state_save_register_item(machine, "ttl7474", NULL, which, chip->last_output);
172    state_save_register_item(machine, "ttl7474", NULL, which, chip->last_output_comp);
162    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].clear);
163    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].preset);
164    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].clock);
165    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].d);
166    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].output);
167    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].output_comp);
168    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].last_clock);
169    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].last_output);
170    state_save_register_item(machine, "ttl7474", NULL, which, chips[which].last_output_comp);
173171}
src/emu/machine/74153.c
r4057r4058
134134   }
135135
136136
137   chips[which].machine = machine;
138   chips[which].output_cb = (intf ? intf->output_cb : 0);
139   chips[which].a = 1;
140   chips[which].b = 1;
141   chips[which].enable[0] = 1;
142   chips[which].enable[1] = 1;
143   chips[which].input_lines[0][0] = 1;
144   chips[which].input_lines[0][1] = 1;
145   chips[which].input_lines[0][2] = 1;
146   chips[which].input_lines[0][3] = 1;
147   chips[which].input_lines[1][0] = 1;
148   chips[which].input_lines[1][1] = 1;
149   chips[which].input_lines[1][2] = 1;
150   chips[which].input_lines[1][3] = 1;
137    chips[which].machine = machine;
138    chips[which].output_cb = (intf ? intf->output_cb : 0);
139    chips[which].a = 1;
140    chips[which].b = 1;
141    chips[which].enable[0] = 1;
142    chips[which].enable[1] = 1;
143    chips[which].input_lines[0][0] = 1;
144    chips[which].input_lines[0][1] = 1;
145    chips[which].input_lines[0][2] = 1;
146    chips[which].input_lines[0][3] = 1;
147    chips[which].input_lines[1][0] = 1;
148    chips[which].input_lines[1][1] = 1;
149    chips[which].input_lines[1][2] = 1;
150    chips[which].input_lines[1][3] = 1;
151151
152   chips[which].last_output[0] = -1;
153   chips[which].last_output[1] = -1;
152    chips[which].last_output[0] = -1;
153    chips[which].last_output[1] = -1;
154
155    state_save_register_item_array(machine, "ttl74153", NULL, which, chips[which].enable);
156    state_save_register_item_array(machine, "ttl74153", NULL, which, chips[which].last_output);
157    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[0][0]);
158    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[0][1]);
159    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[0][2]);
160    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[0][3]);
161    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[1][0]);
162    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[1][1]);
163    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[1][2]);
164    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].input_lines[1][3]);
165    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].a);
166    state_save_register_item(machine, "ttl74153", NULL, which, chips[which].b);
154167}
src/emu/machine/generic.c
r4057r4058
3434/* memory card status */
3535static int memcard_inserted;
3636
37/* interrupt status */
38static UINT8 interrupt_enable[MAX_CPU];
37/* interrupt status for up to 8 CPUs */
38static UINT8 interrupt_enable[8];
3939
4040
4141
src/emu/machine/i8243.c
r0r4058
1/***************************************************************************
2
3    i8243.c
4
5    Intel 8243 Port Expander
6
7    Copyright Aaron Giles
8
9***************************************************************************/
10
11#include "i8243.h"
12
13
14/***************************************************************************
15    TYPE DEFINITIONS
16***************************************************************************/
17
18/* live processor state */
19typedef struct _i8243_state i8243_state;
20struct _i8243_state
21{
22   UINT8      p[4];            /* 4 ports' worth of data */
23   UINT8      p2out;            /* port 2 bits that will be returned */
24   UINT8      p2;               /* most recent port 2 value */
25   UINT8      opcode;            /* latched opcode */
26   UINT8      prog;            /* previous PROG state */
27};
28
29
30/***************************************************************************
31    INLINE FUNCTIONS
32***************************************************************************/
33
34INLINE i8243_state *get_safe_token(const device_config *device)
35{
36   assert(device != NULL);
37   assert(device->type == I8243);
38   return (i8243_state *)device->token;
39}
40
41
42INLINE i8243_config *get_safe_config(const device_config *device)
43{
44   assert(device != NULL);
45   assert(device->type == I8243);
46   return (i8243_config *)device->inline_config;
47}
48
49
50
51/***************************************************************************
52    DEVICE INTERFACE
53***************************************************************************/
54
55/*-------------------------------------------------
56    i8243_p2_r - handle a read from port 2
57-------------------------------------------------*/
58
59READ8_DEVICE_HANDLER( i8243_p2_r )
60{
61   i8243_state *i8243 = get_safe_token(device);
62   return i8243->p2out;
63}
64
65
66/*-------------------------------------------------
67    i8243_p2_r - handle a write to port 2
68-------------------------------------------------*/
69
70WRITE8_DEVICE_HANDLER( i8243_p2_w )
71{
72   i8243_state *i8243 = get_safe_token(device);
73   i8243->p2 = data & 0x0f;
74}
75
76
77/*-------------------------------------------------
78    i8243_prog_w - handle a change in the PROG
79    line state
80-------------------------------------------------*/
81
82WRITE8_DEVICE_HANDLER( i8243_prog_w )
83{
84   i8243_state *i8243 = get_safe_token(device);
85   i8243_config *config = get_safe_config(device);
86
87   /* only care about low bit */
88   data &= 1;
89
90   /* on high->low transition state, latch opcode/port */
91   if (i8243->prog && !data)
92   {
93      i8243->opcode = i8243->p2;
94
95      /* if this is a read opcode, copy result to p2out */
96      if ((i8243->opcode >> 2) == MCS48_EXPANDER_OP_READ)
97      {
98         if (config->readhandler != NULL)
99            i8243->p[i8243->opcode & 3] = (*config->readhandler)(device, i8243->opcode & 3);
100         i8243->p2out = i8243->p[i8243->opcode & 3] & 0x0f;
101      }
102   }
103
104   /* on low->high transition state, act on opcode */
105   else if (!i8243->prog && data)
106   {
107      switch (i8243->opcode >> 2)
108      {
109         case MCS48_EXPANDER_OP_WRITE:
110            i8243->p[i8243->opcode & 3] = i8243->p2 & 0x0f;
111            if (config->writehandler != NULL)
112               (*config->writehandler)(device, i8243->opcode & 3, i8243->p[i8243->opcode & 3]);
113            break;
114
115         case MCS48_EXPANDER_OP_OR:
116            i8243->p[i8243->opcode & 3] |= i8243->p2 & 0x0f;
117            if (config->writehandler != NULL)
118               (*config->writehandler)(device, i8243->opcode & 3, i8243->p[i8243->opcode & 3]);
119            break;
120
121         case MCS48_EXPANDER_OP_AND:
122            i8243->p[i8243->opcode & 3] &= i8243->p2 & 0x0f;
123            if (config->writehandler != NULL)
124               (*config->writehandler)(device, i8243->opcode & 3, i8243->p[i8243->opcode & 3]);
125            break;
126      }
127   }
128
129   /* remember the state */
130   i8243->prog = data;
131}
132
133
134
135/***************************************************************************
136    DEVICE INTERFACE
137***************************************************************************/
138
139/*-------------------------------------------------
140    DEVICE_START( i8243 )
141-------------------------------------------------*/
142
143static DEVICE_START( i8243 )
144{
145   return DEVICE_START_OK;
146}
147
148
149/*-------------------------------------------------
150    DEVICE_RESET( i8243 )
151-------------------------------------------------*/
152
153static DEVICE_RESET( i8243 )
154{
155   i8243_state *i8243 = get_safe_token(device);
156
157   i8243->p2 = 0x0f;
158   i8243->p2out = 0x0f;
159   i8243->prog = 1;
160}
161
162
163/*-------------------------------------------------
164    DEVICE_GET_INFO( i8243 )
165-------------------------------------------------*/
166
167DEVICE_GET_INFO( i8243 )
168{
169   switch (state)
170   {
171      /* --- the following bits of info are returned as 64-bit signed integers --- */
172      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(i8243_state);         break;
173      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(i8243_config);         break;
174      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;      break;
175
176      /* --- the following bits of info are returned as pointers to data or functions --- */
177      case DEVINFO_FCT_START:         info->start = DEVICE_START_NAME(i8243);               break;
178      case DEVINFO_FCT_RESET:         info->reset = DEVICE_RESET_NAME(i8243);               break;
179
180      /* --- the following bits of info are returned as NULL-terminated strings --- */
181      case DEVINFO_STR_NAME:                     strcpy(info->s, "I8243");            break;
182      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "MCS-48");            break;
183      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");               break;
184      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);            break;
185      case DEVINFO_STR_CREDITS:                  /* Nothing */                     break;
186   }
187}
src/emu/machine/i8243.h
r0r4058
1/***************************************************************************
2
3    i8243.h
4
5    Intel 8243 Port Expander
6
7    Copyright Aaron Giles
8
9***************************************************************************/
10
11#pragma once
12
13#ifndef __I8243_H__
14#define __I8243_H__
15
16#include "devintrf.h"
17#include "cpu/mcs48/mcs48.h"
18
19
20/***************************************************************************
21    TYPE DEFINITIONS
22***************************************************************************/
23
24typedef struct _i8243_config i8243_config;
25struct _i8243_config
26{
27   read8_device_func      readhandler;
28   write8_device_func      writehandler;
29};
30
31
32
33/***************************************************************************
34    MACROS
35***************************************************************************/
36
37#define I8243 DEVICE_GET_INFO_NAME( i8243 )
38
39
40#define MDRV_I8243_ADD(_tag, _read, _write) \
41   MDRV_DEVICE_ADD(_tag, I8243, 0) \
42   MDRV_DEVICE_CONFIG_DATAPTR(i8243_config, readhandler, _read) \
43   MDRV_DEVICE_CONFIG_DATAPTR(i8243_config, writehandler, _write)
44
45#define MDRV_I8243_REMOVE(_tag) \
46   MDRV_DEVICE_REMOVE(_tag, I8243)
47
48
49
50/***************************************************************************
51    FUNCTION PROTOTYPES
52***************************************************************************/
53
54DEVICE_GET_INFO( i8243 );
55
56READ8_DEVICE_HANDLER( i8243_p2_r );
57WRITE8_DEVICE_HANDLER( i8243_p2_w );
58
59WRITE8_DEVICE_HANDLER( i8243_prog_w );
60
61
62#endif  /* __I8243_H__ */
src/emu/machine/6850acia.c
r4057r4058
215215   acia6850_t *acia_p = get_token(device);
216216   acia6850_interface *intf = get_interface(device);
217217
218   acia_p->tx_clock = device->clock;
219   acia_p->rx_clock = (intf->rx_clock == 0) ? device->clock : intf->rx_clock;
218   acia_p->rx_clock = intf->rx_clock;
219   acia_p->tx_clock = intf->tx_clock;
220220   acia_p->tx_counter = 0;
221221   acia_p->rx_counter = 0;
222222   acia_p->rx_pin = intf->rx_pin;
src/emu/machine/laserdsc.h
r4057r4058
1414#ifndef __LASERDSC_H__
1515#define __LASERDSC_H__
1616
17#include "chd.h"
1718#include "sound/custom.h"
1819
1920
r4057r4058
6667    TYPE DEFINITIONS
6768***************************************************************************/
6869
70typedef chd_file *(*laserdisc_get_disc_func)(const device_config *device);
71
6972typedef void (*laserdisc_audio_func)(const device_config *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1);
7073
7174typedef void (*vp931_data_ready_func)(const device_config *device, int state);
r4057r4058
7477struct _laserdisc_config
7578{
7679   UINT32               type;
80   laserdisc_get_disc_func   getdisc;
7781   laserdisc_audio_func   audio;
7882   const char *         sound;
7983   const char *         screen;
r4057r4058
98102   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, screen, _screen) \
99103   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, sound, _sound) \
100104
105#define MDRV_LASERDISC_GET_DISC(_func) \
106   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, getdisc, _func)
107
101108#define MDRV_LASERDISC_AUDIO(_func) \
102109   MDRV_DEVICE_CONFIG_DATAPTR(laserdisc_config, audio, _func)
103110
src/emu/machine/ldcore.c
r4057r4058
12831283
12841284static void init_disc(const device_config *device)
12851285{
1286   const laserdisc_config *config = device->inline_config;
12861287   laserdisc_state *ld = get_safe_token(device);
12871288   ldcore_data *ldcore = ld->core;
12881289   chd_error err;
12891290
1290   /* find the disc */
1291   ldcore->disc = get_disk_handle(device->tag);
1291   /* get a handle to the disc to play */
1292   if (config->getdisc != NULL)
1293      ldcore->disc = (*config->getdisc)(device);
1294   else
1295      ldcore->disc = get_disk_handle(device->tag);
12921296
12931297   /* set default parameters */
12941298   ldcore->width = 720;
src/emu/machine/at28c16.c
r4057r4058
5555   else if( c->oe_12v )
5656   {
5757//      logerror( "%s: at28c16_write( %d, %04x, %02x ) erase\n", cpuexec_describe_context(machine), chip, offset, data );
58      memset( c->data, 0xff, SIZE_DATA );
59      memset( c->id, 0xff, SIZE_ID );
60      c->last_write = 0xff;
61      timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
58      if( c->last_write < 0 )
59      {
60         memset( c->data, 0xff, SIZE_DATA );
61         memset( c->id, 0xff, SIZE_ID );
62         c->last_write = 0xff;
63         timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
64      }
6265   }
6366   else if( offset >= OFFSET_ID && c->a9_12v )
6467   {
6568//      logerror( "%s: at28c16_write( %d, %04x, %02x ) id\n", cpuexec_describe_context(machine), chip, offset, data );
66      c->id[ offset - OFFSET_ID ] = data;
67      c->last_write = data;
68      timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
69      if( c->last_write < 0 && c->id[ offset - OFFSET_ID ] != data )
70      {
71         c->id[ offset - OFFSET_ID ] = data;
72         c->last_write = data;
73         timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
74      }
6975   }
7076   else
7177   {
7278//      logerror( "%s: at28c16_write( %d, %04x, %02x ) data\n", cpuexec_describe_context(machine), chip, offset, data );
73      c->data[ offset ] = data;
74      c->last_write = data;
75      timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
79      if( c->last_write < 0 && c->data[ offset ] != data )
80      {
81         c->data[ offset ] = data;
82         c->last_write = data;
83         timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
84      }
7685   }
7786}
7887
src/emu/mame.h
r4057r4058
149149   const input_port_config *portconfig;      /* points to a list of input port configurations */
150150
151151   /* CPU information */
152   const device_config *   cpu[MAX_CPU];      /* array of CPU devices */
152   const device_config *   cpu[8];            /* array of first 8 CPU devices */
153153
154154   /* game-related information */
155155   const game_driver *      gamedrv;         /* points to the definition of the game machine */
src/emu/cpuexec.c
r4057r4058
5959typedef struct _cpu_class_data cpu_class_data;
6060struct _cpu_class_data
6161{
62   /* execution lists */
63   const device_config *device;         /* pointer back to our device */
64   cpu_class_data *next;               /* pointer to the next CPU to execute, in order */
65   cpu_execute_func execute;            /* execute function pointer */
66
6267   /* cycle counting and executing */
6368   int            profiler;            /* profiler tag */
6469   int *         icount;               /* pointer to the icount */
r4057r4058
104109struct _cpuexec_private
105110{
106111   const device_config *executingcpu;      /* pointer to the currently executing CPU */
112   cpu_class_data *executelist;         /* execution list; suspended CPUs are at the back */
107113   char         statebuf[256];         /* string buffer containing state description */
108114};
109115
r4057r4058
122128static TIMER_CALLBACK( empty_event_queue );
123129static IRQ_CALLBACK( standard_irq_callback );
124130static void register_save_states(const device_config *device);
131static void rebuild_execute_list(running_machine *machine);
125132static UINT64 get_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry);
126133static void set_register_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, UINT64 value);
127134static void get_register_string_value(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *dest);
r4057r4058
130137#endif
131138
132139
140
133141/***************************************************************************
142    MACROS
143***************************************************************************/
144
145/* these are macros to ensure inlining in cpuexec_timeslice */
146#define ATTOTIME_LT(a,b)      ((a).seconds < (b).seconds || ((a).seconds == (b).seconds && (a).attoseconds < (b).attoseconds))
147#define ATTOTIME_NORMALIZE(a)   do { if ((a).attoseconds >= ATTOSECONDS_PER_SECOND) { (a).seconds++; (a).attoseconds -= ATTOSECONDS_PER_SECOND; } } while (0)
148
149
150
151/***************************************************************************
134152    INLINE FUNCTIONS
135153***************************************************************************/
136154
r4057r4058
235253void cpuexec_timeslice(running_machine *machine)
236254{
237255   int call_debugger = ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
256   timer_execution_state *timerexec = timer_get_execution_state(machine);
238257   cpuexec_private *global = machine->cpuexec_data;
239   attotime target = timer_next_fire_time(machine);
240   attotime base = timer_get_time(machine);
241   const device_config *cpu;
242258   int ran;
243259
244   LOG(("------------------\n"));
245   LOG(("cpu_timeslice: target = %s\n", attotime_string(target, 9)));
260   /* build the execution list if we don't have one yet */
261   if (global->executelist == NULL)
262      rebuild_execute_list(machine);
246263
247   /* apply pending suspension changes */
248   for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext)
264   /* loop until we hit the next timer */
265   while (ATTOTIME_LT(timerexec->basetime, timerexec->nextfire))
249266   {
250      cpu_class_data *classdata = get_class_data(cpu);
251      classdata->suspend = classdata->nextsuspend;
252      classdata->nextsuspend &= ~SUSPEND_REASON_TIMESLICE;
253      classdata->eatcycles = classdata->nexteatcycles;
254   }
267      cpu_class_data *classdata;
268      UINT32 suspendchanged;
269      attotime target;
255270
256   /* loop over non-suspended CPUs */
257   for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext)
258   {
259      cpu_class_data *classdata = get_class_data(cpu);
260      if (classdata->suspend == 0)
271      /* by default, assume our target is the end of the next quantum */
272      target.seconds = timerexec->basetime.seconds;
273      target.attoseconds = timerexec->basetime.attoseconds + timerexec->curquantum;
274      ATTOTIME_NORMALIZE(target);
275
276      /* however, if the next timer is going to fire before then, override */
277      assert(attotime_sub(timerexec->nextfire, target).seconds <= 0);
278      if (ATTOTIME_LT(timerexec->nextfire, target))
279         target = timerexec->nextfire;
280
281      LOG(("------------------\n"));
282      LOG(("cpu_timeslice: target = %s\n", attotime_string(target, 9)));
283
284      /* apply pending suspension changes */
285      suspendchanged = 0;
286      for (classdata = global->executelist; classdata != NULL; classdata = classdata->next)
261287      {
262         attotime delta = attotime_sub(target, classdata->localtime);
263         if (delta.seconds >= 0 && delta.attoseconds >= classdata->attoseconds_per_cycle)
288         suspendchanged |= (classdata->suspend ^ classdata->nextsuspend);
289         classdata->suspend = classdata->nextsuspend;
290         classdata->nextsuspend &= ~SUSPEND_REASON_TIMESLICE;
291         classdata->eatcycles = classdata->nexteatcycles;
292      }
293
294      /* recompute the execute list if any CPUs changed their suspension state */
295      if (suspendchanged != 0)
296         rebuild_execute_list(machine);
297
298      /* loop over non-suspended CPUs */
299      for (classdata = global->executelist; classdata != NULL; classdata = classdata->next)
300      {
301         /* only process if our target is later than the CPU's current time (coarse check) */
302         if (target.seconds >= classdata->localtime.seconds)
264303         {
265            /* compute how long to run */
266            classdata->cycles_running = div_64x32(delta.attoseconds >> classdata->divshift, classdata->divisor);
267            LOG(("  cpu '%s': %d cycles\n", cpu->tag, classdata->cycles_running));
304            attoseconds_t delta, actualdelta;
268305
269            profiler_mark(classdata->profiler);
306            /* compute how many attoseconds to execute this CPU */
307            delta = target.attoseconds - classdata->localtime.attoseconds;
308            if (delta < 0 && target.seconds > classdata->localtime.seconds)
309               delta += ATTOSECONDS_PER_SECOND;
310            assert(delta == attotime_to_attoseconds(attotime_sub(target, classdata->localtime)));
270311
271            /* note that this global variable cycles_stolen can be modified */
272            /* via the call to cpu_execute */
273            classdata->cycles_stolen = 0;
274            global->executingcpu = cpu;
275            if (!call_debugger)
276               ran = cpu_execute(cpu, classdata->cycles_running);
277            else
312            /* if we have enough for at least 1 cycle, do the math */
313            if (delta >= classdata->attoseconds_per_cycle)
278314            {
279               debugger_start_cpu_hook(cpu, target);
280               ran = cpu_execute(cpu, classdata->cycles_running);
281               debugger_stop_cpu_hook(cpu);
282            }
315               /* compute how many cycles we want to execute */
316               ran = classdata->cycles_running = divu_64x32((UINT64)delta >> classdata->divshift, classdata->divisor);
317               LOG(("  cpu '%s': %d cycles\n", classdata->device->tag, classdata->cycles_running));
283318
284#ifdef MAME_DEBUG
285            if (ran < classdata->cycles_stolen)
286               fatalerror("Negative CPU cycle count!");
287#endif /* MAME_DEBUG */
319               /* if we're not suspended, actually execute */
320               if (classdata->suspend == 0)
321               {
322                  profiler_mark(classdata->profiler);
288323
289            ran -= classdata->cycles_stolen;
290            profiler_mark(PROFILER_END);
324                  /* note that this global variable cycles_stolen can be modified */
325                  /* via the call to cpu_execute */
326                  classdata->cycles_stolen = 0;
327                  global->executingcpu = classdata->device;
328                  *classdata->icount = classdata->cycles_running;
329                  if (!call_debugger)
330                     ran = (*classdata->execute)(classdata->device, classdata->cycles_running);
331                  else
332                  {
333                     debugger_start_cpu_hook(classdata->device, target);
334                     ran = (*classdata->execute)(classdata->device, classdata->cycles_running);
335                     debugger_stop_cpu_hook(classdata->device);
336                  }
291337
292            /* account for these cycles */
293            classdata->totalcycles += ran;
294            classdata->localtime = attotime_add_attoseconds(classdata->localtime, ran * classdata->attoseconds_per_cycle);
295            LOG(("         %d ran, %d total, time = %s\n", ran, (INT32)classdata->totalcycles, attotime_string(classdata->localtime, 9)));
338                  /* adjust for any cycles we took back */
339                  assert(ran >= classdata->cycles_stolen);
340                  ran -= classdata->cycles_stolen;
341                  profiler_mark(PROFILER_END);
342               }
296343
297            /* if the new local CPU time is less than our target, move the target up */
298            if (attotime_compare(classdata->localtime, target) < 0)
299            {
300               target = attotime_max(classdata->localtime, base);
301               LOG(("         (new target)\n"));
302            }
303         }
304      }
305   }
306   global->executingcpu = NULL;
344               /* account for these cycles */
345               classdata->totalcycles += ran;
307346
308   /* update the local times of all CPUs */
309   for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext)
310   {
311      cpu_class_data *classdata = get_class_data(cpu);
347               /* update the local time for this CPU */
348               actualdelta = classdata->attoseconds_per_cycle * ran;
349               classdata->localtime.attoseconds += actualdelta;
350               ATTOTIME_NORMALIZE(classdata->localtime);
351               LOG(("         %d ran, %d total, time = %s\n", ran, (INT32)classdata->totalcycles, attotime_string(classdata->localtime, 9)));
312352
313      /* if we're suspended and counting, process */
314      if (classdata->suspend != 0 && classdata->eatcycles && attotime_compare(classdata->localtime, target) < 0)
315      {
316         attotime delta = attotime_sub(target, classdata->localtime);
353               /* if the new local CPU time is less than our target, move the target up */
354               if (ATTOTIME_LT(classdata->localtime, target))
355               {
356                  assert(attotime_compare(classdata->localtime, target) < 0);
357                  target = classdata->localtime;
317358
318         /* compute how long to run */
319         classdata->cycles_running = div_64x32(delta.attoseconds >> classdata->divshift, classdata->divisor);
320         LOG(("  cpu '%s': %d cycles (suspended)\n", cpu->tag, classdata->cycles_running));
321
322         classdata->totalcycles += classdata->cycles_running;
323         classdata->localtime = attotime_add_attoseconds(classdata->localtime, classdata->cycles_running * classdata->attoseconds_per_cycle);
324         LOG(("         %d skipped, %d total, time = %s\n", classdata->cycles_running, (INT32)classdata->totalcycles, attotime_string(classdata->localtime, 9)));
359                  /* however, if this puts us before the base, clamp to the base as a minimum */
360                  if (ATTOTIME_LT(target, timerexec->basetime))
361                  {
362                     assert(attotime_compare(target, timerexec->basetime) < 0);
363                     target = timerexec->basetime;
364                  }
365                  LOG(("         (new target)\n"));
366               }
367            }
368         }
325369      }
370      global->executingcpu = NULL;
326371
327      /* update the suspend state (breaks steeltal if we don't) */
328      classdata->suspend = classdata->nextsuspend;
329      classdata->eatcycles = classdata->nexteatcycles;
372      /* update the base time */
373      timerexec->basetime = target;
330374   }
331375
332   /* update the global time */
333   timer_set_global_time(machine, target);
376   /* execute timers */
377   timer_execute_timers(machine);
334378}
335379
336380
r4057r4058
427471      header->space[spacenum] = memory_find_address_space(device, spacenum);
428472
429473   header->set_info = (cpu_set_info_func)device_get_info_fct(device, CPUINFO_FCT_SET_INFO);
430   header->execute = (cpu_execute_func)device_get_info_fct(device, CPUINFO_FCT_EXECUTE);
431   header->burn = (cpu_burn_func)device_get_info_fct(device, CPUINFO_FCT_BURN);
432   header->translate = (cpu_translate_func)device_get_info_fct(device, CPUINFO_FCT_TRANSLATE);
433   header->disassemble = (cpu_disassemble_func)device_get_info_fct(device, CPUINFO_FCT_DISASSEMBLE);
434   header->dasm_override = NULL;
435474
436475   /* fill in the input states and IRQ callback information */
437476   for (line = 0; line < ARRAY_LENGTH(classdata->input); line++)
r4057r4058
443482   }
444483
445484   /* fill in the suspend states */
446   classdata->profiler = index + PROFILER_CPU1;
485   classdata->device = device;
486   classdata->execute = (cpu_execute_func)device_get_info_fct(device, CPUINFO_FCT_EXECUTE);
487   classdata->profiler = index + PROFILER_CPU_FIRST;
447488   classdata->suspend = SUSPEND_REASON_RESET;
448489   classdata->inttrigger = index + TRIGGER_INT;
449490
r4057r4058
948989      return;
949990
950991   if (cycles > *classdata->icount)
951      cycles = *classdata->icount + 1;
992      cycles = *classdata->icount;
952993   *classdata->icount -= cycles;
953994}
954995
r4057r4058
9881029   /* swallow the remaining cycles */
9891030   if (classdata->icount != NULL)
9901031   {
991      delta = *classdata->icount + 1;
1032      delta = *classdata->icount;
9921033      classdata->cycles_stolen += delta;
9931034      classdata->cycles_running -= delta;
9941035      *classdata->icount -= delta;
r4057r4058
10911132      cpu_abort_timeslice(cpu);
10921133
10931134      /* see if this is a matching trigger */
1094      if (classdata->suspend != 0 && classdata->trigger == trigger)
1135      if ((classdata->nextsuspend & SUSPEND_REASON_TRIGGER) != 0 && classdata->trigger == trigger)
10951136      {
10961137         cpu_resume(cpu, SUSPEND_REASON_TRIGGER);
10971138         classdata->trigger = 0;
r4057r4058
14121453}
14131454
14141455
1415
14161456/*-------------------------------------------------
14171457    empty_event_queue - empty a CPU's event queue
14181458    for a specific input line
r4057r4058
15711611
15721612
15731613/*-------------------------------------------------
1614    rebuild_execute_list - rebuild the list of
1615    executing CPUs, moving suspended CPUs to the
1616    end
1617-------------------------------------------------*/
1618
1619static void rebuild_execute_list(running_machine *machine)
1620{
1621   cpuexec_private *global = machine->cpuexec_data;
1622   const device_config *curcpu;
1623   cpu_class_data **tailptr;
1624
1625   /* start with an empty list */
1626   tailptr = &global->executelist;
1627   *tailptr = NULL;
1628
1629   /* first iterate over non-suspended CPUs */
1630   for (curcpu = machine->cpu[0]; curcpu != NULL; curcpu = curcpu->typenext)
1631   {
1632      cpu_class_data *classdata = get_class_data(curcpu);
1633      if (classdata->suspend == 0)
1634      {
1635         *tailptr = classdata;
1636         tailptr = &classdata->next;
1637         classdata->next = NULL;
1638      }
1639   }
1640
1641   /* then add the suspended CPUs */
1642   for (curcpu = machine->cpu[0]; curcpu != NULL; curcpu = curcpu->typenext)
1643   {
1644      cpu_class_data *classdata = get_class_data(curcpu);
1645      if (classdata->suspend != 0)
1646      {
1647         *tailptr = classdata;
1648         tailptr = &classdata->next;
1649         classdata->next = NULL;
1650      }
1651   }
1652}
1653
1654
1655/*-------------------------------------------------
15741656    get_register_value - return a register value
15751657    of a CPU using the state table
15761658-------------------------------------------------*/
src/emu/mamecore.h
r4057r4058
6060/* These are forward struct declarations that are used to break
6161   circular dependencies in the code */
6262typedef struct _running_machine running_machine;
63typedef struct _mame_display mame_display;
6463typedef struct _game_driver game_driver;
6564typedef struct _machine_config machine_config;
66typedef struct _rom_load_data rom_load_data;
67typedef struct _osd_create_params osd_create_params;
6865typedef struct _gfx_element gfx_element;
6966typedef struct _mame_file mame_file;
7067
src/emu/cpuintrf.h
r4057r4058
2525    CONSTANTS
2626***************************************************************************/
2727
28#define MAX_CPU             8
2928#define MAX_INPUT_EVENTS      32
3029
3130
r4057r4058
229228    MACROS
230229***************************************************************************/
231230
232#define IRQ_CALLBACK(func)         int func(const device_config *device, int irqline)
231/* device iteration helpers */
232#define cpu_count(config)            device_list_items((config)->devicelist, CPU)
233#define cpu_first(config)            device_list_first((config)->devicelist, CPU)
234#define cpu_next(previous)            ((previous)->typenext)
235#define cpu_get_index(cpu)            device_list_index((cpu)->machine->config->devicelist, CPU, (cpu)->tag)
233236
237
238/* IRQ callback to be called by CPU cores when an IRQ is actually taken */
239#define IRQ_CALLBACK(func)            int func(const device_config *device, int irqline)
240
241
242/* CPU interface functions */
234243#define CPU_GET_INFO_NAME(name)         cpu_get_info_##name
235244#define CPU_GET_INFO(name)            void CPU_GET_INFO_NAME(name)(const device_config *device, UINT32 state, cpuinfo *info)
236245#define CPU_GET_INFO_CALL(name)         CPU_GET_INFO_NAME(name)(device, state, info)
r4057r4058
304313#define CPU_EXPORT_STRING_CALL(name)   CPU_EXPORT_STRING_NAME(name)(device, baseptr, entry, string)
305314
306315
316/* base macro for defining CPU state entries */
317#define CPU_STATE_ENTRY(_index, _symbol, _format, _struct, _member, _datamask, _validmask, _flags) \
318   { _index, _validmask, offsetof(_struct, _member), _datamask, sizeof(((_struct *)0)->_member), _flags, _symbol, _format },
307319
308#define cpu_get_index(cpu)               device_list_index((cpu)->machine->config->devicelist, CPU, (cpu)->tag)
309320
310
311321/* helpers for accessing common CPU state */
312322#define cpu_get_context_size(cpu)         device_get_info_int(cpu, CPUINFO_INT_CONTEXT_SIZE)
313323#define cpu_get_input_lines(cpu)         device_get_info_int(cpu, CPUINFO_INT_INPUT_LINES)
r4057r4058
342352#define cpu_set_reg(cpu, reg, val)         device_set_info_int(cpu, CPUINFO_INT_REGISTER + (reg), (val))
343353
344354
345/* helpers for using machine/cputag instead of cpu objects */
346#define cputag_reset(mach, tag)                  device_reset(cputag_get_cpu(mach, tag))
347#define cputag_get_index(mach, tag)               cpu_get_index(cputag_get_cpu(mach, tag))
348#define cputag_get_address_space(mach, tag, space)   cpu_get_address_space(cputag_get_cpu(mach, tag), space)
349355
350
351#define CPU_STATE_ENTRY(_index, _symbol, _format, _struct, _member, _datamask, _validmask, _flags) \
352   { _index, _validmask, offsetof(_struct, _member), _datamask, sizeof(((_struct *)0)->_member), _flags, _symbol, _format },
353
354
355
356356/***************************************************************************
357357    TYPE DEFINITIONS
358358***************************************************************************/
359359
360/* opaque definition of CPU internal and debugging info */
361typedef struct _cpu_debug_data cpu_debug_data;
362
363
364360/* forward declaration of types */
365361typedef union _cpuinfo cpuinfo;
366362typedef struct _cpu_state_entry cpu_state_entry;
367363
368364
369/* define the various callback functions */
365/* IRQ callback to be called by CPU cores when an IRQ is actually taken */
370366typedef int (*cpu_irq_callback)(const device_config *device, int irqnum);
371367
368
369/* CPU interface functions */
372370typedef void (*cpu_get_info_func)(const device_config *device, UINT32 state, cpuinfo *info);
373371typedef void (*cpu_set_info_func)(const device_config *device, UINT32 state, cpuinfo *info);
374372typedef void (*cpu_init_func)(const device_config *device, cpu_irq_callback irqcallback);
r4057r4058
387385typedef void (*cpu_string_io_func)(const device_config *device, void *baseptr, const cpu_state_entry *entry, char *string);
388386
389387
388/* a cpu_type is just a pointer to the CPU's get_info function */
389typedef cpu_get_info_func cpu_type;
390
391
390392/* structure describing a single item of exposed CPU state */
391393struct _cpu_state_entry
392394{
r4057r4058
412414};
413415
414416
415/* a cpu_type is just a pointer to the CPU's get_info function */
416typedef cpu_get_info_func cpu_type;
417
418
419417/* cpuinfo union used to pass data to/from the get_info/set_info functions */
420418union _cpuinfo
421419{
r4057r4058
450448};
451449
452450
453/* partial data hanging off of the classtoken */
454typedef struct _cpu_class_header cpu_class_header;
455struct _cpu_class_header
456{
457   cpu_debug_data *      debug;                  /* debugging data */
458   const address_space *   space[ADDRESS_SPACES];      /* address spaces */
459451
460   /* table of core functions */
461   cpu_set_info_func      set_info;
462   cpu_execute_func      execute;
463   cpu_burn_func         burn;
464   cpu_translate_func      translate;
465   cpu_disassemble_func   disassemble;
466   cpu_disassemble_func    dasm_override;
467};
468
469
470
471/***************************************************************************
472    CPU DEFINITIONS
473***************************************************************************/
474
475#define cpu_count(config)      device_list_items((config)->devicelist, CPU)
476#define cpu_first(config)      device_list_first((config)->devicelist, CPU)
477#define cpu_next(previous)      device_list_next((previous), CPU)
478
479
480CPU_GET_INFO( dummy );
481#define CPU_DUMMY CPU_GET_INFO_NAME( dummy )
482
483
484
485/***************************************************************************
486    FUNCTION PROTOTYPES
487***************************************************************************/
488
489
490/* ----- live CPU accessors ----- */
491
492/* return the PC, corrected to a byte offset and translated to physical space, on a given CPU */
493offs_t cpu_get_physical_pc_byte(const device_config *cpu);
494
495/* disassemble a line at a given PC on a given CPU */
496offs_t cpu_dasm(const device_config *cpu, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
497
498/* set a dasm override handler */
499void cpu_set_dasm_override(const device_config *cpu, cpu_disassemble_func dasm_override);
500
501
502
503/***************************************************************************
504    INLINE FUNCTIONS
505***************************************************************************/
506
507/*-------------------------------------------------
508    cpu_get_class_header - return a pointer to
509    the class header
510-------------------------------------------------*/
511
512INLINE cpu_class_header *cpu_get_class_header(const device_config *device)
513{
514   if (device->token != NULL)
515      return (cpu_class_header *)((UINT8 *)device->token + device->tokenbytes) - 1;
516   return NULL;
517}
518
519
520/*-------------------------------------------------
521    cpu_get_debug_data - return a pointer to
522    the given CPU's debugger data
523-------------------------------------------------*/
524
525INLINE cpu_debug_data *cpu_get_debug_data(const device_config *device)
526{
527   cpu_class_header *classheader = cpu_get_class_header(device);
528   return classheader->debug;
529}
530
531
532/*-------------------------------------------------
533    cpu_get_address_space - return a pointer to
534    the given CPU's address space
535-------------------------------------------------*/
536
537INLINE const address_space *cpu_get_address_space(const device_config *device, int spacenum)
538{
539   /* it is faster to pull this from the class header, but only after we've started */
540   if (device->token != NULL)
541   {
542      cpu_class_header *classheader = cpu_get_class_header(device);
543      return classheader->space[spacenum];
544   }
545   return memory_find_address_space(device, spacenum);
546}
547
548
549/*-------------------------------------------------
550    cpu_execute - execute the requested cycles on
551    a given CPU
552-------------------------------------------------*/
553
554INLINE int cpu_execute(const device_config *device, int cycles)
555{
556   cpu_class_header *classheader = cpu_get_class_header(device);
557   return (*classheader->execute)(device, cycles);
558}
559
560
561452#endif   /* __CPUINTRF_H__ */
src/emu/cpuexec.h
r4057r4058
4949    TYPE DEFINITIONS
5050***************************************************************************/
5151
52/* opaque definition of CPU internal and debugging info */
53typedef struct _cpu_debug_data cpu_debug_data;
54
55
56/* interrupt callback for VBLANK and timed interrupts */
5257typedef void (*cpu_interrupt_func)(const device_config *device);
5358
5459
r4057r4058
6873};
6974
7075
76/* public data at the end of the device->token */
77typedef struct _cpu_class_header cpu_class_header;
78struct _cpu_class_header
79{
80   cpu_debug_data *      debug;               /* debugging data */
81   const address_space *   space[ADDRESS_SPACES];   /* address spaces */
82   cpu_set_info_func      set_info;            /* this CPU's set_info function */
83};
7184
85
86
7287/***************************************************************************
7388    CPU DEVICE CONFIGURATION MACROS
7489***************************************************************************/
r4057r4058
133148#define cputag_get_cpu(mach, tag)                              devtag_get_device(mach, CPU, tag)
134149
135150/* helpers for using machine/cputag instead of cpu objects */
151#define cputag_reset(mach, tag)                                 devtag_reset(mach, CPU, tag)
152#define cputag_get_index(mach, tag)                              cpu_get_index(cputag_get_cpu(mach, tag))
153#define cputag_get_address_space(mach, tag, space)                  cpu_get_address_space(cputag_get_cpu(mach, tag), space)
136154#define cputag_suspend(mach, tag, reason, eat)                     cpu_suspend(cputag_get_cpu(mach, tag), reason, eat)
137155#define cputag_resume(mach, tag, reason)                        cpu_resume(cputag_get_cpu(mach, tag), reason)
138156#define cputag_is_suspended(mach, tag, reason)                     cpu_is_suspended(cputag_get_cpu(mach, tag), reason)
r4057r4058
292310    INLINE FUNCTIONS
293311***************************************************************************/
294312
295
296313/*-------------------------------------------------
297314    cpu_get_type - return the type of the
298315    specified CPU
r4057r4058
305322}
306323
307324
325/*-------------------------------------------------
326    cpu_get_class_header - return a pointer to
327    the class header
328-------------------------------------------------*/
308329
330INLINE cpu_class_header *cpu_get_class_header(const device_config *device)
331{
332   if (device->token != NULL)
333      return (cpu_class_header *)((UINT8 *)device->token + device->tokenbytes) - 1;
334   return NULL;
335}
336
337
338/*-------------------------------------------------
339    cpu_get_debug_data - return a pointer to
340    the given CPU's debugger data
341-------------------------------------------------*/
342
343INLINE cpu_debug_data *cpu_get_debug_data(const device_config *device)
344{
345   cpu_class_header *classheader = cpu_get_class_header(device);
346   return classheader->debug;
347}
348
349
350/*-------------------------------------------------
351    cpu_get_address_space - return a pointer to
352    the given CPU's address space
353-------------------------------------------------*/
354
355INLINE const address_space *cpu_get_address_space(const device_config *device, int spacenum)
356{
357   /* it is faster to pull this from the class header, but only after we've started */
358   if (device->token != NULL)
359   {
360      cpu_class_header *classheader = cpu_get_class_header(device);
361      return classheader->space[spacenum];
362   }
363   return memory_find_address_space(device, spacenum);
364}
365
309366#endif   /* __CPUEXEC_H__ */
src/emu/sound/es8712.h
r4057r4058
1919WRITE16_HANDLER( es8712_data_1_msb_w );
2020WRITE16_HANDLER( es8712_data_2_msb_w );
2121
22SND_GET_INFO( es8712 );
23
2224#endif /* __ES8712_H__ */
src/emu/sound/nes_apu.h
r4057r4058
4747WRITE8_HANDLER( nes_psg_0_w );
4848WRITE8_HANDLER( nes_psg_1_w );
4949
50SND_GET_INFO( nesapu );
51
5052#endif /* __NES_APU_H__ */
src/emu/sound/262intf.h
r4057r4058
2626WRITE8_HANDLER( ymf262_data_a_1_w );
2727WRITE8_HANDLER( ymf262_data_b_1_w );
2828
29SND_GET_INFO( ymf262 );
2930
3031#endif /* __262INTF_H__ */
src/emu/sound/cdp1869.h
r4057r4058
4040void cdp1869_set_wnfreq(int which, int value);
4141void cdp1869_set_wnoff(int which, int value);
4242
43SND_GET_INFO( cdp1869 );
44
4345#endif /* __CDP1869_H__ */
src/emu/sound/sp0256.h
r4057r4058
3636READ16_HANDLER( spb640_r );
3737WRITE16_HANDLER( spb640_w );
3838
39SND_GET_INFO( sp0256 );
40
3941#endif /* __SP0256_H__ */
src/emu/sound/hc55516.h
r4057r4058
3434WRITE8_HANDLER( hc55516_1_digit_clock_clear_w );
3535READ8_HANDLER ( hc55516_1_clock_state_r );
3636
37SND_GET_INFO( hc55516 );
38SND_GET_INFO( mc3417 );
39SND_GET_INFO( mc3418 );
3740
3841#endif /* __HC55516_H__ */
src/emu/sound/iremga20.h
r4057r4058
1111WRITE16_HANDLER( irem_ga20_w );
1212READ16_HANDLER( irem_ga20_r );
1313
14SND_GET_INFO( iremga20 );
15
1416#endif /* __IREMGA20_H__ */
src/emu/sound/custom.h
r4057r4058
1818#define CUSTOM_STOP(name) void name(const device_config *device, void *token)
1919#define CUSTOM_RESET(name) void name(const device_config *device, void *token)
2020
21SND_GET_INFO( custom );
22
2123#endif /* __CUSTOM_H__ */
src/emu/sound/2612intf.h
r4057r4058
33#ifndef __2612INTF_H__
44#define __2612INTF_H__
55
6void ym2612_update_request(void *param);
7
68typedef struct _ym2612_interface ym2612_interface;
79struct _ym2612_interface
810{
r4057r4058
3234WRITE8_HANDLER( ym2612_data_port_1_a_w );
3335WRITE8_HANDLER( ym2612_data_port_1_b_w );
3436
37SND_GET_INFO( ym2612 );
3538
3639
3740typedef struct _ym3438_interface ym3438_interface;
r4057r4058
6366WRITE8_HANDLER( ym3438_data_port_1_a_w );
6467WRITE8_HANDLER( ym3438_data_port_1_b_w );
6568
69SND_GET_INFO( ym3438 );
6670
6771#endif /* __2612INTF_H__ */
src/emu/sound/c352.h
r4057r4058
66READ16_HANDLER( c352_0_r );
77WRITE16_HANDLER( c352_0_w );
88
9SND_GET_INFO( c352 );
10
911#endif /* __C352_H__ */
1012
src/emu/sound/k051649.h
r4057r4058
1010WRITE8_HANDLER( k051649_keyonoff_w );
1111WRITE8_HANDLER( k052539_waveform_w );
1212
13SND_GET_INFO( k051649 );
14
1315#endif /* __K051649_H__ */
src/emu/sound/k054539.h
r4057r4058
4545*/
4646void k054539_set_gain(int chip, int channel, double gain);
4747
48SND_GET_INFO( k054539 );
49
4850#endif /* __K054539_H__ */
src/emu/sound/namco52.h
r4057r4058
3030
3131void namcoio_52xx_write(int data);
3232
33SND_GET_INFO( namco_52xx );
34
3335#endif /* __NAMCO52_H__ */
3436
src/emu/sound/c140.h
r4057r4058
2323    int banking_type;
2424};
2525
26SND_GET_INFO( c140 );
27
2628#endif /* __C140_H__ */
src/emu/sound/msm5205.h
r4057r4058
3636
3737void msm5205_set_volume(int num,int volume);
3838
39SND_GET_INFO( msm5205 );
40
3941#endif /* __MSM5205_H__ */
src/emu/sound/qsound.h
r4057r4058
1616WRITE8_HANDLER( qsound_cmd_w );
1717READ8_HANDLER( qsound_status_r );
1818
19SND_GET_INFO( qsound );
20
1921#endif /* __QSOUND_H__ */
src/emu/sound/3812intf.c
r4057r4058
408408{
409409   struct y8950_info *info = param;
410410   /* temporary hack until this is converted to a device */
411   const address_space *space = cpu_get_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
411   const address_space *space = memory_find_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
412412   if (info->intf->portread)
413413      return info->intf->portread(space,info->index);
414414   return 0;
r4057r4058
418418{
419419   struct y8950_info *info = param;
420420   /* temporary hack until this is converted to a device */
421   const address_space *space = cpu_get_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
421   const address_space *space = memory_find_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
422422   if (info->intf->portwrite)
423423      info->intf->portwrite(space,info->index,data);
424424}
r4057r4058
427427{
428428   struct y8950_info *info = param;
429429   /* temporary hack until this is converted to a device */
430   const address_space *space = cpu_get_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
430   const address_space *space = memory_find_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
431431   if (info->intf->keyboardread)
432432      return info->intf->keyboardread(space,info->index);
433433   return 0;
r4057r4058
437437{
438438   struct y8950_info *info = param;
439439   /* temporary hack until this is converted to a device */
440   const address_space *space = cpu_get_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
440   const address_space *space = memory_find_address_space(info->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
441441   if (info->intf->keyboardwrite)
442442      info->intf->keyboardwrite(space,info->index,data);
443443}
src/emu/sound/3812intf.h
r4057r4058
3535READ8_HANDLER( ym3812_read_port_1_r );
3636WRITE8_HANDLER( ym3812_write_port_1_w );
3737
38SND_GET_INFO( ym3812 );
3839
3940/* YM3526 */
4041READ8_HANDLER ( ym3526_status_port_0_r );
r4057r4058
4748READ8_HANDLER( ym3526_read_port_1_r );
4849WRITE8_HANDLER( ym3526_write_port_1_w );
4950
51SND_GET_INFO( ym3526 );
5052
5153/* Y8950 */
5254READ8_HANDLER ( y8950_status_port_0_r );
r4057r4058
5961READ8_HANDLER ( y8950_read_port_1_r );
6062WRITE8_HANDLER( y8950_write_port_1_w );
6163
64SND_GET_INFO( y8950 );
65
6266#endif /* __3812INTF_H__ */
src/emu/sound/snkwave.h
r4057r4058
55
66WRITE8_HANDLER( snkwave_w );
77
8SND_GET_INFO( snkwave );
9
810#endif /* __SNKWAVE_H__ */
911
src/emu/sound/rf5c400.h
r4057r4058
88READ16_HANDLER( rf5c400_0_r );
99WRITE16_HANDLER( rf5c400_0_w );
1010
11SND_GET_INFO( rf5c400 );
12
1113#endif /* __RF5C400_H__ */
src/emu/sound/saa1099.h
r4057r4058
1717WRITE16_HANDLER( saa1099_control_port_1_lsb_w );
1818WRITE16_HANDLER( saa1099_write_port_1_lsb_w );
1919
20SND_GET_INFO( saa1099 );
21
2022#endif /* __SAA1099_H__ */
src/emu/sound/cem3394.h
r4057r4058
4343    CEM3394_FINAL_GAIN:         gain, in dB */
4444double cem3394_get_parameter(int chip, int input);
4545
46SND_GET_INFO( cem3394 );
4647
4748#endif /* __CEM3394_H__ */
src/emu/sound/ymz280b.c
r4057r4058
869869            if (chip->ext_ram_write)
870870            {
871871               /* temporary hack until this is converted to a device */
872               const address_space *space = cpu_get_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
872               const address_space *space = memory_find_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
873873               chip->ext_ram_write(space, chip->rom_readback_addr, data);
874874            }
875875            else
src/emu/sound/ymz280b.h
r4057r4058
4343WRITE16_HANDLER( ymz280b_data_1_lsb_w );
4444WRITE16_HANDLER( ymz280b_data_1_msb_w );
4545
46SND_GET_INFO( ymz280b );
47
4648#endif /* __YMZ280B_H__ */
src/emu/sound/rf5c68.h
r4057r4058
1313READ8_HANDLER( rf5c68_r );
1414WRITE8_HANDLER( rf5c68_w );
1515
16SND_GET_INFO( rf5c68 );
1617
1718#endif /* __RF5C68_H__ */
src/emu/sound/votrax.c
r4057r4058
1818#include "sndintrf.h"
1919#include "streams.h"
2020#include "samples.h"
21#include "votrax.h"
2122
2223
2324struct votrax_info
src/emu/sound/k005289.h
r4057r4058
1010WRITE8_HANDLER( k005289_keylatch_A_w );
1111WRITE8_HANDLER( k005289_keylatch_B_w );
1212
13SND_GET_INFO( k005289 );
14
1315#endif /* __K005289_H__ */
src/emu/sound/votrax.h
r0r4058
1#pragma once
2
3#ifndef __VOTRAX_H__
4#define __VOTRAX_H__
5
6void votrax_w(int data);
7int votrax_status_r(void);
8
9SND_GET_INFO( votrax );
10
11#endif /* __VOTRAX_H__ */
src/emu/sound/aica.c
r4057r4058
524524
525525   // get AICA RAM
526526   {
527      memset(AICA,0,sizeof(*AICA));
528
529527      if (sndindex == 0)
530528      {
531529         AICA->Master=1;
r4057r4058
720718static void AICA_UpdateReg(struct _AICA *AICA, int reg)
721719{
722720   /* temporary hack until this is converted to a device */
723   const address_space *space = cpu_get_address_space(AICA->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
721   const address_space *space = memory_find_address_space(AICA->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
724722   switch(reg&0xff)
725723   {
726724      case 0x4:
src/emu/sound/aica.h
r4057r4058
2525WRITE16_HANDLER( aica_midi_in );
2626READ16_HANDLER( aica_midi_out_r );
2727
28SND_GET_INFO( aica );
29
2830#endif /* __AICA_H__ */
src/emu/sound/astrocde.c
r4057r4058
216216   chip->c_state = 0;
217217}
218218
219SND_RESET( astrocade )
219static SND_RESET( astrocade )
220220{
221221   astrocade_reset(device->token);
222222}
src/emu/sound/sn76496.h
r4057r4058
99WRITE8_HANDLER( sn76496_3_w );
1010WRITE8_HANDLER( sn76496_4_w );
1111
12SND_GET_INFO( sn76496 );
13SND_GET_INFO( sn76489 );
14SND_GET_INFO( sn76489a );
15SND_GET_INFO( sn76494 );
16SND_GET_INFO( gamegear );
17SND_GET_INFO( smsiii );
18
1219#endif /* __SN76496_H__ */
src/emu/sound/wave.h
r4057r4058
1111#include "messdrv.h"
1212#endif
1313
14SND_GET_INFO( wave );
1415
1516
1617#endif /* __WAVE_H__ */
src/emu/sound/astrocde.h
r4057r4058
66WRITE8_HANDLER( astrocade_sound1_w );
77WRITE8_HANDLER( astrocade_sound2_w );
88
9SND_GET_INFO( astrocade );
10
911#endif /* __ASTROCDE_H__ */
src/emu/sound/x1_010.h
r4057r4058
1919
2020void seta_sound_enable_w(int);
2121
22SND_GET_INFO( x1_010 );
23
2224#endif /* __X1_010_H__ */
src/emu/sound/sid.h
r4057r4058
6262int sid6581_port_r (running_machine *machine, SID6581 *This, int offset);
6363void sid6581_port_w (SID6581 *This, int offset, int data);
6464
65void sid_set_type(SID6581 *This, SIDTYPE type);
66
6765void sidEmuFillBuffer(SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen );
6866
6967#endif /* __SID_H__ */
src/emu/sound/ymf271.c
r4057r4058
13751375static UINT8 ymf271_read_ext_memory(YMF271Chip *chip, UINT32 address)
13761376{
13771377   /* temporary hack until this is converted to a device */
1378   const address_space *space = cpu_get_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1378   const address_space *space = memory_find_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
13791379   if( chip->ext_mem_read ) {
13801380      return chip->ext_mem_read(space,address);
13811381   } else {
r4057r4058
13881388static void ymf271_write_ext_memory(YMF271Chip *chip, UINT32 address, UINT8 data)
13891389{
13901390   /* temporary hack until this is converted to a device */
1391   const address_space *space = cpu_get_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1391   const address_space *space = memory_find_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
13921392   if( chip->ext_mem_write ) {
13931393      chip->ext_mem_write(space, address, data);
13941394   }
src/emu/sound/pokey.c
r4057r4058
833833   }
834834#endif
835835
836   space = cpu_get_address_space(p->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
836   space = memory_find_address_space(p->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
837837   switch (offs & 15)
838838   {
839839   case POT0_C: case POT1_C: case POT2_C: case POT3_C:
r4057r4058
985985{
986986   struct POKEYregisters *p = sndti_token(SOUND_POKEY, chip);
987987   /* temporary hack until this is converted to a device */
988   const address_space *space = cpu_get_address_space(p->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
988   const address_space *space = memory_find_address_space(p->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
989989   int ch_mask = 0, new_val;
990990
991991#ifdef MAME_DEBUG
src/emu/sound/sp0250.c
r4057r4058
2020#include "sndintrf.h"
2121#include "streams.h"
2222#include "cpuintrf.h"
23#include "cpuexec.h"
2324#include "sp0250.h"
2425
2526/*
r4057r4058
106107   sp->filter[5].B = sp0250_gc(sp->fifo[13]);
107108   sp->filter[5].F = sp0250_gc(sp->fifo[14]);
108109   sp->fifo_pos = 0;
109   sp->drq(ASSERT_LINE);
110   if (sp->drq != NULL)
111      sp->drq(ASSERT_LINE);
110112
111113   sp->pcount = 0;
112114   sp->rcount = 0;
r4057r4058
198200   sp = auto_malloc(sizeof(*sp));
199201   memset(sp, 0, sizeof(*sp));
200202   sp->RNG = 1;
201   sp->drq = intf->drq_callback;
202   sp->drq(ASSERT_LINE);
203   timer_pulse(device->machine, attotime_mul(ATTOTIME_IN_HZ(clock), CLOCK_DIVIDER), sp, 0, sp0250_timer_tick);
203   sp->drq = (intf != NULL) ? intf->drq_callback : NULL;
204   if (sp->drq != NULL)
205   {
206      sp->drq(ASSERT_LINE);
207      timer_pulse(device->machine, attotime_mul(ATTOTIME_IN_HZ(clock), CLOCK_DIVIDER), sp, 0, sp0250_timer_tick);
208   }
204209
205210   sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0250_update);
206211
r4057r4058
211216WRITE8_HANDLER( sp0250_w )
212217{
213218   struct sp0250 *sp = sndti_token(SOUND_SP0250, 0);
219   stream_update(sp->stream);
214220   if (sp->fifo_pos != 15)
215221   {
216222      sp->fifo[sp->fifo_pos++] = data;
217      if (sp->fifo_pos == 15)
223      if (sp->fifo_pos == 15 && sp->drq != NULL)
218224         sp->drq(CLEAR_LINE);
219225   }
226   else
227      logerror("%s: overflow SP0250 FIFO\n", cpuexec_describe_context(space->machine));
220228}
221229
222230
231UINT8 sp0250_drq_r(void)
232{
233   struct sp0250 *sp = sndti_token(SOUND_SP0250, 0);
234   stream_update(sp->stream);
235   return (sp->fifo_pos == 15) ? CLEAR_LINE : ASSERT_LINE;
236}
223237
238
239
224240/**************************************************************************
225241 * Generic get_info
226242 **************************************************************************/
src/emu/sound/upd7759.h
r4057r4058
2929WRITE8_HANDLER( upd7759_0_start_w );
3030READ8_HANDLER( upd7759_0_busy_r );
3131
32SND_GET_INFO( upd7759 );
33
3234#endif /* __UPD7759_H__ */
src/emu/sound/ymf271.h
r4057r4058
1616READ8_HANDLER( ymf271_1_r );
1717WRITE8_HANDLER( ymf271_1_w );
1818
19SND_GET_INFO( ymf271 );
20
1921#endif /* __YMF271_H__ */
src/emu/sound/n63701x.h
r4057r4058
55
66void namco_63701x_write(int offset,int data);
77
8SND_GET_INFO( namco_63701x );
9
810#endif /* __N63701X_H__ */
src/emu/sound/ay8910.c
r4057r4058
387387static void ay8910_write_reg(ay8910_context *psg, int r, int v)
388388{
389389   /* temporary hack until this is converted to a device */
390   const address_space *space = cpu_get_address_space(psg->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
390   const address_space *space = memory_find_address_space(psg->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
391391
392392   //if (r >= 11 && r <= 13 ) printf("%d %x %02x\n", PSG->index, r, v);
393393   psg->regs[r] = v;
r4057r4058
783783{
784784   ay8910_context *psg = chip;
785785   /* temporary hack until this is converted to a device */
786   const address_space *space = cpu_get_address_space(psg->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
786   const address_space *space = memory_find_address_space(psg->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
787787   int r = psg->register_latch;
788788
789789   if (r > 15) return 0;
src/emu/sound/pokey.h
r4057r4058
106106void pokey3_kbcode_w (int kbcode, int make);
107107void pokey4_kbcode_w (int kbcode, int make);
108108
109SND_GET_INFO( pokey );
110
109111#endif   /* __POKEY_H__ */
src/emu/sound/sp0250.h
r4057r4058
88};
99
1010WRITE8_HANDLER( sp0250_w );
11UINT8 sp0250_drq_r(void);
1112
13SND_GET_INFO( sp0250 );
14
1215#endif /* __SP0250_H__ */
src/emu/sound/ym2151.c
r4057r4058
10461046{
10471047   YM2151 *chip = _chip;
10481048   /* temporary hack until this is converted to a device */
1049   const address_space *space = cpu_get_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1049   const address_space *space = memory_find_address_space(chip->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
10501050   YM2151Operator *op = &chip->oper[ (r&0x07)*4+((r&0x18)>>3) ];
10511051
10521052   /* adjust bus to 8 bits */
src/emu/sound/speaker.h
r4057r4058
2525
2626void speaker_level_w (int which, int new_level);
2727
28SND_GET_INFO( speaker );
29
2830#ifdef __cplusplus
2931}
3032#endif
src/emu/sound/ay8910.h
r4057r4058
134134void ay8910_write_ym(void *chip, int addr, int data);
135135int ay8910_read_ym(void *chip);
136136
137SND_GET_INFO( ay8910 );
138SND_GET_INFO( ay8912 );
139SND_GET_INFO( ay8913 );
140SND_GET_INFO( ay8930 );
141SND_GET_INFO( ym2149 );
142SND_GET_INFO( ym3439 );
143SND_GET_INFO( ymz284 );
144SND_GET_INFO( ymz294 );
145
137146#endif /* __AY8910_H__ */
src/emu/sound/cdda.h
r4057r4058
1515int cdda_audio_paused(int num);
1616int cdda_audio_ended(int num);
1717
18SND_GET_INFO( cdda );
19
1820#endif /* __CDDA_H__ */
src/emu/sound/tms36xx.h
r4057r4058
2626/* TMS3617 interface functions */
2727extern void tms3617_enable_w(int chip, int enable);
2828
29SND_GET_INFO( tms36xx );
30
2931#endif /* __TMS36XX_H__ */
src/emu/sound/st0016.h
r4057r4058
1313
1414WRITE8_HANDLER(st0016_snd_w);
1515
16SND_GET_INFO( st0016 );
17
1618#endif /* __ST0016_H__ */
src/emu/sound/tiaintf.h
r4057r4058
55
66WRITE8_HANDLER( tia_sound_w );
77
8SND_GET_INFO( tia );
9
810#endif /* __TIAINTF_H__ */
src/emu/sound/c6280.h
r4057r4058
88WRITE8_HANDLER( c6280_1_w );
99READ8_HANDLER( c6280_r );
1010
11SND_GET_INFO( c6280 );
12
1113#endif /* __C6280_H__ */
src/emu/sound/discrete.h
r4057r4058
43054305READ8_HANDLER(discrete_sound_2_r);
43064306READ8_HANDLER(discrete_sound_3_r);
43074307
4308SND_GET_INFO( discrete );
4309
43084310#endif /* __DISCRETE_H__ */
src/emu/sound/scsp.c
r4057r4058
698698static void SCSP_UpdateReg(struct _SCSP *SCSP, int reg)
699699{
700700   /* temporary hack until this is converted to a device */
701   const address_space *space = cpu_get_address_space(SCSP->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
701   const address_space *space = memory_find_address_space(SCSP->device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
702702   switch(reg&0x3f)
703703   {
704704      case 0x2:
src/emu/sound/samples.h
r4057r4058
5252/* drivers as well (e.g. a sound chip emulator needing drum samples) */
5353struct loaded_samples *readsamples(const char *const *samplenames, const char *name);
5454
55SND_GET_INFO( samples );
56
5557#endif /* __SAMPLES_H__ */
src/emu/sound/msm5232.h
r4057r4058
1515
1616void msm5232_set_clock(void *chip, int clock);
1717
18SND_GET_INFO( msm5232 );
19
1820#endif /* __MSM5232_H__ */
src/emu/sound/scsp.h
r4057r4058
2828
2929extern UINT32* stv_scu;
3030
31SND_GET_INFO( scsp );
32
3133#endif /* __SCSP_H__ */
src/emu/sound/flt_rc.h
r4057r4058
5858
5959void filter_rc_set_RC(int num, int type, double R1, double R2, double R3, double C);
6060
61SND_GET_INFO( filter_rc );
62
6163#endif /* __FLT_RC_H__ */
src/emu/sound/2610intf.h
r4057r4058
66#include "fm.h"
77
88
9void ym2610_update_request(void *param);
10
911typedef struct _ym2610_interface ym2610_interface;
1012struct _ym2610_interface
1113{
r4057r4058
4850WRITE8_HANDLER( ym2610_data_port_1_b_w );
4951WRITE16_HANDLER( ym2610_data_port_1_b_lsb_w );
5052
53SND_GET_INFO( ym2610 );
54SND_GET_INFO( ym2610b );
55
56
5157#endif /* __2610INTF_H__ */
src/emu/sound/beep.h
r4057r4058
1111void beep_set_frequency(int,int);
1212void beep_set_volume(int,int);
1313
14SND_GET_INFO( beep );
15
1416#ifdef __cplusplus
1517}
1618#endif
src/emu/sound/tms3615.h
r4057r4058
88#define TMS3615_FOOTAGE_8   0
99#define TMS3615_FOOTAGE_16   1
1010
11SND_GET_INFO( tms3615 );
12
1113#endif /* __TMS3615_H__ */
src/emu/sound/ics2115.h
r4057r4058
1111READ8_HANDLER( ics2115_r );
1212WRITE8_HANDLER( ics2115_w );
1313
14SND_GET_INFO( ics2115 );
15
1416#endif /* __ICS2115_H__ */
src/emu/sound/dac.h
r4057r4058
1515WRITE8_HANDLER( dac_1_signed_data_w );
1616WRITE8_HANDLER( dac_2_signed_data_w );
1717
18SND_GET_INFO( dac );
19
1820#endif /* __DAC_H__ */
src/emu/sound/s14001a.h
r4057r4058
99void s14001a_set_clock(int clock);     /* set VSU-1000 clock */
1010void s14001a_set_volume(int volume);    /* set VSU-1000 volume control */
1111
12SND_GET_INFO( s14001a );
13
1214#endif /* __S14001A_H__ */
1315
src/emu/sound/gaelco.h
r4057r4058
1515WRITE16_HANDLER( gaelcosnd_w );
1616READ16_HANDLER( gaelcosnd_r );
1717
18SND_GET_INFO( gaelco_gae1 );
19SND_GET_INFO( gaelco_cg1v );
20
1821#endif /* __GALELCO_H__ */
src/emu/sound/bsmt2000.h
r4057r4058
1212
1313WRITE16_HANDLER( bsmt2000_data_0_w );
1414
15SND_GET_INFO( bsmt2000 );
16
1517#endif /* __BSMT2000_H__ */
src/emu/sound/dmadac.h
r4057r4058
1515void dmadac_set_frequency(UINT8 first_channel, UINT8 num_channels, double frequency);
1616void dmadac_set_volume(UINT8 first_channel, UINT8 num_channels, UINT16 volume);
1717
18SND_GET_INFO( dmadac );
19
1820#endif /* __DMADAC_H__ */
src/emu/sound/2608intf.h
r4057r4058
66#include "fm.h"
77#include "ay8910.h"
88
9void ym2608_update_request(void *param);
10
911typedef struct _ym2608_interface ym2608_interface;
1012struct _ym2608_interface
1113{
r4057r4058
3537WRITE8_HANDLER( ym2608_data_port_1_a_w );
3638WRITE8_HANDLER( ym2608_data_port_1_b_w );
3739
40SND_GET_INFO( ym2608 );
41
3842#endif /* __2608INTF_H__ */
src/emu/sound/okim6295.h
r4057r4058
5555void reset_adpcm(struct adpcm_state *state);
5656INT16 clock_adpcm(struct adpcm_state *state, UINT8 nibble);
5757
58SND_GET_INFO( okim6295 );
5859
5960#endif /* __OKIM6295_H__ */
src/emu/sound/es5506.h
r4057r4058
2727void es5505_voice_bank_0_w(int voice, int bank);
2828void es5505_voice_bank_1_w(int voice, int bank);
2929
30SND_GET_INFO( es5505 );
3031
3132
3233typedef struct _es5506_interface es5506_interface;
r4057r4058
5354void es5506_voice_bank_0_w(int voice, int bank);
5455void es5506_voice_bank_1_w(int voice, int bank);
5556
57SND_GET_INFO( es5506 );
58
5659#endif /* __ES5506_H__ */
src/emu/sound/ymf278b.h
r4057r4058
3030WRITE8_HANDLER( ymf278b_control_port_1_c_w );
3131WRITE8_HANDLER( ymf278b_data_port_1_c_w );
3232
33SND_GET_INFO( ymf278b );
34
3335#endif /* __YMF278B_H__ */
src/emu/sound/sid6581.h
r4057r4058
3232WRITE8_HANDLER ( sid6581_0_port_w );
3333WRITE8_HANDLER ( sid6581_1_port_w );
3434
35SND_GET_INFO( sid6581 );
36SND_GET_INFO( sid8580 );
37
3538#endif /* __SID6581_H__ */
src/emu/sound/flt_vol.h
r4057r4058
55
66void flt_volume_set_volume(int num, float volume);
77
8SND_GET_INFO( filter_volume );
9
810#endif /* __FLT_VOL_H__ */
src/emu/sound/5220intf.h
r4057r4058
3030   SNDINFO_INT_TMS5220_VARIANT = SNDINFO_INT_CORE_SPECIFIC
3131};
3232
33SND_GET_INFO( tms5220 );
34SND_GET_INFO( tmc0285 );
35SND_GET_INFO( tms5200 );
36
3337#endif /* __5200INTF_H__ */
src/emu/sound/2151intf.h
r4057r4058
3737WRITE16_HANDLER( ym2151_data_port_1_lsb_w );
3838WRITE16_HANDLER( ym2151_data_port_2_lsb_w );
3939
40SND_GET_INFO( ym2151 );
41
4042#endif /* __2151INTF_H__ */
4143
4244
src/emu/sound/psx.h
r4057r4058
2727   void (*spu_install_write_handler)(int,spu_handler);
2828};
2929
30SND_GET_INFO( psxspu );
31
3032#endif /* __SOUND_PSX_H__ */
src/emu/sound/k053260.h
r4057r4058
2525WRITE16_HANDLER( k053260_1_lsb_w );
2626READ16_HANDLER( k053260_1_lsb_r );
2727
28SND_GET_INFO( k053260 );
29
2830#endif /* __K053260_H__ */
src/emu/sound/2413intf.h
r4057r4058
2424WRITE16_HANDLER( ym2413_data_port_2_lsb_w );
2525WRITE16_HANDLER( ym2413_data_port_3_lsb_w );
2626
27SND_GET_INFO( ym2413 );
28
2729#endif /* __2413INTF_H__ */
src/emu/sound/segapcm.h
r4057r4058
2323WRITE8_HANDLER( sega_pcm_w );
2424READ8_HANDLER( sega_pcm_r );
2525
26SND_GET_INFO( segapcm );
27
2628#endif /* __SEGAPCM_H__ */
src/emu/sound/vrender0.h
r4057r4058
1515READ32_HANDLER(vr0_snd_read);
1616WRITE32_HANDLER(vr0_snd_write);
1717
18SND_GET_INFO( vrender0 );
19
1820#endif /* __VRENDER0_H__ */
src/emu/sound/multipcm.h
r4057r4058
1010
1111void multi_pcm_set_bank(int which, UINT32 leftoffs, UINT32 rightoffs);
1212
13SND_GET_INFO( multipcm );
14
1315#endif /* __MULTIPCM_H__ */
src/emu/sound/namco.h
r4057r4058
3030#define pacman_soundregs namco_soundregs
3131#define polepos_soundregs namco_soundregs
3232
33SND_GET_INFO( namco );
34SND_GET_INFO( namco_15xx );
35SND_GET_INFO( namco_cus30 );
36
3337#endif /* __NAMCO_H__ */
3438
src/emu/sound/sn76477.h
r4057r4058
124124void sn76477_vco_voltage_w(int chip, double data);
125125void sn76477_pitch_voltage_w(int chip, double data);
126126
127SND_GET_INFO( sn76477 );
128
127129#endif/* __SN76477_H__ */
src/emu/sound/vlm5030.h
r4057r4058
2323/* set ST pin level  : set table address A0-A7 / start speech */
2424void vlm5030_st(int pin );
2525
26SND_GET_INFO( vlm5030 );
27
2628#endif /* __VLM5030_H__ */
src/emu/sound/5110intf.h
r4057r4058
2222
2323void tms5110_set_frequency(int frequency);
2424
25SND_GET_INFO( tms5110 );
26SND_GET_INFO( tms5100 );
27SND_GET_INFO( tms5110a );
28SND_GET_INFO( cd2801 );
29SND_GET_INFO( tmc0281 );
30SND_GET_INFO( cd2802 );
31SND_GET_INFO( m58817 );
32
2533#endif /* __5110INTF_H__ */
src/emu/sound/2203intf.h
r4057r4058
55
66#include "ay8910.h"
77
8void ym2203_update_request(void *param);
9
810typedef struct _ym2203_interface ym2203_interface;
911struct _ym2203_interface
1012{
r4057r4058
6466WRITE8_HANDLER( ym2203_word_0_w );
6567WRITE8_HANDLER( ym2203_word_1_w );
6668
69SND_GET_INFO( ym2203 );
70
6771#endif /* __2203INTF_H__ */
src/emu/sound/k007232.h
r4057r4058
3232*/
3333void k007232_set_volume(int chip,int channel,int volumeA,int volumeB);
3434
35SND_GET_INFO( k007232 );
36
3537#endif /* __K007232_H__ */
src/emu/sound/okim6258.h
r4057r4058
2626
2727void okim6258_set_divider(int which, int val);
2828void okim6258_set_clock(int which, int val);
29int okim6258_get_vclk(int which);
2930
3031READ8_HANDLER( okim6258_status_0_r );
3132READ16_HANDLER( okim6258_status_0_lsb_r );
3233READ16_HANDLER( okim6258_status_0_msb_r );
34READ8_HANDLER( okim6258_data_0_r );
35READ16_HANDLER( okim6258_data_0_lsb_r );
36READ16_HANDLER( okim6258_data_0_msb_r );
3337WRITE8_HANDLER( okim6258_data_0_w );
34READ8_HANDLER( okim6258_data_0_r );
35WRITE8_HANDLER( okim6258_ctrl_0_w );
38WRITE8_HANDLER( okim6258_data_1_w );
39WRITE8_HANDLER( okim6258_data_2_w );
3640WRITE16_HANDLER( okim6258_data_0_lsb_w );
41WRITE16_HANDLER( okim6258_data_1_lsb_w );
42WRITE16_HANDLER( okim6258_data_2_lsb_w );
43WRITE16_HANDLER( okim6258_data_0_msb_w );
44WRITE16_HANDLER( okim6258_data_1_msb_w );
45WRITE16_HANDLER( okim6258_data_2_msb_w );
3746WRITE16_HANDLER( okim6258_ctrl_0_lsb_w );
38READ16_HANDLER( okim6258_data_0_lsb_r );
39READ16_HANDLER( okim6258_data_0_msb_r );
4047
48SND_GET_INFO( okim6258 );
49
4150#endif /* __OKIM6258_H__ */
src/emu/sound/es5503.h
r4057r4058
1515WRITE8_HANDLER(es5503_reg_0_w);
1616void es5503_set_base_0(UINT8 *wavemem);
1717
18SND_GET_INFO( es5503 );
19
1820#endif /* __ES5503_H__ */
src/emu/sound/nile.h
r4057r4058
1010WRITE16_HANDLER(nile_sndctrl_w);
1111READ16_HANDLER(nile_sndctrl_r);
1212
13SND_GET_INFO( nile );
14
1315#endif /* __NILE_H__ */
src/emu/devconv.h
r4057r4058
566566WRITE##bits##_DEVICE_HANDLER( name##_w )                     \
567567{                                                   \
568568   if (cond)                                          \
569      return func(handler, device, offset, data, mem_mask);      \
569      func(handler, device, offset, data, mem_mask);            \
570570}
571571
572572
src/emu/ui.c
r4057r4058
10581058         const screen_config *scrconfig = screen->inline_config;
10591059
10601060         if (scrcount > 1)
1061         {
10611062            astring_catc(string, slider_get_screen_desc(screen));
1063            astring_catc(string, ": ");
1064         }
10621065
10631066         if (scrconfig->type == SCREEN_TYPE_VECTOR)
10641067            astring_catc(string, "Vector\n");
r4057r4058
11711174
11721175   /* draw the profiler if visible */
11731176   if (show_profiler)
1174      ui_draw_text_full(profiler_get_text(machine), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
1177   {
1178      astring *profilertext = profiler_get_text(machine, astring_alloc());
1179      ui_draw_text_full(astring_c(profilertext), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
1180      astring_free(profilertext);
1181   }
11751182
11761183   /* if we're single-stepping, pause now */
11771184   if (single_step)
src/emu/profiler.c
r4057r4058
1414#include "profiler.h"
1515
1616
17/* in usrintf.c */
18static int use_profiler;
1917
18/***************************************************************************
19    TYPE DEFINITIONS
20***************************************************************************/
2021
21#define MEMORY 6
22
23typedef struct _profile_data profile_data;
24struct _profile_data
22typedef struct _profile_string profile_string;
23struct _profile_string
2524{
26   UINT64 count[MEMORY][PROFILER_TOTAL];
27   unsigned int cpu_context_switches[MEMORY];
25   int       type;
26   const char *string;
2827};
2928
30static profile_data profile;
31static int memory;
3229
3330
34static int FILO_type[10];
35static osd_ticks_t FILO_start[10];
36static int FILO_length;
31/***************************************************************************
32    GLOBAL VARIABLES
33***************************************************************************/
3734
38void profiler_start(void)
39{
40   use_profiler = 1;
41   FILO_length = 0;
42}
35profiler_state global_profiler;
4336
44void profiler_stop(void)
45{
46   use_profiler = 0;
47}
4837
49void profiler_mark(int type)
50{
51   osd_ticks_t curr_ticks;
5238
39/***************************************************************************
40    CORE FUNCTIONS
41***************************************************************************/
5342
54   if (!use_profiler)
55   {
56      FILO_length = 0;
57      return;
58   }
43/*-------------------------------------------------
44    _profiler_mark - mark the beginning/end of a
45    profiler entry
46-------------------------------------------------*/
5947
60   if (type >= PROFILER_CPU1 && type <= PROFILER_CPU8)
61      profile.cpu_context_switches[memory]++;
48void _profiler_mark(int type)
49{
50   profiler_data *data = &global_profiler.data[global_profiler.dataindex];
51   osd_ticks_t curticks = osd_profiling_ticks();
6252
63   curr_ticks = osd_profiling_ticks();
53   /* track context switches */
54   if (type >= PROFILER_CPU_FIRST && type <= PROFILER_CPU_MAX)
55      data->context_switches++;
6456
57   /* if we're starting a new bucket, begin now */
6558   if (type != PROFILER_END)
6659   {
67      if (FILO_length > 0)
60      int index = global_profiler.filoindex++;
61      profiler_filo_entry *entry = &global_profiler.filo[index];
62
63      /* fail if we overflow */
64      if (index > ARRAY_LENGTH(global_profiler.filo))
65         fatalerror("Profiler FILO overflow\n");
66
67      /* if we're nested, stop the previous entry */
68      if (index > 0)
6869      {
69         if (FILO_length >= 10)
70         {
71logerror("Profiler error: FILO buffer overflow\n");
72            return;
73         }
70         profiler_filo_entry *preventry = entry - 1;
71         data->duration[preventry->type] += curticks - preventry->start;
72      }
7473
75         /* handle nested calls */
76         profile.count[memory][FILO_type[FILO_length-1]] += curr_ticks - FILO_start[FILO_length-1];
77      }
78      FILO_type[FILO_length] = type;
79      FILO_start[FILO_length] = curr_ticks;
80      FILO_length++;
74      /* fill in this entry */
75      entry->type = type;
76      entry->start = curticks;
8177   }
82   else
78
79   /* if we're ending an existing bucket, update the time */
80   else if (global_profiler.filoindex > 0)
8381   {
84      if (FILO_length <= 0)
85      {
86logerror("Profiler error: FILO buffer underflow\n");
87         return;
88      }
82      int index = --global_profiler.filoindex;
83      profiler_filo_entry *entry = &global_profiler.filo[index];
8984
90      FILO_length--;
91      profile.count[memory][FILO_type[FILO_length]] += curr_ticks - FILO_start[FILO_length];
92      if (FILO_length > 0)
85      /* account for the time taken */
86      data->duration[entry->type] += curticks - entry->start;
87
88      /* if we have a previous entry, restart his time now */
89      if (index != 0)
9390      {
94         /* handle nested calls */
95         FILO_start[FILO_length-1] = curr_ticks;
91         profiler_filo_entry *preventry = entry - 1;
92         preventry->start = curticks;
9693      }
9794   }
9895}
9996
100const char *profiler_get_text(running_machine *machine)
97
98/*-------------------------------------------------
99    _profiler_get_text - return the current text
100    in an astring
101-------------------------------------------------*/
102
103astring *_profiler_get_text(running_machine *machine, astring *string)
101104{
102   int i,j;
103   UINT64 total,normalize;
104   UINT64 computed;
105   static const char *const names[PROFILER_TOTAL] =
105   static const profile_string names[] =
106106   {
107      "CPU 1  ",
108      "CPU 2  ",
109      "CPU 3  ",
110      "CPU 4  ",
111      "CPU 5  ",
112      "CPU 6  ",
113      "CPU 7  ",
114      "CPU 8  ",
115      "Mem rd ",
116      "Mem wr ",
117      "Video  ",
118      "drawgfx",
119      "copybmp",
120      "tmdraw ",
121      "tmdrroz",
122      "tmupdat",
123      "Artwork",
124      "Blit   ",
125      "Sound  ",
126      "Mixer  ",
127      "Callbck",
128      "Input  ",
129      "Movie  ",
130      "Logerr ",
131      "Extra  ",
132      "User1  ",
133      "User2  ",
134      "User3  ",
135      "User4  ",
136      "Profilr",
137      "Idle   ",
107      { PROFILER_MEMREAD,          "Memory Read" },
108      { PROFILER_MEMWRITE,         "Memory Write" },
109      { PROFILER_VIDEO,            "Video Update" },
110      { PROFILER_DRAWGFX,          "drawgfx" },
111      { PROFILER_COPYBITMAP,       "copybitmap" },
112      { PROFILER_TILEMAP_DRAW,     "Tilemap Draw" },
113      { PROFILER_TILEMAP_DRAW_ROZ, "Tilemap ROZ Draw" },
114      { PROFILER_TILEMAP_UPDATE,   "Tilemap Update" },
115      { PROFILER_BLIT,             "OSD Blitting" },
116      { PROFILER_SOUND,            "Sound Generation" },
117      { PROFILER_TIMER_CALLBACK,   "Timer Callbacks" },
118      { PROFILER_INPUT,            "Input Processing" },
119      { PROFILER_MOVIE_REC,        "Movie Recording" },
120      { PROFILER_LOGERROR,         "Error Logging" },
121      { PROFILER_EXTRA,            "Unaccounted/Overhead" },
122      { PROFILER_USER1,            "User 1" },
123      { PROFILER_USER2,            "User 2" },
124      { PROFILER_USER3,            "User 3" },
125      { PROFILER_USER4,            "User 4" },
126      { PROFILER_PROFILER,         "Profiler" },
127      { PROFILER_IDLE,             "Idle" }
138128   };
139   static int showdelay[PROFILER_TOTAL];
140   static char buf[50*40];
141   char *bufptr = buf;
129   UINT64 computed, normalize, total;
130   int curtype, curmem, switches;
142131
143
144   if (!use_profiler) return "";
145
146132   profiler_mark(PROFILER_PROFILER);
147133
134   /* compute the total time for all bits, not including profiler or idle */
148135   computed = 0;
149   i = 0;
150   while (i < PROFILER_PROFILER)
151   {
152      for (j = 0;j < MEMORY;j++)
153         computed += profile.count[j][i];
154      i++;
155   }
136   for (curtype = 0; curtype < PROFILER_PROFILER; curtype++)
137      for (curmem = 0; curmem < ARRAY_LENGTH(global_profiler.data); curmem++)
138         computed += global_profiler.data[curmem].duration[curtype];
139
140   /* save that result in normalize, and continue adding the rest */
156141   normalize = computed;
157   while (i < PROFILER_TOTAL)
158   {
159      for (j = 0;j < MEMORY;j++)
160         computed += profile.count[j][i];
161      i++;
162   }
142   for ( ; curtype < PROFILER_TOTAL; curtype++)
143      for (curmem = 0; curmem < ARRAY_LENGTH(global_profiler.data); curmem++)
144         computed += global_profiler.data[curmem].duration[curtype];
145
146   /* this becomes the total; if we end up with 0 for anything, we were just started, so return empty */
163147   total = computed;
148   astring_reset(string);
149   if (total == 0 || normalize == 0)
150      return string;
164151
165   if (total == 0 || normalize == 0) return "";   /* we have been just reset */
166
167   for (i = 0;i < PROFILER_TOTAL;i++)
152   /* loop over all types and generate the string */
153   for (curtype = 0; curtype < PROFILER_TOTAL; curtype++)
168154   {
155      /* determine the accumulated time for this type */
169156      computed = 0;
157      for (curmem = 0; curmem < ARRAY_LENGTH(global_profiler.data); curmem++)
158         computed += global_profiler.data[curmem].duration[curtype];
159
160      /* if we have non-zero data and we're ready to display, do it */
161      if (global_profiler.dataready && computed != 0)
170162      {
171         for (j = 0;j < MEMORY;j++)
172            computed += profile.count[j][i];
173      }
174      if (computed || showdelay[i])
175      {
176         if (computed) showdelay[i] = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds);
177         showdelay[i]--;
163         int nameindex;
178164
179         if (i < PROFILER_PROFILER)
180            bufptr += sprintf(bufptr,"%02d%% %02d%% %s\n",
181                  (int)((computed * 100 + total/2) / total),
182                  (int)((computed * 100 + normalize/2) / normalize),
183                  names[i]);
165         /* start with the un-normalized percentage */
166         astring_catprintf(string, "%02d%% ", (int)((computed * 100 + total/2) / total));
167
168         /* followed by the normalized percentage for everything but profiler and idle */
169         if (curtype < PROFILER_PROFILER)
170            astring_catprintf(string, "%02d%% ", (int)((computed * 100 + normalize/2) / normalize));
171
172         /* and then the text */
173         if (curtype >= PROFILER_CPU_FIRST && curtype <= PROFILER_CPU_MAX)
174            astring_catprintf(string, "CPU '%s'", device_list_find_by_index(machine->config->devicelist, CPU, curtype - PROFILER_CPU_FIRST)->tag);
184175         else
185            bufptr += sprintf(bufptr,"%02d%% %s\n",
186                  (int)((computed * 100 + total/2) / total),
187                  names[i]);
176            for (nameindex = 0; nameindex < ARRAY_LENGTH(names); nameindex++)
177               if (names[nameindex].type == curtype)
178               {
179                  astring_catc(string, names[nameindex].string);
180                  break;
181               }
182
183         /* followed by a carriage return */
184         astring_catc(string, "\n");
188185      }
189186   }
190187
191   i = 0;
192   for (j = 0;j < MEMORY;j++)
193      i += profile.cpu_context_switches[j];
194   bufptr += sprintf(bufptr,"%4d CPU switches\n",i / MEMORY);
188   /* followed by context switches */
189   if (global_profiler.dataready)
190   {
191      switches = 0;
192      for (curmem = 0; curmem < ARRAY_LENGTH(global_profiler.data); curmem++)
193         switches += global_profiler.data[curmem].context_switches;
194      astring_catprintf(string, "%d CPU switches\n", switches / ARRAY_LENGTH(global_profiler.data));
195   }
195196
196   /* reset the counters */
197   memory = (memory + 1) % MEMORY;
198   profile.cpu_context_switches[memory] = 0;
199   for (i = 0;i < PROFILER_TOTAL;i++)
200      profile.count[memory][i] = 0;
201
202197   profiler_mark(PROFILER_END);
203198
204   return buf;
199   /* advance to the next dataset and reset it to 0 */
200   global_profiler.dataindex = (global_profiler.dataindex + 1) % ARRAY_LENGTH(global_profiler.data);
201   memset(&global_profiler.data[global_profiler.dataindex], 0, sizeof(global_profiler.data[global_profiler.dataindex]));
202
203   /* we are ready once we have wrapped around */
204   if (global_profiler.dataindex == 0)
205      global_profiler.dataready = TRUE;
206
207   return string;
205208}
src/emu/profiler.h
r4057r4058
77    Copyright Nicola Salmoria and the MAME Team.
88    Visit http://mamedev.org for licensing and usage restrictions.
99
10****************************************************************************
11
12    To start profiling a certain section, e.g. video:
13    profiler_mark(PROFILER_VIDEO);
14
15    to end profiling the current section:
16    profiler_mark(PROFILER_END);
17
18    the profiler handles a FILO list so calls may be nested.
19
1020***************************************************************************/
1121
1222#pragma once
r4057r4058
1424#ifndef __PROFILER_H__
1525#define __PROFILER_H__
1626
27#include "astring.h"
28
29
30/***************************************************************************
31    CONSTANTS
32***************************************************************************/
33
1734/* profiling */
1835enum
1936{
2037   PROFILER_END = -1,
21   PROFILER_CPU1 = 0,
22   PROFILER_CPU2,
23   PROFILER_CPU3,
24   PROFILER_CPU4,
25   PROFILER_CPU5,
26   PROFILER_CPU6,
27   PROFILER_CPU7,
28   PROFILER_CPU8,
38   PROFILER_CPU_FIRST = 0,
39   PROFILER_CPU_MAX = PROFILER_CPU_FIRST + 32,
2940   PROFILER_MEMREAD,
3041   PROFILER_MEMWRITE,
3142   PROFILER_VIDEO,
r4057r4058
3445   PROFILER_TILEMAP_DRAW,
3546   PROFILER_TILEMAP_DRAW_ROZ,
3647   PROFILER_TILEMAP_UPDATE,
37   PROFILER_ARTWORK,
3848   PROFILER_BLIT,
3949   PROFILER_SOUND,
40   PROFILER_MIXER,
4150   PROFILER_TIMER_CALLBACK,
4251   PROFILER_INPUT,      /* input.c and inptport.c */
4352   PROFILER_MOVIE_REC,   /* movie recording */
r4057r4058
5766};
5867
5968
60/*
61To start profiling a certain section, e.g. video:
62profiler_mark(PROFILER_VIDEO);
6369
64to end profiling the current section:
65profiler_mark(PROFILER_END);
70/***************************************************************************
71    TYPE DEFINITIONS
72***************************************************************************/
6673
67the profiler handles a FILO list so calls may be nested.
68*/
74typedef struct _profiler_filo_entry profiler_filo_entry;
75struct _profiler_filo_entry
76{
77   int            type;            /* type of entry */
78   osd_ticks_t      start;            /* start time */
79};
6980
81
82typedef struct _profiler_data profiler_data;
83struct _profiler_data
84{
85   UINT32         context_switches;   /* number of context switches seen */
86   osd_ticks_t      duration[PROFILER_TOTAL]; /* duration spent in each entry */
87};
88
89
90typedef struct _profiler_state profiler_state;
91struct _profiler_state
92{
93   UINT8         enabled;         /* are we enabled? */
94   UINT8         filoindex;         /* current FILO index */
95   UINT8         dataindex;         /* current data index */
96   UINT8         dataready;         /* are we to display the data yet? */
97   profiler_filo_entry filo[16];      /* array of FILO entries */
98   profiler_data   data[16];         /* array of data */
99};
100
101
102
103/***************************************************************************
104    GLOBAL VARIABLES
105***************************************************************************/
106
107extern profiler_state global_profiler;
108
109
110
111/***************************************************************************
112    MACROS
113***************************************************************************/
114
70115#ifdef MAME_PROFILER
71void profiler_mark(int type);
72116
73/* functions called by usrintf.c */
74void profiler_start(void);
75void profiler_stop(void);
76const char *profiler_get_text(running_machine *machine);
117#define profiler_mark(x)      do { if (global_profiler.enabled) _profiler_mark(x); } while (0)
118#define profiler_start()      do { global_profiler.enabled = TRUE; global_profiler.filoindex = global_profiler.dataindex = global_profiler.dataready = 0; } while (0)
119#define profiler_stop()         do { global_profiler.enabled = FALSE; } while (0)
120#define profiler_get_text(x,s)   _profiler_get_text(x, s)
121
77122#else
78#define profiler_mark(type)
79123
80#define profiler_start()
81#define profiler_stop()
82#define profiler_get_text(machine) ""
124#define profiler_mark(x)      do { } while (0)
125#define profiler_start()      do { } while (0)
126#define profiler_stop()         do { } while (0)
127#define profiler_get_text(x,s)    astring_reset(s)
128
83129#endif
84130
85131
132
133/***************************************************************************
134    FUNCTION PROTOTYPES
135***************************************************************************/
136
137
138/* ----- core functions (do not call directly; use macros) ----- */
139
140/* mark the beginning/end of a profiler entry */
141void _profiler_mark(int type);
142
143/* return the current text in an astring */
144astring *_profiler_get_text(running_machine *machine, astring *string);
145
146
86147#endif   /* __PROFILER_H__ */
src/emu/input.c
r4057r4058
16581658         for (colnum = 0; colnum < 9; colnum++)
16591659         {
16601660            /* if we're at the end of row, copy previous to the middle, then apply left/right symmetry */
1661            if (*mapstring == 0 || *mapstring == '.')
1661            if (colnum > 0 && (*mapstring == 0 || *mapstring == '.'))
16621662            {
16631663               int symmetric = (colnum >= 5);
16641664               UINT8 val = map->map[rownum][symmetric ? (8 - colnum) : (colnum - 1)];
src/emu/clifront.c
r4057r4058
8686   { "listfull;ll",              "0",        OPTION_COMMAND,    "short name, full name" },
8787   { "listsource;ls",            "0",        OPTION_COMMAND,    "driver sourcefile" },
8888   { "listclones;lc",            "0",        OPTION_COMMAND,    "show clones" },
89   { "listbrothers;lb",          "0",        OPTION_COMMAND,    "show \"brothers\", or other drivers from same sourcefile" },
8990   { "listcrc",                  "0",        OPTION_COMMAND,    "CRC-32s" },
9091   { "listroms",                 "0",        OPTION_COMMAND,    "list required roms for a driver" },
9192   { "listsamples",              "0",        OPTION_COMMAND,    "list optional samples for a driver" },
r4057r4058
240241      { CLIOPTION_LISTFULL,      cli_info_listfull },
241242      { CLIOPTION_LISTSOURCE,      cli_info_listsource },
242243      { CLIOPTION_LISTCLONES,      cli_info_listclones },
244      { CLIOPTION_LISTBROTHERS,   cli_info_listbrothers },
243245      { CLIOPTION_LISTCRC,      cli_info_listcrc },
244246#ifdef MESS
245247      { CLIOPTION_LISTDEVICES,   info_listdevices },
r4057r4058
357359   int drvindex, count = 0;
358360
359361   /* iterate over drivers */
360   for (drvindex = 0; drivers[drvindex]; drvindex++)
362   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
361363      if ((drivers[drvindex]->flags & GAME_NO_STANDALONE) == 0 && mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
362364      {
363365         /* print the header on the first one */
r4057r4058
385387   int drvindex, count = 0;
386388
387389   /* iterate over drivers */
388   for (drvindex = 0; drivers[drvindex]; drvindex++)
390   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
389391      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
390392      {
391393         /* output the remaining information */
r4057r4058
409411   int drvindex, count = 0;
410412
411413   /* iterate over drivers */
412   for (drvindex = 0; drivers[drvindex]; drvindex++)
414   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
413415   {
414416      const game_driver *clone_of = driver_get_clone(drivers[drvindex]);
415417
r4057r4058
433435
434436
435437/*-------------------------------------------------
438    cli_info_listbrothers - output the name and
439    source filename of one or more games
440-------------------------------------------------*/
441
442int cli_info_listbrothers(core_options *options, const char *gamename)
443{
444   UINT8 *didit = malloc_or_die(driver_list_get_count(drivers));
445   astring *filename = astring_alloc();
446   int drvindex, count = 0;
447
448   memset(didit, 0, driver_list_get_count(drivers));
449
450   /* iterate over drivers */
451   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
452      if (!didit[drvindex] && mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
453      {
454         int matchindex;
455
456         didit[drvindex] = TRUE;
457         if (count > 0)
458            mame_printf_info("\n");
459         mame_printf_info("%s ... other drivers in %s:\n", drivers[drvindex]->name, astring_c(core_filename_extract_base(filename, drivers[drvindex]->source_file, FALSE)));
460
461         /* now iterate again over drivers, finding those with the same source file */
462         for (matchindex = 0; drivers[matchindex]; matchindex++)
463            if (matchindex != drvindex && strcmp(drivers[drvindex]->source_file, drivers[matchindex]->source_file) == 0)
464            {
465               const char *matchstring = (mame_strwildcmp(gamename, drivers[matchindex]->name) == 0) ? "-> " : "   ";
466               const game_driver *clone_of = driver_get_clone(drivers[matchindex]);
467
468               if (clone_of != NULL && (clone_of->flags & GAME_IS_BIOS_ROOT) == 0)
469                  mame_printf_info("%s%-8s [%s]\n", matchstring, drivers[matchindex]->name, clone_of->name);
470               else
471                  mame_printf_info("%s%s\n", matchstring, drivers[matchindex]->name);
472               didit[matchindex] = TRUE;
473            }
474
475         count++;
476      }
477
478   /* return an error if none found */
479   astring_free(filename);
480   free(didit);
481   return (count > 0) ? MAMERR_NONE : MAMERR_NO_SUCH_GAME;
482}
483
484
485/*-------------------------------------------------
436486    cli_info_listcrc - output the CRC and name of
437487    all ROMs referenced by MAME
438488-------------------------------------------------*/
r4057r4058
442492   int drvindex, count = 0;
443493
444494   /* iterate over drivers */
445   for (drvindex = 0; drivers[drvindex]; drvindex++)
495   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
446496      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
447497      {
448498         machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
r4057r4058
480530   int drvindex, count = 0;
481531
482532   /* iterate over drivers */
483   for (drvindex = 0; drivers[drvindex]; drvindex++)
533   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
484534      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
485535      {
486536         machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
487         const rom_entry *region, *rom, *chunk;
537         const rom_entry *region, *rom;
488538         const rom_source *source;
489539
490540         /* print the header */
r4057r4058
505555
506556                  /* accumulate the total length of all chunks */
507557                  if (ROMREGION_ISROMDATA(region))
508                  {
509                     length = 0;
510                     for (chunk = rom_first_chunk(rom); chunk; chunk = rom_next_chunk(chunk))
511                        length += ROM_GETLENGTH(chunk);
512                  }
558                     length = rom_file_size(rom);
513559
514560                  /* start with the name */
515561                  mame_printf_info("%-12s ", name);
r4057r4058
561607   sndintrf_init(NULL);
562608
563609   /* iterate over drivers */
564   for (drvindex = 0; drivers[drvindex]; drvindex++)
610   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
565611      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
566612      {
567613         machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
r4057r4058
607653   int drvindex;
608654
609655   /* iterate over drivers */
610   for (drvindex = 0; drivers[drvindex]; drvindex++)
656   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
611657      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
612658      {
613659         audit_record *audit;
r4057r4058
691737   int drvindex;
692738
693739   /* now iterate over drivers */
694   for (drvindex = 0; drivers[drvindex]; drvindex++)
740   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
695741      if (mame_strwildcmp(gamename, drivers[drvindex]->name) == 0)
696742      {
697743         audit_record *audit;
r4057r4058
9661012   int drvindex;
9671013
9681014   /* iterate over drivers */
969   for (drvindex = 0; drivers[drvindex]; drvindex++)
1015   for (drvindex = 0; drivers[drvindex] != NULL; drvindex++)
9701016   {
9711017      machine_config *config = machine_config_alloc(drivers[drvindex]->machine_config);
9721018      const rom_entry *region, *rom;
src/emu/timer.c
r4057r4058
2929    CONSTANTS
3030***************************************************************************/
3131
32#define MAX_TIMERS      256
33#define MAX_QUANTA      16
32#define MAX_TIMERS            256
33#define MAX_QUANTA            16
3434
35#define DEFAULT_MINIMUM_QUANTUM   ATTOSECONDS_IN_MSEC(100)
3536
3637
3738/***************************************************************************
r4057r4058
9192{
9293   /* list of active timers */
9394   emu_timer             timers[MAX_TIMERS]; /* actual timers */
94   emu_timer *            activelist;      /* head of the active list */
95   emu_timer *            freelist;       /* head of the free list */
96   emu_timer *            freelist_tail;   /* tail of the free list */
95   emu_timer *            activelist;         /* head of the active list */
96   emu_timer *            freelist;          /* head of the free list */
97   emu_timer *            freelist_tail;      /* tail of the free list */
9798
99   /* execution state */
100   timer_execution_state   exec;            /* current global execution state */
101
98102   /* other internal states */
99   attotime             basetime;      /* the current global base time */
100   emu_timer *            callback_timer;   /* pointer to the current callback timer */
103   emu_timer *            callback_timer;      /* pointer to the current callback timer */
101104   UINT8               callback_timer_modified; /* TRUE if the current callback timer was modified */
102105   attotime            callback_timer_expire_time; /* the original expiration time */
103106
104107   /* scheduling quanta */
105108   quantum_slot          quantum_list[MAX_QUANTA]; /* list of scheduling quanta */
106   quantum_slot *         quantum_current;/* current minimum quantum */
107   attoseconds_t          quantum_minimum;/* duration of minimum quantum */
109   quantum_slot *         quantum_current;   /* current minimum quantum */
110   attoseconds_t          quantum_minimum;   /* duration of minimum quantum */
108111};
109112
110113
r4057r4058
138141
139142   /* if we're executing as a particular CPU, use its local time as a base */
140143   /* otherwise, return the global base time */
141   return cpuexec_override_local_time(machine, global->basetime);
144   return cpuexec_override_local_time(machine, global->exec.basetime);
142145}
143146
144147
r4057r4058
198201   #endif
199202
200203   /* loop over the timer list */
201   for (t = global->activelist; t; lt = t, t = t->next)
204   for (t = global->activelist; t != NULL; lt = t, t = t->next)
202205   {
203206      /* if the current list entry expires after us, we should be inserted before it */
204207      if (attotime_compare(t->expire, expire) > 0)
r4057r4058
207210         timer->prev = t->prev;
208211         timer->next = t;
209212
210         if (t->prev)
213         if (t->prev != NULL)
211214            t->prev->next = timer;
212215         else
216         {
213217            global->activelist = timer;
218            global->exec.nextfire = timer->expire;
219         }
214220         t->prev = timer;
215221         return;
216222      }
217223   }
218224
219225   /* need to insert after the last one */
220   if (lt)
226   if (lt != NULL)
221227      lt->next = timer;
222228   else
229   {
223230      global->activelist = timer;
231      global->exec.nextfire = timer->expire;
232   }
224233   timer->prev = lt;
225234   timer->next = NULL;
226235}
r4057r4058
263272   #endif
264273
265274   /* remove it from the list */
266   if (timer->prev)
275   if (timer->prev != NULL)
267276      timer->prev->next = timer->next;
268277   else
278   {
269279      global->activelist = timer->next;
270   if (timer->next)
280      if (global->activelist != NULL)
281         global->exec.nextfire = global->activelist->expire;
282   }
283   if (timer->next != NULL)
271284      timer->next->prev = timer->prev;
272285}
273286
r4057r4058
291304   memset(global, 0, sizeof(*global));
292305
293306   /* we need to wait until the first call to timer_cyclestorun before using real CPU times */
294   global->basetime = attotime_zero;
307   global->exec.basetime = attotime_zero;
308   global->exec.nextfire = attotime_never;
309   global->exec.curquantum = DEFAULT_MINIMUM_QUANTUM;
295310   global->callback_timer = NULL;
296311   global->callback_timer_modified = FALSE;
297312
298313   /* register with the save state system */
299   state_save_register_item(machine, "timer", NULL, 0, global->basetime.seconds);
300   state_save_register_item(machine, "timer", NULL, 0, global->basetime.attoseconds);
314   state_save_register_item(machine, "timer", NULL, 0, global->exec.basetime.seconds);
315   state_save_register_item(machine, "timer", NULL, 0, global->exec.basetime.attoseconds);
301316   state_save_register_postload(machine, timer_postload, NULL);
302317
303318   /* initialize the lists */
r4057r4058
309324   global->freelist_tail = &global->timers[MAX_TIMERS-1];
310325
311326   /* reset the quanta */
312   global->quantum_list[0].requested = ATTOSECONDS_IN_MSEC(100);
313   global->quantum_list[0].actual = ATTOSECONDS_IN_MSEC(100);
327   global->quantum_list[0].requested = DEFAULT_MINIMUM_QUANTUM;
328   global->quantum_list[0].actual = DEFAULT_MINIMUM_QUANTUM;
314329   global->quantum_list[0].expire = attotime_never;
315330   global->quantum_current = &global->quantum_list[0];
316331   global->quantum_minimum = ATTOSECONDS_IN_NSEC(1) / 1000;
r4057r4058
334349***************************************************************************/
335350
336351/*-------------------------------------------------
337    timer_next_fire_time - return the
338    time when the next timer will fire
352    timer_get_execution_state - return a pointer
353    to the execution state
339354-------------------------------------------------*/
340355
341attotime timer_next_fire_time(running_machine *machine)
356timer_execution_state *timer_get_execution_state(running_machine *machine)
342357{
343358   timer_private *global = machine->timer_data;
344   attotime quantum_time;
359   return &global->exec;
360}
345361
362
363/*-------------------------------------------------
364    timer_execute_timers - execute timers and
365    update scheduling quanta
366-------------------------------------------------*/
367
368void timer_execute_timers(running_machine *machine)
369{
370   timer_private *global = machine->timer_data;
371   emu_timer *timer;
372
346373   /* if the current quantum has expired, find a new one */
347   if (attotime_compare(global->basetime, global->quantum_current->expire) >= 0)
374   if (attotime_compare(global->exec.basetime, global->quantum_current->expire) >= 0)
348375   {
349376      int curr;
350377
r4057r4058
353380      for (curr = 1; curr < ARRAY_LENGTH(global->quantum_list); curr++)
354381         if (global->quantum_list[curr].requested != 0 && global->quantum_list[curr].requested < global->quantum_current->requested)
355382            global->quantum_current = &global->quantum_list[curr];
383      global->exec.curquantum = global->quantum_current->actual;
356384   }
357   quantum_time = attotime_add_attoseconds(global->basetime, global->quantum_current->actual);
358   return attotime_min(quantum_time, global->activelist->expire);
359}
360385
386   LOG(("timer_set_global_time: new=%s head->expire=%s\n", attotime_string(global->exec.basetime, 9), attotime_string(global->activelist->expire, 9)));
361387
362/*-------------------------------------------------
363    timer_adjust_global_time - adjust the global
364    time; this is also where we fire the timers
365-------------------------------------------------*/
366
367void timer_set_global_time(running_machine *machine, attotime newbase)
368{
369   timer_private *global = machine->timer_data;
370   emu_timer *timer;
371
372   /* set the new global offset */
373   global->basetime = newbase;
374
375   LOG(("timer_set_global_time: new=%s head->expire=%s\n", attotime_string(newbase, 9), attotime_string(global->activelist->expire, 9)));
376
377388   /* now process any timers that are overdue */
378   while (attotime_compare(global->activelist->expire, global->basetime) <= 0)
389   while (attotime_compare(global->activelist->expire, global->exec.basetime) <= 0)
379390   {
380391      int was_enabled = global->activelist->enabled;
381392
r4057r4058
473484
474485   /* update the minimum */
475486   if (quantum < global->quantum_current->requested)
487   {
476488      global->quantum_current = &global->quantum_list[blank];
489      global->exec.curquantum = global->quantum_current->actual;
490   }
477491}
478492
479493
r4057r4058
496510   for (curr = 0; curr < ARRAY_LENGTH(global->quantum_list); curr++)
497511      if (global->quantum_list[curr].requested != 0)
498512         global->quantum_list[curr].actual = MAX(global->quantum_list[curr].requested, global->quantum_minimum);
513
514   /* ensure that the live current quantum is up to date */
515   global->exec.curquantum = global->quantum_current->actual;
499516}
500517
501518
src/emu/clifront.h
r4057r4058
2828#define CLIOPTION_LISTFULL            "listfull"
2929#define CLIOPTION_LISTSOURCE         "listsource"
3030#define CLIOPTION_LISTCLONES         "listclones"
31#define CLIOPTION_LISTBROTHERS         "listbrothers"
3132#define CLIOPTION_LISTCRC            "listcrc"
3233#define CLIOPTION_LISTDEVICES         "listdevices"
3334#define CLIOPTION_LISTROMS            "listroms"
r4057r4058
4950int cli_info_listfull(core_options *options, const char *gamename);
5051int cli_info_listsource(core_options *options, const char *gamename);
5152int cli_info_listclones(core_options *options, const char *gamename);
53int cli_info_listbrothers(core_options *options, const char *gamename);
5254int cli_info_listcrc(core_options *options, const char *gamename);
5355int cli_info_listroms(core_options *options, const char *gamename);
5456int cli_info_listsamples(core_options *options, const char *gamename);
src/emu/timer.h
r4057r4058
9898typedef struct _emu_timer emu_timer;
9999
100100
101typedef struct _timer_execution_state timer_execution_state;
102struct _timer_execution_state
103{
104   attotime            nextfire;      /* time that the head of the timer list will fire */
105   attotime            basetime;      /* global basetime; everything moves forward from here */
106   attoseconds_t         curquantum;      /* current quantum of execution */
107};
101108
109
110
102111/***************************************************************************
103112    TIMER DEVICE CONFIGURATION MACROS
104113***************************************************************************/
r4057r4058
159168
160169/* ----- scheduling helpers ----- */
161170
162/* return the time when the next timer will fire */
163attotime timer_next_fire_time(running_machine *machine);
171/* return a pointer to the execution state */
172timer_execution_state *timer_get_execution_state(running_machine *machine);
164173
165/* adjust the global time; this is also where we fire the timers */
166void timer_set_global_time(running_machine *machine, attotime newbase);
174/* execute timers and update scheduling quanta */
175void timer_execute_timers(running_machine *machine);
167176
168177/* add a scheduling quantum; the smallest active one is the one that is in use */
169178void timer_add_scheduling_quantum(running_machine *machine, attoseconds_t quantum, attotime duration);
src/emu/drivers/xtal.h
r4057r4058
6868   XTAL_7_3728MHz      = 7372800,
6969   XTAL_7_8643MHz       = 7864300,      /* Used on InterFlip games as video clock */
7070   XTAL_8MHz          = 8000000,      /* Extremely common, used on 100's of PCBs */
71   XTAL_8_4672MHz      = 8467200,      /* Subsino's Ying Hua Lian */
7172   XTAL_8_664MHz      = 8664000,      /* Touchmaster */
7273   XTAL_8_945MHz      = 8945000,      /* Hit Me */
7374   XTAL_9_828MHz      = 9828000,      /* Universal PCBs */
r4057r4058
112113   XTAL_21_3MHz        = 21300000,
113114   XTAL_21_4772MHz    = 21477200,      /* BMC bowling, some Data East 90's games */
114115   XTAL_22MHz         = 22000000,
116   XTAL_22_1184MHz      = 22118400,
115117   XTAL_24MHz         = 24000000,      /* Mario, 80's Data East games, 80's Konami games */
116118   XTAL_24_576MHz     = 24576000,      /* Pole Position h/w, Model 3 CPU board */
117119   XTAL_25MHz         = 25000000,      /* Namco System 22, Taito GNET, Dogyuun h/w */
r4057r4058
136138   XTAL_38_76922MHz     = 38769220,      /* Namco System 21 video board */
137139   XTAL_40MHz         = 40000000,
138140   XTAL_42_9545MHz     = 42954500,      /* CPS3 */
141   XTAL_44_1MHz      = 44100000,      /* Subsino's Bishou Jan */
139142   XTAL_45MHz         = 45000000,      /* Eolith with Hyperstone CPUs */
140143   XTAL_45_158MHz     = 45158000,      /* Sega Model 2A video board, Model 3 CPU board */
141144   XTAL_48MHz         = 48000000,      /* Williams/Midway Y/Z-unit system */
src/emu/romload.c
r4057r4058
2222#define LOG(x) do { if (LOG_LOAD) debugload x; } while(0)
2323
2424
25/***************************************************************************
26    CONSTANTS
27***************************************************************************/
2528
29#define TEMPBUFFER_MAX_SIZE      (1024 * 1024 * 1024)
30
31
32
2633/***************************************************************************
2734    TYPE DEFINITIONS
2835***************************************************************************/
2936
37typedef struct _rom_load_data rom_load_data;
38struct _rom_load_data
39{
40   running_machine *machine;         /* machine object where needed */
41   int            system_bios;      /* the system BIOS we wish to load */
42
43   int            warnings;         /* warning count during processing */
44   int            errors;            /* error count during processing */
45
46   int            romsloaded;         /* current ROMs loaded count */
47   int            romstotal;         /* total number of ROMs to read */
48   UINT32         romsloadedsize;      /* total size of ROMs loaded so far */
49   UINT32         romstotalsize;      /* total size of ROMs to read */
50
51   mame_file *      file;            /* current file */
52
53   UINT8 *         regionbase;         /* base of current region */
54   UINT32         regionlength;      /* length of current region */
55
56   astring *      errorstring;      /* error string */
57};
58
59
3060typedef struct _open_chd open_chd;
3161struct _open_chd
3262{
r4057r4058
4878static open_chd *chd_list;
4979static open_chd **chd_list_tailptr;
5080
51/* system BIOS */
52static int system_bios;
53
5481static int total_rom_load_warnings;
5582
5683
r4057r4058
6794    HARD DISK HANDLING
6895***************************************************************************/
6996
97/*-------------------------------------------------
98    get_disk_handle - return a pointer to the
99    CHD file associated with the given region
100-------------------------------------------------*/
101
70102chd_file *get_disk_handle(const char *region)
71103{
72104   open_chd *curdisk;
r4057r4058
78110}
79111
80112
113/*-------------------------------------------------
114    set_disk_handle - set a pointer to the CHD
115    file associated with the given region
116-------------------------------------------------*/
117
81118void set_disk_handle(const char *region, mame_file *file, chd_file *chdfile)
82119{
83120   open_chd chd = { 0 };
r4057r4058
94131}
95132
96133
134
97135/***************************************************************************
98136    ROM LOADING
99137***************************************************************************/
r4057r4058
222260
223261
224262/*-------------------------------------------------
225    rom_first_chunk - return pointer to first ROM
226    chunk
227-------------------------------------------------*/
228
229const rom_entry *rom_first_chunk(const rom_entry *romp)
230{
231   return (ROMENTRY_ISFILE(romp)) ? romp : NULL;
232}
233
234
235/*-------------------------------------------------
236    rom_next_chunk - return pointer to next ROM
237    chunk
238-------------------------------------------------*/
239
240const rom_entry *rom_next_chunk(const rom_entry *romp)
241{
242   romp++;
243   return (ROMENTRY_ISCONTINUE(romp) || ROMENTRY_ISIGNORE(romp)) ? romp : NULL;
244}
245
246
247/*-------------------------------------------------
248263    rom_region_name - return the appropriate name
249264    for a rom region
250265-------------------------------------------------*/
r4057r4058
263278
264279
265280/*-------------------------------------------------
281    rom_file_size - return the expected size of a
282    file given the ROM description
283-------------------------------------------------*/
284
285UINT32 rom_file_size(const rom_entry *romp)
286{
287   UINT32 maxlength = 0;
288
289   /* loop until we run out of reloads */
290   do
291   {
292      UINT32 curlength;
293
294      /* loop until we run out of continues/ignores */
295      curlength = ROM_GETLENGTH(romp++);
296      while (ROMENTRY_ISCONTINUE(romp) || ROMENTRY_ISIGNORE(romp))
297         curlength += ROM_GETLENGTH(romp++);
298
299      /* track the maximum length */
300      maxlength = MAX(maxlength, curlength);
301   }
302   while (ROMENTRY_ISRELOAD(romp));
303
304   return maxlength;
305}
306
307
308/*-------------------------------------------------
266309    debugload - log data to a file
267310-------------------------------------------------*/
268311
r4057r4058
288331    from SystemBios structure and OPTION_BIOS
289332-------------------------------------------------*/
290333
291static int determine_bios_rom(rom_load_data *romdata, const rom_entry *romp)
334static void determine_bios_rom(rom_load_data *romdata)
292335{
293336   const char *specbios = options_get_string(mame_options(), OPTION_BIOS);
337   const char *defaultname = NULL;
294338   const rom_entry *rom;
339   int default_no = 1;
295340   int bios_count = 0;
296   int bios_no = 0;
297341
342   romdata->system_bios = 0;
343
344   /* first determine the default BIOS name */
345   for (rom = romdata->machine->gamedrv->rom; !ROMENTRY_ISEND(rom); rom++)
346      if (ROMENTRY_ISDEFAULT_BIOS(rom))
347         defaultname = ROM_GETNAME(rom);
348
298349   /* look for a BIOS with a matching name */
299   for (rom = romp; !ROMENTRY_ISEND(rom); rom++)
350   for (rom = romdata->machine->gamedrv->rom; !ROMENTRY_ISEND(rom); rom++)
300351      if (ROMENTRY_ISSYSTEM_BIOS(rom))
301352      {
302353         const char *biosname = ROM_GETNAME(rom);
r4057r4058
306357         /* Allow '-bios n' to still be used */
307358         sprintf(bios_number, "%d", bios_flags - 1);
308359         if (strcmp(bios_number, specbios) == 0 || strcmp(biosname, specbios) == 0)
309            bios_no = bios_flags;
360            romdata->system_bios = bios_flags;
361         if (defaultname != NULL && strcmp(biosname, defaultname) == 0)
362            default_no = bios_flags;
310363         bios_count++;
311364      }
312365
313366   /* if none found, use the default */
314   if (bios_no == 0 && bios_count > 0)
367   if (romdata->system_bios == 0 && bios_count > 0)
315368   {
316369      /* if we got neither an empty string nor 'default' then warn the user */
317      if (specbios[0] != 0 && strcmp(specbios, "default") != 0)
370      if (specbios[0] != 0 && strcmp(specbios, "default") != 0 && romdata != NULL)
318371      {
319         sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s: invalid bios\n", specbios);
372         astring_catprintf(romdata->errorstring, "%s: invalid bios\n", specbios);
320373         romdata->warnings++;
321374      }
322375
323376      /* set to default */
324      bios_no = 1;
377      romdata->system_bios = default_no;
325378   }
326379
327   LOG(("Using System BIOS: %d\n", bios_no));
328   return bios_no;
380   LOG(("Using System BIOS: %d\n", romdata->system_bios));
329381}
330382
331383
r4057r4058
334386    that will need to be loaded
335387-------------------------------------------------*/
336388
337static int count_roms(running_machine *machine)
389static void count_roms(rom_load_data *romdata)
338390{
339391   const rom_entry *region, *rom;
340392   const rom_source *source;
341   int count = 0;
342393
394   /* start with 0 */
395   romdata->romstotal = 0;
396   romdata->romstotalsize = 0;
397
343398   /* loop over regions, then over files */
344   for (source = rom_first_source(machine->gamedrv, machine->config); source != NULL; source = rom_next_source(machine->gamedrv, machine->config, source))
345      for (region = rom_first_region(machine->gamedrv, source); region != NULL; region = rom_next_region(region))
399   for (source = rom_first_source(romdata->machine->gamedrv, romdata->machine->config); source != NULL; source = rom_next_source(romdata->machine->gamedrv, romdata->machine->config, source))
400      for (region = rom_first_region(romdata->machine->gamedrv, source); region != NULL; region = rom_next_region(region))
346401         for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
347         {
348            int bios_flags = ROM_GETBIOSFLAGS(rom);
349            if (!bios_flags || (bios_flags == system_bios)) /* alternate bios sets */
350               count++;
351         }
352
353   /* return the total count */
354   return count;
402            if (ROM_GETBIOSFLAGS(rom) == 0 || ROM_GETBIOSFLAGS(rom) == romdata->system_bios)
403            {
404               romdata->romstotal++;
405               romdata->romstotalsize += rom_file_size(rom);
406            }
355407}
356408
357409
r4057r4058
377429   /* optional files are okay */
378430   if (ROM_ISOPTIONAL(romp))
379431   {
380      sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "OPTIONAL %s NOT FOUND\n", ROM_GETNAME(romp));
432      astring_catprintf(romdata->errorstring, "OPTIONAL %s NOT FOUND\n", ROM_GETNAME(romp));
381433      romdata->warnings++;
382434   }
383435
384436   /* no good dumps are okay */
385437   else if (ROM_NOGOODDUMP(romp))
386438   {
387      sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NOT FOUND (NO GOOD DUMP KNOWN)\n", ROM_GETNAME(romp));
439      astring_catprintf(romdata->errorstring, "%s NOT FOUND (NO GOOD DUMP KNOWN)\n", ROM_GETNAME(romp));
388440      romdata->warnings++;
389441   }
390442
391443   /* anything else is bad */
392444   else
393445   {
394      sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NOT FOUND\n", ROM_GETNAME(romp));
446      astring_catprintf(romdata->errorstring, "%s NOT FOUND\n", ROM_GETNAME(romp));
395447      romdata->errors++;
396448   }
397449}
r4057r4058
403455    correct checksums for a given ROM
404456-------------------------------------------------*/
405457
406static void dump_wrong_and_correct_checksums(rom_load_data* romdata, const char* hash, const char* acthash)
458static void dump_wrong_and_correct_checksums(rom_load_data *romdata, const char *hash, const char *acthash)
407459{
408460   unsigned i;
409461   char chksum[256];
r4057r4058
413465   found_functions = hash_data_used_functions(hash) & hash_data_used_functions(acthash);
414466
415467   hash_data_print(hash, found_functions, chksum);
416   sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "    EXPECTED: %s\n", chksum);
468   astring_catprintf(romdata->errorstring, "    EXPECTED: %s\n", chksum);
417469
418470   /* We dump informations only of the functions for which MAME provided
419471        a correct checksum. Other functions we might have calculated are
420472        useless here */
421473   hash_data_print(acthash, found_functions, chksum);
422   sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "       FOUND: %s\n", chksum);
474   astring_catprintf(romdata->errorstring, "       FOUND: %s\n", chksum);
423475
424476   /* For debugging purposes, we check if the checksums available in the
425477       driver are correctly specified or not. This can be done by checking
r4057r4058
436488      for (i = 0; i < HASH_NUM_FUNCTIONS; i++)
437489         if (wrong_functions & (1 << i))
438490         {
439            sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)],
491            astring_catprintf(romdata->errorstring,
440492               "\tInvalid %s checksum treated as 0 (check leading zeros)\n",
441493               hash_function_name(1 << i));
442494
r4057r4058
451503    and hash signatures of a file
452504-------------------------------------------------*/
453505
454static void verify_length_and_hash(rom_load_data *romdata, const char *name, UINT32 explength, const char* hash)
506static void verify_length_and_hash(rom_load_data *romdata, const char *name, UINT32 explength, const char *hash)
455507{
456508   UINT32 actlength;
457509   const char* acthash;
458510
459511   /* we've already complained if there is no file */
460   if (!romdata->file)
512   if (romdata->file == NULL)
461513      return;
462514
463515   /* get the length and CRC from the file */
r4057r4058
467519   /* verify length */
468520   if (explength != actlength)
469521   {
470      sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s WRONG LENGTH (expected: %08x found: %08x)\n", name, explength, actlength);
522      astring_catprintf(romdata->errorstring, "%s WRONG LENGTH (expected: %08x found: %08x)\n", name, explength, actlength);
471523      romdata->warnings++;
472524   }
473525
474526   /* If there is no good dump known, write it */
475527   if (hash_data_has_info(hash, HASH_INFO_NO_DUMP))
476528   {
477         sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NO GOOD DUMP KNOWN\n", name);
529         astring_catprintf(romdata->errorstring, "%s NO GOOD DUMP KNOWN\n", name);
478530      romdata->warnings++;
479531   }
480532   /* verify checksums */
481533   else if (!hash_data_is_equal(hash, acthash, 0))
482534   {
483535      /* otherwise, it's just bad */
484      sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s WRONG CHECKSUMS:\n", name);
536      astring_catprintf(romdata->errorstring, "%s WRONG CHECKSUMS:\n", name);
485537
486538      dump_wrong_and_correct_checksums(romdata, hash, acthash);
487539
r4057r4058
490542   /* If it matches, but it is actually a bad dump, write it */
491543   else if (hash_data_has_info(hash, HASH_INFO_BAD_DUMP))
492544   {
493      sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s ROM NEEDS REDUMP\n",name);
545      astring_catprintf(romdata->errorstring, "%s ROM NEEDS REDUMP\n",name);
494546      romdata->warnings++;
495547   }
496548}
r4057r4058
501553    messages about ROM loading to the user
502554-------------------------------------------------*/
503555
504static void display_loading_rom_message(running_machine *machine, const char *name, rom_load_data *romdata)
556static void display_loading_rom_message(rom_load_data *romdata, const char *name)
505557{
506558   char buffer[200];
507559
508560   if (name != NULL)
509      sprintf(buffer, "Loading (%d%%)", 100 * romdata->romsloaded / romdata->romstotal);
561      sprintf(buffer, "Loading (%d%%)", (UINT32)(100 * (UINT64)romdata->romsloadedsize / (UINT64)romdata->romstotalsize));
510562   else
511563      sprintf(buffer, "Loading Complete");
512564
513   ui_set_startup_text(machine, buffer, FALSE);
565   ui_set_startup_text(romdata->machine, buffer, FALSE);
514566}
515567
516568
r4057r4058
519571    results of ROM loading
520572-------------------------------------------------*/
521573
522static void display_rom_load_results(running_machine *machine, rom_load_data *romdata)
574static void display_rom_load_results(rom_load_data *romdata)
523575{
524576   /* final status display */
525   display_loading_rom_message(machine, NULL, romdata);
577   display_loading_rom_message(romdata, NULL);
526578
527579   /* if we had errors, they are fatal */
528580   if (romdata->errors != 0)
r4057r4058
530582      const char *rgntag, *nextrgntag;
531583
532584      /* clean up any regions */
533      for (rgntag = memory_region_next(machine, NULL); rgntag != NULL; rgntag = nextrgntag)
585      for (rgntag = memory_region_next(romdata->machine, NULL); rgntag != NULL; rgntag = nextrgntag)
534586      {
535         nextrgntag = memory_region_next(machine, rgntag);
536         memory_region_free(machine, rgntag);
587         nextrgntag = memory_region_next(romdata->machine, rgntag);
588         memory_region_free(romdata->machine, rgntag);
537589      }
538590
539591      /* create the error message and exit fatally */
540      strcat(romdata->errorbuf, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
541      fatalerror_exitcode(machine, MAMERR_MISSING_FILES, "%s", romdata->errorbuf);
592      mame_printf_error("%s", astring_c(romdata->errorstring));
593      astring_free(romdata->errorstring);
594      fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
542595   }
543596
544597   /* if we had warnings, output them, but continue */
545598   if (romdata->warnings)
546599   {
547      strcat(romdata->errorbuf, "WARNING: the "GAMENOUN" might not run correctly.");
548      mame_printf_warning("%s\n", romdata->errorbuf);
600      astring_catc(romdata->errorstring, "WARNING: the "GAMENOUN" might not run correctly.");
601      mame_printf_warning("%s\n", astring_c(romdata->errorstring));
549602   }
550603}
551604
r4057r4058
555608    byte swapping and inverting data as necessary
556609-------------------------------------------------*/
557610
558static void region_post_process(running_machine *machine, rom_load_data *romdata, const char *rgntag)
611static void region_post_process(rom_load_data *romdata, const char *rgntag)
559612{
560   UINT32 regionlength = memory_region_length(machine, rgntag);
561   UINT32 regionflags = memory_region_flags(machine, rgntag);
562   UINT8 *regionbase = memory_region(machine, rgntag);
613   UINT32 regionlength = memory_region_length(romdata->machine, rgntag);
614   UINT32 regionflags = memory_region_flags(romdata->machine, rgntag);
615   UINT8 *regionbase = memory_region(romdata->machine, rgntag);
563616   int littleendian = ((regionflags & ROMREGION_ENDIANMASK) == ROMREGION_LE);
564617   int datawidth = 1 << ((regionflags & ROMREGION_WIDTHMASK) >> 8);
565618   UINT8 *base;
r4057r4058
599652    up the parent and loading by checksum
600653-------------------------------------------------*/
601654
602static int open_rom_file(running_machine *machine, rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
655static int open_rom_file(rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
603656{
604657   file_error filerr = FILERR_NOT_FOUND;
658   UINT32 romsize = rom_file_size(romp);
605659   const game_driver *drv;
606660   int has_crc = FALSE;
607661   UINT8 crcbytes[4];
608662   UINT32 crc = 0;
609663
610664   /* update status display */
611   ++romdata->romsloaded;
612   display_loading_rom_message(machine, ROM_GETNAME(romp), romdata);
665   display_loading_rom_message(romdata, ROM_GETNAME(romp));
613666
614667   /* extract CRC to use for searching */
615668   has_crc = hash_data_extract_binary_checksum(ROM_GETHASHDATA(romp), HASH_CRC, crcbytes);
r4057r4058
619672   /* attempt reading up the chain through the parents. It automatically also
620673       attempts any kind of load by checksum supported by the archives. */
621674   romdata->file = NULL;
622   for (drv = machine->gamedrv; romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
675   for (drv = romdata->machine->gamedrv; romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
623676      if (drv->name != NULL && *drv->name != 0)
624677      {
625678         astring *fname = astring_assemble_3(astring_alloc(), drv->name, PATH_SEPARATOR, ROM_GETNAME(romp));
r4057r4058
641694      astring_free(fname);
642695   }
643696
697   /* update counters */
698   romdata->romsloaded++;
699   romdata->romsloadedsize += romsize;
700
644701   /* return the result */
645702   return (filerr == FILERR_NONE);
646703}
r4057r4058
651708    random data for a NULL file
652709-------------------------------------------------*/
653710
654static int rom_fread(running_machine *machine, rom_load_data *romdata, UINT8 *buffer, int length)
711static int rom_fread(rom_load_data *romdata, UINT8 *buffer, int length)
655712{
656713   /* files just pass through */
657   if (romdata->file)
714   if (romdata->file != NULL)
658715      return mame_fread(romdata->file, buffer, length);
659716
660717   /* otherwise, fill with randomness */
661718   else
662      fill_random(machine, buffer, length);
719      fill_random(romdata->machine, buffer, length);
663720
664721   return length;
665722}
r4057r4058
670727    entry
671728-------------------------------------------------*/
672729
673static int read_rom_data(running_machine *machine, rom_load_data *romdata, const rom_entry *romp)
730static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
674731{
675732   int datashift = ROM_GETBITSHIFT(romp);
676733   int datamask = ((1 << ROM_GETBITWIDTH(romp)) - 1) << datashift;
r4057r4058
680737   int reversed = ROM_ISREVERSED(romp);
681738   int numgroups = (numbytes + groupsize - 1) / groupsize;
682739   UINT8 *base = romdata->regionbase + ROM_GETOFFSET(romp);
740   UINT32 tempbufsize;
741   UINT8 *tempbuf;
683742   int i;
684743
685744   LOG(("Loading ROM data: offs=%X len=%X mask=%02X group=%d skip=%d reverse=%d\n", ROM_GETOFFSET(romp), numbytes, datamask, groupsize, skip, reversed));
r4057r4058
698757
699758   /* special case for simple loads */
700759   if (datamask == 0xff && (groupsize == 1 || !reversed) && skip == 0)
701      return rom_fread(machine, romdata, base, numbytes);
760      return rom_fread(romdata, base, numbytes);
702761
762   /* use a temporary buffer for complex loads */
763   tempbufsize = MIN(TEMPBUFFER_MAX_SIZE, numbytes);
764   tempbuf = malloc_or_die(tempbufsize);
765
703766   /* chunky reads for complex loads */
704767   skip += groupsize;
705   while (numbytes)
768   while (numbytes > 0)
706769   {
707      int evengroupcount = (sizeof(romdata->tempbuf) / groupsize) * groupsize;
770      int evengroupcount = (tempbufsize / groupsize) * groupsize;
708771      int bytesleft = (numbytes > evengroupcount) ? evengroupcount : numbytes;
709      UINT8 *bufptr = romdata->tempbuf;
772      UINT8 *bufptr = tempbuf;
710773
711774      /* read as much as we can */
712775      LOG(("  Reading %X bytes into buffer\n", bytesleft));
713      if (rom_fread(machine, romdata, romdata->tempbuf, bytesleft) != bytesleft)
776      if (rom_fread(romdata, bufptr, bytesleft) != bytesleft)
777      {
778         free(tempbuf);
714779         return 0;
780      }
715781      numbytes -= bytesleft;
716782
717783      LOG(("  Copying to %p\n", base));
r4057r4058
770836            }
771837      }
772838   }
839   free(tempbuf);
840
773841   LOG(("  All done\n"));
774842   return ROM_GETLENGTH(romp);
775843}
r4057r4058
801869    copy_rom_data - copy a region of ROM space
802870-------------------------------------------------*/
803871
804static void copy_rom_data(running_machine *machine, rom_load_data *romdata, const rom_entry *romp)
872static void copy_rom_data(rom_load_data *romdata, const rom_entry *romp)
805873{
806874   UINT8 *base = romdata->regionbase + ROM_GETOFFSET(romp);
807875   const char *srcrgntag = ROM_GETNAME(romp);
r4057r4058
818886      fatalerror("Error in RomModule definition: COPY has an invalid length\n");
819887
820888   /* make sure the source was valid */
821   srcbase = memory_region(machine, srcrgntag);
889   srcbase = memory_region(romdata->machine, srcrgntag);
822890   if (srcbase == NULL)
823891      fatalerror("Error in RomModule definition: COPY from an invalid region\n");
824892
825893   /* make sure we find within the region space */
826   if (srcoffs + numbytes > memory_region_length(machine, srcrgntag))
894   if (srcoffs + numbytes > memory_region_length(romdata->machine, srcrgntag))
827895      fatalerror("Error in RomModule definition: COPY out of source memory region space\n");
828896
829897   /* fill the data */
r4057r4058
836904    for a region
837905-------------------------------------------------*/
838906
839static void process_rom_entries(running_machine *machine, rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
907static void process_rom_entries(rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
840908{
841909   UINT32 lastflags = 0;
842910
r4057r4058
861929
862930      /* handle copies */
863931      else if (ROMENTRY_ISCOPY(romp))
864         copy_rom_data(machine, romdata, romp++);
932         copy_rom_data(romdata, romp++);
865933
866934      /* handle files */
867935      else if (ROMENTRY_ISFILE(romp))
868936      {
869         int bios_flags = ROM_GETBIOSFLAGS(romp);
870         if (!bios_flags || (bios_flags == system_bios)) /* alternate bios sets */
871         {
872            const rom_entry *baserom = romp;
873            int explength = 0;
937         int irrelevantbios = (ROM_GETBIOSFLAGS(romp) != 0 && ROM_GETBIOSFLAGS(romp) != romdata->system_bios);
938         const rom_entry *baserom = romp;
939         int explength = 0;
874940
875            /* open the file */
876            LOG(("Opening ROM file: %s\n", ROM_GETNAME(romp)));
877            if (!open_rom_file(machine, romdata, regiontag, romp))
878               handle_missing_file(romdata, romp);
941         /* open the file if it is a non-BIOS or matches the current BIOS */
942         LOG(("Opening ROM file: %s\n", ROM_GETNAME(romp)));
943         if (!irrelevantbios && !open_rom_file(romdata, regiontag, romp))
944            handle_missing_file(romdata, romp);
879945
880            /* loop until we run out of reloads */
946         /* loop until we run out of reloads */
947         do
948         {
949            /* loop until we run out of continues/ignores */
881950            do
882951            {
883               /* loop until we run out of continues/ignores */
884               do
885               {
886                  rom_entry modified_romp = *romp++;
887                  int readresult;
952               rom_entry modified_romp = *romp++;
953               int readresult;
888954
889                  /* handle flag inheritance */
890                  if (!ROM_INHERITSFLAGS(&modified_romp))
891                     lastflags = modified_romp._flags;
892                  else
893                     modified_romp._flags = (modified_romp._flags & ~ROM_INHERITEDFLAGS) | lastflags;
955               /* handle flag inheritance */
956               if (!ROM_INHERITSFLAGS(&modified_romp))
957                  lastflags = modified_romp._flags;
958               else
959                  modified_romp._flags = (modified_romp._flags & ~ROM_INHERITEDFLAGS) | lastflags;
894960
895                  explength += ROM_GETLENGTH(&modified_romp);
961               explength += ROM_GETLENGTH(&modified_romp);
896962
897                  /* attempt to read using the modified entry */
898                  if (!ROMENTRY_ISIGNORE(&modified_romp))
899                     readresult = read_rom_data(machine, romdata, &modified_romp);
900               }
901               while (ROMENTRY_ISCONTINUE(romp) || ROMENTRY_ISIGNORE(romp));
902
903               /* if this was the first use of this file, verify the length and CRC */
904               if (baserom)
905               {
906                  LOG(("Verifying length (%X) and checksums\n", explength));
907                  verify_length_and_hash(romdata, ROM_GETNAME(baserom), explength, ROM_GETHASHDATA(baserom));
908                  LOG(("Verify finished\n"));
909               }
910
911               /* reseek to the start and clear the baserom so we don't reverify */
912               if (romdata->file)
913                  mame_fseek(romdata->file, 0, SEEK_SET);
914               baserom = NULL;
915               explength = 0;
963               /* attempt to read using the modified entry */
964               if (!ROMENTRY_ISIGNORE(&modified_romp) && !irrelevantbios)
965                  readresult = read_rom_data(romdata, &modified_romp);
916966            }
917            while (ROMENTRY_ISRELOAD(romp));
967            while (ROMENTRY_ISCONTINUE(romp) || ROMENTRY_ISIGNORE(romp));
918968
919            /* close the file */
920            if (romdata->file)
969            /* if this was the first use of this file, verify the length and CRC */
970            if (baserom)
921971            {
922               LOG(("Closing ROM file\n"));
923               mame_fclose(romdata->file);
924               romdata->file = NULL;
972               LOG(("Verifying length (%X) and checksums\n", explength));
973               verify_length_and_hash(romdata, ROM_GETNAME(baserom), explength, ROM_GETHASHDATA(baserom));
974               LOG(("Verify finished\n"));
925975            }
976
977            /* reseek to the start and clear the baserom so we don't reverify */
978            if (romdata->file != NULL)
979               mame_fseek(romdata->file, 0, SEEK_SET);
980            baserom = NULL;
981            explength = 0;
926982         }
927         else
983         while (ROMENTRY_ISRELOAD(romp));
984
985         /* close the file */
986         if (romdata->file != NULL)
928987         {
929            romp++; /* skip over file */
988            LOG(("Closing ROM file\n"));
989            mame_fclose(romdata->file);
990            romdata->file = NULL;
930991         }
931992      }
932993      else
r4057r4058
938999
9391000
9401001/*-------------------------------------------------
941    open_disk_image - open a DISK image, searching
1002    open_disk_image - open a disk image, searching
9421003    up the parent and loading by checksum
9431004-------------------------------------------------*/
9441005
r4057r4058
9491010
9501011
9511012/*-------------------------------------------------
952    open_disk_image_options - open a DISK image, searching
953    up the parent and loading by checksum
1013    open_disk_image_options - open a disk image,
1014    searching up the parent and loading by
1015    checksum
9541016-------------------------------------------------*/
9551017
9561018chd_error open_disk_image_options(core_options *options, const game_driver *gamedrv, const rom_entry *romp, mame_file **image_file, chd_file **image_chd)
r4057r4058
10811143    for a region
10821144-------------------------------------------------*/
10831145
1084static void process_disk_entries(running_machine *machine, rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
1146static void process_disk_entries(rom_load_data *romdata, const char *regiontag, const rom_entry *romp)
10851147{
10861148   astring *filename = astring_alloc();
10871149
r4057r4058
11041166
11051167         /* first open the source drive */
11061168         LOG(("Opening disk image: %s\n", astring_c(filename)));
1107         err = open_disk_image(machine->gamedrv, romp, &chd.origfile, &chd.origchd);
1169         err = open_disk_image(romdata->machine->gamedrv, romp, &chd.origfile, &chd.origchd);
11081170         if (err != CHDERR_NONE)
11091171         {
11101172            if (err == CHDERR_FILE_NOT_FOUND)
1111               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s NOT FOUND\n", astring_c(filename));
1173               astring_catprintf(romdata->errorstring, "%s NOT FOUND\n", astring_c(filename));
11121174            else
1113               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
1175               astring_catprintf(romdata->errorstring, "%s CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
11141176
11151177            /* if this is NO_DUMP, keep going, though the system may not be able to handle it */
11161178            if (hash_data_has_info(ROM_GETHASHDATA(romp), HASH_INFO_NO_DUMP) || DISK_ISOPTIONAL(romp))
r4057r4058
11291191         /* verify the MD5 */
11301192         if (!hash_data_is_equal(ROM_GETHASHDATA(romp), acthash, 0))
11311193         {
1132            sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s WRONG CHECKSUMS:\n", astring_c(filename));
1194            astring_catprintf(romdata->errorstring, "%s WRONG CHECKSUMS:\n", astring_c(filename));
11331195            dump_wrong_and_correct_checksums(romdata, ROM_GETHASHDATA(romp), acthash);
11341196            romdata->warnings++;
11351197         }
11361198         else if (hash_data_has_info(ROM_GETHASHDATA(romp), HASH_INFO_BAD_DUMP))
11371199         {
1138            sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s CHD NEEDS REDUMP\n", astring_c(filename));
1200            astring_catprintf(romdata->errorstring, "%s CHD NEEDS REDUMP\n", astring_c(filename));
11391201            romdata->warnings++;
11401202         }
11411203
r4057r4058
11431205         if (!DISK_ISREADONLY(romp))
11441206         {
11451207            /* try to open or create the diff */
1146            err = open_disk_diff(machine->gamedrv, romp, chd.origchd, &chd.difffile, &chd.diffchd);
1208            err = open_disk_diff(romdata->machine->gamedrv, romp, chd.origchd, &chd.difffile, &chd.diffchd);
11471209            if (err != CHDERR_NONE)
11481210            {
1149               sprintf(&romdata->errorbuf[strlen(romdata->errorbuf)], "%s DIFF CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
1211               astring_catprintf(romdata->errorstring, "%s DIFF CHD ERROR: %s\n", astring_c(filename), chd_error_string(err));
11501212               romdata->errors++;
11511213               continue;
11521214            }
r4057r4058
12021264    process_region_list - process a region list
12031265-------------------------------------------------*/
12041266
1205static void process_region_list(running_machine *machine, rom_load_data *romdata)
1267static void process_region_list(rom_load_data *romdata)
12061268{
12071269   astring *regiontag = astring_alloc();
12081270   const rom_source *source;
12091271   const rom_entry *region;
12101272
12111273   /* loop until we hit the end */
1212   for (source = rom_first_source(machine->gamedrv, machine->config); source != NULL; source = rom_next_source(machine->gamedrv, machine->config, source))
1213      for (region = rom_first_region(machine->gamedrv, source); region != NULL; region = rom_next_region(region))
1274   for (source = rom_first_source(romdata->machine->gamedrv, romdata->machine->config); source != NULL; source = rom_next_source(romdata->machine->gamedrv, romdata->machine->config, source))
1275      for (region = rom_first_region(romdata->machine->gamedrv, source); region != NULL; region = rom_next_region(region))
12141276      {
12151277         UINT32 regionlength = ROMREGION_GETLENGTH(region);
12161278         UINT32 regionflags = ROMREGION_GETFLAGS(region);
12171279
1218         rom_region_name(regiontag, machine->gamedrv, source, region);
1280         rom_region_name(regiontag, romdata->machine->gamedrv, source, region);
12191281         LOG(("Processing region \"%s\" (length=%X)\n", astring_c(regiontag), regionlength));
12201282
12211283         /* the first entry must be a region */
12221284         assert(ROMENTRY_ISREGION(region));
12231285
12241286         /* if this is a CPU region, override with the CPU width and endianness */
1225         if (cputag_get_cpu(machine, astring_c(regiontag)) != NULL)
1226            regionflags = normalize_flags_for_cpu(machine, regionflags, astring_c(regiontag));
1287         if (cputag_get_cpu(romdata->machine, astring_c(regiontag)) != NULL)
1288            regionflags = normalize_flags_for_cpu(romdata->machine, regionflags, astring_c(regiontag));
12271289
12281290         /* remember the base and length */
1229         romdata->regionbase = memory_region_alloc(machine, astring_c(regiontag), regionlength, regionflags);
1291         romdata->regionbase = memory_region_alloc(romdata->machine, astring_c(regiontag), regionlength, regionflags);
12301292         romdata->regionlength = regionlength;
12311293         LOG(("Allocated %X bytes @ %p\n", romdata->regionlength, romdata->regionbase));
12321294
r4057r4058
12381300         else if (romdata->regionlength <= 0x400000)
12391301            memset(romdata->regionbase, 0, romdata->regionlength);
12401302
1241   #ifdef MAME_DEBUG
1303#ifdef MAME_DEBUG
12421304         /* if we're debugging, fill region with random data to catch errors */
12431305         else
1244            fill_random(machine, romdata->regionbase, romdata->regionlength);
1245   #endif
1306            fill_random(romdata->machine, romdata->regionbase, romdata->regionlength);
1307#endif
12461308
12471309         /* now process the entries in the region */
12481310         if (ROMREGION_ISROMDATA(region))
1249            process_rom_entries(machine, romdata, ROMREGION_ISLOADBYNAME(region) ? ROMREGION_GETTAG(region) : NULL, region + 1);
1311            process_rom_entries(romdata, ROMREGION_ISLOADBYNAME(region) ? ROMREGION_GETTAG(region) : NULL, region + 1);
12501312         else if (ROMREGION_ISDISKDATA(region))
1251            process_disk_entries(machine, romdata, ROMREGION_GETTAG(region), region + 1);
1313            process_disk_entries(romdata, ROMREGION_GETTAG(region), region + 1);
12521314      }
12531315
12541316   /* now go back and post-process all the regions */
1255   for (source = rom_first_source(machine->gamedrv, machine->config); source != NULL; source = rom_next_source(machine->gamedrv, machine->config, source))
1256      for (region = rom_first_region(machine->gamedrv, source); region != NULL; region = rom_next_region(region))
1257         region_post_process(machine, romdata, ROMREGION_GETTAG(region));
1317   for (source = rom_first_source(romdata->machine->gamedrv, romdata->machine->config); source != NULL; source = rom_next_source(romdata->machine->gamedrv, romdata->machine->config, source))
1318      for (region = rom_first_region(romdata->machine->gamedrv, source); region != NULL; region = rom_next_region(region))
1319         region_post_process(romdata, ROMREGION_GETTAG(region));
12581320
12591321   astring_free(regiontag);
12601322}
12611323
12621324
12631325/*-------------------------------------------------
1264    rom_init - new, more flexible ROM
1265    loading system
1326    rom_init - load the ROMs and open the disk
1327    images associated with the given machine
12661328-------------------------------------------------*/
12671329
12681330void rom_init(running_machine *machine)
12691331{
1270   static rom_load_data romdata;
1332   rom_load_data romdata;
12711333
12721334   /* make sure we get called back on the way out */
12731335   add_exit_callback(machine, rom_exit);
12741336
12751337   /* reset the romdata struct */
12761338   memset(&romdata, 0, sizeof(romdata));
1339   romdata.machine = machine;
1340   romdata.errorstring = astring_alloc();
12771341
1278   /* determine the correct biosset to load based on OPTION_BIOS string */
1279   system_bios = determine_bios_rom(&romdata, machine->gamedrv->rom);
1342   /* figure out which BIOS we are using */
1343   determine_bios_rom(&romdata);
12801344
12811345   /* count the total number of ROMs */
1282   romdata.romstotal = count_roms(machine);
1346   count_roms(&romdata);
12831347
12841348   /* reset the disk list */
12851349   chd_list = NULL;
12861350   chd_list_tailptr = &chd_list;
12871351
12881352   /* process the ROM entries we were passed */
1289   process_region_list(machine, &romdata);
1353   process_region_list(&romdata);
12901354
12911355   /* display the results and exit */
12921356   total_rom_load_warnings = romdata.warnings;
1293
1294   display_rom_load_results(machine, &romdata);
1357   display_rom_load_results(&romdata);
1358   astring_free(romdata.errorstring);
12951359}
12961360
12971361
r4057r4058
13261390}
13271391
13281392
1393/*-------------------------------------------------
1394    rom_load_warnings - return the number of
1395    warnings we generated
1396-------------------------------------------------*/
1397
13291398int rom_load_warnings(void)
13301399{
13311400   return total_rom_load_warnings;
src/lib/util/coreutil.c
r4057r4058
8585
8686void rand_memory(void *memory, size_t length)
8787{
88   static UINT32 seed = 0;
8889   UINT8 *bytes = (UINT8 *) memory;
89   UINT32 currand;
9090   size_t i;
9191
92   currand = rand();
93   currand <<= 15;
94   currand ^= rand();
95
9692   for (i = 0; i < length; i++)
9793   {
98      currand = currand * 214013 + 2531011;
99      bytes[i] = (UINT8) (currand >> 16);
94      seed = seed * 214013 + 2531011;
95      bytes[i] = (UINT8) (seed >> 16);
10096   }
10197}
102
src/mess/machine/dgn_beta.c
r4057r4058
10831083
10841084   init_video(machine);
10851085
1086   cpu_set_dasm_override(machine->cpu[0],dgnbeta_dasm_override);
1086   debug_cpu_set_dasm_override(machine->cpu[0],dgnbeta_dasm_override);
10871087
10881088   add_reset_callback(machine, dgnbeta_reset);
10891089   dgnbeta_reset(machine);
src/mess/machine/apple3.c
r4057r4058
739739   /* the Apple /// does some weird tricks whereby it monitors the SYNC pin
740740    * on the CPU to check for indexed instructions and directs them to
741741    * different memory locations */
742   device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_READINDEXED_CALLBACK, (genf *) apple3_indexed_read);
743   device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6502_WRITEINDEXED_CALLBACK, (genf *) apple3_indexed_write);
742   device_set_info_fct(machine->cpu[0], CPUINFO_FCT_M6502_READINDEXED_CALLBACK, (genf *) apple3_indexed_read);
743   device_set_info_fct(machine->cpu[0], CPUINFO_FCT_M6502_WRITEINDEXED_CALLBACK, (genf *) apple3_indexed_write);
744744}
src/mess/machine/coco.c
r4057r4058
28802880   coco_cart = cococart_init(machine, cart_hardware, &cart_config);
28812881
28822882#ifdef MAME_DEBUG
2883   cpu_set_dasm_override(machine->cpu[0], coco_dasm_override);
2883   debug_cpu_set_dasm_override(machine->cpu[0], coco_dasm_override);
28842884#endif
28852885
28862886   state_save_register_global(machine, mux_sel1);
src/mess/machine/c128.c
r4057r4058
890890   int i;
891891
892892   /* configure the M6510 port */
893   device_set_info_fct(machine->cpu[1], CPUINFO_PTR_M6510_PORTREAD, (genf *) c128_m6510_port_read);
894   device_set_info_fct(machine->cpu[1], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c128_m6510_port_write);
893   device_set_info_fct(machine->cpu[1], CPUINFO_FCT_M6510_PORTREAD, (genf *) c128_m6510_port_read);
894   device_set_info_fct(machine->cpu[1], CPUINFO_FCT_M6510_PORTWRITE, (genf *) c128_m6510_port_write);
895895
896896   c64_memory = ram;
897897
src/mess/machine/c16.c
r4057r4058
432432   UINT8 *rom;
433433
434434   /* configure the M7501 port */
435   device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c16_m7501_port_read);
436   device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c16_m7501_port_write);
435   device_set_info_fct(machine->cpu[0], CPUINFO_FCT_M6510_PORTREAD, (genf *) c16_m7501_port_read);
436   device_set_info_fct(machine->cpu[0], CPUINFO_FCT_M6510_PORTWRITE, (genf *) c16_m7501_port_write);
437437
438438   c16_select_roms (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0);
439439   c16_switch_to_rom (cputag_get_address_space(machine,"main",ADDRESS_SPACE_PROGRAM), 0, 0);
src/mess/machine/mac.c
r4057r4058
8080#include "devices/sonydriv.h"
8181#include "machine/ncr5380.h"
8282#include "includes/mac.h"
83#include "debug/debugcpu.h"
8384
8485
8586#ifdef MAME_DEBUG
r4057r4058
19681969
19691970   inquiry_timeout = timer_alloc(machine, inquiry_timeout_func, NULL);
19701971
1971   cpu_set_dasm_override(machine->cpu[0], mac_dasm_override);
1972   debug_cpu_set_dasm_override(machine->cpu[0], mac_dasm_override);
19721973
19731974   /* save state stuff */
19741975   state_save_register_global(machine, mac_overlay);
src/mess/machine/c64.c
r4057r4058
10181018static void c64_common_driver_init (running_machine *machine)
10191019{
10201020   /* configure the M6510 port */
1021   device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTREAD, (genf *) c64_m6510_port_read);
1022   device_set_info_fct(machine->cpu[0], CPUINFO_PTR_M6510_PORTWRITE, (genf *) c64_m6510_port_write);
1021   device_set_info_fct(machine->cpu[0], CPUINFO_FCT_M6510_PORTREAD, (genf *) c64_m6510_port_read);
1022   device_set_info_fct(machine->cpu[0], CPUINFO_FCT_M6510_PORTWRITE, (genf *) c64_m6510_port_write);
10231023
10241024   if (!ultimax)
10251025   {
src/mess/mess.mak
r4057r4058
7373#CPUS += V35
7474#CPUS += V60
7575#CPUS += V70
76CPUS += I8035
77#CPUS += I8041
78CPUS += I8048
79#CPUS += I8648
80CPUS += I8748
81#CPUS += MB8884
82CPUS += I8039
83CPUS += I8049
84CPUS += I8749
85#CPUS += N7751
86#CPUS += M58715
87#CPUS += I8041
88#CPUS += I8741
89CPUS += I8042
90#CPUS += I8242
91#CPUS += I8742
76CPUS += MCS48
9277#CPUS += I8031
9378#CPUS += I8032
9479CPUS += I8051
r4057r4058
150135CPUS += ARM7
151136CPUS += JAGUAR
152137#CPUS += CUBEQCPU
138#CPUS += ESRIP
153139CPUS += R3000
154140#CPUS += R3041
155141CPUS += R4600
r4057r4058
183169#CPUS += GMS30C2132
184170#CPUS += GMS30C2216
185171#CPUS += GMS30C2232
172#CPUS += I860
186173#CPUS += I960
187174#CPUS += H83002
188175#CPUS += H83334
189176CPUS += V810
190177#CPUS += M37702
191178#CPUS += M37710
192#CPUS += PPC403GA
193#CPUS += PPC403GCX
194#CPUS += PPC601
195CPUS += PPC602
196CPUS += PPC603
197CPUS += PPC603E
198#CPUS += PPC603R
199#CPUS += PPC604
200#CPUS += MPC8240
179#CPUS += POWERPC
201180#CPUS += SE3208
202181#CPUS += MC68HC11
203182#CPUS += ADSP21062
r4057r4058
239218CPUS += TMS7000_EXL
240219CPUS += SM8500
241220CPUS += MINX
221CPUS += I8035
222#CPUS += I8041
223CPUS += I8048
224#CPUS += I8648
225CPUS += I8748
226#CPUS += MB8884
227CPUS += I8039
228CPUS += I8049
229CPUS += I8749
230#CPUS += N7751
231#CPUS += M58715
232#CPUS += I8741
233CPUS += I8042
234#CPUS += I8242
235#CPUS += I8742
236CPUS += POWERPC
237#CPUS += PPC403GA
238#CPUS += PPC403GCX
239#CPUS += PPC601
240CPUS += PPC602
241CPUS += PPC603
242CPUS += PPC603E
243#CPUS += PPC603R
244#CPUS += PPC604
245#CPUS += MPC8240
242246CPUS += 8080
243247CPUS += 8085A
244248#CPUS += ADSP2100
src/ldplayer/ldplayer.mak
r4057r4058
2525# specify required CPU cores (none)
2626#-------------------------------------------------
2727
28CPUS += I8049
28CPUS += MCS48
2929CPUS += Z80
3030
3131
src/ldplayer/ldplayer.c
r4057r4058
7777
7878/*************************************
7979 *
80 *  Disc location
81 *
82 *************************************/
83
84static void free_string(running_machine *machine)
85{
86   astring_free(filename);
87}
88
89
90static chd_file *get_disc(const device_config *device)
91{
92   mame_file *image_file = NULL;
93   chd_file *image_chd = NULL;
94   mame_path *path;
95
96   /* open a path to the ROMs and find the first CHD file */
97   path = mame_openpath(mame_options(), OPTION_ROMPATH);
98   if (path != NULL)
99   {
100      const osd_directory_entry *dir;
101
102      /* iterate while we get new objects */
103      while ((dir = mame_readpath(path)) != NULL)
104      {
105         int length = strlen(dir->name);
106
107         /* look for files ending in .chd */
108         if (length > 4 &&
109            tolower(dir->name[length - 4] == '.') &&
110            tolower(dir->name[length - 3] == 'c') &&
111            tolower(dir->name[length - 2] == 'h') &&
112            tolower(dir->name[length - 1] == 'd'))
113         {
114            file_error filerr;
115            chd_error chderr;
116
117            /* open the file itself via our search path */
118            filerr = mame_fopen(SEARCHPATH_IMAGE, dir->name, OPEN_FLAG_READ, &image_file);
119            if (filerr == FILERR_NONE)
120            {
121               /* try to open the CHD */
122               chderr = chd_open_file(mame_core_file(image_file), CHD_OPEN_READ, NULL, &image_chd);
123               if (chderr == CHDERR_NONE)
124               {
125                  set_disk_handle("laserdisc", image_file, image_chd);
126                  filename = astring_dupc(dir->name);
127                  add_exit_callback(device->machine, free_string);
128                  break;
129               }
130
131               /* close the file on failure */
132               mame_fclose(image_file);
133               image_file = NULL;
134            }
135         }
136      }
137      mame_closepath(path);
138   }
139
140   /* if we failed, pop a message and exit */
141   if (image_file == NULL)
142      fatalerror("No valid image file found!\n");
143
144   return get_disk_handle("laserdisc");
145}
146
147
148
149/*************************************
150 *
80151 *  Timers and sync
81152 *
82153 *************************************/
r4057r4058
508579static MACHINE_DRIVER_START( ldv1000 )
509580   MDRV_IMPORT_FROM(ldplayer_ntsc)
510581   MDRV_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "main", "ldsound")
582   MDRV_LASERDISC_GET_DISC(get_disc)
511583MACHINE_DRIVER_END
512584
513585
r4057r4058
516588   MDRV_MACHINE_START(pr8210)
517589   MDRV_MACHINE_RESET(pr8210)
518590   MDRV_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "main", "ldsound")
591   MDRV_LASERDISC_GET_DISC(get_disc)
519592MACHINE_DRIVER_END
520593
521594
r4057r4058
543616 *
544617 *************************************/
545618
546static void free_string(running_machine *machine)
547{
548   astring_free(filename);
549}
619static DRIVER_INIT( ldv1000 ) { execute_command = ldv1000_execute; }
620static DRIVER_INIT( pr8210 )  { execute_command = pr8210_execute; }
550621
551622
552static DRIVER_INIT( ldplayer )
553{
554   mame_file *image_file = NULL;
555   chd_file *image_chd = NULL;
556   mame_path *path;
557623
558   /* open a path to the ROMs and find the first CHD file */
559   path = mame_openpath(mame_options(), OPTION_ROMPATH);
560   if (path != NULL)
561   {
562      const osd_directory_entry *dir;
563
564      /* iterate while we get new objects */
565      while ((dir = mame_readpath(path)) != NULL)
566      {
567         int length = strlen(dir->name);
568
569         /* look for files ending in .chd */
570         if (length > 4 &&
571            tolower(dir->name[length - 4] == '.') &&
572            tolower(dir->name[length - 3] == 'c') &&
573            tolower(dir->name[length - 2] == 'h') &&
574            tolower(dir->name[length - 1] == 'd'))
575         {
576            file_error filerr;
577            chd_error chderr;
578
579            /* open the file itself via our search path */
580            filerr = mame_fopen(SEARCHPATH_IMAGE, dir->name, OPEN_FLAG_READ, &image_file);
581            if (filerr == FILERR_NONE)
582            {
583               /* try to open the CHD */
584               chderr = chd_open_file(mame_core_file(image_file), CHD_OPEN_READ, NULL, &image_chd);
585               if (chderr == CHDERR_NONE)
586               {
587                  set_disk_handle("laserdisc", image_file, image_chd);
588                  filename = astring_dupc(dir->name);
589                  add_exit_callback(machine, free_string);
590                  break;
591               }
592
593               /* close the file on failure */
594               mame_fclose(image_file);
595               image_file = NULL;
596            }
597         }
598      }
599      mame_closepath(path);
600   }
601
602   /* if we failed, pop a message and exit */
603   if (image_file == NULL)
604      fatalerror("No valid image file found!\n");
605}
606
607
608
609static DRIVER_INIT( ldv1000 ) { execute_command = ldv1000_execute; DRIVER_INIT_CALL(ldplayer); }
610static DRIVER_INIT( pr8210 )  { execute_command = pr8210_execute; DRIVER_INIT_CALL(ldplayer); }
611
612
613
614624/*************************************
615625 *
616626 *  Game drivers
r4057r4058
618628 *************************************/
619629
620630GAME( 2008, ldv1000, 0, ldv1000, ldplayer, ldv1000, ROT0, "MAME", "Pioneer LDV-1000 Simulator", 0 )
621GAMEL( 2008, pr8210,  0, pr8210,  ldplayer, pr8210,  ROT0, "MAME", "Pioneer PR-8210 Simulator", 0, layout_pr8210 )
631GAMEL(2008, pr8210,  0, pr8210,  ldplayer, pr8210,  ROT0, "MAME", "Pioneer PR-8210 Simulator", 0, layout_pr8210 )
docs/messnew.txt
r4057r4058
1ïŧŋ0.128.1
1ïŧŋ0.129
22
33New System Drivers Supported (in no particular order):
44------------------------------------------------------
r4057r4058
88- Sony HB-10P/HB-20P [Miodrag Milanovic]
99- Yamaha YIS503IIR Russian/Estonian  [Miodrag Milanovic]
1010
11
12
1113System Driver Changes:
1214----------------------
1315- [ABC800M] Added HR graphics. [Curt Coder, Erik Isaksson]
r4057r4058
7577
7678Source Changes:
7779----------------
78- The core is based on MAME 0.128u7.  This incorporates all features of the
80- The core is based on MAME 0.129.  This incorporates all features of the
7981  update to this core.  [MAME team]
8082
8183- Changed the 8251 UART implementation to be a device.  [Nathan Woods]
whatsnew.txt
r4057r4058
10.128
10.129
22-----
33
44
55MAMETesters Bugs Fixed
66----------------------
7- 02539: [Crash/Freeze] phrcraze, phrcrazs: [debug] Access Violation
8         (Couriersud)
9- 02531: [Sound] mshuttle, mshuttlj, mshutlj2: Moon shuttle speech
10         wrong (Corrado Tomaselli)
7- 02644: [Gameplay] tdragon, tdragon1, hachamf: Coin counter doesn't
8         decrease (Angelo Salese)
9- 02799: [DIP/Input] mace: No player 2, button 4 available for mapping
10         (Phil Bennett)
11- 02676: [Color/Palette] All Laserdisc Games: Wrong colors using
12         Direct3D on ATI cards. (Aaron Giles)
13- 02104: [Crash/Freeze] metlhawk, metlhwkj: Crash while decoding with
14         '-debug' trigger (Aaron Giles)
15- 02575: [Misc.] taitogn: Not marked as bios in -listxml (Aaron Giles)
16- 02779: [Crash/Freeze] sfiii2j: Access Violation with -debug
17         (Aaron Giles)
18- 02141: [Crash/Freeze] sunaq: At the Title, Game is Crash
19         (Aaron Giles)
20- 01961: [Crash/Freeze] jdreddp: [debug] Access Violation when loading
21         savestate with -autosave and -debug (Aaron Giles)
22- 02012: [Crash/Freeze] fatalerror with "symlist" while running game
23         (Aaron Giles)
24- 02760: [Crash/Freeze] Games using MC6845: Crash with an error on
25         startup before OK. (Phil Bennett)
26- 02714: [Sound] 3stooges: Speech works for a while, then starts going
27         in and out of horrible noise and static (Aaron Giles)
28- 02793: [DIP/Input] funkyjet: Unable to locate input port 'P1'.
29         (Phil Bennett)
30- 02776: [Crash/Freeze] mwalk, mwalkj, mwalku: Crash when starting
31         game (Aaron Giles)
32- 02790: [Core] Mame will crash on single monitor system if set to
33         numscreens 2 in the *.ini. (Aaron Giles)
34- 02791: [Crash/Freeze] cafetime: Access Violation with -debug
35         (Phil Bennett)
36- 02788: [Misc.] jjack, dorunrun and clones: Immense emulation speed
37         drop (smf)
38- 02742: [Crash/Freeze] xsleena and clones: Game freezes (Mamesick)
39- 02768: [Documentation] mk3, mk3r20, mk3r10, mk3p40, umk3, umk3r10,
40         umk3r11 : Roms incorrectly named as umk3 instead of mk3 + two
41         versions of U2 SOUND ROM. (Aaron Giles)
42- 02773: [Crash/Freeze] all gamecstl.c sets: [debug] Assertion
43         (Aaron Giles)
44- 02781: [Documentation] mt_mwalk: Change title to "Michael Jackson's
45         Moonwalker (Mega-Tech)" (Aaron Giles)
46- 02780: [Crash/Freeze] nss_smw: Integer Overflow with -debug
47         (Aaron Giles)
48- 02782: [Crash/Freeze] swa: [debug] Access Violation with -debug
49         (Aaron Giles)
50- 02783: [Crash/Freeze] SMS-Based megatech.c sets: [debug] Access
51         Violation with -debug (Aaron Giles)
52- 02785: [Crash/Freeze] a51site4: Interger Overflow with -debug
53         (Aaron Giles)
54- 01092: [Crash/Freeze] debugger crashes when exiting during "run to
55         cursor" (robiza)
56- 02738: [Documentation] zoar: The rom marked as bad dump is not bad.
57         (Aaron Giles)
58- 02758: [Compiling] linking ldplayer fails (Aaron Giles)
59- 02764: [Crash/Freeze] liberatb: [debug] Access Violation (Atari Ace)
60- 02765: [Crash/Freeze] all naomi.c sets: Assertion (Aaron Giles)
61- 02771: [Crash/Freeze] all ddragon3.c, shadfrce.c and wwfsstar.c sets:
62         [debug] Assertion (Mamesick)
63- 02770: [Crash/Freeze] aceattac: Interger Overflow (Aaron Giles)
64- 01437: [Sound] hardhead: MAME has the clock frequency of the YM3812
65         wrong. (Phil Bennett)
66- 02772: [Crash/Freeze] hanayara: [debug] Access Violation
67         (Phil Bennett)
68- 02186: [Misc.] vliner, vlinero: Typo of manufacturer. (Phil Bennett)
69- 02747: [Compiling] Compile error on openSUSE 11.1 / gcc 4.3.2 with
70         OPTIMIZE=3 (Aaron Giles)
71- 02763: [Crash/Freeze] some leland.c sets: Access Violation
72         (Phil Bennett)
73- 02766: [Crash/Freeze] topgunnr: Hangs (Phil Bennett)
74- 02761: [Crash/Freeze] cntrygrl: [debug] Access Violation
75         (Phil Bennett)
76- 02762: [Crash/Freeze] galkaika, galkoku, hyouban, mcontest,
77         tokimbsj, tokyogal, uchuua: Access Violation (Phil Bennett)
1178
1279
1380
1481Source Changes
1582--------------
16Connected firefox audio enables and improved volume balance so you
17can hear the speech chip. Also fixed speech chip frequency.
18[Aaron Giles, Philip Bennett]
83Significantly optimized the inner execution loop. arknoid2 is ~2.5x
84faster with maximum interleave now. [Aaron Giles]
1985
20marked Hacha Mecha Fighter (nmk16.c) BG rom as a bad dump.
21[David Haywood]
86CPU interface organization shuffle. The file cpuintrf.h now merely
87describes the interface, but does not contain any implementation.
88All remaining bits of implementation have been migrated either to
89cpuexec.c or to debugcpu.c. Specifically, cpu_dasm() is now
90debug_cpu_disassemble(), and cpu_set_dasm_override() is now
91debug_cpu_set_dasm_override(). Also moved memory_address_physical()
92to debug_cpu_translate(), since it was only ever used for
93debugging. [Aaron Giles]
2294
23Improved the poker41 and pulltabs button-lamps layouts to look more
24realistic. [Roberto Fresca]
95Changed all CPU and sound cores to use memory_find_address_space()
96instead of cpu_get_address_space(). The former is reliable even
97during early initialization when the CPU cores generally need it.
98[Aaron Giles]
2599
26Fixed the colors of Yumefuda. Added two new palette functions in
27generic.c: paletteram_xRRRRRGGGGGBBBBB_split1_w() and
28paletteram_xRRRRRGGGGGBBBBB_split2_w() (used by Yumefuda).
29[Angelo Salese]
100Removed the dummy CPU core and cpuintrf.c. [Aaron Giles]
30101
31Added function to get the status of CA2 on the 6821 PIA emulator.
32[Phill Harvey-Smith]
102Changed the core execution loop to directly call the execute function
103instead of using the inline helper (which has been removed).
104[Aaron Giles]
33105
34Added new tool ldresample to assist in resynchronizing audio tracks in
35a CHD with frames. Currently still WIP but useful if you know what
36you're doing. [Aaron Giles]
106Virtual Combat improvments: [Jason Eckhardt, Andrew Gardner]
107 * Improved memory map
108 * Fixed the palette
37109
110Turned on perfect interleave for remaining tnzs games, and for qix
111hardware games. [Aaron Giles]
38112
113Perfect synchronization for thunderj, which has always been iffy.
114Removed synchronization hacks. [Aaron Giles]
39115
40New games added or promoted from NOT_WORKING status
41---------------------------------------------------
42Good [David Haywood, Angelo Salese]
116Updated wc90b2 to use newly-dumped roms. [robiza]
43117
118Changed the F3853 implementation into a device. [Wilbert Pol]
44119
120Cleaned up the SID interface. [Wilbert Pol]
45121
46New clones added
47----------------
48Giga Wing (Brazil 990222) [Luis]
122Put some namcos21 logging behind a (disabled) compile-time define.
123[Aaron Giles]
49124
125Converted 68000 core to use state tables. [Aaron Giles]
50126
127Corrected cpu_attotime_to_clocks() calculation. [Phil Bennett]
51128
520.127u8
53-------
129Correctly setup the MC6845 device in the rockola, usgames, coinmstr,
130carrera drivers. [Phil Bennett]
54131
132Added proper inputs to Jongkyo [Angelo Salese]
55133
56MAMETesters Bugs Fixed
57----------------------
58- 02522: [Graphics] cubeqst: Cubequest showing its laserdisc footage under
59         black regular graphics in demo. (Aaron Giles)
60- 01867: [DIP/Input] plygonet: Duplicated Inputs (R. Belmont)
61- 01716: [DIP/Input] backfire, backfira: Coin 1+2, Service1 and Service
62         Mode mapped twice. (Couriersud)
63- 00106: [DIP/Input] le2: Impossible to reload. (R. Belmont)
64- 01708: [DIP/Input] stargrds: stargrds duplicate inputs (Couriersud)
65- 02532: [DIP/Input] lunarba1: Unable to locate input port 'DSW2'
66         (Aaron Giles)
67- 02533: [Crash/Freeze] nbapbp: CPU audio: PULSE_LINE used with level-
68         detected IRQ 1 (Aaron Giles)
69- 02530: [Crash/Freeze] Various: Assertion in cpuint.c (Couriersud)
70- 01821: [Crash/Freeze] lohtb2: Game stops at PCB test (Couriersud)
71- 02529: [DIP/Input] catch22: Credits do not register in game. (Couriersud)
72- 02528: [Core] xexex and clones: Game checks halt with "VERSION ERROR"
73         (R. Belmont)
74- 01447: [DIP/Input] propcycl: Analog input roll over problem. (R. Belmont)
75- 02211: [Sound] soldivid: missing music (R. Belmont)
76- 00978: [Graphics] columns2: There is some garbage on the place where you
77         drop the 2 small squares at the bottom, after the Game Over
78         image drops down. (David Haywood)
79- 02521: [Color/Palette] ichir and clones, tantr and clones: Some colors
80         are missing and other graphics errors (David Haywood)
81- 02511: [Crash/Freeze] dkong: Donkey Kong crashes after quiting.
82         (Aaron Giles)
83- 02512: [Misc.] dkong: Artwork and gameplay area are getting squished/
84         distorted. (Aaron Giles)
134Added extremely preliminary i860 disassembler and hooked it up to the
135vcombat driver. [Jason Eckhardt, Andrew Gardner]
85136
137Cleaned up cycle handling in the 68k core. [Aaron Giles]
86138
139Updated all the sound core header files to declare their SND_GET_INFO
140functions, which will be needed once the sound cores become proper
141devices. It also makes a handful of other header declaration fixes in
142emu/sound, and makes one SND_RESET routine static. Note: votrax.h is
143a new include file altogether. [Atari Ace]
87144
88Source Changes
89--------------
90Updated Dip Switches and Inputs for 'yesnoj' (taito_f2.c driver).
91[stephh]
145Converted the following drivers to use scanline interrupts, partial
146updates, and raw video parameters: [Mamesick]
147 * ddragon
148 * gstream
149 * vball
150 * xain
151 * chinagat
92152
93Fixed several things in the jalmah.c driver: [Angelo Salese]
94 * Fixed Mahjong Daireikai pseudo-random number generator;
95 * Fixed Otogizoushi Urashima Mahjong to make it playable;
96 * Fixed a start-up crashing bug in mjzoomin/urashima/daireika
153Replaced the bad (likely hacked) Gururin dump with a fresh one, and
154fixed some rom names in Double Axle according to the pcb.
155[Smitdogg, Guru]
97156
98Simplified expro02 decryption. [Nicola Salmoria]
157Cleaned up mcs48 to be dependent on a single makefile define, rather
158than separate defines for each CPU which didn't really buy us anything
159in terms of code size or performance. [Aaron Giles]
99160
100Completed general NeoGeo cleanup: [JohnBoy]
101 * Sorted OEM / bootleg sets
102 * Renamed roms on non OEM / bootleg sets to ONE naming sheme
103 * Renamed functions
104 * Cleaned up bootleg sets
105 * Added some comments
106 * Renamed sma in garou/garouo, added comment
161Correctly setup the MC6845 device in the Funworld driver. Added common
162device interface and eliminated the screen size & visible area
163parameters to Magic Card 2. [Roberto Fresca]
107164
108Changed Cube Quest laserdisc override logic. It's still a little hacky
109but this works better than the previous attempt. [Aaron Giles]
165Correctly setup the MC6845 device in the Goldnpkr driver. Added common
166device interface, merged witchcrd and sloco93 machine drivers, and
167added/corrected the 50/60 Hz. DIP switches to all games. The 50hz mode
168needs to be corrected. Some games as most bsuerte sets have the 50/60
169Hz. DIP switch connection patched. [Roberto Fresca]
110170
111Updated segac2 driver to use updated megadriv code. [David Haywood]
171Correctly setup the MC6845 device in the Calomega driver. Added common
172device interface. [Roberto Fresca]
112173
113Moved fantasia -> expro02.c, however, the extra layer is misplaced on
114it. Scroll regs probably differ from the original. [David Haywood]
174Fixed crash when mouse-clicking without a valid mouse_target set
175(typically after startup when no mouse movement events have occurred).
176[Phil Bennett]
115177
116PsikyoSH: hook up VBL IRQ ack [R. Belmont]
178Improvements to lucky8... [Roberto Fresca]
179 - Fixed memory map.
180 - Fixed NVRAM. (please delete the old .nv)
181 - Added sound through sn76496.
182 - Added 3x PPI 8255.
183 - Created basic inputs from the scratch to match the PPI connections.
184 - Defined the output port.
185 - Change description to "New Lucky 8 Lines"
186 - Change manufacturer to Wing Co.Ltd.
187 - Added an alternate set.
117188
118SH2: fix DRC's handling of internally generated IRQs, and fix
119compiling in interpreter mode. [R. Belmont]
189Fixed Top Landing ADPCM ROM loading. [Phil Bennett]
120190
121Rewrote pmpoker.c driver (first part). [Roberto Fresca, Grull Osgo]
122 - Added discrete sound support to Golden Poker hardware games based
123    on schematics.
124 - Added discrete sound support to Potten's Poker hardware games based
125    on PCB analysis.
126 - Added discrete circuitry diagrams for both hardware types.
127 - Adjusted the CPU adressing to 15 bits for pmpoker/goldenpkr
128    hardware.
129 - Adjusted the CPU adressing to 14 bits for pottnpkr hardware.
130 - Rewrote all the ROM loads based on these changes.
131 - Defined MASTER Xtal & CPU clock.
132 - Fixed the visible area based on M6845 registers.
133 - Improved the lamps layouts to be more realistic.
134 - Added Good Luck (potten's poker hybrid running in goldnpkr hardware).
135 - Added Buena Suerte (spanish) x 2 sets.
136 - Added set Royale.
137 - Added Witch Card and spanish variants.
138 - Added Super Loco 93 (spanish) x 2 sets.
139 - Renamed set goldnpkc to pottnpkr (parent Jack Potten's Poker set).
140 - Renamed set jokerpkr to potnpkra, since is another Jack Potten's
141    Poker set.
142 - Added other 2 clones of Jack Potten's Poker.
143 - Renamed/cleaned all sets based on code/hardware analysis.
144 - Added intensity bit to the color system.
145 - Implemented the blue killer bit for Witch Card hardware.
146 - Implemented the extended graphics addressing bit for Witch Card
147    hardware.
148 - Added proper visible area to sloco93.
149 - Rewrote the graphics & color decode system based on schematics. No
150    more patched codes.
151 - Changed the char gfx bank structure and rom load according to the
152    new routines.
153 - Adjusted the amount of color codes and PROM region size accordingly.
154 - Updated all notes.
191Fixed Cherry Bonus III and Cherry Bonus III (Version 1.40) colors.
192[Roberto Fresca]
155193
156Large update to comments in smstrv.c for SMS Manufacturing boards.
157Documented how the input/output ports are hooked up, and what the PALS
158do, still need to document the video output port and add the smssshot
159roms, and actually hook stuff up (like the z80) based on the comments.
160[Lord Nightmare]
194Added preliminary sound & colors to the Mahjong Shiyou driver, game
195now throws a sound error. Merged Mahjong Shiyou to the Royal Mahjong
196driver, graphics are improved because of that. [Angelo Salese]
161197
162Removed speedups from sokyugrt, they break the game (make it too slow)
163the SH2 DRC is sufficient. [David Haywood]
198Fixed ddrago3p gfx ROM loading. [Creamymami]
164199
165Did most of the protection work for Double Dealer. It appears to use
166a funky video register setting involving locations $8c1e0-8c1ef range
167for cards movements so it isn't playable yet. [Angelo Salese]
200Cherry I Gold improvements: [Roberto Fresca]
201 - Completed the missing inputs.
202 - Mapped 4 of the 5 DIP switches banks. (can't find the 5th)
203 - Worked out the conditional DIPs.
204 - Documented all DIP switches bank.
205 - Added PORT_DIPLOCATION to all switches.
168206
169Added DIP LOCATIONS to items in the driver and cleaned up some of the
170comments mentioning duplicate dips configurations.  Not fully
171understanding how the FREE PLAY was implemented, I left that not to
172show a location. [Tafoid]
207Cherry Bonus III (Version 1.40) improvements: [Roberto Fresca]
208 - Worked the remaining inputs.
209 - Mapped and documented all 5 DIP switches banks.
210 - Worked out the conditional DIPs.
211 - Added PORT_DIPLOCATION to all switches.
212The game is working, but need a workaround for the status connection.
213Each time the player press 'Take' to get the credits, a "call
214attendant" msg appear and credits must be taken pressing 'Key Out'.
173215
174cubeqst changes: [Aaron Giles]
175 * removed custom sound in favor of individual DACs
176 * simplified palette management logic
177 * hooked up the "disc on" signal
216Improvements to New Lucky 8 Lines: [Roberto Fresca]
217 - Proper 3x PPI 8255 connections.
218 - Created a new AY8910 interface due to different ports addressing.
219 - Hooked all the input banks (8).
220 - Improved DIP switches with main game and D-UP rates, keyin values,
221    D-UP game type (reels/cards) and other options to both sets.
222 - Added PORT_DIPLOCATION to all DSW banks.
223 - Promoted both sets to working state.
224The game has 2 sets of controls. Once coined, both players can switch
225control through their own 'BIG' key. If the game boots with 'Coin Jam'
226error, press RESET to normalize. Please delete your old .nv and .cfg
227files before run this update.
178228
179Cleaned up Firefox video implementation: [Aaron Giles]
180 - proper sprite/tile priorities
181 - adjusted X offset to match screenshots
182 - converted to tilemaps
229Improved colors of New Lucky 8 Lines. [David Haywood]
183230
184Added cawing B-Board PAL dumps [Corrado Tomaselli]
231Implemented GTE divider using reciprocal table derived by pSXAuthor,
232this should allow the results to be calculated as inaccurately as the
233real hardware. [smf]
185234
235Fixed AT28C16 so that a write isn't allowed to start if there is one
236in progress and a write isn't started if the data is already correct.
237This allows my dream horse to boot again. Further investigation is
238needed. [smf]
186239
240Maps all docastle.c games' third CPU rom to 0x0000 so that MAME
241doesn't log unmapped reads constantly. [smf, David Haywood]
187242
188New games added or promoted from NOT_WORKING status
189---------------------------------------------------
190Mahjong Daireikai [Angelo Salese]
191Otogizoushi Urashima Mahjong [Angelo Salese]
192Good Luck! [Roberto Fresca]
193Buena Suerte! (spanish) [Roberto Fresca]
194Witch Card (english) [Roberto Fresca]
195Super Loco 93 (spanish) [Roberto Fresca]
243Improvements to goldstar.c driver: [Roberto Fresca]
244 - Added another set of Cherry Bonus III.
245 - Reworked and cleaned ncb3, cb3a, lucky8 and lucky8a inputs.
246 - Added the 2nd set of controls to the above games.
247 - Removed the OKI references from machine driver and rom load for the
248    above games.
249 - Promoted ncb3 and cb3a to working status.
250 - Reparented sets.
196251
252Wrote a placeholder driver for an unknown "fruit" ROM set. Anything
253might be wrong about it... [David Haywood, Angelo Salese]
197254
255Improved bishjan.c: [Luca Elia]
256 - Converted the tilemaps chip to an 8-bit bus width, and added 16-bit
257    handlers using the macros in memconv.h.
258 - Improved bishjan memory map.
259 - Implemented line scroll emulation.
198260
199New clones added
200----------------
201Matrimelee / Shin Gouketsuji Ichizoku Toukon (bootleg) [Kawaks]
202Jack Potten's Poker (2 sets) [Roberto Fresca]
203Witch Card (spanish)(2 sets) [Roberto Fresca]
204Buena Suerte (spanish, set 2) [Roberto Fresca]
205Super Loco 93 (spanish, set 2) [Roberto Fresca]
261Merged i8x41 (UPI-41) core into MCS-48 core: [Aaron Giles]
262 * all code now lives in mcs48.c
263 * rewrote disassembler as unified MCS-48/UPI-41 disassembler
264 * changed UPI-41 interfaces to match MCS-48
265 * added new master read/write interfaces for external access
266 * unified interface to 8243 expander chip
267 * converted tnzs and decocass to the new interfaces
206268
269DECO Cassette fixes/cleanups: [Aaron Giles]
270 * converted tape handling to a device
271 * changed tape handling to use a timer callback
272 * updated to work with new UPI-41 core
273 * corrected clock speeds for all chips (esp. the 8041)
274 * fixed very wrong CRC implementation (how did it ever work?)
275 * corrected sound IRQ rate
276 * corrected video timing
207277
278Burger Time hardware fixes: [Aaron Giles]
279 * corrected sound IRQ rate and handling
280 * removed lnc audio reset hack
281 * full audio memory maps based on schematics
282 * corrected video timing
208283
209New games marked as GAME_NOT_WORKING
210------------------------------------
211Royale [Roberto Fresca]
284Disassembled PCs are now forcibly aligned to the minimum opcode size
285and explicitly masked. [Aaron Giles]
212286
287Normalized the CPU cores to always do while (icount > 0), in order
288to remove the kludge in cpuexec.c that caused us to overeat by 1 cycle
289to accommodate those cores that there looping while (icount >= 0).
290[Aaron Giles]
213291
292Fixed System 18 rendering so that System 16 sprites don't attempt to
293shadow VDP pixels (causes crash downstream in debug builds).
294[Aaron Giles]
214295
2150.127u7
216-------
296Hooked up DSA/ESA instructions for PowerPC 602 (as no-ops for now).
297Also hooked up PPC602 IBR. polystar gets a little farther but crashes
298due to a TLB issue. [Aaron Giles]
217299
300Removed HAS_PPC* in favor of a single HAS_POWERPC, and a single
301definition in cpu.mak for all PowerPC variants. [Aaron Giles]
218302
219MAMETesters Bugs Fixed
220----------------------
221- 02482: [Graphics] bubblemj: Demonstration screen trouble
222         (Couriersud)
223- 02483: [Graphics] gunlock, rayforcj: Title screen trouble
224         (Couriersud)
225- 02498: [Graphics] lightbr: Trouble of title screen (Couriersud)
226- 02221: [Sound] blzntrnd: Sound is almost completely broken
227         (Aaron Giles)
228- 02467: [Crash/Freeze] qsww: Game Crashes (Olivier Galibert)
229- 02479: [Misc.] Various: Memory leak (Aaron Giles)
230- 02266: [Multisession] tceptor: Thunder Ceptor crashes out when run
231         as the second game. (Aaron Giles)
232- 02439: [Multisession] tx1: TX1 quits out on second launch.
233         (Aaron Giles)
234- 02488: [Multisession] All sets with using 2+ monitors: Crash to
235         desktop on second play. (Aaron Giles)
236- 02321: [Crash/Freeze] mpu4utst, mpu4tst2, mpu4met0: Screenless
237         systems crash due to problems in some display core functions
238         (Aaron Giles)
239- 02476: [Misc.] some neodrvr.c sets: Memory leak
240- 02324: [Gameplay] dokyusei, dokyusp, gakusai, gakusai2: Game doesn't
241         start (Aaron Giles)
242- 02292: [Crash/Freeze] dcclubfd, gground, ggroundj, roughrac,
243         sgmastc, sgmastj : Game doesn't start (Olivier Galibert)
244- 02480: [Crash/Freeze] Various: CPU x: PULSE_LINE used with level-
245         detected IRQ y (Aaron Giles)
246- 02489: [Color/Palette] All Sets in namcos22.c: Garbled colours and
247         graphics (Aaron Giles)
248- 02470: [Crash/Freeze] Various: Access Violation (Aaron Giles)
249- 02475: [Crash/Freeze] kf10thep: Access Violation  (Johnboy)
250- 02502: [Crash/Freeze] fax, hardhat, mtrap, pepper2, teetert,
251         venture and clones: Accessing a certain portion of memory in
252         the debugger causes crash. (Aaron Giles)
253- 00998: [Crash/Freeze] dcclubfd: Hangs during playing with an access
254         violation error. (Olivier Galibert)
255- 02460: [DIP/Input] qrouka: Coin 1+2 no longer work. (David Haywood)
256- 00081: [Crash/Freeze] dcclub: Game crash and freeze.
257         (Olivier Galibert)
258- 00989: [Graphics] qgh: If you do a metamorphose, the screen turns
259         black without displaying words/pictures. (David Haywood)
260- 02458: [Color/Palette] enforce: Road layer colors are wrong.
261         (M.A.S.H., Phil Bennett)
262- 02469: [Graphics] geebee and clones: Appears to be missing its
263         middle swinging gate (Couriersud)
264- 02477: [DIP/Input] most merit.c sets: Unable to locate input port
265         'IN3'
266- 02468: [Compiling] 64 bit build fails (Aaron Giles)
303Made xsleena run at perfect interleave and simplified the shared RAM.
304Also moved to modern banking and cleaned up memory maps a bit.
305[Aaron Giles]
267306
307Added two new Windows OSD options: -debugger_font and
308-debugger_font_size, which control the font and size used in the
309debugger text Windows. These default to "Lucida Console" and 9pt,
310which is the same face as previously hard-coded but 1pt larger.
311Personally, I prefer "Consolas" 9pt, which is one of the new "C" fonts
312included with Windows Vista and later (also available for free
313download on older systems). Note that only fixed-width fonts really
314work here, for obvious reasons. [Aaron Giles]
268315
316Added new frontend option -listbrothers. This will list all "brothers"
317of a given driver, meaning those drivers that come from the same
318source file, along with their parent names if they are clones. If a
319wildcard name is specified for the driver, then the first driver in a
320given source file will trigger a list of his brothers, and any other
321drivers in the same source file which match the wildcard will be
322flagged. [Aaron Giles]
269323
270Source Changes
271--------------
272Removed unneeded UI keys by removing the constants. Readded
273UI_ON_SCREEN_DISPLAY to be changed again in the "Inputs" menu.
274[stephh]
324Corrected Mr. Do clocks, video parameters, merged memory maps.
325[Aaron Giles]
275326
276Added missing support of normal joystick for player 2 in 'gwarb'.
277[stephh]
327Fixed i86 core so that REP instructions with high interleave actually
328make forward progress. Also fixed cpu.mak dependencies for i286.
329[Aaron Giles]
278330
279Fixed a number of regressions due to recent 68000 IRQ changes.
331Added polling hooks for SP0250 DRQ line. The callback is now optional.
332If not provided, then the kick timer is not used. Converted gottlieb
333speech driver to use polling for SP0250 DRQ line. [Aaron Giles]
334
335Added kludge to 6502 core such that CLI followed by RTI does not allow
336any interrupts through. In the future, the 6502 interrupt handling
337needs further revisiting. [Aaron Giles]
338
339Improved graphics and sound in Grand Prix '98 [David Haywood]
340
341Added the ability for a ROMset to specify a default BIOS. Use
342ROM_DEFAULT_BIOS("biosname") in the ROM definition. This can be used
343to ensure a correct default BIOS for ROM versions that care.
280344[Aaron Giles]
281345
282Added new functions for building device-relative tags. Changed machine
283configuration builder to use these functions. Also changed the
284laserdisc player devices to use them. Updated Z80 CTC/SIO code to
285assume that the CPU provided for the clock is relative to the device
286that the CTC/SIO belong to. Updated memory code to assume that regions
287and devices referenced by the memory map are relative to the device
288the associated CPU belongs to. [Aaron Giles]
346atarisy1 changes: [Kevin Eshbach]
347 * Support for new Atari System 1 TTL Motherboard dump (previously
348    MAME would crash when using it and now it just seems to hang.)
349 * PROMs dumped from Atari System 1 TTL Motherboard (one PLA needs
350    dumping though.)
351 * Added notes on the Atari System 1 Motherboard and some of its
352    supported games
289353
290Neo-Geo cleanups (still in progress): [Johnboy]
291 - Sorted OEM / Bootleg sets
292 - Renamed roms on non OEM / Bootleg sets to ONE naming sheme
293 - Renamed functions
294 - Added some comments
354Added placeholders for various PALs on the following systems: balsente,
355galaga, ms32, namcofl, rocnrope, tx1. [Kevin Eshbach]
295356
296System 24 cleanups: [Aaron Giles, Olivier Galibert]
297 * correct memory map for both CPUs
298 * reduced RAM size to 256k
299 * correct video timings
300 * renamed regions
301 * proper interrupt handling
302 * fixed dcclub magic latch
357popeye.c improvements: [Kevin Eshbach]
358 * Corrected the rom names for Popeye
359 * Added save state support to Popeye
360 * Added the dip location to the encrypted Popeye and fixed the coin
361   settings according to the manual (unencrypted Popeye not changed)
303362
304Checked, via Z80 code analysis, inputs and Dip Switches for the
305following games in snk.c driver: [stephh]
306 - ikari, ikaria, ikarinc, ikarijp, ikarijpb
307 - victroad, dogosoke, dogosokb
308 - bermudat, bermudaj
309 - worldwar, bermudaa
310 - psychos, psychosj
363Added the dip locations to Tutankham. [Kevin Eshbach]
311364
312Added correct overlay positioning, font, and behavior to PR-8210
313emulation. [Aaron Giles, Warren Ondras]
365Some minor MCS-48 cleanup. Added 8040/8050 variants. [Aaron Giles]
314366
315Sonic Blast Man 2 Special Turbo (SNES bootleg) changes:
316[Andreas Naive, Tomasz Slanina]
317 - added rom decryption
318 - patched protection checks
319 - mapped extra inputs
367Fixed buggyboy I/O, engine sound and tilemap scrolling. [Phil Bennett]
320368
321Fixed timers in i8051 core. [Grull Osgo]
369ldplayer works again. Added MDRV_LASERDISC_GET_DISC callback hook
370which allows for dynamically finding the CHD, rather than relying
371on the DRIVER_INIT hackery that was there before. [Aaron Giles]
322372
323Fixed the i8051 AJMP opcode to take 2 bytes instead of 3. [Grull Osgo]
373Added a work-around for 2 Minute Drill, to get it booting again.
374[Angelo Salese]
324375
325Improved the button-lamps layout to all games in ampoker2.c driver.
326Now buttons are more realistic. Also improved the Lucky 74 button-
327lamps layout to be more realistic.[Roberto Fresca]
376Fixed rendering of slider controls so it doesn't overlap when menus
377get large. [Aaron Giles]
328378
329Improvements to InterFlip / Recreativos Franco driver: [Grull Osgo, Roberto Fresca]
330 - Added Baby Poker Game.
331 - Added sound support to Baby Poker Game.
332 - Reworked the color routines.
333 - Added Baby Dado Game.
334 - Added new color routines for Baby Games.
335 - Redumped the videocba color PROM.
336 - Added color switch. (It changes background color in some games).
337 - Added "hopper full" switch support (for diverter function).
338 - Added diverter function decoder.
339 - Added full functional mechanical counters decoding.
340 - Added 7 Segment decoder and 7 Digit Counter functions.
341 - Added button-lamps layout & mechanical counters simulation on
342   layout. Mechanical counters to layout: Coin-In, Coin-Out and Coin
343   to Drop.
344 - Added NVRAM support to mechanical counters.
345 - Mapped "Hand Pay" button for Baby Games.
346 - Added decoder to Jackpot mechanical counter.
347 - Added tower lamps to Baby Games layouts.
348 - Reworked layouts for Baby Games.
379Fixed speed-up for Vamf x1/2 (Europe) [Pierpaolo Prazzoli]
349380
350Fixed old regression bug in Sengoku Mahjong that made the controls
351not work when the V30 CPU core was converted to 16-bit. Specifically,
352the game accesses the multiplexer with a word write instead of a byte
353write. [Angelo Salese]
381Cleaned up the profiler. Reduced its runtime overhead significantly by
382inlining the check to see if it is running. Removed obsolete entries
383and updated the text to more accurately describe each one. Added CPU
384tags to the CPU names. Switched to using an astring for building the
385final string. Unfortunately, still a bit too much overhead to leave
386it on in all builds. [Aaron Giles]
354387
355Checked, via Z80 code analysis, inputs and Dip Switches for the
356following games in snk.c driver: [stephh]
357 - gwar, gwarj, gwara, gwarb
358 - chopper, choppera, chopperb, legofair
359 - tdfever, tdfeverj, tdfever2
360 - fsoccer, fsoccerj, fsoccerb
388Added NO_DUMPS for the VHS on hnxmasev, hnageman, av2mj1bb and
389av2mj2rg. [Angelo Salese]
361390
362MCU protection now working for lohtb2 (m72.c) [Couriersud]
363 * Hooked up 6751
364 * Synchronized protection ram writes with timer callbacks
365 * Removed speed hack from NEC CPU emulation, which breaks the
366    protection code
391Fixed auto_malloc() to randomize its memory when allocated in the
392debug build. This used to be the standard, but it seems to have been
393removed when the pool allocation was moved into the library. Also
394changed rand_memory() to use a fixed seed for consistent behavior.
395[Aaron Giles]
367396
368snes.c - Fixed problem with OAM address reset at start of vblank.
369[Tomasz Slanina]
397Removed a couple of unnecessary typedefs from mamecore.h. Updated
398romload to use an astring for accumulating errors (I always feared
399busting that buffer with some huge romlist). [Aaron Giles]
370400
371Made the Z80 daisy chain aware of referencing device-specific devices.
401romload cleanups: [Aaron Giles]
402 - added running_machine to internal structure, removed as explicit
403    parameter
404 - added new function rom_file_size() to compute the size of a ROM
405 - removed rom_first_chunk() and rom_next_chunk() which are no longer
406    needed (all users can use rom_file_size() now)
407 - changed progress display to be based on size of ROMs loaded
408 - changed temporary load buffer to be dynamically allocated
409 - fixed reload logic to handle skipped BIOSes
410
411Fixed layer enable,flip x & x/y position in goodejan.c driver.
412[Angelo Salese]
413
414Fixed for odd word DMA transfers in the namcos12 driver.
415[Olivier Galibert]
416
417Added simple built-in layout for polepos showing the position of the
418shifter. Removed debug build hack to popmessage the shifter state.
372419[Aaron Giles]
373420
374Added preliminary LD-V1000 emulation. Not fully working yet, but
375mostly there. [Aaron Giles]
421Added savestate support to all games in mrdo.c: mrdo, mrdoy, mrdot,
422mrdofix, mrlo, mrdu, yankeedo. [MooglyGuy]
376423
377Cleaned up and normalized the three existing laserdisc emulations.
378Removed obsolete code from the laserdisc core. [Aaron Giles]
424Added savestate support to all games in docastle.c: docastle,
425docastl2, docastlo, douni, dorunrun, dorunru2, dorunruc, dorunrca,
426spiero, dowil, jjack, kickridr, idsoccer. [MooglyGuy]
379427
380Optimized st0016 RAM tile behavior to lazy decode the graphics,
381giving a big speed boost to some of the mahjong games. [Aaron Giles]
428Added savestate support to all games in statriv2.c: statusbj, hangman,
429trivquiz, statriv2, statrv2v, statriv4, sextriv, quaquiz2, supertr2,
430supertr3. [MooglyGuy]
382431
383Space Duel: Added the P10/11 dip switch (only 4 switches instead of
384the standard 8) [Franklin Bowen]
432Lots of improvements to the different Cherry Master hardware: added
433new sets, created new machine drivers, fixed colors, added PPI
434devices, created new 8255 and ay8910 interfaces, worked out inputs
435and DIP switches from the scratch, fixed memory maps, merged the
436cherrym2.c driver with goldstar.c and much more...
437[Roberto Fresca, David Haywood]
385438
386Improvements to Sandii' games (snookr10, apple10 & tenballs):
387[Roberto Fresca]
388 - Reworked the button-lamps matrix system.
389 - Documented both output ports.
390 - Connected coin in, key in and payout counters.
391 - Improved the lamps layout to be more realistic.
392 - Updated technical notes.
439Added savestate support to 4enraya. [MooglyGuy]
393440
394Minor optimization to the Neo-Geo sprite clearing code.
395[Christophe Jaillet]
441Changed videopkr MCS-48 P4 control register to the PROG line, which is
442more likely. The way to toggle the PROG line is to read/write/and/or
443to ports 4-7. Since the board doesn't list an 8243 port expander, it
444is likely the "writes" to port 4 are really just a mechanism to get
445the PROG line to toggle to clear the interrupt. [Aaron Giles]
396446
397Added emulation for snes special chips DSP-2 & OBC-1.
398[Fabio Priuli, byuu]
399 - added sources snesdsp2.c & snesobc1.c
400 - removed special chips detection from MAME
401 - modified memory handlers to account for the new chips
447Fixed Super Triv colors. [Pierpaolo Prazzoli]
402448
449Discovered numerous new opcodes for cb2001. [robiza]
403450
451Improved mgcs. It now runs through attract mode. It still locks up as
452soon as one coins up though, due to the unemulated IGS029 protection.
453[Luca Elia]
404454
455Fixed more stuff with Diamond Derby, game is playable but not yet
456working (due of a subtle bug, see source) [Angelo Salese]
457
458Slot Carnival: [Roberto Fresca]
459 - Added gfxdecode & palette length to the machine driver, so tiles
460    can be viewed through F4 in case of someone wants to help.
461 - Defined SND_CLOCK for the ay8910.
462
463Removed bogus port 4-7 definitions from MCS-48. Added i8243
464implementation. Connected 8243 properly to monsterb and system 16a
465sound. Changed draw80pkr to connect the PROG line like videopkr.
466[Aaron Giles]
467
468Changed Status Trivia 2 (and related games) clock to 13.684MHz to fix
469game speed. Still wrong, but better than before. [MooglyGuy]
470
471Fixed a few out-of-bounds errors revealed by randomly initializing
472auto_malloc() memory. These would manifest themselves as difficult-to-
473reproduce crashes on some systems. Affects laserbat, progolf, seta2,
474and cubeqst drivers. [Aaron Giles]
475
476Removed dangling old obsolete code from scramble.c, scobra.c, and
477galaxold.c. [Aaron Giles]
478
479Added savestate support to the TTL74148 and TTL74153 devices.
480[MooglyGuy]
481
482Removed anonymous timers from gridlee and added savestate support.
483[MooglyGuy]
484
485Added savestate support to all games in 40love.c, 88games.c, 1943.c,
486carpolo.c, circus.c and exidy.c: 40love, fieldday, undoukai, 88games,
487konami88, hypsptsp, 1943, 1943j, 1943kai, carpolo, circus, circusse,
488robotbwl, crash, ripcord, sidetrac, targ, targc, spectar, spectar1,
489rallys, phantoma, mtrap, mtrap3, mtrap4, venture, venture2, venture4,
490teetert, pepper2, hardhat, fax, fax2. [MooglyGuy]
491
492Cleaned up some memory and file handles in the error cases of
493ldverify. [Oliver Stoeneberg]
494
495
496
405497New games added or promoted from NOT_WORKING status
406498---------------------------------------------------
407Megatouch 5 (9255-60-07 RON, New Jersey version) [Brian Troha]
408Astropal (Sidam?) [Couriersud]
409Baby Poker [Grull Osgo, Roberto Fresca]
410Baby Dado [Grull Osgo, Roberto Fresca]
411Sonic Blast Man 2 Special Turbo (SNES bootleg)
412  [Andreas Naive, Tomasz Slanina]
499Turbo Sub (2 versions) [Phil Bennett]
500Mahjong Jong-Tei [Luca Elia]
501Barline [David Haywood, Angelo Salese]
502New Lucky 8 Lines (2 sets) [Roberto Fresca]
503Cherry Bonus III (Version 1.40, 2 sets) [Roberto Fresca]
504Cherry Bonus III (version 1.40, encrypted)
505  [Andreas Naive, Roberto Fresca]
506Ying Hua Lian 2.0 [Luca Elia, Angelo Salese, David Haywood]
507M.A.C.H. 3 [Aaron Giles, Bobby Tribble]
508Us vs. Them [Aaron Giles, Smitdogg]
509Soul Calibur [Olivier Galibert]
510Cherry Master (Corsica, ver.8.01) [Roberto Fresca]
511Cherry Master (ver.4) [Roberto Fresca, David Haywood]
512Cherry Master I (ver.1.01) [Roberto Fresca, David Haywood]
413513
414514
415515
416516New clones added
417517----------------
418Megatouch III (9255-20-07 ROG, New Jersey version) [Brian Troha]
419Super Megatouch IV (9255-41-07 ROG, New Jersey version) [Brian Troha] (Not Working)
420Armored Warriors (US 940920) [Razoola]
421Mortal Kombat 3 (rev 1 chip label p4.0) [Andrea Turci]
422Decathlete V1.001 [Andrea Turci]
518Space Echo (set 2) [Roberto Fresca]
519Show Hand (China) [Luca Elia]
520Don Den Lover Vol. 1 (Korea) [Luca Elia]
521Vamf x1/2 (Europe) [Smitdogg]
522DownTown / Mokugeki (Joystick Hack) [Corrado Tomaselli]
523New Lucky 8 Lines (set 2) [Roberto Fresca]
524Pit Boss (Set 2) [David Haywood]
525R-Type (world, bootleg) [mameitalia]
526Thunder Cross II (World) [Stefan Lindberg]
527Trivia ? Whiz (Horizontal) (question set 3) [David Haywood]
528Trivia ? Whiz (Edition 2) (question set 2) [David Haywood]
529Trivia ? Whiz (Edition 3 - Horizontal) (set 2) [David Haywood]
530Trivia ? Whiz (Edition 4) (question set 2) [David Haywood]
531Phraze Craze (set 2) [David Haywood]
5329-Ball Shootout Championship (not working) [David Haywood]
533Dogyuun (Licensed to Unite Trading For Korea) [Smitdogg]
423534
424535
425536
4260.127u6
537New games marked as GAME_NOT_WORKING
538------------------------------------
539Night Bunny / Royal Night [David Haywood, Angelo Salese]
540Night Gal [David Haywood, Angelo Salese]
541Night Gal Summer [David Haywood, Angelo Salese]
542Sexy Gal / Sweet Gal [David Haywood, Angelo Salese]
543Mahjong Cafe Break [Guru]
544Bingo Circus [David Haywood, Angelo Salese]
545Status Black Jack [Angelo Salese, Roberto Fresca]
546Merit Poker [David Haywood, Angelo Salese]
547Cherry Chance [David Haywood, Angelo Salese]
548Dancing Stage Euro Mix [smf]
549Landing High Japan [Ordyne, Phil Bennett]
550Lucky Girl [David Haywood]
551X Se Dae Quiz [David Haywood]
552Mahjong Senka [Angelo Salese]
553Mahjong Yarou [Angelo Salese]
554AV Hanafuda Hana no Christmas Eve [Angelo Salese]
555AV Hanafuda Hana no Ageman [Angelo Salese]
556Mahjong Gaiden [David Haywood]
557Operation Tiger [Chris Hardy, Phil Bennett]
558Magic Card [Roberto Fresca, David Haywood, Angelo Salese]
559Slot Carnival [David Haywood, Roberto Fresca]
560Cross Bingo [f205v]
561
562
563
5640.128u7
427565-------
428566
567NOTE: As of this release, we have two more major changes. These should
568be the last "huge" changes of this dev cycle.
429569
570The most major change is the final retirement of the global Machine
571pointer, which has been part of MAME for many years. Frankly, I never
572thought we'd hit this point so quickly, so my hats off to Atari Ace
573who helped push through the final round of changes needed to make this
574happen finally. As a result of this change, it should be possible in
575the coming year to finally write a driver that runs two full machines
576simultaneously.
577
578The second big change is that the CPUs are now full-fledged devices,
579and participate like all other devices in the system configuration.
580This is mainly an internal structural change, but in the end removes
581some redundant code and behavior. In a future dev cycle, a similar
582thing will happen with the sound cores.
583
584Starting now, the focus for MAME will be to iron out remaining issues
585and release a 0.129 sometime around the 1st of the year. Please keep
586reporting bugs to MAMETesters as you find things.
587
588
589
430590MAMETesters Bugs Fixed
431591----------------------
432- 02323: [DIP/Input] geebeeb: Unable to coin - Always coin lockout
433         (stephh)
434- 01090: [Crash/Freeze] invadpt2, sicv: Watchdog reset. (couriersud)
435- 02440: [Crash/Freeze] abcop, gprider1, rachero: abcop just shows a
436         black flickering screen, rachero gives an error and crashes
437         on exit (couriersud)
438- 02442: [Core] -aviwrite produces faulty files (Aaron Giles)
439- 02441: [Crash/Freeze] rdft22kc: rdft22kc just shows a black screen
440         and fails to boot (couriersud)
441- 02194: [Misc.] All Sets in othunder.c: Black screen, game does not
442         start (couriersud)
443- 02410: [Misc.] -aviwrite: files over 2 gigs sometimes get cut off
592- 02745: [Crash/Freeze] all sets using autosave: Games using autosave
593         segfault on startup (Aaron Giles)
594- 02750: [Sound] All Sets in equites.c: no background music
444595         (Aaron Giles)
445- 02024: [Color/Palette] pbobble3, pbobble4, ringrage and clones:
446         Color Regression (Nicola Salmoria)
596- 02757: [Documentation] sengoku3: manufacturer should be "Noise
597         Factory / SNK" (Phil Bennett)
598- 02753: [Crash/Freeze] gradius4: hardware error -1 (Aaron Giles)
599- 02755: [Crash/Freeze] All Sets in metro.c: Crash with access
600         violation. (Aaron Giles)
601- 02756: [Crash/Freeze] hyprduel, hyprdelj: Colors on the title screen
602         wrong, games crash mame with ACCESS VIOLATION (Mamesick)
447603
448604
449605
450606Source Changes
451607--------------
452NeoGeo Update:  [Johnboy]
453 * Updated Neo-Geo game pcb infos
454 * 2020bba: Marked MVS and AES version
455 * sonicwi2: Added correct sized v2
456 * kof95 / kof95a:
457   . Renamed kof95 to kof95h
458   . Renamed p1 to correct chip label
459   . Added note
460   . Renamed kof95a to kof95
461   . Renamed p1
462 * samsho3 / samsho3a:
463   . Renamed samsho3a to samsho3
464   . Renamed samsho3 to samsho3h
465   . Renamed p1 to correct chip label
466   . Marked AES version
467 * kof98 / kof98n:
468   . Renamed m1 in kof98 to correct chip label
469   . Renamed m1 in kof98n to correct chip label
470     (kof98n should be latest revision, cart had very high SN
471      1xx.xxx)
472 * kof97: Marked MVS version
473 * samsho5 / samsho5h:
474   . Correct text layer size
475   . Marked samsho5h AES version
476 * neogeo:
477   . Updated system set to what is found on NEO-MVH MV1FS
478   . Added note
479 * ms5pcb:
480   . Hooked up bios dip
481   . Renamed bios to correct chip label
482   . Renamed p1 / p2 to correct chip label, marked NO_DUMP
483   . Added note
608Removed old cherrym driver (meant to be removed last time, oops).
609[Aaron Giles]
484610
485Added pen_mask tile attribute to the tilemap system. Implemented
486dynamic tile & sprite bit depth in the Taito F3 driver.
487[Nicola Salmoria]
611Funworld.c improvements [Roberto Fresca]
612 - Added new set: Jolly Card (italian, encrypted bootleg).
613   No coins... Only remote credits. After nvram init, set the Payout
614   DIP to 'manual' to allow the remote credits mode to work.
615 - Created inputs from the scratch for jolycdib.
616 - Updated technical notes.
488617
489Changed MAKE_RGB macro to set the alpha to 255 instead of 0. Updated
490palette.c to preserve the alpha when transforming palette values.
491These changes should be transparent to almost all drivers and
492rendering (ha-ha), but there may be an occasional instance where a
493driver relied on the alpha being 0 in the system palette. This also
494means that the palette_set_color() function preserves any alpha value
495that is set. [Aaron Giles]
618Made CPUs into proper devices. CPUs are now added in the machine
619configuration just as any other device, and the standard CPU
620configuration is performed via the inline configuration macros.
621[Aaron Giles]
496622
497Changed Firefox to RGB32 to allow for mid-screen palette changes.
498Because of the above change, the hacky alpha manipulation that was
499previously required is no longer necessary; the alpha is set directly
500in the palette entry. [Aaron Giles]
623Changed cpu_type from an enumeration into a pointer to the CPU's
624get_info function, very similar to device behavior. Updated all
625drivers to #include the necessary header files for the CPU's they
626reference. [Aaron Giles, Atari Ace]
501627
502Removed render_container_set_palette_alpha() hack. Now the alpha value
503can be set directly in the palette entry and will be respected for
504laserdisc overlays. [Aaron Giles]
628Added function cpu_get_type() to return the CPU type. [Aaron Giles]
505629
506Minor NSS/SNES cleanups [Fabio Priuli]
630Changed several cpu_* functions over to the device_* equivalents,
631specifically for get/set info and for reset. [Aaron Giles]
507632
508Updated warpwarp.c driver: [stephh]
509 - reworked 'geebee', 'navarone' and 'warpwarp' INPUT_PORTS
510   definitions by using conditional Dip Switches.
511 - added 'geebeeb' INPUT_PORTS definition (this game has specific
512   "Replay" settings).
633The device system now maintains a parallel list of devices based on
634type and class, for faster iteration through all devices of a given
635type or class. [Aaron Giles]
513636
514Removed unneeded keys: [stephh]
515  - UI_ON_SCREEN_DISPLAY (there is now a "Slider Controls" menu)
516  - UI_ADD_CHEAT, UI_DELETE_CHEAT, UI_SAVE_CHEAT, UI_WATCH_VALUE,
517    UI_EDIT_CHEAT, UI_RELOAD_CHEAT (these keys belonged to the old
518    cheat engine)
637Cleaned up code that looped over CPUs via the machine->cpu array to
638now loop using the type-based device list. [Aaron Giles]
519639
520Converted the z80pio implementation into a device. [Wilbert Pol]
640Removed start/stop/reset/nvram functions from the device_config in
641favor of grabbing them as needed. [Aaron Giles]
521642
522Verified watchdog behaviour in schematics for 8080bw.c. [couriersud]
643Cleaned up the generic interrupt_enable code to work with CPU devices
644instead of numbers. [Aaron Giles]
523645
524ldverify improvements: [Aaron Giles]
525 - uses back-end decoding for CHDs directly to bitmaps
526 - changed min/max detection to only check 0/255
527 - fixed off-by-one bug in min/max computation
528 - separated white code detection from frame number detection
529 - track cadence with frame numbers as well as white codes
530 - use vbiparse.h constants where appropriate
646Mapped the devtag_* functions to device_* functions via macros instead
647of parallel implementations. [Aaron Giles]
531648
532Plumbed machine parameters through the renderer. Removed need for
533deprecat.h. [Aaron Giles]
649Removed cpuintrf_init() which is no longer necessary. [Aaron Giles]
534650
535Changed render_texture_set_bitmap() to accept a palette object
536instead of a palette index. The renderer remains optimized for the
537system palette but will work if objects have their own palette as
538well. [Aaron Giles]
651Changed a number of APIs in the system to accept running_machine,
652address_space, or device_config types, in order to remove the use of
653the global Machine variable. Removed the global Machine variable now
654that it is no longer directly references. [Atari Ace, Aaron Giles]
539655
540Changed renderer to permit palettes for RGB and YUY textures. If
541specified, these palettes specify a 32-entry (RGB15) or 256-entry
542(others) lookup for applying additional brightness/contrast/gamma
543on a per-texture basis. [Aaron Giles]
656Added the concept of device "owner", for devices owned by other
657devices. [Aaron Giles]
544658
545Removed rescale notification. It never really worked that well and
546violated proper layering. [Aaron Giles]
659Modified laserdisc players to walk back to their global device state
660via the owner, rather than brute-force searching for the first
661instance and hoping that is the right one. [Aaron Giles]
547662
548Renamed palette_set_brightness() to palette_set_pen_contrast() for
549clarity. [Aaron Giles]
663Finalizer update [poUzVdb90]
664 - converted to tilemap
665 - added flipscreen
666 - changed sound chip name from SN76496 to SN76489A
550667
551Changed palette objects to support global brightness/contrast/gamma
552in addition to per-group and per-entry controls. [Aaron Giles]
668Made the concept of a "clock" native to devices. The clock is now
669specified when the device is added, and the clock is available in
670the device_config directly via device->clock. Updated all devices
671that have a clock to specify it when adding the device, rather than
672as part of their configuration. As part of this work, also created
673device-specific _ADD and _REMOVE macros to simplify configuration.
674[Aaron Giles]
553675
554Simplified core deinterlacing logic based on availability of pre-
555decoded VBI data. Added plumbing for allowing for overall brightness/
556contrast/gamma corrections on laserdisc video. Fixed bug when
557combining brightness values in the palette logic. [Aaron Giles]
676Defined a generic device execute function callback, though it
677is not used yet. The long term plan is that any device with an
678execute callback will be scheduled along with the CPUs. Now that
679CPUs are devices, their scheduling will be moved over to this
680logic eventually. [Aaron Giles]
558681
559Converted Z80 CTC to a proper device. Updated all drivers. Added new
560item to the interface which is the tag of a CPU to take the base clock
561from. [Aaron Giles]
682Changed various NVRAM devices to fetch their default memory region
683from the device->region rather than specifying it in the
684configuration. [Aaron Giles]
562685
563Changed Z80 daisy chain interface to simply be a list of devices in
564the chain. Interrupt callback functions are now fetched via the
565standard device interface and referenced by the daisy chain code.
686Moved device startup to *before* the DRIVER_INIT is called. This
687is to allow the DRIVER_INIT to configure devices that have been
688properly allocated. So far I don't see any negative effects, but
689be on the lookout if something weird shows up. [Aaron Giles]
690
691Rewrote the device iteration logic to make use of the typenext
692field and the newly-introduced classnext field for iterating more
693efficiently through devices of a given type or class. [Aaron Giles]
694
695Modified the parameters of the stream_update_func callback. As part of
696this work, macro-ized all the callbacks to STREAM_UPDATE, and added
697the sound device as a parameter. [Atari Ace]
698
699Cleaned up i86/i286/i386/nec/v30mz headers: [Aaron Giles]
700 * renamed i86.h -> i86priv.h
701 * renamed i86intrf.h -> i86.h
702 * consolidated i88intrf.h, i186intf.h, i188intf.h, etc into i86.h
703
704Cleaned up many other CPU headers to move memory read/write macros
705out of them, since they are inappropriate and should be prive to the
706CPU core. [Aaron Giles]
707
708Removed index and clock parameters from CPU_INIT function.
566709[Aaron Giles]
567710
568Changed Z80 PIO interrupt callback to pass a device instead of the
569machine. All device callbacks should provide the device. [Aaron Giles]
711Some PIC8259 updates: [Wilbert Pol]
712 - Fixed operation of edge-triggered interrupts
713 - INT output line is now cleared when an IRQ is acknowledged
714 - Implemented basic OCW3 features
570715
571merit.c: [couriersud]
572 * Implemented palette & colour decoding from crt 200 schematics.
573 * Hooked up 6845
574 * Hooked up lscnblk line
575 * Fixed Phraze Craze gfx rom ordering
576 * Clocks from schematics
577 * Ram palette moved to static var. This should not be in RAM.
578 * Added save state support
716Fixed proms in boobhack. [robiza]
579717
580expro02.c: [DITraI4D0]
581 - fixed DIPSW
582 - added graphics decode routine (probably it can be simpler)
718Decoded some graphics and setup some RAM in the Virtual Combat driver.
719[Andrew Gardner]
583720
584video/kaneko16.c [DITraI4D0]
585 - tilemap scroll position is different for expro02, so added new
586   function (is it better to fix current one?)
721Cleaned up device and sound interfaces to match the CPU interfaces
722when handling strings. Namely, the generic get_info functions
723allocate a temporary string and the device in question copies its
724string to the target, instead of assigning a const char *. Updated
725all device and sound cores to operate this way. [Aaron Giles]
587726
588Converted Z80 SIO to device. Updated drivers accordingly.
727Added the concept of a cpu_state_table, which is supplied by the CPU
728cores and which describes all the register state accessible to the
729debugger and other subsystems. The format of the table is such that
730most data can be simply fetched from memory without the further
731involvement of the CPU core, including the display of common formats.
732Extensibility points are available for custom display and for
733importing/exporting the data to intermediate variables for more
734complicated scenarios. Updated the ADSP21xx, TMS340x0, i86, Z80, Z180,
735and 8085 cores to use this. [Aaron Giles]
736
737Removed the old debugger register list, which was never used. Replaced
738it with using ordering from the cpu_state_table. [Aaron Giles]
739
740Renamed REG_PC -> REG_GENPC, REG_SP -> REG_GENSP, and
741REG_PREVIOUSPC -> REG_GENPCBASE. Updated a few spots that were using
742these directly. Moved these definitions into the end of the register
743area rather than leaving them outside which put them in a weird range.
589744[Aaron Giles]
590745
591Added additional Motorola DSP56k reset behavior. [Andrew Gardner]
746More cleanup. Added address-space-specific constants for the various
747bus width and shift CPU interface constants. Changed all the cores
748to use them. [Aaron Giles]
592749
593Added mechanism to generically specify input port tags in place of
594machine/device handlers. Unfortunately, the implementation relies on
595sentinel values to distinguish a port tag versus a pointer to function
596code. However, since this is a very common situation, it will
597hopefully be worth the slight grossness. New macros are defined in
598inptport.h:
750Changed ADSP21xx cores to accept a configuration struct instead of
751using set_info to specify serial port callbacks. Simplified the
752ADSP21xx get/set info significantly. Removed support for only
753including certain variants of the chips; they are now either all
754supported or all unsupported. [Aaron Giles]
599755
600   DEVICE8_PORT(name) - use this to specify the name of a port to read
601     wherever a read8_device_func would normally be used
756Memory view fixes: [Aaron Giles]
757 * Fixed bug that computed the wrong total size if the address
758   space was a full 32 bits
759 * Improved display to show unmapped memory with *s
760 * Disabled enumeration of disk and 0-length regions
602761
603   MACHINE8_PORT(name) - same as DEVICE8_PORT except it can be used
604     wherever a read8_machine_func would normally be used
762Added PAL to arkgcbl. [robiza]
605763
606   IS_HANDLER_PORT(ptr) - accepts a read8_device_func or
607     read8_machine_func and determines if it is an actual function or
608     a reference to a port; intended for use by devices that accept
609     DEVICE8_PORT-style functions
764Added Country Girl to the Jangou driver,working with sound
765[David Haywood, Angelo Salese]
766 - Fixed transparency pens in the Jangou driver (so removed the
767    GAME_IMPERFECT_GRAPHICS flag); [Angelo Salese]
768 - Added a kludge for Jangou Lady RNG,will be worked on in the future;
769    [Angelo Salese]
610770
611   CALL_DEVICE8_READ(ptr,device,offset) - either calls through the
612     given read8_device_func, or calls input_port_read with the
613     appropriate tag, depending on the result of IS_HANDLER_PORT;
614     intended for use by devices that accept DEVICE8_PORT-style
615     functions
771Added running_machine callbacks for the Amiga code. [Nathan Woods]
616772
617   CALL_MACHINE8_READ(ptr,machine,offset) - same as CALL_DEVICE8_READ
618     except for read8_machine_func
773Updated sscope2 to use newly-dumped roms. [robiza]
619774
620Note that in order for these to be useful, the consumer of the
621function pointer must be enhanced to use the CALL_* macros above
622instead of directly calling through the function. So far, only the
6238255 PPI is set up to do this, as part of the cleanup below. Also
624note that the sentinel value is currently 4 consecutive 0 bytes; this
625may need to change in the future, in either length or value, so it is
626important to stick to the macros above. [Aaron Giles]
775Added running_machine parameters to the f3853 callbacks. [Wilbert Pol]
627776
6288255 PPI interface cleanup: [Aaron Giles]
629 - added MDRV_PPI8255_ADD, MDRV_PPI8255_RECONFIG and
630    MDRV_PPI8255_REMOVE macros; updated all drivers to use them
631 - changed callbacks to device read/write handlers intead of
632    machine read/write handlers; updated all drivers accordingly
633 - normalized function and variable names to be lower_under
634 - removed a number of redundant interfaces from the galaxian/
635    scamble line of games
777Added running_machine parameter to the callback in the sid interface.
778[Wilbert Pol]
636779
637LD-V1000: added some (compile-time removed) information about the
638ROM and memory map [Aaron Giles]
780Removed MDRV_INTERLEAVE(x), which specified the minimum scheduling
781quantum in terms of "frames" (a dubious concept now with multiple
782screens and changing refresh rates). Replaced it with a new
783MDRV_QUANTUM_TIME(x) which specifies the minimum scheduling quantum
784as a time value. Time can be specified as HZ(x), NSEC(x), USEC(x),
785etc. Updated all drivers to use this, assuming 60 was the frame
786rate (this is not perfect but should work for almost all cases).
787[Aaron Giles]
639788
640Changed 68000 interrupts to only trigger during execution. This
641means that multiple changes without any execution will be seen as
642atomic. It also means that PULSE_LINE no longer works for signalling
643IRQs. [Aaron Giles]
789Changed MDRV_WATCHDOG_INIT_TIME(x) to automatically prepend
790UINT64_ATTOTIME_IN_ to the parameter, ensuring there is no improper
791use of this macro and bringing it in line with the MDRV_QUANTUM_TIME()
792macro. Updated all callers. [Aaron Giles]
644793
645Added checks in the debug build to catch people who try to use
646PULSE_LINE for non-NMI and non-RESET input lines on CPUs that no
647longer support direct interrupt generation. Over time expect this
648list to increase. [Aaron Giles]
794Added new MDRV_QUANTUM_PERFECT_CPU(x) to specify that the minimum
795quantum should be enough to ensure that the specified CPU tag only
796ever executes a single instruction at a time. This can be used to
797explicitly require "perfect" synchronization for drivers that have
798multiple CPUs with shared memory. Turned this on for the arknoid2
799driver for now as a test (the interleave on that driver was already
800very close to perfect anyway). [Aaron Giles]
649801
650Fixed edge case bug in the Cube Quest line CPU involving adding with
651carry. [Matt Ownby]
802Fixed some color issues in the goldstar.c driver [David Haywood]
652803
653Fixed sbasketb DIP switch reading. [Fabio Priuli]
804Merged goldstar and lucky8 drivers. [David Haywood]
654805
655Continued work on System1 inputs: [Sonikos]
656 - Added dips location in all game
657 - Moved in generic Cabinet dip for eliminate the redundancy
658 - Better implementation of generic input
806Improvements to ddragon3/shadfrce/wwfsstar/wwfwfest: [Mamesick]
807 - converted driver to be fully scanlines based using timers
808 - updated driver to new video screen raw parameters
809 - hooked up interrupts (ddragon3, wwfwfest)
659810
660Changed the NSS/SNES loading code to support more cart/memory layouts
661and generally be more in line with the MESS way of handling SNES
662cartridges. [Fabio Priuli]
811Fixed Agress' title screen. [David VanVoorhis]
663812
813Fixed update_handler for the dsp56k and polygonet. [Andrew Gardner]
664814
815Improvements to the dmndrby.c driver. [Mike Green]
665816
817Continued rewrite of the Motorola DSP56k CPU core. [Andrew Gardner]
818 * Fixed flag calculation and sign extension for numerous ops.
819 * Added rnd, mpysuuu, and dmac ops.
820 * Fixed do loop behavior to skip empty loops.
821 * Added stack underflow exception handling.
822
823Improvements to the skylncr.c driver: [Roberto Fresca, David Haywood]
824 - Complete reel support from the scratch.
825 - Full inputs, outputs & DIP switches from the scratch.
826 - Added new games.
827 - Updated technical and game notes.
828
829Rewrote 8080/8085 interrupt handling so that it makes sense. Changed
830callbacks to be specified in a config structure. Converted core to
831cpu_state_table. Changed to a single HAS_808X define for both cores.
832Fixed several drivers that used 8080/8085 interrupts in odd ways.
833[Aaron Giles]
834
835Converted warpwarp driver to raw video parameters. [Aaron Giles]
836
837Fixe 'run to cursor' and 'toggle breakpoint' operations in the
838debugger when dealing with CPUs that have shifted address spaces.
839[Andrew Gardner]
840
841Improvements to goldstar.c driver. [Roberto Fresca]
842 - Hooked the 3x PPI 8255 devices to chryigld and ncb3.
843 - Reworked the chryigld and ncb3 inputs based on PPI 8255 connections.
844 - Added the unmapped PSG sound to chryigld and ncb3.
845 - Some works on their machine driver.
846 - Some cleanups.
847
848
849
666850New games added or promoted from NOT_WORKING status
667851---------------------------------------------------
668Gals Panic (US, EXPRO-02 PCB)
669Pit Boss [Couriersud]
852Country Girl [David Haywood, Angelo Salese]
8534nin-uchi Mahjong Jantotsu [David Haywood, Angelo Salese]
854Three Ds - Three Dealers Casino House [David Haywood, Angelo Salese]
855Sky Lancer (Bordun, ver.U450C) [Roberto Fresca, David Haywood]
856Butterfly Video Game (ver.U350C) [Roberto Fresca, David Haywood]
857Mad Zoo (ver.U450C) [Roberto Fresca, David Haywood]
858Casino Winner [Chris Hardy, Angelo Salese]
859Cherry I Gold (bootleg of Golden Star) [Roberto Fresca]
670860
671861
672862
673863New clones added
674864----------------
67520 Year Reunion (V1.04) [Johan Samuelsson]
676Capcom Sports Club (EURO 971017) [Corrado Tomaselli]
865Jolly Card (italian, encrypted bootleg) [Roberto Fresca]
866Double Dragon 3 - The Rosetta Stone (prototype) [Guru]
677867
678868
679869
6800.127u5
870New games marked as GAME_NOT_WORKING
871------------------------------------
872Grand Prix 98 [David Haywood]
873Leader [Roberto Fresca, David Haywood]
874Parent Jack [David Haywood]
875Janshi [David Haywood]
876Cherry Master I (v1.01) [Roberto Fresca, David Haywood]
877
878
879
8800.128u6
681881-------
682882
683883
684884MAMETesters Bugs Fixed
685885----------------------
686- 01187: [Graphics] gseeker: In attract mode, there is a priority
687         error where a stealth bomber is coming out of a hanger.
688         (couriersud)
689- 02381: [DIP/Input] peke1012: Lightpen not mapped in option
690         (Fabio Priuli)
691- 02191: [Sound] wseries, basebal2, dblplay, strkzone: Speech quality
692         regression (couriersud)
693- 02322: [Core] All Drivers using 8080 CPU: 8080 Core problem with
694         score/credit counts and other variables (Miodrag Milanovic)
695- 02254: [DIP/Input] All Sets in namcond1.c: Unable to coin/start
696         game properly (Fabio Priuli)
697- 02156: [Color/Palette] naughtyb: Wrong RESNET calculation of the
698         green component. (couriersud)
699- 02280: [Misc.] any set with multiple CPUs: Disassembler freezes when
700         doing a Run on any CPU other than CPU 0 (Aaron Giles)
701- 02259: [Misc.] tinklpit: Debug messages displayed on exit
702         (Phil Bennett)
703- 02258: [Crash/Freeze] srmp6: Game displays black screen, plays two
704         NiLe samples every three seconds over and over again
705         (Fabio Priuli)
886- 02728: [Crash/Freeze] galpani3: 'Illegal Instruction' after ROM Check
887         (R. Belmont)
888- 02739: [Sound] skysoldr: In-game music (three level BGMs and boss theme)
889         plays one octave higher. (Phil Bennett)
890- 02718: [Crash/Freeze] zigzag, zigzag2: Don't boot correctly. The screen
891         just flashes over and over. (Aaron Giles)
892- 02730: [Crash/Freeze] fiveside: locks up at rom check (Aaron Giles)
893- 02740: [Debugger] resizing the debug window, the text is only in the
894         old area (Aaron Giles)
895- 02721: [Crash/Freeze] All Sets in arcadia.c: Games not booting, they
896         just keep resetting to a white screen. (Aaron Giles)
897- 02661: [Gameplay] f1gpstr2: Game freezes upon reaching track (Mamesick)
898- 02708: [Crash/Freeze] wildplt: Gameplay freezes at start (Mamesick)
899- 02724: [DIP/Input] elgrande, jjpoker, ssipkr24: Unable to locate input
900         port 'SW2'. (Roberto Fresca)
901- 02677: [Graphics] eprom, eprom2: missing graphical brightness effect,
902         verified on real machine w/video (Nicola Salmoria)
706903
707904
708905
709906Source Changes
710907--------------
711Added newest Naomi 2 BIOS. [Brian Troha]
908Pointer-ified the following CPU cores:
909 - DSP32 [Aaron Giles]
910 - m6805 [Andrew Gardner]
911 - MIPS 3 [Aaron Giles]
912 - PowerPC [Aaron Giles]
913 - Konami [Aaron Giles]
914 - ARM [Andrew Gardner]
915 - SHARC [Atari Ace]
916 - V60 [Aaron Giles]
917 - Z8000 [Aaron Giles]
918 - Z180 [Aaron Giles]
919 - V810 [Aaron Giles]
920 - V30MZ [Aaron Giles]
921 - PDP1/TX0 [Wilbert Pol]
922 - H6280 [Andrew Gardner]
923 - F8 [Atari Ace]
924 - TLCS-90 [Atari Ace]
925 - Cube Quest CPUs [Aaron Giles]
926 - i86/i286 [Aaron Giles]
927 - i386 [Aaron Giles]
928 - ALPHA-8201 [Aaron Giles]
929 - i8085 [Aaron Giles]
930 - APEXC [Aaron Giles]
931 - RSP [Aaron Giles]
932 - MB88 [Aaron Giles]
933 - MB86233 [Aaron Giles]
934 - TMS7000 [Aaron Giles]
935 - SH2 [Aaron Giles]
936 - SH4 [Aaron Giles]
937 - uPD7810 [Aaron Giles]
938 - TMS32051 [Aaron Giles]
939 - MC68HC11 [Aaron Giles]
940 - CP1610 [Aaron Giles]
941 - LH5801 [Aaron Giles]
942 - LR35902 [Aaron Giles]
943 - PDP1 [Aaron Giles]
944 - Saturn [Aaron Giles]
945 - SC61860 [Aaron Giles]
946 - TMS32010 [Quench]
947 - PIC16C5x [Quench]
948 - TMS99xx [Aaron Giles]
949 - TMS32025 [Quench]
950 - dsp56k [Quench]
712951
713Correct NeoGeo M1 decryption for all CMC50 sets [Andreas Naive]
952Enabled all CPU cores/variants. Fixed compile issue revealed as a
953result. [Aaron Giles]
714954
715Rewrite of the Motorola DSP56k disassembler. [Andrew Gardner]
716 * Removes arbitrary opcode groupings in favor of flat decode model.
717 * Fixes a number of small issues with unknown opcodes.
718 * Added the final ALU parallel move ops.
719 * Fixes branch relative offset decoding.
955Changed konami setlines callback to pass a device. Updated all drivers
956accordingly. [Aaron Giles, Atari Ace]
720957
721NB1/NB2: fix default dips, added diplocations, used latest idioms. 
722IMPORTANT: you must delete all cfg and nv files for these games!
723[R. Belmont]
958Added best-known CRC in wb90b2 and jjsquawb "bad dump" roms. [robiza]
724959
725Removed sprite to tile priority in firefox, it doesn't exist. [smf]
960Made the PCI bus a device. The bus is declared in the machine config,
961and the devices attached to it are enumerated there. Eventually, the
962PCI config read/write functions should be moved to well-known
963functions within the device, but for now they are kept separate.
964[Aaron Giles]
726965
727System 23 updates: [R. Belmont]
728 * Fixed text layer to show (colors are wrong)
729 * Added very preliminary support for Gorgon h/w
730 * Added Rapid River readme
731 * Adjusted Gorgon h/w MIPS clock to 133 MHz based on readme
732 * Renamed GP500 to 500GP, which is it's correct name
733 * Fixed sound CPU shared RAM. Comms not yet correct.
966Added correct proms for arkgcbl. [robiza]
734967
73565816/377xx: fix disassembly of BRL [ShimaPong]
968Changed many, many global Machine references to use machine,
969device->machine, etc. instead. [Atari Ace]
736970
737Fixed AF calculation in mcs48. [Aaron Giles]
971Changed megadriv.c to pass running_machine to I/O callbacks plus other
972MESS support. [R. Belmont]
738973
739Fixed Leland ay8910/12 output combining. [couriersud]
974Re-synced f3853 core with MESS. [Nathan Woods]
740975
741rescale_notifier() changed to always allow rescaling for screenless
742drivers. [Wilbert Pol]
976Introduced function macros for SAMPLES_START, CUSTOM_{START,STOP,RESET},
977and ANTIC_RENDERER. Pushed the running_machine * passing through these
978functions. In other locations added "running_machine *machine = Machine"
979to the top of functions to isolate the dependencies. [Atari Ace]
743980
744Added 22VP931 emulation, which is mostly working. Communication works
745fine and basic searching/playback/skipping is functional. Still a bit
746glitchy. [Aaron Giles]
981Added logic to track OSD debugger updates separately from internal
982view updates. In order to get the OSD to update, a new function
983debug_view_flush_updates() must be called. Currently this is
984automatically called before osd_wait_for_debugger(), and during the
985periodic updates while executing. The OSD code may occasionally need
986to call it under other circumstances (for example, the Windows code
987calls it explicitly while tracking scrollbar thumbs to get live
988scrolling). [Aaron Giles]
747989
748Firefox improvements: [Aaron Giles]
749 - memory map is complete from schematics
750 - gutted laserdisc hacks in favor of actual laserdisc implementation
751 - fixed all CPU and sound clocks
752 - removed need for deprecat.h
990Updated gradius2 to use proper gfx2 roms (same values of vulcan but
991byteswapped). [robiza]
753992
754Added generic timer devices, which simply allocate a timer but don't
755prime it. This is the preferred method for allocating timers, and may
756eventually be the only mechanism for doing so in the future.
993Disabled the use of PULSE_LINE for any input lines except NMI and
994RESET. Added a helper function generic_pulse_irq_line() for doing a
995single-cycle assert/deassert for those few drivers remaining that were
996trying to use PULSE_LINE directly. [Aaron Giles]
997
998Updated z8000 tables to reflect recent findings. [Juergen Buchmueller]
999
1000Fixed the widely used konamiic/taitoic/deco16ic/segaic16 video cores
1001to no longer reference the global Machine. [Atari Ace]
1002
1003Added wrappers for ADSP21xx callbacks. Added device parameters to them.
1004Updated IRQ setters to use generic_pulse_irq_line(). [Aaron Giles]
1005
1006Added MDRV_PIC8259_ADD, MDRV_PIT8353_ADD, MDRV_PIT8254_ADD, and
1007MDRV_DMA8237_ADD macros. [Wilbert Pol]
1008
1009Added the sound device to the parameters passed to stream_create so
1010that the global Machine can be removed from streams.c. [Atari Ace]
1011
1012Improvements to Millennium 4000 driver: [Roberto Fresca]
1013 - Completed normal Inputs/Outputs.
1014 - Added button-lamps calculation.
1015 - Created button-lamps layout.
1016 - Documented the PCB RAM.
1017 - Fixed NVRAM size based on PCB picture (2x CY62256L-70PC near the
1018    battery).
1019 - Added notes about the method to make appear the real poker cards.
1020 - Fixed the OKI 6295 frequency (1000 kHz resonator near). Now the
1021    game has more decent sounds.
1022 - Corrected CPU clock to 12 MHz. (main Xtal).
1023
1024Updated adp driver: now fashiong show something. [robiza]
1025
1026Widened some machine init interfaces to pass the machine parameter,
1027allowing more Machine global references to be eliminated. Eventually
1028most of these need to be converted to devices, but this change reduces
1029the deprecation surface in the meantime. [Atari Ace]
1030
1031Relaxed the OKI 6295 command validity check. [Nicola Salmoria]
1032
1033Added new function cpuexec_describe_context(machine) which can be
1034used in logerror() and other printf-style functions to return a
1035description of the current CPU/PC given only the machine. Changed
1036several dozen sites to use this instead of directly interrogating
1037the activecpu. [Aaron Giles]
1038
1039Removed all other uses of activecpu throughout the system. Removed
1040activecpu from the machine structure to prevent future abuse.
7571041[Aaron Giles]
7581042
759Fixed copy + paste error in geebeeg romset. [David Haywood]
1043Removed cpu_push_context() and cpu_pop_context(), and all call
1044sites. [Aaron Giles]
7601045
761Move dkong memory_region calls into initialization routines.
762[couriersud]
1046Voodoo devices now require a CPU to be defined in the configuration
1047in order to know whom to steal cycles from or stall when FIFOs get
1048full. Updated all voodoo users to specify one. [Aaron Giles]
7631049
764Fixed -listroms to know about device-specific ROMs. [Aaron Giles]
1050CPD1869 devices now also require a CPU to be defined in the
1051configuration, in order to know which CPU's registers to fetch.
1052Updated all cdp1869 users to specify one. [Aaron Giles]
7651053
766Another pass to make static functions static, almost entirely
767affecting code added in the last few months to MAME.  The fixes are
768the usual lot, changing enum definitions so they aren't declared,
769decorating dead code/declarations with #if...#endif, and of course,
770adding static where appropriate.  In addition, I fixed a bunch of
771UNUSED_FUNCTON symbols to be spelled correctly (I didn't introduce
772this). [Atari Ace]
1054Removed get context/set context calls from the CPU interface entirely.
1055[Aaron Giles]
7731056
774More system1.c input cleanups. [Sonikos]
1057Removed safe_cpu_get_pc() which doesn't really make sense anymore.
1058[Aaron Giles]
7751059
776Naomi update: [Samuele Zannoli]
777 * now show the contents of the framebuffer if the 3d accelerator is
778    not used so that now the atomiswave logo and messages are shown
779    (if you wait enough).
780 * removed a maple bug (no more strange messages in cvs2gd).
781 * improveed documentation of the communication registers with the
782    dimm board
783 * if DEBUG_VERTICES is defined as 1 the vertices sent to the tile
784    accelerator are collected and then drawn connected by a segment to
785    give a wireframe-like view of the scene.
1060Moved cpu_execute() to be an inline function. [Aaron Giles]
7861061
787Minor optimization to fillbitmap when non-zero fills are done.
788[Christophe Jaillet]
1062Writes to a pit8253 timer control word always restart the timer.
1063[Wilbert Pol]
7891064
790Moved memory_region() call (which is slow) out of core sprite loop in
791the neogeo renderer, giving a dramatic speed boost.
792[Christophe Jaillet]
1065Updated the fcompress APIs to allow for specifying a compression level.
1066[Aaron Giles]
7931067
1068Removed the concept of state saving tags, which was a hack to get save
1069states to work with multiple CPU cores. Simplified the state saving
1070system as a result, performing the operation in a single pass and
1071without allocating a full blob of memory. Also enabled minimal
1072compression. [Aaron Giles]
7941073
1074Squashed another deprecated use of Machine from the mame core by
1075plumbing machine_config into rendlay.c. [Atari Ace]
7951076
1077Fix Altivec RGB primitives on newer GCCs. [budge, Vas Crabb]
1078
1079Changed commonly-used verboselog to require a machine parameter.
1080[Atari Ace]
1081
1082Removed remaining deprecat.h references from the CPU and sound cores.
1083[Atari Ace]
1084
1085i8085: added INTE and state word callbacks [Curt Coder]
1086
1087n8080.c changes: [Curt Coder]
1088 - rewrote interrupt handling according to schematics
1089 - added interrupt acknowledge
1090
1091Re-ordered SCSP init to fix crash. [R. Belmont]
1092
1093Modified regrep to display the soruce file. [Aaron Giles]
1094
1095Expanded cpuexec cycles <-> attotime functions to handle UINT64s.
1096[Aaron Giles]
1097
1098Reduced all alpha68k.c YM2413 clocks from 8MHz to 3.579545MHz.
1099[Philip Bennett]
1100
1101Changed attotime_to_ticks/ticks_to_attotime to use UINTs and the
1102eminline functions where possible. [Aaron Giles]
1103
1104Changed the 6522 VIA implementation to be a device. [Nathan Woods]
1105
1106Removed the ACIA6850 device from Cal Omega System 905 machine driver.
1107It fixes the wrong lack of SW2. [Roberto Fresca]
1108
1109Fixed EI handling in the 8080/85 core to have a shadow like the Z80.
1110[Miodrag Milanovic]
1111
1112Modified the tms34010.h, pc16552.h, and tms34061.h interfaces to
1113eliminate some more global Machine variables. Six more deprecat.h
1114includes eliminated. [Atari Ace]
1115
1116Eliminated the #include "deprecat.h" from tilemap.c. The main change
1117is to require callers of tilemap_create to provide a machine pointer.
1118This pointer is then attached to the tilemap and used when needed
1119inside tilemap.c. [Atari Ace]
1120
1121Eliminated the #include "deprecat.h" from drawgfx.h.  It does so in a
1122fashion similar to my recent tilemap patch, adding the machine pointer
1123to gfx_element, changing allocgfx to take a machine, and then
1124adjusting the internals to use the machine field as needed.
1125[Atari Ace]
1126
1127i960: fixed nor opcode and added notor opcode [robiza]
1128
1129Fixed raster effects in nbbatman by altering the V33 prefetch timing
1130(just a guess as no documentation has been found). [couriersud]
1131
1132Removed unnecessary address masking in disassembly view. Changed
1133console subview computations to leave the registers portion fixed.
1134[Aaron Giles]
1135
1136Removed hack for setting mcs51 serial callbacks. Updated micro3d to
1137use new functions. [Aaron Giles]
1138
1139Merged goldstar.c & cmaster.c drivers. Converted the Reels video to
1140tilemaps. [David Haywood]
1141
1142Added proper artwork for the LEDs in Gridiron Fight. [David Haywood]
1143
1144
1145
7961146New games added or promoted from NOT_WORKING status
7971147---------------------------------------------------
798TX-1 (Atari/Namco/Taito license) [Phil Bennett, Guru]
799Chanbara [Tomasz Slanina, David Haywood]
800Paradise Deluxe 2 [Chris Hardy]
1148Super Pool 99 [David Haywood, Angelo Salese]
1149Bra$il / Fashion [Angelo Salese]
1150Pesadelo [Mariusz Wojcieszek, hap]
1151Super Free Kick [Tomasz Slanina]
1152Jangou [David Haywood, Angelo Salese, Phil Bennett]
1153Jangou Lady [David Haywood, Angelo Salese, Phil Bennett]
8011154
8021155
8031156
1157New clones added
1158----------------
1159Europa 2002 Space (Ver 3.0) [Roberto Fresca]
1160Triv Two (Vertical) [David Haywood]
1161Super High Impact (prototype, rev 6.0 09/23/91) [Smittdogg]
1162Giga Man 2: The Power Fighters [David Haywood, Arzeno Fabrice]
1163CarnEvil (v1.0.3) [Brian Troha]
1164(New?) Cherry Bonus III (not working) [David Haywood]
1165Cherry Bonus III (not working) [David Haywood]
1166
1167
1168
8041169New games marked as GAME_NOT_WORKING
8051170------------------------------------
806Rapid River (RD3 Ver. C) [Guru, R. Belmont]
807Time Crisis 2 (TSS2 Ver. B) [Guru]
808GameCristal (version 2.613) [ANY, f205v]
1171Cherry Bonus 2001 [David Haywood, robiza]
1172Four Roses (encrypted, 2 sets) [Roberto Fresca]
1173Queen [David Haywood]
1174Cherry Master (Corsica, v8.01) [David Haywood]
1175Cherry Master 91? [David Haywood]
1176Jackie [David Haywood]
8091177
8101178
8111179
8120.127u4
11800.128u5
8131181-------
8141182
8151183
8161184MAMETesters Bugs Fixed
8171185----------------------
818- 02210: [Misc.] fieldday, undoukai: Game doesn't start. Source typo in
819         0.126u2. (MASH)
820- 02240: [Crash/Freeze] All Sets in namcos12.c: Game Freeze (Aaron Giles)
821- 02241: [Sound] kncljoe, kncljoea: Missing AY-3-8910A sound effects.
1186- 02638: [Compiling] various cpu cores don't compile anymore
8221187         (Aaron Giles)
823- 02248: [Sound] All sets in m58.c: No sound in game (Aaron Giles)
824- 02239: [Sound] stunrun: No OKI6295 sound. (Aaron Giles)
825- 02249: [Crash/Freeze] All Sets in zn.c: Game Hangs (Aaron Giles)
826- 02233: [Speed] chboxing, chwrestl, dokidoki: Game Speed/Timing issue
827         (Curt Coder)
828- 01897: [Original Reference] birdtry: DIP switch settings from manual.
829         (Tafoid)
830- 02242: [Gameplay] ikarijp, ikarijpb: Test screen now required to be
831         cycled to enter game. (Nicola Salmoria)
1188- 02709: [Documentation] nstockr2: nstockr2 not defined as clone of
1189         nstocker? (Luigi30, Edward Swiftwood)
1190- 02713: [Crash/Freeze] demndrgn, profpac: demndrgn gives a black
1191         screen only. profpac doesn't accept coins. (Aaron Giles)
1192- 01442: [Sound] wwfsstar: The OKI6295 playback frequency is too high.
1193         (Phil Bennett)
1194- 00894: [Crash/Freeze] elecyoyo: Inserted coins and pressing start
1195         sometimes leads back to the test menu. (Mamesick)
1196- 02658: [Interface] Supplement game status reports with yellow screen
1197         (Edward Swiftwood)
1198- 02689: [Multisession] jumpbug: Jumpbug won't start second time
1199         around (Atari Ace)
1200- 02673: [Crash/Freeze] All Sets with HuC6280 as Audio Device
1201         (PCE-Based titles): Fatal Error after OK (Aaron Giles)
1202- 02676: [Color/Palette] All Laserdisc Games: Wrong colors using
1203         Direct3D on ATI cards. (Aaron Giles)
1204- 02680: [Misc.] carnevil: -verifyrom fails to consider if a CHD is a
1205         BAD_DUMP (Aaron Giles)
1206- 02705: [Crash/Freeze] connect4: connect4 crashes if nvram file is
1207         present (Aaron Giles)
1208- 02702: [Sound] tturf: no audio (Aaron Giles)
1209- 02691: [Sound] Some drivers with z80/ay8910 Audio: Audio tempo has
1210         changed (Aaron Giles)
1211- 02669: [Sound] pandoras: music tempo is too fast (Aaron Giles)
1212- 02683: [Crash/Freeze] Pressing F5 while running debugger causes
1213         access violation (Aaron Giles)
1214- 02687: [Core] emuopts.c: CORE INPUT AUTOMATIC ENABLE OPTIONS
1215         (Aaron Giles)
1216- 02688: [DIP/Input] DIP switch settings are not being stored in INP
1217         files. (Aaron Giles)
1218- 02693: [Crash/Freeze] dacholer, kickboy: Freeze on the title or
1219         credit. (Mamesick)
1220- 02653: [Sound] all games on artmagic.c: OKI clipping in artmagic
1221         games (Nicola Salmoria)
1222- 02690: [Graphics] jantouki: The upper screen is totally garbled.
1223         (Mamesick)
1224- 02672: [Crash/Freeze] Most Sets using MCS48/51.C (intel 80xx family):
1225         Fatal Error when using -cheat trigger (Aaron Giles)
1226- 02670: [Core] Many sets using SH2: The SH2 timers aren't firing at
1227         the correct speed / time, causing various issues (Aaron Giles)
8321228
8331229
8341230
8351231Source Changes
8361232--------------
837Added redump of indytemc. There's sprite/playfield flipping issues,
838hence GAME_IMPERFECT_GRAPHICS. [Dazzer]
1233Fixes subtle timing calculation problems that affected SH-2 timers.
1234[Aaron Giles]
8391235
840Improvements to Funworld driver: [Roberto Fresca]
841 - Added new clone: Pool 10 (italian, set 4).
842 - Improved lamps layout for all games.
843 - Added Pool 10 pinout and DIP switches info.
1236Fixed copy/paste error on viostorm rom names. [David Haywood]
1237
1238Made non-critical UI warnings yellow instead so that they stand out.
1239[BarnacleEd]
1240
1241Added Treasure Island to the Burger Time HW. It doesn't work because
1242I highly suspect that there's an unhandled encryption scheme in it.
1243[Angelo Salese]
1244
1245Pointer-ified the CCPU and T-11 cores. [Aaron Giles]
1246
1247Removed globals from cpuexec. Also removed ATTOTIME_TO_CYCLES() and
1248ATTOTIME_IN_CYCLES(). Replaced them with functions in cpuexec:
1249cpu_clocks_to_attotime() and cpu_attotime_to_clocks(), both of which
1250take CPU devices instead of indexes. Updated all callers, many of
1251which were using the functions dubiously. [Aaron Giles]
1252
1253Added placeholders for interrupt callback and Z80 daisy chain
1254functions in Z80DMA. [Curt Coder]
1255
1256Pool items are now tracked globally, and freed in reverse order of
1257allocation. This enables proper nesting. [Aaron Giles]
1258
1259Changed timer_alloc, timer_set, timer_pulse, timer_call_after_resynch,
1260and timer_get_time to pass the machine parameter. Moved timer globals
1261to hang off of the running_machine. [Aaron Giles]
1262
1263Pointer-ified the hyperstone core, and removed all activecpu refs.
1264[Aaron Giles]
1265
1266Removed cpunum_get_active() calls and activecpu references from all
1267of the CPU cores. [Aaron Giles]
1268
1269Normalized several local CPU state variables to the generic 'cpustate'
1270instead of names_with_underscores. [Aaron Giles]
1271
1272Added macros to access ROM and MACHINE_DRIVER by name. [Curt Coder]
1273
1274Normalized CDP1802 state variables to 'cpustate'. [Curt Coder]
1275
1276Removed all references to cpunum_get_active() and removed the function
1277entirely. [Aaron Giles, Andrew Gardner]
1278
1279Updated t5182 memory mapping a bit to properly handle mirrored areas;
1280added comments about how shared ram works. [Lord Nightmare]
1281
1282Fixed reversed VBLANK-IN/OUT events in ST-V. Fixes hanagumi/groovef 2
1283credits at start-up. [Angelo Salese]
1284
1285Added ATTR_NONNULL to various declarations. [Nathan Woods]
1286
1287Pointer-ified the 65816. [R. Belmont]
1288
1289Many improvements on the irq handling of the ST-V driver:
1290    [Angelo Salese, Charles MacDonald]
1291 * Fixed a bug with irq timings;
1292 * Added ODD bit emulation;
1293 * Fixed vblank period timings;
1294 * Optimized a bit the whole interrupt routines, getting a 4x speed
1295    gain
1296 * Fixed an irq mask handling bug;
1297This fixes at least Astra SuperStars and Pebble Beach booting, but
1298the latter still fails the timer 1 irq routines...I need to check why)
1299
1300Pointer-ified the SPC700. [R. Belmont]
1301
1302Fixed stepping in the debugger. [R. Belmont]
1303
1304ARM7 updates: [R. Belmont]
1305 - Pointer-ified ARM7 core
1306 - Added disassembler and execution support for ARMv5 LDRD/STRD
1307    instructions. 39in1 now makes it until it needs the MMU.
1308
1309The jchan gamse aren't really clones even if they share most of the
1310same roms. They're very different. [David Haywood]
1311
1312Pmpoker.c major rewrite (part 2): [Roberto Fresca]
1313 - Changed the driver name to goldnpkr.c (Golden Poker is the most
1314    representative hardware).
1315 - Splitted the PIA interfases to cover witchcrd/pottenpkr connections.
1316 - Fixed the witchcrd/pottnpkr/sloco93 double up mode.
1317 - Replaced the pottenpkr layout with goldnpkr one in all Jack
1318    Potten's Poker sets.
1319 - Updated game notes for Witch Card and Super Loco 93 sets.
1320 - Fixed al inputs & lamps to allow double up mode to the above games.
1321 - Added Witch Card (Video Klein) but still not working.
1322 - Added several Buena Suerte! sets.
1323 - Added new games: Maverik, Brasil 89 & Poker'91.
1324 - Reworked the sets parent-clone relationship (still in progress).
1325
1326Cleaned up gfx decode on Sengoku Mahjong. [Angelo Salese]
1327
1328Improvements to funworld.c driver [Roberto Fresca, Andreas Naive]
1329 - Decripted saloon's program, graphics and color PROM.
1330 - Created a new memory map and machine driver for saloon.
1331 - Removed set jolycdae (it's not coming from a real board).
1332 - Renamed the sets magiccrd, magiccda and magiccdb, to magicrd2, magicd2a and magicd2b.
8441333 - Updated technical notes.
8451334
846Continued I/O map merging. [Andrew Gardner]
1335Fixed RGB565 bugs in Ghost Eolith driver. [Angelo Salese]
8471336
848Changed Namco NB-x to use real C75 BIOS, read controls the real
849hardware way. [R. Belmont]
1337Changed oki 6295 to use a reasonable volume table derived from the
1338manual. Added popmessages to notify of invalid commands so we can
1339investigate them if some game uses them. It should also be noted that
1340many games using this chip are clipping at the moment. This is
1341something that might date back to when sound mixing was upgraded to
134232-bit. It is sensible for the 6295 emulator to output at this level
1343because it ensures that bits of precision are not lost, so the mixing
1344levels in the drivers should be adjusted to avoid clipping.
1345[Nicola Salmoria]
8501346
851Added lamps support + layout to magjoker and galaxi. Magjoker has a
852good lamps sequence in the attract. [Roberto Fresca]
1347Cool Riders: added an hack for the SH-2, fixed some irqs and some
1348memory maps/ram sharing. Got to the point that area 0x03e00000 on the
1349SH-2 loads some DMA-style tables. (and this is going to be REALLY
1350nasty to do without docs...) [Angelo Salese]
8531351
854Fixed crash when hitting watchpoints on static handlers. [Aaron Giles]
1352Added layer enable register, coin counter, coin lockout and cleaned-up
1353the Sengoku Mahjong driver. [Angelo Salese]
8551354
856Changed Namco NA-2 to use real C70 BIOS. Removed sound and input
857simulation code. Changed the NA-1/2 MCU type to M37702. [Phil Bennett]
1355Big debugger cleanup: [Aaron Giles]
8581356
859Added correct colour PROMS to arkatour. [Dazzer]
1357  Important note for OSD ports: the get/set property functions have
1358  been retired for debug_views. Instead, there are specific functions
1359  to perform each get/set operation. In addition, the format of the
1360  update callback has changed to pass the osd private data in, and
1361  the update callback/osd private data must be passed in at view
1362  allocation time. And osd_wait_for_debugger() now gets a CPU object
1363  instead of the machine.
8601364
861Fixed inputs in Main Event (SNK) based on the info in
862http://otoya.sheep-cloud.net/dipsw/ma-mo/mainevent.html. [9IEM1smI0]
1365  Removed extra debugger tracking for address spaces and added some
1366  of the useful data to the address_space structure. Updated all
1367  debugger commands and views to use CPU and address space objects
1368  where appropriate.
8631369
864Jaleco 'Bomb's Away' Improvements [aDG4W+qp0]
1370  Added new memory functions for converting between bytes and
1371  addresses, and for performing translations for a given address
1372  space. Removed debugger macros that did similar things in favor
1373  of calling these functions.
8651374
866Fixed refresh rate and interrupts in sg1000a driver, added 8255PPI and
867coin counter. [Curt Coder]
1375  Rewrote most of the memory view handling. Disasm and register views
1376  still need some additional tweaking.
8681377
869Changed requirements for laserdisc CHDs to require a new chunk of
870metadata with pre-decoded frame information. Modified chdman to
871automatically produce this for CHDs that are of the appropriate
872parameters. To fix up existing CHDs, use chdman -fixavdata on the
873CHD. [Aaron Giles]
1378  Added the concept of 'subviews' to the debugger views. The core
1379  now creates a list of possible subviews, and the OSD can select
1380  between them. This removes code from the OSD that was previously
1381  required to find all possible memory and disassembly views.
8741382
875Modified the laserdisc core to leverage the pre-decoded frame
876metadata, which is now required. This improves seek times when
877searching and allows the player-specific emulation access to the
878VBI data as soon as it would really be available. Changed update
879callback timing to fire just before the first line of VBI data
880would be read; at that point, the frame selection is assumed to
881be committed. [Aaron Giles]
1383  Added machine parameters to debugger console output functions.
8821384
883Converted PR-8210 emulation over to using the actual MCU from the
884laserdisc player. This MCU controls low-level functions such as
885slider position and laser on/off, and receives decoded vertical
886blanking data in order to make decisions. Removed old HLE behavior.
887Note that the overlay text is displayed via the UI; this is
888temporary and will be fixed shortly. [Aaron Giles]
1385  Moved globals to hang off of the machine structure.
8891386
890Converted Simutrek-hacked laserdisc emulation to using the actual
891MCU from the game, which in turn hands off commands to the PR-8210
892MCU. This is still not 100% but is pretty close at this point and
893achieves the correct behaviors in most cases. [Aaron Giles]
1387  Fixed bug where the visiblecpu was not updated immediately upon
1388  a break.
8941389
895Fixed Cube Quest overlay scaling to cover the whole screen.
896[Aaron Giles]
1390Made the 6850 ACIA a device. [Nathan Woods]
8971391
898Changed laserdisc video parameters to position the screen area at
899the bottom rather than the top, since this corresponds more closely
900to standard line numbering. [Aaron Giles]
1392Re-enabled the OSD key for master volume control. All other sliders
1393are still only accessible via the menus. [Aaron Giles]
9011394
902Extended the vbiparse code to support pack/unpack, and to more
903fully document all the meanings of the VBI codes. [Aaron Giles]
1395Renamed constants: [Aaron Giles]
1396   CPU_IS_LE -> ENDIANNESS_LITTLE
1397   CPU_IS_BE -> ENDIANNESS_BIG
9041398
905Updated ldplayer to support slow/fast forward movement, frame/chapter
906display, and separate controls for scanning/stepping. [Aaron Giles]
1399To fix 02688 (DIP switch settings are not being stored in INP files),
1400old INP files had to be broken. Since they were already broken, the
1401corefile module was enhanced to support streaming compression, and
1402the new INP files are output and processed compressed. [Aaron Giles]
9071403
908Added new built-in variable "frame" to the debugger. [Aaron Giles]
1404Added a number of new cputag_* macros to cpuexec.h. [Aaron Giles]
9091405
910Fixed device-based ROM loading to support loading ROMs from the
911game's ZIP as well. [Aaron Giles]
1406Removed fillbitmap() macro in favor of direct calls to bitmap_fill().
1407Note that the parameters to the latter are in a different order
1408(bitmap, clip, color). [Atari Ace]
9121409
913CPU-internal regions now have priority again. Fixed mario by installing
914a handler in the SOUND_START function. [Aaron Giles]
1410Furthered the process of aligning the sound cores with the recent cpu
1411core changes. Added a fake device implementation similar to the one
1412the cpu cores are using. Made some interface adjustments aligned to
1413128u4 (i.e. adding snd_class_header, adding get_ to various getter
1414functions). The primary benefit of this change is the removal of
1415"deprecat.h" from 23 sound cores. Also adjusted ui.c to stop calling
1416sndnum_clock and access the clock data similarly to how it does the
1417cpu clock data. (Note from Aaron: further changes to the sound
1418interfaces will be kept to a minimum until the CPUs are sorted out.)
1419[Atari Ace]
9151420
916Improved DIP switch handling and added DIP locations in epos.c. [Tafoid]
1421Fixed 8080 interrupt handling: [Miodrag Milanovic]
1422 1. previous implementation cleared interrupt enable bit on interrupt
1423     trigger which is wrong since interrupts should stay enabled
1424 2. service interrupt number was not cleared after interrupt is
1425     executed, so if same one is triggered it will not be catched.
9171426
918Added DIP locations to the dec0 driver. [Tafoid]
1427Made the 6526/8520 CIA implementations be devices. Added
1428differentiation between the r1 and r2 versions of the 6526; not acting
1429on it yet. [Nathan Woods]
9191430
920Separate NBA Jam TE from NBA Jam as they are not technically clones of
921each other. [Atari Ace]
1431Save state system improvements: [Aaron Giles]
1432  Changed save state system to accept machine parameters where
1433  appropriate, and to keep all global variables hanging off the
1434  machine structure. Once again, this means all state registration
1435  call sites have been touched:
9221436
923Verified cpu clocks and corrected/verified OKI M6295 frequencies and pin
924for Shadow Force. [Corrado Tomaselli]
1437    - state_save_register_global* now takes a machine parameter
1438    - state_save_register_item* now takes a machine parameter
1439    - added new state_save_register_device_item* which now uses
1440       the device name and tag to generate the base name
9251441
1442Extended the fake sound devices to have more populated fields.
1443Modified sound cores to use tags from the devices and simplified
1444the start function. [Aaron Giles]
9261445
1446Renumbered CPU and sound get/set info constants to align with
1447the device constants, and shared values where they were perfectly
1448aligned. [Aaron Giles]
9271449
1450Set the type field in the fake device_configs for CPU and sound
1451chips to a get_info stub which calls through to the CPU and sound
1452specific get_info functions. This means the device_get_info()
1453functions work for CPU and sound cores, even in their fake state.
1454[Aaron Giles]
1455
1456Changed device information getters from device_info() to
1457device_get_info() to match the CPU and sound macros. [Aaron Giles]
1458
1459Removed cpunum_get_active(). Main important change is that IDE
1460controllers with bus mastering (DMA) need to specify the target
1461address space in the IDE device configuration. [Aaron Giles]
1462
1463Removed mame_find_cpu_index(). Use cputag_get_cpu() instead.
1464Updated all drivers calling this to the newer function, and
1465generally simplified their code as a result. [Aaron Giles]
1466
1467Added NVRAM emulation to Sengoku Mahjong. [Angelo Salese]
1468
1469Merged The Couples driver with Merit, fixing most of the graphics/
1470color bugs in it. [Angelo Salese]
1471
1472Removed mostly silly uses of activecpu from the CPU cores.
1473[Aaron Giles]
1474
1475
1476
9281477New games added or promoted from NOT_WORKING status
9291478---------------------------------------------------
930Fire Fox (still needs proper laserdisc support) [smf]
1479Tennis (bootleg of Pro Tennis) [Angelo Salese]
1480Maverik [Roberto Fresca]
1481Brasil 89 [Roberto Fresca]
1482Poker'91 [Roberto Fresca]
1483New Magic Card [David Haywood, Angelo Salese]
1484Millenium Nuovo 4000 [David Haywood, Angelo Salese]
9311485
9321486
9331487
9341488New clones added
9351489----------------
936Tengai (World) [Jet Black / Tormod]
937Pool 10 (italian, set 4) [Roberto Fresca]
938Hot Mind (adjustable prize) [David Haywood, Roberto Fresca]
939Marvel Vs. Capcom: Clash of Super Heroes (Euro 980123) [bonky_0013]
940Three Wonders (hack?) [EMMA team]
1490Buena Suerte (21 new sets) [Roberto Fresca]
1491Royalea [Roberto Fresca]
1492Black Tiger (bootleg alt) [mameitalia]
1493Surf Planet (Version 4.0) [Smittdogg]
1494Worldcup 90 (bootleg) [robiza]
1495J.J. Squawkers (bootleg) [robiza]
1496Loco-Motion (bootleg) [David Haywood]
9411497
9421498
9431499
9441500New games marked as GAME_NOT_WORKING
9451501------------------------------------
946Funny Land de Luxe [Tomasz Slanina]
1502Treasure Island [Angelo Salese]
1503Destiny Horoscope [Angelo Salese]
1504Galaxian 3 [Andy Welburn]
1505Witch Card (Video Klein) [Roberto Fresca, Guru]
1506Bra$il [David Haywood, Angelo Salese]
1507Fashion (Version 2.14) [David Haywood, Angelo Salese]
1508Il Pagliaccio [David Haywood, Angelo Salese]
9471509
9481510
9491511
9500.127u3
15120.128u4
9511513-------
9521514
1515IMPORTANT NOTICE: This update represents the first part of a
1516monumental internal change within MAME in the way CPU cores are
1517managed and how memory is addressed. There are two ways you can help
1518get these changes sorted out.
9531519
15201. Test the games you are familiar with, and some you are not. Report
1521bugs at http://mametesters.org/mantis for anything out of the
1522ordinary.
1523
15242. If you are up to coding, help us by submitting patches that remove
1525the use of [Mm]achine->activecpu and/or cpunum_get_active(). You
1526should be able to derive which CPU you are referencing through other
1527means. To avoid duplication of effort, either send these quickly in
1528small bunches, or better yet, send a message to the submission address
1529announcing your intention to work on a certain class of drivers.
1530
1531
1532
9541533MAMETesters Bugs Fixed
9551534----------------------
956- 00614: [DIP/Input] sspeedr: The pedal controls don't work at all,
957         in game or in the test. (Mike Green)
958- 02198: [DIP/Input] stocker: Coinage Dip Switch has incorrect
959         configuration (Mike Green)
960- 02206: [Sound] cubeqst: Cubequest now missing narrator and music
961         during attract mode. (Aaron Giles)
962- 02166: [Cheat System] garou and clones: Work RAM Error (Aaron Giles)
963- 02200: [Cheat System] galaga: Locks up (Aaron Giles)
964- 02189: [Cheat System] gradius4: C'ant pass Setup (Aaron Giles)
965- 02214: [Cheat System] rchase: Player's lorry doesn't move at all.
966         (Aaron Giles)
967- 02177: [Cheat System] All lethal.c sets: T 4 EEPROM error(BAD)
968         (Aaron Giles)
969- 02188: [Cheat System] Many sets in neodrvr.c: Freeze on start up
970         with a Work RAM Error. (Aaron Giles)
971- 02207: [Crash/Freeze] marioj, marioo: Access Violation (Aaron Giles)
972- 02204: [Crash/Freeze] masao: Memory bank error (Aaron Giles)
973- 02202: [Crash/Freeze] Many Sets in segas16a.c: Access Violation
974         (Aaron Giles)
975- 02222: [Crash/Freeze] monsterb, monster2: Monster Bash crashes on
976         launch. (Aaron Giles)
977- 02205: [Graphics] jackal, jackalj, topgunbl, topgunr: Enemy tank
978         colors are wrong (Nicola Salmoria)
979- 02201: [Compiling] 64 bit compiling error (Aaron Giles)
980- 01689: [Graphics] riskchal, gussun: Missing raster effect
981         (Pierpaolo Prazzoli)
1535- 02668: [DIP/Input] vendetta + clones: NVRAM being corrupted
1536         (Mamesick)
1537- 02656: [Crash/Freeze] elevator: Elevator Action freezes after coin
1538         insert with "8" (David Haywood)
1539- 02660: [Crash/Freeze] All sets in decocass.c: Games freeze when the
1540         count reach 15, 14 or 13. (couriersud)
1541- 02654: [Crash/Freeze] timecris, timecrsa: Unable to start game due
1542         to improper initialization (robiza)
1543- 02667: [Sound] bbmanwj: No sound since 0.123u2. (robiza)
1544- 02655: [Misc.] Some games using MC6845: A message reading "Mode
1545         Control 88 is not supported!!!" is displayed (couriersud)
1546- 02092: [Graphics] spinlbrk and clones: Priorities issues (robiza)
1547- 02641: [Graphics] strider and clones: Problem with graphics layer
1548         (Nicola Salmoria)
1549- 02196: [DIP/Input] scross: Five Player 2 buttons are mapped twice
1550         (Luigi30)
9821551
9831552
9841553
9851554Source Changes
9861555--------------
987Implemented m90 playfield 1 and playfield 2 y-offset table. This
988fixes, at least, the water effect in riskchal and the text fading
989effect in the matchit2 demo. [Pierpaolo Prazzoli, Tomasz Slanina]
1556UPI-41/42 (still I8x41.c) changes: [couriersud]
1557 * cpu/i8x41 should be renamed to UPI-4x, since UPI-41/42 was an
1558    intel chip family postponed for now until core moved to pointers.
1559 * removed I8041 definition from mcs48
1560 * removed I8x41 cpu definition and config struct
1561 * added I8041, I8741, I8042, I8242 and I8742 cpus to i8x41.c
1562 * added internal memory maps
1563 * internal ram now uses DATA memory space
1564 * updated drivers
1565 * increased interleave to 70 in decocass. This fixes decocass hanging
1566    in countdown around 13. No idea when this bug was introduced.
1567 * converted i8x41 to use pointers for state access
1568 * separated opcodes into i8x41ops.c
9901569
991Started changing naomi gdrom sets to load the CHDs. [David Haywood]
1570Populated tag and static_config parts of fake CPU device. Removed
1571'config' parameter from CPU_INIT. Modified CPU cores to pull config
1572from the device static_config. [Aaron Giles]
9921573
993Additional documentation for Egg Venture & Lethal Justice:
994[Brian Troha]
995 - Added JAMMA pinout
996 - Gun Connector pinout
997 - Sound & Amp information
1574s14001a.c: added chip pinout and operation notes. [Lord Nightmare]
9981575
999snk.c coin inputs seem to be active high (except for jcross)
1000[Nicola Salmoria]
1576Clean-ups in the ST-V driver and corrected protection number seeds
1577for elandore. [Angelo Salese]
10011578
1002Fixed bg tile banking in Canvas Croquis. Removed snkwave since it
1003doesn't seem to be used and might not be present on the pcb at all.
1004General driver cleanup, bringing it in line with snk.c but not
1005merging it since somthing doesn't quite fit. [Nicola Salmoria]
1579Video emulation fixes to the Ghost Eolith HW (not yet working).
1580[Angelo Salese]
10061581
1007Merged memory maps in munchmo.c. [Nicola Salmoria]
1582i960 core switched to pointer state access. [couriersud]
10081583
1009Changes to magic10 driver: [Roberto Fresca]
1010 - Better structure and organization.
1011 - Added Super Gran Safari.
1012 - Added improved lamps layout to Super Gran Safari and Magic's 10.
1584Major cpuintrf changes: [Aaron Giles]
1585 * added a set of cpu_* calls which accept a CPU device object;
1586    these are now the preferred means of manipulating a CPU
1587 * removed the cpunum_* calls; added an array of cpu[] to the
1588    running_machine object; converted all existing cpunum_* calls
1589    to cpu_* calls, pulling the CPU device object from the new
1590    array in the running_machine
1591 * removed the activecpu_* calls; added an activecpu member to
1592    the running_machine object; converted all existing activecpu_*
1593    calls to cpu_* calls, pulling the active CPU device object
1594    from the running_machine
1595 * changed cpuintrf_push_context() to cpu_push_context(), taking
1596    a CPU object pointer; changed cpuintrf_pop_context() to
1597    cpu_pop_context(); eventually these will go away
1598 * many other similar changes moving toward a model where all CPU
1599    references are done by the CPU object and not by index
1600 * added CPU device parameters to all CPU callbacks except for the
1601    context ones (which are going away), and the validity check.
10131602
1014Added new device interface selector: DEVINFO_PTR_ROM_REGION. This
1015allows a device to provide a set of ROM regions to be loaded along
1016with the game ROMs. It is expected that most regions defined for
1017devices will use the ROMREGION_LOADBYNAME flag to enable the ROMs to
1018live in a central location. [Aaron Giles]
1603Converted TMS340x0 cores to be pointer-based. [Aaron Giles]
10191604
1020Added new device interface selector: DEVINFO_PTR_MACHINE_CONFIG. This
1021allows a device to specify a partial machine driver which is appended
1022to the end of the machine driver for any game using that device. The
1023intention for this is to allow devices which have their own BIOS logic
1024to specify CPUs and other characteristics common to all systems using
1025the device. [Aaron Giles]
1605Fixed Dip Switches for 'lkage' and clones. Fixed bootlegs visible
1606area to match original sets. [stephh]
10261607
1027Added new ROMREGION flag: ROMREGION_LOADBYNAME, which means that if
1028the ROMs in that region are not found in the usual driver files, then
1029the name of the region will be used as a driver filename for loading.
1030[Aaron Giles]
1608Fixed Dip Switches for 'magmax'. [stephh]
10311609
1032Extended the ldcore interface structure to allow each player type to
1033provide its own ROM region and partial machine driver. [Aaron Giles]
1610Fixed Dip Switches for all games in mermaid.c driver. [stephh]
10341611
1035Moved preliminary PR-8210 emulation code from ldplayer.c to
1036ldpr8210.c. It is currently disabled behind the EMULATE_PR8210_ROM
1037compile time flag. [Aaron Giles]
1612peplus.c updates: [couriersud]
1613 * changed the 6845 type to R6545_1 (Rockwell as mentioned in the
1614    driver).
1615 * use transparent addressing
1616 * lightpen code now generates a "lightpen_assert" at the right screen
1617    position.
1618 * Completely hooked up 6545 without wrappers.
10381619
1039Added built-in "Off" states to the cheats with parameters. This is
1040also the default state, obviating the need for a default value.
1041Removed the "default" attribute as a result. Switching from "Off" to
1042another state first executes the "on" script followed by the "change"
1043script. Switching to "Off" from another state executes the "off"
1044script. While not off, the "run" script is executed each frame.
1620abc_step and abc_reset now declared as DISCRETE_STEP( abc ) and
1621DISCRETE_RESET( abc ). [couriersud]
1622
1623Fixed Dip Switches for 'momoko'. [stephh]
1624
1625Fixed Dip Switches for 'joyfulr' and clone. [stephh]
1626
1627Fix state save in discrete sound: [couriersud]
1628 * sndindex now considered as well in state save
1629 * expose discrete_sound_n_r(void *chip, ...) to enable accessing
1630    multiple discrete sound cores
1631
1632Kaneko changes: [David Haywood, Andreas Naive]
1633 * Added Simulation of Toybox external data rom decryption
1634 * Converted Blood Warrior, Bonk's Adventure, Great 1000 Miles Rally
1635    1+2 to use the new code.
1636 * Updated suprnova rendering to allow 2 sprite chips.
1637 * Started work on Jackie Chan & Gals Panic 3
1638
1639Massive API cleanup/change: [Aaron Giles]
1640
1641  The primary goal is that all CPU-related APIs now take a device
1642  pointer instead of an index. All functions that take a CPU device
1643  are prefixed with cpu_*. All functions that are globally related to
1644  cpu execution are prefixed with cpuexec_*. Below is a list of some
1645  of the mappings:
1646 
1647    cpu_boost_interleave     -> cpuexec_boost_interleave
1648    cpunum_suspend           -> cpu_suspend
1649    cpunum_resume            -> cpu_resume
1650    cpunum_is_suspended      -> cpu_is_suspended
1651    cpunum_get_clock         -> cpu_get_clock
1652    cpunum_set_clock         -> cpu_set_clock
1653    cpunum_get_clockscale    -> cpu_get_clockscale
1654    cpunum_set_clockscale    -> cpu_set_clockscale
1655    cpunum_get_localtime     -> cpu_get_local_time
1656    cpunum_gettotalcycles    -> cpu_get_total_cycles
1657    activecpu_eat_cycles     -> cpu_eat_cycles
1658    activecpu_adjust_icount  -> cpu_adjust_icount
1659    cpu_trigger              -> cpuexec_trigger
1660    cpu_triggertime          -> cpuexec_triggertime
1661    cpunum_set_input_line    -> cpu_set_input_line
1662    cpunum_set_irq_callback  -> cpu_set_irq_callback
1663 
1664  In addition, a number of functions retain the same name but now
1665  require a specific CPU parameter to be passed in:
1666 
1667    cpu_yield
1668    cpu_spin
1669    cpu_spinuntil_time
1670    cpu_spinuntil_int
1671    cpu_spinuntil_trigger
1672    cpu_triggerint
1673 
1674  Merged cpuint.c into cpuexec.c. One side-effect of this change is
1675  that driver reset callbacks are called AFTER the CPUs and devices
1676  are reset. This means that if you make changes to the CPU state and
1677  expect the reset vectors to recognize the changes in your reset
1678  routine, you will need to manually reset the CPU after making the
1679  change (since it has already been reset).
1680 
1681  Added a number of inline helper functions to cpuintrf.h for
1682  managing addresses.
1683 
1684  Removed cpu_gettotalcpu(). This information is rarely needed
1685  outside of the core and can be obtained by looking at the
1686  machine->cpu[] array.
1687 
1688  Changed CPU interrupt acknowledge callbacks to pass a CPU
1689  device instead of machine/cpunum pair.
1690
1691  Changed VBLANK and periodic timer callbacks to pass a CPU
1692  device instead of machine/cpunum pair.
1693 
1694  Renamed all information getters from cpu_* to cpu_get_* and
1695  from cputype_* to cputype_get_*.
1696
1697Defined macros for standard sound core functions and updated all sound
1698cores to use them. [Atari Ace]
1699
1700Replaced the Machine parameter where an running_machine * is
1701available and removes the deprecat.h where unnecessary.
1702[Atari Ace, Oliver Stoeneberg]
1703
1704Cleaned up use of running_machine in the Windows debugger code.
1705[Oliver Stoeneberg]
1706
1707Fixed Dip Switches and Inputs for 'jchan' and clone. [stephh]
1708
1709Documented the CPS2 Phoenix sets, and what happens to a dead CPS2
1710board. [MAMEPlus]
1711
1712Pointer-ified the 6800, 6809 and hd6309 cpu cores: [couriersud]
1713 * temporarily named the state var m68_state in the 68xx cores
1714 * reorganized some code for simpler comparison of 68xx cores
1715
1716Pre-irq rewrite submission in ST-V driver: [Angelo Salese]
1717 * Better management of hblank/vblank bits;
1718 * Makes dynamic resolutions to be called with a timer instead of
1719    run-time;
1720 * Makes dynamic resolutions to not be changed at every frame but
1721    only when there's an actual change;
1722 * Fixed Final Arch broken Test Mode;
1723 * Demoted Super Major League / Final Arch as GAME_NOT_WORKING, they
1724    hangs randomly due of SH-2 master/slave communication RAM issues
1725 * Removed GAME_NOT_WORKING flag to Fighting Dragoon Legend Elan
1726    Doree, because protection affects only in-game graphics and not
1727    gameplay
1728 * Removed all the read/write handler speed-up hacks, they aren't
1729    needed anymore and they were doing more damage than being useful.
1730This fixes Golden Axe: the Duel gameplay speed at the cost of breaking
1731up Groove on Fight coin counter at start-up.
1732
1733Major memory system change: [Aaron Giles, couriersud, smf, R. Belmont]
1734
1735  Changed READ/WRITE handlers to accept an address_space * instead of
1736  a machine *. The address_space object was enhanced to contain a
1737  machine and a pointer to the relevant CPU object.
1738 
1739  Added new function cpu_get_address_space() to fetch the address
1740  space for calling in manually to these functions. In some instances,
1741  code which should eventually be converted to a device is hard-coding
1742  fetching the program space of CPU #0 in order to have something
1743  valid to pass.
1744
1745Converted cultures driver to have separated color tables for each
1746plane. [Angelo Salese]
1747
1748Significantly pared down the 68k core. Merged outer MAME shell into
1749the core proper and removed unused macros. Changed all external
1750interfaces to pass the CPU device. Enabled 64-bit operations by
1751default. Re-derived the interface functions to cascade and share code
1752more aggressively. These changes also seem to have cured the taito_f3
1753issues as far as I can tell (at least pbobble3 seems right now).
10451754[Aaron Giles]
10461755
1047Moved reset to default behavior in the cheat menu to IPT_UI_CLEAR.
1756Disentangled the 68000 core, converting it to be much simpler and less
1757overly abstracted. Hard-coded it for the options that are relevant
1758and never going to change. Removed old unused CPS2 encryption junk.
1759Changed encryption interfaces to pass the CPU core object.
10481760[Aaron Giles]
10491761
1050Moved all naomi-gd keys to external. [David Haywood]
1762Updated CPS1 documentation. [Nicola Salmoria]
10511763
1052Cleaned up shadfrce.c input port mapping. [David Haywood]
1764Added m6809 config option to control where opcodes 10 and 11 fetch
1765the second byte. [Nicola Salmoria]
10531766
1054Merged I/O maps in a number of drivers. [Andrew Gardner]
1767Changed kram3 to use a partially understood decryption algorithm and
1768removed external tables. [Nicola Salmoria]
10551769
1056Fixed sprites in imago [Pierpaolo Prazzoli, Tomasz Slanina]
1770Fixed Dip Switches for 'scotrsht'. [stephh]
10571771
1058Added concept of rom sources to the rom loader. Updated auditing,
1059CLI utilities, validity checks, and ROM loading to use these new
1060functions so that device-specific ROMs are handled properly.
1061[Aaron Giles]
1772Naomi improvements: [Samuele Zannoli]
1773 * This patch implements a "plug-in board" device for the Naomi.
1774    It represents the rom boards for the various games and the dimm
1775    board for the gdrom.
1776 * Now the dimm board part contains only a routine to load the "rom
1777    file" from the gdrom chd, but in the future it will be fully
1778    implemented with its own sh4 processor, security chip and so on.
1779 * Extracted .rom files are no longer needed, rom file is extracted
1780    in code from the CHD.
10621781
1063Added a core_fopen_ram_copy() call, similar to core_fopen_ram()
1064except that it copies the memory. [Nathan Woods]
1782Added "tag" parameter to state_save_register_item_* calls. Removed
1783state_save_combine_module_and_tag() function in favor of passing
1784the tag when registering. Revisited all save state item registrations
1785and changed them to use the tag where appropriate. [Aaron Giles]
10651786
1066Added redumped welltris program ROMs. [Dazzer]
1787Changed 6809 disassembler to work with kram3. [Nicola Salmoria]
10671788
1068CPUs, sound chips, devices, and ROM-regions which are specified by
1069devices now have their tags auto-prefixed with the device's tag. This
1070allows for multiple instances to be present. For example, the PR-8210
1071laserdisc player has a CPU with a tag of "pr8210". When it is included
1072as a device by a driver, the driver may tag the device "laserdisc".
1073The resulting final CPU tag name will be "laserdisc:pr8210". Also
1074updated the debugger expression engine to support names with embedded
1075colons. [Aaron Giles]
1789Added template support to regrep. Changed output to not color the
1790entire background of each cell. Switched to astrings and core_files
1791internally. [Aaron Giles]
10761792
1077Added checks to ensure that tags used for CPUs, sound chips, regions,
1078and devices follow some basic rules: they should be less than 15
1079characters long, be all lower-case, and only contain letters, numbers,
1080underscores, or dots (no spaces). This is to ensure that they can be
1081used properly in debugger expressions and don't get too long or
1082unwieldy to type (even 15 chars is rather long). Fixed up all tags in
1083the system that failed these checks. [Aaron Giles]
1793ST-V IRQ rewrite and that removes several global hacks/game specific
1794hacks. (SMPC irq bit/introdon irq register hack/pblbeach framebuffer
1795hack plus some more). Note: some games have issues with it, but
1796they'll be hopefully fixed on the next couple of updates.
1797[Angelo Salese]
10841798
1085Space Win changes: [Roberto Fresca]
1086 - Some corrections to the memory map.
1087 - Added proper working RAM.
1088 - Added Dallas DS1220Y NVRAM.
1089 - Added output port.
1090 - Added lamps layout.
1091 - Added complete inputs.
1092 - Changed description to "Scacco Matto / Space Win" since the
1093    default game is Scacco Matto.
1094 - Fixed memory maps.
1095 - Documented Super Derby outputs.
1096 - Added lamps support + layout to Super Derby.
1097 - Fixed the phisical RAM size to all games.
1098 - Fixed the wrong NVRAM size to spacewin (16Kb instead of 16KB).
1099 - Added proper NVRAM to sderby and pmroulet.
1100 - Added the missing 3rd input to pmroulet (needed for 3-button mode).
1101 - Cleaned up the driver.
1102You must enter the service mode and change graphics in order to
1103switch the game.
1799Generalized the concept of opbase access into "direct" access.
1800Removed opbase globals to the address_space structure. Cleaned up
1801names of pointers (decrypted and raw versus rom and ram). Added inline
1802functions to read/write data via any address space. Added macros for
1803existing functions to point them to the new functions. Other related
1804cleanups. [Aaron Giles]
11041805
1105Changed DEVICE_START functions to return an error code. Currently
1106this is either DEVICE_START_OK or DEVICE_START_MISSING_DEPENDENCY.
1107The latter should be returned by a device if there is another device
1108it depends on which hasn't been started yet. Added new flag in the
1109device interface to indicate whether a device has been started.
1110[Aaron Giles]
1806Pointerized the CDP1802 CPU core. [Curt Coder]
11111807
1112Changed laserdisc interface to explicitly specify the screen and sound
1113devices it should route to. Drivers no longer have to manually call
1114laserdisc_vsync(). Instead, the laserdisc code connects up to the
1115routed screen device and works based on that screen's VBLANK timing.
1116Removed all existing calls to laserdisc_vsync(). [Aaron Giles]
1808Tweaked gun handling in beast busters a bit.. by halving the
1809precision of the guns to 7-bit they can be calibrated more easily,
1810maybe the originals were like this.  I've also added a default
1811eeprom with them calibrated in a 'reasonable' way for MAME.  Sound
1812is pretty awful on this, maybe the sound ROMs should be checked?
1813[David Haywood]
11171814
1118Changed laserdisc behavior so that it completes the previous video
1119read and initiates the next read at the end of VBLANK instead of the
1120beginning. This gives player logic time during VBLANK to alter the
1121slider position prior to fetching the next frame. [Aaron Giles]
1815Cleaned up macro mess in the Z80 core. Switched to using generic
1816memory calls instead of program_* and io_*. [Aaron Giles]
11221817
1123Added new laserdisc callback for vsync begin and changed the update
1124callback to be called at the end of VBLANK. Also added functions to
1125set the slider speed, advance the slider, and directly control the
1126video/audio squelch. In addition, there is a new status function to
1127get the slider position in general terms. [Aaron Giles]
1818Pointer-ified the ASAP core. [Aaron Giles]
11281819
1129Added parameter to the VBLANK callbacks supported in emu/video.c.
1130Updated all callers to provide a callback value. [Aaron Giles]
1820Pointerized the COP400 CPU cores. [Curt Coder]
11311821
1132Fixed bug that would cause watchpoints to trigger if you had a memory
1133window open to the watchpoint address. [Aaron Giles]
1822Switched mcs48, mcs51, m68000 to new memory functions. [couriersud]
11341823
1135Further updates to the PR-8210 ROM simulation. Still not quite there
1136but the system is much better understood now. Added layout to the
1137PR-8210 which displays the state of the front-panel LEDs.
1824Documented alt Ajax rom board [Phil Morris]
1825
1826Fixed basic controls in 2 Minutes Drill & added preliminary shutter/
1827defender sensors. Still need proper ball hit/run sensors to get this
1828working however. [Angelo Salese]
1829
1830Big H8 update: [R. Belmont]
1831 - Added support for 8-bit H8 family MCUs, starting with the H8/3344
1832 - Pointer-ified all H8 cores
1833 - Some cleanup and renames toward additional future work
1834
1835System 23: [R. Belmont]
1836 - Added extremely preliminary support for I/O boards with the H8/3344
1837
1838Removed the change_pc() macro. Changed memory_set_direct_region() to
1839return a boolean indicating whether the given address was successfully
1840located in a bank. Change raw/decrypted access to look at this result,
1841and if the given address is not in a bank, calls through to the
1842standard read handlers. This should prevent most crashes when
1843accessing opcodes. [Aaron Giles]
1844
1845Fixed address space mapping handlers to invalidate direct access
1846regions if a change is made to the mapping. This is needed to prevent
1847the Sega dynamic memory mapping chips from falling over. [Aaron Giles]
1848
1849Refactored the CDP1802 and COP400 CPU cores to use the new memory
1850functions. [Curt Coder]
1851
1852Switched m6809 and hd6309 to new memory functions: [couriersud]
1853 * cleaned up some macros
1854 * aligned code a bit more
1855 * interrupts now checked in cpu_execute instead of set_context
1856
1857Pointerified the psx cpu core & switched it to the new memory
1858functions. Changed some MIPS_* to PSXCPU_*. [smf]
1859
1860Fixed broken crazywar eeprom. [David Haywood]
1861
1862Another significant memory system change: [Aaron Giles]
1863
1864  Moved memory global state into a struct hanging off of the machine.
1865  Updated almost all memory APIs to take an address_space * where
1866  appropriate, and updated all callers. Changed memory internals to
1867  use address spaces where appropriate. Changed accessors to point
1868  to the memory_* functions instead of the address space-specific
1869  functions. Improved internal handling of watchpoints.
1870 
1871  Added cputag_* functions: cputag_reset(), cputag_get_index(),
1872  cputag_get_address_space(). These just expand via macros to an
1873  initial fetch of the CPU via cputag_get_cpu() followed by the
1874  standard CPU call.
1875 
1876  Added debugger_interrupt_hook() and debugger_exception_hook() calls
1877  which intelligently look at the debugger flags before calling.
1878
1879  Memory banking now requires a machine object. This makes the memory
1880  system fully global-free.
1881
1882Pointer-ified the jaguar CPU core. [Aaron Giles]
1883
1884Pointer-ified the TMS32031 core. [Aaron Giles]
1885
1886Replaced parent crkdown image with one containing valid settings data
1887(prevents game booting with 0 seconds and invalid highscore data
1888which it can't restore correctly). [David Haywood]
1889
1890Converted H8 CPUs to the new memory functions. [R. Belmont]
1891
1892Debugger interfaces cleanup. Added callback parameters to the
1893expression engine. Improved CPU parsing so you can use a CPU tag or
1894index in most commands that take one. Switched to passing CPU and
1895address space objects around where appropriate. Symbol tables now have
1896a global ref as well as a per-symbol ref. Debugcpu is now clear of
1897active CPU references and global Machine references. Lots of other
1898minor tweaks. [Aaron Giles]
1899
1900Pointer-ified cpu/nec (V30). [couriersud]
1901
1902Switched adsp21xx to new memory functions. [couriersud]
1903
1904Fixed several protection issues with Double Wings, improved video
1905and sound. [Angelo Salese]
1906
1907Converted ssp1601 to pointers (still works, tested virtua racing
1908genesis). [Curt Coder]
1909
1910Pointer work on se3208 (although I haven't touched the disassembler..)
1911[David Haywood]
1912
1913Adjusted bbusters volume balance slightly. [David Haywood]
1914
1915MC6845: Hsync needs to toggle on every scanline. [Curt Coder]
1916
1917Converted remaining CPU cores over to new memory functions.
11381918[Aaron Giles]
11391919
1140Clickable input support. Layouts can now have items which when clicked
1141will alter the state of an input port. This is done via the new
1142attributes 'inputtag' and 'inputmask', which specify an input port tag
1143and mask. When the given element is clicked, the state of the element
1144changes to 1 and the given bits in the input port are set the same as
1145if you had pressed the equivalent switch. [Nathan Woods]
1920Un-deprecat'ed the H8. [R. Belmont]
11461921
1147Started adding naomi2 sets. [David Haywood]
1922Removed cpu_read_byte/cpu_write_byte. Thesea are replaced with
1923memory_read_byte/memory_write_byte. [Aaron Giles]
11481924
1149Added sprites buffering to Limenko driver and removed imperfect video
1150flag from spotty. [Pierpaolo Prazzoli]
1925Pointer-ified the M377xx. [R. Belmont]
11511926
1152Improvements to Croupier (Playmark Roulette): [Roberto Fresca]
1153 - Simulated the MCU communication/protection.
1154   The game seems to work properly, but is hard to win.
1155   I conserved the game flags till we have the MCU decapped,
1156   and emulated properly.
1157 - Added full sound support.
1158 - Added lamps support + layout.
1927Removed all direct memory accesses via program_read/write_* from
1928game drivers. All drivers now use the memory_read/write_* and pass in
1929an address space. [Aaron Giles]
11591930
1160Fixed memory handling of internal banks. They should be LOWER priority
1161than the driver's memory maps. Reverted recent changes to MCS-48 core
1162that were very hacky and which crashed many games. You can now
1163properly override the internal memory map and do your own banking.
1931Removed ROM banking kludges from bublbobl, ninjakd2, tnzs, lsasquad,
1932missb2, and other drivers. [Nicola Salmoria, David Haywood]
1933
1934Pointer-"ified" the s2650 core. [couriersud]
1935
1936Removed memory context switch. All memory accesses now specify an
1937address space explicitly. There is no longer any concept of a
1938"current" memory context. [Aaron Giles]
1939
1940Enhanced the runtest.cmd to use all available processors.
11641941[Aaron Giles]
11651942
11668080/8085 CPU core updates: [Miodrag Milanovic]
1167 1. ANA/ANI instruction, HF flag was not set right because error in
1168     calculation of it (missing brackets)
1169 2. 8080 have NF flag always set (it is not used flag but bit is
1170     always set)
1171 3. Added support for status output lines.
1943Removed cpu_num info from SH2 in favor of just keeping the device
1944object. [Aaron Giles]
11721945
1173Moved more static data into const and added some more explicit
1174initialization. [Atari Ace]
1946Better fix for vendetta eeprom. [Mamesick, Fabio Priuli]
11751947
1176Added LSI BIOS to the Atari System 1 driver. Made the System 1 BIOS
1177a proper BIOS. Removed restriction that BIOS-related ROMs must
1178immediately follow the BIOS definition. [Kevin Eshbach, Aaron Giles]
1948Removed all vestiges of the old change_pc macro, which is no longer
1949needed with the banking improvements. [Aaron Giles]
11791950
1180cave.c changes: [Kevin Eshbach]
1181 * Changed the hardcoded MHz values in the Cave driver to the XTAL
1182    equivalents
1183 * Updated the Cave driver for the game Guwange with gals that need
1184    to be dumped
1951Added the latest "what we know" to the plygonet driver. [Phil Bennett]
11851952
1186Jail Break changes: [Kevin Eshbach]
1187 * Updated the Jail Break driver with the dip locations
1188 * Corrected the Jail Break driver sound chip from a SN76496 to a
1189    SN76489
1190 * Corrected the Jail Break rom names
1191 * Redumped the Jail Break VLM rom dump
1953More accurately describes the aux board behavior for Ms. Pac-Man.
1954There is a thorough description of how the board works. mspacman is a
1955more faithful emulation. In particular you can now enter service mode
1956(F2) at anytime during game play. [Steve Golson]
11921957
1193Super Basketball changes: [Kevin Eshbach]
1194 * Corrected the Super Basketball Revision H rom dump
1195 * Updated the Super Basketball driver with the dip locations
1196 * Corrected the Super Basketball VLM XTAL
1197 * Corrected the Super Basketball parent/child relationships by making
1198    the Revision H the parent
1199 * Turned on save state support for the Super Basketball driver
1958Derived clocks from crystals in in ace.c, asteroid.c, avalnche.c,
1959blockade.c, boxer.c, bzone.c, cosmic.c, firetrk.c, galaga.c,
1960lazercmd.c, meadows.c, missile.c, orbit.c, skydiver.c, sprint2.c,
1961warpwarp.c, williams.c. [Luigi30]
12001962
1201Updated the Sega System 1 driver with more board information on the
1202Choplifter bootleg and updated the placeholders for the pals that need
1203to be dumped. [Kevin Eshbach]
1963Added diplocations to meadows.c, mugsmash.c, orbit.c. [Luigi30]
12041964
1205Updated the WWF Wrestlefest driver rom names. Added save state support
1206to the WWF Wrestlefest driver. [Kevin Eshbach]
1965Unified sprint2.c memory map. [Luigi30]
12071966
1208C352 cleanup: Removed an unused volume table dating from before the
1209volume was (correctly) implemented as linear. [Olivier Galibert]
1967Unified galaga.c CPU4 memory maps. [Luigi30]
12101968
1211Added memory checking and error logic to ledutil.c.
1212[Christophe Jaillet]
1969Changed flyball CPU clock to a #defined crystal. Added dip locations.
1970[Luigi30]
12131971
1214Added running_machine * to some more locations in the system. Updated
1215drivers accordingly. [Oliver Stoeneberg]
1972Added new sound core for the Oki MSM6258. [Barry Rodewald]
12161973
1974Added dates to Tron revisions. Swapped tron/tron2 now that we know
1975tron2 is the later version. [Tim Lindquist]
12171976
12181977
1978
12191979New games added or promoted from NOT_WORKING status
12201980---------------------------------------------------
1221Super Gran Safari [Roberto Fresca]
1222Scacco Matto / Space Win [David Haywood, Roberto Fresca]
1981Filetto [Angelo Salese]
1982Jackie Chan - The Kung-Fu Master
1983   [David Haywood, Andreas Naive, stephh, Angelo Salese]
1984Firefox [Aaron Giles, smf]
12231985
12241986
12251987
12261988New clones added
12271989----------------
1228The Great Ragtime Show (Japan v1.3, 92.11.26) [Stefan Lindberg]
1229Imago (cocktail set) [Chris Hardy]
1230The NewZealand Story (Japan, newer) [Tirino73]
1231Marble Madness (set 5 - LSI Cartridge) [Kevin Eshbach]
1990Beast Busters (US, Version 2) [Brian Hargrove]
1991Puzzle Bobble 2 (Ver 2.3O 1995/07/31) [Ross Myers]
1992Street Fighter II' - Champion Edition (Rainbow set 3, bootleg)
1993   [Bill DeLeo]
1994Violent Storm (ver UAC) [Bill DeLeo]
1995Daitoride (YMF278B version) [Stefan Lindberg]
1996Soldam (World?) [Gerald]
12321997
12331998
12341999
12350.127u2
2000New games marked as GAME_NOT_WORKING
2001------------------------------------
2002Motocross Go! (MG3 Ver. A) [Guru]
2003
2004
2005
20060.128u3
12362007-------
12372008
12382009
12392010MAMETesters Bugs Fixed
12402011----------------------
1241- 00596: [DIP/Input] pocketrc: The car turns only to the right and
1242         there is no way to calibrate controls. (smf)
1243- 02075: [DIP/Input] mooncrgx: Cabinet DIP setting is duplicated.
1244         (MikeDX)
1245- 02137: [DIP/Input] rockduck: DIP setting for LIVES is incorrect
1246         (MikeDX)
1247- 02179: [DIP/Input] lethalej: lethalej crosshairs backwards
1248         (Luigi30, MikeDX)
1249- 02035: [DIP/Input] gwarb: Guerrilla War bootleg doesn't need a
1250         rotary joy (robiza)
1251- 02174: [Sound] dkongjr and clones + mario and clones + pestplce:
1252         Music speed regression (Aaron Giles)
1253- 02173: [Crash/Freeze] radarscp, radarsc1: Hang or Reset before game
1254         start. (Aaron Giles)
2012- 02633: [Crash/Freeze] Many sets using the MC6845: Crash/hanging in
2013         many games. (Curt Coder)
2014- 02626: [DIP/Input] crimfgt2, crimfgtj: Cannot start a game
2015         (Fabio Priuli)
2016- 02618: [Sound] samuraia and clones: No SFX sound
2017         (Pierpaolo Prazzoli)
2018- 02544: [Core] Dip Condition / Port Include limitation (Aaron Giles)
2019- 02542: [DIP/Input] ghoulsu: Doesn't remove the original port when
2020         replacing it with a conditional port (Aaron Giles)
2021- 02607: [Crash/Freeze] frogs: Taking a screenshot in Frogs (Gremlin) exits the game with an error. (aaron)
12552022
12562023
12572024
12582025Source Changes
12592026--------------
1260Optimized DISCRETE_RCDISC_MODULATED. Added X_TALs to circus. Optimized
1261DISCRETE_RCINTEGRATE and DISCRETE_555_ASTABLE. Optimized
1262DISCRETE_555_ASTABLE_CV and DISCRETE_MIXER. Optimized DISCRETE_555_CC.
1263The 555 and mixer changes also speed up just about every current
1264discrete game. [Derrick Renaud]
2027Changed 74123 into a device. Clarified behavior from datasheet. Added
2028logic to avoid recursive calls. [couriersud]
12652029
1266Added updated information about Sorcer Striker and moved Fix Eight
1267bootleg PCB layout down by the roms like the other layouts in the
1268driver. [Brian Troha]
2030Fixed Dip Switches for all games in halleys.c driver.
2031Added Dip locations for 'halleys' and clones. [stephh]
12692032
1270Added redumped roms for the Bubble Symphony (bootleg with OKI6295)
1271set. [Brian Troha]
2033More improvements to the 32x code. [David Haywood]
12722034
1273Started removing extraneous enable lines from the discrete modules. 
1274Most modules are always enabled anyways. [Derrick Renaud]
2035Irem M10: first results from schematics: [couriersud]
2036 * Updated video timing and cpu/pixel clocks
2037 * Rewrote irq for m10/m11 to use two 74LS123
12752038
1276Changed MCS-48 core to write p1 and p2 on reset. [couriersud]
2039AICA: fix missing instruments in DTPK driver games.
2040[R. Belmont, Deunan Knute, kingshriek]
12772041
1278dkong/dkongjr: use MB8884 as sound cpu / verified on schematics.
1279[couriersud]
2042Naomi: unmapped words in the AICA address range must read as zero.
2043[R. Belmont]
12802044
1281mcs48.c: Use banking to handle ea line: [couriersud]
1282 * Adds MCS48_INTERNAL_ROMBANK define to header
1283 * Drivers which need to control the ea line have to initialize
1284    banking for internal/external rom
1285This is not yet optimal but works as expected with existing drivers
1286and modified mario.c
2045Corrected YM2203 balance in powerins. [Jim Hernandez]
12872046
1288Changed MCS-48 EA line handling to use an explicit bank for now.
1289[couriersud]
2047Converted toobin to RGB32 to allow for mid-screen palette updates.
2048Also added correct video timing and full memory map, and connected
2049watchdog. [Aaron Giles]
12902050
1291Added EggVenture readme to lethalj.c. [Guru]
2051Added Dip locations for 'exprraid' and clones, and for 'gyruss' and
2052clones. [stephh]
12922053
1293Changed sound cpu type in saiyugb1 to I8748. [couriersud]
2054Hooked up 6845 to peplus driver: [couriersud]
2055 * Hooked up 6845 in a daisy chain way into existing "6845 emulation"
2056 * Clocks from schematics
2057 * Video size issues - 6845 code related, discussion started on list
12942058
1295dkong.c: S2650 based games consolidated [couriersud]
1296 * consolidated memory maps for S2650 based games
1297 * renamed handlers to s2650_*
1298 * joined protection handlers
2059Re-inlined core attotime functions. This makes a significant
2060difference when running with high interleaves. [Aaron Giles]
12992061
1300Added Cruis'n USA and new Raiden DX/2 readme. Cleaned up some
1301documentation in raiden2.c. Renamed "Raiden DX (set 2)" to "Raiden DX
1302(Tuning license)", and renamed ROMs to match the actual PCB.
1303[Guru]
2062Added support for recently-discovered internal Z80 register to the
2063Z80 core. Improves accuracy of undefined flags. [Miodrag Milanovic]
13042064
1305Updated documentation and disk/ROM names in segas24 based on new
1306information. [Brian Troha, T.Fujita]
2065Reverted MC6845 changes as they broke a number of things. [Curt Coder]
13072066
1308Removed "game_no_sound" from the 2 Hotrod games (in segas24.c) as all
13093 seem to have the same sound capabilities. [Brian Troha]
2067Converted Z80, R3000, ADSP2100, and M680x0 cores to reference their
2068data via pointers instead of global structs, in anticipation of
2069future changes. [Aaron Giles]
13102070
1311toaplan2: [Brian Troha]
1312 * removed duplicate info
1313 * changed most speeds to "xtal_xxMHz" define
1314 * corrected Battle Battle Bakraid Z80 clock based on readme info
2071Fixed coinage in Speed Attack! and cleaned-up the driver to current
2072standards. [Angelo Salese]
13152073
1316Fixed Dip Switches and Inputs for 'aso', 'alphamis', 'arian' (same as
1317'alphamis'), 'tnk3', 'tnk3j' (same as 'tnk3') and 'athena'. [stephh]
2074Converted the MCS-48, MCS-51, and m6502 cores to reference data via
2075pointers. [couriersud]
13182076
1319Improvements to galaxi driver... [Roberto Fresca]
1320 - Added Magic Joker.
1321 - Fixed the 3rd background offset to Galaxi.
1322 - Remapped inputs to match the standard poker games.
2077Added concept of scheduling quanta to the timer system. Also added
2078means of setting the minimum useful scheduling quantum, and clamping
2079all quanta to that value. [Aaron Giles]
13232080
1324Began the "big IO_MAP merge of 2008". A number of drivers have had
1325their I/O space address maps merged. [Andrew Gardner]
2081Changed interleave/boost handling to use scheduling quanta instead
2082of timers. [Aaron Giles]
13262083
1327Changed the default bootleg gwar pcb to be joystick only, and removed
1328code duplication. Fixed jcross cabinet dip switches. [Nicola Salmoria]
2084Added machine parameter to cpu_boost_interleave. [Aaron Giles]
13292085
1330M377xx:  8-bit I/O port reads no longer cause bogus reads of
1331neighboring ports. [R. Belmont]
2086Updated cpuexec to compute the "perfect" interleave value taking into
2087account the minimum number of cycles per instruction specified by the
2088CPU core. Updated Z80 core to indicate that the minimum cpi is 2.
2089Fixed incorrect minimum cpi in the 68020+ cores. [Aaron Giles]
13322090
1333Removed unnecessary ARM7 hooks so MRC and MCR disassemble properly.
1334[R. Belmont]
2091Changed core cycle computations to use div_64x32 instead of full
209264-bit divides. This involves tossing a few bits of resolution at
2093divide time, but should make no real difference in practice.
2094[Aaron Giles]
13352095
1336Updated TMS5100 LPC tables based on mathematical analysis of 1st and
13372nd derivatives of the values and comparison to the best quality
1338patent image, which nearly always showed which values were in error.
1339Some off-by-one issues may remain, but it is now nearly perfect.
1340Further perfection will require PROMOUT dumping, which is planned.
1341[Lord Nightmare]
2096Began the process of pruning options from the 68000 core, hard-coding
2097it for MAME's needs. We've hacked on it sufficiently that it is no
2098longer generic, so this is a good opportunity to simplify the code
2099so that it can actually be followed (still in progress). [Aaron Giles]
13422100
1343snk update: [Nicola Salmoria]
1344 * added another ikari us clone
1345 * renamed ikaria to ikarinc (for Ikari No Continues)
1346 * ikari is the JAMMA board, with conitnues
1347 * ikaria is the non-JAMMA board, with continues
1348 * ikarinc is the non-JAMMA board, without continues
1349 * fixed sound in Jumping Cross
1350 * adjusted some input bits in several games
1351 * merged hal21.c into snk.c
1352 * removed hacks and kludges
1353 * fixed colors (I think--though some sprites do look weird)
1354 * fixed emulation of the "SNK Wave" custom sound used by Marvin's
1355    Maze and Vanguard II and made it into a proper sound core
1356 * fixed palette decoding of early SNK games (from marvins to
1357    athena + fitegolf). The least significan bits were assigned
1358    incorrectly.
1359 * merged marvins.c into snk.c, with all resulting fixes (removed
1360    hacks, correct shadows, scroll offsets etc)
2101Defined macros for all core CPU functions, along with macros for the
2102name and for calling, in the spirit of the devintrf.h macros.
2103[Aaron Giles]
13612104
1362Replaced aso ROMs (which were possibly from a bootleg) with split ones
1363that are definitely from an original. Renamed ROMs across sets
1364accordingly. [Nicola Salmoria]
2105Changed init, reset, exit, and execute interfaces to be passed a
2106const device_config * object. This is a fake object for the moment,
2107but encapsulates the machine pointer and token. Eventually this will
2108be a real device. [Aaron Giles]
13652109
1366Converted timekeeper to a device, all default contents are loaded from
1367disk. slapshot & opwolf3 read/write memory map have been merged.
1368[smf]
2110Changed the CPU IRQ callbacks to a proper type, and added a device
2111parameter to them. [Aaron Giles]
13692112
1370Shadow Force changes: [Pierpaolo Prazzoli]
1371 - Added irqs ack
1372 - Implemented raster irq
1373 - Fixed coin2 and service input not working during the game
1374 - Added watchdog
1375 - Fixed visible area
1376 - Added video enable and irqs enable flags
2113Fixed background color of srmp1/srmp2. [EdxGROfS0]
13772114
1378Added decryption of 39in1. Doesn't get far due to very odd RAM check
1379routine. [Andreas Naive]
2115Various improvements in the ST-V driver: [Angelo Salese]
2116 * Fixed bitmap zooming in Virtual Mahjong 2 - My Fair Lady;
2117 * Worked around a major graphic bug in ElanDoree;
2118 * Added some missing alpha blending effects,Pro Mahjong Kiwame S
2119    title screen needs it but it doesn't work yet due to other
2120    problems (still investigating)
2121 * Fixed a crash bug with Astra Super Stars when the debugger is
2122    active.
13802123
1381Changed all MCS-48 chips to have a 12-bit address space, regardless
1382of internal ROM size. [Aaron Giles]
2124Merged DS5002FP into MCS51: [couriersud]
2125 * Merged DS5002FP
2126 * Disassembler now uses type specific memory names
2127 * Merged DS5002FP disasm
2128 * added 83C751 memory names to disassembler
2129 * delete DS5002FP specific files
2130 * removed unnecessary cpu callback in wrally
2131 * DATA_MAP ==> IO_MAP in wrally
13832132
1384Enabled internal COP410 program map. [Curt Coder]
2133Continued rewrite of the Motorola DSP56k CPU core:
2134[Andrew Gardner, PhilB, RBelmont]
2135 * Added proper clock speed to plygonet.c and internal divider to
2136    dsp56k.c
2137 * Fixed up disassembler add/sub, 05xx, and bsr ops.
2138 * Handle mysterious uuuuF instruction found in plygonet add op.
2139 * Partially implemented add, sub, mac, mpy, inc, cmpm, macr, asr16,
2140    jscc, lea, and movec ops.
2141 * Added dual X memory read and data move with short displacement
2142    parallel moves.
13852143
1386Fixed Dip Switches and Inputs for 'hal21', 'hal21j' (same as 'hal'),
1387'fitegolf', 'fitegol2' (same as 'fitegolf') and 'countryc'. [stephh]
2144Some improvements to the Forte Card driver, not yet working.
2145[Angelo Salese]
13882146
1389Changed refreshspeed target to 0.25Hz below rate provided, in order to
1390guarantee that inexact timings do not lead to sound stuttering.
1391[Aaron Giles]
2147Changed Psicho Nics Oscar (japan revision 0) to (world revision 0)
2148since there is no japan disclaimer. [Corrado Tomaselli]
13922149
1393Added Fist of the North Star and (partial) Demolish Fist sets
1394(Atomiswave) and decryption. [Andreas Naive]
2150Fixed missing inputs in expro02. [Sonikos]
13952151
1396Added PCB info for Hard Yardage & earlier World Class Bowling.
1397Corrected a few rom names. [Brian Troha]
2152CPS2 ROM updates to match PCB labels. [Razoola]
13982153
1399Split core laserdisc functionality into separate file ldcore.c.
1400Each player now gets its own source file, along with new hooks
1401which enable more precise control over the behavior. Updated the
1402PR-8210 and LD-V1000 implementations to the new spec. Other
1403players will come online shortly. [Aaron Giles]
2154Added ADDRESS_MAP_NAME macro, updated CPU cores to use it to reference
2155internal address maps. [Atari Ace]
14042156
1405Changed laserdisc scan behavior so that it requires a constant stream
1406of signals to continue scanning. Updated ldplayer accordingly.
1407[Aaron Giles]
2157Added include files for many drivers that never bothered before.
2158[Atari Ace]
14082159
1409Updated debugger to pass running_machine around where appropriate.
1410Added running_machine to several devices which really should
1411eventually be converted into proper devices. [Oliver Stoenberg]
2160Improved Star Castle drone sound. [Jim Hernandez]
14122161
1413Concluded input port cleanups for drivers W->Z. Changed Primal Rage
1414start buttons into input buttons. Removed unused protection bit in
1415Driver's Edge. Introduced a new PORT_CUSTOM which returns a tagged
1416input that can be used to route bits from one port into another.
1417[Fabio Priuli]
14182162
1419Added the missing SHA1 checksums to the atrowar set.
1420[Oliver Stoenberg]
14212163
1422Added basic implementation of the "update ended" interrupt flag to the
1423MC146818. [Barry Rodewald]
2164New games added or promoted from NOT_WORKING status
2165---------------------------------------------------
2166Snezhnaja Koroleva [Antro]
14242167
14252168
14262169
1427New games added or promoted from NOT_WORKING status
1428---------------------------------------------------
1429Video Poker [Grull Osgo, Roberto Fresca]
1430Black Jack [Grull Osgo, Roberto Fresca]
1431Video Dado [Grull Osgo, Roberto Fresca]
1432Video Cordoba [Grull Osgo, Roberto Fresca]
1433Magic Joker (v1.25.10.2000) [Roberto Fresca]
21700.128u2
2171-------
14342172
14352173
2174MAMETesters Bugs Fixed
2175----------------------
2176- 02268: [Graphics] devilw, darkadv, majuu : Sprite-background
2177         priority isn't correct. (Mamesick)
2178- 02042: [Color/Palette] jjparad2: Wrong background color (Mamesick)
2179- 01679: [Crash/Freeze] kuniokub, kuniokun, renegade: Game freezes
2180         after Title Screen. (Mamesick)
2181- 00224: [Sound] macross2: After stage 1, the sound keeps going out
2182         and coming back. (Nicola Salmoria)
2183- 02605: [Color/Palette] funnymou, suprmous: Wrong colors in Funny
2184         Mouse and clone. (David Haywood)
2185- 02587: [Gameplay] lohtb2: lohtb2 protection emulation is imperfect
2186         (couriersud)
2187- 02456: [Core] wrong sector size at CD_TRACK_MODE2 conversion routine
2188         (R. Belmont)
2189- 02011: [Sound] superchs: ES5505 clockspeed too low (Phil Bennett)
2190- 02199: [DIP/Input] banbam, pettanp: The 4th 'Unused' dipswitch is
2191         the 'Freeze' switch. (Angelo Salese)
2192- 00893: [Sound] All games in playch10.c, punchout.c, vsnes.c: It
2193         seems that some sound channels are missing. (Aaron Giles)
14362194
1437New clones added
1438----------------
1439Egg Venture (A.L. Release) [Guru]
1440Ikari Warriors (US) [Nicola Salmoria]
1441Double Dragon (bootleg) [Sonikos]
14422195
14432196
2197Source Changes
2198--------------
2199Added sound banking to the mirage.c driver. [Angelo Salese]
14442200
1445New games marked as GAME_NOT_WORKING
1446------------------------------------
1447Mad Zoo [Roberto Fresca]
2201Removed parent clone relationship from "Street Fighter Zero/Alpha 2"
2202and "Street Fighter Zero 2 Alpha". [David Haywood]
14482203
2204Removed parent clone relationship between missb2 and bublbobl. We
2205don't usually make the 'korean hacks' as clones as they have very
2206little to do with the original releases except for the stolen cpu
2207code. GFX / Sound / Gameplay are completely redesigned.
2208[David Haywood]
14492209
2210Changed VBLANK to irq0_line_assert and added a CLEAR_LINE in the
2211peplus driver. This greatly increases speed on all video slots.
2212[Jim Stolis]
14502213
14510.127u1
1452-------
2214Cleaned up the sample rom loading in mirage.c. [Angelo Salese]
14532215
2216MCS-51 improvements: [couriersud, Jim Stolis]
2217 * Fixed split timer mode
2218 * No interrupts for timer 0 modes 0,1,2 while timer 1 in mode 3
2219 * mcs51 core now supports 4 interrupt levels depending on cpu type
2220 * According to Philips, 80C31 is a 80C52 family member with 128K
2221    internal ram and no rom
2222 * Implemented cmos features: powerdown & idle
2223 * Added comments about special function registers on Philips 80C52
2224 * cleaned up reset routines
2225 * Fixed INT0 & INT1 interrupt line handling
2226 * Finally move cpu/i8051 to cpu/mcs51, rename files and some
2227    constants
2228 * Quotes from the documentation added to the source as well
2229 * Started DS5002FP integration
14542230
1455MAMETesters Bugs Fixed
1456----------------------
1457- 00228: [Graphics] sgladiat: Emulation is missing some enemy sprites
1458         that are present on the pcb. (Nicola Salmoria)
1459- 02147: [Interface] Annoying behaviour of highlighted entries in
1460         minimal UI (Aaron Giles)
1461- 02159: [Crash/Freeze] cubeqst: Cubequest crashes on ATI hardware
1462         w/ prescale > 1 (Aaron Giles)
1463- 02035: [DIP/Input] gwarb: Guerrilla War bootleg doesn't need a
1464         rotary joy (Nicola Salmoria)
1465- 00650: [DIP/Input] stv.c games: P1 and P2 Button 4 are duplicated.
1466         (Fabio Priuli)
1467- 02154: [DIP/Input] ckongg: Coinage settings are wrong.
1468         (Fabio Priuli)
1469- 02143: [Graphics] ozmawars, ozmawar2, solfight, spaceph: Streaks
1470         and dashes appear on screen after playing awhile
1471         (Fabio Priuli)
1472- 02142: [Sound] centipdb, magworm, millpac: No Sound (couriersud)
1473- 02150: [DIP/Input] spacegun: Missing crosshairs (Nicola Salmoria)
1474- 02144: [DIP/Input] ozmawars, ozmawar2, solfight, spaceph: DIP
1475         settings for coinage are incorrect (Fabio Priuli)
1476- 02126: [Core] corrupt CHDs are reported as missing (Aaron Giles)
1477- 02133: [Misc.] chindrah: The title of Zhong Guo Long?(Hong Kong,
1478         V011H) is Dong Fang Zhi Zhu(Hong Kong, V011H) (Aaron Giles)
1479- 02139: [Misc.] In audio/system16.c, there is a reference to
1480         REGION_SOUND1 (Aaron Giles)
1481- 02138: [Cheat System] flamegun: Debugger/Cheat System upper case
1482         cpu tag of MAIN doesn't work (Aaron Giles)
1483- 02110: [Side-by-side] All sets in cps3.c: video from a DV cam
1484         proves the refresh rate of CPS3 in MAME is wrong (Aaron Giles)
1485- 02127: [Documentation] xymg: The game name should be Xing Yun Man
1486         Guan and "Pin Yin:"should be omitted (Aaron Giles)
1487- 02136: [Interface] cubeqst: from minimal UI cubeqst requires the
1488         optional CHD (Aaron Giles)
1489- 00869: [Graphics] ikari: The title screen and high score screen do
1490         not have a black background, as MAME displays.
1491         (Nicola Salmoria)
1492- 02135: [DIP/Input] rtypej: DIP Switch "Demo Sounds" is wrong
1493         (Fabio Priuli)
1494- 00429: [Gameplay] fastlane: the random function of this doesn't work
1495         well and always gives a "no bonus"... (ShimaPong)
2231Updated nes pcm dma to read data through the cpu address map.
2232[Wilbert Pol]
14962233
2234Fixed Dip Switches for 'ambush' and clones. [stephh]
14972235
2236Improvements to magicfly driver: [Roberto Fresca]
2237 - Added sound support to magicfly and 7mezzo.
2238 - Hooked coin counters to magicfly and 7mezzo.
2239 - Inverted the graphics banks to be straight with the hardware accesses.
2240 - Updated the memory map description and technical notes.
2241 - Added game notes and documented the test/settings/bookkeeping modes.
14982242
1499Source Changes
1500--------------
1501Changed DIRECTINPUT & DIRECT3D handling, so they can be overridden by
1502environment variables. [smf]
2243Fixed Dip Switches for 'arabian' and clones. [stephh]
15032244
1504Readded generic calls to install memory handlers that were in long
1505before 0.126u5 - these are useful on the MESS side for things like
1506the PC driver. [Nathan Woods]
2245Fixed Dip Switches for 'spaceint' and clones. [stephh]
15072246
1508HD63484 improvements: [robiza]
1509 * fixed cpx and cpy when a ptn or a agcpy command is executed
1510 * fixed for PTN command: copy direction and dot color
1511 * first implementation of PAINT command (for now only 4bpp and 8bpp
1512    supported and the pattern is not supported)
2247Fixed MSM5205 ADPCM and sound comms in Ashita no Joe/Success Joe.
2248[Philip Bennett]
15132249
1514Cleaned up the discrete code and fixed discrete logging.
1515[Derrick Renaud]
2250Changed superchs ES5505 clock rate to 15238050Hz. [Philip Bennett]
15162251
1517Fixed handling of a number of static variables to avoid multisession
1518issues. [Atari Ace]
2252Fixed Dip Switches for all games in astrof.c driver. [stephh]
15192253
1520Moved FD1089 decryption keys to external files. [Atari Ace]
2254Various improvements to the jalmah.c driver: [Angelo Salese]
2255 * Fixed tilemaps paging / tilemap positioning;
2256 * Fixed a protection issue in Mahjong Daireikai,not giving correct
2257    colors for the girls in-game;
2258 * Fixed a rom-loading issue in Mahjong Daireikai;
2259 * Fixed 'ZA' sound banking behaviour,this fixes at least the sound
2260    in kakumei2;
2261 * Removed VIDEO_EOF and added a TIMER_DEVICE_CALLBACK function for
2262    MCU simulations;
2263 * Added WIP code for the priority system;
2264 * Added a NO_DUMP for the MCU for all the sets;
15212265
1522Changed 68000 IRQ support so that the IRQ lines explicitly simulate
1523a standard demux chip connected to the IRQ lines. This means that the
1524sequence:
2266Rewrite of the Motorola DSP56k CPU core. [Andrew Gardner]
2267 * Partially implemented inc24, asl4, bcc, brkcc, and doForever ops.
2268 * Added code for parallel address register update.
2269 * Partially implemented tfr op.
2270 * Polygonet now allows test mode to be run for a few seconds.  Most
2271    IO is now known, though coin2 is still a mystery.
2272 * Partially implemented move, asr4, and mpy ops.
15252273
1526      cpunum_set_input_line(5, ASSERT_LINE);
1527      cpunum_set_input_line(3, ASSERT_LINE);
1528      cpunum_set_input_line(3, CLEAR_LINE);
2274YM2608/2612: applied latest fixes/discoveries. [Eke-Eke, Nemesis]
15292275
1530now works as expected. This required fixes to several Atari and other
1531drivers. [Olivier Galibert]
2276Added palette fading effect on macrossp.c driver. [Angelo Salese]
15322277
1533Input port cleanup pass over drivers from N-V, leveraging
1534AM_READ_PORT, converting to full 32-bit inputs where suitable, using
1535CUSTOM_PORTs for EEPROM bits, etc. [Fabio Priuli]
2278Fixed skewing and display area in MC6845. [Curt Coder]
15362279
1537Additional input port cleanups in the cps1, deco, pgm, psikyo, nbmj,
1538and jaleco drivers. [Fabio Priuli]
2280Fixed Dip Switches and inputs for 'dreamwld'. [stephh]
15392281
1540snk.c rewrite: [Nicola Salmoria]
1541 - fixed sprite-sprite priorities
1542 - TNK3, Athena, Fighting Golf, Country Club
1543    - converted to tilemaps
1544    - removed hacks
1545    - proper memory maps
1546    - screen flip / cocktail mode support
1547    - DIP locations
1548    - better implementation of sound CPU communication
1549    - hooked sound CPU interrupts to YM chips
1550    - fitegolf hax 1xYM3812, not 2xYM3526
1551 - Ikari Warriors, Victory Road
1552    - removed ROM patches
1553    - simulated "hard flags" behaviour
1554    - proper memory maps
1555    - fixed ikarijp color test
1556    - renamed dogosokj to dogosokb and loaded the correct palette PROMs
1557    - inputs, dip locations, etc.
1558    - removed NO_COCKTAIL flag since these games don't have a flip
1559       screen dip switch
1560 - Guerrilla War, Psycho Soldier, Chopper I, TouchDown Fever /
1561   Fighting Soccer
1562    - tilemaps
1563    - proper memory map
1564    - input, dip locations, etc.
1565 - Bermuda Triangle / World Wars
1566    - removed ROM patches
1567    - simulated "turbo front" check
1568    - renamed bermudao->bermudaj
1569    - clarified the relationship between the four sets
1570    - made World Wars a main set instead of a clone of Bermuda Triangle
1571    - tliemaps, proper memory maps, inputs, etc.
1572 - ASO
1573    - moved from hal21.c to snk.c
1574    - removed hacks, fixed bg color
1575 - Gladiator
1576    - moved from sgladiat.c to snk.c
1577    - fixed shadows, visible area, tilemaps, inputs, etc.
1578 - Jumping Cross
1579    - moved from jcross.c to snk.c
1580    - fixed fg layer and visible area
1581    - the game seems to be ok now? is there still something wrong?
2282NEC CPU core improvements: [couriersud]
2283 * removed another speed hack in the NEC core
2284 * renamed "FETCH" to "FETCH()" (macros used as functions should
2285    look like functions)
2286 * Preparation for opcode prefetch timing
2287 * improved prefetch timing calculation
2288 * prefetch timing now also used by V20 and V33
2289 * moved some static variables into cpu context
2290 * nec_reset now explicitly clears context variables
2291 * all cpus now share nec_execute
15822292
1583Added 8303 ROM to the games using it and updated MCU simulation to
1584match the new findings. [Nicola Salmoria]
2293More Discrete module optimizations. Added optimized custom mixer to
2294Donkey Kong. [Derrick Renaud]
15852295
1586Removed duplicate buttons in sf2hack. Promoted sf2m2 clone to
1587working. [robiza]
2296lohtb2: Improved mcu emulation [couriersud]
2297 * The whole startup cycle now works. No more timeouts and erratic
2298    behavior.
2299 * lohtb2 will however not display the "Warning" screen due to a
2300    priority issue. With color/attribute of 0x80 in videoram at 0xd0000 and 0xd8000, videoram at 0xd80000 will be displayed. Some tilemap guru has to look into this.
15882301
1589Added helper function devtag_get_device(machine, type, tag) to
1590retrieve the device_config for (type, tag). [couriersud]
2302Fix GCC 4.3 "array bounds exceeded" error in disc_flt.c. [R. Belmont]
15912303
1592Hooked up sound CPU comms in Power Instinct 2. This enables
1593synchronized dancing for the background characters. [ShimaPong]
2304plygonet improvements: [R. Belmont]
2305 - Turned off network IRQ.  Game now boots without "network error"
2306 - Hooked up palette RAM
2307 - Improved text layer emulation (flip bits still missing)
2308 - Fixed text layer emulation and visible area. FBI logo and color
2309    test now display properly.
15942310
1595Fixed bug when writing AVI files with more than one RIFF chunk.
1596Added missing chdman error messages when extracting to an AVI file.
2311Fixed sound,hooked-up generic inputs and added some notes in Alien
2312Command (not yet working). [Angelo Salese]
2313
2314Fixed m72 tilemap group 2 priorities. [couriersud]
2315
2316Fixed Joker's Wild graphics to 2 bits per pixel. [Roberto Fresca]
2317
2318NeoGeo updates [JohnBoy}
2319 * Updated NeoGeo game pcb infos
2320 * Renamed p's in kof2000n to correct chip label
2321 * Renamed v's in mahretsu to correct chip label, readded 128k m1
2322    from Mame 0.34b6 / s1 from older dump
2323 * breakrev: Renamed c's to correct chip label, added correct c5/c6
2324 * Marked mslug3h MVS AND AES VERSION
2325 * Marked mslug4 2nd revision, added mslug4 1st revision missing set
2326    comment
2327 * Marked trally MVS AND AES VERSION
2328 * Marked ncombath MVS AND AES VERSION
2329 * Marked sengoku MVS VERSION
2330 * Marked superspy MVS AND AES VERSION
2331 * Marked mutnat MVS AND AES VERSION
2332
2333Modified src2html to use a template source file instead of hard-coding
2334to the MAME site. Changed from explicit styles to classes.
15972335[Aaron Giles]
15982336
1599Derived CPS2/CPS3 video timing based on measurements. These are
1600educated guesses. The logic behind the derivations is shown in the
1601source. [Aaron Giles]
2337Changed magictg to use (hopefully correct) roms. [David Haywood]
16022338
1603Game-A-Tron gambling hardware updates: [Roberto Fresca]
1604 - Added sound support to "Poker 4-1" and "Pull Tabs".
1605 - Figured out the output ports. Documented each bit accessed.
1606 - Added button lamps support. Created layouts for both games.
1607 - Switched the 8255 port C to be used as output port.
1608 - Adjusted the coin pulse timing.
1609 - Updated technical notes.
1610 - Splitted the driver to driver + video.
1611 - Final clean-up.
2339Naomi / DC improvements [Samuele Zannoli]
2340 * cvs2gd stops looping forever. However with no 3d emulation nothing
2341    is shown on the screen.
2342 * implemented the naomi RTC and there are a few verbose messages
2343    about transfers not implemented yet.
16122344
1613Fixed problem that would cause the "Return To Prior Menu" menu item to
1614not stick if one is calling ui_menu_reset() with
1615UI_MENU_RESET_REMEMBER_POSITION, and that menu item is selected.
1616[Nathan Woods]
2345Fixed Dip Switches for 'exprraid' and clones. [stephh]
16172346
1618Added PR-8210 support to the ldplayer. Fixed step forward command on
1619the PR-8210. [Aaron Giles]
2347Improvements to re900.c driver [Roberto Fresca, Grull Osgo]
2348 - Reworked inputs to allow 6 players through a selector.
2349 - Hooked all lamps (even the ball simulator array).
2350 - Added a internal layout and support for external artwork.
2351 - Extended the hardware to support Buena Suerte '94.
2352 - Cleaned up the driver.
16202353
1621Changed Journey and Domino Man to 4-way joysticks. [John Rieman]
2354Fixed Dip Switches for 'gyruss' and clones. [stephh]
16222355
1623Added Discrete Sound for Starship 1. Still need to properly emulate
1624the MC3340. [Derrick Renaud]
2356Fix NES APU to work with high sample rates (don't know the bug #).
2357[Aaron Giles]
16252358
1626Changed some decryptions in igs_blit.c to use program roms loaded
1627byteswapped. Decrypted Mahjong Man Guan Cai Shen, Mahjong Long
1628Hu Zheng Ba 2, Mahjong Shuang Long Qiang Zhu 2, and Mahjong Super
1629Da Man Guan 2. [Pierpaolo Prazzoli]
2359Synchronized 6502 disassembly with CPU core. [Pugsy]
16302360
1631Added save state for discrete node->output to ensure that input nodes
1632save states. [couriersud]
2361Added missing const/statics, added/removed entries in header files,
2362and fixed a few potential multisession issues by explicitly adding
2363initializers. asic65.c has significant changes to accomodate using a
2364struct instead of 16 variables, otherwise the changes are modest and
2365obvious. [Atari Ace]
16332366
1634Added a new generic latch device. Generic emulation of 74LS174/175,
163574LS259 and other latches. Apart from providing synched latch
1636operation, these latches can be configured to read their input
1637bitwise from other devices as well and individual bits can be
1638connected to discrete nodes. Please see audio/dkong.c for examples.
1639[couriersud]
2367expro02 driver improvements: [Sonikos]
2368 - Fixed dips in all galsnew sets and  fantasia.
2369 - Added dips location.
2370 - A little driver clean up.
16402371
1641dkong & friends: Use new latch device [couriersud]
1642 * adds new latch device where appropriate
1643 * increased accuracy since now all main/sound cpu communications
1644    are properly latched
1645 * removed quite some code as a consequence
1646 * minor cosmetic edits
2372Added save state support to the toaplan2 driver. [Atari Ace]
16472373
1648Updated adp memory map. [robiza]
2374Changed the coinage settings and swapped coin A mech with coin B to
2375match the behaviour of Chelnov (world) pcb. [Corrado Tomaselli]
16492376
1650m4510 core fixes: [robiza]
1651 - banking in read and write operations
1652 - jsr and jsrx instruction
1653 - fixed TSY instruction
16542377
1655Optimized ycc_to_rgb conversion code. [couriersud]
16562378
1657Added readme for The Simpsons. [Guru]
2379New games added or promoted from NOT_WORKING status
2380---------------------------------------------------
2381Ruleta RE-900 [Grull Osgo]
2382Buena Suerte '94 [Grull Osgo, Roberto Fresca]
2383Virtual Mahjong 2 - My Fair Lady
16582384
1659zn.c improvements: [smf]
1660 - Improved dip switch emulation, ram hacks to get games booting are
1661    no longer required.
1662 - Added gun emulation for judge dredd.
1663 - Fixed judge dredd ide emulation when building with visual studio.
1664 - Mapped primal rage 2 inputs
1665 - Mapped player 3 & 4 inputs for 1 on 1 government, these are now
1666    the default with the 6 button inputs only mapped for games that
1667    need them.
1668 - Converted AT28C16 to a device.
1669 - Added preliminary support for devices to load/save nvram.
16702385
1671Added some initial logic to boot and run the PR-8210 ROM (i8049)
1672in ldplayer.c. Currently this is disabled behind a compile-time
1673switch. Once this is working, the plan is to incorporate this into
1674the existing PR-8210 emulation, but we're not there yet. [Aaron Giles]
16752386
1676Changed Trivia Quest clocks based on some really old information.
1677[Pierpaolo Prazzoli]
2387New clones added
2388----------------
2389Power Instinct (USA) [Jim Hernandez]
16782390
1679Added new function tilemap_set_pen_data_offset(). While this isn't
1680'free' as tilemap_set_palette_offset() is (when the offset changes,
1681the pixmap cache needs to be invalidated), it helps removing some
1682redundant code from drivers. Updated snk.c and snk68.c to take
1683advantage of the new function. [Nicola Salmoria]
16842391
1685Significant cleanup/rewrite of the MCS-48 CPU core:
1686 * renamed from i8039 to mcs48
1687 * changed to use data address space for internal RAM
1688 * added internal memory maps for variants with internal RAM/ROM
1689 * added a number of variants from documentation
1690 * removed redundant and unused definitions from header file
1691 * renamed constants and functions to be MCS48* prefixed
1692 * re-verified all opcode behaviors and timing
1693 * changed illegal opcodes to count 1 cycle to avoid infinite loops
1694 * changed EA behavior so that it is a push from the driver instead of a pull on each opcode fetch
1695    (this may change further in the future).
1696 * reimplemented IRQ generation and timer behavior according to documentation
1697 * updated all drivers accordingly
1698 * fixed several uses of PULSE_LINE, which no longer works
16992392
1700SH4, Naomi, and Hikaru updates [Samuele Zannoli]
1701 - Fixed SH-4 core to support multiple SH-4s
1702 - Fixed LDCSR instruction
1703 - Fixed SH-4 I/O ports
1704 - Skeleton Hikaru driver with memory maps and both SH-4s
1705 - Fixed JVS/Maple translation so Naomi 2 BIOS runs
2393New games marked as GAME_NOT_WORKING
2394------------------------------------
2395Joker's Wild (encrypted) [Roberto Fresca]
17062396
1707Fixed Dip Switches and Inputs for 'jcross' and 'sgladiat'. [stephh]
17082397
1709Changed slider controls into a menu. For now, removed the old direct
1710access mechanism; instead, you must access the sliders via the main
1711menu. While in the menu, you can use the ~ key to turn off the menu
1712display and leave only the bar display, in order to see more of the
1713screen. [Aaron Giles]
17142398
1715Namco NB 1/2 work: [Olivier Galibert]
1716 - Shares the memory with the c75.
1717 - Renames the c75 region to c7x from user4.
1718 - Implements the c75 reset/halt control.
1719 - Implements the irqs more correctly.
23990.128u1
2400-------
17202401
1721Small optimization to memory handling for 68000 core.
1722[Christophe Jaillet]
17232402
1724Fixed input port confusion in the 8080bw driver. Connected AVGDVG
1725status bits via PORT_CUSTOM. [Fabio Priuli]
2403MAMETesters Bugs Fixed
2404----------------------
2405- 01722: [Crash/Freeze] sokonuke: Game hangs after you choose stage.
2406         (Aaron Giles)
2407- 00468: [DIP/Input] gogomile, gogomilj: Inserting coins or pressing
2408         start has no effect at the continue screen. (Phil Bennett)
2409- 00436: [Sound] kyukaidk: Some of sound effects are wrong. Umpire's
2410         voice is most notable. Also, music is not correct.
2411         (Phil Bennett)
2412- 01702: [Gameplay] cloak + clones: Canīt pick up items (Phil Bennett)
2413- 02140: [Save/Restore] cubeqst: cube quest crashes mame when saving
2414         state (Phil Bennett)
2415- 02577: [DIP/Input] crush and clones: Broken Dips (Fabio Priuli)
2416- 00359: [Sound] blocken: Some of the enemy voices are totally wrong
2417         (Phil Bennett)
17262418
1727Updated stepper motor code to use a MAME-style config interface,
1728rather than a load of setting functions. Changed optic functions to
1729use clearly defined start and end points. Added standard layout for
1730Starpoint units used in many machines. Updated all affected drivers.
1731[James Wallace]
17322419
1733Removed useless backslashes lurking throughout the code. [Atari Ace]
17342420
1735Improvements to magic10.c driver: [Roberto Fresca]
1736 - Added Magic's 10 version 16.15
1737 - Remapped all inputs to match other poker games.
1738 - Added a missing input to Magic's 10 games.
2421Source Changes
2422--------------
2423MC6845 changes: [Curt Coder]
2424 - added cursor and display enable skewing
2425 - added preliminary support for SY6545-1's transparent addressing mode
2426 - Hsync should be pulsed even when vsync is active.
17392427
2428Removed per-game hacks from CPS3 (moved to DMA callback in SH2 core).
2429Removed Speedups from CPS3 / PsikyoSH, while they do still give a
2430decent speed boost they're not really needed with the DRC and just
2431clutter the code. [David Haywood]
17402432
2433Minor NeoGeo cleanups [JohnBoy]
17412434
2435Rewrite of the Motorola DSP56k CPU core. [Andrew Gardner]
2436 * Complete rewrite focusing on legibility and extensibility.
2437 * 27/121 opcodes (mostly) implemented.
2438 * Bugfix for reset status of interrupt priority bits.
2439 * Bugfix for disassembly of register-to-register parallel data move.
2440 * Added additional branch, move and bitfield ops.
2441 * Plygonet now passes its memory test and uploads a new program.
2442 * Implemented tst, or, jsr, rti, tst2, and 2 new movec ops.
2443 * Added opbase handler to plygonet.c
2444
2445Increase cubeqst interleave factor to eliminate LDP timeout countdown
2446flicker. [Philip Bennett]
2447
2448Added redumped B-Rap Boys sample ROMs. [Guru]
2449
2450Cleaned up STV rom loading a bit. [David Haywood]
2451
2452NamcoNBx: fixed C75 BIOS loading for big-endian targets. [R. Belmont]
2453
2454Updated tnzs.c driver: [stephh]
2455  - renamed sets :
2456      * 'tnzsjn'   -> 'tnzsj'
2457      * 'tnzsj'    -> 'tnzsjo'
2458      * 'kagekia'  -> 'kagekih'
2459  - fixed Dip Switches for all games (2 remaining unknown Dips in
2460    'plumppop' and 'jpopnics' though)
2461  - added many notes
2462
2463Small cleanups to the ST-V driver. Make some work for magzun, still
2464not working. [Angelo Salese]
2465
2466AICA: fix sample addressing for the full 8 MB [kingshriek].
2467
2468Fixed bnstars1 screens. [David Haywood]
2469
2470MCS51/I8051 overhaul, micro3d improvements and full m72 protection
2471emulation for lohtb2: [couriersud, Jim Stolis]
2472 * improved serial port timing
2473 * better infrastructure for adding more variants like DS5002
2474 * Fixed port reading
2475 * Rewrote Macros for better readibility
2476 * Fixed and rewrote Interrupt handling
2477 * Now returns INTERNAL_DIVIDER, adjusted cycle counts
2478 * Remove unnecessary and duplicated code
2479 * Remove unnecessary functions
2480 * Rewrite to have sfr-registers stored in int_ram.
2481 * Debugger may now watch sfr-registers as well.
2482 * implemented interrupt callbacks (HOLD_LINE now supported)
2483 * Runtime switch for processor type - remove ifdefs
2484 * internal memory maps for internal rom versions (internal ram now
2485    displayed in debugger)
2486 * more timer cleanups from manual
2487 * fix timer 2 interrupts
2488 * implement serial mode 2/3 rx and tx clock handling
2489 * Remaining games checked and adapted to changes in cpu core
2490 * Cardline still broken. I need the exact and complete cpu name.
2491 * Added more variants 803X, 80CXX, AT89C4051
2492 * Fix segas18.c (segaic16.c) mcu maps.
2493 * Fix sslam.c
2494 * Fix limenko.c videopkr.c : Issue with core allocation of ram (duplicate savestate)
2495
2496micro3d improvements: [couriersud]
2497 * serial port communication between main cpu and sound board works
2498 * sound board now works
2499 
2500m72 - lohtb2 improvements: [couriersud]
2501 * full emulation of protection device
2502 * Samples are now piped through the mcu
2503
2504Added sound and corrected wrong DIP-SW in the Double Dealer driver.
2505Completed protection vectors, fixed video emulation and added coin
2506setting simulation. [Angelo Salese]
2507
2508Fixed recently regressed raster interrupt issues in fuukifg*
2509drivers. [Philip Bennett]
2510
2511Added flip screen / cocktail support to yumefude driver. Completed
2512DIP-Switches (manual-wise) and made better comments. [Angelo Salese]
2513
2514Separated umk3 and breakrev from their parents. [David Haywood]
2515
2516Some reorganization in megadriv.c, porting over some code to attempt
2517to get it working again, bit by bit. [David Haywood]
2518
2519Improved dakkochn gfx; the priority are ok but there are various
2520offset so i marked also the game as "inperfect gfx". [Sonikos]
2521
2522Fixed a subtle bug in the 65c02 emulation where the result of the BIT
2523instruction differs on the 65c02 (from the 6502), when executed
2524in immediate mode. [Phill Harvey-Smith]
2525
2526Added samples suppor to Cosmic Alien. [T. Bellm]
2527
2528
2529
17422530New games added or promoted from NOT_WORKING status
17432531---------------------------------------------------
1744Aero Fighters Special (Tiawan) [smf]
1745Super Football Champ [smf]
1746Magical Date / Magical Date - dokidoki kokuhaku daisakusen [smf]
1747Fighters' Impact [smf]
1748Judge Dredd [smf]
2532(Medal) Yumefuda [Bet] [Angelo Salese]
2533Grudge Match (Yankee Game Technology) [Aaron Giles]
2534Double Dealer [Angelo Salese, David Haywood]
2535Super Megatouch IV (9255-41-07 ROG, New Jersey version)
2536  [Mariusz Wojcieszek]
2537Mirage Youjuu Mahjongden [Angelo Salese]
17492538
17502539
17512540
17522541New clones added
17532542----------------
1754Top Skater (USA) [Gerald (COY)]
1755Ikari Warriors (US) [Corrado Tomaselli]
1756Magic's 10 (ver. 16.15) [Roberto Fresca]
1757s
2543The King of Fighters 2002 (bootleg) [Kawaks]
2544Police Trainer (v1.3B Newer) [Brian Troha]
2545Egg Venture (Release 8) [Brian Troha]
2546Kick for the Goal [Brian Troha] (Not Working)
2547Fire Shark (Korea, set 1, easier) [Guru]
2548Fire Shark (Korea, set 2, harder) [Guru]
2549Seibu Cup Soccer (set 2) [Chris Hardy] (NOT WORKING)
2550
2551
2552
2553New games marked as GAME_NOT_WORKING
2554------------------------------------
2555P's Attack [Guru]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team