Previous 15994 Revisions Next

r7554 Friday 12th March, 2010 at 04:52:33 UTC by Nathan Woods
Updating to MAME 0.137; does not compile yet
[ROOT]whatsnew.txt
[docs]messnew.txt
[src/emu]clifront.c cpuexec.c cpuintrf.h devcb.c devintrf.c devintrf.h info.c memory.c profiler.c render.c rendlay.c romload.c sound.c state.h ui.c validity.c video.c
[src/emu/cpu/avr8]avr8.c
[src/emu/cpu/cdp1802]cdp1802.c
[src/emu/cpu/h83002]h8_8.c h8periph.c
[src/emu/cpu/hd6309]hd6309.c
[src/emu/cpu/i860]i860dec.c
[src/emu/cpu/m6502]m4510.c m6502.c m6509.c m65ce02.c ops02.h opsce02.h
[src/emu/cpu/m6800]m6800.c
[src/emu/cpu/m68000]m68000.h m68k_in.c m68kcpu.c m68kdasm.c
[src/emu/cpu/m6809]m6809.c
[src/emu/cpu/mcs51]mcs51.c mcs51ops.c
[src/emu/cpu/saturn]satops.c sattable.c saturn.c
[src/emu/cpu/sh2]sh2comn.c
[src/emu/cpu/sh4]sh4comn.c
[src/emu/cpu/tms32031]tms32031.c
[src/emu/cpu/tms34010]tms34010.c
[src/emu/cpu/tms7000]tms7000.c
[src/emu/cpu/unsp]unsp.c unspdasm.c
[src/emu/cpu/upd7810]7810ops.c
[src/emu/cpu/z180]z180.c z180dd.c z180ed.c z180op.c z180ops.h
[src/emu/cpu/z80]z80.c
[src/emu/cpu/z8000]z8000.c z8000ops.c
[src/emu/debug]debugcmd.c debugcmt.c debugcpu.c debugvw.c
[src/emu/machine]6522via.c 6526cia.c 6532riot.c 6821pia.c 6840ptm.c 68681.c 74123.c adc083x.c eeprom.c i8255a.c idectrl.c ins8154.c latch8.c ldcore.c pci.c z80dart.c z80dma.c z80pio.c z80sti.c
[src/emu/sound]2610intf.c ay8910.c c6280.c digitalk.c disc_sys.c discrete.c es8712.c msm5205.c okim6295.c okim6376.c pokey.c saa1099.c scsp.c sn76477.c
[src/emu/video]voodoo.c
[src/mame]mame.mak mamedriv.c
[src/mame/drivers]39in1.c 5clown.c* aristmk4.c asterix.c btime.c cclimber.c chinagat.c chsuper.c cps1.c cybertnk.c ddragon.c ddragon3.c deco_mlc.c esd16.c funworld.c galaga.c galaxold.c galdrvr.c galpani2.c galpani3.c gijoe.c goldstar.c gticlub.c hornet.c jchan.c kingdrby.c konamigx.c konamim2.c laserbat.c legionna.c lethal.c merit.c midyunit.c model3.c moo.c munchmo.c mystwarr.c namcos23.c opwolf.c plygonet.c pzletime.c rabbit.c route16.c rungun.c segas24.c simpsons.c spdodgeb.c stv.c taito_f3.c tbowl.c terracre.c tmnt.c toaplan1.c vcombat.c vendetta.c williams.c xexex.c xmen.c zr107.c
[src/mame/includes]goldstar.h munchmo.h snes.h toaplan1.h
[src/mame/machine]atari_vg.c atarigen.c decocass.c kaneko16.c mathbox.c namco06.c namcos1.c naomibd.c segas24.c snes.c toaplan1.c
[src/mame/video]cps1.c goldstar.c hng64.c konamigx.c n64.c ppu2c0x.c rdpacvg.c rdpblend.c rdpfb.c rdpfetch.c rdpfrect.c rdpmask.c rdpspn16.c rdptpipe.c rdptrect.c rdptri.c snes.c stvvdp1.c stvvdp2.c
[src/osd/sdl]video.c

src/mame/machine/decocass.c
r7553r7554
5959WRITE8_HANDLER( decocass_sound_command_w )
6060{
6161   decocass_state *state = (decocass_state *)space->machine->driver_data;
62   LOG(2,("CPU %s sound command -> $%02x\n", space->cpu->tag.cstr(), data));
62   LOG(2,("CPU %s sound command -> $%02x\n", space->cpu->tag(), data));
6363   soundlatch_w(space, 0, data);
6464   state->sound_ack |= 0x80;
6565   /* remove snd cpu data ack bit. i don't see it in the schems, but... */
r7553r7554
7070READ8_HANDLER( decocass_sound_data_r )
7171{
7272   UINT8 data = soundlatch2_r(space, 0);
73   LOG(2,("CPU %s sound data    <- $%02x\n", space->cpu->tag.cstr(), data));
73   LOG(2,("CPU %s sound data    <- $%02x\n", space->cpu->tag(), data));
7474   return data;
7575}
7676
r7553r7554
7878{
7979   decocass_state *state = (decocass_state *)space->machine->driver_data;
8080   UINT8 data = state->sound_ack;   /* D6+D7 */
81   LOG(4,("CPU %s sound ack     <- $%02x\n", space->cpu->tag.cstr(), data));
81   LOG(4,("CPU %s sound ack     <- $%02x\n", space->cpu->tag(), data));
8282   return data;
8383}
8484
8585WRITE8_HANDLER( decocass_sound_data_w )
8686{
8787   decocass_state *state = (decocass_state *)space->machine->driver_data;
88   LOG(2,("CPU %s sound data    -> $%02x\n", space->cpu->tag.cstr(), data));
88   LOG(2,("CPU %s sound data    -> $%02x\n", space->cpu->tag(), data));
8989   soundlatch2_w(space, 0, data);
9090   state->sound_ack |= 0x40;
9191}
r7553r7554
9494{
9595   decocass_state *state = (decocass_state *)space->machine->driver_data;
9696   UINT8 data = soundlatch_r(space, 0);
97   LOG(4,("CPU %s sound command <- $%02x\n", space->cpu->tag.cstr(), data));
97   LOG(4,("CPU %s sound command <- $%02x\n", space->cpu->tag(), data));
9898   cpu_set_input_line(state->audiocpu, M6502_IRQ_LINE, CLEAR_LINE);
9999   state->sound_ack &= ~0x80;
100100   return data;
r7553r7554
127127{
128128   decocass_state *state = (decocass_state *)space->machine->driver_data;
129129   UINT8 data = 0xff;
130   LOG(2,("CPU %s sound ack rst <- $%02x\n", space->cpu->tag.cstr(), data));
130   LOG(2,("CPU %s sound ack rst <- $%02x\n", space->cpu->tag(), data));
131131   state->sound_ack &= ~0x40;
132132   return data;
133133}
r7553r7554
135135WRITE8_HANDLER( decocass_sound_data_ack_reset_w )
136136{
137137   decocass_state *state = (decocass_state *)space->machine->driver_data;
138   LOG(2,("CPU %s sound ack rst -> $%02x\n", space->cpu->tag.cstr(), data));
138   LOG(2,("CPU %s sound ack rst -> $%02x\n", space->cpu->tag(), data));
139139   state->sound_ack &= ~0x40;
140140}
141141
src/mame/machine/atari_vg.c
r7553r7554
108108
109109   /* validate arguments */
110110   assert(device != NULL);
111   assert(strlen(device->tag) < 20);
112111
113112   /* set static values */
114113   earom->device = device;
src/mame/machine/namco06.c
r7553r7554
122122
123123   if (!cpu_is_suspended(state->nmicpu, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
124124   {
125      LOG(("NMI cpu '%s'\n",state->nmicpu->tag.cstr()));
125      LOG(("NMI cpu '%s'\n",state->nmicpu->tag()));
126126
127127      cpu_set_input_line(state->nmicpu, INPUT_LINE_NMI, PULSE_LINE);
128128   }
129129   else
130      LOG(("NMI not generated because cpu '%s' is suspended\n",state->nmicpu->tag.cstr()));
130      LOG(("NMI not generated because cpu '%s' is suspended\n",state->nmicpu->tag()));
131131}
132132
133133
r7553r7554
137137   UINT8 result = 0xff;
138138   int devnum;
139139
140   LOG(("%s: 06XX '%s' read offset %d\n",cpuexec_describe_context(device->machine),device->tag.cstr(),offset));
140   LOG(("%s: 06XX '%s' read offset %d\n",cpuexec_describe_context(device->machine),device->tag(),offset));
141141
142142   if (!(state->control & 0x10))
143143   {
144      logerror("%s: 06XX '%s' read in write mode %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),state->control);
144      logerror("%s: 06XX '%s' read in write mode %02x\n",cpuexec_describe_context(device->machine),device->tag(),state->control);
145145      return 0;
146146   }
147147
r7553r7554
158158   namco_06xx_state *state = get_safe_token(device);
159159   int devnum;
160160
161   LOG(("%s: 06XX '%s' write offset %d = %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),offset,data));
161   LOG(("%s: 06XX '%s' write offset %d = %02x\n",cpuexec_describe_context(device->machine),device->tag(),offset,data));
162162
163163   if (state->control & 0x10)
164164   {
165      logerror("%s: 06XX '%s' write in read mode %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),state->control);
165      logerror("%s: 06XX '%s' write in read mode %02x\n",cpuexec_describe_context(device->machine),device->tag(),state->control);
166166      return;
167167   }
168168
r7553r7554
175175READ8_DEVICE_HANDLER( namco_06xx_ctrl_r )
176176{
177177   namco_06xx_state *state = get_safe_token(device);
178   LOG(("%s: 06XX '%s' ctrl_r\n",cpuexec_describe_context(device->machine),device->tag.cstr()));
178   LOG(("%s: 06XX '%s' ctrl_r\n",cpuexec_describe_context(device->machine),device->tag()));
179179   return state->control;
180180}
181181
r7553r7554
184184   namco_06xx_state *state = get_safe_token(device);
185185   int devnum;
186186
187   LOG(("%s: 06XX '%s' control %02x\n",cpuexec_describe_context(device->machine),device->tag.cstr(),data));
187   LOG(("%s: 06XX '%s' control %02x\n",cpuexec_describe_context(device->machine),device->tag(),data));
188188
189189   state->control = data;
190190
src/mame/machine/segas24.c
r7553r7554
4949
5050READ16_HANDLER ( system24temp_sys16_io_r )
5151{
52   //  logerror("IO read %02x (%s:%x)\n", offset, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
52   //  logerror("IO read %02x (%s:%x)\n", offset, space->cpu->tag(), cpu_get_pc(space->cpu));
5353   if(offset < 8)
5454      return system24temp_sys16_io_io_r ? system24temp_sys16_io_io_r(space->machine,offset) : 0xff;
5555   else if (offset < 0x20) {
r7553r7554
6767      case 0xf:
6868         return system24temp_sys16_io_dir;
6969      default:
70         logerror("IO control read %02x (%s:%x)\n", offset, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
70         logerror("IO control read %02x (%s:%x)\n", offset, space->cpu->tag(), cpu_get_pc(space->cpu));
7171         return 0xff;
7272      }
7373   } else
r7553r7554
8585   if(ACCESSING_BITS_0_7) {
8686      if(offset < 8) {
8787         if(!(system24temp_sys16_io_dir & (1 << offset))) {
88            logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
88            logerror("IO port write on input-only port (%d, [%02x], %02x, %s:%x)\n", offset, system24temp_sys16_io_dir, data & 0xff, space->cpu->tag(), cpu_get_pc(space->cpu));
8989            return;
9090         }
9191         if(system24temp_sys16_io_io_w)
r7553r7554
101101            system24temp_sys16_io_dir = data;
102102            break;
103103         default:
104            logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
104            logerror("IO control write %02x, %02x (%s:%x)\n", offset, data & 0xff, space->cpu->tag(), cpu_get_pc(space->cpu));
105105         }
106106      }
107107   }
src/mame/machine/toaplan1.c
r7553r7554
1414#define ASSERT 1
1515
1616
17/* List of possible regions for coinage (for games with unemulated sound CPU) */
18enum {
19   TOAPLAN1_REGION_JAPAN=0,
20   TOAPLAN1_REGION_US,
21   TOAPLAN1_REGION_WORLD,
22   TOAPLAN1_REGION_OTHER
23};
24
25static UINT8 toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER+1][2][4];
26static UINT8 toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER+1][2][4];
27
28
1729static int toaplan1_coin_count; /* coin count increments on startup ? , so dont count it */
1830static int toaplan1_intenable;
19static int vimana_credits;
20static int vimana_latch;
31
2132static int demonwld_dsp_on;
2233static int demonwld_dsp_BIO;
23static int dsp_execute;                     /* Demon world */
24static UINT32 dsp_addr_w, main_ram_seg;   /* Demon world */
34static int dsp_execute;                 /* Demon world */
35static UINT32 dsp_addr_w, main_ram_seg; /* Demon world */
2536
37static UINT8 vimana_coins[2];
38static UINT8 vimana_credits;
39static UINT8 vimana_latch;
40
41
2642int toaplan1_unk_reset_port;
2743
2844UINT8 *toaplan1_sharedram;
r7553r7554
169185   return (0x80 | input_port_read(space->machine, "TJUMP")) & 0xff;
170186}
171187
172READ16_HANDLER( vimana_input_port_5_word_r )
188READ16_HANDLER ( vimana_system_port_r )
173189{
174   int data, p;
190   int data, p, r, d, slot, reg, dsw;
175191
192    UINT8 vimana_region[16] = { TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_US   , TOAPLAN1_REGION_WORLD, TOAPLAN1_REGION_JAPAN,
193                         TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_US   ,
194                         TOAPLAN1_REGION_JAPAN, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER,
195                         TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_OTHER, TOAPLAN1_REGION_JAPAN };
196
197   slot = -1;
198   d = input_port_read(space->machine, "DSWA");
199   r = input_port_read(space->machine, "TJUMP");
176200   p = input_port_read(space->machine, "SYSTEM");
177201   vimana_latch ^= p;
178   data = (vimana_latch & p );
202   data = (vimana_latch & p);
179203
180   /* simulate the mcu keeping track of credits */
181   /* latch so it doesn't add more than one */
182   /* credit per keypress */
183   if (data & 0x18)
204   /* simulate the mcu keeping track of credits based on region and coinage settings */
205   /* latch so it doesn't add more than one coin per keypress */
206   if (d & 0x04)   /* "test mode" ON */
184207   {
185      vimana_credits++ ;
208      vimana_coins[0] = vimana_coins[1] = 0;
209      vimana_credits = 0;
186210   }
211   else            /* "test mode" OFF */
212   {
213      if (data & 0x02)      /* TILT */
214      {
215         vimana_coins[0] = vimana_coins[1] = 0;
216         vimana_credits = 0;
217      }
218      if (data & 0x01)      /* SERVICE1 */
219      {
220         vimana_credits++ ;
221      }
222      if (data & 0x08)      /* COIN1 */
223      {
224         slot = 0;
225      }
226      if (data & 0x10)      /* COIN2 */
227      {
228         slot = 1 ;
229      }
230
231      if (slot != -1)
232      {
233         reg = vimana_region[r];
234         dsw = (d & 0xf0) >> (4 + 2 * slot);
235         vimana_coins[slot]++;
236         if (vimana_coins[slot] >= toaplan1_coins_for_credit[reg][slot][dsw])
237         {
238            vimana_credits += toaplan1_credits_for_coin[reg][slot][dsw];
239            vimana_coins[slot] -= toaplan1_coins_for_credit[reg][slot][dsw];
240         }
241         coin_counter_w(space->machine, slot, 1);
242         coin_counter_w(space->machine, slot, 0);
243      }
244
245      if (vimana_credits >= 9)
246         vimana_credits = 9;
247   }
248
249   coin_lockout_global_w(space->machine, (vimana_credits >= 9));
250
187251   vimana_latch = p;
188252
189253   return p & 0xffff;
r7553r7554
195259   switch (offset)
196260   {
197261      case 0:  data = 0xff; break;
198      case 1:  data = 0; break;
262      case 1:  data = 0x00; break;
199263      case 2:  data = vimana_credits; break;
200264   }
201265   return data & 0xff;
r7553r7554
205269{
206270   switch (offset)
207271   {
208      case 0:  break;
209      case 1:  break;
210      case 2:  if (ACCESSING_BITS_0_7) vimana_credits = data & 0xff; break;
272      case 0:   break;
273      case 1:   break;
274      case 2:   if (ACCESSING_BITS_0_7)
275            {
276               vimana_credits = data & 0xff;
277               coin_lockout_global_w(space->machine, (vimana_credits >= 9));
278            }
279            break;
211280   }
212281}
213282
r7553r7554
297366}
298367
299368
369void toaplan1_init_coinage_tables(running_machine *machine)
370{
371   /* Japan */
372   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][0][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][0][0] = 1;
373   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][0][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][0][1] = 2;
374   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][0][2] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][0][2] = 1;
375   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][0][3] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][0][3] = 3;
376   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][1][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][1][0] = 1;
377   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][1][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][1][1] = 2;
378   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][1][2] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][1][2] = 1;
379   toaplan1_coins_for_credit[TOAPLAN1_REGION_JAPAN][1][3] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_JAPAN][1][3] = 3;
380   /* US = Japan */
381   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][0][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][0][0] = 1;
382   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][0][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][0][1] = 2;
383   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][0][2] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][0][2] = 1;
384   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][0][3] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][0][3] = 3;
385   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][1][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][1][0] = 1;
386   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][1][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][1][1] = 2;
387   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][1][2] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][1][2] = 1;
388   toaplan1_coins_for_credit[TOAPLAN1_REGION_US   ][1][3] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_US   ][1][3] = 3;
389   /* World */
390   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][0][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][0][0] = 1;
391   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][0][1] = 2; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][0][1] = 1;
392   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][0][2] = 3; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][0][2] = 1;
393   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][0][3] = 4; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][0][3] = 1;
394   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][1][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][1][0] = 2;
395   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][1][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][1][1] = 3;
396   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][1][2] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][1][2] = 4;
397   toaplan1_coins_for_credit[TOAPLAN1_REGION_WORLD][1][3] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_WORLD][1][3] = 6;
398   /* Other - as it is an unknown or invalid setting, I set everything to 1C_1C */
399   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][0][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][0][0] = 1;
400   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][0][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][0][1] = 1;
401   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][0][2] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][0][2] = 1;
402   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][0][3] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][0][3] = 1;
403   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][1][0] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][1][0] = 1;
404   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][1][1] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][1][1] = 1;
405   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][1][2] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][1][2] = 1;
406   toaplan1_coins_for_credit[TOAPLAN1_REGION_OTHER][1][3] = 1; toaplan1_credits_for_coin[TOAPLAN1_REGION_OTHER][1][3] = 1;
407}
408
300409MACHINE_RESET( toaplan1 )
301410{
302411   toaplan1_intenable = 0;
r7553r7554
337446MACHINE_RESET( vimana )
338447{
339448   MACHINE_RESET_CALL(toaplan1);
449   toaplan1_init_coinage_tables(machine);
450   vimana_coins[0] = vimana_coins[1] = 0;
340451   vimana_credits = 0;
341452   vimana_latch = 0;
342453}
343454void vimana_driver_savestate(running_machine *machine)
344455{
456   state_save_register_global(machine, vimana_coins[0]);
457   state_save_register_global(machine, vimana_coins[1]);
345458   state_save_register_global(machine, vimana_credits);
346459   state_save_register_global(machine, vimana_latch);
347460}
src/mame/machine/namcos1.c
r7553r7554
9999
100100static READ8_HANDLER( no_key_r )
101101{
102   popmessage("CPU %s PC %08x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
102   popmessage("CPU %s PC %08x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
103103   return 0;
104104}
105105
106106static WRITE8_HANDLER( no_key_w )
107107{
108   popmessage("CPU %s PC %08x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
108   popmessage("CPU %s PC %08x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
109109}
110110
111111
r7553r7554
210210*/
211211static READ8_HANDLER( key_type1_r )
212212{
213//  logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
213//  logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
214214
215215   if (offset < 3)
216216   {
r7553r7554
241241
242242static WRITE8_HANDLER( key_type1_w )
243243{
244//  logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
244//  logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
245245
246246   if (offset < 4)
247247      key[offset] = data;
r7553r7554
393393
394394static READ8_HANDLER( key_type2_r )
395395{
396//  logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
396//  logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
397397
398398   key_numerator_high_word = 0;
399399
r7553r7554
412412
413413static WRITE8_HANDLER( key_type2_w )
414414{
415//  logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
415//  logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
416416
417417   if (offset < 5)
418418   {
r7553r7554
521521{
522522   int op;
523523
524//  logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
524//  logerror("CPU %s PC %04x: keychip read %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
525525
526526   /* I need to handle blastoff's read from 0858. The game previously writes to 0858,
527527       using it as temporary storage, so maybe it expects to act as RAM, however
r7553r7554
537537   if (op == key_bottom4)   return (offset << 4) | (key[key_swap4_arg] & 0x0f);
538538   if (op == key_top4)      return (offset << 4) | (key[key_swap4_arg] >> 4);
539539
540   popmessage("CPU %s PC %08x: keychip read %04x", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
540   popmessage("CPU %s PC %08x: keychip read %04x", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
541541
542542   return 0;
543543}
544544
545545static WRITE8_HANDLER( key_type3_w )
546546{
547//  logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, data);
547//  logerror("CPU %s PC %04x: keychip write %04x=%02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, data);
548548
549549   key[(offset & 0x70) >> 4] = data;
550550}
r7553r7554
647647
648648static WRITE8_HANDLER( rom_w )
649649{
650   logerror("CPU %s PC %04x: warning - write %02x to rom address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
650   logerror("CPU %s PC %04x: warning - write %02x to rom address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
651651}
652652
653653/* error handlers */
654654static READ8_HANDLER( unknown_r )
655655{
656   logerror("CPU %s PC %04x: warning - read from unknown chip\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
657//  popmessage("CPU %s PC %04x: read from unknown chip", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
656   logerror("CPU %s PC %04x: warning - read from unknown chip\n", space->cpu->tag(), cpu_get_pc(space->cpu) );
657//  popmessage("CPU %s PC %04x: read from unknown chip", space->cpu->tag(), cpu_get_pc(space->cpu) );
658658   return 0;
659659}
660660
661661static WRITE8_HANDLER( unknown_w )
662662{
663   logerror("CPU %s PC %04x: warning - wrote to unknown chip\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
664//  popmessage("CPU %s PC %04x: wrote to unknown chip", space->cpu->tag.cstr(), cpu_get_pc(space->cpu) );
663   logerror("CPU %s PC %04x: warning - wrote to unknown chip\n", space->cpu->tag(), cpu_get_pc(space->cpu) );
664//  popmessage("CPU %s PC %04x: wrote to unknown chip", space->cpu->tag(), cpu_get_pc(space->cpu) );
665665}
666666
667667/* Main bankswitching routine */
r7553r7554
737737
738738WRITE8_HANDLER( namcos1_bankswitch_w )
739739{
740//  logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag.cstr(), offset, data);
740//  logerror("cpu %s: namcos1_bankswitch_w offset %04x data %02x\n", space->cpu->tag(), offset, data);
741741
742742   namcos1_bankswitch(space->machine, (space->cpu == devtag_get_device(space->machine, "maincpu")) ? 0 : 1, offset, data);
743743}
src/mame/machine/snes.c
r7553r7554
769769   {
770770      case INIDISP:   /* Initial settings for screen */
771771         if ((snes_ppu.screen_disabled & 0x80) && (!(data & 0x80))) //a 1->0 force blank transition causes a reset OAM address
772         {   
772         {
773773            memory_write_byte(space, OAMADDL, snes_ppu.oam.saved_address_low);
774774            memory_write_byte(space, OAMADDH, snes_ppu.oam.saved_address_high);
775775         }
r7553r7554
809809                  default:
810810                     /* Unknown size so default to 8 & 16 */
811811                     logerror("Object size unsupported: %d\n", (data & 0xe0) >> 5);
812     
812
813813                     snes_ppu.oam.size[0] = 1;
814814                     snes_ppu.oam.size[1] = 2;
815815            break;
src/mame/machine/atarigen.c
r7553r7554
7070      if (state->screen_timer[i].screen == screen)
7171         return &state->screen_timer[i];
7272
73   fatalerror("Unexpected: no atarivc_eof_update_timer for screen '%s'\n", screen->tag.cstr());
73   fatalerror("Unexpected: no atarivc_eof_update_timer for screen '%s'\n", screen->tag());
7474   return NULL;
7575}
7676
src/mame/machine/naomibd.c
r7553r7554
17531753   }
17541754
17551755   /* set the type */
1756   v->index = device->machine->devicelist.index(device->type, device->tag);
1756   v->index = device->machine->devicelist.index(device->type, device->tag());
17571757   v->type = config->type;
17581758
17591759   /* initialize some registers */
src/mame/machine/mathbox.c
r7553r7554
320320
321321   /* validate arguments */
322322   assert(device != NULL);
323   assert(strlen(device->tag) < 20);
324323
325324   /* set static values */
326325   mb->device = device;
src/mame/machine/kaneko16.c
r7553r7554
24252425*/
24262426READ16_HANDLER( toybox_mcu_status_r )
24272427{
2428   logerror("CPU %s (PC=%06X) : read MCU status\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu));
2428   logerror("CPU %s (PC=%06X) : read MCU status\n", space->cpu->tag(), cpu_get_previouspc(space->cpu));
24292429   return 0; // most games test bit 0 for failure
24302430}
24312431
src/mame/mamedriv.c
r7553r7554
932932   DRIVER( timecrs2b )   /* (c) 1997 */
933933   DRIVER( timecrs2c )   /* (c) 1997 */
934934   DRIVER( panicprk )   /* (c) 1998 */
935   DRIVER( gunwars )   /* (c) 1998 */
935936   DRIVER( 500gp )      /* (c) 1999 */
936937   DRIVER( finfurl2 )   /* (c) 1999 */
937938   DRIVER( finfurl2j )   /* (c) 1999 */
r7553r7554
26932694   DRIVER( dinoj )      /* 01/02/1993 (c) 1993 (Japan) (CPS1 + QSound) */
26942695   DRIVER( dinopic )   /* bootleg */
26952696   DRIVER( dinopic2 )   /* bootleg */
2697   DRIVER( dinohunt )   /* bootleg */
26962698   DRIVER( punisher )   /* 22/04/1993 (c) 1993 (World) (CPS1 + QSound) */
26972699   DRIVER( punisheru )   /* 22/04/1993 (c) 1993 (US)    (CPS1 + QSound) */
26982700   DRIVER( punisherj )   /* 22/04/1993 (c) 1993 (Japan) (CPS1 + QSound) */
26992701   DRIVER( punipic )   /* bootleg */
27002702   DRIVER( punipic2 )   /* bootleg */
27012703   DRIVER( punipic3 )   /* bootleg */
2704   DRIVER( punisherbz )/* bootleg */
27022705   DRIVER( slammast )   /* 13/07/1993 (c) 1993 (World) (CPS1 + QSound) */
27032706   DRIVER( slammastu )   /* 13/07/1993 (c) 1993 (US)    (CPS1 + QSound) */
27042707   DRIVER( mbomberj )   /* 13/07/1993 (c) 1993 (Japan) (CPS1 + QSound) */
r7553r7554
51715174   DRIVER( skullfng )   /* MCH (c) 1996 Data East Corporation (World) */
51725175   DRIVER( skullfngj )   /* MCH (c) 1996 Data East Corporation (Japan) */
51735176   DRIVER( stadhr96 )   /* MCM (c) 1996 Data East */
5174   DRIVER( stadhr96a )   /* MCM (c) 1996 Data East */
5177   DRIVER( stadhr96j )   /* MCM (c) 1996 Data East */
51755178
51765179   /* Tehkan / Tecmo games (Tehkan became Tecmo in 1986) */
51775180   DRIVER( senjyo )   /* (c) 1983 Tehkan */
r7553r7554
56915694   DRIVER( windheat )   /* GX677 (c)1996 */
56925695   DRIVER( windheatu )   /* GX677 (c)1996 */
56935696   DRIVER( windheatj )   /* GX677 (c)1996 */
5694   DRIVER( jetwave )   /* GX678 (c)1996 */
5697   DRIVER( waveshrk )   /* GX678 (c)1996 */
56955698
56965699   /* Konami M2 games */
56975700   DRIVER( polystar )   /* GX623 (c)1997 */
r7553r7554
68886891   DRIVER( smashtv6 )   /* (c) 1990 Williams */
68896892   DRIVER( smashtv5 )   /* (c) 1990 Williams */
68906893   DRIVER( smashtv4 )   /* (c) 1990 Williams */
6894   DRIVER( smashtv3 )   /* (c) 1990 Williams */
68916895   DRIVER( hiimpact )   /* (c) 1990 Williams */
68926896   DRIVER( hiimpact4 )   /* (c) 1990 Williams */
68936897   DRIVER( hiimpact3 )   /* (c) 1990 Williams */
r7553r7554
82538257   DRIVER( stellecu )   /* (c) 1998 */
82548258   DRIVER( iqblock )   /* (c) 1993 */
82558259   DRIVER( grndtour )   /* (c) 1993 */
8260   DRIVER( 5clown )   /* (c) IGS 1993 */
8261   DRIVER( 5clowna )   /* (c) IGS 1993 */
8262   DRIVER( 5clownsp )   /* (c) IGS 1993 */
82568263
82578264   /* IGS005 + IGS006 + IGS007 + IGS008 Games */
82588265   DRIVER( lordgun )   /* (c) 1994 */
r7553r7554
90729079   DRIVER( vegasfte )   /* (c) 1993 Soft Design */
90739080   DRIVER( jolyjokr )   /* (c) 198? Impera */
90749081   DRIVER( jolyjokra )   /* (c) 198? Impera */
9082   DRIVER( jolyjokrb )   /* (c) 198? Impera */
90759083   DRIVER( jokercrd )   /* (c) 1993 Vesely Svet */
90769084   DRIVER( mongolnw )   /* 199? bootleg */
90779085   DRIVER( soccernw )   /* 199? bootleg */
r7553r7554
94479455   DRIVER( cmfun )      /* (c) 1995 Dyna Electronics */
94489456   DRIVER( cmaster )   /* (c) 1991 Dyna Electronics */
94499457   DRIVER( cmasterb )   /* (c) 1991 Dyna Electronics */
9458   DRIVER( cmezspin )   /* (c) 1991 Dyna Electronics */
94509459   DRIVER( cmasterc )   /* (c) 1991 Dyna Electronics */
94519460   DRIVER( cmasterbv )   /* (c) 1991 Dyna Electronics / Gerald Duhamel?*/
94529461   DRIVER( cmasterd )   /* (c) 1991 Dyna Electronics */
r7553r7554
94549463   DRIVER( cmasterf )   /* (c) 1991 Dyna Electronics */
94559464   DRIVER( cmast91 )   /* (c) 1991 Dyna Electronics */
94569465   DRIVER( cmast92 )   /* (c) 1992 Dyna Electronics */
9466
9467   DRIVER( jkrmast )   /* (c) 199? unknown */
9468   DRIVER( pkrmast )   /* (c) 199? unknown */
9469   DRIVER( pkrmasta )   /* (c) 199? unknown */
9470
94579471   DRIVER( cb2001 )   /* (c) 2001 Dyna Electronics */
94589472   DRIVER( scherrym )   /* (c) 2001? Dyna Electronics */
94599473
src/mame/includes/goldstar.h
r7553r7554
2222   UINT8 *reel2_ram;
2323   UINT8 *reel3_ram;
2424
25   /* reelx_attrram for unkch sets */
26   UINT8 *reel1_attrram;
27   UINT8 *reel2_attrram;
28   UINT8 *reel3_attrram;
29   UINT8 unkch_vidreg;
30
2531   tilemap_t *reel1_tilemap;
2632   tilemap_t *reel2_tilemap;
2733   tilemap_t *reel3_tilemap;
r7553r7554
3238   UINT8 cmaster_girl_pal;
3339   UINT8 cm_enable_reg;
3440   UINT8 cm_girl_scroll;
41   UINT8 lucky8_nmi_enable;
42   int tile_bank;
43
3544};
3645
3746
r7553r7554
4150WRITE8_HANDLER( goldstar_reel2_ram_w );
4251WRITE8_HANDLER( goldstar_reel3_ram_w );
4352
53WRITE8_HANDLER( unkch_reel1_attrram_w );
54WRITE8_HANDLER( unkch_reel2_attrram_w );
55WRITE8_HANDLER( unkch_reel3_attrram_w );
56
4457WRITE8_HANDLER( goldstar_fg_vidram_w );
4558WRITE8_HANDLER( goldstar_fg_atrram_w );
4659WRITE8_HANDLER( cm_girl_scroll_w );
r7553r7554
5063WRITE8_HANDLER( cm_outport0_w );
5164VIDEO_START( goldstar );
5265VIDEO_START( cherrym );
66VIDEO_START( unkch );
67VIDEO_START( magical );
5368VIDEO_UPDATE( goldstar );
5469VIDEO_UPDATE( cmast91 );
5570VIDEO_UPDATE( amcoe1a );
71VIDEO_UPDATE( unkch );
72VIDEO_UPDATE( magical );
src/mame/includes/toaplan1.h
r7553r7554
1818WRITE16_HANDLER( demonwld_dsp_ctrl_w );
1919READ16_HANDLER ( demonwld_BIO_r );
2020READ16_HANDLER ( samesame_port_6_word_r );
21READ16_HANDLER ( vimana_system_port_r );
2122READ16_HANDLER ( vimana_mcu_r );
2223WRITE16_HANDLER( vimana_mcu_w );
23READ16_HANDLER ( vimana_input_port_5_word_r );
2424
2525WRITE8_HANDLER( rallybik_coin_w );
2626WRITE8_HANDLER( toaplan1_coin_w );
src/mame/includes/snes.h
r7553r7554
2323#define DOTCLK_NTSC   (MCLK_NTSC/4)
2424#define DOTCLK_PAL   (MCLK_PAL/4)
2525
26#define SNES_LAYER_DEBUG  1
26#define SNES_LAYER_DEBUG 
2727
2828/* Debug definitions */
2929#ifdef MAME_DEBUG
src/mame/includes/munchmo.h
r7553r7554
2727   /* misc */
2828   int          nmi_enable;
2929   int          which;
30   UINT8        sound_nmi_enable;
3031
3132   /* devices */
3233   running_device *maincpu;
src/mame/mame.mak
r7553r7554
14781478   $(DRIVERS)/3super8.o \
14791479   $(DRIVERS)/4enraya.o $(VIDEO)/4enraya.o \
14801480   $(DRIVERS)/4roses.o \
1481   $(DRIVERS)/5clown.o \
14811482   $(DRIVERS)/acefruit.o \
14821483   $(DRIVERS)/adp.o \
14831484   $(DRIVERS)/amaticmg.o \
src/mame/video/stvvdp1.c
r7553r7554
192192
193193//  x ^= 0x00020000;
194194
195   logerror ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset);
195   logerror ("cpu %s (PC=%08X) VDP1: Read from Registers, Offset %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset);
196196//  if (offset == 0x04) return x;
197197
198198   return stv_vdp1_regs[offset];
r7553r7554
348348
349349//  if (((offset * 4) > 0xdf) && ((offset * 4) < 0x140))
350350//  {
351//      logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset*4, data, mem_mask);
351//      logerror("cpu %s (PC=%08X): VRAM dword write to %08X = %08X & %08X\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset*4, data, mem_mask);
352352//  }
353353
354354   data = stv_vdp1_vram[offset];
src/mame/video/rdpfrect.c
r7553r7554
1010   UINT8* hb = &hidden_bits[fb_address >> 1];
1111
1212   int index, i, j;
13   int x1 = rect->xh / 4;
14   int x2 = rect->xl / 4;
15   int y1 = rect->yh / 4;
16   int y2 = rect->yl / 4;
17   int clipx1, clipx2, clipy1, clipy2;
13   int x1 = rect->xh;
14   int x2 = rect->xl;
15   int y1 = rect->yh;
16   int y2 = rect->yl;
1817   UINT16 fill_color1, fill_color2;
1918   int fill_cvg1;
2019   int fill_cvg2;
r7553r7554
3433   fill_cvg1 = (fill_color1 & 1) ? 8 : 1;
3534   fill_cvg2 = (fill_color2 & 1) ? 8 : 1;
3635
37   clipx1 = clip.xh / 4;
38   clipx2 = clip.xl / 4;
39   clipy1 = clip.yh / 4;
40   clipy2 = clip.yl / 4;
41
4236   // clip
43   if (x1 < clipx1)
37   if (x1 < clip.xh)
4438   {
45      x1 = clipx1;
39      x1 = clip.xh;
4640   }
47   if (y1 < clipy1)
41   if (y1 < clip.yh)
4842   {
49      y1 = clipy1;
43      y1 = clip.yh;
5044   }
51   if (x2 >= clipx2)
45   if (x2 >= clip.xl)
5246   {
53      x2 = clipx2-1;
47      x2 = clip.xl - 1;
5448   }
55   if (y2 >= clipy2)
49   if (y2 >= clip.yl)
5650   {
57      y2 = clipy2-1;
51      y2 = clip.yl - 1;
5852   }
5953
6054   shade_color.c = 0;   // Needed by Command & Conquer menus
r7553r7554
114108   UINT8* hb = &hidden_bits[fb_address >> 1];
115109
116110   int index, i, j;
117   int x1 = rect->xh / 4;
118   int x2 = rect->xl / 4;
119   int y1 = rect->yh / 4;
120   int y2 = rect->yl / 4;
121   int clipx1, clipx2, clipy1, clipy2;
111   int x1 = rect->xh;
112   int x2 = rect->xl;
113   int y1 = rect->yh;
114   int y2 = rect->yl;
122115   UINT16 fill_color1, fill_color2;
123116   int fill_cvg1;
124117   int fill_cvg2;
r7553r7554
138131   fill_cvg1 = (fill_color1 & 1) ? 8 : 1;
139132   fill_cvg2 = (fill_color2 & 1) ? 8 : 1;
140133
141   clipx1 = clip.xh / 4;
142   clipx2 = clip.xl / 4;
143   clipy1 = clip.yh / 4;
144   clipy2 = clip.yl / 4;
145
146134   // clip
147   if (x1 < clipx1)
135   if (x1 < clip.xh)
148136   {
149      x1 = clipx1;
137      x1 = clip.xh;
150138   }
151   if (y1 < clipy1)
139   if (y1 < clip.yh)
152140   {
153      y1 = clipy1;
141      y1 = clip.yh;
154142   }
155   if (x2 >= clipx2)
143   if (x2 >= clip.xl)
156144   {
157      x2 = clipx2-1;
145      x2 = clip.xl - 1;
158146   }
159   if (y2 >= clipy2)
147   if (y2 >= clip.yl)
160148   {
161      y2 = clipy2-1;
149      y2 = clip.yl - 1;
162150   }
163151
164152   shade_color.c = 0;   // Needed by Command & Conquer menus
r7553r7554
223211   UINT8* hb = &hidden_bits[fb_address >> 1];
224212
225213   int index, i, j;
226   int x1 = rect->xh / 4;
227   int x2 = rect->xl / 4;
228   int y1 = rect->yh / 4;
229   int y2 = rect->yl / 4;
230   int clipx1, clipx2, clipy1, clipy2;
214   int x1 = rect->xh;
215   int x2 = rect->xl;
216   int y1 = rect->yh;
217   int y2 = rect->yl;
231218   UINT16 fill_color1, fill_color2;
232219   int fill_cvg1;
233220   int fill_cvg2;
r7553r7554
247234   fill_cvg1 = (fill_color1 & 1) ? 8 : 1;
248235   fill_cvg2 = (fill_color2 & 1) ? 8 : 1;
249236
250   clipx1 = clip.xh / 4;
251   clipx2 = clip.xl / 4;
252   clipy1 = clip.yh / 4;
253   clipy2 = clip.yl / 4;
254
255237   // clip
256   if (x1 < clipx1)
238   if (x1 < clip.xh)
257239   {
258      x1 = clipx1;
240      x1 = clip.xh;
259241   }
260   if (y1 < clipy1)
242   if (y1 < clip.yh)
261243   {
262      y1 = clipy1;
244      y1 = clip.yh;
263245   }
264   if (x2 >= clipx2)
246   if (x2 >= clip.xl)
265247   {
266      x2 = clipx2-1;
248      x2 = clip.xl - 1;
267249   }
268   if (y2 >= clipy2)
250   if (y2 >= clip.yl)
269251   {
270      y2 = clipy2-1;
252      y2 = clip.yl - 1;
271253   }
272254
273255   shade_color.c = 0;   // Needed by Command & Conquer menus
src/mame/video/stvvdp2.c
r7553r7554
53655365         h_count = video_screen_get_hpos(space->machine->primary_screen) & 0x3ff;
53665366         v_count = video_screen_get_vpos(space->machine->primary_screen) & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
53675367         stv_vdp2_regs[offset] = (h_count<<16)|(v_count);
5368         if(LOG_VDP2) logerror("CPU %s PC(%08x) = VDP2: H/V counter read : %08x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu),stv_vdp2_regs[offset]);
5368         if(LOG_VDP2) logerror("CPU %s PC(%08x) = VDP2: H/V counter read : %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),stv_vdp2_regs[offset]);
53695369         break;
53705370      }
53715371   }
src/mame/video/rdpfetch.c
r7553r7554
11INLINE UINT32 FETCH_TEXEL_RGBA4_TLUT_EN0(UINT32 s, UINT32 t)
22{
3   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
4   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
3   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
4   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
55   return rgb16_to_32_lut[tlut[((cached_tpal | p) ^ WORD_ADDR_XOR) << 2]];
66}
77
88INLINE UINT32 FETCH_TEXEL_RGBA4_TLUT_EN1(UINT32 s, UINT32 t)
99{
10   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
11   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
10   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
11   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
1212   return ia8_to_32_lut[tlut[((cached_tpal | p) ^ WORD_ADDR_XOR) << 2]];
1313}
1414
1515INLINE UINT32 FETCH_TEXEL_RGBA4_TLUT_NEN(UINT32 s, UINT32 t)
1616{
17   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
18   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
17   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
18   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
1919
2020   return (cached_tpal | p) * 0x01010101;
2121}
2222
2323INLINE UINT32 FETCH_TEXEL_RGBA8_TLUT_EN0(UINT32 s, UINT32 t)
2424{
25   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
25   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
2626   return rgb16_to_32_lut[tlut[(TMEM[taddr ^ BYTE_ADDR_XOR] ^ WORD_ADDR_XOR) << 2]];
2727}
2828
2929INLINE UINT32 FETCH_TEXEL_RGBA8_TLUT_EN1(UINT32 s, UINT32 t)
3030{
31   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
31   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
3232   return ia8_to_32_lut[tlut[(TMEM[taddr ^ BYTE_ADDR_XOR] ^ WORD_ADDR_XOR) << 2]];
3333}
3434
3535INLINE UINT32 FETCH_TEXEL_RGBA8_TLUT_NEN(UINT32 s, UINT32 t)
3636{
37   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
37   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
3838   return TMEM[taddr ^ BYTE_ADDR_XOR] * 0x01010101;
3939}
4040
4141INLINE UINT32 FETCH_TEXEL_RGBA16_TLUT_EN0(UINT32 s, UINT32 t)
4242{
43   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + (s))  ^ ((t & 1) ? XOR_SWAP_WORD : 0);
43   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + s)  ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
4444   return rgb16_to_32_lut[tlut[(TMEM16[(taddr & 0x7ff) ^ WORD_ADDR_XOR] >> 8) << 2]];
4545}
4646
4747INLINE UINT32 FETCH_TEXEL_RGBA16_TLUT_EN1(UINT32 s, UINT32 t)
4848{
49   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + (s))  ^ ((t & 1) ? XOR_SWAP_WORD : 0);
49   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + s)  ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
5050   return ia8_to_32_lut[tlut[(TMEM16[(taddr & 0x7ff) ^ WORD_ADDR_XOR] >> 8) << 2]];
5151}
5252
5353INLINE UINT32 FETCH_TEXEL_RGBA16_TLUT_NEN(UINT32 s, UINT32 t)
5454{
55   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + (s))  ^ ((t & 1) ? XOR_SWAP_WORD : 0);
55   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + s)  ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
5656   return rgb16_to_32_lut[TMEM16[(taddr & 0x7ff) ^ WORD_ADDR_XOR]];
5757}
5858
5959INLINE UINT32 FETCH_TEXEL_RGBA32_TLUT_EN0(UINT32 s, UINT32 t)
6060{
6161   int xorval = (fb_size == PIXEL_SIZE_16BIT) ? XOR_SWAP_WORD : XOR_SWAP_DWORD; // Conker's Bad Fur Day, Jet Force Gemini, Super Smash Bros., Mickey's Speedway USA, Ogre Battle, Wave Race, Gex 3, South Park Rally
62   UINT32 taddr = (((cached_tbase >> 2) + ((t) * (cached_twidth >> 1)) + (s)) ^ ((t & 1) ? xorval : 0)) & 0x3ff;
62   UINT32 taddr = (((cached_tbase >> 2) + ((t) * (cached_twidth >> 1)) + s) ^ ((t & 1) ? xorval : 0)) & 0x3ff;
6363
6464   return rgb16_to_32_lut[tlut[(TMEM32[taddr] >> 24) << 2]];
6565}
r7553r7554
6767INLINE UINT32 FETCH_TEXEL_RGBA32_TLUT_EN1(UINT32 s, UINT32 t)
6868{
6969   int xorval = (fb_size == PIXEL_SIZE_16BIT) ? XOR_SWAP_WORD : XOR_SWAP_DWORD; // Conker's Bad Fur Day, Jet Force Gemini, Super Smash Bros., Mickey's Speedway USA, Ogre Battle, Wave Race, Gex 3, South Park Rally
70   UINT32 taddr = (((cached_tbase >> 2) + ((t) * (cached_twidth >> 1)) + (s)) ^ ((t & 1) ? xorval : 0)) & 0x3ff;
70   UINT32 taddr = (((cached_tbase >> 2) + ((t) * (cached_twidth >> 1)) + s) ^ ((t & 1) ? xorval : 0)) & 0x3ff;
7171
7272   return ia8_to_32_lut[tlut[(TMEM32[taddr] >> 24) << 2]];
7373}
r7553r7554
7575INLINE UINT32 FETCH_TEXEL_RGBA32_TLUT_NEN(UINT32 s, UINT32 t)
7676{
7777   int xorval = (fb_size == PIXEL_SIZE_16BIT) ? XOR_SWAP_WORD : XOR_SWAP_DWORD; // Conker's Bad Fur Day, Jet Force Gemini, Super Smash Bros., Mickey's Speedway USA, Ogre Battle, Wave Race, Gex 3, South Park Rally
78   UINT32 taddr = (((cached_tbase >> 2) + ((t) * (cached_twidth >> 1)) + (s)) ^ ((t & 1) ? xorval : 0)) & 0x3ff;
78   UINT32 taddr = (((cached_tbase >> 2) + ((t) * (cached_twidth >> 1)) + s) ^ ((t & 1) ? xorval : 0)) & 0x3ff;
7979
8080   return TMEM32[taddr];
8181}
r7553r7554
8585   INT32 newr = 0;
8686   INT32 newg = 0;
8787   INT32 newb = 0;
88   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth)) + (s)) ^ ((t & 1) ? XOR_SWAP_WORD : 0);
88   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth)) + s) ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
8989   UINT32 c1, c2;
9090   INT32 y;
9191   INT32 u, v;
r7553r7554
113113      newg = y + ((k1 * u) >> 8) + ((k2 * v) >> 8);
114114      newb = y + ((k3 * u) >> 8);
115115   }
116
116117   return (((newr < 0) ? 0 : ((newr > 0xff) ? 0xff : newr)) << 24) |
117118          (((newg < 0) ? 0 : ((newg > 0xff) ? 0xff : newg)) << 16) |
118119          (((newb < 0) ? 0 : ((newb > 0xff) ? 0xff : newb)) <<  8) |
r7553r7554
121122
122123INLINE UINT32 FETCH_TEXEL_CI4_TLUT_EN0(UINT32 s, UINT32 t)
123124{
124   UINT32 b = TMEM[(((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff) ^ BYTE_ADDR_XOR];
125   return rgb16_to_32_lut[tlut[(cached_tpal | (((s) & 1) ? (b & 0xf) : (b >> 4))) << 2]];
125   UINT32 b = TMEM[(((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff) ^ BYTE_ADDR_XOR];
126   return rgb16_to_32_lut[tlut[(cached_tpal | ((b >> ((s & 1) << 2)) & 0xf)) << 2]];
126127}
127128
128129INLINE UINT32 FETCH_TEXEL_CI4_TLUT_EN1(UINT32 s, UINT32 t)
129130{
130   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
131   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
131   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
132   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
132133   return ia8_to_32_lut[tlut[(cached_tpal | p) << 2]];
133134}
134135
135136INLINE UINT32 FETCH_TEXEL_CI4_TLUT_NEN(UINT32 s, UINT32 t)
136137{
137   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
138   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
138   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
139   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
139140
140141   return (cached_tpal | p) * 0x01010101;
141142}
142143
143144INLINE UINT32 FETCH_TEXEL_CI8_TLUT_EN0(UINT32 s, UINT32 t)
144145{
145   return rgb16_to_32_lut[tlut[TMEM[(((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff) ^ BYTE_ADDR_XOR] << 2]];
146   return rgb16_to_32_lut[tlut[TMEM[(((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff) ^ BYTE_ADDR_XOR] << 2]];
146147}
147148
148149INLINE UINT32 FETCH_TEXEL_CI8_TLUT_EN1(UINT32 s, UINT32 t)
149150{
150   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
151   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
151152   return ia8_to_32_lut[tlut[TMEM[taddr ^ BYTE_ADDR_XOR] << 2]];
152153}
153154
154155INLINE UINT32 FETCH_TEXEL_CI8_TLUT_NEN(UINT32 s, UINT32 t)
155156{
156   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0x7ff;
157   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0x7ff;
157158   return TMEM[taddr ^ BYTE_ADDR_XOR] * 0x01010101;
158159}
159160
160161INLINE UINT32 FETCH_TEXEL_CI16_TLUT_EN0(UINT32 s, UINT32 t)
161162{   // 16-bit CI is a "valid" mode; some games use it, it behaves the same as 16-bit RGBA
162   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + (s))  ^ ((t & 1) ? XOR_SWAP_WORD : 0);
163   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + s)  ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
163164   return rgb16_to_32_lut[tlut[(TMEM16[(taddr & 0x7ff) ^ WORD_ADDR_XOR] >> 8) << 2]];
164165}
165166
166167INLINE UINT32 FETCH_TEXEL_CI16_TLUT_EN1(UINT32 s, UINT32 t)
167168{   // 16-bit CI is a "valid" mode; some games use it, it behaves the same as 16-bit RGBA
168   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + (s))  ^ ((t & 1) ? XOR_SWAP_WORD : 0);
169   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + s)  ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
169170   return ia8_to_32_lut[tlut[(TMEM16[(taddr & 0x7ff) ^ WORD_ADDR_XOR] >> 8) << 2]]; // Beetle Adventure Racing, Mount Mayhem
170171}
171172
172173INLINE UINT32 FETCH_TEXEL_CI16_TLUT_NEN(UINT32 s, UINT32 t)
173174{   // 16-bit CI is a "valid" mode; some games use it, it behaves the same as 16-bit RGBA
174   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + (s))  ^ ((t & 1) ? XOR_SWAP_WORD : 0);
175   UINT32 taddr = ((cached_tbase_s1) + ((t) * (cached_twidth_s1)) + s)  ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
175176   return rgb16_to_32_lut[TMEM16[(taddr & 0x7ff) ^ WORD_ADDR_XOR]]; // PGA European Tour (U)
176177}
177178
178179INLINE UINT32 FETCH_TEXEL_IA4_TLUT_EN0(UINT32 s, UINT32 t)
179180{
180   UINT32 taddr = (cached_tbase + ((t) * cached_twidth) + (s >> 1)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0);
181   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
181   UINT32 taddr = (cached_tbase + ((t) * cached_twidth) + (s >> 1)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT);
182   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
182183   return rgb16_to_32_lut[tlut[(cached_tpal | p) << 2]];
183184}
184185
185186INLINE UINT32 FETCH_TEXEL_IA4_TLUT_EN1(UINT32 s, UINT32 t)
186187{
187   UINT32 taddr = (cached_tbase + ((t) * cached_twidth) + (s >> 1)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0);
188   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
188   UINT32 taddr = (cached_tbase + ((t) * cached_twidth) + (s >> 1)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT);
189   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
189190   return ia8_to_32_lut[tlut[(cached_tpal | p) << 2]];
190191}
191192
192193INLINE UINT32 FETCH_TEXEL_IA4_TLUT_NEN(UINT32 s, UINT32 t)
193194{
194   UINT32 taddr = (cached_tbase + ((t) * cached_twidth) + (s >> 1)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0);
195   UINT32 p = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
195   UINT32 taddr = (cached_tbase + ((t) * cached_twidth) + (s >> 1)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT);
196   UINT32 p = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
196197   UINT32 i = ((p & 0xe) << 4) | ((p & 0xe) << 1) | (p & 0xe >> 2);
197198
198   return (i * 0x01010100) | ((p & 0x1) ? 0xff : 0);
199   return (i * 0x01010100) | ((p & 0x1) & 0xff);
199200}
200201
201202INLINE UINT32 FETCH_TEXEL_IA8_TLUT_EN0(UINT32 s, UINT32 t)
202203{
203   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
204   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
204205   return rgb16_to_32_lut[tlut[TMEM[taddr ^ BYTE_ADDR_XOR] << 2]];
205206}
206207
207208INLINE UINT32 FETCH_TEXEL_IA8_TLUT_EN1(UINT32 s, UINT32 t)
208209{
209   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
210   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
210211   return ia8_to_32_lut[tlut[TMEM[taddr ^ BYTE_ADDR_XOR] << 2]];
211212}
212213
213214INLINE UINT32 FETCH_TEXEL_IA8_TLUT_NEN(UINT32 s, UINT32 t)
214215{
215   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
216   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
216217   UINT32 p = TMEM[taddr ^ BYTE_ADDR_XOR];
217218   UINT32 i = (p >> 4) | (p & 0xf0);
218219
r7553r7554
221222
222223INLINE UINT32 FETCH_TEXEL_IA16_TLUT_EN0(UINT32 s, UINT32 t)
223224{
224   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth >> 1)) + (s)) ^ ((t & 1) ? XOR_SWAP_WORD : 0);
225   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth >> 1)) + s) ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
225226   return rgb16_to_32_lut[tlut[(TMEM16[taddr ^ WORD_ADDR_XOR] >> 8) << 2]];
226227}
227228
228229INLINE UINT32 FETCH_TEXEL_IA16_TLUT_EN1(UINT32 s, UINT32 t)
229230{
230   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth >> 1)) + (s)) ^ ((t & 1) ? XOR_SWAP_WORD : 0);
231   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth >> 1)) + s) ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
231232   return ia8_to_32_lut[tlut[(TMEM16[taddr ^ WORD_ADDR_XOR] >> 8) << 2]];
232233}
233234
234235INLINE UINT32 FETCH_TEXEL_IA16_TLUT_NEN(UINT32 s, UINT32 t)
235236{
236   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth >> 1)) + (s)) ^ ((t & 1) ? XOR_SWAP_WORD : 0);
237   UINT32 taddr = ((cached_tbase >> 1) + ((t) * (cached_twidth >> 1)) + s) ^ ((t & 1) << XOR_SWAP_WORD_SHIFT);
237238   UINT32 c = TMEM16[taddr ^ WORD_ADDR_XOR];
238239
239240   return ((c >> 8) * 0x01010100) | (c & 0xff);
r7553r7554
241242
242243INLINE UINT32 FETCH_TEXEL_I4_TLUT_EN0(UINT32 s, UINT32 t)
243244{
244   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
245   UINT32 c = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
245   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
246   UINT32 c = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
246247   c |= (c << 4);
247248
248249   return rgb16_to_32_lut[tlut[(cached_tpal | c) << 2]];
r7553r7554
250251
251252INLINE UINT32 FETCH_TEXEL_I4_TLUT_EN1(UINT32 s, UINT32 t)
252253{
253   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
254   UINT32 c = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
254   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
255   UINT32 c = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
255256   c |= (c << 4);
256257
257258   return ia8_to_32_lut[tlut[(cached_tpal | c) << 2]];
r7553r7554
259260
260261INLINE UINT32 FETCH_TEXEL_I4_TLUT_NEN(UINT32 s, UINT32 t)
261262{
262   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s) / 2)) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
263   UINT32 c = ((s) & 1) ? (TMEM[taddr ^ BYTE_ADDR_XOR] & 0xf) : (TMEM[taddr ^ BYTE_ADDR_XOR] >> 4);
263   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + (s / 2)) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
264   UINT32 c = (TMEM[taddr ^ BYTE_ADDR_XOR] >> ((s & 1) << 2)) & 0xf;
264265   c |= (c << 4);
265266
266267   return (c * 0x01010101);
r7553r7554
268269
269270INLINE UINT32 FETCH_TEXEL_I8_TLUT_EN0(UINT32 s, UINT32 t)
270271{
271   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
272   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
272273   return rgb16_to_32_lut[tlut[TMEM[taddr ^ BYTE_ADDR_XOR] << 2]];
273274}
274275
275276INLINE UINT32 FETCH_TEXEL_I8_TLUT_EN1(UINT32 s, UINT32 t)
276277{
277   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
278   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
278279   return ia8_to_32_lut[tlut[TMEM[taddr ^ BYTE_ADDR_XOR] << 2]];
279280}
280281
281282INLINE UINT32 FETCH_TEXEL_I8_TLUT_NEN(UINT32 s, UINT32 t)
282283{
283   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + ((s))) ^ ((t & 1) ? XOR_SWAP_BYTE : 0)) & 0xfff;
284   UINT32 taddr = ((cached_tbase + ((t) * cached_twidth) + s) ^ ((t & 1) << XOR_SWAP_BYTE_SHIFT)) & 0xfff;
284285   return TMEM[taddr ^ BYTE_ADDR_XOR] * 0x01010101;
285286}
286287
src/mame/video/rdptri.c
r7553r7554
1#define addleft(x) addleftcvg(x,k)
2#define addright(x) addrightcvg(x,k)
3
4#define setvalues()   \
5{               \
6   addvalues();   \
7   adjust_attr();   \
8}
9
110static void triangle_ns_nt_nz(UINT32 w1, UINT32 w2)
211{
3   int j;
4   int xleft, xright, xleft_inc, xright_inc;
5   int xstart, xend;
6   int flip = (w1 & 0x800000) ? 1 : 0;
12   int flip     = (w1 & 0x800000) ?  1 :  0;
13   int sign     = (w1 & 0x800000) ? -1 :  1;
14   int inv_sign = (w1 & 0x800000) ?  1 : -1;
715
8   INT32 yl, ym, yh;
9   INT32 xl, xm, xh;
10   INT32 dxldy, dxhdy, dxmdy;
11   UINT32 w3, w4, w5, w6, w7, w8;
12
13   int k = 0;
14
15   INT32 limcvg = 0;
16   INT32 startcvg = 0;
17
18   int sign_dxldy = 0;
19   int sign_dxmdy = 0;
20   int samesign = 0;
21
22   int sign_dxhdy = 0;
23
2416   int xfrac = 0;
2517
26   int m_inc;
27   UINT32 min=0, max=3;
28   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
18   INT32 maxxmx = 0;
19   INT32 minxmx = 0;
20   INT32 maxxhx = 0;
21   INT32 minxhx = 0;
2922
30   int spix = 0; // Current subpixel
31   int ycur;
32   int ylfar;
33   int ldflag;
34   int yhpix;
35   int ympix;
36   int ylpix;
23   UINT32 w3 = rdp_cmd_data[rdp_cmd_cur+2];
24   UINT32 w4 = rdp_cmd_data[rdp_cmd_cur+3];
25   UINT32 w5 = rdp_cmd_data[rdp_cmd_cur+4];
26   UINT32 w6 = rdp_cmd_data[rdp_cmd_cur+5];
27   UINT32 w7 = rdp_cmd_data[rdp_cmd_cur+6];
28   UINT32 w8 = rdp_cmd_data[rdp_cmd_cur+7];
3729
38#define addleft(x) addleftcvg(x,k)
39#define addright(x) addrightcvg(x,k)
40
41   w3 = rdp_cmd_data[rdp_cmd_cur+2];
42   w4 = rdp_cmd_data[rdp_cmd_cur+3];
43   w5 = rdp_cmd_data[rdp_cmd_cur+4];
44   w6 = rdp_cmd_data[rdp_cmd_cur+5];
45   w7 = rdp_cmd_data[rdp_cmd_cur+6];
46   w8 = rdp_cmd_data[rdp_cmd_cur+7];
47
48   yl = (w1 & 0x3fff);
49   ym = ((w2 >> 16) & 0x3fff);
50   yh = ((w2 >>  0) & 0x3fff);
51   xl = (INT32)(w3 & 0x3fffffff);
52   xh = (INT32)(w5 & 0x3fffffff);
53   xm = (INT32)(w7 & 0x3fffffff);
30   INT32 yl = (w1 & 0x3fff);
31   INT32 ym = ((w2 >> 16) & 0x3fff);
32   INT32 yh = ((w2 >>  0) & 0x3fff);
33   INT32 xl = (INT32)(w3 & 0x3fffffff);
34   INT32 xh = (INT32)(w5 & 0x3fffffff);
35   INT32 xm = (INT32)(w7 & 0x3fffffff);
5436   // Inverse slopes in 16.16 format
55   dxldy = (INT32)(w4);
56   dxhdy = (INT32)(w6);
57   dxmdy = (INT32)(w8);
37   INT32 dxldy = (INT32)(w4);
38   INT32 dxhdy = (INT32)(w6);
39   INT32 dxmdy = (INT32)(w8);
5840
5941   max_level = ((w1 >> 19) & 7);
6042
r7553r7554
6850
6951   span[0].dymax = 0;
7052
71   xleft_inc = dxmdy >> 2;
72   xright_inc = dxhdy >> 2;
53   int xleft_inc = dxmdy >> 2;
54   int xright_inc = dxhdy >> 2;
7355
74   xright = xh;
75   xleft = xm;
56   int xright = xh;
57   int xleft = xm;
7658
77   limcvg = ((yl>>2) <= 1023) ? (yl>>2) : 1023; // Needed by 40 Winks
59   INT32 limcvg = ((yl>>2) <= 1023) ? (yl>>2) : 1023; // Needed by 40 Winks
7860   if (limcvg < 0)
7961   {
8062      limcvg = 0;
8163   }
8264
83   startcvg = ((yh>>2)>=0) ? (yh>>2) : 0;
84   for (k = startcvg; k <= limcvg; k++)
65   INT32 startcvg = ((yh>>2)>=0) ? (yh>>2) : 0;
66   for (int k = startcvg; k <= limcvg; k++)
8567   {
8668      memset((void*)&span[k].cvg[0],0,640);
8769   }
8870
89   sign_dxldy = (dxldy & 0x80000000) ? 1 : 0;
90   sign_dxmdy = (dxmdy & 0x80000000) ? 1 : 0;
91   samesign = !(sign_dxldy ^ sign_dxmdy);
71   int sign_dxhdy = (dxhdy & 0x80000000) ? 1 : 0;
9272
93   sign_dxhdy = (dxhdy & 0x80000000) ? 1 : 0;
73   int ycur =   yh & ~3;
74   int ylfar = yl | 3;
75   int ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
76   int yhpix = yh >> 2;
77   int ylpix = yl >> 2;
9478
95   m_inc = flip ? 1 : -1;
79   if(ylfar >= 0x1000)
80   {
81      ylfar = 0x0fff;
82   }
9683
97   ycur =   yh & ~3;
98   ylfar = yl | 3;
99   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
100   yhpix = yh >> 2;
101   ympix = ym >> 2;
102   ylpix = yl >> 2;
103
104   for (k = ycur; k <= ylfar; k++)
84   for (int k = ycur; k <= ylfar; k++)
10585   {
10686      if (k == ym)
10787      {
r7553r7554
10989         xleft_inc = dxldy >> 2;
11090      }
11191
112      xstart = xleft >> 16;
113      xend = xright >> 16;
114      j = k >> 2;
115      spix = k & 3;
92      int xstart = xleft >> 16;
93      int xend = xright >> 16;
94      int j = k >> 2;
95      int spix = k & 3;
11696
117      if (k >= 0 && k < 0x1000)
97      UINT32 min = 0;
98      UINT32 max = 3;
99      if (j == yhpix)
118100      {
119         int m = 0;
120         int n = 0;
121         int length = 0;
122         min = 0; max = 3;
123         if (j == yhpix)
101         min = yh & 3;
102      }
103      if (j == ylpix)
104      {
105         max = yl & 3;
106      }
107      if (spix >= min && spix <= max)
108      {
109         if (spix == min)
124110         {
125            min = yh & 3;
111            minxmx = maxxmx = xstart;
112            minxhx = maxxhx = xend;
126113         }
127         if (j == ylpix)
114         else
128115         {
129            max = yl & 3;
116            minxmx = (xstart < minxmx) ? xstart : minxmx;
117            maxxmx = (xstart > maxxmx) ? xstart : maxxmx;
118            minxhx = (xend < minxhx) ? xend : minxhx;
119            maxxhx = (xend > maxxhx) ? xend : maxxhx;
130120         }
131         if (spix >= min && spix <= max)
121      }
122
123      if (spix == max)
124      {
125         if (flip)
132126         {
133            if (spix == min)
134            {
135               minxmx = maxxmx = xstart;
136               minxhx = maxxhx = xend;
137            }
138            else
139            {
140               minxmx = (xstart < minxmx) ? xstart : minxmx;
141               maxxmx = (xstart > maxxmx) ? xstart : maxxmx;
142               minxhx = (xend < minxhx) ? xend : minxhx;
143               maxxhx = (xend > maxxhx) ? xend : maxxhx;
144            }
127            span[j].lx = maxxmx;
128            span[j].rx = minxhx;
145129         }
130         else
131         {
132            span[j].lx = minxmx;
133            span[j].rx = maxxhx;
134         }
135      }
146136
147         if (spix == max)
137      int length = (xend - xstart) * sign;
138
139      if (spix == ldflag)
140      {
141         xfrac = ((xright >> 8) & 0xff);
142      }
143
144      int m = flip ? (xend+1) : (xend-1);
145
146      if (k >= yh && length >= 0 && k <= yl)
147      {
148         if (xstart>=0 && xstart <1024)
148149         {
149            if (flip)
150            if (!flip)
150151            {
151               span[j].lx = maxxmx;
152               span[j].rx = minxhx;
152               span[j].cvg[xstart] += addleft(xleft);
153153            }
154154            else
155155            {
156               span[j].lx = minxmx;
157               span[j].rx = maxxhx;
156               span[j].cvg[xstart] += addright(xleft);
158157            }
159158         }
160
161         length = flip ? (xstart - xend) : (xend - xstart);
162
163         if (spix == ldflag)
159         if (xend>=0 && xend<1024)
164160         {
165            xfrac = ((xright >> 8) & 0xff);
166         }
167
168         m = flip ? (xend+1) : (xend-1);
169
170         if (k >= yh && length >= 0 && k <= yl)
171         {
172            if (xstart>=0 && xstart <1024)
161            if (xstart != xend)
173162            {
174163               if (!flip)
175164               {
176                  span[j].cvg[xstart] += addleft(xleft);
165                  span[j].cvg[xend] += addright(xright);
177166               }
178167               else
179168               {
180                  span[j].cvg[xstart] += addright(xleft);
169                  span[j].cvg[xend] += addleft(xright);
181170               }
182171            }
183            if (xend>=0 && xend<1024)
172            else
184173            {
185               if (xstart != xend)
174               if (!flip)
186175               {
187                  if (!flip)
188                  {
189                     span[j].cvg[xend] += addright(xright);
190                  }
191                  else
192                  {
193                     span[j].cvg[xend] += addleft(xright);
194                  }
176                  span[j].cvg[xend] -= (2 - addright(xright));
195177               }
196178               else
197179               {
198                  if (!flip)
199                  {
200                     span[j].cvg[xend] -= (2 - addright(xright));
201                  }
202                  else
203                  {
204                     span[j].cvg[xend] -= (2 - addleft(xright));
205                  }
206                  if (span[j].cvg[xend] > 200)
207                  {
208                     span[j].cvg[xend] = 0;
209                  }
180                  span[j].cvg[xend] -= (2 - addleft(xright));
210181               }
211            }
212            for (n = 0; n < (length - 1); n++)
213            {
214               if (m>=0 && m < 640)
182               if (span[j].cvg[xend] > 200)
215183               {
216                  span[j].cvg[m] += 2;
184                  span[j].cvg[xend] = 0;
217185               }
218
219               m += m_inc;
220186            }
221187         }
188         for (int n = 0; n < (length - 1); n++)
189         {
190            if (m >= 0 && m < 640)
191            {
192               span[j].cvg[m] += 2;
193            }
194
195            m += inv_sign;
196         }
222197      }
223198
224199      xleft += xleft_inc;
r7553r7554
243218
244219static void triangle_ns_nt_z(UINT32 w1, UINT32 w2)
245220{
246   int j;
247   int xleft, xright, xleft_inc, xright_inc;
248   int xstart, xend;
249   int z = 0;
250   int dzdx = 0;
251   int dzdy = 0;
252   int dzde = 0;
253   int tilenum;
254   int flip = (w1 & 0x800000) ? 1 : 0;
221   int flip     = (w1 & 0x800000) ? 1 : 0;
222   int sign     = (w1 & 0x800000) ? -1 : 1;
223   int inv_sign = (w1 & 0x800000) ? 1 : -1;
255224
256   INT32 yl, ym, yh;
257   INT32 xl, xm, xh;
258   INT32 dxldy, dxhdy, dxmdy;
259   int dzdy_dz, dzdx_dz;
260   UINT32 w3, w4, w5, w6, w7, w8;
261
262   int k = 0;
263
264   INT32 limcvg = 0;
265   INT32 startcvg = 0;
266
267   int sign_dxldy = 0;
268   int sign_dxmdy = 0;
269   int samesign = 0;
270
271   int dzdiff = 0;
272   int sign_dxhdy = 0;
273
274   int dzdeh = 0, dzdyh = 0;
275   int do_offset = 0;
276
277225   int xfrac = 0;
278   int dzeoff = 0;
279226
280   int dzdxh = 0;
281
282   int m_inc;
283   UINT32 min=0, max=3;
284227   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
285228
286   int spix = 0; // Current subpixel
287   int ycur;
288   int ylfar;
289   int ldflag;
290   int yhpix;
291   int ympix;
292   int ylpix;
293
294229   int zbuffer_base = rdp_cmd_cur + 8;
295230
296   w3 = rdp_cmd_data[rdp_cmd_cur+2];
297   w4 = rdp_cmd_data[rdp_cmd_cur+3];
298   w5 = rdp_cmd_data[rdp_cmd_cur+4];
299   w6 = rdp_cmd_data[rdp_cmd_cur+5];
300   w7 = rdp_cmd_data[rdp_cmd_cur+6];
301   w8 = rdp_cmd_data[rdp_cmd_cur+7];
231   UINT32 w3 = rdp_cmd_data[rdp_cmd_cur+2];
232   UINT32 w4 = rdp_cmd_data[rdp_cmd_cur+3];
233   UINT32 w5 = rdp_cmd_data[rdp_cmd_cur+4];
234   UINT32 w6 = rdp_cmd_data[rdp_cmd_cur+5];
235   UINT32 w7 = rdp_cmd_data[rdp_cmd_cur+6];
236   UINT32 w8 = rdp_cmd_data[rdp_cmd_cur+7];
302237
303   yl = (w1 & 0x3fff);
304   ym = ((w2 >> 16) & 0x3fff);
305   yh = ((w2 >>  0) & 0x3fff);
306   xl = (INT32)(w3 & 0x3fffffff);
307   xh = (INT32)(w5 & 0x3fffffff);
308   xm = (INT32)(w7 & 0x3fffffff);
238   INT32 yl = (w1 & 0x3fff);
239   INT32 ym = ((w2 >> 16) & 0x3fff);
240   INT32 yh = ((w2 >>  0) & 0x3fff);
241   INT32 xl = (INT32)(w3 & 0x3fffffff);
242   INT32 xh = (INT32)(w5 & 0x3fffffff);
243   INT32 xm = (INT32)(w7 & 0x3fffffff);
309244   // Inverse slopes in 16.16 format
310   dxldy = (INT32)(w4);
311   dxhdy = (INT32)(w6);
312   dxmdy = (INT32)(w8);
245   INT32 dxldy = (INT32)(w4);
246   INT32 dxhdy = (INT32)(w6);
247   INT32 dxmdy = (INT32)(w8);
313248
314249   max_level = ((w1 >> 19) & 7);
315   tilenum = (w1 >> 16) & 0x7;
250   int tilenum = (w1 >> 16) & 0x7;
316251
317252   if (yl & 0x2000)  yl |= 0xffffc000;
318253   if (ym & 0x2000)  ym |= 0xffffc000;
r7553r7554
322257   if (xm & 0x20000000)  xm |= 0xc0000000;
323258   if (xh & 0x20000000)  xh |= 0xc0000000;
324259
325   z    = rdp_cmd_data[zbuffer_base+0];
326   dzdx = rdp_cmd_data[zbuffer_base+1];
327   dzde = rdp_cmd_data[zbuffer_base+2];
328   dzdy = rdp_cmd_data[zbuffer_base+3];
260   int z    = rdp_cmd_data[zbuffer_base+0];
261   int dzdx = rdp_cmd_data[zbuffer_base+1];
262   int dzde = rdp_cmd_data[zbuffer_base+2];
263   int dzdy = rdp_cmd_data[zbuffer_base+3];
329264
265   int dzdiff = 0;
266   int dzeoff = 0;
267   int dzdeh = 0;
268   int dzdyh = 0;
269   int dzdxh = dzdx >> 8;
270
271   int dzdy_dz = (dzdy >> 16) & 0xffff;
272   int dzdx_dz = (dzdx >> 16) & 0xffff;
330273   span[0].dz.w = dzdx;
331   dzdy_dz = (dzdy >> 16) & 0xffff;
332   dzdx_dz = (dzdx >> 16) & 0xffff;
333274   span[0].dzpix = ((dzdy_dz & 0x8000) ? ((~dzdy_dz) & 0x7fff) : dzdy_dz) + ((dzdx_dz & 0x8000) ? ((~dzdx_dz) & 0x7fff) : dzdx_dz);
334275   span[0].dzpix = normalize_dzpix(span[0].dzpix);
335276
336   xleft_inc = dxmdy >> 2;
337   xright_inc = dxhdy >> 2;
277   int xleft_inc = dxmdy >> 2;
278   int xright_inc = dxhdy >> 2;
338279
339   xright = xh;
340   xleft = xm;
280   int xright = xh;
281   int xleft = xm;
341282
342   limcvg = ((yl>>2) <= 1023) ? (yl>>2) : 1023; // Needed by 40 Winks
283   INT32 limcvg = ((yl>>2) <= 1023) ? (yl>>2) : 1023; // Needed by 40 Winks
343284   if (limcvg < 0)
344285   {
345286      limcvg = 0;
346287   }
347288
348   startcvg = ((yh>>2)>=0) ? (yh>>2) : 0;
349   for (k = startcvg; k <= limcvg; k++)
289   INT32 startcvg = ((yh>>2)>=0) ? (yh>>2) : 0;
290   for (int k = startcvg; k <= limcvg; k++)
350291   {
351292      memset((void*)&span[k].cvg[0],0,640);
352293   }
353294
354   sign_dxldy = (dxldy & 0x80000000) ? 1 : 0;
355   sign_dxmdy = (dxmdy & 0x80000000) ? 1 : 0;
356   samesign = !(sign_dxldy ^ sign_dxmdy);
295   int sign_dxhdy = (dxhdy & 0x80000000) ? 1 : 0;
357296
358   sign_dxhdy = (dxhdy & 0x80000000) ? 1 : 0;
359
360   do_offset = !(sign_dxhdy ^ (flip));
361
362   if (do_offset)
297   if (!(sign_dxhdy ^ (flip)))
363298   {
364      dzdeh = dzde >> 9;   dzdyh = dzdy >> 9;
365
299      dzdeh = dzde >> 9;
300      dzdyh = dzdy >> 9;
366301      dzdiff = (dzdeh*3 - dzdyh*3) << 7;
367   }
368   else
369   {
370      dzdiff = 0;
371   }
372
373   if (do_offset)
374   {
375302      dzeoff = (dzdeh*3) << 7;
376303   }
377304   else
378305   {
306      dzdiff = 0;
379307      dzeoff = 0;
380308   }
381309
382#define addleft(x) addleftcvg(x,k)
383#define addright(x) addrightcvg(x,k)
384#define setvalues() {               \
385         addvalues();            \
386         adjust_attr();   \
387}
388
389   dzdxh = dzdx >> 8;
390
391310#define adjust_attr()      \
392311{                     \
393312         span[j].z.w = z + dzdiff - (xfrac * dzdxh);            \
r7553r7554
397316         z += dzde; \
398317}
399318
400   m_inc = flip ? 1 : -1;
319   int ycur =   yh & ~3;
320   int ylfar = yl | 3;
321   int ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
322   int yhpix = yh >> 2;
323   int ylpix = yl >> 2;
401324
402   ycur =   yh & ~3;
403   ylfar = yl | 3;
404   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
405   yhpix = yh >> 2;
406   ympix = ym >> 2;
407   ylpix = yl >> 2;
325   if(ylfar >= 0x1000)
326   {
327      ylfar = 0x0fff;
328   }
408329
409   for (k = ycur; k <= ylfar; k++)
330   for (int k = ycur; k <= ylfar; k++)
410331   {
411332      if (k == ym)
412333      {
r7553r7554
414335         xleft_inc = dxldy >> 2;
415336      }
416337
417      xstart = xleft >> 16;
418      xend = xright >> 16;
419      j = k >> 2;
420      spix = k & 3;
338      int xstart = xleft >> 16;
339      int xend = xright >> 16;
340      int j = k >> 2;
341      int spix = k & 3;
421342
422      if (k >= 0 && k < 0x1000)
343      //if (k >= 0 && k < 0x1000)
423344      {
424         int m = 0;
425345         int n = 0;
426         int length = 0;
427         min = 0; max = 3;
346         UINT32 min = 0;
347         UINT32 max = 3;
428348         if (j == yhpix)
429349         {
430350            min = yh & 3;
r7553r7554
463383            }
464384         }
465385
466         length = flip ? (xstart - xend) : (xend - xstart);
386         int length = (xend - xstart) * sign;
467387
468388         if (spix == ldflag)
469389         {
r7553r7554
471391            adjust_attr();
472392         }
473393
474         m = flip ? (xend+1) : (xend-1);
394         int m = flip ? (xend+1) : (xend-1);
475395
476396         if (k >= yh && length >= 0 && k <= yl)
477397         {
r7553r7554
522442                  span[j].cvg[m] += 2;
523443               }
524444
525               m += m_inc;
445               m += inv_sign;
526446            }
527447         }
528448      }
r7553r7554
552472}
553473#undef addvalues
554474#undef adjust_attr
555#undef addleft
556#undef addright
557#undef setvalues
558475
559476static void triangle_ns_t_nz(UINT32 w1, UINT32 w2)
560477{
r7553r7554
567484   int dsde = 0, dtde = 0, dwde = 0;
568485   int tilenum;
569486   int flip = (w1 & 0x800000) ? 1 : 0;
487   int sign = (w1 & 0x800000) ? -1 : 1;
488   int inv_sign = (w1 & 0x800000) ?  1 : -1;
570489
571490   INT32 yl, ym, yh;
572491   INT32 xl, xm, xh;
r7553r7554
593512
594513   int dsdxh = 0, dtdxh = 0, dwdxh = 0;
595514
596   int m_inc;
597515   UINT32 min=0, max=3;
598516   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
599517
r7553r7554
707625      dseoff = dteoff = dweoff;
708626   }
709627
710#define addleft(x) addleftcvg(x,k)
711#define addright(x) addrightcvg(x,k)
712#define setvalues() {               \
713         addvalues();            \
714         adjust_attr();   \
715}
716
717628   dsdxh = dsdx >> 8;
718629   dtdxh = dtdx >> 8;
719630   dwdxh = dwdx >> 8;
r7553r7554
731642         w += dwde; \
732643}
733644
734   m_inc = flip ? 1 : -1;
735
736645   ycur =   yh & ~3;
737646   ylfar = yl | 3;
738647   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
r7553r7554
740649   ympix = ym >> 2;
741650   ylpix = yl >> 2;
742651
652   if(ylfar >= 0x1000)
653   {
654      ylfar = 0x0fff;
655   }
656
743657   for (k = ycur; k <= ylfar; k++)
744658   {
745659      if (k == ym)
r7553r7554
753667      j = k >> 2;
754668      spix = k & 3;
755669
756      if (k >= 0 && k < 0x1000)
670      //if (k >= 0 && k < 0x1000)
757671      {
758672         int m = 0;
759673         int n = 0;
760         int length = 0;
761674         min = 0; max = 3;
762675         if (j == yhpix)
763676         {
r7553r7554
797710            }
798711         }
799712
800         length = flip ? (xstart - xend) : (xend - xstart);
713         int length = (xend - xstart) * sign;
801714
802715         if (spix == ldflag)
803716         {
r7553r7554
856769                  span[j].cvg[m] += 2;
857770               }
858771
859               m += m_inc;
772               m += inv_sign;
860773            }
861774         }
862775      }
r7553r7554
886799}
887800#undef addvalues
888801#undef adjust_attr
889#undef addleft
890#undef addright
891#undef setvalues
892802
893803static void triangle_ns_t_z(UINT32 w1, UINT32 w2)
894804{
r7553r7554
901811   int dzde = 0, dsde = 0, dtde = 0, dwde = 0;
902812   int tilenum;
903813   int flip = (w1 & 0x800000) ? 1 : 0;
814   int sign = (w1 & 0x800000) ? -1 : 1;
815   int inv_sign = (w1 & 0x800000) ?  1 : -1;
904816
905817   INT32 yl, ym, yh;
906818   INT32 xl, xm, xh;
r7553r7554
929841
930842   int dsdxh = 0, dtdxh = 0, dwdxh = 0, dzdxh = 0;
931843
932   int m_inc;
933844   UINT32 min=0, max=3;
934845   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
935846
r7553r7554
1070981      dseoff = dteoff = dweoff = dzeoff = 0;
1071982   }
1072983
1073#define addleft(x) addleftcvg(x,k)
1074#define addright(x) addrightcvg(x,k)
1075#define setvalues() {               \
1076         addvalues();            \
1077         adjust_attr();   \
1078}
1079
1080984   dsdxh = dsdx >> 8;
1081985   dtdxh = dtdx >> 8;
1082986   dwdxh = dwdx >> 8;
r7553r7554
10971001         z += dzde; \
10981002}
10991003
1100   m_inc = flip ? 1 : -1;
1101
11021004   ycur =   yh & ~3;
11031005   ylfar = yl | 3;
11041006   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
r7553r7554
11061008   ympix = ym >> 2;
11071009   ylpix = yl >> 2;
11081010
1011   if(ylfar >= 0x1000)
1012   {
1013      ylfar = 0x0fff;
1014   }
1015
11091016   for (k = ycur; k <= ylfar; k++)
11101017   {
11111018      if (k == ym)
r7553r7554
11191026      j = k >> 2;
11201027      spix = k & 3;
11211028
1122      if (k >= 0 && k < 0x1000)
1029      //if (k >= 0 && k < 0x1000)
11231030      {
11241031         int m = 0;
11251032         int n = 0;
1126         int length = 0;
11271033         min = 0; max = 3;
11281034         if (j == yhpix)
11291035         {
r7553r7554
11631069            }
11641070         }
11651071
1166         length = flip ? (xstart - xend) : (xend - xstart);
1072         int length = (xend - xstart) * sign;
11671073
11681074         if (spix == ldflag)
11691075         {
r7553r7554
12221128                  span[j].cvg[m] += 2;
12231129               }
12241130
1225               m += m_inc;
1131               m += inv_sign;
12261132            }
12271133         }
12281134      }
r7553r7554
12521158}
12531159#undef addvalues
12541160#undef adjust_attr
1255#undef addleft
1256#undef addright
1257#undef setvalues
12581161
12591162static void triangle_s_nt_nz(UINT32 w1, UINT32 w2)
12601163{
r7553r7554
12681171   int drde = 0, dgde = 0, dbde = 0, dade = 0;
12691172   int tilenum;
12701173   int flip = (w1 & 0x800000) ? 1 : 0;
1174   int sign = (w1 & 0x800000) ? -1 : 1;
1175   int inv_sign = (w1 & 0x800000) ?  1 : -1;
12711176
12721177   INT32 yl, ym, yh;
12731178   INT32 xl, xm, xh;
r7553r7554
12941199
12951200   int drdxh = 0, dgdxh = 0, dbdxh = 0, dadxh = 0;
12961201
1297   int m_inc;
12981202   UINT32 min=0, max=3;
12991203   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
13001204
r7553r7554
14161320      dreoff = dgeoff = dbeoff = daeoff;
14171321   }
14181322
1419#define addleft(x) addleftcvg(x,k)
1420#define addright(x) addrightcvg(x,k)
1421#define setvalues() {               \
1422         addvalues();            \
1423         adjust_attr();   \
1424}
1425
14261323   drdxh = drdx >> 8;
14271324   dgdxh = dgdx >> 8;
14281325   dbdxh = dbdx >> 8;
r7553r7554
14431340         a += dade; \
14441341}
14451342
1446   m_inc = flip ? 1 : -1;
1447
14481343   ycur =   yh & ~3;
14491344   ylfar = yl | 3;
14501345   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
r7553r7554
14521347   ympix = ym >> 2;
14531348   ylpix = yl >> 2;
14541349
1350   if(ylfar >= 0x1000)
1351   {
1352      ylfar = 0x0fff;
1353   }
1354
14551355   for (k = ycur; k <= ylfar; k++)
14561356   {
14571357      if (k == ym)
r7553r7554
14651365      j = k >> 2;
14661366      spix = k & 3;
14671367
1468      if (k >= 0 && k < 0x1000)
1368      //if (k >= 0 && k < 0x1000)
14691369      {
14701370         int m = 0;
14711371         int n = 0;
1472         int length = 0;
14731372         min = 0; max = 3;
14741373         if (j == yhpix)
14751374         {
r7553r7554
15091408            }
15101409         }
15111410
1512         length = flip ? (xstart - xend) : (xend - xstart);
1411         int length = (xend - xstart) * sign;
15131412
15141413         if (spix == ldflag)
15151414         {
r7553r7554
15681467                  span[j].cvg[m] += 2;
15691468               }
15701469
1571               m += m_inc;
1470               m += inv_sign;
15721471            }
15731472         }
15741473      }
r7553r7554
15981497}
15991498#undef addvalues
16001499#undef adjust_attr
1601#undef addleft
1602#undef addright
1603#undef setvalues
16041500
16051501static void triangle_s_nt_z(UINT32 w1, UINT32 w2)
16061502{
r7553r7554
16141510   int drde = 0, dgde = 0, dbde = 0, dade = 0, dzde = 0;
16151511   int tilenum;
16161512   int flip = (w1 & 0x800000) ? 1 : 0;
1513   int sign = (w1 & 0x800000) ? -1 : 1;
1514   int inv_sign = (w1 & 0x800000) ?  1 : -1;
16171515
16181516   INT32 yl, ym, yh;
16191517   INT32 xl, xm, xh;
r7553r7554
16411539
16421540   int drdxh = 0, dgdxh = 0, dbdxh = 0, dadxh = 0, dzdxh = 0;
16431541
1644   int m_inc;
16451542   UINT32 min=0, max=3;
16461543   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
16471544
r7553r7554
17791676      dreoff = dgeoff = dbeoff = daeoff = dzeoff = 0;
17801677   }
17811678
1782#define addleft(x) addleftcvg(x,k)
1783#define addright(x) addrightcvg(x,k)
1784#define setvalues() {               \
1785         addvalues();            \
1786         adjust_attr();   \
1787}
1788
17891679   drdxh = drdx >> 8;
17901680   dgdxh = dgdx >> 8;
17911681   dbdxh = dbdx >> 8;
r7553r7554
18091699         z += dzde; \
18101700}
18111701
1812   m_inc = flip ? 1 : -1;
1813
18141702   ycur =   yh & ~3;
18151703   ylfar = yl | 3;
18161704   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
r7553r7554
18181706   ympix = ym >> 2;
18191707   ylpix = yl >> 2;
18201708
1709   if(ylfar >= 0x1000)
1710   {
1711      ylfar = 0x0fff;
1712   }
1713
18211714   for (k = ycur; k <= ylfar; k++)
18221715   {
18231716      if (k == ym)
r7553r7554
18311724      j = k >> 2;
18321725      spix = k & 3;
18331726
1834      if (k >= 0 && k < 0x1000)
1727      //if (k >= 0 && k < 0x1000)
18351728      {
18361729         int m = 0;
18371730         int n = 0;
1838         int length = 0;
18391731         min = 0; max = 3;
18401732         if (j == yhpix)
18411733         {
r7553r7554
18751767            }
18761768         }
18771769
1878         length = flip ? (xstart - xend) : (xend - xstart);
1770         int length = (xend - xstart) * sign;
18791771
18801772         if (spix == ldflag)
18811773         {
r7553r7554
19341826                  span[j].cvg[m] += 2;
19351827               }
19361828
1937               m += m_inc;
1829               m += inv_sign;
19381830            }
19391831         }
19401832      }
r7553r7554
19641856}
19651857#undef addvalues
19661858#undef adjust_attr
1967#undef addleft
1968#undef addright
1969#undef setvalues
19701859
19711860static void triangle_s_t_nz(UINT32 w1, UINT32 w2)
19721861{
r7553r7554
19801869   int drde = 0, dgde = 0, dbde = 0, dade = 0, dsde = 0, dtde = 0, dwde = 0;
19811870   int tilenum;
19821871   int flip = (w1 & 0x800000) ? 1 : 0;
1872   int sign = (w1 & 0x800000) ? -1 : 1;
1873   int inv_sign = (w1 & 0x800000) ?  1 : -1;
19831874
19841875   INT32 yl, ym, yh;
19851876   INT32 xl, xm, xh;
r7553r7554
20071898
20081899   int dsdxh = 0, dtdxh = 0, dwdxh = 0, drdxh = 0, dgdxh = 0, dbdxh = 0, dadxh = 0;
20091900
2010   int m_inc;
20111901   UINT32 min=0, max=3;
20121902   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
20131903
r7553r7554
21682058      dseoff = dteoff = dweoff = dreoff = dgeoff = dbeoff = daeoff = 0;
21692059   }
21702060
2171#define addleft(x) addleftcvg(x,k)
2172#define addright(x) addrightcvg(x,k)
2173#define setvalues() {               \
2174         addvalues();            \
2175         adjust_attr();   \
2176}
2177
21782061   dsdxh = dsdx >> 8;
21792062   dtdxh = dtdx >> 8;
21802063   dwdxh = dwdx >> 8;
r7553r7554
22042087         a += dade; \
22052088}
22062089
2207   m_inc = flip ? 1 : -1;
2208
22092090   ycur =   yh & ~3;
22102091   ylfar = yl | 3;
22112092   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
r7553r7554
22132094   ympix = ym >> 2;
22142095   ylpix = yl >> 2;
22152096
2097   if(ylfar >= 0x1000)
2098   {
2099      ylfar = 0x0fff;
2100   }
2101
22162102   for (k = ycur; k <= ylfar; k++)
22172103   {
22182104      if (k == ym)
r7553r7554
22262112      j = k >> 2;
22272113      spix = k & 3;
22282114
2229      if (k >= 0 && k < 0x1000)
2115      //if (k >= 0 && k < 0x1000)
22302116      {
22312117         int m = 0;
22322118         int n = 0;
2233         int length = 0;
22342119         min = 0; max = 3;
22352120         if (j == yhpix)
22362121         {
r7553r7554
22702155            }
22712156         }
22722157
2273         length = flip ? (xstart - xend) : (xend - xstart);
2158         int length = (xend - xstart) * sign;
22742159
22752160         if (spix == ldflag)
22762161         {
r7553r7554
23292214                  span[j].cvg[m] += 2;
23302215               }
23312216
2332               m += m_inc;
2217               m += inv_sign;
23332218            }
23342219         }
23352220      }
r7553r7554
23592244}
23602245#undef addvalues
23612246#undef adjust_attr
2362#undef addleft
2363#undef addright
2364#undef setvalues
23652247
23662248static void triangle_s_t_z(UINT32 w1, UINT32 w2)
23672249{
r7553r7554
23752257   int drde = 0, dgde = 0, dbde = 0, dade = 0, dzde = 0, dsde = 0, dtde = 0, dwde = 0;
23762258   int tilenum;
23772259   int flip = (w1 & 0x800000) ? 1 : 0;
2260   int sign = (w1 & 0x800000) ? -1 : 1;
2261   int inv_sign = (w1 & 0x800000) ?  1 : -1;
23782262
23792263   INT32 yl, ym, yh;
23802264   INT32 xl, xm, xh;
r7553r7554
24032287
24042288   int dsdxh = 0, dtdxh = 0, dwdxh = 0, drdxh = 0, dgdxh = 0, dbdxh = 0, dadxh = 0, dzdxh = 0;
24052289
2406   int m_inc;
24072290   UINT32 min=0, max=3;
24082291   INT32 maxxmx = 0, minxmx = 0, maxxhx = 0, minxhx = 0;
24092292
r7553r7554
25762459      dseoff = dteoff = dweoff = dreoff = dgeoff = dbeoff = daeoff = dzeoff = 0;
25772460   }
25782461
2579#define addleft(x) addleftcvg(x,k)
2580#define addright(x) addrightcvg(x,k)
2581#define setvalues() {               \
2582         addvalues();            \
2583         adjust_attr();   \
2584}
2585
25862462   dsdxh = dsdx >> 8;
25872463   dtdxh = dtdx >> 8;
25882464   dwdxh = dwdx >> 8;
r7553r7554
26152491         z += dzde; \
26162492}
26172493
2618   m_inc = flip ? 1 : -1;
2619
26202494   ycur =   yh & ~3;
26212495   ylfar = yl | 3;
26222496   ldflag = (sign_dxhdy ^ flip) ? 0 : 3;
r7553r7554
26242498   ympix = ym >> 2;
26252499   ylpix = yl >> 2;
26262500
2501   if(ylfar >= 0x1000)
2502   {
2503      ylfar = 0x0fff;
2504   }
2505
26272506   if(flip)
26282507   {
26292508      for (k = ycur; k <= ylfar; k++)
r7553r7554
26392518         j = k >> 2;
26402519         spix = k & 3;
26412520
2642         if (k >= 0 && k < 0x1000)
2521         //if (k >= 0 && k < 0x1000)
26432522         {
26442523            int m = 0;
26452524            int n = 0;
2646            int length = 0;
26472525            min = 0; max = 3;
26482526            if (j == yhpix)
26492527            {
r7553r7554
26752553               span[j].rx = minxhx;
26762554            }
26772555
2678            length = xstart - xend;
2556            int length = (xend - xstart) * sign;
26792557
26802558            if (spix == ldflag)
26812559            {
r7553r7554
27132591                     span[j].cvg[m] += 2;
27142592                  }
27152593
2716                  m += m_inc;
2594                  m += inv_sign;
27172595               }
27182596            }
27192597         }
r7553r7554
27452623         {
27462624            int m = 0;
27472625            int n = 0;
2748            int length = 0;
27492626            min = 0; max = 3;
27502627            if (j == yhpix)
27512628            {
r7553r7554
27772654               span[j].rx = maxxhx;
27782655            }
27792656
2780            length = xend - xstart;
2657            int length = (xend - xstart) * sign;
27812658
27822659            if (spix == ldflag)
27832660            {
r7553r7554
28152692                     span[j].cvg[m] += 2;
28162693                  }
28172694
2818                  m += m_inc;
2695                  m += inv_sign;
28192696               }
28202697            }
28212698         }
r7553r7554
28442721      default: break; // V-Rally2 does this, fb_size=0
28452722   }
28462723}
2724
28472725#undef addvalues
28482726#undef adjust_attr
2849#undef addleft
2850#undef addright
2851#undef setvalues
src/mame/video/rdptpipe.c
r7553r7554
8181   #endif
8282
8383   #if defined(COPY)
84      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
84      #define CLAMP_LIGHT(SSS, SST) \
8585         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
8686         SST = (SIGN17(SST) >> 5) & 0x1fff;
8787   #else
8888   #if defined(DOS) && defined(DOT)
89      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
89      #define CLAMP_LIGHT(SSS, SST) \
9090         if (SSS & 0x10000) \
9191         { \
9292            SSS = 0; \
r7553r7554
113113            SST = (SIGN17(SST) >> 5) & 0x1fff; \
114114         }
115115   #elif defined(DOS) && !defined(DOT)
116      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
116      #define CLAMP_LIGHT(SSS, SST) \
117117         if (SSS & 0x10000) \
118118         { \
119119            SSS = 0; \
r7553r7554
129129 \
130130         SST = (SIGN17(SST) >> 5) & 0x1fff;
131131   #elif !defined(DOS) && defined(DOT)
132      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
132      #define CLAMP_LIGHT(SSS, SST) \
133133         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
134134 \
135135         if (SST & 0x10000) \
r7553r7554
145145            SST = (SIGN17(SST) >> 5) & 0x1fff; \
146146         }
147147   #else
148      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
148      #define CLAMP_LIGHT(SSS, SST) \
149149         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
150150         SST = (SIGN17(SST) >> 5) & 0x1fff;
151151   #endif
r7553r7554
336336#endif
337337{
338338   INT32 maxs, maxt;
339   COLOR t0, t1, t2, t3, TEX;
340   int sss2, sst2;
339   int sss2 = SSS + 32;
340   int sst2 = SST + 32;
341341
342   INT32 SFRAC = 0, TFRAC = 0, INVSF = 0, INVTF = 0;
343   INT32 R32, G32, B32, A32;
344   INT32 maxs2, maxt2;
345
346342   TEXSHIFT(SSS, SST, maxs, maxt)
347343
348   sss2 = SSS + 32; sst2 = SST + 32;
349   maxs2 = ((sss2 >> 3) >= tex_tile->sh);
350   maxt2 = ((sst2 >> 3) >= tex_tile->th);
351
352344   SSS = RELATIVE(SSS, tex_tile->sl);
353345   SST = RELATIVE(SST, tex_tile->tl);
354346   sss2 = RELATIVE(sss2, tex_tile->sl);
355347   sst2 = RELATIVE(sst2, tex_tile->tl);
356348
357   SFRAC = SSS & 0x1f;
358   TFRAC = SST & 0x1f;
349   INT32 SFRAC = SSS & 0x1f;
350   INT32 TFRAC = SST & 0x1f;
359351
360352   CLAMP(SSS, SST, maxs, maxt)
361   CLAMP_LIGHT(sss2, sst2, maxs2, maxt2)
353   CLAMP_LIGHT(sss2, sst2)
362354
363355   MASK(&SSS, &SST, tex_tile);
364356   MASK(&sss2, &sst2, tex_tile);
365357
366   t1.c = FETCH_TEXEL(sss2, SST);
367   t2.c = FETCH_TEXEL(SSS, sst2);
358   COLOR t1 = { { FETCH_TEXEL(sss2, SST) } };
359   COLOR t2 = { { FETCH_TEXEL(SSS, sst2) } };
368360
361   COLOR TEX;
369362   if ((SFRAC + TFRAC) < 0x20)
370363   {
371      t0.c = FETCH_TEXEL(SSS, SST);
372      R32 = t0.i.r + ((SFRAC*(t1.i.r - t0.i.r))>>5) + ((TFRAC*(t2.i.r - t0.i.r))>>5);
364      COLOR t0 = { { FETCH_TEXEL(SSS, SST) } };
365      INT32 R32 = t0.i.r + ((SFRAC*(t1.i.r - t0.i.r))>>5) + ((TFRAC*(t2.i.r - t0.i.r))>>5);
366      INT32 G32 = t0.i.g + ((SFRAC*(t1.i.g - t0.i.g))>>5) + ((TFRAC*(t2.i.g - t0.i.g))>>5);
367      INT32 B32 = t0.i.b + ((SFRAC*(t1.i.b - t0.i.b))>>5) + ((TFRAC*(t2.i.b - t0.i.b))>>5);
368      INT32 A32 = t0.i.a + ((SFRAC*(t1.i.a - t0.i.a))>>5) + ((TFRAC*(t2.i.a - t0.i.a))>>5);
373369      TEX.i.r = (R32 < 0) ? 0 : R32;
374      G32 = t0.i.g + ((SFRAC*(t1.i.g - t0.i.g))>>5) + ((TFRAC*(t2.i.g - t0.i.g))>>5);
375370      TEX.i.g = (G32 < 0) ? 0 : G32;
376      B32 = t0.i.b + ((SFRAC*(t1.i.b - t0.i.b))>>5) + ((TFRAC*(t2.i.b - t0.i.b))>>5);
377371      TEX.i.b = (B32 < 0) ? 0 : B32;
378      A32 = t0.i.a + ((SFRAC*(t1.i.a - t0.i.a))>>5) + ((TFRAC*(t2.i.a - t0.i.a))>>5);
379372      TEX.i.a = (A32 < 0) ? 0 : A32;
380373   }
381374   else
382375   {
383      INVSF = 0x20 - SFRAC;
384      INVTF = 0x20 - TFRAC;
385      t3.c = FETCH_TEXEL(sss2, sst2);
386      R32 = t3.i.r + ((INVSF*(t2.i.r - t3.i.r))>>5) + ((INVTF*(t1.i.r - t3.i.r))>>5);
376      INT32 INVSF = 0x20 - SFRAC;
377      INT32 INVTF = 0x20 - TFRAC;
378      COLOR t3 = { { FETCH_TEXEL(sss2, sst2) } };
379      INT32 R32 = t3.i.r + ((INVSF*(t2.i.r - t3.i.r))>>5) + ((INVTF*(t1.i.r - t3.i.r))>>5);
380      INT32 G32 = t3.i.g + ((INVSF*(t2.i.g - t3.i.g))>>5) + ((INVTF*(t1.i.g - t3.i.g))>>5);
381      INT32 B32 = t3.i.b + ((INVSF*(t2.i.b - t3.i.b))>>5) + ((INVTF*(t1.i.b - t3.i.b))>>5);
382      INT32 A32 = t3.i.a + ((INVSF*(t2.i.a - t3.i.a))>>5) + ((INVTF*(t1.i.a - t3.i.a))>>5);
387383      TEX.i.r = (R32 < 0) ? 0 : R32;
388      G32 = t3.i.g + ((INVSF*(t2.i.g - t3.i.g))>>5) + ((INVTF*(t1.i.g - t3.i.g))>>5);
389384      TEX.i.g = (G32 < 0) ? 0 : G32;
390      B32 = t3.i.b + ((INVSF*(t2.i.b - t3.i.b))>>5) + ((INVTF*(t1.i.b - t3.i.b))>>5);
391385      TEX.i.b = (B32 < 0) ? 0 : B32;
392      A32 = t3.i.a + ((INVSF*(t2.i.a - t3.i.a))>>5) + ((INVTF*(t1.i.a - t3.i.a))>>5);
393386      TEX.i.a = (A32 < 0) ? 0 : A32;
394387   }
395388
r7553r7554
523516#endif
524517{
525518   INT32 maxs, maxt;
526   COLOR t0, t1, t2, t3, TEX;
527519   int sss2, sst2;
528520
529   INT32 SFRAC = 0, TFRAC = 0, INVSF = 0, INVTF = 0;
530   INT32 R32, G32, B32, A32;
531   INT32 maxs2, maxt2;
532
533521   TEXSHIFT(SSS, SST, maxs, maxt)
534522
535523   sss2 = SSS + 32; sst2 = SST + 32;
536   maxs2 = ((sss2 >> 3) >= tex_tile->sh);
537   maxt2 = ((sst2 >> 3) >= tex_tile->th);
538524
539525   SSS = RELATIVE(SSS, tex_tile->sl);
540526   SST = RELATIVE(SST, tex_tile->tl);
541527   sss2 = RELATIVE(sss2, tex_tile->sl);
542528   sst2 = RELATIVE(sst2, tex_tile->tl);
543529
544   SFRAC = SSS & 0x1f;
545   TFRAC = SST & 0x1f;
530   INT32 SFRAC = SSS & 0x1f;
531   INT32 TFRAC = SST & 0x1f;
546532
547533   CLAMP(SSS, SST, maxs, maxt)
548   CLAMP_LIGHT(sss2, sst2, maxs2, maxt2)
534   CLAMP_LIGHT(sss2, sst2)
549535
550536   MASK(&SSS, &SST, tex_tile);
551537   MASK(&sss2, &sst2, tex_tile);
552538
539   COLOR t0 = { { FETCH_TEXEL(SSS, SST)   } };
540   COLOR t1 = { { FETCH_TEXEL(sss2, SST)  } };
541   COLOR t2 = { { FETCH_TEXEL(SSS, sst2)  } };
542   COLOR t3 = { { FETCH_TEXEL(sss2, sst2) } };
553543
554   t0.c = FETCH_TEXEL(SSS, SST);
555   t1.c = FETCH_TEXEL(sss2, SST);
556   t2.c = FETCH_TEXEL(SSS, sst2);
557   t3.c = FETCH_TEXEL(sss2, sst2);
558
544   COLOR TEX;
559545   if (SFRAC!= 0x10 || TFRAC != 0x10)
560546   {
561547      if ((SFRAC + TFRAC) >= 0x20)
562548      {
563         INVSF = 0x20 - SFRAC;
564         INVTF = 0x20 - TFRAC;
565         R32 = t3.i.r + ((INVSF*(t2.i.r - t3.i.r))>>5) + ((INVTF*(t1.i.r - t3.i.r))>>5);
549         INT32 INVSF = 0x20 - SFRAC;
550         INT32 INVTF = 0x20 - TFRAC;
551         INT32 R32 = t3.i.r + ((INVSF*(t2.i.r - t3.i.r))>>5) + ((INVTF*(t1.i.r - t3.i.r))>>5);
552         INT32 G32 = t3.i.g + ((INVSF*(t2.i.g - t3.i.g))>>5) + ((INVTF*(t1.i.g - t3.i.g))>>5);
553         INT32 B32 = t3.i.b + ((INVSF*(t2.i.b - t3.i.b))>>5) + ((INVTF*(t1.i.b - t3.i.b))>>5);
554         INT32 A32 = t3.i.a + ((INVSF*(t2.i.a - t3.i.a))>>5) + ((INVTF*(t1.i.a - t3.i.a))>>5);
566555         TEX.i.r = (R32 < 0) ? 0 : R32;
567         G32 = t3.i.g + ((INVSF*(t2.i.g - t3.i.g))>>5) + ((INVTF*(t1.i.g - t3.i.g))>>5);
568556         TEX.i.g = (G32 < 0) ? 0 : G32;
569         B32 = t3.i.b + ((INVSF*(t2.i.b - t3.i.b))>>5) + ((INVTF*(t1.i.b - t3.i.b))>>5);
570557         TEX.i.b = (B32 < 0) ? 0 : B32;
571         A32 = t3.i.a + ((INVSF*(t2.i.a - t3.i.a))>>5) + ((INVTF*(t1.i.a - t3.i.a))>>5);
572558         TEX.i.a = (A32 < 0) ? 0 : A32;
573559      }
574560      else
575561      {
576         R32 = t0.i.r + ((SFRAC*(t1.i.r - t0.i.r))>>5) + ((TFRAC*(t2.i.r - t0.i.r))>>5);
562         INT32 R32 = t0.i.r + ((SFRAC*(t1.i.r - t0.i.r))>>5) + ((TFRAC*(t2.i.r - t0.i.r))>>5);
563         INT32 G32 = t0.i.g + ((SFRAC*(t1.i.g - t0.i.g))>>5) + ((TFRAC*(t2.i.g - t0.i.g))>>5);
564         INT32 B32 = t0.i.b + ((SFRAC*(t1.i.b - t0.i.b))>>5) + ((TFRAC*(t2.i.b - t0.i.b))>>5);
565         INT32 A32 = t0.i.a + ((SFRAC*(t1.i.a - t0.i.a))>>5) + ((TFRAC*(t2.i.a - t0.i.a))>>5);
577566         TEX.i.r = (R32 < 0) ? 0 : R32;
578         G32 = t0.i.g + ((SFRAC*(t1.i.g - t0.i.g))>>5) + ((TFRAC*(t2.i.g - t0.i.g))>>5);
579567         TEX.i.g = (G32 < 0) ? 0 : G32;
580         B32 = t0.i.b + ((SFRAC*(t1.i.b - t0.i.b))>>5) + ((TFRAC*(t2.i.b - t0.i.b))>>5);
581568         TEX.i.b = (B32 < 0) ? 0 : B32;
582         A32 = t0.i.a + ((SFRAC*(t1.i.a - t0.i.a))>>5) + ((TFRAC*(t2.i.a - t0.i.a))>>5);
583569         TEX.i.a = (A32 < 0) ? 0 : A32;
584570      }
585571   }
src/mame/video/goldstar.c
r7553r7554
7979         0);
8080}
8181
82static TILE_GET_INFO( get_magical_fg_tile_info )
83{
84   goldstar_state *state = (goldstar_state *)machine->driver_data;
85   int code = state->fg_vidram[tile_index];
86   int attr = state->fg_atrram[tile_index];
87
88   SET_TILE_INFO(
89         0,
90         (code | (attr & 0xf0)<<4)+state->tile_bank*0x1000,
91         attr&0x0f,
92         0);
93}
94
95
8296// colour / high tile bits are swapped around
8397static TILE_GET_INFO( get_cherrym_fg_tile_info )
8498{
r7553r7554
155169         0);
156170}
157171
172WRITE8_HANDLER( unkch_reel1_attrram_w )
173{
174   goldstar_state *state = (goldstar_state *)space->machine->driver_data;
158175
176   state->reel1_attrram[offset] = data;
177   tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
178}
159179
180WRITE8_HANDLER( unkch_reel2_attrram_w )
181{
182   goldstar_state *state = (goldstar_state *)space->machine->driver_data;
183
184   state->reel2_attrram[offset] = data;
185   tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
186}
187
188
189WRITE8_HANDLER( unkch_reel3_attrram_w )
190{
191   goldstar_state *state = (goldstar_state *)space->machine->driver_data;
192
193   state->reel3_attrram[offset] = data;
194   tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
195}
196
197
198static TILE_GET_INFO( get_unkch_reel1_tile_info )
199{
200   goldstar_state *state = (goldstar_state *)machine->driver_data;
201   int code = state->reel1_ram[tile_index];
202   int attr = state->reel1_attrram[tile_index];
203
204   SET_TILE_INFO(
205         1,
206         code | (attr & 0x0f)<<8,
207         (attr&0xf0)>>4,
208         0);
209}
210
211static TILE_GET_INFO( get_unkch_reel2_tile_info )
212{
213   goldstar_state *state = (goldstar_state *)machine->driver_data;
214   int code = state->reel2_ram[tile_index];
215   int attr = state->reel2_attrram[tile_index];
216
217   SET_TILE_INFO(
218         1,
219         code | (attr & 0x0f)<<8,
220         (attr&0xf0)>>4,
221         0);
222}
223
224static TILE_GET_INFO( get_unkch_reel3_tile_info )
225{
226   goldstar_state *state = (goldstar_state *)machine->driver_data;
227   int code = state->reel3_ram[tile_index];
228   int attr = state->reel3_attrram[tile_index];
229
230   SET_TILE_INFO(
231         1,
232         code | (attr & 0x0f)<<8,
233         (attr&0xf0)>>4,
234         0);
235}
236
237
238
239
160240VIDEO_START( goldstar )
161241{
162242   goldstar_state *state = (goldstar_state *)machine->driver_data;
r7553r7554
176256   state->cm_enable_reg = 0x0b;
177257}
178258
259VIDEO_START( magical )
260{
261   goldstar_state *state = (goldstar_state *)machine->driver_data;
262
263   state->reel1_tilemap = tilemap_create(machine,get_goldstar_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
264   state->reel2_tilemap = tilemap_create(machine,get_goldstar_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
265   state->reel3_tilemap = tilemap_create(machine,get_goldstar_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8);
266
267   tilemap_set_scroll_cols(state->reel1_tilemap, 32);
268   tilemap_set_scroll_cols(state->reel2_tilemap, 32);
269   tilemap_set_scroll_cols(state->reel3_tilemap, 32);
270
271   state->fg_tilemap = tilemap_create(machine,get_magical_fg_tile_info,tilemap_scan_rows,8,8, 64, 32);
272   tilemap_set_transparent_pen(state->fg_tilemap,0);
273
274   // is there an enable reg for this game?
275   state->cm_enable_reg = 0x0b;
276}
277
278VIDEO_START( unkch )
279{
280   goldstar_state *state = (goldstar_state *)machine->driver_data;
281
282   state->reel1_tilemap = tilemap_create(machine,get_unkch_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
283   state->reel2_tilemap = tilemap_create(machine,get_unkch_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
284   state->reel3_tilemap = tilemap_create(machine,get_unkch_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8);
285
286   tilemap_set_scroll_cols(state->reel1_tilemap, 32);
287   tilemap_set_scroll_cols(state->reel2_tilemap, 32);
288   tilemap_set_scroll_cols(state->reel3_tilemap, 32);
289
290   state->cmaster_girl_num = 0;
291   state->cmaster_girl_pal = 0;
292   state->unkch_vidreg = 0x00;
293
294   state->fg_tilemap = tilemap_create(machine,get_cherrym_fg_tile_info,tilemap_scan_rows,8,8, 64, 32);
295   tilemap_set_transparent_pen(state->fg_tilemap,0);
296
297   state->cm_enable_reg = 0x0b;
298}
299
179300VIDEO_START( cherrym )
180301{
181302   goldstar_state *state = (goldstar_state *)machine->driver_data;
r7553r7554
263384static const rectangle am1a_visible2 = { 0*8, (14+48)*8-1, 10*8, (10+6)*8-1 };
264385static const rectangle am1a_visible3 = { 0*8, (14+48)*8-1, 16*8, (16+6)*8-1 };
265386
387static const rectangle unkch_visible1 = { 0*8, (14+48)*8-1,  3*8,  (3+7)*8-1 };
388static const rectangle unkch_visible2 = { 0*8, (14+48)*8-1, 10*8, (10+7)*8-1 };
389static const rectangle unkch_visible3 = { 0*8, (14+48)*8-1, 17*8, (17+7)*8-1 };
266390
391static const rectangle magical_visible1 = { 0*8, (14+48)*8-1,  4*8,  (4+8)*8-1 };
392static const rectangle magical_visible2 = { 0*8, (14+48)*8-1, 12*8, (12+8)*8-1 };
393static const rectangle magical_visible3 = { 0*8, (14+48)*8-1, 20*8, (20+8)*8-1 };
394
395static const rectangle magical_visible1alt = { 0*8, (16+48)*8-1,  4*8,  16*8-1 };
396static const rectangle magical_visible2alt = { 0*8, (16+48)*8-1, 16*8,  28*8-1 };
397
398
267399VIDEO_UPDATE( goldstar )
268400{
269401   goldstar_state *state = (goldstar_state *)screen->machine->driver_data;
r7553r7554
309441   return 0;
310442}
311443
444
445VIDEO_UPDATE( magical )
446{
447   goldstar_state *state = (goldstar_state *)screen->machine->driver_data;
448   int i;
449
450   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
451
452   if (!state->cm_enable_reg &0x01)
453      return 0;
454
455   if (state->cm_enable_reg &0x08)
456   {
457      // guess, could be wrong, but different screens clearly need different reel layouts
458      if (state->unkch_vidreg & 2)
459      {
460         for (i= 0;i < 32;i++)
461         {
462            tilemap_set_scrolly(state->reel1_tilemap, i, state->reel1_scroll[i*2]);
463            tilemap_set_scrolly(state->reel2_tilemap, i, state->reel2_scroll[i*2]);
464         //  tilemap_set_scrolly(state->reel3_tilemap, i, state->reel3_scroll[i*2]);
465         }
466
467
468         tilemap_draw(bitmap, &magical_visible1alt, state->reel1_tilemap, 0, 0);
469         tilemap_draw(bitmap, &magical_visible2alt, state->reel2_tilemap, 0, 0);
470         //tilemap_draw(bitmap, &magical_visible3, state->reel3_tilemap, 0, 0);
471      }
472      else
473      {
474         for (i= 0;i < 32;i++)
475         {
476            tilemap_set_scrolly(state->reel1_tilemap, i, state->reel1_scroll[i*2]);
477            tilemap_set_scrolly(state->reel2_tilemap, i, state->reel2_scroll[i*2]);
478            tilemap_set_scrolly(state->reel3_tilemap, i, state->reel3_scroll[i*2]);
479         }
480
481
482         tilemap_draw(bitmap, &magical_visible1, state->reel1_tilemap, 0, 0);
483         tilemap_draw(bitmap, &magical_visible2, state->reel2_tilemap, 0, 0);
484         tilemap_draw(bitmap, &magical_visible3, state->reel3_tilemap, 0, 0);
485      }
486   }
487
488   if (state->cm_enable_reg &0x02)
489   {
490      tilemap_draw(bitmap,cliprect, state->fg_tilemap, 0, 0);
491   }
492
493   return 0;
494}
495
496
497VIDEO_UPDATE( unkch )
498{
499   goldstar_state *state = (goldstar_state *)screen->machine->driver_data;
500   int i;
501
502   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
503
504   if (!state->cm_enable_reg &0x01)
505      return 0;
506
507   if (state->cm_enable_reg &0x08)
508   {
509      // guess, this could be something else completely!!
510      // only draw the first 'reels' tilemap, but fullscreen, using alt registers? (or no scrolling at all? - doubtful, see girl)
511      if (state->unkch_vidreg & 0x40)
512      {
513         for (i= 0;i < 32;i++)
514         {
515            tilemap_set_scrolly(state->reel1_tilemap, i, -0x08/*state->reel1_scroll[(i*2)+1]*/);
516         //  tilemap_set_scrolly(state->reel2_tilemap, i, state->reel2_scroll[(i*2)+1]);
517         //  tilemap_set_scrolly(state->reel3_tilemap, i, state->reel3_scroll[(i*2)+1]);
518         }
519
520         tilemap_draw(bitmap, cliprect, state->reel1_tilemap, 0, 0);
521
522      }
523      // or draw the reels normally?
524      else
525      {
526         for (i= 0;i < 32;i++)
527         {
528            tilemap_set_scrolly(state->reel1_tilemap, i, state->reel1_scroll[i*2]);
529            tilemap_set_scrolly(state->reel2_tilemap, i, state->reel2_scroll[i*2]);
530            tilemap_set_scrolly(state->reel3_tilemap, i, state->reel3_scroll[i*2]);
531         }
532
533         tilemap_draw(bitmap, &unkch_visible1, state->reel1_tilemap, 0, 0);
534         tilemap_draw(bitmap, &unkch_visible2, state->reel2_tilemap, 0, 0);
535         tilemap_draw(bitmap, &unkch_visible3, state->reel3_tilemap, 0, 0);
536      }
537   }
538
539   if (state->cm_enable_reg &0x02)
540   {
541      tilemap_draw(bitmap,cliprect, state->fg_tilemap, 0, 0);
542   }
543
544   return 0;
545}
546
312547VIDEO_UPDATE( cmast91 )
313548{
314549   goldstar_state *state = (goldstar_state *)screen->machine->driver_data;
src/mame/video/cps1.c
r7553r7554
12891289   {"dinoj",    CPS_B_21_QS2, mapper_CD63B },   /* layer enable never used */
12901290   {"dinopic",  CPS_B_21_QS2, mapper_CD63B },   /* layer enable never used */
12911291   {"dinopic2", CPS_B_21_QS2, mapper_CD63B },   /* layer enable never used */
1292   {"dinohunt", CPS_B_21_DEF, mapper_CD63B },   /* Chinese bootleg */
12921293   {"punisher", CPS_B_21_QS3, mapper_PS63B },
12931294   {"punisheru",CPS_B_21_QS3, mapper_PS63B },
12941295   {"punisherj",CPS_B_21_QS3, mapper_PS63B },
12951296   {"punipic",  CPS_B_21_QS3, mapper_PS63B },
12961297   {"punipic2", CPS_B_21_QS3, mapper_PS63B },
12971298   {"punipic3", CPS_B_21_QS3, mapper_PS63B },
1299   {"punisherbz", CPS_B_21_DEF, mapper_PS63B },   /* Chinese bootleg */
12981300   {"slammast", CPS_B_21_QS4, mapper_MB63B },
12991301   {"slammastu",CPS_B_21_QS4, mapper_MB63B },
13001302   {"mbomberj", CPS_B_21_QS4, mapper_MB63B },
r7553r7554
14721474   if (offset == 0x24 / 2 && state->cps_version == 2)
14731475      return;
14741476
1477#ifdef MAME_DEBUG
14751478   if (offset > CPS1_VIDEOCONTROL)
14761479      popmessage("write to CPS-A register %02x contact MAMEDEV", offset * 2);
1480#endif
14771481}
14781482
14791483
r7553r7554
15141518      if (offset == 0x12/2)
15151519         return state->cps_b_regs[0x12 / 2];
15161520   }
1517
1521#ifdef MAME_DEBUG
15181522   popmessage("CPS-B read port %02x contact MAMEDEV", offset * 2);
1519
1523#endif
15201524   return 0xffff;
15211525}
15221526
r7553r7554
15671571      }
15681572   }
15691573
1570
1574#ifdef MAME_DEBUG
15711575   if (offset != state->game_config->cpsb_addr / 2 &&   // only varth writes here
15721576         offset != state->game_config->mult_factor1 / 2 &&
15731577         offset != state->game_config->mult_factor2 / 2 &&
r7553r7554
15831587         offset != state->game_config->out2_addr / 2 &&
15841588         !state->game_config->bootleg_kludge)
15851589      popmessage("CPS-B write %04x to port %02x contact MAMEDEV", data, offset * 2);
1590#endif
15861591}
15871592
15881593
r7553r7554
17691774   if (state->game_config->layer_enable_mask[1] == state->game_config->layer_enable_mask[2])
17701775      enablemask = state->game_config->layer_enable_mask[1];
17711776
1777#ifdef MAME_DEBUG
17721778   if (enablemask)
17731779   {
17741780      if (((layercontrol & enablemask) && (layercontrol & enablemask) != enablemask))
17751781         popmessage("layer %02x contact MAMEDEV", layercontrol & 0xc03f);
17761782   }
1783#endif
17771784
17781785   enablemask = state->game_config->layer_enable_mask[0] | state->game_config->layer_enable_mask[1]
17791786         | state->game_config->layer_enable_mask[2]
17801787         | state->game_config->layer_enable_mask[3] | state->game_config->layer_enable_mask[4];
17811788
1789#ifdef MAME_DEBUG
17821790   if (((layercontrol & ~enablemask) & 0x003e) != 0)
17831791      popmessage("layer %02x contact MAMEDEV", layercontrol & 0xc03f);
1792#endif
1793
17841794}
17851795
17861796}
src/mame/video/rdpmask.c
r7553r7554
1313#endif
1414{
1515#if defined(MASK_S)
16   INT32 swrap;
17#endif
18#if defined(MASK_T)
19   INT32 twrap;
20#endif
21
22#if defined(MASK_S)
23   swrap = *S >> tex_tile->mask_s;
16   INT32 swrap = *S >> tex_tile->mask_s;
2417   swrap &= 1;
2518   if (tex_tile->ms && swrap)
2619   {
r7553r7554
3326#endif
3427
3528#if defined(MASK_T)
36   twrap = *T >> tex_tile->mask_t;
29   INT32 twrap = *T >> tex_tile->mask_t;
3730   twrap &= 1;
3831   if (tex_tile->mt && twrap)
3932   {
src/mame/video/snes.c
r7553r7554
138138
139139INLINE void snes_draw_blend( UINT16 offset, UINT16 *colour, UINT8 prevent_color_math, UINT8 black_pen_clip, int switch_screens )
140140{
141   /* when color math is applied to subscreen pixels, the blending depends on the blending used by the previous mainscreen
142   pixel, except for subscreen pixel 0 which has no previous mainscreen pixel, see comments in snes_refresh_scanline */
141   /* when color math is applied to subscreen pixels, the blending depends on the blending used by the previous mainscreen
142    pixel, except for subscreen pixel 0 which has no previous mainscreen pixel, see comments in snes_refresh_scanline */
143143   if (switch_screens && offset > 0)
144144      offset -= 1;
145145
r7553r7554
480480                     scanlines[SNES_SUBSCREEN].layer[ii >> 1] = layer;
481481                  }
482482               }
483            }   
483            }
484484         }
485485      }
486486   }
r7553r7554
10031003
10041004// FIXME: The following functions should be used to create sprite list with
10051005// obsel data from the previous line. Unfortunately, some games are very picky
1006// about when you set up sprite attributes (e.g. Super Star Wars - The Empire
1006// about when you set up sprite attributes (e.g. Super Star Wars - The Empire
10071007// Strikes Back and Super Street Fighter II) and they would freeze if we only build
10081008// part of the sprite attributes at the right moment and part of them later, during
10091009// scanline drawing. Hence, these functions are on hold until more OAM refactoring
r7553r7554
10601060      {
10611061      case 0:         /* 8x8 or 16x16 */
10621062         oam_list[i].width  = oam_list[i].size ? 2 : 1;
1063         oam_list[i].height = oam_list[i].size ? 2 : 1;
1063         oam_list[i].height = oam_list[i].size ? 2 : 1;
10641064         break;
10651065      case 1:         /* 8x8 or 32x32 */
10661066         oam_list[i].width  = oam_list[i].size ? 4 : 1;
1067         oam_list[i].height = oam_list[i].size ? 4 : 1;
1067         oam_list[i].height = oam_list[i].size ? 4 : 1;
10681068         break;
10691069      case 2:         /* 8x8 or 64x64 */
10701070         oam_list[i].width  = oam_list[i].size ? 8 : 1;
1071         oam_list[i].height = oam_list[i].size ? 8 : 1;
1071         oam_list[i].height = oam_list[i].size ? 8 : 1;
10721072         break;
10731073      case 3:         /* 16x16 or 32x32 */
10741074         oam_list[i].width  = oam_list[i].size ? 4 : 2;
1075         oam_list[i].height = oam_list[i].size ? 4 : 2;
1075         oam_list[i].height = oam_list[i].size ? 4 : 2;
10761076         break;
10771077      case 4:         /* 16x16 or 64x64 */
10781078         oam_list[i].width  = oam_list[i].size ? 8 : 2;
1079         oam_list[i].height = oam_list[i].size ? 8 : 2;
1079         oam_list[i].height = oam_list[i].size ? 8 : 2;
10801080         break;
10811081      case 5:         /* 32x32 or 64x64 */
10821082         oam_list[i].width  = oam_list[i].size ? 8 : 4;
1083         oam_list[i].height = oam_list[i].size ? 8 : 4;
1083         oam_list[i].height = oam_list[i].size ? 8 : 4;
10841084         break;
10851085      case 6:         /* undocumented: 16x32 or 32x64 */
10861086         oam_list[i].width  = oam_list[i].size ? 4 : 2;
1087         oam_list[i].height = oam_list[i].size ? 8 : 4;
1087         oam_list[i].height = oam_list[i].size ? 8 : 4;
10881088         if (snes_ppu.obj_interlace && !oam_list[i].size)
10891089            oam_list[i].height = 2;
10901090         break;
10911091      case 7:         /* undocumented: 16x32 or 32x32 */
10921092         oam_list[i].width  = oam_list[i].size ? 4 : 2;
1093         oam_list[i].height = oam_list[i].size ? 4 : 4;
1093         oam_list[i].height = oam_list[i].size ? 4 : 4;
10941094         if (snes_ppu.obj_interlace && !oam_list[i].size)
10951095            oam_list[i].height = 2;
10961096         break;
r7553r7554
11461146   curline *= snes_ppu.obj_interlace;
11471147
11481148   charaddr = snes_ppu.oam.next_charmap << 13;
1149   
1149
11501150   for (i = 128; i > 0; i--)
11511151   {
11521152      if ((i % 4) == 0)
r7553r7554
13851385      case 7: snes_update_mode_7(curline); break;      /* Mode 7 - Supports direct colour */
13861386   }
13871387}
1388   
1388
13891389/*********************************************
13901390 * snes_update_windowmasks()
13911391 *
r7553r7554
15801580         {
15811581            c = scanline2->buffer[x];
15821582
1583            /* in hires, subscreen pixels are blended as well: for each subscreen pixel, color math is applied if
1584            it had been applied to the previous mainscreen pixel. What happens at subscreen pixel 0 (which has no
1585            previous mainscreen pixel) is undocumented. Until more info are discovered, we (arbitrarily) apply to it
1586            the same color math as the *next* mainscreen pixel (i.e. mainscreen pixel 0) */
1583            /* in hires, subscreen pixels are blended as well: for each subscreen pixel, color math is applied if
1584                it had been applied to the previous mainscreen pixel. What happens at subscreen pixel 0 (which has no
1585                previous mainscreen pixel) is undocumented. Until more info are discovered, we (arbitrarily) apply to it
1586                the same color math as the *next* mainscreen pixel (i.e. mainscreen pixel 0) */
15871587
15881588            if (x == 0 && !scanline1->blend_exception[0] && snes_ppu.layer[scanline1->layer[0]].color_math)
15891589               snes_draw_blend(0, &c, snes_ppu.prevent_color_math, snes_ppu.clip_to_black, 1);
src/mame/video/rdpblend.c
r7553r7554
124124   #endif
125125#endif
126126{
127   int r, g, b;
128   int special_bsel = 0;
129127   UINT16 mem = *fb;
130128#if defined(IMGREAD)
131129   UINT32 memory_cvg = ((mem & 1) << 2) + (*hb & 3);
r7553r7554
144142      return 0;
145143   }
146144
145   int special_bsel = 0;
147146   if (blender2b_a[0] == &memory_color.i.a)
148147   {
149148      special_bsel = 1;
r7553r7554
163162   memory_color.i.a = 0xe0;
164163#endif
165164
165   int r, g, b;
166166#if defined(ZCOMPARE)
167167#if defined(FORCEBLEND)
168168   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
r7553r7554
331331   #endif
332332#endif
333333{
334   int r, g, b;
335   int special_bsel = 0;
336334   UINT16 mem = *fb;
337335#if defined(IMGREAD)
338336   UINT32 memory_cvg = ((mem & 1) << 2) + (*hb & 3);
r7553r7554
351349      return 0;
352350   }
353351
352   int special_bsel = 0;
354353   if (blender2b_a[0] == &memory_color.i.a)
355354   {
356355      special_bsel = 1;
r7553r7554
372371
373372   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
374373
374   int r, g, b;
375375#if defined(FORCEBLEND)
376376   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
377377#else
r7553r7554
496496   #endif
497497#endif
498498{
499   int r, g, b;
500   int special_bsel = 0;
501499   UINT16 mem = *fb;
502500#if defined(IMGREAD)
503501   UINT32 memory_cvg = ((mem & 1) << 2) + (*hb & 3);
r7553r7554
516514      return 0;
517515   }
518516
517   int special_bsel = 0;
519518   if (blender2b_a[0] == &memory_color.i.a)
520519   {
521520      special_bsel = 1;
r7553r7554
535534   memory_color.i.a = 0xe0;
536535#endif
537536
537   int r, g, b;
538538#if defined(ZCOMPARE)
539539#if defined(FORCEBLEND)
540540   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
r7553r7554
631631   #endif
632632#endif
633633{
634   int r, g, b;
635   int special_bsel = 0;
636634   UINT16 mem = *fb;
637635#if defined(IMGREAD)
638636   UINT32 memory_cvg = ((mem & 1) << 2) + (*hb & 3);
r7553r7554
651649      return 0;
652650   }
653651
652   int special_bsel = 0;
654653   if (blender2b_a[0] == &memory_color.i.a)
655654   {
656655      special_bsel = 1;
r7553r7554
672671
673672   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
674673
674   int r, g, b;
675675#if defined(FORCEBLEND)
676676   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
677677#else
src/mame/video/rdpspn16.c
r7553r7554
769769   UINT8 *zhb = &hidden_bits[zb_address >> 1];
770770#endif
771771
772   int i, j;
773
774   int clipx1, clipx2, clipy1, clipy2;
775
776772#if defined(SHADE)
777773   SPAN_PARAM dr = span[0].dr;
778774   SPAN_PARAM dg = span[0].dg;
r7553r7554
828824   }
829825#endif
830826
831   clipx1 = clip.xh / 4;
832   clipx2 = clip.xl / 4;
833   clipy1 = clip.yh / 4;
834   clipy2 = clip.yl / 4;
835
836827#if defined(TEXTURE)
837828   calculate_clamp_diffs(tex_tile->num);
838829
r7553r7554
847838   }
848839#endif
849840
850   if (start < clipy1)
841   if (start < clip.yh)
851842   {
852      start = clipy1;
843      start = clip.yh;
853844   }
854   if (start >= clipy2)
845   if (start >= clip.yl)
855846   {
856      start = clipy2 - 1;
847      start = clip.yl - 1;
857848   }
858   if (end < clipy1)
849   if (end < clip.yh)
859850   {
860      end = clipy1;
851      end = clip.yh;
861852   }
862   if (end >= clipy2) // Needed by 40 Winks
853   if (end >= clip.yl) // Needed by 40 Winks
863854   {
864      end = clipy2 - 1;
855      end = clip.yl - 1;
865856   }
866857
867858#if !defined(SHADE)
r7553r7554
870861
871862   CACHE_TEXTURE_PARAMS(tex_tile);
872863
873   for (i = start; i <= end; i++)
864   for (int i = start; i <= end; i++)
874865   {
875      int xstart = span[i].lx;
876      int xend = span[i].rx;
866      int x = span[i].rx;
877867
878      int x;
879
880868      int fb_index = fb_width * i;
881      int length;
882869
883870#if defined(SHADE)
884871      SPAN_PARAM r = span[i].r;
r7553r7554
895882      SPAN_PARAM z = span[i].z;
896883#endif
897884
898      x = xend;
899
900885#if defined(FLIP)
901      length = (xstart - xend);
886      int length = (span[i].lx - span[i].rx);
902887#else
903      length = (xend - xstart);
888      int length = (span[i].rx - span[i].lx);
904889#endif
905890
906      for (j = 0; j <= length; j++)
891      for (int j = 0; j <= length; j++)
907892      {
908893#if defined(SHADE)
909894         int sr = r.h.h;
r7553r7554
931916         }
932917#endif
933918
934         if (x >= clipx1 && x < clipx2)
919         if (x >= clip.xh && x < clip.xl)
935920         {
936921#if defined(ZCOMPARE)
937922            int z_compare_result = 1;
r7553r7554
994979#endif
995980               {
996981#if defined(ZUPDATE)
997                  int rendered = 0;
998982#endif
999983#if defined(MAGICDITHER)
1000984                  int dith = magic_matrix[(((i) & 3) << 2) + ((x ^ WORD_ADDR_XOR) & 3)];
r7553r7554
1004988
1005989#if defined(ZUPDATE)
1006990#if defined(MAGICDITHER) || defined(BAYERDITHER)
1007                  rendered = BLENDER1_16_DITH(fbcur, hbcur, c1, dith);
991                  int rendered = BLENDER1_16_DITH(fbcur, hbcur, c1, dith);
1008992#else
1009                  rendered = BLENDER1_16_NDITH(fbcur, hbcur, c1);
993                  int rendered = BLENDER1_16_NDITH(fbcur, hbcur, c1);
1010994#endif
1011995
1012996                  if (rendered)
r7553r7554
18191803   UINT8 *zhb = &hidden_bits[zb_address >> 1];
18201804#endif
18211805
1822   int i, j;
1823
1824   int clipx1, clipx2, clipy1, clipy2;
1825
18261806#if defined(SHADE)
18271807   SPAN_PARAM dr = span[0].dr;
18281808   SPAN_PARAM dg = span[0].dg;
r7553r7554
18471827   TILE *tex_tile2 = NULL;
18481828   int tilenum;
18491829
1850   int LOD = 0;
1851   INT32 horstep, vertstep;
1852   INT32 l_tile;
1853   UINT32 magnify = 0;
1854   UINT32 distant = 0;
1830   int nexts;// = 0;
1831   int nextt;// = 0;
1832   int nextsw;// = 0;
18551833
1856   int nexts, nextt, nextsw;
1857   int lodclamp = 0;
1858
18591834   SPAN_PARAM ds = span[0].ds;
18601835   SPAN_PARAM dt = span[0].dt;
18611836   SPAN_PARAM dw = span[0].dw;
r7553r7554
19001875   }
19011876#endif
19021877
1903   clipx1 = clip.xh / 4;
1904   clipx2 = clip.xl / 4;
1905   clipy1 = clip.yh / 4;
1906   clipy2 = clip.yl / 4;
1907
1908   if (start < clipy1)
1878   if (start < clip.yh)
19091879   {
1910      start = clipy1;
1880      start = clip.yh;
19111881   }
1912   if (start >= clipy2)
1882   if (start >= clip.yl)
19131883   {
1914      start = clipy2 - 1;
1884      start = clip.yl - 1;
19151885   }
1916   if (end < clipy1)
1886   if (end < clip.yh)
19171887   {
1918      end = clipy1;
1888      end = clip.yh;
19191889   }
1920   if (end >= clipy2) // Needed by 40 Winks
1890   if (end >= clip.yl) // Needed by 40 Winks
19211891   {
1922      end = clipy2 - 1;
1892      end = clip.yl - 1;
19231893   }
19241894
19251895#if !defined(SHADE)
19261896   shade_color.c = prim_color.c;
19271897#endif
19281898
1929   for (i = start; i <= end; i++)
1899   for (int i = start; i <= end; i++)
19301900   {
1931      int xstart = span[i].lx;
1932      int xend = span[i].rx;
19331901#if defined(SHADE)
19341902      SPAN_PARAM r = span[i].r;
19351903      SPAN_PARAM g = span[i].g;
r7553r7554
19451913      SPAN_PARAM z = span[i].z;
19461914#endif
19471915
1948      int x;
1949
19501916      int fb_index = fb_width * i;
1951      int length;
1917      int x = span[i].rx;
19521918
1953      x = xend;
1954
19551919#if defined(FLIP)
1956      length = (xstart - xend);
1920      int length = (span[i].lx - span[i].rx);
19571921#else
1958      length = (xend - xstart);
1922      int length = (span[i].rx - span[i].lx);
19591923#endif
19601924
1961      for (j = 0; j <= length; j++)
1925      for (int j = 0; j <= length; j++)
19621926      {
19631927#if defined(SHADE)
19641928         int sr = r.h.h;
r7553r7554
19871951         }
19881952#endif
19891953
1990         if (x >= clipx1 && x < clipx2)
1954         if (x >= clip.xh && x < clip.xl)
19911955         {
19921956#if defined(ZCOMPARE)
19931957            int z_compare_result = 1;
r7553r7554
20462010                     nextt = (t.w + dtinc)>>16;
20472011                  }
20482012
2049                  lodclamp = 0;
2013                  int lodclamp = 0;
20502014
2051                  horstep = SIGN17(nexts & 0x1ffff) - SIGN17(sss & 0x1ffff);
2052                  vertstep = SIGN17(nextt & 0x1ffff) - SIGN17(sst & 0x1ffff);
2015                  INT32 horstep = SIGN17(nexts & 0x1ffff) - SIGN17(sss & 0x1ffff);
2016                  INT32 vertstep = SIGN17(nextt & 0x1ffff) - SIGN17(sst & 0x1ffff);
20532017                  if (horstep & 0x20000)
20542018                  {
20552019                     horstep = ~horstep & 0x1ffff;
r7553r7554
20582022                  {
20592023                     vertstep = ~vertstep & 0x1ffff;
20602024                  }
2061                  LOD = ((horstep >= vertstep) ? horstep : vertstep);
2025                  int LOD = ((horstep >= vertstep) ? horstep : vertstep);
20622026                  LOD = (LOD >= span[0].dymax) ? LOD : span[0].dymax;
20632027
20642028                  if ((LOD & 0x1c000) || lodclamp)
r7553r7554
20702034                     LOD = min_level;
20712035                  }
20722036
2073                  magnify = (LOD < 32) ? 1: 0;
2074                  l_tile = getlog2((LOD >> 5) & 0xff);
2075                  distant = ((LOD & 0x6000) || (l_tile >= max_level)) ? 1 : 0;
2037                  bool magnify = (LOD < 32);
2038                  INT32 l_tile = getlog2((LOD >> 5) & 0xff);
2039                  bool distant = ((LOD & 0x6000) || (l_tile >= max_level));
20762040
20772041                  lod_frac = ((LOD << 3) >> l_tile) & 0xff;
20782042
src/mame/video/rdpacvg.c
r7553r7554
22{
33   UINT32 temp = *comb_alpha;
44   UINT32 temp2 = curpixel_cvg;
5   UINT32 temp3 = 0;
65
7   temp3 = (temp * temp2) + 4;
6   UINT32 temp3 = (temp * temp2) + 4;
87   curpixel_cvg = temp3 >> 8;
98
109   temp = (temp3 >> 3);
r7553r7554
2120
2221INLINE void alpha_cvg_get_ncta_ca(UINT8 *comb_alpha)
2322{
24   UINT32 temp = *comb_alpha;
2523   UINT32 temp2 = curpixel_cvg;
24   UINT32 temp = temp2 << 5;
2625
27   temp = temp2 << 5;
28
2926   if (temp > 0xff)
3027   {
3128      *comb_alpha = 0xff;
r7553r7554
4037{
4138   UINT32 temp = *comb_alpha;
4239   UINT32 temp2 = curpixel_cvg;
43   UINT32 temp3 = 0;
40   UINT32 temp3 = (temp * temp2) + 4;
4441
45   temp3 = (temp * temp2) + 4;
4642   curpixel_cvg = temp3 >> 8;
4743
4844   if (temp > 0xff)
src/mame/video/rdptrect.c
r7553r7554
4343   UINT8 *zhb = &hidden_bits[zb_address >> 1];
4444#endif
4545
46   int i, j;
47   int x1, x2, y1, y2;
48   int s, t;
49
50   int clipx1, clipx2, clipy1, clipy2;
51
5246   UINT32 tilenum = rect->tilenum;
5347   TILE *tex_tile = &tile[rect->tilenum];
5448
55   x1 = (rect->xh / 4);
56   x2 = (rect->xl / 4);
57   y1 = (rect->yh / 4);
58   y2 = (rect->yl / 4);
49   int x1 = rect->xh;
50   int x2 = rect->xl;
51   int y1 = rect->yh;
52   int y2 = rect->yl;
5953
60   if (x2<=x1)
54   if (x2 <= x1)
6155   {
6256      x2 = x1 + 1;
6357   }
64   if (y1==y2)
58   if (y1 == y2)
6559   {
6660      y2 = y1 + 1; // Needed by Goldeneye
6761   }
r7553r7554
7569      y2++;
7670   }
7771
78   clipx1 = clip.xh / 4;
79   clipx2 = clip.xl / 4;
80   clipy1 = clip.yh / 4;
81   clipy2 = clip.yl / 4;
82
8372   calculate_clamp_diffs(tilenum);
8473
8574   shade_color.c = 0;   // Needed by Pilotwings 64
8675
8776   CACHE_TEXTURE_PARAMS(tex_tile);
8877
89   if(y1 < clipy1)
78   if(y1 < clip.yh)
9079   {
91      rect->t += rect->dtdy * (clipy1 - y1);
92      y1 = clipy1;
80      rect->t += rect->dtdy * (clip.yh - y1);
81      y1 = clip.yh;
9382   }
94   if(y2 > clipy2)
83   if(y2 > clip.yl)
9584   {
96      y2 = clipy2;
85      y2 = clip.yl;
9786   }
98   if(x1 < clipx1)
87   if(x1 < clip.xh)
9988   {
100      rect->s += rect->dsdx * (clipx1 - x1);
101      x1 = clipx1;
89      rect->s += rect->dsdx * (clip.xh - x1);
90      x1 = clip.xh;
10291   }
103   if(x2 > clipx2)
92   if(x2 > clip.xl)
10493   {
105      x2 = clipx2;
94      x2 = clip.xl;
10695   }
10796   rect->dsdx >>= 5;
10897   rect->dtdy >>= 5;
10998
110   t = ((int)(rect->t));
99   int t = ((int)(rect->t));
111100
112101   if(rect->flip)
113102   {
114      for (j = y1; j < y2; j++)
103      for (int j = y1; j < y2; j++)
115104      {
116105         int fb_index = j * fb_width;
117106#if defined(MAGICDITHER) || defined(BAYERDITHER)
118107         int mline = (j & 3) << 2;
119108#endif
120         s = ((int)(rect->s));
109         int s = ((int)(rect->s));
121110
122         for (i = x1; i < x2; i++)
111         for (int i = x1; i < x2; i++)
123112         {
124113            COLOR c;
125114#if defined(ZUPDATE)
r7553r7554
184173   }
185174   else
186175   {
187      for (j = y1; j < y2; j++)
176      for (int j = y1; j < y2; j++)
188177      {
189178         int fb_index = j * fb_width;
190179#if defined(MAGICDITHER) || defined(BAYERDITHER)
191180         int mline = (j & 3) << 2;
192181#endif
193182
194         s = ((int)(rect->s));
183         int s = ((int)(rect->s));
195184
196         for (i = x1; i < x2; i++)
185         for (int i = x1; i < x2; i++)
197186         {
198187            COLOR c;
199188#if defined(ZUPDATE)
r7553r7554
308297   UINT8 *zhb = &hidden_bits[zb_address >> 1];
309298#endif
310299
311   int i, j;
312   int x1, x2, y1, y2;
313   int s, t;
314
315   int clipx1, clipx2, clipy1, clipy2;
316
317300   UINT32 tilenum = rect->tilenum;
318301   UINT32 tilenum2 = 0;
319302   TILE *tex_tile = &tile[rect->tilenum];
320303   TILE *tex_tile2 = NULL;
321304
322   x1 = (rect->xh / 4);
323   x2 = (rect->xl / 4);
324   y1 = (rect->yh / 4);
325   y2 = (rect->yl / 4);
305   int x1 = rect->xh;
306   int x2 = rect->xl;
307   int y1 = rect->yh;
308   int y2 = rect->yl;
326309
327   if (x2<=x1)
310   if (x2 <= x1)
328311   {
329312      x2 = x1 + 1;
330313   }
331   if (y1==y2)
314   if (y1 == y2)
332315   {
333316      y2 = y1 + 1; // Needed by Goldeneye
334317   }
r7553r7554
342325      y2++;
343326   }
344327
345   clipx1 = clip.xh / 4;
346   clipx2 = clip.xl / 4;
347   clipy1 = clip.yh / 4;
348   clipy2 = clip.yl / 4;
349
350328   calculate_clamp_diffs(tilenum);
351329
352330   if (!other_modes.tex_lod_en)
r7553r7554
362340
363341   shade_color.c = 0;   // Needed by Pilotwings 64
364342
365   if(y1 < clipy1)
343   if(y1 < clip.yh)
366344   {
367      rect->t += rect->dtdy * (clipy1 - y1);
368      y1 = clipy1;
345      rect->t += rect->dtdy * (clip.yh - y1);
346      y1 = clip.yh;
369347   }
370   if(y2 > clipy2)
348   if(y2 > clip.yl)
371349   {
372      y2 = clipy2;
350      y2 = clip.yl;
373351   }
374   if(x1 < clipx1)
352   if(x1 < clip.xh)
375353   {
376      rect->s += rect->dsdx * (clipx1 - x1);
377      x1 = clipx1;
354      rect->s += rect->dsdx * (clip.xh - x1);
355      x1 = clip.xh;
378356   }
379   if(x2 > clipx2)
357   if(x2 > clip.xl)
380358   {
381      x2 = clipx2;
359      x2 = clip.xl;
382360   }
383361   rect->dsdx >>= 5;
384362   rect->dtdy >>= 5;
385363
386   t = ((int)(rect->t));
364   int t = ((int)(rect->t));
387365
388366   if(rect->flip)
389367   {
390      for (j = y1; j < y2; j++)
368      for (int j = y1; j < y2; j++)
391369      {
392         //if (j >= clipy1 && j < clipy2)
393370         {
394371            int fb_index = j * fb_width;
395372#if defined(MAGICDITHER) || defined(BAYERDITHER)
396373            int mline = (j & 3) << 2;
397374#endif
398            s = (int)(rect->s);
375            int s = (int)(rect->s);
399376
400            for (i = x1; i < x2; i++)
377            for (int i = x1; i < x2; i++)
401378            {
402               //if (i >= clipx1 && i < clipx2)
403379               {
404380                  COLOR c1, c2;
405381#if defined(ZUPDATE)
r7553r7554
470446   }
471447   else
472448   {
473      for (j = y1; j < y2; j++)
449      for (int j = y1; j < y2; j++)
474450      {
475         //if (j >= clipy1 && j < clipy2)
476451         {
477452            int fb_index = j * fb_width;
478453#if defined(MAGICDITHER) || defined(BAYERDITHER)
479454            int mline = (j & 3) << 2;
480455#endif
481            s = (int)(rect->s);
456            int s = (int)(rect->s);
482457
483            for (i = x1; i < x2; i++)
458            for (int i = x1; i < x2; i++)
484459            {
485               //if (i >= clipx1 && i < clipx2)
486460               {
487461                  COLOR c1, c2;
488462#if defined(ZUPDATE)
r7553r7554
593567{
594568   UINT16 *fb = (UINT16*)&rdram[(fb_address / 4)];
595569
596   int i, j;
597   int x1, x2, y1, y2;
598   int s, t;
599
600   int clipx1, clipx2, clipy1, clipy2;
601
602570   UINT32 tilenum = rect->tilenum;
603571   TILE *tex_tile = &tile[rect->tilenum];
604572
605   x1 = (rect->xh / 4);
606   x2 = (rect->xl / 4);
607   y1 = (rect->yh / 4);
608   y2 = (rect->yl / 4);
573   int x1 = rect->xh;
574   int x2 = rect->xl;
575   int y1 = rect->yh;
576   int y2 = rect->yl;
609577
610   if (x2<=x1)
578   if (x2 <= x1)
611579   {
612580      x2 = x1 + 1;
613581   }
614   if (y1==y2)
582   if (y1 == y2)
615583   {
616584      y2 = y1 + 1; // Needed by Goldeneye
617585   }
r7553r7554
620588   x2 += 1;
621589   y2 += 1;
622590
623   clipx1 = clip.xh / 4;
624   clipx2 = clip.xl / 4;
625   clipy1 = clip.yh / 4;
626   clipy2 = clip.yl / 4;
627
628591   calculate_clamp_diffs(tilenum);
629592
630593   shade_color.c = 0;   // Needed by Pilotwings 64
631594
632595   CACHE_TEXTURE_PARAMS(tex_tile);
633596
634   if(y1 < clipy1)
597   if(y1 < clip.yh)
635598   {
636      rect->t += rect->dtdy * (clipy1 - y1);
637      y1 = clipy1;
599      rect->t += rect->dtdy * (clip.yh - y1);
600      y1 = clip.yh;
638601   }
639   if(y2 > clipy2)
602   if(y2 > clip.yl)
640603   {
641      y2 = clipy2;
604      y2 = clip.yl;
642605   }
643   if(x1 < clipx1)
606   if(x1 < clip.xh)
644607   {
645      rect->s += rect->dsdx * (clipx1 - x1);
646      x1 = clipx1;
608      rect->s += rect->dsdx * (clip.xh - x1);
609      x1 = clip.xh;
647610   }
648   if(x2 > clipx2)
611   if(x2 > clip.xl)
649612   {
650      x2 = clipx2;
613      x2 = clip.xl;
651614   }
652615   rect->dsdx >>= 5;
653616   rect->dtdy >>= 5;
654617
655   t = ((int)(rect->t));
618   int t = ((int)(rect->t));
656619
657620   if(rect->flip)
658621   {
659      for (j = y1; j < y2; j++)
622      for (int j = y1; j < y2; j++)
660623      {
661624         int fb_index = j * fb_width;
662         //if (j >= clipy1 && j < clipy2)
663625         {
664            s = (int)(rect->s);
626            int s = (int)(rect->s);
665627
666            for (i = x1; i < x2; i++)
628            for (int i = x1; i < x2; i++)
667629            {
668               //if (i >= clipx1 && i < clipx2)
669630               {
670631                  texel0_color.c = TEXTURE_PIPELINE(t, s, tex_tile);
671632
r7553r7554
684645   }
685646   else
686647   {
687      for (j = y1; j < y2; j++)
648      for (int j = y1; j < y2; j++)
688649      {
689650         int fb_index = j * fb_width;
690         //if (j >= clipy1 && j < clipy2)
691651         {
692            s = (int)(rect->s);
652            int s = (int)(rect->s);
693653
694            for (i = x1; i < x2; i++)
654            for (int i = x1; i < x2; i++)
695655            {
696               //if (i >= clipx1 && i < clipx2)
697               {
698                  texel0_color.c = TEXTURE_PIPELINE(s, t, tex_tile);
656               texel0_color.c = TEXTURE_PIPELINE(s, t, tex_tile);
699657
700                  curpixel_cvg = 8;
658               curpixel_cvg = 8;
701659
702                  if ((texel0_color.i.a != 0)||(!other_modes.alpha_compare_en))
703                  {
704                     fb[(fb_index + i) ^ WORD_ADDR_XOR] = ((texel0_color.i.r >> 3) << 11) | ((texel0_color.i.g >> 3) << 6) | ((texel0_color.i.b >> 3) << 1)|1;
705                  }
660               if ((texel0_color.i.a != 0)||(!other_modes.alpha_compare_en))
661               {
662                  fb[(fb_index + i) ^ WORD_ADDR_XOR] = ((texel0_color.i.r >> 3) << 11) | ((texel0_color.i.g >> 3) << 6) | ((texel0_color.i.b >> 3) << 1)|1;
706663               }
707664               s += rect->dsdx;
708665            }
src/mame/video/rdpfb.c
r7553r7554
55#endif
66{
77#undef CVG_DRAW
8   UINT16 finalcolor;
98   UINT32 memory_cvg = ((*fb & 1) << 2) + (*hb & 3) + 1;
10   UINT32 newcvg;
11   UINT32 wrapflag;
12   UINT32 clampcvg;
139#ifdef CVG_DRAW
1410   int covdraw;
1511   if (curpixel_cvg == 8)
r7553r7554
2824      curpixel_overlap = 0;
2925   }
3026
31   newcvg = curpixel_cvg + memory_cvg;
32   wrapflag = (newcvg > 8) ? 1 : 0;
27   UINT32 newcvg = curpixel_cvg + memory_cvg;
28   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
3329
34   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
30   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
3531
36   clampcvg = (newcvg > 8) ? 8 : newcvg;
32   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
3733   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
3834
3935   curpixel_cvg--;
r7553r7554
7167#endif
7268{
7369#undef CVG_DRAW
74   UINT16 finalcolor;
7570   UINT32 memory_cvg = ((*fb & 1) << 2) + (*hb & 3) + 1;
76   UINT32 newcvg;
77   UINT32 wrapflag;
78   UINT32 clampcvg;
7971#ifdef CVG_DRAW
8072   int covdraw;
8173   if (curpixel_cvg == 8)
r7553r7554
9486      curpixel_overlap = 0;
9587   }
9688
97   newcvg = curpixel_cvg + memory_cvg;
98   wrapflag = (newcvg > 8) ? 1 : 0;
89   UINT32 newcvg = curpixel_cvg + memory_cvg;
90   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
9991
100   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
92   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
10193
102   clampcvg = (newcvg > 8) ? 8 : newcvg;
94   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
10395   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
10496
10597   curpixel_cvg--;
r7553r7554
129121#endif
130122{
131123#undef CVG_DRAW
132   UINT16 finalcolor;
133124   UINT32 memory_cvg = ((*fb & 1) << 2) + (*hb & 3) + 1;
134   UINT32 newcvg;
135   UINT32 wrapflag;
136   UINT32 clampcvg;
137125#ifdef CVG_DRAW
138126   int covdraw;
139127   if (curpixel_cvg == 8)
r7553r7554
152140      curpixel_overlap = 0;
153141   }
154142
155   newcvg = curpixel_cvg + memory_cvg;
156   wrapflag = (newcvg > 8) ? 1 : 0;
143   UINT32 newcvg = curpixel_cvg + memory_cvg;
144   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
157145
158   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
146   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
159147
160   clampcvg = (newcvg > 8) ? 8 : newcvg;
148   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
161149   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
162150
163151   curpixel_cvg--;
r7553r7554
187175#endif
188176{
189177#undef CVG_DRAW
190   UINT16 finalcolor;
191178   UINT32 memory_cvg = ((*fb & 1) << 2) + (*hb & 3) + 1;
192   UINT32 newcvg;
193   UINT32 wrapflag;
194   UINT32 clampcvg;
195179#ifdef CVG_DRAW
196180   int covdraw;
197181   if (curpixel_cvg == 8)
r7553r7554
210194      curpixel_overlap = 0;
211195   }
212196
213   newcvg = curpixel_cvg + memory_cvg;
214   wrapflag = (newcvg > 8) ? 1 : 0;
197   UINT32 newcvg = curpixel_cvg + memory_cvg;
198   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
215199
216   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
200   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
217201
218   clampcvg = (newcvg > 8) ? 8 : newcvg;
202   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
219203   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
220204
221205   curpixel_cvg--;
r7553r7554
245229#endif
246230{
247231#undef CVG_DRAW
248   UINT16 finalcolor;
249   UINT32 newcvg;
250   UINT32 wrapflag;
251   UINT32 clampcvg;
252232#ifdef CVG_DRAW
253233   int covdraw;
254234   if (curpixel_cvg == 8)
r7553r7554
267247      curpixel_overlap = 0;
268248   }
269249
270   newcvg = curpixel_cvg + 8;
271   wrapflag = (newcvg > 8) ? 1 : 0;
250   UINT32 newcvg = curpixel_cvg + 8;
251   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
272252
273   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
253   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
274254
275   clampcvg = (newcvg > 8) ? 8 : newcvg;
255   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
276256   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
277257
278258   curpixel_cvg--;
r7553r7554
309289#endif
310290{
311291#undef CVG_DRAW
312   UINT16 finalcolor;
313   UINT32 newcvg;
314   UINT32 wrapflag;
315   UINT32 clampcvg;
316292#ifdef CVG_DRAW
317293   int covdraw;
318294   if (curpixel_cvg == 8)
r7553r7554
331307      curpixel_overlap = 0;
332308   }
333309
334   newcvg = curpixel_cvg + 8;
335   wrapflag = (newcvg > 8) ? 1 : 0;
310   UINT32 newcvg = curpixel_cvg + 8;
311   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
336312
337   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
313   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
338314
339   clampcvg = (newcvg > 8) ? 8 : newcvg;
315   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
340316   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
341317
342318   curpixel_cvg--;
r7553r7554
365341#endif
366342{
367343#undef CVG_DRAW
368   UINT16 finalcolor;
369   UINT32 newcvg;
370   UINT32 wrapflag;
371   UINT32 clampcvg;
372344#ifdef CVG_DRAW
373345   int covdraw;
374346   if (curpixel_cvg == 8)
r7553r7554
387359      curpixel_overlap = 0;
388360   }
389361
390   newcvg = curpixel_cvg + 8;
391   wrapflag = (newcvg > 8) ? 1 : 0;
362   UINT32 newcvg = curpixel_cvg + 8;
363   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
392364
393   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
365   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
394366
395   clampcvg = (newcvg > 8) ? 8 : newcvg;
367   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
396368   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
397369
398370   curpixel_cvg--;
r7553r7554
421393#endif
422394{
423395#undef CVG_DRAW
424   UINT16 finalcolor;
425   UINT32 newcvg;
426   UINT32 wrapflag;
427   UINT32 clampcvg;
428396#ifdef CVG_DRAW
429397   int covdraw;
430398   if (curpixel_cvg == 8)
r7553r7554
443411      curpixel_overlap = 0;
444412   }
445413
446   newcvg = curpixel_cvg + 8;
447   wrapflag = (newcvg > 8) ? 1 : 0;
414   UINT32 newcvg = curpixel_cvg + 8;
415   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
448416
449   finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
417   UINT16 finalcolor = ((r >> 3) << 11) | ((g >> 3) << 6) | ((b >> 3) << 1);
450418
451   clampcvg = (newcvg > 8) ? 8 : newcvg;
419   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
452420   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
453421
454422   curpixel_cvg--;
r7553r7554
478446{
479447   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
480448   UINT32 memory_cvg = ((*fb >>5) & 7) + 1;
481   UINT32 newcvg;
482   UINT32 wrapflag;
483   UINT32 clampcvg;
484449
485   newcvg = curpixel_cvg + memory_cvg;
486   wrapflag = (newcvg > 8) ? 1 : 0;
487   clampcvg = (newcvg > 8) ? 8 : newcvg;
450   UINT32 newcvg = curpixel_cvg + memory_cvg;
451   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
452   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
488453   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
489454
490455   curpixel_cvg--;
r7553r7554
520485{
521486   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
522487   UINT32 memory_cvg = ((*fb >>5) & 7) + 1;
523   UINT32 newcvg;
524   UINT32 wrapflag;
525   UINT32 clampcvg;
526488
527   newcvg = curpixel_cvg + memory_cvg;
528   wrapflag = (newcvg > 8) ? 1 : 0;
529   clampcvg = (newcvg > 8) ? 8 : newcvg;
489   UINT32 newcvg = curpixel_cvg + memory_cvg;
490   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
491   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
530492   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
531493
532494   curpixel_cvg--;
r7553r7554
555517{
556518   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
557519   UINT32 memory_cvg = ((*fb >>5) & 7) + 1;
558   UINT32 newcvg;
559   UINT32 wrapflag;
560   UINT32 clampcvg;
561520
562   newcvg = curpixel_cvg + memory_cvg;
563   wrapflag = (newcvg > 8) ? 1 : 0;
564   clampcvg = (newcvg > 8) ? 8 : newcvg;
521   UINT32 newcvg = curpixel_cvg + memory_cvg;
522   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
523   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
565524   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
566525
567526   curpixel_cvg--;
r7553r7554
591550   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
592551   UINT32 memory_alphachannel = *fb & 0xff;
593552   UINT32 memory_cvg = ((*fb >>5) & 7) + 1;
594   UINT32 newcvg;
595   UINT32 wrapflag;
596   UINT32 clampcvg;
597553
598   newcvg = curpixel_cvg + memory_cvg;
599   wrapflag = (newcvg > 8) ? 1 : 0;
600   clampcvg = (newcvg > 8) ? 8 : newcvg;
554   UINT32 newcvg = curpixel_cvg + memory_cvg;
555   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
556   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
601557   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
602558
603559   curpixel_cvg--;
r7553r7554
625581#endif
626582{
627583   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
628   UINT32 newcvg;
629   UINT32 wrapflag;
630   UINT32 clampcvg;
631584
632   newcvg = curpixel_cvg + 8;
633   wrapflag = (newcvg > 8) ? 1 : 0;
634   clampcvg = (newcvg > 8) ? 8 : newcvg;
585   UINT32 newcvg = curpixel_cvg + 8;
586   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
587   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
635588   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
636589
637590   curpixel_cvg--;
r7553r7554
665618#endif
666619{
667620   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
668   UINT32 newcvg;
669   UINT32 wrapflag;
670   UINT32 clampcvg;
671621
672   newcvg = curpixel_cvg + 8;
673   wrapflag = (newcvg > 8) ? 1 : 0;
674   clampcvg = (newcvg > 8) ? 8 : newcvg;
622   UINT32 newcvg = curpixel_cvg + 8;
623   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
624   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
675625   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
676626
677627   curpixel_cvg--;
r7553r7554
698648#endif
699649{
700650   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
701   UINT32 newcvg;
702   UINT32 wrapflag;
703   UINT32 clampcvg;
704651
705   newcvg = curpixel_cvg + 8;
706   wrapflag = (newcvg > 8) ? 1 : 0;
707   clampcvg = (newcvg > 8) ? 8 : newcvg;
652   UINT32 newcvg = curpixel_cvg + 8;
653   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
654   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
708655   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
709656
710657   curpixel_cvg--;
r7553r7554
732679{
733680   UINT32 finalcolor=(r << 24) | (g << 16) | (b << 8);
734681   UINT32 memory_alphachannel = *fb & 0xff;
735   UINT32 newcvg;
736   UINT32 wrapflag;
737   UINT32 clampcvg;
738682
739   newcvg = curpixel_cvg + 8;
740   wrapflag = (newcvg > 8) ? 1 : 0;
741   clampcvg = (newcvg > 8) ? 8 : newcvg;
683   UINT32 newcvg = curpixel_cvg + 8;
684   UINT32 wrapflag = (newcvg > 8) ? 1 : 0;
685   UINT32 clampcvg = (newcvg > 8) ? 8 : newcvg;
742686   newcvg = (wrapflag)? (newcvg - 8) : newcvg;
743687
744688   curpixel_cvg--;
src/mame/video/konamigx.c
r7553r7554
20802080      konamigx_mixer_primode(4);
20812081   } else
20822082
2083   if (!strcmp(machine->gamedrv->name,"gokuparo") || !strcmp(machine->gamedrv->name,"fantjour"))
2083   if (!strcmp(machine->gamedrv->name,"gokuparo") || !strcmp(machine->gamedrv->name,"fantjour") || !strcmp(machine->gamedrv->name,"fantjoura"))
20842084   {
20852085      K053247GP_set_SpriteOffset(-46, -23);
20862086   } else
src/mame/video/ppu2c0x.c
r7553r7554
10291029
10301030   if (offset >= PPU_MAX_REG)
10311031   {
1032      logerror("PPU %s(r): Attempting to read past the chip\n", device->tag.cstr());
1032      logerror("PPU %s(r): Attempting to read past the chip\n", device->tag());
10331033      offset &= PPU_MAX_REG - 1;
10341034   }
10351035
src/mame/video/n64.c
r7553r7554
134134typedef struct
135135{
136136   int cycle_type;
137   int persp_tex_en;
138   int detail_tex_en;
139   int sharpen_tex_en;
140   int tex_lod_en;
141   int en_tlut;
142   int tlut_type;
143   int sample_type;
144   int mid_texel;
145   int bi_lerp0;
146   int bi_lerp1;
147   int convert_one;
148   int key_en;
137   bool persp_tex_en;
138   bool detail_tex_en;
139   bool sharpen_tex_en;
140   bool tex_lod_en;
141   bool en_tlut;
142   bool tlut_type;
143   bool sample_type;
144   bool mid_texel;
145   bool bi_lerp0;
146   bool bi_lerp1;
147   bool convert_one;
148   bool key_en;
149149   int rgb_dither_sel;
150150   int alpha_dither_sel;
151151   int blend_m1a_0;
r7553r7554
157157   int blend_m2b_0;
158158   int blend_m2b_1;
159159    int tex_edge;
160   int force_blend;
161   int alpha_cvg_select;
162   int cvg_times_alpha;
160   bool force_blend;
161   bool alpha_cvg_select;
162   bool cvg_times_alpha;
163163   int z_mode;
164164   int cvg_dest;
165   int color_on_cvg;
166   int image_read_en;
167   int z_update_en;
168   int z_compare_en;
169   int antialias_en;
170   int z_source_sel;
171   int dither_alpha_en;
172   int alpha_compare_en;
165   bool color_on_cvg;
166   bool image_read_en;
167   bool z_update_en;
168   bool z_compare_en;
169   bool antialias_en;
170   bool z_source_sel;
171   bool dither_alpha_en;
172   bool alpha_compare_en;
173173} OTHER_MODES;
174174
175175/*****************************************************************************/
r7553r7554
318318INLINE void z_store(UINT16* zb, UINT8* zhb, UINT32 z, UINT32 deltaz);
319319INLINE INT32 normalize_dzpix(INT32 sum);
320320INLINE INT32 CLIP(INT32 value,INT32 min,INT32 max);
321INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, UINT32 hres);
321INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres);
322322INLINE void divot_filter16(UINT8* r, UINT8* g, UINT8* b, UINT16* fbuff, UINT32 fbuff_index);
323323INLINE void restore_filter16(INT32* r, INT32* g, INT32* b, UINT16* fbuff, UINT32 fbuff_index, UINT32 hres);
324324INLINE UINT32 getlog2(UINT32 lod_clamp);
r7553r7554
430430
431431VIDEO_START(n64)
432432{
433   int i = 0, j = 0;
434433   UINT8 *normpoint = memory_region(machine, "normpoint");
435434   UINT8 *normslope = memory_region(machine, "normslope");
436435
437436   if (LOG_RDP_EXECUTION)
437   {
438438      rdp_exec = fopen("rdp_execute.txt", "wt");
439   }
439440
440441   TMEM = auto_alloc_array(machine, UINT8, 0x1004); // 4 guard bytes
441442   memset(TMEM, 0, 0x1000);
r7553r7554
446447   one_color.c = 0xffffffff;
447448   zero_color.c = 0;
448449
449   for(i = 0; i < (1 << 21); i++)
450   for(int i = 0; i < (1 << 21); i++)
450451   {
451452      INT32 frac = i >> 16;
452453      INT32 left = (i >> 8) & 0x000000ff;
r7553r7554
454455      tex_lerp_lut[i] = (frac*(left - right))>>5;
455456   }
456457
457   for(i = 0; i < (1 << 24); i++)
458   for(int i = 0; i < (1 << 24); i++)
458459   {
459460      UINT8 A = (i >> 16) & 0x000000ff;
460461      UINT8 B = (i >> 8) & 0x000000ff;
r7553r7554
462463      cc_lut1[i] = (INT16)((((((INT32)A - (INT32)B) * (INT32)C) + 0x80) >> 8) & 0x0000ffff);
463464   }
464465
465   for(i = 0; i < (1 << 16); i++)
466   for(int i = 0; i < (1 << 16); i++)
466467   {
467      for(j = 0; j < (1 << 8); j++)
468      for(int j = 0; j < (1 << 8); j++)
468469      {
469470         INT32 temp = (INT32)((INT16)i) + j;
470471         if(temp > 255)
r7553r7554
482483      }
483484   }
484485
485   for(i = 0; i < (1 << 16); i++)
486   for(int i = 0; i < (1 << 16); i++)
486487   {
487488      UINT8 r = ((i >> 8) & 0xf8) | (i >> 13);
488489      UINT8 g = ((i >> 3) & 0xf8) | ((i >>  8) & 0x07);
r7553r7554
524525
525526   memset(hidden_bits, 3, 4194304); // Hack / fix for letters in Rayman 2
526527
527   for (i = 0; i < 8; i++)
528   for (int i = 0; i < 8; i++)
528529   {
529530      tile[i].num = i;
530531   }
531532
532   for (i = 0; i < 256; i++)
533   for (int i = 0; i < 256; i++)
533534   {
534535      gamma_table[i] = sqrt((float)(i << 6));
535536      gamma_table[i] <<= 1;
536537   }
537538
538   for (i = 0; i < 0x4000; i++)
539   for (int i = 0; i < 0x4000; i++)
539540   {
540541      gamma_dither_table[i] = sqrt((float)i);
541542      gamma_dither_table[i] <<= 1;
r7553r7554
544545   z_build_com_table();
545546
546547   maskbits_table[0] = 0x3ff;
547   for(i = 1; i < 16; i++)
548   for(int i = 1; i < 16; i++)
548549   {
549550      maskbits_table[i] = ((UINT16)(0xffff) >> (16 - i)) & 0x3ff;
550551   }
551552
552   for(i = 0; i < 64; i++)
553   for(int i = 0; i < 64; i++)
553554   {
554555      NormPointRom[i] = (normpoint[(i << 1) + 1] << 8) | normpoint[i << 1];
555556      NormSlopeRom[i] = (normslope[(i << 1) + 1] << 8) | normslope[i << 1];
r7553r7554
569570
570571static void video_update_n64_32(bitmap_t *bitmap)
571572{
572   int i, j;
573573    int gamma = (n64_vi_control >> 3) & 1;
574574    int gamma_dither = (n64_vi_control >> 2) & 1;
575575    //int vibuffering = ((n64_vi_control & 2) && fsaa && divot);
576576
577    UINT32 *frame_buffer32;
578   UINT16 *frame_buffer;
579   UINT32 hb;
580   UINT8* hidden_buffer;
577    UINT32 *frame_buffer32 = (UINT32*)&rdram[(n64_vi_origin & 0xffffff) >> 2];
581578
582   int r, g, b;
583   int dith = 0;
584
585   INT32 hdiff = (n64_vi_hstart & 0x3ff) - ((n64_vi_hstart >> 16) & 0x3ff);
586   float hcoeff = ((float)(n64_vi_xscale & 0xfff) / (1 << 10));
579   const INT32 hdiff = (n64_vi_hstart & 0x3ff) - ((n64_vi_hstart >> 16) & 0x3ff);
580   const float hcoeff = ((float)(n64_vi_xscale & 0xfff) / (1 << 10));
587581   UINT32 hres = ((float)hdiff * hcoeff);
588582   INT32 invisiblewidth = n64_vi_width - hres;
589583
590   INT32 vdiff = ((n64_vi_vstart & 0x3ff) - ((n64_vi_vstart >> 16) & 0x3ff)) >> 1;
591   float vcoeff = ((float)(n64_vi_yscale & 0xfff) / (1 << 10));
592   UINT32 vres = ((float)vdiff * vcoeff);
584   const INT32 vdiff = ((n64_vi_vstart & 0x3ff) - ((n64_vi_vstart >> 16) & 0x3ff)) >> 1;
585   const float vcoeff = ((float)(n64_vi_yscale & 0xfff) / (1 << 10));
586   const UINT32 vres = ((float)vdiff * vcoeff);
593587
594588   if (vdiff <= 0 || hdiff <= 0)
595589   {
596
597590      return;
598591   }
599592
600   frame_buffer = (UINT16*)&rdram[(n64_vi_origin & 0xffffff) >> 2];
601   hb = ((n64_vi_origin & 0xffffff) >> 2) >> 1;
602   hidden_buffer = &hidden_bits[hb];
603
604593   if (hres > 640) // Needed by Top Gear Overdrive (E)
605594   {
606595      invisiblewidth += (hres - 640);
607596      hres = 640;
608597   }
609598
610   frame_buffer32 = (UINT32*)&rdram[(n64_vi_origin & 0xffffff) >> 2];
611599   if (frame_buffer32)
612600   {
613      for (j=0; j < vres; j++)
601      for (int j = 0; j < vres; j++)
614602      {
615603         UINT32 *d = BITMAP_ADDR32(bitmap, j, 0);
616         for (i=0; i < hres; i++)
604         for (int i = 0; i < hres; i++)
617605         {
618606            UINT32 pix = *frame_buffer32++;
619607            if (gamma || gamma_dither)
620608            {
621               r = (pix >> 24) & 0xff;
622               g = (pix >> 16) & 0xff;
623               b = (pix >> 8) & 0xff;
609               int r = (pix >> 24) & 0xff;
610               int g = (pix >> 16) & 0xff;
611               int b = (pix >> 8) & 0xff;
612               int dith = 0;
624613               if (gamma_dither)
625614               {
626615                  dith = rdp_rand() & 0x3f;
r7553r7554
662651
663652VIDEO_UPDATE(n64)
664653{
665   int i, j;
666654    int fsaa = (((n64_vi_control >> 8) & 3) < 2);
667655    int divot = (n64_vi_control >> 4) & 1;
668656    int height = fb_height;
657   //UINT16 *frame_buffer = (UINT16*)&rdram[(n64_vi_origin & 0xffffff) >> 2];
658   //UINT8  *cvg_buffer = &hidden_bits[((n64_vi_origin & 0xffffff) >> 2) >> 1];
669659    //int vibuffering = ((n64_vi_control & 2) && fsaa && divot);
670660
671661   //vibuffering = 0; // Disabled for now
r7553r7554
681671                {
682672                    UINT16 pix;
683673                    pix = frame_buffer[pixels ^ WORD_ADDR_XOR];
684                    curpixel_cvg = ((pix & 1) << 2) | (hidden_buffer[pixels ^ BYTE_ADDR_XOR] & 3); // Reuse of this variable
674                    curpixel_cvg = ((pix & 1) << 2) | (cvg_buffer[pixels ^ BYTE_ADDR_XOR] & 3); // Reuse of this variable
685675                    if (curpixel_cvg < 7 && i > 1 && j > 1 && i < (hres - 2) && j < (vres - 2) && fsaa)
686676                    {
687                        newc = video_filter16(&frame_buffer[pixels ^ WORD_ADDR_XOR], &hidden_buffer[pixels ^ BYTE_ADDR_XOR], n64_vi_width);
677                        newc = video_filter16(&frame_buffer[pixels ^ WORD_ADDR_XOR], &cvg_buffer[pixels ^ BYTE_ADDR_XOR], n64_vi_width);
688678                        ViBuffer[i][j] = newc;
689679                    }
690680                    else
r7553r7554
704694
705695    if (n64_vi_blank)
706696    {
707        for (j=0; j <height; j++)
697        for (int j = 0; j <height; j++)
708698        {
709699            UINT32 *d = BITMAP_ADDR32(bitmap, j, 0);
710            for (i=0; i < fb_width; i++)
700            for (int i = 0; i < fb_width; i++)
711701            {
712702                d[BYTE_XOR_BE(i)] = 0;
713703            }
r7553r7554
949939
950940/*****************************************************************************/
951941
942#define XOR_SWAP_BYTE_SHIFT      2
943#define XOR_SWAP_WORD_SHIFT      1
944#define XOR_SWAP_DWORD_SHIFT   0
945
952946#define XOR_SWAP_BYTE   4
953947#define XOR_SWAP_WORD   2
954948#define XOR_SWAP_DWORD   1
r7553r7554
980974
981975INLINE void z_build_com_table(void) // Thanks to angrylion, Gonetz and Orkin
982976{
983   int j = 0;
984   for(j = 0; j < 0x40000; j++)
977   for(int j = 0; j < 0x40000; j++)
985978   {
986979      UINT32 exponent = 0;
987980      UINT32 testbit = 0x20000;
r7553r7554
1000993INLINE void z_store(UINT16* zb, UINT8* zhb, UINT32 z, UINT32 deltaz)
1001994{
1002995   UINT8 deltazmem = 15;
1003   int j = 0;
1004996   z &= 0x3ffff;
1005997   deltaz &= 0xffff;
1006   for(j = 15; j >= 0; j--)
998   for(int j = 15; j >= 0; j--)
1007999   {
10081000      if( (deltaz >> j) == 1 )
10091001      {
r7553r7554
10831075
10841076INLINE INT32 normalize_dzpix(INT32 sum)
10851077{
1086   int count = 0;
10871078   if (sum & 0xc000)
10881079   {
10891080      return 0x8000;
r7553r7554
10921083   {
10931084      return 1;
10941085   }
1095   for(count = 0x2000; count > 0; count >>= 1)
1086   for(int count = 0x2000; count > 0; count >>= 1)
10961087    {
10971088      if (sum & count)
10981089      {
r7553r7554
11181109   }
11191110}
11201111
1121INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, UINT32 hres)
1112INLINE void video_filter16(int *out_r, int *out_g, int *out_b, UINT16* vbuff, UINT8* hbuff, const UINT32 hres)
11221113{
1114
11231115   COLOR penumax, penumin, max, min;
11241116   UINT16 pix = *vbuff;
1125   UINT32 centercvg = (*hbuff & 3) + ((pix & 1) << 2) + 1;
1117   const UINT8 centercvg = (*hbuff & 3) + ((pix & 1) << 2) + 1;
11261118   UINT32 numoffull = 1;
11271119   UINT32 cvg;
1128   UINT32 r = ((pix >> 8) & 0xf8) | (pix >> 13);
1129   UINT32 g = ((pix >> 3) & 0xf8) | ((pix >>  8) & 0x07);
1130   UINT32 b = ((pix << 2) & 0xf8) | ((pix >>  3) & 0x07);
11311120   UINT32 backr[7], backg[7], backb[7];
11321121   UINT32 invr[7], invg[7], invb[7];
11331122   INT32 coeff;
r7553r7554
11361125   INT32 toleft = -2;
11371126   UINT32 colr, colg, colb;
11381127   UINT32 enb;
1139   int i = 0;
1128   UINT32 r = ((pix >> 8) & 0xf8) | (pix >> 13);
1129   UINT32 g = ((pix >> 3) & 0xf8) | ((pix >>  8) & 0x07);
1130   UINT32 b = ((pix << 2) & 0xf8) | ((pix >>  3) & 0x07);
11401131
11411132   *out_r = *out_g = *out_b = 0;
11421133
r7553r7554
11551146      return;
11561147   }
11571148
1158   for(i = 0; i < 5; i++)
1149   for(int i = 0; i < 5; i++)
11591150   {
11601151      pix = vbuff[leftup ^ WORD_ADDR_XOR];
11611152      cvg = hbuff[leftup ^ BYTE_ADDR_XOR] & 3;
r7553r7554
11811172      leftup++;
11821173   }
11831174
1184   for(i = 0; i < 5; i++)
1175   for(int i = 0; i < 5; i++)
11851176   {
11861177      pix = vbuff[leftdown ^ WORD_ADDR_XOR];
11871178      cvg = hbuff[leftdown ^ BYTE_ADDR_XOR] & 3;
r7553r7554
12071198      leftdown++;
12081199   }
12091200
1210   for(i = 0; i < 5; i++)
1201   for(int i = 0; i < 5; i++)
12111202   {
12121203      pix = vbuff[toleft ^ WORD_ADDR_XOR];
12131204      cvg = hbuff[toleft ^ BYTE_ADDR_XOR] & 3;
r7553r7554
12341225   }
12351226
12361227   video_max(&backr[0], &max.i.r, &enb);
1237   for(i = 1; i < 7; i++)
1228   for(int i = 1; i < 7; i++)
12381229   {
12391230      if (!((enb >> i) & 1))
12401231      {
r7553r7554
12421233      }
12431234   }
12441235   video_max(&backg[0], &max.i.g, &enb);
1245   for (i = 1; i < 7; i++)
1236   for (int i = 1; i < 7; i++)
12461237   {
12471238      if (!((enb >> i) & 1))
12481239      {
r7553r7554
12501241      }
12511242   }
12521243   video_max(&backb[0], &max.i.b, &enb);
1253   for (i = 1; i < 7; i++)
1244   for (int i = 1; i < 7; i++)
12541245   {
12551246      if (!((enb >> i) & 1))
12561247      {
r7553r7554
12581249      }
12591250   }
12601251   video_max(&invr[0], &min.i.r, &enb);
1261   for (i = 1; i < 7; i++)
1252   for (int i = 1; i < 7; i++)
12621253   {
12631254      if (!((enb >> i) & 1))
12641255      {
r7553r7554
12661257      }
12671258   }
12681259   video_max(&invg[0], &min.i.g, &enb);
1269   for (i = 1; i < 7; i++)
1260   for (int i = 1; i < 7; i++)
12701261   {
12711262      if (!((enb >> i) & 1))
12721263      {
r7553r7554
12741265      }
12751266   }
12761267   video_max(&invb[0], &min.i.b, &enb);
1277   for (i = 1; i < 7; i++)
1268   for (int i = 1; i < 7; i++)
12781269   {
12791270      if (!((enb >> i) & 1))
12801271      {
r7553r7554
12831274   }
12841275
12851276   video_max(&backr[0], &penumax.i.r, &enb);
1286   i = ge_two(enb);
1287   penumax.i.r = i ? max.i.r : penumax.i.r;
1277   penumax.i.r = ge_two(enb) ? max.i.r : penumax.i.r;
12881278
12891279   video_max(&backg[0], &penumax.i.g, &enb);
1290   i = ge_two(enb);
1291   penumax.i.g = i ? max.i.g : penumax.i.g;
1280   penumax.i.g = ge_two(enb) ? max.i.g : penumax.i.g;
12921281
12931282   video_max(&backb[0], &penumax.i.b, &enb);
1294   i = ge_two(enb);
1295   penumax.i.b = i ? max.i.b : penumax.i.b;
1283   penumax.i.b = ge_two(enb) ? max.i.b : penumax.i.b;
12961284
12971285   video_max(&invr[0], &penumin.i.r, &enb);
1298   i = ge_two(enb);
1299   penumin.i.r = i ? min.i.r : penumin.i.r;
1286   penumin.i.r = ge_two(enb) ? min.i.r : penumin.i.r;
13001287
13011288   video_max(&invg[0], &penumin.i.g, &enb);
1302   i = ge_two(enb);
1303   penumin.i.g = i ? min.i.g : penumin.i.g;
1289   penumin.i.g = ge_two(enb) ? min.i.g : penumin.i.g;
13041290
13051291   video_max(&invb[0], &penumin.i.b, &enb);
1306   i = ge_two(enb);
1307   penumin.i.b = i ? min.i.b : penumin.i.b;
1292   penumin.i.b = ge_two(enb) ? min.i.b : penumin.i.b;
13081293
13091294   penumin.i.r = ~penumin.i.r;
13101295   penumin.i.g = ~penumin.i.g;
r7553r7554
13131298   colr = (UINT32)penumin.i.r + (UINT32)penumax.i.r - (r << 1);
13141299   colg = (UINT32)penumin.i.g + (UINT32)penumax.i.g - (g << 1);
13151300   colb = (UINT32)penumin.i.b + (UINT32)penumax.i.b - (b << 1);
1316   coeff = 8 - (INT32)centercvg;
1301   coeff = 8 - centercvg;
13171302   colr = (((colr * coeff) + 4) >> 3) + r;
13181303   colg = (((colg * coeff) + 4) >> 3) + g;
13191304   colb = (((colb * coeff) + 4) >> 3) + b;
r7553r7554
13731358
13741359INLINE void divot_filter16_buffer(int* r, int* g, int* b, COLOR* vibuffer)
13751360{
1376   UINT32 leftr, leftg, leftb, rightr, rightg, rightb;
1377   COLOR leftpix, rightpix, filtered;
1378   leftpix = vibuffer[-1];
1379   rightpix = vibuffer[1];
1380   filtered = *vibuffer;
1361   COLOR leftpix = vibuffer[-1];
1362   COLOR rightpix = vibuffer[1];
1363   COLOR filtered = *vibuffer;
13811364
13821365   *r = filtered.i.r;
13831366   *g = filtered.i.g;
13841367   *b = filtered.i.b;
1385   leftr = leftpix.i.r;
1386   leftg = leftpix.i.g;
1387   leftb = leftpix.i.b;
1388   rightr = rightpix.i.r;
1389   rightg = rightpix.i.g;
1390   rightb = rightpix.i.b;
1368   UINT32 leftr = leftpix.i.r;
1369   UINT32 leftg = leftpix.i.g;
1370   UINT32 leftb = leftpix.i.b;
1371   UINT32 rightr = rightpix.i.r;
1372   UINT32 rightg = rightpix.i.g;
1373   UINT32 rightb = rightpix.i.b;
1374
13911375   if ((leftr >= *r && rightr >= leftr) || (leftr >= rightr && *r >= leftr))
13921376   {
13931377      *r = leftr; //left = median value
r7553r7554
16241608      temp |= 1;
16251609   }
16261610   else if (Pixels[0] < Pixels[pos])
1611   {
16271612      temp |= 1;
1613   }
16281614
16291615   if (Pixels[1] > Pixels[pos])
16301616   {
r7553r7554
16321618      pos = 1;
16331619   }
16341620   else if (Pixels[1] < Pixels[pos])
1621   {
16351622      temp |= 2;
1623   }
16361624   else
1625   {
16371626      pos = 1;
1627   }
16381628
16391629   if (Pixels[2] > Pixels[pos])
16401630   {
r7553r7554
16421632      pos = 2;
16431633   }
16441634   else if (Pixels[2] < Pixels[pos])
1635   {
16451636      temp |= 4;
1637   }
16461638   else
1639   {
16471640      pos = 2;
1641   }
16481642
16491643   if (Pixels[3] > Pixels[pos])
16501644   {
r7553r7554
16521646      pos = 3;
16531647   }
16541648   else if (Pixels[3] < Pixels[pos])
1649   {
16551650      temp |= 8;
1651   }
16561652   else
1653   {
16571654      pos = 3;
1655   }
16581656
16591657   if (Pixels[4] > Pixels[pos])
16601658   {
r7553r7554
16621660      pos = 4;
16631661   }
16641662   else if (Pixels[4] < Pixels[pos])
1663   {
16651664      temp |= 16;
1665   }
16661666   else
1667   {
16671668      pos = 4;
1669   }
16681670
16691671   if (Pixels[5] > Pixels[pos])
16701672   {
r7553r7554
16721674      pos = 5;
16731675   }
16741676   else if (Pixels[5] < Pixels[pos])
1677   {
16751678      temp |= 32;
1679   }
16761680   else
1681   {
16771682      pos = 5;
1683   }
16781684
16791685   if (Pixels[6] > Pixels[pos])
16801686   {
r7553r7554
16821688      pos = 6;
16831689   }
16841690   else if (Pixels[6] < Pixels[pos])
1691   {
16851692      temp |= 64;
1693   }
16861694   else
1695   {
16871696      pos = 6;
1697   }
16881698
16891699   if (Pixels[7] > Pixels[pos])
16901700   {
r7553r7554
16921702      pos = 7;
16931703   }
16941704   else if (Pixels[7] < Pixels[pos])
1705   {
16951706      temp |= 128;
1707   }
16961708   else
1709   {
16971710      pos = 7;
1711   }
16981712
16991713   *enb = temp;
17001714   *max = Pixels[pos];
17011715}
1716
17021717/*
17031718INLINE void video_max(UINT32* Pixels, UINT8* max, UINT32* enb)
17041719{
r7553r7554
18581873
18591874INLINE UINT32 getlog2(UINT32 lod_clamp)
18601875{
1861   int i;
18621876   if (lod_clamp < 2)
18631877   {
18641878      return 0;
18651879   }
18661880   else
18671881   {
1868      for (i = 7; i > 0; i--)
1882      for (int i = 7; i > 0; i--)
18691883      {
18701884         if ((lod_clamp >> i) & 1)
18711885         {
r7553r7554
18831897
18841898INLINE void BILERP_AND_WRITE(UINT32* src0, UINT32* src1, UINT32* dest)
18851899{
1886   UINT32 r1, g1, b1, col0, col1;
1887   col0 = *src0;
1888   col1 = *src1;
1889   r1 = (((col0 >> 16)&0xff) + ((col1 >> 16)&0xff))>>1;
1890   g1 = (((col0 >> 8)&0xff) + ((col1 >> 8)&0xff))>>1;
1891   b1 = (((col0 >> 0)&0xff) + ((col1 >> 0)&0xff))>>1;
1900   UINT32 col0 = *src0;
1901   UINT32 col1 = *src1;
1902   UINT32 r1 = (((col0 >> 16) & 0xff) + ((col1 >> 16) & 0xff))>>1;
1903   UINT32 g1 = (((col0 >> 8) & 0xff) + ((col1 >> 8) & 0xff))>>1;
1904   UINT32 b1 = (((col0 >> 0) & 0xff) + ((col1 >> 0) & 0xff))>>1;
18921905   *dest = (r1 << 16) | (g1 << 8) | b1;
18931906}
18941907
r7553r7554
18961909{
18971910   int w_carry;
18981911   int shift;
1899   int normout;
1900   int wnorm;
1901   int tlu_rcp;
1902   int shift_value;
19031912
19041913   if (!(sw & 0x7fff))
19051914   {
r7553r7554
19141923   for(shift = 1; shift <= 14 && !((sw << shift) & 0x8000); shift++);
19151924   shift -= 1;
19161925
1917   normout = ((sw << shift) & 0x3fff) >> 8;
1918   wnorm = ((sw << shift) & 0xff) << 2;
1926   int normout = ((sw << shift) & 0x3fff) >> 8;
1927   int wnorm = ((sw << shift) & 0xff) << 2;
19191928
1920   tlu_rcp = ((-(NormSlopeRom[normout] * wnorm)) >> 10) + NormPointRom[normout];
1929   int tlu_rcp = ((-(NormSlopeRom[normout] * wnorm)) >> 10) + NormPointRom[normout];
19211930
19221931   if(shift == 14)
19231932   {
r7553r7554
19261935   }
19271936   else
19281937   {
1929      shift_value = 13 - shift;
1938      int shift_value = 13 - shift;
19301939      *sss = (SIGN16(ss) * tlu_rcp) >> shift_value;
19311940      *sst = (SIGN16(st) * tlu_rcp) >> shift_value;
19321941   }
r7553r7554
20842093static void fill_rectangle_32bit(RECTANGLE *rect)
20852094{
20862095   UINT32 *fb = (UINT32*)&rdram[(fb_address / 4)];
2087   int index, i, j;
2088   int x1 = rect->xh / 4;
2089   int x2 = rect->xl / 4;
2090   int y1 = rect->yh / 4;
2091   int y2 = rect->yl / 4;
2092   int clipx1, clipx2, clipy1, clipy2;
2096   int x1 = rect->xh;
2097   int x2 = rect->xl;
2098   int y1 = rect->yh;
2099   int y2 = rect->yl;
20932100   int fill_cvg = 0;
20942101
2095   // TODO: clip
2096   clipx1 = clip.xh / 4;
2097   clipx2 = clip.xl / 4;
2098   clipy1 = clip.yh / 4;
2099   clipy2 = clip.yl / 4;
2100
21012102   // clip
2102   if (x1 < clipx1)
2103   if (x1 < clip.xh)
21032104   {
2104      x1 = clipx1;
2105      x1 = clip.xh;
21052106   }
2106   if (y1 < clipy1)
2107   if (y1 < clip.yh)
21072108   {
2108      y1 = clipy1;
2109      y1 = clip.yh;
21092110   }
2110   if (x2 >= clipx2)
2111   if (x2 >= clip.xl)
21112112   {
2112      x2 = clipx2-1;
2113      x2 = clip.xl - 1;
21132114   }
2114   if (y2 >= clipy2)
2115   if (y2 >= clip.yl)
21152116   {
2116      y2 = clipy2-1;
2117      y2 = clip.yl - 1;
21172118   }
21182119
21192120   shade_color.c = 0;
r7553r7554
21222123
21232124   if (other_modes.cycle_type == CYCLE_TYPE_FILL)
21242125   {
2125      for (j=y1; j <= y2; j++)
2126      for (int j = y1; j <= y2; j++)
21262127      {
2127         index = j * fb_width;
2128         int index = j * fb_width;
21282129
2129         for (i=x1; i <= x2; i++)
2130         for (int i = x1; i <= x2; i++)
21302131         {
21312132            fb[(index + i)^1] = fill_color;
21322133         }
r7553r7554
21342135   }
21352136   else if (other_modes.cycle_type == CYCLE_TYPE_1)
21362137   {
2137      for (j=y1; j <= y2; j++)
2138      for (int j = y1; j <= y2; j++)
21382139      {
21392140         COLOR c;
2140         index = j * fb_width;
2141         for (i=x1; i <= x2; i++)
2141         int index = j * fb_width;
2142         for (int i = x1; i <= x2; i++)
21422143         {
21432144            curpixel_cvg = fill_cvg;
21442145            COLOR_COMBINER1(c);
r7553r7554
21482149   }
21492150   else if (other_modes.cycle_type == CYCLE_TYPE_2)
21502151   {
2151      for (j=y1; j <= y2; j++)
2152      for (int j = y1; j <= y2; j++)
21522153      {
21532154         COLOR c1, c2;
2154         index = j * fb_width;
2155         for (i=x1; i <= x2; i++)
2155         int index = j * fb_width;
2156         for (int i = x1; i <= x2; i++)
21562157         {
21572158            curpixel_cvg = fill_cvg;
21582159            COLOR_COMBINER2_C0(c1);
r7553r7554
21702171INLINE void texture_rectangle_32bit(TEX_RECTANGLE *rect)
21712172{   // TODO: Z-compare and Z-update
21722173   UINT32 *fb = (UINT32*)&rdram[(fb_address / 4)];
2173   int i, j;
2174   int x1, x2, y1, y2;
2175   int s, t;
2176   int ss, st;
21772174
2178   int clipx1, clipx2, clipy1, clipy2;
2179
21802175   UINT32 tilenum = rect->tilenum;
21812176   UINT32 tilenum2 = 0;
21822177   TILE *tex_tile = &tile[rect->tilenum];
21832178   TILE *tex_tile2 = NULL;
21842179
2185   x1 = (rect->xh / 4);
2186   x2 = (rect->xl / 4);
2187   y1 = (rect->yh / 4);
2188   y2 = (rect->yl / 4);
2180   int x1 = rect->xh;
2181   int x2 = rect->xl;
2182   int y1 = rect->yh;
2183   int y2 = rect->yl;
21892184
21902185   if (other_modes.cycle_type == CYCLE_TYPE_FILL || other_modes.cycle_type == CYCLE_TYPE_COPY)
21912186   {
r7553r7554
21942189      y2 += 1;
21952190   }
21962191
2197   clipx1 = clip.xh / 4;
2198   clipx2 = clip.xl / 4;
2199   clipy1 = clip.yh / 4;
2200   clipy2 = clip.yl / 4;
2192   // clip
2193   if (x1 < clip.xh)
2194   {
2195      x1 = clip.xh;
2196   }
2197   if (y1 < clip.yh)
2198   {
2199      y1 = clip.yh;
2200   }
2201   if (x2 >= clip.xl)
2202   {
2203      x2 = clip.xl - 1;
2204   }
2205   if (y2 >= clip.yl)
2206   {
2207      y2 = clip.yl - 1;
2208   }
22012209
22022210   calculate_clamp_diffs(tex_tile->num);
22032211
r7553r7554
22172225
22182226   shade_color.c = 0;   // Needed by Pilotwings 64
22192227
2220   t = (int)(rect->t) << 5;
2228   int t = (int)(rect->t) << 5;
22212229
22222230   if (other_modes.cycle_type == CYCLE_TYPE_1)
22232231   {
22242232      CACHE_TEXTURE_PARAMS(tex_tile);
22252233
2226      for (j = y1; j < y2; j++)
2234      for (int j = y1; j < y2; j++)
22272235      {
22282236         int fb_index = j * fb_width;
22292237
2230         s = (int)(rect->s) << 5;
2238         int s = (int)(rect->s) << 5;
22312239
2232         for (i = x1; i < x2; i++)
2240         for (int i = x1; i < x2; i++)
22332241         {
22342242            COLOR c;
2235            curpixel_cvg=8;
2236            ss = s >> 5;
2237            st = t >> 5;
2243            int ss = s >> 5;
2244            int st = t >> 5;
2245
2246            curpixel_cvg = 8;
2247
22382248            if (rect->flip)
22392249            {
22402250               texel0_color.c = TEXTURE_PIPELINE(st, ss, tex_tile);
r7553r7554
22562266   }
22572267   else if (other_modes.cycle_type == CYCLE_TYPE_2)
22582268   {
2259      for (j = y1; j < y2; j++)
2269      for (int j = y1; j < y2; j++)
22602270      {
22612271         int fb_index = j * fb_width;
22622272
2263         s = (int)(rect->s) << 5;
2273         int s = (int)(rect->s) << 5;
22642274
2265         for (i = x1; i < x2; i++)
2275         for (int i = x1; i < x2; i++)
22662276         {
22672277            COLOR c1, c2;
2278            int ss = s >> 5;
2279            int st = t >> 5;
2280
22682281            curpixel_cvg=8;
2269            ss = s >> 5;
2270            st = t >> 5;
2282
22712283            if (rect->flip)
22722284            {
22732285               CACHE_TEXTURE_PARAMS(tex_tile);
r7553r7554
23002312   {
23012313      CACHE_TEXTURE_PARAMS(tex_tile);
23022314
2303      for (j = y1; j < y2; j++)
2315      for (int j = y1; j < y2; j++)
23042316      {
23052317         int fb_index = j * fb_width;
23062318
2307         s = (int)(rect->s) << 5;
2319         int s = (int)(rect->s) << 5;
23082320
2309         for (i = x1; i < x2; i++)
2321         for (int i = x1; i < x2; i++)
23102322         {
2311            ss = s >> 5;
2312            st = t >> 5;
2323            int ss = s >> 5;
2324            int st = t >> 5;
23132325            if (rect->flip)
23142326            {
23152327               texel0_color.c = TEXTURE_PIPELINE(st, ss, tex_tile);
r7553r7554
23392351   UINT32 *fb = (UINT32*)&rdram[fb_address / 4];
23402352   UINT16 *zb = (UINT16*)&rdram[zb_address / 4];
23412353   UINT8 *zhb = &hidden_bits[zb_address >> 1];
2342   int i, j;
23432354   int tilenum = tex_tile->num;
23442355
2345   int clipx1, clipx2, clipy1, clipy2;
2346
23472356   UINT32 tilenum2 = 0;
23482357   TILE *tex_tile2 = NULL;
23492358
r7553r7554
23562365   SPAN_PARAM dt = span[0].dt;
23572366   SPAN_PARAM dw = span[0].dw;
23582367   int dzpix = span[0].dzpix;
2359   int drinc, dginc, dbinc, dainc, dzinc, dsinc, dtinc, dwinc;
23602368   int xinc = flip ? 1 : -1;
23612369
23622370   calculate_clamp_diffs(tilenum);
23632371
2364   clipx1 = clip.xh / 4;
2365   clipx2 = clip.xl / 4;
2366   clipy1 = clip.yh / 4;
2367   clipy2 = clip.yl / 4;
2368
23692372   if (other_modes.cycle_type == CYCLE_TYPE_2 && texture)
23702373   {
23712374      if (!other_modes.tex_lod_en)
r7553r7554
23802383      }
23812384   }
23822385
2383   if (start < clipy1)
2386   if (start < clip.yh)
23842387   {
2385      start = clipy1;
2388      start = clip.yh;
23862389   }
2387   if (start >= clipy2)
2390   if (start >= clip.yl)
23882391   {
2389      start = clipy2-1;
2392      start = clip.yl - 1;
23902393   }
2391   if (end < clipy1)
2394   if (end < clip.yh)
23922395   {
2393      end = clipy1;
2396      end = clip.yh;
23942397   }
2395   if (end >= clipy2)
2398   if (end >= clip.yl)
23962399   {
2397      end = clipy2-1;
2400      end = clip.yl - 1;
23982401   }
23992402
2400   drinc = flip ? (dr.w) : -dr.w;
2401   dginc = flip ? (dg.w) : -dg.w;
2402   dbinc = flip ? (db.w) : -db.w;
2403   dainc = flip ? (da.w) : -da.w;
2404   dzinc = flip ? (dz.w) : -dz.w;
2405   dsinc = flip ? (ds.w) : -ds.w;
2406   dtinc = flip ? (dt.w) : -dt.w;
2407   dwinc = flip ? (dw.w) : -dw.w;
2403   int drinc = flip ? (dr.w) : -dr.w;
2404   int dginc = flip ? (dg.w) : -dg.w;
2405   int dbinc = flip ? (db.w) : -db.w;
2406   int dainc = flip ? (da.w) : -da.w;
2407   int dzinc = flip ? (dz.w) : -dz.w;
2408   int dsinc = flip ? (ds.w) : -ds.w;
2409   int dtinc = flip ? (dt.w) : -dt.w;
2410   int dwinc = flip ? (dw.w) : -dw.w;
24082411
24092412   if(!shade)
24102413   {
r7553r7554
24132416
24142417   CACHE_TEXTURE_PARAMS(tex_tile);
24152418
2416   for (i = start; i <= end; i++)
2419   for (int i = start; i <= end; i++)
24172420   {
24182421      int xstart = span[i].lx;
24192422      int xend = span[i].rx;
r7553r7554
24262429      SPAN_PARAM t = span[i].t;
24272430      SPAN_PARAM w = span[i].w;
24282431
2429      int x;
2432      int x = xend;
24302433      int fb_index = fb_width * i;
2431      int length;
2434      int length = flip ? (xstart - xend) : (xend - xstart);
24322435
2433      x = xend;
2434
2435      length = flip ? (xstart - xend) : (xend - xstart);
2436
2437      for (j=0; j <= length; j++)
2436      for (int j = 0; j <= length; j++)
24382437      {
2439         int sr = r.h.h;
2440         int sg = g.h.h;
2441         int sb = b.h.h;
2442         int sa = a.h.h;
2443         int ss = s.h.h;
2444         int st = t.h.h;
2445         int sw = w.h.h;
24462438         UINT32 sz = z.w >> 13;
2447         int sss = 0, sst = 0;
24482439         if (other_modes.z_source_sel)
24492440         {
24502441            sz = (((UINT32)primitive_z) << 3) & 0x3ffff;
24512442            dzpix = primitive_delta_z;
24522443         }
24532444
2454         if (x >= clipx1 && x < clipx2)
2445         if (x >= clip.xh && x < clip.xl)
24552446         {
24562447            curpixel_cvg = span[i].cvg[x];
24572448            if (curpixel_cvg)
r7553r7554
24672458               c1.i.r = c1.i.g = c1.i.b = c1.i.a = 0;
24682459               c2.i.r = c2.i.g = c2.i.b = c2.i.a = 0;
24692460
2470               if (other_modes.persp_tex_en)
2471               {
2472                  tcdiv(ss, st, sw, &sss, &sst);
2473               }
2474               else
2475               {
2476                  sss = ss;
2477                  sst = st;
2478               }
2479
24802461               if (shade)
24812462               {
2463                  int sr = r.h.h;
2464                  int sg = g.h.h;
2465                  int sb = b.h.h;
2466                  int sa = a.h.h;
2467
24822468                  // Needed by Superman
24832469                  if (sr > 0xff) sr = 0xff;
24842470                  if (sg > 0xff) sg = 0xff;
r7553r7554
24962482
24972483               if (texture)
24982484               {
2485                  int ss = s.h.h;
2486                  int st = t.h.h;
2487                  int sw = w.h.h;
2488                  int sss = 0;
2489                  int sst = 0;
2490
2491                  if (other_modes.persp_tex_en)
2492                  {
2493                     tcdiv(ss, st, sw, &sss, &sst);
2494                  }
2495                  else
2496                  {
2497                     sss = ss;
2498                     sst = st;
2499                  }
2500
24992501                  if (other_modes.cycle_type == CYCLE_TYPE_1)
25002502                  {
25012503                     texel0_color.c = TEXTURE_PIPELINE(sss, sst, tex_tile);
r7553r7554
34693471
34703472static RDP_COMMAND( rdp_tex_rect )
34713473{
3472   UINT32 w3, w4;
34733474   TEX_RECTANGLE rect;
3475   UINT32 w3 = rdp_cmd_data[rdp_cmd_cur+2];
3476   UINT32 w4 = rdp_cmd_data[rdp_cmd_cur+3];
34743477
3475   w3 = rdp_cmd_data[rdp_cmd_cur+2];
3476   w4 = rdp_cmd_data[rdp_cmd_cur+3];
3477
34783478   rect.tilenum   = (w2 >> 24) & 0x7;
3479   rect.xl         = (w1 >> 12) & 0xfff;
3480   rect.yl         = (w1 >>  0) & 0xfff;
3481   rect.xh         = (w2 >> 12) & 0xfff;
3482   rect.yh         = (w2 >>  0) & 0xfff;
3479   rect.xl         = ((w1 >> 12) & 0xfff) >> 2;
3480   rect.yl         = ((w1 >>  0) & 0xfff) >> 2;
3481   rect.xh         = ((w2 >> 12) & 0xfff) >> 2;
3482   rect.yh         = ((w2 >>  0) & 0xfff) >> 2;
34833483   rect.s         = (w3 >> 16) & 0xffff;
34843484   rect.t         = (w3 >>  0) & 0xffff;
34853485   rect.dsdx      = (w4 >> 16) & 0xffff;
r7553r7554
34953495
34963496static RDP_COMMAND( rdp_tex_rect_flip )
34973497{
3498   UINT32 w3, w4;
34993498   TEX_RECTANGLE rect;
3499   UINT32 w3 = rdp_cmd_data[rdp_cmd_cur+2];
3500   UINT32 w4 = rdp_cmd_data[rdp_cmd_cur+3];
35003501
3501   w3 = rdp_cmd_data[rdp_cmd_cur+2];
3502   w4 = rdp_cmd_data[rdp_cmd_cur+3];
3503
35043502   rect.tilenum   = (w2 >> 24) & 0x7;
3505   rect.xl         = (w1 >> 12) & 0xfff;
3506   rect.yl         = (w1 >>  0) & 0xfff;
3507   rect.xh         = (w2 >> 12) & 0xfff;
3508   rect.yh         = (w2 >>  0) & 0xfff;
3503   rect.xl         = ((w1 >> 12) & 0xfff) >> 2;
3504   rect.yl         = ((w1 >>  0) & 0xfff) >> 2;
3505   rect.xh         = ((w2 >> 12) & 0xfff) >> 2;
3506   rect.yh         = ((   w2 >>  0) & 0xfff) >> 2;
35093507   rect.t         = (w3 >> 16) & 0xffff;
35103508   rect.s         = (w3 >>  0) & 0xffff;
35113509   rect.dtdy      = (w4 >> 16) & 0xffff;
r7553r7554
35733571   clip.xl = (w2 >> 12) & 0xfff;
35743572   clip.yl = (w2 >>  0) & 0xfff;
35753573
3574   clip.xh >>= 2;
3575   clip.yh >>= 2;
3576   clip.xl >>= 2;
3577   clip.yl >>= 2;
3578
35763579   // TODO: handle f & o?
35773580}
35783581
r7553r7554
35843587
35853588static RDP_COMMAND( rdp_set_other_modes )
35863589{
3587   int index;
3588
35893590   other_modes.cycle_type         = (w1 >> 20) & 0x3;
3590   other_modes.persp_tex_en      = (w1 & 0x80000) ? 1 : 0;
3591   other_modes.detail_tex_en      = (w1 & 0x40000) ? 1 : 0;
3592   other_modes.sharpen_tex_en      = (w1 & 0x20000) ? 1 : 0;
3593   other_modes.tex_lod_en         = (w1 & 0x10000) ? 1 : 0;
3594   other_modes.en_tlut            = (w1 & 0x08000) ? 1 : 0;
3595   other_modes.tlut_type         = (w1 & 0x04000) ? 1 : 0;
3596   other_modes.sample_type         = (w1 & 0x02000) ? 1 : 0;
3597   other_modes.mid_texel         = (w1 & 0x01000) ? 1 : 0;
3598   other_modes.bi_lerp0         = (w1 & 0x00800) ? 1 : 0;
3599   other_modes.bi_lerp1         = (w1 & 0x00400) ? 1 : 0;
3600   other_modes.convert_one         = (w1 & 0x00200) ? 1 : 0;
3601   other_modes.key_en            = (w1 & 0x00100) ? 1 : 0;
3591   other_modes.persp_tex_en      = (w1 & 0x80000) ? true : false;
3592   other_modes.detail_tex_en      = (w1 & 0x40000) ? true : false;
3593   other_modes.sharpen_tex_en      = (w1 & 0x20000) ? true : false;
3594   other_modes.tex_lod_en         = (w1 & 0x10000) ? true : false;
3595   other_modes.en_tlut            = (w1 & 0x08000) ? true : false;
3596   other_modes.tlut_type         = (w1 & 0x04000) ? true : false;
3597   other_modes.sample_type         = (w1 & 0x02000) ? true : false;
3598   other_modes.mid_texel         = (w1 & 0x01000) ? true : false;
3599   other_modes.bi_lerp0         = (w1 & 0x00800) ? true : false;
3600   other_modes.bi_lerp1         = (w1 & 0x00400) ? true : false;
3601   other_modes.convert_one         = (w1 & 0x00200) ? true : false;
3602   other_modes.key_en            = (w1 & 0x00100) ? true : false;
36023603   other_modes.rgb_dither_sel      = (w1 >> 6) & 0x3;
36033604   other_modes.alpha_dither_sel   = (w1 >> 4) & 0x3;
36043605   other_modes.blend_m1a_0         = (w2 >> 30) & 0x3;
r7553r7554
36093610   other_modes.blend_m2a_1         = (w2 >> 20) & 0x3;
36103611   other_modes.blend_m2b_0         = (w2 >> 18) & 0x3;
36113612   other_modes.blend_m2b_1         = (w2 >> 16) & 0x3;
3612   other_modes.force_blend         = (w2 & 0x4000) ? 1 : 0;
3613   other_modes.alpha_cvg_select   = (w2 & 0x2000) ? 1 : 0;
3614   other_modes.cvg_times_alpha      = (w2 & 0x1000) ? 1 : 0;
3613   other_modes.force_blend         = (w2 & 0x4000) ? true : false;
3614   other_modes.alpha_cvg_select   = (w2 & 0x2000) ? true : false;
3615   other_modes.cvg_times_alpha      = (w2 & 0x1000) ? true : false;
36153616   other_modes.z_mode            = (w2 >> 10) & 0x3;
36163617   other_modes.cvg_dest         = (w2 >> 8) & 0x3;
3617   other_modes.color_on_cvg      = (w2 & 0x80) ? 1 : 0;
3618   other_modes.image_read_en      = (w2 & 0x40) ? 1 : 0;
3619   other_modes.z_update_en         = (w2 & 0x20) ? 1 : 0;
3620   other_modes.z_compare_en      = (w2 & 0x10) ? 1 : 0;
3621   other_modes.antialias_en      = (w2 & 0x08) ? 1 : 0;
3622   other_modes.z_source_sel      = (w2 & 0x04) ? 1 : 0;
3623   other_modes.dither_alpha_en      = (w2 & 0x02) ? 1 : 0;
3624   other_modes.alpha_compare_en   = (w2 & 0x01) ? 1 : 0;
3618   other_modes.color_on_cvg      = (w2 & 0x80) ? true : false;
3619   other_modes.image_read_en      = (w2 & 0x40) ? true : false;
3620   other_modes.z_update_en         = (w2 & 0x20) ? true : false;
3621   other_modes.z_compare_en      = (w2 & 0x10) ? true : false;
3622   other_modes.antialias_en      = (w2 & 0x08) ? true : false;
3623   other_modes.z_source_sel      = (w2 & 0x04) ? true : false;
3624   other_modes.dither_alpha_en      = (w2 & 0x02) ? true : false;
3625   other_modes.alpha_compare_en   = (w2 & 0x01) ? true : false;
36253626
36263627   texture_rectangle_16bit = rdp_texture_rectangle_16bit_func[((((other_modes.z_update_en | other_modes.z_source_sel) << 3) | ((other_modes.z_compare_en | other_modes.z_source_sel) << 2) | other_modes.cycle_type) << 2) | other_modes.rgb_dither_sel];
36273628   fill_rectangle_16bit = rdp_fill_rectangle_16bit_func[(other_modes.cycle_type << 2) | other_modes.rgb_dither_sel];
r7553r7554
36493650   render_spans_16_s_t_nz_f = rdp_render_spans_16_func[28 + ((other_modes.cycle_type & 1) | (other_modes.z_compare_en << 5) | (other_modes.z_update_en << 6) | (other_modes.rgb_dither_sel << 7))];
36503651   render_spans_16_s_t_z_f = rdp_render_spans_16_func[30 + ((other_modes.cycle_type & 1) | (other_modes.z_compare_en << 5) | (other_modes.z_update_en << 6) | (other_modes.rgb_dither_sel << 7))];
36513652
3652   for(index = 0; index < 8; index++)
3653   for(int index = 0; index < 8; index++)
36533654   {
36543655      tile[index].fetch_index = (tile[index].size << 5) | (tile[index].format << 2) | (other_modes.en_tlut << 1) | other_modes.tlut_type;
36553656   }
r7553r7554
36773678
36783679static RDP_COMMAND( rdp_load_tlut )
36793680{
3680   int i;
3681   int tl, th, sl, sh;
3682   int tilenum = (w2 >> 24) & 7;
3681   const int tilenum = (w2 >> 24) & 7;
36833682   TILE* tex_tile = &tile[tilenum];
36843683
3685   sl = tex_tile->sl = ((w1 >> 12) & 0xfff);
3686   tl = tex_tile->tl =  w1 & 0xfff;
3687   sh = tex_tile->sh = ((w2 >> 12) & 0xfff);
3688   th = tex_tile->th = w2 & 0xfff;
3684   int sl = tex_tile->sl = ((w1 >> 12) & 0xfff);
3685   int tl = tex_tile->tl =  w1 & 0xfff;
3686   int sh = tex_tile->sh = ((w2 >> 12) & 0xfff);
36893687
36903688   switch (ti_size)
36913689   {
r7553r7554
36973695         UINT16 *dst = (UINT16*)&TMEM[tex_tile->tmem];
36983696         int count = ((sh >> 2) - (sl >> 2)) + 1;
36993697
3700         for (i = 0; i < count; i++)
3698         for (int i = 0; i < count; i++)
37013699         {
37023700            if((i*4) < 0x400)
37033701            {
r7553r7554
37373735
37383736static RDP_COMMAND( rdp_load_block )
37393737{
3740   int i, width;
3741   UINT16 sl, sh, tl, dxt;
3742   int tilenum = (w2 >> 24) & 0x7;
3743   UINT32 *src, *tc;
3744   UINT32 tb;
3738   const int tilenum = (w2 >> 24) & 0x7;
3739   const UINT32 ti_address2 = ti_address - ((ti_address & 3) ? 4 : 0);
37453740   UINT16 *ram16 = (UINT16*)rdram;
3746   UINT32 ti_address2 = ti_address - ((ti_address & 3) ? 4 : 0);
37473741   int ti_width2 = ti_width;
37483742   int slindwords = 0;
37493743
3750   tile[tilenum].sl = sl = ((w1 >> 12) & 0xfff);
3751   tile[tilenum].tl = tl = ((w1 >>  0) & 0xfff);
3752   tile[tilenum].sh = sh = ((w2 >> 12) & 0xfff);
3753   dxt   = ((w2 >>  0) & 0xfff);
3744   UINT32 sl = tile[tilenum].sl = ((w1 >> 12) & 0xfff);
3745   UINT32 tl = tile[tilenum].tl = ((w1 >>  0) & 0xfff);
3746   UINT32 sh = tile[tilenum].sh = ((w2 >> 12) & 0xfff);
3747   UINT32 dxt   = ((w2 >>  0) & 0xfff);
37543748
3755   width = (sh - sl) + 1;
3749   int width = (sh - sl) + 1;
37563750
37573751   if (width > 2048) // Hack for Magical Tetris Challenge
37583752   {
37593753      width = 2048;
37603754   }
37613755
3762   switch (ti_size)
3763   {
3764      case PIXEL_SIZE_4BIT:   width >>= 1; break;
3765      case PIXEL_SIZE_8BIT:   break;
3766      case PIXEL_SIZE_16BIT:   width <<= 1; break;
3767      case PIXEL_SIZE_32BIT:   width <<= 2; break;
3768   }
3769
37703756   if ((ti_address & 3) && (ti_address & 0xffffff00) != 0xf8a00)
37713757   {
37723758      fatalerror( "load block: unaligned ti_address 0x%x",ti_address ); // Rat Attack, Frogger 2 prototype
37733759   }
37743760
3775   src = (UINT32*)&ram16[ti_address2 >> 1];
3776   tc = (UINT32*)TMEM;
3777   tb = tile[tilenum].tmem >> 2;
3761   UINT32* src = (UINT32*)&ram16[ti_address2 >> 1];
3762   UINT32* tc = (UINT32*)TMEM;
3763   UINT32 tb = tile[tilenum].tmem >> 2;
37783764
3779   if ((tb + (width >> 2)) > 0x400)
3780   {
3781      width = 0x1000 - tb*4; // Hack for Magical Tetris Challenge
3782   }
3765   slindwords = sl;
37833766
3784   switch (ti_size)
3767   switch (ti_size) // slindwords Neededby Vigilante 8
37853768   {
3786      case PIXEL_SIZE_4BIT:   ti_width2 >>= 1; break;
3787      case PIXEL_SIZE_8BIT:   break;
3788      case PIXEL_SIZE_16BIT:   ti_width2 <<= 1; break;
3789      case PIXEL_SIZE_32BIT:   ti_width2 <<= 2; break;
3769      case PIXEL_SIZE_4BIT:   ti_width2 >>= 1;    slindwords >>= 3;    width >>= 1;   break;
3770      case PIXEL_SIZE_8BIT:                   slindwords >>= 2;               break;
3771      case PIXEL_SIZE_16BIT:   ti_width2 <<= 1;   slindwords >>= 1;   width <<= 1;   break;
3772      case PIXEL_SIZE_32BIT:   ti_width2 <<= 2;                   width <<= 2;   break;
37903773   }
37913774
3792   slindwords = sl;
3793   switch (ti_size) // Needed by Vigilante 8
3775   if ((tb + (width >> 2)) > 0x400)
37943776   {
3795      case PIXEL_SIZE_4BIT:   slindwords >>= 3; break;
3796      case PIXEL_SIZE_8BIT:   slindwords >>= 2;break;
3797      case PIXEL_SIZE_16BIT:   slindwords >>= 1; break;
3798      case PIXEL_SIZE_32BIT:   break;
3777      width = 0x1000 - tb*4; // Hack for Magical Tetris Challenge
37993778   }
38003779
38013780   if (width & 7)   // Sigh... another Rat Attack-specific thing.
r7553r7554
38053784
38063785   if (dxt != 0)
38073786   {
3808      int j= 0;
3787      int j = 0;
38093788      int t = 0;
38103789      int oldt = 0;
38113790      int ptr;
38123791      int xorval = (fb_size == PIXEL_SIZE_16BIT && ti_size == PIXEL_SIZE_32BIT ) ? 2 : 1; // Wave Race-specific
38133792      UINT32 srcstart = ((tl * ti_width2) >> 2) + slindwords;
38143793      src = &src[srcstart];
3815      for (i = 0; i < (width >> 2); i += 2)
3794      for (int i = 0; i < (width >> 2); i += 2)
38163795      {
38173796         oldt = t;
38183797         t = ((j >> 11) & 1) ? xorval : 0;
r7553r7554
38373816
38383817static RDP_COMMAND( rdp_load_tile )
38393818{
3840   int i, j;
3841   UINT16 sl, sh, tl, th;
3842   int width, height;
3843   int tilenum = (w2 >> 24) & 0x7;
3819   const int tilenum = (w2 >> 24) & 0x7;
38443820   TILE *tex_tile = &tile[tilenum];
38453821   int line = tex_tile->line; // Per Ziggy
3846   int toppad;
3822   int toppad = 0;
38473823
38483824   if (!line)
38493825   {
r7553r7554
38543830   tex_tile->tl = ((w1 >>  0) & 0xfff);
38553831   tex_tile->sh = ((w2 >> 12) & 0xfff);
38563832   tex_tile->th = ((w2 >>  0) & 0xfff);
3857   sl = tex_tile->sl / 4;
3858   tl = tex_tile->tl / 4;
3859   sh = tex_tile->sh / 4;
3860   th = tex_tile->th / 4;
38613833
3862   width = (sh - sl) + 1;
3863   height = (th - tl) + 1;
3834   UINT16 sl = tex_tile->sl / 4;
3835   UINT16 tl = tex_tile->tl / 4;
3836   UINT16 sh = tex_tile->sh / 4;
3837   UINT16 th = tex_tile->th / 4;
38643838
3839   int width = (sh - sl) + 1;
3840   int height = (th - tl) + 1;
3841
38653842   if (ti_size < 3)
38663843   {
38673844      toppad = (width * ti_size) & 0x7;
r7553r7554
38853862            height = (4096 - tb) / line; // Per Ziggy
38863863         }
38873864
3888         for (j=0; j < height; j++)
3865         for (int j = 0; j < height; j++)
38893866         {
38903867            int tline = tb + (tex_tile->line * j);
38913868            int s = ((j + tl) * ti_width) + sl;
38923869#define BYTE_XOR_DWORD_SWAP 7
38933870            int xorval8 = ((j & 1) ? BYTE_XOR_DWORD_SWAP : BYTE_ADDR_XOR); // Per Ziggy
38943871
3895            for (i=0; i < width; i++)
3872            for (int i = 0; i < width; i++)
38963873            {
38973874               tc[(tline + i) ^ xorval8] = src[(ti_address + s + i) ^ BYTE_ADDR_XOR];
38983875            }
r7553r7554
39123889            height = (2048 - tb) / (line / 2); // Per Ziggy
39133890         }
39143891
3915         for (j = 0; j < height; j++)
3892         for (int j = 0; j < height; j++)
39163893         {
39173894            int tline = tb + ((tex_tile->line / 2) * j);
39183895            int s = 0;
r7553r7554
39253902#define WORD_XOR_DWORD_SWAP 3
39263903            xorval16 = (j & 1) ? WORD_XOR_DWORD_SWAP : WORD_ADDR_XOR;
39273904
3928            for (i = 0; i < width; i++)
3905            for (int i = 0; i < width; i++)
39293906            {
39303907               taddr = (tline+i) ^ xorval16;
39313908               if (taddr < 2048) // Needed by World Driver Championship
r7553r7554
39523929            height = (1024 - tb) / (line/4); // Per Ziggy
39533930         }
39543931
3955         for (j=0; j < height; j++)
3932         for (int j = 0; j < height; j++)
39563933         {
39573934            int tline = tb + ((tex_tile->line / 2) * j);
39583935            int s = ((j + tl) * ti_width) + sl;
39593936            int xorval32cur = (j & 1) ? xorval32 : 0;
3960            for (i=0; i < width; i++)
3937            for (int i = 0; i < width; i++)
39613938            {
39623939               tc[(tline + i) ^ xorval32cur] = src[s + i];
39633940            }
r7553r7554
39973974static RDP_COMMAND( rdp_fill_rect )
39983975{
39993976   RECTANGLE rect;
4000   rect.xl = (w1 >> 12) & 0xfff;
4001   rect.yl = (w1 >>  0) & 0xfff;
4002   rect.xh = (w2 >> 12) & 0xfff;
4003   rect.yh = (w2 >>  0) & 0xfff;
3977   rect.xl = (w1 >> 14) & 0x3ff;
3978   rect.yl = (w1 >>  2) & 0x3ff;
3979   rect.xh = (w2 >> 14) & 0x3ff;
3980   rect.yh = (w2 >>  2) & 0x3ff;
40043981
40053982   switch (fb_size)
40063983   {
src/mame/video/hng64.c
r7553r7554
11221122   // buriki tm1 = roz
11231123
11241124   // my life would be easier if the roz we're talking about for complex zoom wasn't setting this as well
1125   if ((tileregs & 0x1800)==0x1000) // floor mode
1125   if ((tileregs & 0x0800)==0x0000) // floor mode
11261126   {
11271127      /* Floor mode - per pixel simple / complex modes? -- every other line?
11281128          (there doesn't seem to be enough data in Buriki for every line at least)
11291129        */
1130      if ((tileregs&0xf000) == 0x1000)
1130      //if ((tileregs&0xf000) == 0x1000)
1131      //{
1132      //  popmessage("Floor is Active");
1133      //}
1134      int line;
1135      rectangle clip;
1136      INT32 xtopleft,xmiddle;
1137      INT32 ytopleft,ymiddle;
1138      int xinc,yinc;
1139
1140      const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
1141      clip.min_x = visarea->min_x;
1142      clip.max_x = visarea->max_x;
1143      clip.min_y = visarea->min_y;
1144      clip.max_y = visarea->max_y;
1145
1146      if (global_tileregs&0x04000000) // globally selects alt scroll register layout???
11311147      {
1132         popmessage("Floor is Active");
1148         /* logic would dictate that this should be the 'complex' scroll register layout,
1149               but per-line.  That doesn't work however.
1150
1151               You only have line data for the number of lines on the screen, not enough for
1152               the complex register layout
1153
1154               HOWEVER, using the code below doesn't work either.  This might be because
1155               they have mosaic turned on, and it adopts a new meaning in linescroll modes?
1156
1157               The code below could also be wrong, and rowscroll simply acts the same in all
1158               modes, this is hard to know because ss64_2 barely uses it.
1159
1160            */
1161
1162         popmessage("Unhandled rowscroll %02x", tileregs>>12);
11331163      }
1134      else
1164      else // 'simple' mode with linescroll, used in some ss64_2 levels (assumed to be correct, but doesn't do much with it.. so could be wrong)
11351165      {
1136         popmessage("Unknown Floor/Mosaic combo %04x", tileregs&0xf800);
1166         for (line=0;line<448;line++)
1167         {
1168            clip.min_y = clip.max_y = line;
1169
1170            if (hng64_videoregs[0x00]&0x00010000) // disable all scrolling / zoom (test screen) (maybe)
1171            {
1172               /* If this bit is active the scroll registers don't seem valid at all?
1173                       It either disables zooming, or disables use of the scroll registers completely
1174                       - used at startup
1175                   */
1176
1177               xtopleft = 0;
1178               xmiddle = 256<<16;
1179
1180               ytopleft = 0;
1181               ymiddle = 256<<16;
1182            }
1183            else
1184            {
1185               xtopleft = (hng64_videoram[(0x40000+(line*0x10)+(scrollbase<<4))/4]);
1186               xmiddle   = (hng64_videoram[(0x40004+(line*0x10)+(scrollbase<<4))/4]); // middle screen point
1187               ytopleft = (hng64_videoram[(0x40008+(line*0x10)+(scrollbase<<4))/4]);
1188               ymiddle   = (hng64_videoram[(0x4000c+(line*0x10)+(scrollbase<<4))/4]); // middle screen point
1189            }
1190
1191            xinc = (xmiddle - xtopleft) / 512;
1192            yinc = (ymiddle - ytopleft) / 512;
1193
1194            hng64_tilemap_draw_roz(machine, bitmap,&clip,tilemap,xtopleft,ytopleft,
1195                  xinc<<1,0,0,yinc<<1,
1196                  1,
1197                  0,0, debug_blend_enabled?HNG64_TILEMAP_ADDITIVE:HNG64_TILEMAP_NORMAL);
1198
1199
1200         }
11371201      }
11381202   }
11391203   else
11401204   {
1141      if ((tileregs&0xf000) > 0x1000)
1205      if ((tileregs&0xf000))
11421206         popmessage("Tilemap Mosaic? %02x", tileregs>>12);
11431207      // 0x1000 is set up the buriki 2nd title screen with rotating logo and in fatal fury at various times?
11441208
r7553r7554
13841448    // 0940 - samurai shodown 64
13851449    // 0880 - buriki
13861450
1387    // mmml dbr? ???? ????
1388    // m = mosaic related?  (xrally, l maybe too)
1389    // l = floor effects / linescroll enable  (buriki on tilemap1, fatal fury on tilemap3) - also enables for rotating logo on buriki ?!
1451    // mmmm dbr? ??e? ????
1452    // m = mosaic related?
1453    //  -- they seem to enable mosaic at the same time as rowscroll in several cases (floor in buriki / ff)
1454    //     and also on the rotating logo in buriki.. does it cause some kind of aliasing side-effect, or.. ?
13901455    // r = tile size (seems correct)
13911456    // b = 4bpp/8bpp (seems correct) (beast busters, samsh64, sasm64 2, xrally switch it for some screens)
1392    // d = floor / mosaic toggle
1393    //  when d = 0 then l = floor enable
1394    //  when d = 1 then l = lower part of mosaic?
1395    //   (buriki one floor vs. 2nd game logo sequence seems a good example)
1396    //    could have other meanings too?
1457    // d = line (floor) mode - buriki, fatafurwa, some backgrounds in ss64_2
1458    // e = enable according to sams64_2 debug mode, buriki and xrally.. but NOT fatal fury :-(
1459
1460
13971461 */
13981462
13991463
r7553r7554
14141478   UINT16 tileflags0, tileflags1;
14151479   UINT16 tileflags2, tileflags3;
14161480
1481#if 0
1482   // press in sams64_2 attract mode for a nice debug screen from the game
1483   // not sure how functional it is, and it doesn't appear to test everything (rowscroll modes etc.)
1484   // but it could be useful
1485   if ( input_code_pressed_once(screen->machine, KEYCODE_L) )
1486   {
1487      const address_space *space = cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
1488      memory_write_byte(space, 0x2f27c8, 0x2);
1489   }
1490#endif
1491
14171492   bitmap_fill(bitmap, 0, hng64_tcram[0x50/4] & 0x10000 ? get_black_pen(screen->machine) : screen->machine->pens[0]); //FIXME: Is the register correct? check with HW tests
14181493   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0x00);
14191494
r7553r7554
15251600   popmessage("%08x %08x TR(%04x %04x %04x %04x) SB(%04x %04x %04x %04x) %08x %08x %08x %08x %08x AA(%08x %08x) %08x %08x",
15261601    hng64_videoregs[0x00],
15271602    hng64_videoregs[0x01],
1528   (hng64_videoregs[0x02]>>16)&0xf9ff, // bits we're sure about are masked out
1529   (hng64_videoregs[0x02]>>0)&0xf9ff,
1530   (hng64_videoregs[0x03]>>16)&0xf9ff,
1531   (hng64_videoregs[0x03]>>0)&0xf9ff,
1603   (hng64_videoregs[0x02]>>16)&0xf9ff, // ----  bits we're sure about are masked out
1604   (hng64_videoregs[0x02]>>0)&0xf9ff,  //  ss64_2 debug mode indicates that 0x0040 is enable!
1605   (hng64_videoregs[0x03]>>16)&0xf9ff, //   buriki agrees (debug data on text layer) xrally agress (pink layer)
1606   (hng64_videoregs[0x03]>>0)&0xf9ff,  //   fatal fury doesn't (all backgrounds have it set) joy
15321607   (hng64_videoregs[0x04]>>16)&0xffff,
15331608   (hng64_videoregs[0x04]>>0)&0xffff,
15341609   (hng64_videoregs[0x05]>>16)&0xffff,
r7553r7554
15541629      hng64_tcram[0x00/4],
15551630      hng64_tcram[0x04/4],
15561631      hng64_tcram[0x08/4], // tilemaps 0/1 ?
1557      hng64_tcram[0x0c/4], // tilemaps 2/3 ?
1632      hng64_tcram[0x0c/4], // ss64_2 debug 04000000 = 'half' on tm1   00000004 = 'half' on tm3 (used in transitions?)
15581633      hng64_tcram[0x10/4],
15591634      hng64_tcram[0x14/4],
15601635      hng64_tcram[0x18/4],
src/mame/drivers/deco_mlc.c
r7553r7554
501501   ROM_LOAD( "mcg-12.5a",  0x000000, 0x200000, CRC(bef9b28f) SHA1(b7a2a0539ea4d22b48ce3f3eb367017f219da2c1) ) // basic coin sounds etc.
502502   ROM_LOAD( "mcg-13.9k",  0x200000, 0x200000, CRC(92301551) SHA1(a7891e7a3c8d7f165ca73f5d5a034501df46e9a2) ) // music
503503   ROM_LOAD( "mcg-14.6a",  0x400000, 0x200000, CRC(c0d8b5f0) SHA1(08eecf6e7d0273e41cda3472709a67e2b16068c9) ) // music
504
505   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
506   ROM_LOAD( "avengrgs.nv",  0x00, 0x80, CRC(c0e84b4e) SHA1(e7afca68cc5fa69ded32bc0a1dcc6a59fe7f081b) )
504507ROM_END
505508
506509ROM_START( avengrgsj )
r7553r7554
529532   ROM_LOAD( "mcg-12.5a",  0x000000, 0x200000, CRC(bef9b28f) SHA1(b7a2a0539ea4d22b48ce3f3eb367017f219da2c1) ) // basic coin sounds etc.
530533   ROM_LOAD( "mcg-13.9k",  0x200000, 0x200000, CRC(92301551) SHA1(a7891e7a3c8d7f165ca73f5d5a034501df46e9a2) ) // music
531534   ROM_LOAD( "mcg-14.6a",  0x400000, 0x200000, CRC(c0d8b5f0) SHA1(08eecf6e7d0273e41cda3472709a67e2b16068c9) ) // music
535
536   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
537   ROM_LOAD( "avengrgsj.nv",  0x00, 0x80, CRC(7ea70843) SHA1(f010b77b824e37c5e8c5722d5fff79751118f0b7) )
532538ROM_END
533539
540
534541ROM_START( stadhr96 )
535542   ROM_REGION( 0x100000, "maincpu", 0 )
536   ROM_LOAD32_WORD( "ead00-4.2a", 0x000000, 0x80000, CRC(b0adfc39) SHA1(3094dfb7c7f8fa9d7e10d98dff8fb8aba285d710) )
537   ROM_LOAD32_WORD( "ead01-4.2b", 0x000002, 0x80000, CRC(0b332820) SHA1(28b757fe529250711fcb82424ba63c222a9329b9) )
543   ROM_LOAD32_WORD( "sh-eaj.2a", 0x000000, 0x80000, CRC(10d1496a) SHA1(1dc151547463a38d717159b3dfce7ffd78a943ad) )
544   ROM_LOAD32_WORD( "sh-eaj.2b", 0x000002, 0x80000, CRC(608a9144) SHA1(15e2fa99dc96e8ebd9868713ae7708cb824fc6c5) )
538545
539546   ROM_REGION( 0x1800000, "gfx1", 0 )
540547   ROM_LOAD16_BYTE( "mcm-00.2e", 0x0000001, 0x400000, CRC(c1919c3c) SHA1(168000ff1512a147d7029ee8878dd70de680fb08) )
r7553r7554
545552   ROM_LOAD16_BYTE( "mcm-05.11m",0x1000000, 0x400000, CRC(476f03d7) SHA1(5c58ab4fc0e29f76619827bc27fa64cce2627e48) )
546553
547554   ROM_REGION( 0x80000, "gfx2", 0 )
548   ROM_LOAD( "ead02-0.6h", 0x000000, 0x80000, CRC(f95ad7ce) SHA1(878dcc1d5f76c8523c788e66bb4a8c5740d515e5) )
555   ROM_LOAD( "sh-eaf.6h", 0x000000, 0x80000, CRC(f074a5c8) SHA1(72709cc0ac2d0df19393b405d8f927834f563e69) )
549556
550   ROM_REGION( 0x800000, "ymz", 0 )
557   ROM_REGION( 0x400000, "ymz", 0 )
551558   ROM_LOAD( "mcm-06.6a",  0x000000, 0x400000,  CRC(fbc178f3) SHA1(f44cb913177b6552b30c139505c3284bc445ba13) )
559
560   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
561   ROM_LOAD( "eeprom-stadhr96.bin",  0x00, 0x80, CRC(77861793) SHA1(df43b3ee55b7eb840cd6d3e5c5e04c68ce64bb57) )
552562ROM_END
553563
554ROM_START( stadhr96a )
564ROM_START( stadhr96j )
555565   ROM_REGION( 0x100000, "maincpu", 0 )
556   ROM_LOAD32_WORD( "sh-eaj.2a", 0x000000, 0x80000, CRC(10d1496a) SHA1(1dc151547463a38d717159b3dfce7ffd78a943ad) )
557   ROM_LOAD32_WORD( "sh-eaj.2b", 0x000002, 0x80000, CRC(608a9144) SHA1(15e2fa99dc96e8ebd9868713ae7708cb824fc6c5) )
566   ROM_LOAD32_WORD( "ead00-4.2a", 0x000000, 0x80000, CRC(b0adfc39) SHA1(3094dfb7c7f8fa9d7e10d98dff8fb8aba285d710) )
567   ROM_LOAD32_WORD( "ead01-4.2b", 0x000002, 0x80000, CRC(0b332820) SHA1(28b757fe529250711fcb82424ba63c222a9329b9) )
558568
559569   ROM_REGION( 0x1800000, "gfx1", 0 )
560570   ROM_LOAD16_BYTE( "mcm-00.2e", 0x0000001, 0x400000, CRC(c1919c3c) SHA1(168000ff1512a147d7029ee8878dd70de680fb08) )
r7553r7554
565575   ROM_LOAD16_BYTE( "mcm-05.11m",0x1000000, 0x400000, CRC(476f03d7) SHA1(5c58ab4fc0e29f76619827bc27fa64cce2627e48) )
566576
567577   ROM_REGION( 0x80000, "gfx2", 0 )
568   ROM_LOAD( "sh-eaf.6h", 0x000000, 0x80000, CRC(f074a5c8) SHA1(72709cc0ac2d0df19393b405d8f927834f563e69) )
578   ROM_LOAD( "ead02-0.6h", 0x000000, 0x80000, CRC(f95ad7ce) SHA1(878dcc1d5f76c8523c788e66bb4a8c5740d515e5) )
569579
570   ROM_REGION( 0x400000, "ymz", 0 )
580   ROM_REGION( 0x800000, "ymz", 0 )
571581   ROM_LOAD( "mcm-06.6a",  0x000000, 0x400000,  CRC(fbc178f3) SHA1(f44cb913177b6552b30c139505c3284bc445ba13) )
582
583   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
584   ROM_LOAD( "eeprom-stadhr96j.bin",  0x00, 0x80, CRC(cf98098f) SHA1(54fc9bdd1ce9b836dad7b4a9909608e8f9842f71) )
572585ROM_END
573586
587
574588ROM_START( hoops96 )
575589   ROM_REGION( 0x100000, "maincpu", 0 )
576590   ROM_LOAD32_WORD( "sz00-0.2a", 0x000000, 0x80000, CRC(971b4376) SHA1(e60d8d628bd1dc95d7f2b8840b0b188e68905c12) )
r7553r7554
588602
589603   ROM_REGION( 0x400000, "ymz", 0 )
590604   ROM_LOAD( "mce-05.6a",  0x000000, 0x400000,  CRC(e7a9355a) SHA1(039b23666e224c33ebb02baa80e496f8bce0514f) )
605
606   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
607   ROM_LOAD( "hoops.nv",  0x00, 0x80, CRC(67b18457) SHA1(5d6a0034bfc3d395ecd941ed024c8884b43f2a31) )
591608ROM_END
592609
593610ROM_START( hoops95 )
r7553r7554
607624
608625   ROM_REGION( 0x400000, "ymz", 0 )
609626   ROM_LOAD( "mce-05.6a",  0x000000, 0x400000,  CRC(e7a9355a) SHA1(039b23666e224c33ebb02baa80e496f8bce0514f) )
627
628   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
629   ROM_LOAD( "hoops.nv",  0x00, 0x80, CRC(67b18457) SHA1(5d6a0034bfc3d395ecd941ed024c8884b43f2a31) )
610630ROM_END
611631
612632ROM_START( ddream95 )
r7553r7554
626646
627647   ROM_REGION( 0x400000, "ymz", 0 )
628648   ROM_LOAD( "mce-05.6a",  0x000000, 0x400000,  CRC(e7a9355a) SHA1(039b23666e224c33ebb02baa80e496f8bce0514f) )
649
650   ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 )
651   ROM_LOAD( "hoops.nv",  0x00, 0x80, CRC(67b18457) SHA1(5d6a0034bfc3d395ecd941ed024c8884b43f2a31) )
629652ROM_END
630653
631654ROM_START( skullfng )
r7553r7554
745768
746769GAME( 1995, avengrgs, 0,        avengrgs, mlc, avengrgs, ROT0,   "Data East Corporation", "Avengers In Galactic Storm (US)", 0 )
747770GAME( 1995, avengrgsj,avengrgs, avengrgs, mlc, avengrgs, ROT0,   "Data East Corporation", "Avengers In Galactic Storm (Japan)", 0 )
748GAME( 1996, stadhr96, 0,        mlc_6bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Stadium Hero 96 (Version EAD)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
749GAME( 1996, stadhr96a,stadhr96, mlc_6bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Stadium Hero 96 (Version EAJ)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
771GAME( 1996, stadhr96, 0,        mlc_6bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Stadium Hero 96 (World, EAJ)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) // Rom labels are EAJ  ^^
772GAME( 1996, stadhr96j,stadhr96, mlc_6bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Stadium Hero 96 (Japan, EAD)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING ) // Rom labels are EAD (this isn't a Konami region code!)
750773GAME( 1996, skullfng, 0,        mlc_6bpp, mlc, mlc,      ROT270, "Data East Corporation", "Skull Fang (World)", 0 ) /* Version 1.13, Europe, Master 96.02.19 */
751774GAME( 1996, skullfngj,skullfng, mlc_6bpp, mlc, mlc,      ROT270, "Data East Corporation", "Skull Fang (Japan)", 0 ) /* Version 1.09, Japan, Master 96.02.08 */
752775GAME( 1996, hoops96,  0,        mlc_5bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Hoops '96 (Europe/Asia 2.0)", 0 )
753GAME( 1995, ddream95, hoops96,  mlc_5bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Dunk Dream '95 (Japan 1.4 EAM)", 0 )
776GAME( 1995, ddream95, hoops96,  mlc_5bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Dunk Dream '95 (Japan 1.4, EAM)", 0 )
754777GAME( 1995, hoops95,  hoops96,  mlc_5bpp, mlc, mlc,      ROT0,   "Data East Corporation", "Hoops (Europe/Asia 1.7)", 0 )
src/mame/drivers/hornet.c
r7553r7554
392392
393393static VIDEO_UPDATE( hornet_2board )
394394{
395   if (strcmp(screen->tag, "lscreen") == 0)
395   if (strcmp(screen->tag(), "lscreen") == 0)
396396   {
397397      running_device *k037122 = devtag_get_device(screen->machine, "k037122_1");
398398      running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
r7553r7554
401401      /* TODO: tilemaps per screen */
402402      k037122_tile_draw(k037122, bitmap, cliprect);
403403   }
404   else if (strcmp(screen->tag, "rscreen") == 0)
404   else if (strcmp(screen->tag(), "rscreen") == 0)
405405   {
406406      running_device *k037122 = devtag_get_device(screen->machine, "k037122_2");
407407      running_device *voodoo = devtag_get_device(screen->machine, "voodoo1");
src/mame/drivers/ddragon3.c
r7553r7554
714714   ROM_LOAD( "30j-2.ic11",   0x100000, 0x80000, CRC(41c6fb08) SHA1(9fb6105bdc9ff8eeaacf378d208cf6d32a09401b) )
715715   ROM_LOAD( "30j11-0.ic10", 0x180000, 0x10000, CRC(99195b2a) SHA1(d1c0e1855aed22f169717f94d78bc326e68e3064) )
716716   ROM_LOAD( "30j-1.ic13",   0x200000, 0x80000, CRC(67a6f114) SHA1(7d0f3cd6376128ddfcd13f2ec683ec270e95c19c) )
717   ROM_LOAD( "30a10-0.ic12", 0x280000, 0x10000, CRC(e3879b5d) SHA1(fc87aedb0f4964a8d261d86121fe8544b330bed9) )
717   ROM_LOAD( "30j10-0.ic12", 0x280000, 0x10000, CRC(e3879b5d) SHA1(fc87aedb0f4964a8d261d86121fe8544b330bed9) )
718718   ROM_LOAD( "30j-0.ic15",   0x300000, 0x80000, CRC(f15dafbe) SHA1(68049c4542e1c7119bbf1be1fa44e3eea9c11b6e) )
719719   ROM_LOAD( "30j9-0.ic14",  0x380000, 0x10000, CRC(2759ae84) SHA1(02c70958259f56174ce2ba2db56040dad72be02b) )
720720
r7553r7554
861861
862862ROM_START( ctribe1 )
863863   ROM_REGION( 0x80000, "maincpu", 0 )   /* 64k for cpu code */
864   ROM_LOAD16_BYTE( "28a16-2.ic26", 0x00001, 0x20000, CRC(f00f8443) SHA1(3c099b6bea9956cc60ce4a9a5d790ac2bf7d77bd) )
865   ROM_LOAD16_BYTE( "28a15-2.ic25", 0x00000, 0x20000, CRC(dd70079f) SHA1(321b523fefec2a962d0afa20b33428e7caea8958) )
864   ROM_LOAD16_BYTE( "1_28a16-2.ic26", 0x00001, 0x20000, CRC(f00f8443) SHA1(3c099b6bea9956cc60ce4a9a5d790ac2bf7d77bd) )
865   ROM_LOAD16_BYTE( "1_28a15-2.ic25", 0x00000, 0x20000, CRC(dd70079f) SHA1(321b523fefec2a962d0afa20b33428e7caea8958) )
866866   ROM_LOAD16_BYTE( "28j17-0.104", 0x40001, 0x10000, CRC(8c2c6dbd) SHA1(b99b9be6e0bdc8340fedd258819c4df587926a84) )
867867   /* No EVEN rom! */
868868
src/mame/drivers/5clown.c
r0r7554
1/******************************************************************************
2
3
4  FIVE CLOWN HARDWARE
5  IGS - International Games System.
6
7  Driver by Roberto Fresca & Grull Osgo.
8
9
10  Games running on this hardware:
11
12  * Five Clown (english, set 1), 1993, IGS.
13  * Five Clown (english, set 2), 1993, IGS.
14  * Five Clown (spanish hack),   1993, IGS.
15
16
17  This hardware seems to be based on Bonanza's Golden Poker, but on steroids...
18  Double CPU, FM sounds, samples system, different encryption schemes and other
19  complex things mark the difference.
20
21  Special Thanks to Iris Falbala that kindly offered herself as beta tester. :)
22
23
24*******************************************************************************
25
26
27  *** Hardware notes ***
28
29
30  - CPU:  2x Rockwell R6502P.   (u16, u42)
31  - CRTC: 1x GoldStar GM68B45S. (u10)
32  - I/O:  2x ST EF6821P PIA's.  (u9, u15)
33
34  - RAM:  1x GM76C28A-10 CMOS SRAM (2048 x 8, DIP). (u45)
35          2x Hitachi 6116. (u1, u36)
36
37  - CLK:  1x 10MHz. crystal.
38
39  - ROMs: 1x M27C512.    (u50)
40          1x M27256.     (u34)
41          1x M5L2764.    (u35)
42          1x DB (5,6,7). (u2)
43
44  - PLDs: 1x PEEL 18CV8P. (u33)
45          1x PALCE22V10H. (u43)
46          2x PALCE16V6Q.  (u13, u14)
47
48  - PROM: 1x Fairchild Semiconductor DM74S287AN. (u32)
49
50  - SOUND: 1x Winbond WF19054 (AY8910 compatible). (u59)
51           1x (unknown) A66 (OKI 6295 compatible). (u51)
52
53           1x NEC Electronics UPC1242H (7W AF Power Amplifier). (u54)
54
55
56  Other components:
57
58  3x 8 DIP Switches Banks. (SW1, SW2, SW3)
59  1x 4 DIP Switches Bank.  (SW4)
60  1x Reset Switch.         (SW5)
61
62  1x 3.6 Battery.
63  1x (2x) 22-pins Edge Connector.
64  1x (2x) 10-pins Edge Connector.
65
66  1x 19 Diodes Matrix (near edge connector)
67
68
69
70  PCB Layout:
71   ____________________________________________________________________________________________
72  |      ________    ________    ________    ________   ____       ___________   ___________   |
73  |     |DS2003CN|  |12345678|  |12345678|  |12345678| |1234|     |           | |  27C512   |  |
74  |     |________|  |________|  |________|  |________| |____|     |  HM-6116  | | ...or DB  |  |
75  |      U30         SW1         SW2         SW3        SW4       |___________| |___________|  |
76  |___   ________   _________   _________   _________   _________  U1            U2            |
77      | | 74LS02 | | 74LS245 | | 74LS245 | | 74LS245 | | 74LS138 |     _________   _________   |
78      | |________| |_________| |_________| |_________| |_________|    | 74LS245 | | 74LS245 |  |
79      |  U31        U3          U4          U5          U6            |_________| |_________|  |
80   ___|                ____________________    ____________________    U7          U8          |
81  |___  22x2          |                    |  |                    |   ________    _________   |
82  |___  CONN          |      EF6821P       |  |     GM68B45S       |  |74LS193?|  | 74LS374 |  |
83  |___    __          |____________________|  |____________________|  |________|  |_________|  |
84  |___   |__| D        U9                      U10                     U11         U12         |
85  |___   |__| I        ____________________    ____________________    _________   _________   |
86  |___   |__| O       |                    |  |                    |  |PALCE16V8| |PALCE16V8|  |
87  |___   |__| D       |      EF6821P       |  |      R6502P        |  |_________| |_________|  |
88  |___   |__| E       |____________________|  |____________________|   U13         U14         |
89  |___   |__|          U15                     U16                     _________   _________   |
90  |___   |__| M                                                       | 74LS166 | | 74LS245 |  |
91  |___   |__| A        _________                                      |_________| |_________|  |
92  |___   |__| T       | HD7407P |  ________                            U17         U18         |
93  |___   |__| R       |_________| | 74LS04 |   ________    ________    _________   _________   |
94  |___   |__| I        U19        |________|  | 74LS86 |  | 74LS36?|  | 74LS273 | | 74LS166 |  |
95  |___   |__| X        _________   U20        |________|  |________|  |_________| |_________|  |
96  |___   |__|         | HD7407P |              U21         U22         U23         U24         |
97  |___   |__|         |_________|   _______    ___________             _________   _________   |
98  |___   |__|          U25         | XTAL  |  | 74LS244   |           | 74LS273 | | 74LS166 |  |
99  |___   |__|          _________   | 10MHz |  |___________|           |_________| |_________|  |
100  |___   |__|         | 74LS174 |  |_______|   U26                     U27         U28         |
101  |___   |__|         |_________|   X1                                                         |
102  |___                 U29                   _____________    _____________     ____________   |
103      |          __________    __________   |             |  |             |   |            |  |
104      |         |DM74S287AN|  |PEEL18CV8P|  | [7] M27256  |  | [9] M5L2764 |   |  HM-6116   |  |
105      |         |__________|  |__________|  |_____________|  |_____________|   |____________|  |
106      |          U32           U33           U34              U35               U36            |
107      |          ___________    _________    __________    ___________________    _________    |
108      |         |  74LS273  |  | 74LS157 |  | 74LS273  |  |                   |  | 74LS367 |   |
109      |         |___________|  |_________|  |__________|  |      R6502P       |  |_________|   |
110      |          U37            U38          U39          |___________________|   U40          |
111      |                         _________    ___________   U42                    _________    |
112      |                        | 74LS157 |  |PALCE22V10H|       ______           | 74LS245 |   |
113      | _______ ____________   |_________!  |___________|      |      |          |_________|   |
114   ___||       |            |   U41          U43               | A66  |           U44          |
115  |___ | 3.6v  |  GoldStar  |   _________       _____________  |(6295)| _________   _________  |
116  |___ |BATTERY|  GM76C28A  |  | 74LS157 |     |             | |______|| 74LS04  | | PAL16L8 | |
117  |___ |       |____________|  |_________|     | [8] M27C512 |  U51    |_________| |_________| |
118  |___ |_______| U45             U46           |_____________|          U47         U48        |
119  |___           _________   _______  _______   U50                     __________             |
120  |___          | 74LS161 | |(NO IC)||       |       ________          | 74LS245  |            |
121  |___          |_________| |  UPC  ||  UPC  |      |        |         |__________|            |
122  |___           U49        | 1241H || 1242H |      | GL7805 |          U52                    |
123  |___  10x2     _________  |_______||_______|      |________|          _________   _________  |
124  |___  CONN    | 74HC132 |  U53      U54            U55               | 74LS374 | | 74LS174 | |
125      |         |_________|                                            |_________| |_________| |
126      |  _|_|_|_ U56                                                    U57         U58        |
127      | |       |                                                       _____________________  |
128   ___| |  SW5  |                                                      |                     | |
129  |     |_______|                                                      |  WF19054 (AY8910)   | |
130  |       |_|                                                          |_____________________| |
131  |                                                                     U59                    |
132  |____________________________________________________________________________________________|
133
134
135  U58 = 74LS174 (Quad Latch).....
136  U57 = 74LS374 (Octal Latch)..... Near to AY8910! :)
137
138
139
140  DIP Switches Layout:
141
142   SW1:                    SW2:                    SW3:                    SW4:
143  +-------------------+   +-------------------+   +-------------------+   +-----------+
144  | ON                |   | ON                |   | ON                |   | ON        |
145  | +---------------+ |   | +---------------+ |   | +---------------+ |   | +-------+ |
146  | |_|_|_|_|_|o|o|o| |   | |_|o|o|o|o|_|_|_| |   | |_|o|_|_|o|_|_|_| |   | |_|_|_|_| |
147  | |o|o|o|o|o| | | | |   | |o| | | | |o|o|o| |   | |o| |o|o| |o|o|o| |   | |o|o|o|o| |
148  | +---------------+ |   | +---------------+ |   | +---------------+ |   | +-------+ |
149  |  1 2 3 4 5 6 7 8  |   |  1 2 3 4 5 6 7 8  |   |  1 2 3 4 5 6 7 8  |   |  1 2 3 4  |
150  +-------------------+   +-------------------+   +-------------------+   +-----------+
151
152
153*******************************************************************************
154
155
156  MEMORY MAP
157  ----------
158
159  Main CPU:
160
161  0000 - 07FF  NVRAM.
162
163  0800 - 0800  MC6845 address.
164  0801 - 0801  MC6845 register.
165
166  0844 - 0847  PIA 0.
167  0848 - 084B  PIA 1.
168
169  1000 - 13FF  Video RAM (Init'ed at $2042).
170  1800 - 1BFF  Color RAM (Init'ed at $2054).
171
172  2000 - 7FFF  ROM space.
173
174  C048 - C048  Unknown sound related writes.
175  D800 - D800  Main/Sound latch.
176
177  C400 - C400  DIP Switches bank: SW1.
178  CC00 - CC00  DIP Switches bank: SW2.
179  D400 - D400  DIP Switches bank: SW3.
180
181  E000 - FFFF  ROM space.
182
183
184*******************************************************************************
185
186
187    Game Notes
188    ----------
189
190  - Checksums.
191
192  The checksum routine starts at $FE1D
193  Once checksumed the whole range, compares the result with a harcoded value.
194  If match, jumps to a subroutine that prints "ROM x ERR".
195  If doesn't match, prints "ROM x OK"
196
197  So... It's inverted. Seems that someone replaced the BEQ's instructions with
198  BNE's, to pass the checksums.
199
200  $FE1D ---> checks ROM 5 (4000-5FFF)
201  $FE44 ---> checks ROM 6 (2000-3FFF)
202  $FE6B ---> checks ROM 7 (E000-FDFF)
203
204
205*******************************************************************************
206
207
208  Game Settings
209  -------------
210
211  From a datasheet. Seems to be unaccurate...
212
213
214  DIP Switches Settings:
215
216  DIP SW.1  Win-Up "7" Rate     1       2
217            Lowest              on      on
218            Low                 off     on
219            Medium              on      off
220            High                off     off
221
222            Two Pair            3
223            High                on
224            Low                 off
225
226            One Joker Rate      5       6
227            Lowest              on      on
228            Low                 on      off
229            Medium              off     on
230            High                off     off
231
232            Three of a kind     7
233            High                on
234            Low                 off
235
236  DIP SW.2  Key In              1       2
237            10                  on      on
238            20                  on      off
239            50                  off     on
240            100                 off     off
241
242  DIP SW.3  2 Jokers Rate       1       8
243            Lowest              on      on
244            Low                 on      off
245            Medium              off     on
246            High                off     off
247
248            3,4,5 Jokers Rate   2       3
249            Lowest              on      on
250            Low                 off     on
251            Medium              on      off
252            High                off     off
253
254            Max Bet             4       5
255            80                  on      on
256            40                  on      off
257            50                  off     on
258            10                  off     off
259
260  DIP SW.4  "J" Pair            1
261            Win                 on
262            Lose                off
263
264            Pay Mode            2
265            Key out             on
266            Coin out            off
267
268            Coin                3
269            1 Coin 1 Credit     on
270            1 Coin 10 Credit    off
271
272
273
274  CHANCE SETTINGS
275  ---------------
276
277  Settings Table:
278
279  -----+-----------------+-----------+-------------------------------------
280  Loc. |    Function     | Val.Range |      Comment
281  -----+-----------------+-----------+-------------------------------------
282   A   | Five Jokers     |    0-8    | If 0 never comes out.
283   B   | Royal Flush     |    0-8    | If 0 never comes out.
284   C   | Five of a Kind  |    0-8    | If 0 never comes out.
285   D   | Straight Flush  |    0-8    | If 0 never comes out.
286   E   | Four of a Kind  |    0-8    | If 0 never comes out.
287   F   | Full House      |    0-8    | 0 Lowest -  8 Highest.
288   G   | Flush           |    0-8    | 0 Lowest -  8 Highest.
289   H   | Straight        |    0-8    | 0 Lowest -  8 Highest.
290   I   | W-Up            |    0-10   | 0 Lowest - 10 Highest.
291   J   | Bet Limit       |    0-1    | 0 Over bet setting never comes out.
292       |                 |           | 1 Below bet setting never comes out.
293
294
295  Chance Settings Screen:
296
297              A   B   C   D   E   F   G   H   I   J
298  Value       0   0   4   3   5   6   6   7   10  0
299  Bet Limit   0   0   50  50  50  -   -   -   -   -
300
301  Bet Range: 1 to 80 Credits.
302
303
304
305  Chance Settings Key Function:
306
307  BIG:     Move left
308  SMALL:   Move right
309  START:   Increase value.
310  COLLECT: Decrease value.
311  HOLD 5:  Exit.
312
313
314
315  Settings Suggestions
316  --------------------
317
318  Suggestion One:
319
320    Dip.Sw. Setting
321    Dip.Sw. 2   3=On    4=On    Others=Off
322    Dip.Sw. 3   2=On    4=On    Others=Off
323
324    Chance Setting
325    A   B   C   D   E   F   G   H   I   J
326    1   2   2   4   6   7   8   8   8   0
327    5   10  20  40  40  -   -   -   -   -
328
329
330  Suggestion Two:
331
332    Dip.Sw. Setting
333    Dip.Sw. 2   4=On    7=On    Others=Off
334    Dip.Sw. 3   2=On    4=On    Others=Off
335
336    Chance Setting
337    A   B   C   D   E   F   G   H   I   J
338    1   2   2   3   5   6   6   7   8   0
339    5   10  20  40  40  -   -   -   -   -
340
341
342*******************************************************************************
343
344    Keyboard Matrix
345    ---------------
346
347    Com. A      Bet         Record      W-Up        Start       N/U
348    Com. B      Payout      Keyout      Small       Big         Collect
349    Com. C      Hold 1      Hold 2      Hold 3      Hold 4      Hold 5
350    Com. D      Key In      Coin        Setting     N/U         N/U
351
352
353*******************************************************************************
354
355  Findings about the samples encryption
356  -------------------------------------
357
358  For every byte, if bit 1 is active is automatically XOR'ed.
359  Otherwise bit 1 & bit 5 are XOR'ed.
360
361
362  XOR'ing bit 1, I got the following vector table:
363
364  01) 0400-1E67
365  02) 1E78-06D7 <--- No sense!
366  03) 06C8-2067
367  04) 2078-3737
368  05) 3728-3FEF
369  06) 3000-382F
370  07) 3840-49B0
371  08) 49B1-7671
372  09) 7662-84D2
373  10) 84D3-A893
374  11) A884-C8CC
375  12) C8CD-DEEC
376  13) DEED-D8DC <--- No sense!
377  14) D8DD-DD4C
378
379  But... If we involve bit 5 in the changes, vectors are perfect!.
380
381  01) 0400-1E67  --->  0400-0E77 (ok)
382  02) 1E78-06D7  --->  0E78-16C7 (ok)
383  03) 06C8-2067  --->  16C8-2077 (ok)
384  04) 2078-3737  --->  2078-2727 (ok)
385  05) 3728-3FEF  --->  2728-2FFF (ok)
386  06) 3000-382F  --->  3000-383F (ok)
387  07) 3840-49B0  --->  3840-49B0 (ok)
388  08) 49B1-7671  --->  49B1-6671 (ok)
389  09) 7662-84D2  --->  6672-84C2 (ok)
390  10) 84D3-A893  --->  84C3-A883 (ok)
391  11) A884-C8CC  --->  A884-C8CC (ok)
392  12) C8CD-DEEC  --->  C8CD-CEEC (ok)
393  13) DEED-D8DC  --->  CEED-D8DC (ok)
394  14) D8DD-DD4C  --->  D8DD-DD4C (ok)
395
396
397  Happy End! :)
398
399
400*******************************************************************************
401
402
403  Driver updates:
404
405
406  [2010-03-08]
407
408  - Initial release.
409  - Hooked both 6502 CPU's.
410  - Hooked the M6845 CRT.
411  - Decrypted main program and bulk GFX.
412  - Decoded GFX and color PROM.
413  - Hooked both PIA's 6821.
414  - Worked inputs from the scratch.
415  - Hooked DIP Switches banks 2 & 4.
416  - Hooked proper interrupts for audio CPU.
417  - Hooked the AY8910 latches...
418  - Hooked the OKI6295.
419  - Hooked DIP switches ports $C400 & $CC00.
420  - Found the sound samples decryption algorithm.
421  - Added NVRAM support.
422  - Added a complete PCB layout.
423  - Added game notes.
424  - Added technical notes.
425
426
427  TODO:
428
429  - Proper clock frequencies for CPU, AY8910 & OKI6295.
430  - Verify OKI6295 pin 7 (high/low).
431  - Try to implement SW5 (Hard Reset + NVRAM clear).
432  - Main CPU:  0xC048 - Unknown sound stuff writes (related to ay8910).
433  - Audio CPU: 0x2004 - Unknown writes.
434  - Audio CPU: 0x2006 - Unknown reads.
435  - PIA0: Unknown reads to port B.
436  - PIA1: Massive unknown reads to port B.
437  - Verify the background color.
438
439
440*******************************************************************************/
441
442
443#define MASTER_CLOCK   XTAL_10MHz
444
445#include "emu.h"
446#include "cpu/m6502/m6502.h"
447#include "video/mc6845.h"
448#include "machine/6821pia.h"
449#include "sound/ay8910.h"
450#include "sound/okim6295.h"
451
452static UINT8 main_latch_d800;
453static UINT8 snd_latch_0800;
454static UINT8 snd_latch_0a02;
455static UINT8 ay8910_addr;
456running_device *ay8910;
457
458
459/*************************
460*     Video Hardware     *
461*************************/
462
463static UINT8 *videoram;
464static UINT8 *colorram;
465static tilemap_t *bg_tilemap;
466
467
468static WRITE8_HANDLER( fclown_videoram_w )
469{
470   videoram[offset] = data;
471   tilemap_mark_tile_dirty(bg_tilemap, offset);
472}
473
474static WRITE8_HANDLER( fclown_colorram_w )
475{
476   colorram[offset] = data;
477   tilemap_mark_tile_dirty(bg_tilemap, offset);
478}
479
480
481static TILE_GET_INFO( get_fclown_tile_info )
482{
483
484/*  - bits -
485    7654 3210
486    ---- ---x   Tiles extended address (MSB).
487    ---- --x-   Tiles bank.
488    --xx xx--   Tiles color.
489    -x-- ----   Chars extended address.
490    x--- ----   Extra color for 7's.
491*/
492
493   int attr = colorram[tile_index];
494   int code = ((attr & 0x01) << 8) | ((attr & 0x40) << 2) | videoram[tile_index];   /* bit 8 for extended char set */
495   int bank = (attr & 0x02) >> 1;                                       /* bit 1 switch the gfx banks */
496   int color = (attr & 0x3c) >> 2 | ((attr & 0x80) >> 3);                     /* bits 2-3-4-5-7 for color */
497
498   SET_TILE_INFO(bank, code, color, 0);
499}
500
501
502static VIDEO_START(fclown)
503{
504   bg_tilemap = tilemap_create(machine, get_fclown_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
505}
506
507
508static VIDEO_UPDATE( fclown )
509{
510   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
511   return 0;
512}
513
514static PALETTE_INIT( fclown )
515{
516/*
517    7654 3210
518    ---- ---x   RED component.
519    ---- --x-   GREEN component.
520    ---- -x--   BLUE component.
521    ---- x---   background killer.
522    xxxx ----   unused.
523*/
524   int i;
525
526   /* 0000KBGR */
527
528   if (color_prom == 0) return;
529
530   for (i = 0;i < machine->config->total_colors;i++)
531   {
532      int bit0, bit1, bit2, bit3, r, g, b, bk;
533
534      /* background killer */
535        bit3 = (color_prom[i] >> 3) & 0x01;
536        bk = bit3;
537
538      /* red component */
539      bit0 = (color_prom[i] >> 0) & 0x01;
540      r = (bit0 * 0xff);
541
542      /* green component */
543      bit1 = (color_prom[i] >> 1) & 0x01;
544      g = (bit1 * 0xff);
545
546      /* blue component */
547      bit2 = (color_prom[i] >> 2) & 0x01;
548      b = bk * (bit2 * 0xff);
549
550      palette_set_color(machine, i, MAKE_RGB(r, g, b));
551   }
552}
553
554
555/******************************
556*         R/W Handlers        *
557******************************/
558
559static int mux_data = 0;
560
561/* Inputs (buttons) are multiplexed.
562   There are 4 sets of 5 bits each and are connected to PIA0, portA.
563   The selector bits are located in PIA1, portB (bits 4-7).
564*/
565static READ8_DEVICE_HANDLER( mux_port_r )
566{
567   switch( mux_data & 0xf0 )      /* bits 4-7 */
568   {
569      case 0x10: return input_port_read(device->machine, "IN0-0");
570      case 0x20: return input_port_read(device->machine, "IN0-1");
571      case 0x40: return input_port_read(device->machine, "IN0-2");
572      case 0x80: return input_port_read(device->machine, "IN0-3");
573   }
574
575   return 0xff;
576}
577
578
579static WRITE8_DEVICE_HANDLER( mux_w )
580{
581   mux_data = data ^ 0xff;   /* Inverted */
582}
583
584
585static WRITE8_DEVICE_HANDLER( counters_w )
586{
587/*  Counters:
588
589    7654 3210
590    ---- xxxx   Unused.
591    ---x ----   Key In / Note counter.
592    --x- ----   Payout counter.
593    -x-- ----   Unknown (increments at start).
594    x--- ----   Unknown (increments at start).
595*/
596   coin_counter_w(device->machine, 0, data & 0x10);   /* Key In */
597   coin_counter_w(device->machine, 1, data & 0x20);   /* Payout */
598   coin_counter_w(device->machine, 2, data & 0x40);   /* unknown */
599   coin_counter_w(device->machine, 3, data & 0x80);   /* unknown */
600
601}
602
603
604static WRITE8_DEVICE_HANDLER( trigsnd_w )
605{
606   /************ Interrupts trigger **************
607
608    Writes 0x07 & 0x0F each time a sound is triggered through $D800 */
609
610   if ( (data & 0x0f) == 0x07 )
611   {
612      cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE );
613   }
614
615   else
616   {
617      cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE );
618   }
619
620}
621
622static READ8_DEVICE_HANDLER( pia0_b_r )
623{
624   /* often read the port */
625   return 0x00;
626}
627
628static READ8_DEVICE_HANDLER( pia1_b_r )
629{
630   /* constantly read the port */
631   return 0x00;   /* bit 2 shouldn't be active to allow work the key out system */
632}
633
634
635/**********************************/
636
637
638static WRITE8_HANDLER( cpu_c048_w)
639{
640   logerror("Main: Write to $C048: %02X\n", data);
641}
642
643static WRITE8_HANDLER( cpu_d800_w )
644{
645   logerror("Main: Write to $D800: %02x\n", data);
646   main_latch_d800 = data;
647}
648
649
650/********************************
651*  AY3-8910 R/W Handlers        *
652********************************/
653
654static WRITE8_DEVICE_HANDLER( fclown_ay8910_w )
655{
656   ay8910_address_w(device, 0, offset);
657   ay8910_data_w(device, 0, data);
658}
659
660
661/******************************
662*  SOUND  R/W Handlers        *
663******************************/
664
665static READ8_HANDLER( snd_e06_r )
666{
667   logerror("Sound: Read from $0E06 \n");
668   return main_latch_d800;
669}
670
671static WRITE8_HANDLER( snd_800_w )
672{
673   snd_latch_0800 = data;
674
675   if (snd_latch_0a02 == 0xc0)
676   {
677      ay8910_addr = snd_latch_0800;
678   }
679
680   if (snd_latch_0a02 == 0x00)
681   {
682      fclown_ay8910_w( ay8910, ay8910_addr, snd_latch_0800);
683   }
684}
685
686static WRITE8_HANDLER( snd_a02_w )
687{
688   snd_latch_0a02 = data & 0xff;
689   logerror("Sound: Write to $0A02: %02x\n", snd_latch_0a02);
690}
691
692
693/*************************
694* Memory map information *
695*************************/
696
697static ADDRESS_MAP_START( fclown_map, ADDRESS_SPACE_PROGRAM, 8 )
698   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram)
699   AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_address_w)
700   AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
701   AM_RANGE(0x0844, 0x0847) AM_DEVREADWRITE("pia0", pia6821_r, pia6821_w)
702   AM_RANGE(0x0848, 0x084b) AM_DEVREADWRITE("pia1", pia6821_r, pia6821_w)
703   AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(fclown_videoram_w) AM_BASE(&videoram)   /* Init'ed at $2042 */
704   AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(fclown_colorram_w) AM_BASE(&colorram)   /* Init'ed at $2054 */
705   AM_RANGE(0x2000, 0x7fff) AM_ROM               /* ROM space */
706
707   AM_RANGE(0xc048, 0xc048) AM_WRITE(cpu_c048_w )
708   AM_RANGE(0xd800, 0xd800) AM_WRITE(cpu_d800_w )
709
710   AM_RANGE(0xc400, 0xc400) AM_READ_PORT("SW1")   /* DIP Switches bank */
711   AM_RANGE(0xcc00, 0xcc00) AM_READ_PORT("SW2")   /* DIP Switches bank */
712   AM_RANGE(0xd400, 0xd400) AM_READ_PORT("SW3")   /* Second DIP Switches bank */
713
714   AM_RANGE(0xe000, 0xffff) AM_ROM               /* ROM space */
715ADDRESS_MAP_END
716
717/*
718
719  $C048 & $D800
720  --------------
721
722  $C048: SND Writes.
723
724   VAL  MEANS
725  ----+-------
726   0F | Mute or Ack Command?
727   12 | Hold
728   31 | D-UP
729   A6 | D-UP 7's
730
731
732  $D800: SND Writes.
733  Seems that enumerate the different sounds (from table?)
734  After each $D800 write, 0x07 & 0x0F are written to PIA1, port A,
735  triggering the needed interrupt for audio CPU.
736
737   VAL  MEANS
738  ----+-------
739   01 | Deal 1 (Coin In)
740   02 | Deal 2 (Key In)
741   03 | Deal 3 (bet, Coin Out)
742   04 | Deal 4
743   05 | Deal 5
744   06 | Hold
745   07 | Un-Hold
746   0C | D-UP
747   34 | D-UP
748   13 | Big
749   15 | D-UP 7's
750
751
752  WIN seq --> D800: 1B 1B 18 1B 10 1B 1B 1B 19 1D 18 1A 19 1B 10 1C 10 1A 1A 1A 10 1A
753                    1D 18 1B 18 1D 18 10 18 19 10 10 10 1B 1B 10 19 1B 1C 3F () 16 ()
754
755  WIN seq --> C048: 33 () 35 37 35 33 35 37 35 33 35 30 (0F)
756
757  Empty parenthesis means switch to the other offset.
758  Last value (0x0F) seems to be a kind of mute command.
759
760  Example:
761
762  Main: Write to $D800: 02      : Sound 2.
763  PIA 1: Write to port A: 07    : Trigger audio CPU interrupt.
764  PIA 1: Write to port A: 0F    : Clear audio CPU interrupt.
765  Main: Write to $C048: XX      : Writes (to other snd device?) if apply.
766  Main: Write to $C048: XX      : Writes (to other snd device?) if apply.
767  Main: Write to $C048: XX      : Writes (to other snd device?) if apply.
768  Main: Write to $C048: 0F      : Kind of mute or ack command.
769
770*/
771
772static ADDRESS_MAP_START( fcaudio_map, ADDRESS_SPACE_PROGRAM, 8 )
773   AM_RANGE(0x0000, 0x07ff) AM_RAM
774   AM_RANGE(0x0800, 0x0800) AM_WRITE(snd_800_w)
775   AM_RANGE(0x0a02, 0x0a02) AM_WRITE(snd_a02_w)
776   AM_RANGE(0x0c04, 0x0c04) AM_DEVWRITE("oki6295", okim6295_w)
777   AM_RANGE(0x0c06, 0x0c06) AM_DEVREAD("oki6295", okim6295_r)
778   AM_RANGE(0x0e06, 0x0e06) AM_READ(snd_e06_r)
779   AM_RANGE(0xe000, 0xffff) AM_ROM               /* ROM space */
780ADDRESS_MAP_END
781
782
783/*************************
784*      Input ports       *
785*************************/
786
787static INPUT_PORTS_START( fclown )
788   /* Multiplexed - 4x5bits */
789   PORT_START("IN0-0")
790   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_BET )
791   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK )   PORT_NAME("Record")
792   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )
793   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL )   PORT_NAME("Start")
794   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )      /* cancel */
795   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
796   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
797   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
798
799   PORT_START("IN0-1")
800   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
801   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
802   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE )   PORT_NAME("Collect")
803   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH )   PORT_NAME("Big")
804   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_LOW )      PORT_NAME("Small")
805   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
806   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
807   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
808
809   PORT_START("IN0-2")
810   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 )
811   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 )
812   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 )
813   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 )
814   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )
815   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
816   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
817   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
818
819   PORT_START("IN0-3")
820   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE )   PORT_NAME("Setting") PORT_CODE(KEYCODE_9)
821   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
822   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
823   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )      PORT_IMPULSE(3) PORT_NAME("Coin In")
824   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN)
825   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
826   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
827   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
828
829   PORT_START("SW1")
830   PORT_DIPNAME( 0x01, 0x01, "SW1-01 (C400)" )
831   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
832   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
833   PORT_DIPNAME( 0x02, 0x02, "SW1-02 (C400)" )
834   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
835   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
836   PORT_DIPNAME( 0x04, 0x04, "SW1-04 (C400)" )
837   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
838   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
839   PORT_DIPNAME( 0x08, 0x08, "SW1-08 (C400)" )
840   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
841   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
842   PORT_DIPNAME( 0x10, 0x10, "SW1-10 (C400)" )
843   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
844   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
845   PORT_DIPNAME( 0x20, 0x20, "SW1-20 (C400)" )
846   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
847   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
848   PORT_DIPNAME( 0x40, 0x40, "SW1-40 (C400)" )
849   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
850   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
851   PORT_DIPNAME( 0x80, 0x80, "SW1-80 (C400)" )
852   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
853   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
854
855/*  SW2 is ok... The remaining bits are checked in unused routines,
856    or just NOP'ed...
857*/
858   PORT_START("SW2")
859   PORT_DIPNAME( 0x01, 0x01, "SW2-01 (CC00)" )
860   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
861   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
862   PORT_DIPNAME( 0x02, 0x02, "SW2-02 (CC00)" )
863   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
864   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
865   PORT_DIPNAME( 0x04, 0x04, "SW2-04 (CC00)" )
866   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
867   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
868   PORT_DIPNAME( 0x08, 0x08, "SW2-08 (CC00)" )
869   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
870   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
871   PORT_DIPNAME( 0x10, 0x00, "SW2-10 (CC00) System Boot" )   /* Should be turned ON to boot */
872   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
873   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
874   PORT_DIPNAME( 0x20, 0x00, "Key In (value)" )
875   PORT_DIPSETTING(    0x20, "1 Pulse / 20 Credits" )
876   PORT_DIPSETTING(    0x00, "1 Pulse / 100 Credits" )
877   PORT_DIPNAME( 0x40, 0x40, "SW2-40 (CC00)" )
878   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
879   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
880   PORT_DIPNAME( 0x80, 0x80, "SW2-80 (CC00)" )
881   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
882   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
883
884   PORT_START("SW3")
885   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW3:1")
886   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
887   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
888   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW3:2")
889   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
890   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
891   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW3:3")
892   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
893   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
894   PORT_DIPNAME( 0x18, 0x10, "Min/Max Bet" )      PORT_DIPLOCATION("SW3:4,5")   /* Always 1-40 on screen */
895   PORT_DIPSETTING(    0x00, "Min:10; Max:80" )
896   PORT_DIPSETTING(    0x08, "Min:10; Max:50" )
897   PORT_DIPSETTING(    0x10, "Min:05; Max:40" )
898   PORT_DIPSETTING(    0x18, "Min:05; Max:10" )
899   PORT_DIPNAME( 0x60, 0x40, "Key In (screen)" )   PORT_DIPLOCATION("SW3:6,7")   /* Only on screen */
900   PORT_DIPSETTING(    0x60, "20" )
901   PORT_DIPSETTING(    0x40, "100" )
902   PORT_DIPSETTING(    0x20, "120" )
903   PORT_DIPSETTING(    0x00, "130" )
904   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW3:8")
905   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
906   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
907
908   PORT_START("SW4")
909   /* only bits 4-6-7 are connected here and were routed to SW4 1-4 */
910   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
911   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
912   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
913   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
914   PORT_DIPNAME( 0x10, 0x00, "Jacks or Better" )   PORT_DIPLOCATION("SW4:1")
915   PORT_DIPSETTING(    0x10, DEF_STR( No ) )
916   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
917   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )   PORT_DIPLOCATION("SW4:2")
918   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
919   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
920   PORT_DIPNAME( 0x40, 0x00, "Payout Mode" )      PORT_DIPLOCATION("SW4:3")
921   PORT_DIPSETTING(    0x40, "Manual" )
922   PORT_DIPSETTING(    0x00, "Auto" )
923   PORT_DIPNAME( 0x80, 0x80, "Coin In" )         PORT_DIPLOCATION("SW4:4")
924   PORT_DIPSETTING(    0x80, "x10" )
925   PORT_DIPSETTING(    0x00, "x5" )
926INPUT_PORTS_END
927
928
929/*************************
930*    Graphics Layouts    *
931*************************/
932
933static const gfx_layout tilelayout =
934{
935   8, 8,
936   RGN_FRAC(1,3),
937   3,
938   { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) },    /* bitplanes are separated */
939   { 0, 1, 2, 3, 4, 5, 6, 7 },
940   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
941   8*8
942};
943
944
945/******************************
946* Graphics Decode Information *
947******************************/
948
949static GFXDECODE_START( fclown )
950   GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 16 )
951   GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 16 )
952GFXDECODE_END
953
954
955/***********************
956*    CRTC Interface    *
957***********************/
958
959static const mc6845_interface mc6845_intf =
960{
961   "screen",   /* screen we are acting on */
962   8,         /* number of pixels per video memory address */
963   NULL,      /* before pixel update callback */
964   NULL,      /* row update callback */
965   NULL,      /* after pixel update callback */
966   DEVCB_NULL,   /* callback for display state changes */
967   DEVCB_NULL,   /* callback for cursor state changes */
968   DEVCB_NULL,   /* HSYNC callback */
969   DEVCB_NULL,   /* VSYNC callback */
970   NULL      /* update address callback */
971};
972
973
974/***********************
975*    PIA Interfaces    *
976***********************/
977
978static const pia6821_interface fclown_pia0_intf =
979{
980   DEVCB_HANDLER(mux_port_r),   /* Port A IN        Multiplexed Ports read */
981   DEVCB_HANDLER(pia0_b_r),   /* Port B IN        unknown (used) */
982   DEVCB_NULL,               /* Line CA1 IN */
983   DEVCB_NULL,               /* Line CB1 IN */
984   DEVCB_NULL,               /* Line CA2 IN */
985   DEVCB_NULL,               /* Line CA2 IN */
986   DEVCB_NULL,               /* Port A OUT       NULL */
987   DEVCB_HANDLER(counters_w),   /* Port B OUT       Counters */
988   DEVCB_NULL,               /* Line CA2 OUT */
989   DEVCB_NULL,               /* Line CB2 OUT */
990   DEVCB_NULL,               /* IRQA */
991   DEVCB_NULL               /* IRQB */
992};
993
994static const pia6821_interface fclown_pia1_intf =
995{
996   DEVCB_INPUT_PORT("SW4"),   /* Port A IN        4th DIP Switchs bank */
997   DEVCB_HANDLER(pia1_b_r),   /* Port B IN        Check bit 2 to allow key out system to work */
998   DEVCB_NULL,               /* Line CA1 IN */
999   DEVCB_NULL,               /* Line CB1 IN */
1000   DEVCB_NULL,               /* Line CA2 IN */
1001   DEVCB_NULL,               /* Line CB2 IN */
1002   DEVCB_HANDLER(trigsnd_w),   /* Port A OUT       Trigger the audio CPU interrupts */
1003   DEVCB_HANDLER(mux_w),      /* Port B OUT       Multiplexed Ports selector */
1004   DEVCB_NULL,               /* Line CA2 OUT */
1005   DEVCB_NULL,               /* Line CB2 OUT */
1006   DEVCB_NULL,               /* IRQA */
1007   DEVCB_NULL               /* IRQB */
1008};
1009
1010
1011/*************************
1012*    Sound Interfaces    *
1013*************************/
1014
1015static const ay8910_interface ay8910_config =
1016{
1017   AY8910_LEGACY_OUTPUT,
1018   AY8910_DEFAULT_LOADS,
1019   DEVCB_NULL,
1020   DEVCB_NULL,
1021   DEVCB_NULL,
1022   DEVCB_NULL
1023};
1024
1025
1026/*************************
1027*    Machine Drivers     *
1028*************************/
1029
1030static MACHINE_DRIVER_START( fclown )
1031
1032   /* basic machine hardware */
1033   MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8)   /* guess, seems ok */
1034   MDRV_CPU_PROGRAM_MAP(fclown_map)
1035   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
1036
1037   MDRV_CPU_ADD("audiocpu", M6502, MASTER_CLOCK/8)   /* guess, seems ok */
1038   MDRV_CPU_PROGRAM_MAP(fcaudio_map)
1039
1040   MDRV_NVRAM_HANDLER(generic_0fill)
1041
1042   MDRV_PIA6821_ADD("pia0", fclown_pia0_intf)
1043   MDRV_PIA6821_ADD("pia1", fclown_pia1_intf)
1044
1045   /* video hardware */
1046   MDRV_SCREEN_ADD("screen", RASTER)
1047   MDRV_SCREEN_REFRESH_RATE(60)
1048   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1049   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1050   MDRV_SCREEN_SIZE((39+1)*8, (31+1)*8)
1051   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
1052
1053   MDRV_GFXDECODE(fclown)
1054   MDRV_PALETTE_LENGTH(256)
1055   MDRV_PALETTE_INIT(fclown)
1056
1057   MDRV_VIDEO_START(fclown)
1058   MDRV_VIDEO_UPDATE(fclown)
1059
1060   MDRV_MC6845_ADD("crtc", MC6845, MASTER_CLOCK/16, mc6845_intf) /* guess */
1061
1062   /* sound hardware */
1063   MDRV_SPEAKER_STANDARD_MONO("mono")
1064
1065   MDRV_SOUND_ADD("ay8910", AY8910, MASTER_CLOCK/8)      /* guess, seems ok */
1066   MDRV_SOUND_CONFIG(ay8910_config)
1067   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
1068
1069   MDRV_SOUND_ADD("oki6295", OKIM6295, MASTER_CLOCK/12)   /* guess, seems ok */
1070   MDRV_SOUND_CONFIG(okim6295_interface_pin7low)         /* pin7 guessed, seems ok */
1071   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.20)
1072
1073MACHINE_DRIVER_END
1074
1075
1076/*************************
1077*        Rom Load        *
1078*************************/
1079
1080ROM_START( 5clown )
1081   ROM_REGION( 0x10000, "maincpu", 0 )
1082   ROM_LOAD( "4.u2",      0x2000, 0x8000, CRC(96e3e8ab) SHA1(fec20b9a8bde5306162f8288cdc9580f445cadf5) )
1083   ROM_COPY( "maincpu",   0x2000, 0x8000, 0x8000 )
1084
1085
1086   ROM_REGION( 0x8000,  "gfxbanks", 0 )
1087   ROM_LOAD( "7.u34",   0x0000, 0x8000, CRC(64c9f4ee) SHA1(6e695feee826e319f84d91f6bbf7cfacd443fc8f) )
1088
1089   ROM_REGION( 0x10000, "audiocpu", 0 )
1090   ROM_LOAD( "9.u35",   0xe000, 0x2000, CRC(7e3c3af5) SHA1(ebc09da981dbdf4eac90bcf982e5bc8ede47e81a) )
1091
1092   ROM_REGION( 0x40000, "oki6295", 0 )
1093   ROM_LOAD( "8.u50",   0x0000, 0x10000, CRC(e1e37180) SHA1(e162abcb01952e26deee74ece5719239961e1b69) )
1094
1095
1096   ROM_REGION( 0x3000, "gfx1", 0 )
1097   ROM_FILL(            0x0000, 0x2000, 0 ) /* filling the remaining bitplanes */
1098   ROM_COPY( "gfxbanks",   0x7000, 0x2000, 0x1000 )
1099
1100   ROM_REGION( 0x3000, "gfx2", 0 )
1101   ROM_COPY( "gfxbanks",   0x6000, 0x0000, 0x1000 )
1102   ROM_COPY( "gfxbanks",   0x5000, 0x1000, 0x1000 )
1103   ROM_COPY( "gfxbanks",   0x4000, 0x2000, 0x1000 )
1104
1105   ROM_REGION( 0x0100, "proms", 0 )
1106   ROM_LOAD( "dm74s287an.u32",   0x0000, 0x0100, CRC(2d207266) SHA1(374b4830a0a8ed3001cf0df16daa8dffee503cbe) )
1107
1108ROM_END
1109
1110
1111ROM_START( 5clowna )
1112   ROM_REGION( 0x10000, "maincpu", 0 )
1113   ROM_LOAD( "6.u2",   0x2000, 0x2000, BAD_DUMP CRC(15ecca37) SHA1(d8d0a43f559168cccc3a46418557ccfc30c8108e) )
1114   ROM_LOAD( "5.u2",   0x4000, 0x2000, BAD_DUMP CRC(2e962007) SHA1(86599ba5030068c08ff5a19ada7250c410b2ba35) )
1115   ROM_LOAD( "7.u2",   0xe000, 0x2000, BAD_DUMP CRC(308c4771) SHA1(f6ee402c120ff16601347cc994a45a7092511050) )
1116
1117
1118   ROM_REGION( 0x8000,  "gfxbanks", 0 )
1119   ROM_LOAD( "7.u34",   0x0000, 0x8000, CRC(64c9f4ee) SHA1(6e695feee826e319f84d91f6bbf7cfacd443fc8f) )
1120
1121   ROM_REGION( 0x10000, "audiocpu", 0 )
1122   ROM_LOAD( "9.u35",   0xe000, 0x2000, CRC(7e3c3af5) SHA1(ebc09da981dbdf4eac90bcf982e5bc8ede47e81a) )
1123
1124   ROM_REGION( 0x40000, "oki6295", 0 )
1125   ROM_LOAD( "8.u50",   0x0000, 0x10000, CRC(e1e37180) SHA1(e162abcb01952e26deee74ece5719239961e1b69) )
1126
1127
1128   ROM_REGION( 0x3000, "gfx1", 0 )
1129   ROM_FILL(            0x0000, 0x2000, 0 ) /* filling the remaining bitplanes */
1130   ROM_COPY( "gfxbanks",   0x7000, 0x2000, 0x1000 )
1131
1132   ROM_REGION( 0x3000, "gfx2", 0 )
1133   ROM_COPY( "gfxbanks",   0x6000, 0x0000, 0x1000 )
1134   ROM_COPY( "gfxbanks",   0x5000, 0x1000, 0x1000 )
1135   ROM_COPY( "gfxbanks",   0x4000, 0x2000, 0x1000 )
1136
1137   ROM_REGION( 0x0100, "proms", 0 )
1138   ROM_LOAD( "dm74s287an.u32",   0x0000, 0x0100, CRC(2d207266) SHA1(374b4830a0a8ed3001cf0df16daa8dffee503cbe) )
1139
1140ROM_END
1141
1142
1143ROM_START( 5clownsp )
1144   ROM_REGION( 0x10000, "maincpu", 0 )
1145   ROM_LOAD( "five_clown_sp.u2",   0x2000, 0x8000, CRC(fa18090d) SHA1(47feb5dbc77ae8621fc35b707c24d64a95227a39) )
1146   ROM_COPY( "maincpu",         0x2000, 0x8000, 0x8000 )
1147
1148
1149   ROM_REGION( 0x8000,  "gfxbanks", 0 )
1150   ROM_LOAD( "7.u34",   0x0000, 0x8000, CRC(64c9f4ee) SHA1(6e695feee826e319f84d91f6bbf7cfacd443fc8f) )
1151
1152   ROM_REGION( 0x10000, "audiocpu", 0 )
1153   ROM_LOAD( "9.u35",   0xe000, 0x2000, CRC(7e3c3af5) SHA1(ebc09da981dbdf4eac90bcf982e5bc8ede47e81a) )
1154
1155   ROM_REGION( 0x40000, "oki6295", 0 )
1156   ROM_LOAD( "8.u50",   0x0000, 0x10000, CRC(e1e37180) SHA1(e162abcb01952e26deee74ece5719239961e1b69) )
1157
1158
1159   ROM_REGION( 0x3000, "gfx1", 0 )
1160   ROM_FILL(            0x0000, 0x2000, 0 ) /* filling the remaining bitplanes */
1161   ROM_COPY( "gfxbanks",   0x7000, 0x2000, 0x1000 )
1162
1163   ROM_REGION( 0x3000, "gfx2", 0 )
1164   ROM_COPY( "gfxbanks",   0x6000, 0x0000, 0x1000 )
1165   ROM_COPY( "gfxbanks",   0x5000, 0x1000, 0x1000 )
1166   ROM_COPY( "gfxbanks",   0x4000, 0x2000, 0x1000 )
1167
1168   ROM_REGION( 0x0100, "proms", 0 )
1169   ROM_LOAD( "dm74s287an.u32",   0x0000, 0x0100, CRC(2d207266) SHA1(374b4830a0a8ed3001cf0df16daa8dffee503cbe) )
1170
1171ROM_END
1172
1173
1174/*************************
1175*      Driver Init       *
1176*************************/
1177
1178static DRIVER_INIT( fclown )
1179{
1180    /* Decrypting main program */
1181
1182   int x;
1183   UINT8 *src = memory_region( machine, "maincpu" );
1184
1185   for (x = 0x0000; x < 0x10000; x++)
1186   {
1187      src[x] = src[x] ^ 0x20;      /* Decrypting byte */
1188   }
1189
1190
1191    /* Decrypting GFX by segments */
1192
1193   UINT8 *gfx1_src = memory_region( machine, "gfx1" );
1194   UINT8 *gfx2_src = memory_region( machine, "gfx2" );
1195
1196   for (x = 0x2000; x < 0x3000; x++)
1197   {
1198      gfx1_src[x] = gfx1_src[x] ^ 0x22;   /* Decrypting bulk GFX segment 7000-7fff */
1199   }
1200
1201   for (x = 0x0000; x < 0x1000; x++)
1202   {
1203      gfx2_src[x] = gfx2_src[x] ^ 0x3f;   /* Decrypting bulk GFX segment 6000-6fff */
1204   }
1205
1206   for (x = 0x2000; x < 0x3000; x++)
1207   {
1208      gfx2_src[x] = gfx2_src[x] ^ 0x22;   /* Decrypting bulk GFX segment 4000-4fff */
1209   }
1210
1211
1212    /* Decrypting sound samples */
1213
1214   UINT8 *samples_src = memory_region( machine, "oki6295" );
1215
1216   for (x = 0x0000; x < 0x10000; x++)
1217   {
1218      if (samples_src[x] & 0x02)                  /* If bit 1 is active... */
1219      {
1220         samples_src[x] = samples_src[x] ^ 0x02;      /* Then bit 1 XOR'ed */
1221      }
1222
1223      else
1224      {
1225         samples_src[x] = samples_src[x] ^ 0x12;      /* Otherwise bit 1 & 5 XOR'ed */
1226      }
1227   }
1228
1229
1230   /* Assigning AY-3-8910 sound device */
1231
1232   ay8910 = devtag_get_device(machine, "ay8910");
1233}
1234
1235
1236/*************************
1237*      Game Drivers      *
1238*************************/
1239
1240/*    YEAR  NAME      PARENT  MACHINE INPUT   INIT    ROT    COMPANY  FULLNAME                      FLAGS... */
1241GAME( 1993, 5clown,   0,      fclown, fclown, fclown, ROT0, "IGS",   "Five Clown (english, set 1)", GAME_IMPERFECT_SOUND )
1242GAME( 1993, 5clowna,  5clown, fclown, fclown, fclown, ROT0, "IGS",   "Five Clown (english, set 2)", GAME_IMPERFECT_SOUND )
1243GAME( 1993, 5clownsp, 5clown, fclown, fclown, fclown, ROT0, "IGS",   "Five Clown (spanish hack)",   GAME_IMPERFECT_SOUND )
src/mame/drivers/galpani3.c
r7553r7554
527527
528528static READ16_HANDLER( galpani3_mcu_status_r )
529529{
530   logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu));
530   logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag(), cpu_get_previouspc(space->cpu));
531531   return 0;
532532}
533533
r7553r7554
549549      }
550550
551551      default:
552         logerror("cpu '%s' (PC=%06X): galpani3_regs1_r %02x %04x\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu), offset, mem_mask);
552         logerror("cpu '%s' (PC=%06X): galpani3_regs1_r %02x %04x\n", space->cpu->tag(), cpu_get_previouspc(space->cpu), offset, mem_mask);
553553         break;
554554
555555   }
r7553r7554
574574      }
575575
576576      default:
577         logerror("cpu '%s' (PC=%06X): galpani3_regs2_r %02x %04x\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu), offset, mem_mask);
577         logerror("cpu '%s' (PC=%06X): galpani3_regs2_r %02x %04x\n", space->cpu->tag(), cpu_get_previouspc(space->cpu), offset, mem_mask);
578578         break;
579579
580580   }
r7553r7554
599599      }
600600
601601      default:
602         logerror("cpu '%s' (PC=%06X): galpani3_regs3_r %02x %04x\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu), offset, mem_mask);
602         logerror("cpu '%s' (PC=%06X): galpani3_regs3_r %02x %04x\n", space->cpu->tag(), cpu_get_previouspc(space->cpu), offset, mem_mask);
603603         break;
604604
605605   }
src/mame/drivers/terracre.c
r7553r7554
983983   ROM_LOAD( "kid_prom.2g",  0x300, 0x100, CRC(4b9be0ed) SHA1(81aa7bb24fe6ea13f5dffdb67ea699adf0b3129a) ) /* clut */
984984
985985   ROM_REGION( 0x0100, "user1", 0 )
986   ROM_LOAD( "kid_prom.4e",  0x000, 0x100, NO_DUMP CRC(e4fb54ee) SHA1(aba89d347b24dc6680e6f25b4a6c0d6657bb6a83) ) /* ctable */
986   ROM_LOAD( "kid_prom.4e",  0x000, 0x100, BAD_DUMP CRC(e4fb54ee) SHA1(aba89d347b24dc6680e6f25b4a6c0d6657bb6a83) ) /* ctable */
987987ROM_END
988988
989989static DRIVER_INIT( amazon )
src/mame/drivers/cclimber.c
r7553r7554
14231423   ROM_LOAD( "ck3.bin",      0x3000, 0x1000, CRC(61122c5e) SHA1(978b6dbec35f3adc651fddf332db17625099a92e) )
14241424
14251425   ROM_REGION( 0x1000, "gfx2", 0 )
1426   ROM_LOAD( "ck2.bin",      0x0000, 0x0800, CRC(f67c80f1) SHA1(d1fbcce1b6242f810e106ff50812636e3168ebc1) )
1427   ROM_LOAD( "ck1.bin",      0x0800, 0x0800, CRC(80eb517d) SHA1(fef4111f656c58b28e7eac5aa5b5cc7e07ccb2fd) )
1426   ROM_LOAD( "alc_ck2.bin",  0x0000, 0x0800, CRC(f67c80f1) SHA1(d1fbcce1b6242f810e106ff50812636e3168ebc1) )
1427   ROM_LOAD( "alc_ck1.bin",  0x0800, 0x0800, CRC(80eb517d) SHA1(fef4111f656c58b28e7eac5aa5b5cc7e07ccb2fd) )
14281428
14291429   ROM_REGION( 0x0060, "proms", 0 )
14301430   ROM_LOAD( "ck6v.bin",     0x0000, 0x0020, CRC(751c3325) SHA1(edce2bc883996c1d72dc6c1c9f62799b162d415a) )
r7553r7554
14811481   ROM_LOAD( "ck3.bin",      0x3000, 0x1000, CRC(61122c5e) SHA1(978b6dbec35f3adc651fddf332db17625099a92e) )
14821482
14831483   ROM_REGION( 0x1000, "gfx2", 0 )
1484   ROM_LOAD( "ck2.bin",      0x0000, 0x0800, CRC(f67c80f1) SHA1(d1fbcce1b6242f810e106ff50812636e3168ebc1) )
1485   ROM_LOAD( "ck1.bin",      0x0800, 0x0800, CRC(80eb517d) SHA1(fef4111f656c58b28e7eac5aa5b5cc7e07ccb2fd) )
1484   ROM_LOAD( "md_ck2.bin",   0x0000, 0x0800, CRC(f67c80f1) SHA1(d1fbcce1b6242f810e106ff50812636e3168ebc1) )
1485   ROM_LOAD( "md_ck1.bin",   0x0800, 0x0800, CRC(80eb517d) SHA1(fef4111f656c58b28e7eac5aa5b5cc7e07ccb2fd) )
14861486
14871487   ROM_REGION( 0x0060, "proms", 0 )
14881488   ROM_LOAD( "ck6v.bin",     0x0000, 0x0020, BAD_DUMP CRC(751c3325) SHA1(edce2bc883996c1d72dc6c1c9f62799b162d415a)  )
src/mame/drivers/chinagat.c
r7553r7554
740740   ROM_LOAD( "23ja-0.100",  0x60000, 0x20000, CRC(f678594f) SHA1(4bdcf9407543925f4630a8c7f1f48b85f76343a9) )   /* 0,1 */
741741
742742   ROM_REGION(0x40000, "gfx3", 0 )   /* Background */
743   ROM_LOAD( "a-13", 0x00000, 0x10000, NO_DUMP )      /* Where are    */
744   ROM_LOAD( "a-12", 0x10000, 0x10000, NO_DUMP )      /* these on the */
745   ROM_LOAD( "a-15", 0x20000, 0x10000, NO_DUMP )      /* real board ? */
746   ROM_LOAD( "a-14", 0x30000, 0x10000, NO_DUMP )
743   ROM_LOAD( "chinagat_a-13", 0x00000, 0x10000, NO_DUMP )      /* Where are    */
744   ROM_LOAD( "chinagat_a-12", 0x10000, 0x10000, NO_DUMP )      /* these on the */
745   ROM_LOAD( "chinagat_a-15", 0x20000, 0x10000, NO_DUMP )      /* real board ? */
746   ROM_LOAD( "chinagat_a-14", 0x30000, 0x10000, NO_DUMP )
747747
748748   ROM_REGION(0x40000, "oki", 0 )   /* ADPCM */
749749   ROM_LOAD( "23j1-0.53", 0x00000, 0x20000, CRC(f91f1001) SHA1(378402a3c966cabd61e9662ae5decd66672a228b) )
src/mame/drivers/cybertnk.c
r7553r7554
187187static UINT16 *tx_vram,*bg_vram,*fg_vram,*spr_ram;
188188static UINT16 *io_ram;
189189
190#define LOG_UNKNOWN_WRITE logerror("unknown io write CPU '%s':%08x  0x%08x 0x%04x & 0x%04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset*2, data, mem_mask);
190#define LOG_UNKNOWN_WRITE logerror("unknown io write CPU '%s':%08x  0x%08x 0x%04x & 0x%04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset*2, data, mem_mask);
191191
192192static TILE_GET_INFO( get_tx_tile_info )
193193{
src/mame/drivers/btime.c
r7553r7554
250250   else if (offset == 0x9000)                     { return; }  /* AM_NOP */
251251   else if (offset == 0x9002)                     { audio_command_w(space, 0, data); return; }
252252   else if (offset >= 0xb000 && offset <= 0xb1ff)   ;
253   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
253   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
254254
255255   state->rambase[offset] = data;
256256
r7553r7554
270270   else if (offset == 0x9000)                     { return; }  /* AM_NOP */
271271   else if (offset == 0x9002)                     { audio_command_w(space, 0, data); return; }
272272   else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(space, offset - 0xb000, data); return; }
273   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
273   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
274274
275275   state->rambase[offset] = data;
276276
r7553r7554
290290   else if (offset == 0x4002)                     btime_video_control_w(space, 0, data);
291291   else if (offset == 0x4003)                     audio_command_w(space, 0, data);
292292   else if (offset == 0x4004)                     bnj_scroll1_w(space, 0, data);
293   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
293   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
294294
295295   state->rambase[offset] = data;
296296
r7553r7554
311311   else if (offset == 0x4004)                     bnj_scroll1_w(space, 0, data);
312312   else if (offset == 0x4005)              bnj_scroll2_w(space, 0, data);
313313//  else if (offset == 0x8000)                     btime_video_control_w(space,0,data);
314   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
314   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
315315
316316   state->rambase[offset] = data;
317317
r7553r7554
331331   else if (offset == 0x9804)                     bnj_scroll2_w(space, 0, data);
332332   else if (offset == 0x9805)                     bnj_scroll1_w(space, 0, data);
333333   else if (offset == 0x9806)                     audio_command_w(space, 0, data);
334   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
334   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
335335
336336   state->rambase[offset] = data;
337337
r7553r7554
347347   else if (offset >= 0x8000 && offset <= 0x881f) ;
348348   else if (offset == 0x9a00)                     audio_command_w(space, 0, data);
349349   else if (offset == 0x9c00)                     disco_video_control_w(space, 0, data);
350   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, offset);
350   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, offset);
351351
352352   state->rambase[offset] = data;
353353
src/mame/drivers/chsuper.c
r7553r7554
240240
241241ROM_START( chsuper2 )
242242   ROM_REGION( 0x80000, "maincpu", 0 )
243   ROM_LOAD( "c.bin",  0x0000, 0x80000, CRC(cbf59e69) SHA1(68e4b167fdf9103fd748cff401f4fe7c1d214552) )
243   ROM_LOAD( "chsuper2-c.bin",  0x0000, 0x80000, CRC(cbf59e69) SHA1(68e4b167fdf9103fd748cff401f4fe7c1d214552) )
244244
245245   ROM_REGION( 0x100000, "gfx1", 0 )
246   ROM_LOAD( "a.bin",  0x00000, 0x80000, CRC(7caa8ebe) SHA1(440306a208ec8afd570b15f05b5dc542acc98510) )
247   ROM_LOAD( "b.bin",  0x80000, 0x80000, CRC(7bb463d7) SHA1(fb3842ba53e545fa47574c91df7281a9cb417395) )
246   ROM_LOAD( "chsuper2-a.bin",  0x00000, 0x80000, CRC(7caa8ebe) SHA1(440306a208ec8afd570b15f05b5dc542acc98510) )
247   ROM_LOAD( "chsuper2-b.bin",  0x80000, 0x80000, CRC(7bb463d7) SHA1(fb3842ba53e545fa47574c91df7281a9cb417395) )
248248
249249   ROM_REGION( 0x10000, "vram", ROMREGION_ERASE00 )
250250
src/mame/drivers/munchmo.c
r7553r7554
5454      cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
5555}
5656
57static INTERRUPT_GEN( mnchmobl_sound_irq )
58{
59   munchmo_state *state = (munchmo_state *)device->machine->driver_data;
60
61   if (!(state->sound_nmi_enable))
62      cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
63}
64
5765static WRITE8_HANDLER( mnchmobl_soundlatch_w )
5866{
5967   munchmo_state *state = (munchmo_state *)space->machine->driver_data;
r7553r7554
6270   cpu_set_input_line(state->audiocpu, 0, HOLD_LINE );
6371}
6472
73static WRITE8_HANDLER( sound_nmi_enable_w )
74{
75   munchmo_state *state = (munchmo_state *)space->machine->driver_data;
76   state->sound_nmi_enable = data & 1;
77}
78
79
6580static WRITE8_HANDLER( sound_nmi_ack_w )
6681{
6782   munchmo_state *state = (munchmo_state *)space->machine->driver_data;
r7553r7554
107122   AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_data_w)
108123   AM_RANGE(0x7000, 0x7000) AM_DEVWRITE("ay2", ay8910_address_w)
109124   AM_RANGE(0x8000, 0x8000) AM_WRITENOP /* ? */
110   AM_RANGE(0xa000, 0xa000) AM_WRITENOP /* ? */
125   AM_RANGE(0xa000, 0xa000) AM_WRITE(sound_nmi_enable_w)
111126   AM_RANGE(0xc000, 0xc000) AM_WRITE(sound_nmi_ack_w)
112127   AM_RANGE(0xe000, 0xe7ff) AM_RAM
113128ADDRESS_MAP_END
r7553r7554
325340
326341   MDRV_CPU_ADD("audiocpu", Z80, XTAL_15MHz/4) /* ? */
327342   MDRV_CPU_PROGRAM_MAP(sound_map)
328   MDRV_CPU_VBLANK_INT("screen", nmi_line_assert)
343   MDRV_CPU_VBLANK_INT("screen", mnchmobl_sound_irq)
329344
330345   MDRV_MACHINE_START(munchmo)
331346   MDRV_MACHINE_RESET(munchmo)
src/mame/drivers/namcos23.c
r7553r7554
11/*
2    Namco System 22.5 and (Super) System 23
2    Namco System 22.5 and (Super) System 23 (Evolution 2)
33    Extremely preliminary driver by R. Belmont, thanks to Phil Stroffolino & Olivier Galibert
44
55    Hardware: * R4650 (MIPS III with IDT special instructions) main CPU.
66                133 MHz for Gorgon, 166 MHz for System 23 and Super System 23, and
7        200 MHz for Super System 23 Evolution 2.
7                200 MHz for Super System 23 Evolution 2.
88              * H8/3002 MCU for sound/inputs
99              * Custom polygon hardware
1010              * 1 text tilemap
r7553r7554
2727      Works like this: write to d00004, then read d00004 12 times.  Ditto at
2828      d00006.  This gives 24 bits of inputs (?) from the I/O board (?) or guns (?)
2929
30    - The entire 3D subsystem.  Is there a DSP living down there?  If not, why the 300k
31      download on initial startup?
30    - The entire 3D subsystem.  Is there a DSP living down there?
3231
3332    - There are currently no differences seen between System 23 (Time Crisis 2) and
3433      Super System 23 (GP500, Final Furlong 2).  These will presumably appear when
r7553r7554
4645      - read 2 bytes from one rom at a200000a
4746      - read 2 bytes from one rom at a200000c
4847
48    - Add the sh2 in Gunmen Wars (no rom, controls the camera)
49
4950    - Super System 23 tests irqs in the post.  timecrs2c's code can
5051    potentially test 7 sources, but only actually test 5.  With each
5152    source there is code to clear the interrupt and code to raise it.
r7553r7554
9596
9697/*
9798
98Namco System 23 and Super System 23 Hardware Overview (last updated 27th February, 2006 at 5.26pm)
99Namco System 23 and Super System 23 Hardware Overview (last updated 7th March, 2010 at 12.53am)
99100Namco, 1997 - 2000
100101
101102Note! This document is a Work-In-Progress and will be updated from time to time when more dumps are available.
102103
103This document covers all the known Namco System 23 / Super System 23 games, including....
104*Angler King      Namco, 1999    System 23
104This document covers all the known Namco Gorgon / System 23 / Super System 23 games, including....
105105Final Furlong     Namco, 1997    System 22.5/Gorgon
106Gunmen Wars       Namco, 1998    System 23 [not dumped, but have]
106Rapid River       Namco, 1997    System 22.5/Gorgon
107107Motocross Go!     Namco, 1997    System 23
108Time Crisis II    Namco, 1997    System 23 and Super System 23
109Downhill Bikers   Namco, 1997    System 23
108110Panic Park        Namco, 1998    System 23
109Rapid River       Namco, 1997    System 22.5/Gorgon
110Time Crisis II    Namco, 1997    System 23
111*Underground King Namco, 1998    System 23
112Downhill Bikers   Namco, 199?    System 23 [not dumped, but have]
111*Angler King      Namco, 1999    System 23
112Gunmen Wars       Namco, 1998    Super System 23
113*Race On!         Namco, 1998    Super System 23
113114500 GP            Namco, 1999    Super System 23
114Crisis Zone       Namco, 2000    Super System 23 Evolution 2 [not dumped, but have]
115115Final Furlong 2   Namco, 1999    Super System 23
116116*Guitar Jam       Namco, 1999    Super System 23
117*Race On!         Namco, 1998    Super System 23
117Crisis Zone       Namco, 2000    System 23 Evolution 2
118118
119* - denotes not dumped yet (and hardware type not confirmed). If you can help with the remaining undumped S22.5/S23/SS23 games,
120    please contact me at http://www.mameworld.net/gurudumps/
119* - denotes not dumped yet (and hardware type not confirmed, they might not be System 23 hardware).
120If you can help with the remaining undumped S22.5/S23/SS23 games, please contact me at http://guru.mameworld.info/
121121
122122The system comprises the following main boards....
123123- EMI PCB                          Small PCB with some connectors, including power in, video out, network in/out, sound out (to AMP PCB)
124124- BASS AMP PCB                     Power AMP PCB for general sounds and bass
125- SYSTEM23 MAIN PCB                Main PCB for System 23        \
126  or SystemSuper23 MAIN(1) PCB     Main PCB for Super System 23  / Note the 2 main boards are similar, but not exactly the same.
127- MSPM(FRA) PCB                    A small plug-in daughterboard that holds FLASHROMs containing Main CPU and Sub CPU programs
128- FCA PCB                          Controls & I/O interface board. Contains mostly transistors, caps, resistors, several connectors and an MCU.
129                                   The MCU is different for EACH game and the FCA PCBs are not interchangeable between different games.
125- SYSTEM23 MAIN PCB                Main PCB for System 23               \
126  or SystemSuper23 MAIN(1) PCB     Main PCB for Super System 23         /
127  or System23Evolution2 PCB        Main PCB for System 23 Evolution 2  /  Note the 3 main boards are similar, but not exactly the same.
128- MSPM(FR*) PCB                    A small plug-in daughterboard that holds FLASHROMs containing Main CPU and Sound CPU programs
129- FCA PCB                          Controls & I/O interface board used with a few Super System 23 games only. Contains mostly transistors,
130                                   caps, resistors, several connectors, an MCU and a PIC16F84.
131                                   The PIC is different for EACH game and the FCA PCBs are not interchangeable between different games.
130132                                   If the FCA PCB is not connected, the game will not advance past the 3rd screen shown below.
133- ASCA-3A PCB / ASCA-4A PCB        This is the standard I/O board used with most of the S23/SS23 games with support for digital and
134                                   analog controls (buttons/joysticks/pots etc).
135- V185 I/O PCB                     Gun I/O board used with Time Crisis II
136- V221 MIU PCB                     Gun I/O board used with Crisis Zone (System 23 Evolution 2) and Time Crisis 3 (on System 246)
131137- SYSTEM23 MEM(M) PCB              Holds MASKROMs for GFX/Sound and associated logic
132138                                   Note that in Super System23, the MEM(M) PCB is re-used from System23.
133                                   On Super System23, there is a sticker over the System23 part labelled 'SystemSuper23'
139                                   On Super System23, there is a sticker over the System23 part labelled 'SystemSuper23' and one
140                                   PAL is not populated.
141- GMEN PCB                         A large board that sits on top of the main board and the ROM board sits on top of it, containing
142                                   a SH2 CPU, some RAM and a few CPLDs/FPGAs. This controls the camera in Gunmen Wars.
134143
135144The metal box housing these PCB's is approximately the same size as Super System 22. However, the box is mostly
136145empty. All of the CPU/Video/DSP hardware is located on the main PCB which is the same size as the
r7553r7554
138147can be configured for either 32MBit or 64MBit SOP44 MASK ROMs with a maximum capacity of 1664MBits.
139148The system also uses a dual pipeline graphics bus similar to Super System 22 and has two copies of the graphics ROMs
140149on the PCB.
141The System 23 hardware is the first NAMCO system to require an external 3.3V power source. Previously the 3.3volts
142was derived from a 5v to 3.3v regulator on systems such as System10/11/12 etc.
150The System 23 hardware is the first NAMCO system to require an external 3.3V power source. Previously the 3.3V
151was derived from a 5V to 3.3V regulator on systems such as System10/11/12 etc.
143152The KEYCUS chip is the familiar MACH211 PLCC44 IC as used on System12. The sound system is also taken from System12.
144153
145154On bootup, the following happens (on GP500)...
146155
1471st screen - Black screen with white text
1561st screen - Grey screen with white text
148157                               "SYSTEM 23 BOOTING     "
149158                               "SDRAM CHECKING A0xx000" (xx = slowly counts up to 3F, from 00), then OK ('CHECKING' is in yellow text, 'OK' is in green text)
150159   As the SDRAM is being checked, the LEDS 1 to 8 turn off in sequence from 8 to 1.
151160
1522nd screen - Black screen with white text
1612nd screen - Grey screen with white text
153162                               "S.S.23 POWER ON TEST      xxxx"  (xxxx = numbers count up rapidly from 0000)
154163                               "(C) NAMCO                     "
155164                               "                     VER. 1.16"
156165   As these checks happen, the LEDs 1 to 8 flash on/off
157166
1583rd screen - Black screen with white text
1673rd screen - Grey screen with white text
159168                               "S.S.23 POWER ON TEST      xxxx"  (xxxx = numbers count up rapidly from 0000)
160169                               "SUBCPU INITIALIZING ....      "
161170                               "SUBCPU PROGRAM Ver. 0211      "
162171
163172   and a PACMAN eating dots along the bottom of the screen from left to right.
164173   As these checks happen, the LEDs 1 to 8 simultaneously flash on/off in various patterns.
174   The Sub CPU will initialize before the Pacman reaches half-way across the screen.
165175
166   - On System23, the bootup sequence is shorter. The screen remains blank while the SDRAM is being checked. LEDS 1-8 turn off in sequence 8-1
167     After that, the bootup sequence is mostly the same as SS23.
176When the SUB-CPU connects there are numerous POST screens that test almost all of the main components.
168177
178On System23, the bootup sequence is shorter. The screen remains blank while the SDRAM is being checked. LEDS 1-8 turn off in sequence 8-1
179The bank of 8 LEDs on the main board cycles from left to right to left repeatedly (almost all S23/SS23 games seem to do this in fact).
180After that, the bootup sequence is mostly the same as SS23.
181When the game is running some games just cycle the 8 LEDs left/right/left etc. Others cycle the LEDs in pairs just one LED position
182left/right/left etc. Those crazy Namco guys *really* like LEDs.
169183
184To skip the (long) POST, set DIP switch #2 of the 8-position DIP switch block to ON. As soon as the SUB-CPU connects the game will boot.
185However this only works if the program supports it. Most games just ignore the DIPs.
186
187
170188PCB Layouts
171189-----------
172
173SYSTEM23 MAIN PCB 8660962302 8660971105 (8660961105)
190Rev 1
191SYSTEM23 MAIN PCB 8660961103 (8660971103) This rev has J7/J8/J9/J10/J11 populated
192Rev 2
193SYSTEM23 MAIN PCB 8660961105 (8660971105)
174194|----------------------------------------------------------------------------|
175|       J5                    3V_BATT                                        |
195|       J5       J7  J8       3V_BATT       J9   J10                J11      |
176196|                     LED1-8         *R4543     *MAX734          ADM485JR    |
177197|  |-------| LED10-11         LC35256                 CXA1779P  *3414 *3414  |
178198|  |H8/3002|          *2061ASC-1                                             |
r7553r7554
205225|                                                             *KM681000      |
206226|       |----------|    |---------|                        |-------------|   |
207227|       |NKK       |    |         |                        |             |   |
208|       |NR4650-138|    |   C361  |           CY2291       |    C412     |   |
228|       |NR4650-13B|    |   C361  |           CY2291       |    C412     |   |
209229|J14    |          |    |         |                        |             |J15|
210230|       |          |    |         |           14.31818MHz  |             |   |
211231|       |----------|    |---------|  PAL(1)                |-------------|   |
r7553r7554
226246      ---
227247          N341256    - NKK 32k x8 SRAM (x9, SOJ28)
228248          LC35256    - Sanyo 32k x8 SRAM (SOP28)
229          KM416S1020 - Samsung 1M x16 SDRAM (x2, TSOP48)
249          KM416S1020 - Samsung 16MBit SDRAM (x2, TSSOP50)
230250          M5M4V4265  - Mitsubishi 256k x16 DRAM (x2, TSOP40/44)
231251          LC321664   - Sanyo 64k x16 EDO DRAM (SOJ40)
232          HM5216165  - Hitachi 1M x16 SDRAM (x2, TSOP48)
252          HM5216165  - Hitachi 16MBit SDRAM (x2, TSSOP50)
233253          KM681000   - Samsung 128k x8 SRAM (x2, SOP32)
234254          CY7C182    - Cypress 8k x9 SRAM (SOJ28)
235255
r7553r7554
249269
250270      Other ICs
251271      ---------
252               XC95108  - Xilinx XC95108 In-System Programmable CPLD (QFP100, labelled 'S23MA9B')
272               XC95108  - Xilinx XC95108 In-System Programmable CPLD (QFP100)
273                            - labelled 'S23MA9' on Rev 1
274                            - labelled 'S23MA9B' on Rev 2
253275               DS8921   - National RS422/423 Differential Line Driver and Receiver Pair (SOIC8)
254276               CXD1178Q - SONY CXD1178Q  8-bit RGB 3-channel D/A converter (QFP48)
255277               PAL(1)   - PALCE16V8H (PLCC20, stamped 'PAD23')
r7553r7554
270292
271293      Misc
272294      ----
273          J18   - Connector for MSPM(FRA) PCB
274295          J5    - Connector for EMI PCB
296          J7/J8 - 15-pin VGA output connectors                        -\
297          J9/J10- Red/White Stereo Audio Output RCA connectors          \
298          J11   - Standard USB connector (used on Motocross Go!)       -/  Not populated on most PCBs
275299          J12   - 6-pin connector for In-System Programming of the XC95108 IC
276300          J14 \
277          J15 \
278          J16 \
301          J15 |
302          J16 |
279303          J17 \ - Connectors for MEM(M) PCB
304          J18   - Connector for MSPM(FRA) PCB
280305          SW2   - 2 position DIP Switch
281306          SW3   - 2 position DIP Switch
282307          SW4   - 8 position DIP Switch
r7553r7554
284309
285310SystemSuper23 MAIN(1) PCB 8672960904 8672960104 (8672970104)
286311|----------------------------------------------------------------------------|
287|       J5                    3V_BATT                                        |
312|       J5       J7  J8       3V_BATT       J9   J10                J11      |
288313|                     LED1-8         *R4543     *MAX734          ADM485JR    |
289314|  |-------| LED10-11         LC35256                 CXA1779P   3414  3414  |
290315|  |H8/3002|          *2061ASC-1                                             |
r7553r7554
336361
337362      RAM
338363      ---
339          N341256    - NKK 32K x8 SRAM (x5, SOJ28)
340          LC35256    - Sanyo 32K x8 SRAM (SOP28)
341          KM416S1020 - Samsung 16M SDRAM (x4, TSOP48)
342          KM416V2540 - Samsung 256K x16 EDO DRAM (x2, TSOP40/44)
343          LC321664   - Sanyo 64K x16 EDO DRAM (SOJ40)
344          71V124     - IDT 128K x8 SRAM (x2, SOJ32)
345          CY7C1399   - Cypress 32K x8 SRAM (x4, SOJ28)
346          CY7C182    - Cypress 8K x9 SRAM (SOJ28)
347          M5M4V4265  - Mitsubishi 256K x16 DRAM (x2, TSOP40/44)
348          HM5216165  - Hitachi 1M x16 SDRAM (x2, TSOP48)
349          KM681000   - Samsung 128K x8 SRAM (x2, SOP32)
364          N341256    - NKK 32k x8 SRAM (x5, SOJ28)
365          LC35256    - Sanyo 32k x8 SRAM (SOP28)
366          KM416S1020 - Samsung 16MBit SDRAM (x4, TSSOP50)
367          KM416V2540 - Samsung 256k x16 EDO DRAM (x2, TSOP40/44)
368          LC321664   - Sanyo 64k x16 EDO DRAM (SOJ40)
369          71V124     - IDT 128k x8 SRAM (x2, SOJ32)
370          CY7C1399   - Cypress 32k x8 SRAM (x4, SOJ28)
371          CY7C182    - Cypress 8k x9 SRAM (SOJ28)
372          M5M4V4265  - Mitsubishi 256k x16 DRAM (x2, TSOP40/44)
350373
351374      Namco Customs
352375      -------------
353376                    C352 (QFP100)
354377                    C361 (QFP120)
355                    C403 (QFP136)
356378                    C404 (QFP208)
357                    C412 (QFP256)
358379                    C413 (QFP208)
359380                    C416 (QFP176)
360381                    C417 (QFP208)
r7553r7554
366387
367388      Other ICs
368389      ---------
369               XC95108  - Xilinx XC95108 In-System Programmable CPLD (QFP100, labelled 'S23MA9B')
370390               EPM7064  - Altera MAX EPM7064STC100-10 CPLD (TQFP100, labelled 'SS23MA4A')
371391               DS8921   - National RS422/423 Differential Line Driver and Receiver Pair (SOIC8)
372392               CXD1178Q - SONY CXD1178Q  8-bit RGB 3-channel D/A converter (QFP48)
373               PAL(1)   - PALCE16V8H (PLCC20, stamped 'PAD23')
374               PAL(2)   - PALCE22V10H (PLCC28, stamped 'S23MA5')
375               PAL(3)   - PALCE22V10H (PLCC28, stamped 'SS23MA6B')
376393               PAL(1)   - PALCE16V8H (PLCC20, stamped 'SS23MA1B')
377394               PAL(2)   - PALCE22V10H (PLCC28, stamped 'SS23MA2A')
378395               PAL(3)   - PALCE22V10H (PLCC28, stamped 'SS23MA3A')
r7553r7554
387404               CY2291   - Cypress CY2291 Three-PLL General Purpose EPROM Programmable Clock Generator (SOIC20)
388405               2061ASC-1- IC Designs 2061ASC-1 clock generator IC (SOIC16, also found on Namco System 11 PCBs)
389406               R4543    - EPSON Real Time Clock Module (SOIC14)
390               IDT7200  - Integrated Devices Technology IDT7200 256 x9 CMOS Asynchronous FIFO
391407
392408      Misc
393409      ----
410          J5    - Connector for EMI PCB
411          J7/J8 - 15-pin VGA output connectors                 -\
412          J9/J10- Red/White Stereo Audio Output RCA connectors   \
413          J11   - Standard USB connector                        -/  Not populated on most PCBs
414          J14 \
415          J15 |
416          J16 |
417          J17 \ - Connectors for MEM(M) PCB
394418          J18   - Connector for MSPM(FRA) PCB
419          SW2   - 2 position DIP Switch
420          SW3   - 2 position DIP Switch
421          SW4   - 8 position DIP Switch
422
423
424System23Evolution2 MAIN PCB 8902960103 (8902970103)
425|----------------------------------------------------------------------------|
426|       J5          J7                           3V_BATT                     |
427|                     LED1-8     ADM485               *R4543                 |
428|  |-------| LED10-11                                  LC35256   CXD1178Q    |
429|  |H8/3002|          *2061ASC-1                                             |
430|  |       |       SW4                  UDA1320 UDA1320                      |
431|  |-------|                    DS8921                                       |
432|J18                                                                         |
433|               SW3  14.7456MHz                |----|    |----|              |
434|              |------|  |----|   |---------|  |C435|    |C435|              |
435|    N341256   | C452 |  |C422|   |         |  |----|    |----|              |
436|              |      |  |----|   |   C444  |                                |
437|    N341256   |      |           |         | XILINX    XILINX  |---------|  |
438|              |------|           |         | XC9572XL  XC9536XL|         |  |
439|   |----| *PST575                |---------|                   |  C451   |  |
440|   |C352|           CY7C182                                    |         |  |
441|   |----| LED9                                                 |         |  |
442|                                                               |---------|  |
443|     KM432S2030                                KM416V2540                   |
444|                                                                            |
445|J16                                                                      J17|
446|     KM432S2030                            |---------|  |---------| N341256 |
447|                                IS61LV256  |         |  |         |         |
448|                                           |   C421  |  |   C404  | N341256 |
449|       |---------|              IS61LV256  |         |  |         |         |
450|       |         |                         |         |  |         | N341256 |
451|       |   C450  |                         |---------|  |---------|         |
452|       |         |                                                          |
453|       |         |                             KM416V2540                   |
454|       |---------| SW2    LC321664                                          |
455|               *PST575                                                      |
456|                                                           *KM416S1120      |
457|       |----------|    |---------|                        |-------------|   |
458|       |IDT       |    |         |                        |             |   |
459|       |NR4650-200|    |   C361  |           CY2291       |    C447     |   |
460|J14    |          |    |         |                        |             |J15|
461|       |          |    |         |           14.31818MHz  |             |   |
462|       |----------|    |---------|  PAL                   |-------------|   |
463|                                                           *KM416S1120      |
464|                                                          71V124   71V124   |
465|----------------------------------------------------------------------------|
466Notes:
467      * - These parts are underneath the PCB.
468
469      Main Parts List:
470
471      CPU
472      ---
473          NKK NR4650 - R4600-based 64bit RISC CPU (Main CPU, QFP208, clock input source = CY2291)
474          H8/3002    - Hitachi H8/3002 HD6413002F17 (Sound CPU, QFP100, running at 14.7456MHz)
475
476      RAM
477      ---
478          N341256    - NKK 32k x8 SRAM (x5, SOJ28)
479          LC35256    - Sanyo 32k x8 SRAM (SOP28)
480          KM432S2030 - Samsung 32MBit SDRAM (x2, TSSOP86)
481          KM416S1120 - Samsung 16MBit SDRAM (x2, TSSOP50)
482          KM416V2540 - Samsung 256k x16 EDO DRAM (x2, TSOP40/44)
483          LC321664   - Sanyo 64k x16 EDO DRAM (SOJ40)
484          71V124     - IDT 128k x8 SRAM (x2, SOJ32)
485          ISS61LV256 - ISSI 32k x8 SRAM (x2, SOJ28)
486          CY7C182    - Cypress 8k x9 SRAM (SOJ28)
487          M5M4V4265  - Mitsubishi 256k x16 DRAM (x2, TSOP40/44)
488
489      Namco Customs
490      -------------
491                    C352 (QFP100)
492                    C361 (QFP120)
493                    C404 (QFP208)
494                    C421 (QFP208)
495                    C422 (QFP64)
496                    C435 (x2, QFP144)
497                    C444 (QFP136)
498                    C447 (QFP256)
499                    C450 (BGAxxx)
500                    C451 (QFP208)
501                    C452 (QFP176)
502
503      Other ICs
504      ---------
505               XC9536   - XILINX XC9536XL CPLD (TQFP64, labelled 'S23EV2.1')
506               XC9572   - XILINX XC9536XL CPLD (TQFP100, labelled 'S23EV2.2')
507               DS8921   - National RS422/423 Differential Line Driver and Receiver Pair (SOIC8)
508               CXD1178Q - SONY CXD1178Q  8-bit RGB 3-channel D/A converter (QFP48)
509               PAL      - PALCE16V8H (PLCC20, stamped 'PAD23')
510               PST575   - PST575 System Reset IC (SOIC4)
511               ADM485   - Analog Devices Low Power EIA RS485 transceiver (SOIC8)
512               CY2291   - Cypress CY2291 Three-PLL General Purpose EPROM Programmable Clock Generator (SOIC20)
513               2061ASC-1- IC Designs 2061ASC-1 clock generator IC (SOIC16, also found on Namco System 11 PCBs)
514               R4543    - EPSON Real Time Clock Module (SOIC14)
515               UDA1320  - Philips UDA1320 Low-cost stereo filter DAC (SOIC16)
516
517      Misc
518      ----
395519          J5    - Connector for EMI PCB
520          J7    - 15-pin VGA output connector
396521          J14 \
397          J15 \
398          J16 \
522          J15 |
523          J16 |
399524          J17 \ - Connectors for MEM(M) PCB
525          J18   - Connector for MSPM(FRC) PCB
400526          SW2   - 2 position DIP Switch
401527          SW3   - 2 position DIP Switch
402528          SW4   - 8 position DIP Switch
403529
404530
531SystemSuper23 Gmen PCB 8672960502 (8672970502)
532Sticker: Gmen (GTR) PCB
533                         |---------------------------------------------------|
534                         |        J8              LED4    J6        J5       |
535                         |          20.25MHz          82AF          LT1635   |
536                         |     VXP3220A            611_803        24.576MHz  |
537                         |                                      |-----|      |
538                         |                                      |FUJI |      |
539                         |                           |-----|    |MD8402A     |
540                         |                           |FUJI |    |-----|      |
541                         |                           |MD8412A                |
542                         |                           |-----|                 |
543                         |                                                   |
544                         |                                                   |
545                         |                                                   |
546                         |                       TSOP48                      |
547|------------------------|                                                   |
548|  N341256 N341256                                             N341024       |
549|                     HM5118165 HM5118165                                    |
550|                                                                            |
551|     |---------|                  |---(1)--|                                |
552|J10  |         |                  |ALTERA  |                  N341024    J17|
553|     |  C446   |      |--------|  |MAX     |                                |
554|     |         |      |ALTERA  |  |EPM7064 |                                |
555|     |         |      |FLEX    |  |--------|                                |
556|     |---------|      |EPM8282 | LED3                     |----------|      |
557|                      |--------|                          |ALTERA    |      |
558|                                                          |FLEX      |      |
559|                                                          |EPM8452   |      |
560|                                                          |          |      |
561|                         |-------|                        |----------|      |
562|                         | SH2   |                           LED2           |
563|                         |       |                                          |
564|              28.7MHz    |-------|                                          |
565|J11                3771         KM416S1020                    N341024    J16|
566|    HD63B50                                                                 |
567|              40MHz                                                         |
568|                                KM416S1020          SW3                     |
569| |--(2)--|                                                    N341024       |
570| |ALTERA |                                                                  |
571| |EPM7064|                                                                  |
572| |-------|    LT1180                               LED1    LED5-12          |
573|----------------------------------------------------------------------------|
574Notes:
575      This board is used only on Gunmen Wars to control the CCD camera. The main board does it's usual POST
576      then the board fires up, LED1 lights red and the LEDs 5-12 go crazy pulsing left to right from the middle outwards.
577      The main board uploads a loader program, then the Main SH2 program. After completion LED 3 lights green and then.....
578      it doesn't work. LED 2 lights orange for a second then extinguishes, then the main board resets :-/
579
580      SH2        - Hitachi HD6417604 SH2 CPU (QFP144, clock input 28.7MHz)
581      N341024    - NKK 128k x8 SRAM (x4, SOP32)
582      N341256    - NKK 32k x8 SRAM (x2, SOP28)
583      KM416S1020 - Samsung 16MBit SDRAM (x2, TSSOP50). Also compatible with MB811181622
584      HM5118165  - Hitachi 16MBit SDRAM (x2, TSSOP44/50)
585      C446       - Namco Custom IC (QFP160)
586      TSOP48     - Not-populated position for a 29F400 512k x8 TSOP48 flash ROM
587      3771       - Fujitsu MB3771 System Reset IC (SOIC4)
588      MD8402     - Fuji MD8402A IEEE 1394 'Firewire' Physical Channel Interface IC (TQFP100)
589      MD8412     - Fuji MD8412A IEEE 1394 'Firewire' Link Layer Controller IC (TQFP100)
590      VXP3220A   - Micronis Intermetall VXP3220A Video Pixel Decoder IC (PLCC44)
591      HD63B50    - Hitachi HD63B50 Asynchronous Communications Interface Adapter IC (SOP24)
592      LT1180     - Linear Technology LT1180A Low Power 5V RS232 Dual Driver/Receiver Pair with 0.1mF Capacitors
593      EPM7064(1) - Altera MAX EPM7064 CPLD labelled 'SS23GM1A' (TQFP100)
594      EPM7064(2) - Altera EPM7064 CPLD labelled 'SS23GM2A' (TQFP44)
595      EPM8452    - Altera FLEX EPM8452 CPLD (no label, QFP160)
596      EPM8282    - Altera FLEX EPM8282 CPLD (no label, TQFP100)
597      82AF       - National 82AF General Purpose EMI Reduction IC (SOIC8)
598      LT1635     - Linear Technology LT1635 Micropower Rail-to-Rail Op Amp and Reference Buffer (SOIC8)
599      611_803    - ? (SOIC8)
600      J5/J6      - IEEE 1394 'Firewire' connectors
601      J8         - Connector for EMI PCB
602      J10        - Labelled 'WAVE'       \
603      J11        - Labelled 'SYS23BUS'   | Connectors for MEM(M) PCB
604      J16        - Labelled 'TEXTURE'    | i.e. The ROM board sits on top of this board
605      J17        - Labelled 'POINT'      /
606      SW3        - 8 position DIP Switch
607
608
405609Program ROM PCB
406610---------------
407
611Type 1:
408612MSPM(FRA) PCB 8699017500 (8699017400)
409613|--------------------------|
410614|            J1            |
r7553r7554
422626
423627      Games that use this PCB include...
424628
425      Game           Code and revision
426      --------------------------------
427      Time Crisis 2  TSS3 Ver.B
629      Game             Code and revision
630      ----------------------------------
631      Time Crisis 2    TSS2 Ver.B
632      Time Crisis 2    TSS3 Ver.B
633      Gunmen Wars      GM1 Ver.A
634      Downhill Bikers  DH3 Ver.A
635      Motocross Go!    MG3 Ver.A
636      Panic Park       PNP2 Ver.A
428637
429
638Type 2:
430639MSPM(FRA) PCB 8699017501 (8699017401)
431640|--------------------------|
432641|            J1            |
r7553r7554
444653
445654      Games that use this PCB include...
446655
447      Game           Code and revision
448      --------------------------------
449      GP500          5GP3 Ver.C (for Super System 23)
450      Time Crisis 2  TSS4 Ver.A (for Super System 23)
451
452Other games dumps with unknown PCB information....
453
454656      Game             Code and revision
455657      ----------------------------------
658      GP500            5GP3 Ver.C (for Super System 23)
659      Time Crisis 2    TSS4 Ver.A (for Super System 23)
456660      Final Furlong 2  FFS1 Ver.?
457661      Final Furlong 2  FFS2 Ver.?
458662
663Type 3:
664MSPM(FRC) PCB 8699019800 (8699019700)
665|--------------------------|
666|            J1            |
667|                          |
668|  IC1         IC2   IC4   |
669|                          |
670|                          |
671|                 IC3      |
672|--------------------------|
673Notes:
674      J1 -  Connector to plug into Main PCB
675      IC1 - Sound Program (Fujitsu 29F400T 4MBit FlashROM, TSOP48)
676      IC3 - a *very tiny* transistor marked 'H5'
677      IC2 \
678      IC4 / Main Program  (Intel DA28F640J5 64MBit FlashROM, SSOP56)
459679
680      Games that use this PCB include...
681
682      Game             Code and revision    Notes
683      -----------------------------------------------------------------------
684      Crisis Zone      CSZO3 Ver.B          Serialsed ROMs, IC2 not populated
685
686
460687ROM PCB
461688-------
462689
463690Printed on the PCB        - 8660960601 (8660970601) SYSTEM23 MEM(M) PCB
464Sticker (GP500)           - 8672961100
691Sticker (500GP)           - 8672961100
465692Sticker (Time Crisis 2)   - 8660962302
466Sticker (Final Furlong 2) - ??????????
693Sticker (Crisis Zone)     - 8672961100 .... same as 500GP
467694|----------------------------------------------------------------------------|
468695| KEYCUS    MTBH.2M      CGLL.4M        CGLL.5M         CCRL.7M       PAL(3) |
469696|                                                                            |
r7553r7554
491718|----------------------------------------------------------------------------|
492719Notes:
493720      J1   \
494      J2   \
495      J3   \
721      J2   |
722      J3   |
496723      J4   \   - Connectors to main PCB
497724      JP1      - ROM size configuration jumper for WAVE ROMs. Set to 64M, alt. setting 32M
498725      JP2      - ROM size configuration jumper for CG ROMs. Set to 64M, alt. setting 32M
r7553r7554
513740                 Note this PAL is not populated when used on Super System 23
514741
515742      All ROMs are SOP44 MaskROMs
516      Note: ROMs at locations 7M, 7K, 5M, 5K, 5J & 5F are not included in the archive since they're copies of
517            other ROMs which are included in the archive. However, they are populated on the PCB.
743      Note: ROMs at locations 7M, 7K, 5M, 5K, 5J & 5F are copies of identical ROMs on the PCB at locations 7F, 7E, 4M, 4K, 4J, 4F
518744            Each ROM is stamped with the Namco Game Code, then the ROM-use code (such as CCRL, CCRH, PT* or MT*).
519745
520746                            Game
521747            Game            Code     Keycus    Notes
522            ---------------------------------------------------------
523            GP500           5GP1     KC029     -
524            Time Crisis 2   TSS1     KC010     3A and 3C not populated. i.e. PT3L & PT3H is not used.
748            -----------------------------------------------------------------------
749            500GP           5GP1     KC029     -
750            Crisis Zone     CSZ1     KC039     -
751            Downhill Bikers DH1      KC016     3A, 3C, 2M and 2F not populated.
525752            Final Furlong 2 FFS1     KC???     -
753            Gunmen Wars     GM1      KC018     3A, 3C, 4A, 4C, 2A, 2F and 2M not populated.
754            Motocross Go!   MG1      KC???     3A, 3C, 4A, 4C, 4F and 7F not populated.
755            Panic Park      PNP1     KC015     3A, 3C, 4A, 4C, 2M and 2F not populated.
756            Time Crisis 2   TSS1     KC010     3A and 3C not populated.
526757
527
528758I/O PCBs
529759--------
530760
531761FCA PCB  8662969102 (8662979102)
532(Used with GP500)
762(Used with 500 GP so far. Another identical board is secured for a different but unknown game)
533763|---------------------------------------------------|
534764| J101                J106                          |
535765|            4.9152MHz                              |
r7553r7554
549779      J106     - 30 pin flat cable connector
550780      JP1      - 3 pin jumper, set to 'NORM'. Alt setting 'WR'
551781      3771     - Fujitsu MB3771 System Reset IC (SOIC8)
552      PIC16F84 - Microchip PIC16F84 Programmable Interrupt Controller stamped 'CAP10' (SOIC20)
553      MCU      - Fujitsu MB90F574 Microcontroller, stamped 'FCAF10' (QFP120)
782      PIC16F84 - Microchip PIC16F84 PIC (SOIC20)
783                  - For 500 GP stamped 'CAP10'
784                  - For unknown stamped 'CAP11'
785      MCU      - Fujitsu MB90F574 Microcontroller (QFP120)
786                  - For 500 GP stamped 'FCAF10'
787                  - For unknown stamped 'FCAF11'
554788      ADM485   - Analog Devices ADM485 +5V Low Power EIA RS-485 Transceiver (SOIC8)
555789
556I/O Boards for Gun games
790
791ASCA-3A PCB 8662968301 (8662978301)
792This is used with Motocross Go!
793It's identical to the one shown below (ASCA-4A) but the ROM is a surface mounted
794PLCC32 instead of a socketed DIP32 chip. Everything else is identical.
795
796ASCA-4A PCB  8662968401 (8662978401)
797(Used with most games and [for testing purposes] is able to boot all S23/SS23/Evolution2 games)
798Sticker for Gunmen Wars: ASCA5 PCB 86629615
799|---------------------------------------------------|
800|                           PST592           62256  |
801|                     14.7460MHz  |-------|         |
802|                                 |  C78  |         |
803|         LB1235       DSW(4)     |       | 27C1001 |
804| LB1233  LB1235                  |-------|         |
805|                                                   |
806|                |------|            ADM485         |
807|                |ALTERA|                           |
808|                |EPM7096                           |
809|      J101      |------|          J102  J103       |
810|---------------------------------------------------|
811Notes:
812      J101     - 64 pin connector for power + inputs. This joins to another PCB at 90 degrees containing
813                 a bunch of connectors named 'ASCA 4B PCB 8662968702 (8662978702)'. This is where ALL of the
814                 inputs/outputs for game control and inter-PCB communication are connected
815      PST592   - System Reset IC (SOIC4)
816      C78      - Hitachi HD643334 H8/3334 Microcontroller rebadged as 'C78'. Clock input 14.746MHz (PLCC84)
817      27C1001  - 128k x8 EPROM (DIP32)
818                  - For Downhill Bikers labelled 'ASC3 IO-C'
819                  - For Panic Park labelled 'ASC3 IO-C'
820                  - For Gunmen Wars labelled 'ASC5 IO-A'
821      62256    - 32k x8 SRAM (SOP28)
822      EPM7096  - Altera EPM7096 CPLD with sticker 'ASCA,DR1' (PLCC68)
823      ADM485   - Analog Devices ADM485 +5V Low Power EIA RS-485 Transceiver (SOIC8)
824      J102/J103- Standard USB A and B connectors. These are not populated on most games, but are populated for use with Motocross Go!
825
826
827I/O Boards for gun games
557828------------------------
558829
559830Type 1:
r7553r7554
575846|-----------------------------------------|
576847Notes:
577848      TSSIOPROG - Atmel AT29C020 EEPROM stamped 'TSSIOP8' (PLCC32)
578      C78       - Namco Custom C78, actually a rebadged Hitachi HD643334 MCU (PLCC84)
849      C78       - Namco Custom C78, actually a rebadged Hitachi HD643334 MCU, clock input 14.746MHz (PLCC84)
579850      TSSIOPLD  - Altera MAX EPM7128ELC84 CPLD with label 'TSSIOPLD' (PLCC84)
580      SLA4060   -
581      J1        - 12 position connector for power and I/O
582      J3        - 12 position connector for buttons and gun connection
851      SLA4060   - Sanken Electric SLA4060 NPN general purpose darlington transistor (used to drive the kick-back solenoid in the gun)
852      PST592    - System Reset IC (SOIC4)
853      J1        - 12 position connector for power and I/O communication
854      J3        - 12 position connector for gun connection (trigger/buttons/optical signal/power)
583855      J4        - not used?
584856      J5        - 6 position connector for network
585857      J601      - not used?
r7553r7554
639911
640912This board is used on Crisis Zone (System 23 Evolution2) and Time Crisis 3 (System 246)
641913Note both games use a CCD camera for the gun sensor.
642*/
914--------------
643915
644/*
645Rapid River
646Namco, 1997
647916
648This game runs on hardware called "GORGON". It appears to be similar to
649System 23 but the PCBs are slightly larger.
917Namco Gorgon-based games
918------------------------
650919
920Rapid River, Final Furlong (both Namco, 1997)
921
922These games run on hardware called "GORGON". It appears to have similar
923capabilities to System 23 but like Super System 22 has sprites also.
924(System 23 doesn't have sprites). The PCBs are about two times larger
925than System 23.
926
651927The system comprises Main PCB, ROM PCB and I/O PCB all located inside
652928a metal box with 3 separate power supplies for 5V, 12V and 3.3V. Main
653929input power is 115V.
654The game is controlled by rotating a paddle (for thrust) and turning it
930Rapid River is controlled by rotating a paddle (for thrust) and turning it
655931sideways (moves left/right).
656932The rotation action is done with a 5K potentiometer whereby the thrust
657933is achieved by moving the pot from full left to full right continuously.
r7553r7554
663939a warning if it's not working. Pressing START allows the game to continue
664940and function normally without the seat movement.
665941
942The other game on this system (Final Furlong) and is a horse racing game.
943To control the horse you rock it forwards and backwards continually (it's very tiring
944to play this game).
945This would activate possibly one or two 5K potentiometers inside the horse body.
946Just like a real horse you need to control the speed so your horse lasts the entire race.
947If you rock too much, a message on screen says 'Too Fast'. To steer the horse turn the
948head sideways using the reins. There would be another 5K potentiometer in the head
949to activate the turning direction.
666950
951
667952Main PCB
668953--------
669954
r7553r7554
703988|    2061ASC               |C416  | |------|      |        |     |      |     |---------| |---------|  |
704989|      14.7456MHz          |      |               |--------|     |------|     |         | |NKK      |  |
705990|PAL             |-----|   |------|    |------|                   D4516161    |  C413   | |NR4650   |  |
706|                |H8/  |               |C361  |                   D4516161    |         | |LQF-133  |  |
991|                |H8/  |               |C361  |                   D4516161    |         | |LQF-13B  |  |
707992|                |3002 |               |      |LC321664                       |         | |         |  |
708993|  J10           |-----|               |------|    J8                         |---------| |---------|  |
709994|------------------------------------------------------------------------------------------------------|
r7553r7554
7781063
7791064      Game           Code and revision
7801065      --------------------------------
1066      Rapid River    RD2 Ver.C
7811067      Rapid River    RD3 Ver.C
7821068      Final Furlong  FF2 Ver.A
7831069
r7553r7554
8671153Notes:
8681154      IC1  - Atmel AT29C020 2MBit EEPROM labelled 'ASCA1 I/O-A' (PLCC32)
8691155      C78  - Namco Custom MCU, positively identified as a Hitachi H8/3334 (PLCC84)
870      EPM7064 - Altera EPM7064LC68-15 FPGA, labelled 'ASCA DR0' (PLCC68)
1156      EPM7064 - Altera EPM7064LC68-15 PLD, labelled 'ASCA DR0' (PLCC68)
8711157      PST592 - System Reset IC (SOIC4)
8721158      ADM485 - Analog Devices +ADM485 5V Low Power EIA RS-485 Transceiver (SOIC8)
8731159      MB87078 - Fujitsu MB87078 Electronic Volume Control IC (SOIC24)
r7553r7554
8761162      J102 - 50 pin flat cable connector for filter board
8771163      J104 - 8 pin power connector (+5V, +12V, +3.3V)
8781164      J105 - 64 pin connector for connection of Main PCB
1165
8791166*/
8801167
8811168#include "emu.h"
8821169#include "cpu/mips/mips3.h"
8831170#include "cpu/h83002/h8.h"
1171#include "cpu/sh2/sh2.h"
8841172#include "sound/c352.h"
8851173
8861174#define S23_BUSCLOCK   (66664460/2)   // 33 MHz CPU bus clock / input, somehow derived from 14.31721 MHz crystal
r7553r7554
8911179
8921180//static int ss23_vstat = 0, hstat = 0, vstate = 0;
8931181static tilemap_t *bgtilemap;
894static UINT32 *namcos23_textram, *namcos23_shared_ram;
1182static UINT32 *namcos23_textram, *namcos23_shared_ram, *gmen_sh2_shared;
8951183static UINT32 *namcos23_charram;
8961184static UINT8 namcos23_jvssense;
8971185static INT32 has_jvsio;
r7553r7554
9131201static UINT16 c421_sram[0x8000];
9141202static UINT32 c421_adr = 0;
9151203
1204static INT16 s23_c422_regs[0x10];
1205static int s23_subcpu_running;
9161206
9171207static UINT16 nthword( const UINT32 *pSource, int offs )
9181208{
r7553r7554
9321222   SET_TILE_INFO( 0, data&0x03ff, data>>12, TILE_FLIPYX((data&0x0c00)>>10) );
9331223} /* TextTilemapGetInfo */
9341224
935static READ32_HANDLER( namcos23_textram_r )
936{
937   return namcos23_textram[offset];
938}
939
9401225static WRITE32_HANDLER( namcos23_textram_w )
9411226{
9421227   COMBINE_DATA( &namcos23_textram[offset] );
r7553r7554
9511236   tilemap_set_transparent_pen(bgtilemap, 0xf);
9521237}
9531238
954#if 0
955static double
956Normalize( UINT32 data )
957{
958   data &=  0xffffff;
959   if( data&0x800000 )
960   {
961      data |= 0xff000000;
962   }
963   return (INT32)data;
964}
965
966static void
967DrawLine( bitmap_t *bitmap, int x0, int y0, int x1, int y1 )
968{
969   if( x0>=0 && x0<bitmap->width &&
970      x1>=0 && x1<bitmap->width &&
971      y0>=0 && y0<bitmap->height &&
972      y1>=0 && y1<bitmap->height )
973   {
974      int sx,sy,dy;
975      if( x0>x1 )
976      {
977         int temp = x0;
978         x0 = x1;
979         x1 = temp;
980
981         temp = y0;
982         y0 = y1;
983         y1 = temp;
984      }
985
986      if( x1>x0 )
987      {
988         sy = y0<<16;
989         dy = ((y1-y0)<<16)/(x1-x0);
990         for( sx=x0; sx<x1; sx++ )
991         {
992            UINT16 *pDest = BITMAP_ADDR16(bitmap, sy>>16, 0);
993            pDest[sx] = 1;
994            sy += dy;
995         }
996      }
997   }
998} /* DrawLine */
999
1000static void
1001DrawPoly( bitmap_t *bitmap, const UINT32 *pSource, int n, int bNew )
1002{
1003   UINT32 flags = *pSource++;
1004   UINT32 unk = *pSource++;
1005   UINT32 intensity = *pSource++;
1006   double x[4],y[4],z[4];
1007   int i;
1008   if( bNew )
1009   {
1010      mame_printf_debug( "polydata: 0x%08x 0x%08x 0x%08x\n", flags, unk, intensity );
1011   }
1012   for( i=0; i<n; i++ )
1013   {
1014      x[i] = Normalize(*pSource++);
1015      y[i] = Normalize(*pSource++);
1016      z[i] = Normalize(*pSource++);
1017
1018      if( bNew )
1019      {
1020         mame_printf_debug( "\t(%f,%f,%f)\n", x[i], y[i], z[i] );
1021      }
1022   }
1023   for( i=0; i<n; i++ )
1024   {
1025      #define KDIST 0x400
1026      int j = (i+1)%n;
1027      double z0 = z[i]+KDIST;
1028      double z1 = z[j]+KDIST;
1029
1030      if( z0>0 && z1>0 )
1031      {
1032         int x0 = bitmap->width*x[i]/z0 + bitmap->width/2;
1033         int y0 = bitmap->width*y[i]/z0 + bitmap->height/2;
1034         int x1 = bitmap->width*x[j]/z1 + bitmap->width/2;
1035         int y1 = bitmap->width*y[j]/z1 + bitmap->height/2;
1036         if( bNew )
1037         {
1038            mame_printf_debug( "[%d,%d]..[%d,%d]\n", x0,y0,x1,y1 );
1039         }
1040         DrawLine( bitmap, x0,y0,x1,y1 );
1041      }
1042   }
1043}
1044#endif
1045
10461239static VIDEO_UPDATE( ss23 )
10471240{
10481241   bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
10491242   bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
10501243
10511244   tilemap_draw( bitmap, cliprect, bgtilemap, 0/*flags*/, 0/*priority*/ ); /* opaque */
1052
1053#if 0
1054   static int bNew = 1;
1055   static int code = 0x80;
1056   const UINT32 *pSource = (UINT32 *)memory_region(machine, "pointrom");
1057
1058   pSource = pSource + pSource[code];
1059
1060   bitmap_fill( bitmap, 0 , 0);
1061   for(;;)
1062   {
1063      UINT32 opcode = *pSource++;
1064      int bDone = (opcode&0x10000);
1065
1066      switch( opcode&0x0f00 )
1067      {
1068      case 0x0300:
1069         DrawPoly( bitmap, pSource, 3, bNew );
1070         pSource += 3 + 3*3;
1071         break;
1072
1073      case 0x0400:
1074         DrawPoly( bitmap, pSource, 4, bNew );
1075         pSource += 3 + 4*3;
1076         break;
1077
1078      default:
1079         mame_printf_debug( "unk opcode: 0x%x\n", opcode );
1080         bDone = 1;
1081         break;
1082      }
1083
1084
1085      if( bDone )
1086      {
1087         break;
1088      }
1089   }
1090
1091   bNew = 0;
1092
1093   if( keyboard_pressed(KEYCODE_SPACE) )
1094   {
1095      while( keyboard_pressed(KEYCODE_SPACE) ){}
1096      code++;
1097      bNew = 1;
1098   }
1099#endif
11001245   return 0;
11011246}
11021247
1103static READ32_HANDLER( s23_txtchar_r )
1104{
1105   return namcos23_charram[offset];
1106}
1107
11081248static WRITE32_HANDLER( s23_txtchar_w )
11091249{
11101250   COMBINE_DATA(&namcos23_charram[offset]);
11111251   gfx_element_mark_dirty(space->machine->gfx[0], offset/32);
11121252}
1113#if 0
1114static READ32_HANDLER( ss23_vstat_r )
1115{
1116   if (offset == 1)
1117   {
1118      hstat ^= 0xffffffff;
1119      return hstat;
1120   }
11211253
1122   vstate++;
1123   if (vstate >= 2)
1124   {
1125   ss23_vstat ^= 0xffffffff;
1126      vstate = 0;
1127   }
1128   return ss23_vstat;
1129}
1130#endif
11311254static UINT8 nthbyte( const UINT32 *pSource, int offs )
11321255{
11331256   pSource += offs/4;
r7553r7554
11361259
11371260INLINE void UpdatePalette( running_machine *machine, int entry )
11381261{
1139         int j;
1262   int j;
11401263
11411264   for( j=0; j<2; j++ )
11421265   {
r7553r7554
11481271   }
11491272}
11501273
1151static READ32_HANDLER( namcos23_paletteram_r )
1152{
1153   return space->machine->generic.paletteram.u32[offset];
1154}
1155
11561274/* each LONGWORD is 2 colors.  each OFFSET is 2 colors */
11571275
11581276static WRITE32_HANDLER( namcos23_paletteram_w )
r7553r7554
11621280   UpdatePalette(space->machine, (offset % (0x10000/4))*2);
11631281}
11641282
1165static READ16_HANDLER(s23_c417_16_r)
1283static READ16_HANDLER(s23_c417_r)
11661284{
11671285   switch(offset) {
11681286   case 0: return 0x8e | (video_screen_get_vblank(space->machine->primary_screen) ? 0x8000 : 0);
r7553r7554
11721290      return c417_ram[c417_adr];
11731291   }
11741292
1175   logerror("c417_16_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1293   logerror("c417_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
11761294   return 0;
11771295}
11781296
1179static WRITE16_HANDLER(s23_c417_16_w)
1297static WRITE16_HANDLER(s23_c417_w)
11801298{
11811299    switch(offset) {
1300    case 0:
1301       if (data == 1)
1302   {
1303      logerror("c417_w: raise IRQ 2\n");
1304      cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ2, ASSERT_LINE);
1305   }
1306       break;
11821307    case 1:
11831308        COMBINE_DATA(&c417_adr);
11841309        break;
r7553r7554
11871312      //        logerror("c417_w %04x = %04x (%08x, %08x)\n", c417_adr, data, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
11881313        COMBINE_DATA(c417_ram + c417_adr);
11891314        break;
1315    case 7:
1316       logerror("c417_w: ack IRQ 2 (%x)\n", data);
1317       cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ2, CLEAR_LINE);
1318       break;
11901319    default:
1191        logerror("c417_16_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1320        logerror("c417_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
11921321        break;
11931322    }
11941323}
11951324
1196static READ32_HANDLER(s23_c417_32_r)
1197{
1198    UINT32 data = 0;
1199    if (ACCESSING_BITS_16_31)
1200        data |= s23_c417_16_r(space, offset*2, mem_mask >> 16) << 16;
1201    if (ACCESSING_BITS_0_15)
1202        data |= s23_c417_16_r(space, offset*2+1, mem_mask);
1203    return data;
1204}
1205
1206static WRITE32_HANDLER(s23_c417_32_w)
1207{
1208    if (ACCESSING_BITS_16_31)
1209        s23_c417_16_w(space, offset*2, data >> 16, mem_mask >> 16);
1210    if (ACCESSING_BITS_0_15)
1211        s23_c417_16_w(space, offset*2+1, data, mem_mask);
1212}
1213
12141325static READ16_HANDLER(s23_c412_ram_r)
12151326{
12161327   //  logerror("c412_ram_r %06x (%08x, %08x)\n", offset, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
r7553r7554
12391350      COMBINE_DATA(c412_pczram  + (offset & 0x001ff));
12401351}
12411352
1242static READ16_HANDLER(s23_c412_16_r)
1353static READ16_HANDLER(s23_c412_r)
12431354{
12441355   switch(offset) {
12451356   case 8: return c412_adr;
r7553r7554
12471358   case 10: return s23_c412_ram_r(space, c412_adr, mem_mask);
12481359   }
12491360
1250   logerror("c412_16_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1361   logerror("c412_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
12511362   return 0;
12521363}
12531364
1254static WRITE16_HANDLER(s23_c412_16_w)
1365static WRITE16_HANDLER(s23_c412_w)
12551366{
12561367    switch(offset) {
12571368   case 8: c412_adr = (data & mem_mask) | (c412_adr & (0xffffffff ^ mem_mask)); break;
12581369   case 9: c412_adr = ((data & mem_mask) << 16) | (c412_adr & (0xffffffff ^ (mem_mask << 16))); break;
12591370   case 10: s23_c412_ram_w(space, c412_adr, data, mem_mask); break;
12601371    default:
1261        logerror("c412_16_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1372        logerror("c412_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
12621373        break;
12631374    }
12641375}
12651376
1266static READ32_HANDLER(s23_c412_32_r)
1267{
1268    UINT32 data = 0;
1269    if (ACCESSING_BITS_16_31)
1270        data |= s23_c412_16_r(space, offset*2, mem_mask >> 16) << 16;
1271    if (ACCESSING_BITS_0_15)
1272        data |= s23_c412_16_r(space, offset*2+1, mem_mask);
1273    return data;
1274}
1275
1276static WRITE32_HANDLER(s23_c412_32_w)
1277{
1278    if (ACCESSING_BITS_16_31)
1279        s23_c412_16_w(space, offset*2, data >> 16, mem_mask >> 16);
1280    if (ACCESSING_BITS_0_15)
1281        s23_c412_16_w(space, offset*2+1, data, mem_mask);
1282}
1283
1284
12851377static READ16_HANDLER(s23_c421_ram_r)
12861378{
12871379   //  logerror("c421_ram_r %06x (%08x, %08x)\n", offset, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
r7553r7554
13061398      COMBINE_DATA(c421_sram   + (offset & 0x07fff));
13071399}
13081400
1309static READ16_HANDLER(s23_c421_16_r)
1401static READ16_HANDLER(s23_c421_r)
13101402{
13111403   switch(offset) {
13121404   case 0: return s23_c421_ram_r(space, c421_adr & 0xfffff, mem_mask);
r7553r7554
13141406   case 3: return c421_adr;
13151407   }
13161408
1317   logerror("c421_16_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1409   logerror("c421_r %x @ %04x (%08x, %08x)\n", offset, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
13181410   return 0;
13191411}
13201412
1321static WRITE16_HANDLER(s23_c421_16_w)
1413static WRITE16_HANDLER(s23_c421_w)
13221414{
13231415    switch(offset) {
13241416   case 0: s23_c421_ram_w(space, c421_adr & 0xfffff, data, mem_mask); break;
13251417   case 2: c421_adr = ((data & mem_mask) << 16) | (c421_adr & (0xffffffff ^ (mem_mask << 16))); break;
13261418   case 3: c421_adr = (data & mem_mask) | (c421_adr & (0xffffffff ^ mem_mask)); break;
13271419    default:
1328        logerror("c421_16_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1420        logerror("c421_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
13291421        break;
13301422    }
13311423}
13321424
1333static READ32_HANDLER(s23_c421_32_r)
1425static WRITE16_HANDLER(s23_ctl_w)
13341426{
1335    UINT32 data = 0;
1336    if (ACCESSING_BITS_16_31)
1337        data |= s23_c421_16_r(space, offset*2, mem_mask >> 16) << 16;
1338    if (ACCESSING_BITS_0_15)
1339        data |= s23_c421_16_r(space, offset*2+1, mem_mask);
1340    return data;
1341}
1342
1343static WRITE32_HANDLER(s23_c421_32_w)
1344{
1345    if (ACCESSING_BITS_16_31)
1346        s23_c421_16_w(space, offset*2, data >> 16, mem_mask >> 16);
1347    if (ACCESSING_BITS_0_15)
1348        s23_c421_16_w(space, offset*2+1, data, mem_mask);
1349}
1350
1351static WRITE16_HANDLER(s23_ctl_16_w)
1352{
13531427   switch(offset) {
13541428   case 0: {
13551429      if(ctl_led != (data & 0xff)) {
13561430         ctl_led = data;
1357         logerror("LEDS %c%c%c%c%c%c%c%c\n",
1358                ctl_led & 0x80 ? '.' : '#',
1359                ctl_led & 0x40 ? '.' : '#',
1360                ctl_led & 0x20 ? '.' : '#',
1361                ctl_led & 0x10 ? '.' : '#',
1362                ctl_led & 0x08 ? '.' : '#',
1363                ctl_led & 0x04 ? '.' : '#',
1364                ctl_led & 0x02 ? '.' : '#',
1365                ctl_led & 0x01 ? '.' : '#');
1431/*          logerror("LEDS %c%c%c%c%c%c%c%c\n",
1432                     ctl_led & 0x80 ? '.' : '#',
1433                     ctl_led & 0x40 ? '.' : '#',
1434                     ctl_led & 0x20 ? '.' : '#',
1435                     ctl_led & 0x10 ? '.' : '#',
1436                     ctl_led & 0x08 ? '.' : '#',
1437                     ctl_led & 0x04 ? '.' : '#',
1438                     ctl_led & 0x02 ? '.' : '#',
1439                     ctl_led & 0x01 ? '.' : '#');*/
13661440      }
13671441      break;
13681442   }
r7553r7554
13781452      }
13791453      break;
13801454
1455   case 6:   // gmen wars spams this heavily with 0 prior to starting the GMEN board test
1456      if (data != 0)
1457         logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1458      break;
1459
13811460   default:
13821461      logerror("ctl_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
13831462   }
13841463}
13851464
1386static READ16_HANDLER(s23_ctl_16_r)
1465static READ16_HANDLER(s23_ctl_r)
13871466{
13881467   switch(offset) {
1389      // dips ?
1390      // 0100 set freezes gorgon
1391      // 0080 is service mode for gorgon
1392      // 0004 unset freezes ss23 at the boot level
1393      // 0002 unset skips the post on ss23
1394   case 1: return 0x0004;
1468      // 0100 set freezes gorgon (polygon fifo flag)
1469   case 1: return 0x0000 | input_port_read(space->machine, "DSW");
13951470   case 2: case 3: {
13961471      UINT16 res = ctl_inp_buffer[offset-2] & 0x800 ? 0xffff : 0x0000;
13971472      ctl_inp_buffer[offset-2] = (ctl_inp_buffer[offset-2] << 1) | 1;
r7553r7554
14021477   return 0xffff;
14031478}
14041479
1405static WRITE32_HANDLER(s23_ctl_32_w)
1480static WRITE16_HANDLER(s23_c361_w)
14061481{
1407    if (ACCESSING_BITS_16_31)
1408        s23_ctl_16_w(space, offset*2, data >> 16, mem_mask >> 16);
1409    if (ACCESSING_BITS_0_15)
1410        s23_ctl_16_w(space, offset*2+1, data, mem_mask);
1411}
1482   switch(offset) {
1483   case 4:   // interrupt control
1484      if (data == 0xc8)
1485      {
1486         logerror("c361_w: raise IRQ 1\n");
1487         cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, ASSERT_LINE);
1488      }
1489      else if (data == 0x1ff)
1490      {
1491         logerror("c361_w: ack IRQ 1\n");
1492         cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, CLEAR_LINE);
1493      }
1494      else
1495      {
1496         logerror("c361_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
1497      }
1498      break;
14121499
1413static READ32_HANDLER(s23_ctl_32_r)
1414{
1415    UINT32 data = 0;
1416    if (ACCESSING_BITS_16_31)
1417        data |= s23_ctl_16_r(space, offset*2, mem_mask >> 16) << 16;
1418    if (ACCESSING_BITS_0_15)
1419        data |= s23_ctl_16_r(space, offset*2+1, mem_mask);
1420    return data;
1421}
1422
1423
1424static WRITE16_HANDLER(s23_c361_16_w)
1425{
1426   switch(offset) {
14271500   default:
14281501      logerror("c361_w %x, %04x @ %04x (%08x, %08x)\n", offset, data, mem_mask, cpu_get_pc(space->cpu), (unsigned int)cpu_get_reg(space->cpu, MIPS3_R31));
14291502   }
14301503}
14311504
1432static READ16_HANDLER(s23_c361_16_r)
1505static READ16_HANDLER(s23_c361_r)
14331506{
14341507   switch(offset) {
14351508   case 5: return video_screen_get_vpos(space->machine->primary_screen);
r7553r7554
14391512   return 0xffff;
14401513}
14411514
1442static WRITE32_HANDLER(s23_c361_32_w)
1515static READ16_HANDLER(s23_c422_r)
14431516{
1444    if (ACCESSING_BITS_16_31)
1445        s23_c361_16_w(space, offset*2, data >> 16, mem_mask >> 16);
1446    if (ACCESSING_BITS_0_15)
1447        s23_c361_16_w(space, offset*2+1, data, mem_mask);
1517   return s23_c422_regs[offset];;
14481518}
14491519
1450static READ32_HANDLER(s23_c361_32_r)
1520static WRITE16_HANDLER(s23_c422_w)
14511521{
1452    UINT32 data = 0;
1453    if (ACCESSING_BITS_16_31)
1454        data |= s23_c361_16_r(space, offset*2, mem_mask >> 16) << 16;
1455    if (ACCESSING_BITS_0_15)
1456        data |= s23_c361_16_r(space, offset*2+1, mem_mask);
1457    return data;
1522   switch (offset)
1523   {
1524      case 1:
1525         if (data == 0xfffb)
1526         {
1527            logerror("c422_w: raise IRQ 3\n");
1528            cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ3, ASSERT_LINE);
1529         }
1530         else if (data == 0x000f)
1531         {
1532            logerror("c422_w: ack IRQ 3\n");
1533            cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ3, CLEAR_LINE);
1534         }
1535         break;
1536
1537      default:
1538         logerror("c422_w: %04x @ %x\n", data, offset);
1539         break;
1540
1541   }
1542
1543   COMBINE_DATA(&s23_c422_regs[offset]);
14581544}
14591545
14601546static INTERRUPT_GEN(s23_interrupt)
r7553r7554
14751561      if (data)
14761562      {
14771563         logerror("S23: booting H8/3002\n");
1564
1565         // Panic Park: writing 1 when it's already running means reboot?
1566         if (s23_subcpu_running)
1567         {
1568            cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
1569         }
1570
14781571         cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
1572         s23_subcpu_running = 1;
14791573      }
14801574      else
14811575      {
14821576         logerror("S23: stopping H8/3002\n");
14831577         cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
1578         s23_subcpu_running = 0;
14841579      }
14851580   }
14861581}
r7553r7554
15131608   }
15141609}
15151610
1611// Panic Park sits in a tight loop waiting for this AND 0002 to be non-zero (at PC=BFC02F00)
1612static READ32_HANDLER( s23_unk_status_r )
1613{
1614   return 0x00020002;
1615}
1616
15161617static ADDRESS_MAP_START( gorgon_map, ADDRESS_SPACE_PROGRAM, 32 )
15171618   AM_RANGE(0x00000000, 0x003fffff) AM_RAM
15181619   AM_RANGE(0x01000000, 0x010000ff) AM_READ( gorgon_magic_r )
1519   AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE( s23_c417_32_r, s23_c417_32_w )
1620   AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE16( s23_c417_r, s23_c417_w, 0xffffffff )
15201621   AM_RANGE(0x04400000, 0x0440ffff) AM_READWRITE( gorgon_sharedram_r, gorgon_sharedram_w ) AM_BASE(&namcos23_shared_ram)
15211622
15221623   AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE( s23_mcuen_w )
r7553r7554
15251626   AM_RANGE(0x06080000, 0x06081fff) AM_RAM
15261627
15271628   AM_RANGE(0x06108000, 0x061087ff) AM_RAM      // GAMMA (C404-3S)
1528   AM_RANGE(0x06110000, 0x0613ffff) AM_READWRITE(namcos23_paletteram_r, namcos23_paletteram_w) AM_BASE_GENERIC(paletteram)
1529   AM_RANGE(0x06400000, 0x06403fff) AM_READWRITE( s23_txtchar_r, s23_txtchar_w ) AM_BASE(&namcos23_charram)   // text layer characters
1629   AM_RANGE(0x06110000, 0x0613ffff) AM_RAM_WRITE( namcos23_paletteram_w ) AM_BASE_GENERIC(paletteram)
1630   AM_RANGE(0x06400000, 0x06403fff) AM_RAM_WRITE( s23_txtchar_w ) AM_BASE(&namcos23_charram)   // text layer characters
15301631   AM_RANGE(0x06404000, 0x0641dfff) AM_RAM
1531   AM_RANGE(0x0641e000, 0x0641ffff) AM_READWRITE(namcos23_textram_r, namcos23_textram_w) AM_BASE(&namcos23_textram)
1632   AM_RANGE(0x0641e000, 0x0641ffff) AM_RAM_WRITE( namcos23_textram_w ) AM_BASE(&namcos23_textram)
15321633
15331634   AM_RANGE(0x08000000, 0x087fffff) AM_ROM AM_REGION("data", 0)   // data ROMs
15341635
15351636   AM_RANGE(0x0c000000, 0x0c00ffff) AM_RAM   AM_BASE_SIZE_GENERIC(nvram) // BACKUP
15361637
1537   AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE (s23_ctl_32_r, s23_ctl_32_w ) // write for LEDs at d000000, watchdog at d000004
1638   AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE16( s23_ctl_r, s23_ctl_w, 0xffffffff ) // write for LEDs at d000000, watchdog at d000004
15381639
1640   AM_RANGE(0x0f000000, 0x0f000003) AM_READ( s23_unk_status_r )
1641
15391642   AM_RANGE(0x0f200000, 0x0f201fff) AM_RAM
15401643
15411644   AM_RANGE(0x0fc00000, 0x0fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0)
r7553r7554
15451648static ADDRESS_MAP_START( ss23_map, ADDRESS_SPACE_PROGRAM, 32 )
15461649   AM_RANGE(0x00000000, 0x003fffff) AM_RAM
15471650   AM_RANGE(0x01000000, 0x010000ff) AM_READ( gorgon_magic_r )
1548   AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE( s23_c417_32_r, s23_c417_32_w )
1651   AM_RANGE(0x02000000, 0x0200000f) AM_READWRITE16( s23_c417_r, s23_c417_w, 0xffffffff )
15491652   AM_RANGE(0x04400000, 0x0440ffff) AM_RAM AM_BASE(&namcos23_shared_ram)
15501653   AM_RANGE(0x04c3ff08, 0x04c3ff0b) AM_WRITE( s23_mcuen_w )
15511654   AM_RANGE(0x04c3ff0c, 0x04c3ff0f) AM_RAM            // 3d FIFO
15521655   AM_RANGE(0x06000000, 0x0600ffff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) // Backup
15531656   AM_RANGE(0x06200000, 0x06203fff) AM_RAM                             // C422
1554   AM_RANGE(0x06800000, 0x06807fff) AM_READWRITE( s23_txtchar_r, s23_txtchar_w ) AM_BASE(&namcos23_charram)   // text layer characters (shown as CGRAM in POST)
1657   AM_RANGE(0x06400000, 0x0640000f) AM_READWRITE16( s23_c422_r, s23_c422_w, 0xffffffff )   // C422 registers
1658   AM_RANGE(0x06800000, 0x06807fff) AM_RAM_WRITE( s23_txtchar_w ) AM_BASE(&namcos23_charram)   // text layer characters (shown as CGRAM in POST)
15551659   AM_RANGE(0x06804000, 0x0681dfff) AM_RAM
1556   AM_RANGE(0x0681e000, 0x0681ffff) AM_READWRITE(namcos23_textram_r, namcos23_textram_w) AM_BASE(&namcos23_textram)
1557   AM_RANGE(0x06820000, 0x0682000f) AM_READWRITE( s23_c361_32_r, s23_c361_32_w )   // C361
1660   AM_RANGE(0x0681e000, 0x0681ffff) AM_RAM_WRITE( namcos23_textram_w ) AM_BASE(&namcos23_textram)
1661   AM_RANGE(0x06820000, 0x0682000f) AM_READWRITE16( s23_c361_r, s23_c361_w, 0xffffffff )   // C361
15581662   AM_RANGE(0x06a08000, 0x06a0ffff) AM_RAM   // GAMMA (C404)
1559   AM_RANGE(0x06a10000, 0x06a3ffff) AM_READWRITE(namcos23_paletteram_r, namcos23_paletteram_w) AM_BASE_GENERIC(paletteram)
1663   AM_RANGE(0x06a10000, 0x06a3ffff) AM_RAM_WRITE( namcos23_paletteram_w ) AM_BASE_GENERIC(paletteram)
15601664   AM_RANGE(0x08000000, 0x08ffffff) AM_ROM AM_REGION("data", 0x0000000) AM_MIRROR(0x01000000)   // data ROMs
15611665   AM_RANGE(0x0a000000, 0x0affffff) AM_ROM AM_REGION("data", 0x1000000) AM_MIRROR(0x01000000)
1562   AM_RANGE(0x0c000000, 0x0c00001f) AM_READWRITE( s23_c412_32_r, s23_c412_32_w )
1563   AM_RANGE(0x0c400000, 0x0c400007) AM_READWRITE( s23_c421_32_r, s23_c421_32_w )
1564   AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE( s23_ctl_32_r, s23_ctl_32_w )
1666   AM_RANGE(0x0c000000, 0x0c00001f) AM_READWRITE16( s23_c412_r, s23_c412_w, 0xffffffff )
1667   AM_RANGE(0x0c400000, 0x0c400007) AM_READWRITE16( s23_c421_r, s23_c421_w, 0xffffffff )
1668   AM_RANGE(0x0d000000, 0x0d00000f) AM_READWRITE16( s23_ctl_r, s23_ctl_w, 0xffffffff )
1669   AM_RANGE(0x0e800000, 0x0e800003) AM_READ( s23_unk_status_r )
15651670   AM_RANGE(0x0fc00000, 0x0fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0)
15661671   AM_RANGE(0x1fc00000, 0x1fffffff) AM_WRITENOP AM_ROM AM_REGION("user1", 0)
15671672ADDRESS_MAP_END
15681673
1674static READ32_HANDLER( gmen_trigger_sh2 )
1675{
1676   logerror("gmen_trigger_sh2: booting SH-2\n");
1677   cputag_set_input_line(space->machine, "gmen", INPUT_LINE_RESET, CLEAR_LINE);
1678
1679   return 0;
1680}
1681
1682static READ32_HANDLER( sh2_shared_r )
1683{
1684   return gmen_sh2_shared[offset];
1685}
1686
1687static WRITE32_HANDLER( sh2_shared_w )
1688{
1689   COMBINE_DATA(&gmen_sh2_shared[offset]);
1690}
1691
1692static ADDRESS_MAP_START( gmen_mips_map, ADDRESS_SPACE_PROGRAM, 32 )
1693   AM_IMPORT_FROM(ss23_map)
1694   AM_RANGE(0x0e400000, 0x0e400003) AM_READ( gmen_trigger_sh2 )
1695   AM_RANGE(0x0e700000, 0x0e707fff) AM_READWRITE( sh2_shared_r, sh2_shared_w )
1696ADDRESS_MAP_END
1697
1698
1699static ADDRESS_MAP_START( gmen_sh2_map, ADDRESS_SPACE_PROGRAM, 32 )
1700   AM_RANGE( 0x00000000, 0x00007fff ) AM_RAM AM_BASE(&gmen_sh2_shared)
1701   AM_RANGE( 0x04000000, 0x043fffff ) AM_RAM   // SH-2 main work RAM
1702ADDRESS_MAP_END
1703
1704static MACHINE_RESET(gmen)
1705{
1706   // halt the SH-2 until we need it
1707   cputag_set_input_line(machine, "gmen", INPUT_LINE_RESET, ASSERT_LINE);
1708}
1709
15691710static WRITE16_HANDLER( sharedram_sub_w )
15701711{
15711712   UINT16 *shared16 = (UINT16 *)namcos23_shared_ram;
r7553r7554
15891730   return shared16[BYTE_XOR_BE(offset)];
15901731}
15911732
1733static WRITE16_HANDLER( sub_interrupt_main_w )
1734{
1735   if  ((mem_mask == 0xffff) && (data == 0x3170))
1736   {
1737      cputag_set_input_line(space->machine, "maincpu", MIPS3_IRQ1, ASSERT_LINE);
1738   }
1739   else
1740   {
1741      logerror("Unknown write %x to sub_interrupt_main_w!\n", data);
1742   }
1743}
1744
15921745/* H8/3002 MCU stuff */
15931746static ADDRESS_MAP_START( s23h8rwmap, ADDRESS_SPACE_PROGRAM, 16 )
15941747   AM_RANGE(0x000000, 0x07ffff) AM_ROM
r7553r7554
15961749   AM_RANGE(0x280000, 0x287fff) AM_DEVREADWRITE( "c352", c352_r, c352_w )
15971750   AM_RANGE(0x300000, 0x300003) AM_NOP   // seems to be more inputs, maybe false leftover code from System 12?
15981751   AM_RANGE(0x300010, 0x300011) AM_NOP
1752   AM_RANGE(0x300020, 0x300021) AM_WRITE( sub_interrupt_main_w )
15991753   AM_RANGE(0x300030, 0x300031) AM_WRITENOP   // timecrs2 writes this when writing to the sync shared ram location, motoxgo doesn't
16001754ADDRESS_MAP_END
16011755
r7553r7554
17471901   cputag_set_input_line(space->machine, "ioboard", H8_SCI_0_RX, ASSERT_LINE);
17481902}
17491903
1904static INPUT_PORTS_START( gorgon )
1905   PORT_START("H8PORT")
1906
1907   // No idea if start is actually there, but we need buttons to pass error screens
1908   PORT_START("P1")
1909   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START1 )
1910   PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN )
1911
1912   PORT_START("P2")
1913   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START2 )
1914   PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN )
1915
1916   PORT_START("RRP0")
1917   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1 )
1918   PORT_BIT(0xef, IP_ACTIVE_LOW, IPT_UNKNOWN )
1919
1920   PORT_START("RRP1")
1921   PORT_BIT(0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
1922
1923   PORT_START("RRP2")
1924   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1 )
1925   PORT_BIT(0xf7, IP_ACTIVE_LOW, IPT_UNKNOWN )
1926
1927   PORT_START("RRP3")
1928   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
1929   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1930   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
1931   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_BUTTON4 )
1932   PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
1933
1934   PORT_START("DSW")
1935   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
1936   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1937   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1938   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
1939   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1940   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1941   PORT_DIPNAME( 0x04, 0x04, "Freeze?" )
1942   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1943   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1944   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1945   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1946   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1947   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
1948   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1949   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1950   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1951   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1952   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1953   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1954   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1955   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1956   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Service_Mode ) )
1957   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1958   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1959INPUT_PORTS_END
1960
1961static INPUT_PORTS_START( s23 )
1962   PORT_START("H8PORT")
1963
1964   // No idea if start is actually there, but we need buttons to pass error screens
1965   PORT_START("P1")
1966   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START1 )
1967   PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN )
1968
1969   PORT_START("P2")
1970   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_START2 )
1971   PORT_BIT( 0xffe, IP_ACTIVE_LOW, IPT_UNKNOWN )
1972
1973   PORT_START("TC2P0")
1974   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1975   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
1976   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )   // this is the "coin acceptor connected" signal
1977   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1978   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
1979   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
1980   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
1981   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON3 )
1982
1983   PORT_START("TC2P1")
1984   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )   // gun trigger
1985   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )   // foot pedal
1986   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
1987
1988   PORT_START("DSW")
1989   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Service_Mode ) )
1990   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1991   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1992   PORT_DIPNAME( 0x02, 0x02, "Skip POST" )
1993   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1994   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1995   PORT_DIPNAME( 0x04, 0x04, "Freeze?" )
1996   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1997   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1998   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
1999   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2000   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2001   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
2002   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2003   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2004   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
2005   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2006   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2007   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2008   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2009   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2010   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
2011   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2012   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2013INPUT_PORTS_END
2014
17502015static INPUT_PORTS_START( ss23 )
17512016   PORT_START("H8PORT")
17522017
r7553r7554
17732038   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )   // gun trigger
17742039   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )   // foot pedal
17752040   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
2041
2042   PORT_START("DSW")
2043   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Service_Mode ) )
2044   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2045   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2046   PORT_DIPNAME( 0x02, 0x02, "Skip POST" )
2047   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2048   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2049   PORT_DIPNAME( 0x04, 0x04, "Freeze?" )
2050   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2051   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2052   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
2053   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2054   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2055   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
2056   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2057   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2058   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
2059   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2060   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2061   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2062   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2063   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2064   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
2065   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2066   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17762067INPUT_PORTS_END
17772068
17782069
r7553r7554
18032094ADDRESS_MAP_END
18042095
18052096// version without serial hookup to I/O board for games where the PIC isn't dumped
1806static ADDRESS_MAP_START( s23h8ionoiobmap, ADDRESS_SPACE_IO, 8 )
2097static ADDRESS_MAP_START( s23h8noiobmap, ADDRESS_SPACE_IO, 8 )
2098   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE( s23_mcu_p6_r, s23_mcu_p6_w )
18072099   AM_RANGE(H8_PORT_7, H8_PORT_7) AM_READ_PORT( "H8PORT" )
18082100   AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ( s23_mcu_p8_r ) AM_WRITENOP
18092101   AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE( s23_mcu_pa_r, s23_mcu_pa_w )
r7553r7554
18642156   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("TC2P0")     // 0-1 = coin 0-3 = coin connect, 0-5 = test 0-6 = down select, 0-7 = up select, 0-8 = enter
18652157   AM_RANGE(0x6001, 0x6001) AM_READ_PORT("TC2P1")     // 1-1 = gun trigger 1-2 = foot pedal
18662158   AM_RANGE(0x6002, 0x6003) AM_READ( iob_r )
2159   AM_RANGE(0x6004, 0x6005) AM_WRITENOP
2160   AM_RANGE(0x6006, 0x6007) AM_NOP
18672161   AM_RANGE(0x7000, 0x700f) AM_READ( iob_r )
18682162
18692163   AM_RANGE(0xc000, 0xf7ff) AM_RAM
18702164ADDRESS_MAP_END
18712165
2166// gorgon map
2167static ADDRESS_MAP_START( gorgoniobrdmap, ADDRESS_SPACE_PROGRAM, 8 )
2168   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("ioboard", 0)
2169   AM_RANGE(0x6000, 0x6000) AM_READ_PORT("RRP0")     // 0-5 = start
2170   AM_RANGE(0x6001, 0x6001) AM_READ_PORT("RRP1")     //
2171   AM_RANGE(0x6002, 0x6002) AM_READ_PORT("RRP2")     // 0-4 = coin
2172   AM_RANGE(0x6003, 0x6003) AM_READ_PORT("RRP3")     // 1-1 = button?  1-4 = start?
2173   AM_RANGE(0x6004, 0x6005) AM_WRITENOP
2174   AM_RANGE(0x6006, 0x6007) AM_NOP
2175   AM_RANGE(0x7000, 0x700f) AM_READ( iob_r )
2176
2177   AM_RANGE(0xc000, 0xf7ff) AM_RAM
2178ADDRESS_MAP_END
2179
18722180/*
18732181    port 5 bit 2 = LED to indicate transmitting packet to main
18742182    port 4 bit 2 = SENSE line back to main (0 = asserted, 1 = dropped)
r7553r7554
18772185   AM_RANGE(H8_PORT_4, H8_PORT_4) AM_READWRITE( s23_iob_p4_r, s23_iob_p4_w )
18782186   AM_RANGE(H8_PORT_5, H8_PORT_5) AM_NOP   // status LED in bit 2
18792187   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_NOP   // unknown
2188   AM_RANGE(H8_PORT_8, H8_PORT_8) AM_NOP   // unknown - used on ASCA-5 only
2189   AM_RANGE(H8_PORT_9, H8_PORT_9) AM_NOP   // unknown - used on ASCA-5 only
18802190   AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE( s23_iob_mcu_r, s23_iob_mcu_w )
2191   AM_RANGE(H8_ADC_0_H, H8_ADC_3_L) AM_NOP
18812192ADDRESS_MAP_END
18822193
18832194static DRIVER_INIT(ss23)
r7553r7554
18912202   memset(s23_settings, 0, sizeof(s23_settings));
18922203   s23_tssio_port_4 = 0;
18932204   s23_porta = 0, s23_rtcstate = 0;
2205   s23_subcpu_running = 1;
18942206
18952207   if ((!strcmp(machine->gamedrv->name, "motoxgo")) ||
18962208       (!strcmp(machine->gamedrv->name, "panicprk")) ||
18972209       (!strcmp(machine->gamedrv->name, "rapidrvr")) ||
18982210       (!strcmp(machine->gamedrv->name, "finlflng")) ||
2211       (!strcmp(machine->gamedrv->name, "gunwars")) ||
2212       (!strcmp(machine->gamedrv->name, "finfurl2")) ||
2213       (!strcmp(machine->gamedrv->name, "finfurl2j")) ||
2214       (!strcmp(machine->gamedrv->name, "timecrs2b")) ||
18992215       (!strcmp(machine->gamedrv->name, "timecrs2")))
19002216   {
19012217      has_jvsio = 1;
r7553r7554
19202236   64*16
19212237}; /* cg_layout */
19222238
1923#if 0
1924static const gfx_layout sprite_layout =
1925{
1926   32,32,
1927   RGN_FRAC(1,1),
1928   8,
1929   { 0,1,2,3,4,5,6,7 },
1930   {
1931      0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,
1932      8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8,
1933      16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8,
1934      24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 },
1935   {
1936      0*32*8,1*32*8,2*32*8,3*32*8,4*32*8,5*32*8,6*32*8,7*32*8,
1937      8*32*8,9*32*8,10*32*8,11*32*8,12*32*8,13*32*8,14*32*8,15*32*8,
1938      16*32*8,17*32*8,18*32*8,19*32*8,20*32*8,21*32*8,22*32*8,23*32*8,
1939      24*32*8,25*32*8,26*32*8,27*32*8,28*32*8,29*32*8,30*32*8,31*32*8 },
1940   32*32*8
1941};
1942#endif
1943
19442239static GFXDECODE_START( namcos23 )
19452240   GFXDECODE_ENTRY( NULL, 0, namcos23_cg_layout, 0x7f00, 0x80 )
19462241GFXDECODE_END
r7553r7554
19652260   MDRV_CPU_VBLANK_INT("screen", irq1_line_pulse)
19662261
19672262   MDRV_CPU_ADD("ioboard", H83334, 14745600 )
1968   MDRV_CPU_PROGRAM_MAP( s23iobrdmap )
2263   MDRV_CPU_PROGRAM_MAP( gorgoniobrdmap )
19692264   MDRV_CPU_IO_MAP( s23iobrdiomap )
19702265
19712266   MDRV_QUANTUM_TIME(HZ(60000))
r7553r7554
19972292MACHINE_DRIVER_END
19982293
19992294static MACHINE_DRIVER_START( s23 )
2000
20012295   /* basic machine hardware */
20022296   MDRV_CPU_ADD("maincpu", R4650BE, S23_BUSCLOCK*4)
20032297   MDRV_CPU_CONFIG(config)
r7553r7554
20422336MACHINE_DRIVER_END
20432337
20442338static MACHINE_DRIVER_START( ss23 )
2045
20462339   /* basic machine hardware */
20472340   MDRV_CPU_ADD("maincpu", R4650BE, S23_BUSCLOCK*5)
20482341   MDRV_CPU_CONFIG(config)
r7553r7554
20512344
20522345   MDRV_CPU_ADD("audiocpu", H83002, 14745600 )
20532346   MDRV_CPU_PROGRAM_MAP( s23h8rwmap )
2054   MDRV_CPU_IO_MAP( s23h8ionoiobmap )
2347   MDRV_CPU_IO_MAP( s23h8noiobmap )
20552348   MDRV_CPU_VBLANK_INT("screen", irq1_line_pulse)
20562349
2057   MDRV_QUANTUM_TIME(HZ(60*40000))
2350   MDRV_QUANTUM_TIME(HZ(60*18000))   // higher than 60*20000 causes timecrs2 crash after power-on test $1e
20582351
20592352   MDRV_SCREEN_ADD("screen", RASTER)
20602353   MDRV_SCREEN_REFRESH_RATE(S23_VSYNC1)
r7553r7554
20822375   MDRV_SOUND_ROUTE(3, "lspeaker", 1.00)
20832376MACHINE_DRIVER_END
20842377
2378static MACHINE_DRIVER_START( ss23io )
2379   MDRV_IMPORT_FROM( ss23 )
2380
2381   MDRV_CPU_MODIFY("audiocpu")
2382   MDRV_CPU_IO_MAP( s23h8iomap )
2383
2384   MDRV_CPU_ADD("ioboard", H83334, 14745600 )
2385   MDRV_CPU_PROGRAM_MAP( s23iobrdmap )
2386   MDRV_CPU_IO_MAP( s23iobrdiomap )
2387MACHINE_DRIVER_END
2388
2389static MACHINE_DRIVER_START( gmen )
2390   MDRV_IMPORT_FROM( s23 )
2391
2392   MDRV_CPU_REPLACE("maincpu", R4650BE, S23_BUSCLOCK*5)
2393   MDRV_CPU_PROGRAM_MAP(gmen_mips_map)
2394
2395   MDRV_CPU_ADD("gmen", SH2, 28700000)
2396   MDRV_CPU_PROGRAM_MAP(gmen_sh2_map)
2397
2398   MDRV_MACHINE_RESET(gmen)
2399MACHINE_DRIVER_END
2400
20852401ROM_START( rapidrvr )
20862402   ROM_REGION32_BE( 0x400000, "user1", 0 ) /* 4 megs for main R4650 code */
20872403        ROM_LOAD16_BYTE( "rd3verc.ic2",  0x000000, 0x200000, CRC(c15c0f30) SHA1(9f529232818f3e184f81f62408a5cad615b05613) )
r7553r7554
23782694
23792695   ROM_REGION32_BE( 0x2000000, "data", 0 )   /* data roms */
23802696        ROM_LOAD16_BYTE( "5gp1mtah.2j",  0x0000000, 0x800000, CRC(246e4b7a) SHA1(75743294b8f48bffb84f062febfbc02230d49ce9) )
2381      ROM_LOAD16_BYTE( "5gp1mtal.2h",  0x0000001, 0x800000, CRC(1bb00c7b) SHA1(922be45d57330c31853b2dc1642c589952b09188) )
2697   ROM_LOAD16_BYTE( "5gp1mtal.2h",  0x0000001, 0x800000, CRC(1bb00c7b) SHA1(922be45d57330c31853b2dc1642c589952b09188) )
23822698
23832699      /* COMMON FUJII YASUI WAKAO KURE INOUE
23842700         * 0x000000..0x57ffff: all 0xff
r7553r7554
24192735   ROM_REGION( 0x80000, "audiocpu", 0 )   /* Hitachi H8/3002 MCU code */
24202736        ROM_LOAD16_WORD_SWAP( "m29f400.ic3",  0x000000, 0x080000, CRC(9fd69bbd) SHA1(53a9bf505de70495dcccc43fdc722b3381aad97c) )
24212737
2738   ROM_REGION( 0x40000, "ioboard", 0 )   /* I/O board HD643334 H8/3334 MCU code */
2739        ROM_LOAD( "asca-3a.ic14", 0x000000, 0x040000, CRC(8e9266e5) SHA1(ffa8782ca641d71d57df23ed1c5911db05d3df97) )
2740
24222741   ROM_REGION32_BE( 0x2000000, "data", 0 )   /* data roms */
24232742        ROM_LOAD16_BYTE( "ffs1mtah.2j",  0x0000000, 0x800000, CRC(f336d81d) SHA1(a9177091e1412dea1b6ea6c53530ae31361b32d0) )
24242743        ROM_LOAD16_BYTE( "ffs1mtal.2h",  0x0000001, 0x800000, CRC(98730ad5) SHA1(9ba276ad88ec8730edbacab80cdacc34a99593e4) )
r7553r7554
24582777   ROM_REGION( 0x80000, "audiocpu", 0 )   /* Hitachi H8/3002 MCU code */
24592778        ROM_LOAD16_WORD_SWAP( "m29f400.ic3",  0x000000, 0x080000, CRC(9fd69bbd) SHA1(53a9bf505de70495dcccc43fdc722b3381aad97c) )
24602779
2780   ROM_REGION( 0x40000, "ioboard", 0 )   /* I/O board HD643334 H8/3334 MCU code */
2781        ROM_LOAD( "asca-3a.ic14", 0x000000, 0x040000, CRC(8e9266e5) SHA1(ffa8782ca641d71d57df23ed1c5911db05d3df97) )
2782
24612783   ROM_REGION32_BE( 0x2000000, "data", 0 )   /* data roms */
24622784        ROM_LOAD16_BYTE( "ffs1mtah.2j",  0x0000000, 0x800000, CRC(f336d81d) SHA1(a9177091e1412dea1b6ea6c53530ae31361b32d0) )
24632785        ROM_LOAD16_BYTE( "ffs1mtal.2h",  0x0000001, 0x800000, CRC(98730ad5) SHA1(9ba276ad88ec8730edbacab80cdacc34a99593e4) )
r7553r7554
25052827        ROM_LOAD16_BYTE( "pnp1mtal.2h",  0x000001, 0x800000, CRC(6490faaa) SHA1(03443746009b434e5d4074ea6314910418907360) )
25062828
25072829   ROM_REGION( 0x4000000, "textile", 0 )   /* texture tiles */
2508        ROM_LOAD( "pnp1cguu.5f",  0x000000, 0x800000, CRC(cd64f57f) SHA1(8780270298e0823db1acbbf79396788df0c3c19c) )
2509        ROM_LOAD( "pnp1cgum.4j",  0x800000, 0x800000, CRC(206217ca) SHA1(9c095bba7764f3405c3fab10513b9b78981ec44d) )
2830        ROM_LOAD( "pnp1cguu.5f",  0x0000000, 0x800000, CRC(cd64f57f) SHA1(8780270298e0823db1acbbf79396788df0c3c19c) )
2831        ROM_LOAD( "pnp1cgum.4j",  0x0800000, 0x800000, CRC(206217ca) SHA1(9c095bba7764f3405c3fab10513b9b78981ec44d) )
25102832        ROM_LOAD( "pnp1cgll.4m",  0x1000000, 0x800000, CRC(d03932cf) SHA1(49240e44923cc6e815e9457b6290fd18466658af) )
2511        ROM_LOAD( "pnp1cglm.5k",  0x180000, 0x800000, CRC(abf4ccf2) SHA1(3848e26d0ba6c872bbc6d5e0eb23a9d4b34152d5) )
2833        ROM_LOAD( "pnp1cglm.5k",  0x1800000, 0x800000, CRC(abf4ccf2) SHA1(3848e26d0ba6c872bbc6d5e0eb23a9d4b34152d5) )
25122834        ROM_LOAD( "pnp1cguu.4f",  0x2000000, 0x800000, CRC(cd64f57f) SHA1(8780270298e0823db1acbbf79396788df0c3c19c) )
25132835        ROM_LOAD( "pnp1cgum.5j",  0x2800000, 0x800000, CRC(206217ca) SHA1(9c095bba7764f3405c3fab10513b9b78981ec44d) )
25142836        ROM_LOAD( "pnp1cgll.5m",  0x3000000, 0x800000, CRC(d03932cf) SHA1(49240e44923cc6e815e9457b6290fd18466658af) )
r7553r7554
25312853        ROM_LOAD( "pnp1waveh.2a", 0x800000, 0x800000, CRC(6fa1826a) SHA1(20a5af49e65ae2bc57c016b5cd9bafa5a5220d35) )
25322854ROM_END
25332855
2856ROM_START( gunwars )
2857   ROM_REGION32_BE( 0x400000, "user1", 0 ) /* 4 megs for main R4650 code */
2858   ROM_LOAD16_BYTE( "gm1vera.ic2",  0x000000, 0x200000, CRC(cf61467f) SHA1(eae79e4e540340cba7d576a36085f802b8032f4f) )
2859   ROM_LOAD16_BYTE( "gm1vera.ic1",  0x000001, 0x200000, CRC(abc9ffe6) SHA1(d833b9b9d8bb0cc4b53f30507c9603df9e63fa2f) )
25342860
2861   ROM_REGION( 0x80000, "audiocpu", 0 )   /* Hitachi H8/3002 MCU code */
2862   ROM_LOAD16_WORD_SWAP( "gm1vera.ic3",  0x000000, 0x080000, CRC(5582fdd4) SHA1(8aae8bc6688d531888f2de509c07502ee355b3ab) )
2863
2864   ROM_REGION( 0x40000, "ioboard", 0 )   /* I/O board HD643334 H8/3334 MCU code. "ASCA-5;Ver 2.09;JPN,Multipurpose" */
2865   ROM_LOAD( "asc5_io-a.ic14", 0x000000, 0x020000, CRC(5964767f) SHA1(320db5e78ae23c5f94e368432d51573b409995db) )
2866
2867   ROM_REGION32_BE( 0x2000000, "data", 0 )   /* data roms */
2868        ROM_LOAD16_BYTE( "gm1mtah.2j",   0x000000, 0x800000, CRC(3cea9094) SHA1(497395425e409de47e1114de9aeeaf05e4f6a9a1) )
2869        ROM_LOAD16_BYTE( "gm1mtal.2h",   0x000001, 0x800000, CRC(d531dfcd) SHA1(9f7cbe9a03c1f7649bf05a7a30d47511573b50ba) )
2870
2871   ROM_REGION( 0x4000000, "textile", 0 )   /* texture tiles */
2872        ROM_LOAD( "gm1cguu.5f",   0x0000000, 0x800000, CRC(26a74698) SHA1(3f07d273abb3f2552dc6a29300f5dc2f2744c852) )
2873        ROM_LOAD( "gm1cgum.4j",   0x0800000, 0x800000, CRC(a7728944) SHA1(c187c6d66128554fcecc96e81d4f5396197e8280) )
2874        ROM_LOAD( "gm1cgll.4m",   0x1000000, 0x800000, CRC(936c0079) SHA1(3aec8caada35b7ed790bb3a8bcf6e01cad068fcd) )
2875        ROM_LOAD( "gm1cglm.4k",   0x1800000, 0x800000, CRC(e2ee5493) SHA1(1ffd74646796ad554d7967ba9fc18deab4fedadf) )
2876
2877   ROM_REGION( 0x4000000, "textile2", 0 )   /* second copy of texture tiles */
2878        ROM_LOAD( "gm1cguu.4f",   0x0000000, 0x800000, CRC(26a74698) SHA1(3f07d273abb3f2552dc6a29300f5dc2f2744c852) )
2879        ROM_LOAD( "gm1cgum.5j",   0x0800000, 0x800000, CRC(a7728944) SHA1(c187c6d66128554fcecc96e81d4f5396197e8280) )
2880        ROM_LOAD( "gm1cgll.5m",   0x1000000, 0x800000, CRC(936c0079) SHA1(3aec8caada35b7ed790bb3a8bcf6e01cad068fcd) )
2881        ROM_LOAD( "gm1cglm.5k",   0x1800000, 0x800000, CRC(e2ee5493) SHA1(1ffd74646796ad554d7967ba9fc18deab4fedadf) )
2882
2883   ROM_REGION( 0x800000, "textilemap", 0 )   /* texture tilemap */
2884        ROM_LOAD( "gm1ccrl.7f",   0x000000, 0x400000, CRC(2c54c182) SHA1(538dfb04653f8d86f976e702456bf4da97e3fda9) )
2885        ROM_LOAD( "gm1ccrh.7e",   0x400000, 0x200000, CRC(8563ef01) SHA1(59f09a08008a71a4bb12bd43a1b5dbe633d3061d) )
2886
2887   ROM_REGION( 0x800000, "textilemap2", 0 )   /* second copy of texture tilemap */
2888        ROM_LOAD( "gm1ccrl.7m",   0x000000, 0x400000, CRC(2c54c182) SHA1(538dfb04653f8d86f976e702456bf4da97e3fda9) )
2889        ROM_LOAD( "gm1ccrh.7k",   0x400000, 0x200000, CRC(8563ef01) SHA1(59f09a08008a71a4bb12bd43a1b5dbe633d3061d) )
2890
2891   ROM_REGION32_LE( 0x2000000, "pointrom", 0 )   /* 3D model data */
2892        ROM_LOAD32_WORD( "gm1pt0l.7c",   0x000000, 0x400000, CRC(62e9bedb) SHA1(7043c5e6f26139c9e6e18d4f35fac6a16d4dabd1) )
2893        ROM_LOAD32_WORD( "gm1pt0h.7a",   0x000002, 0x400000, CRC(5ebd658c) SHA1(9e7b89a726b11b6da3327d72ec6adcc30fbb384d) )
2894        ROM_LOAD32_WORD( "gm1pt1l.5c",   0x800000, 0x400000, CRC(f44c149f) SHA1(9f995de02ea6ac35ccbabbba5bb473a10e1ec667) )
2895        ROM_LOAD32_WORD( "gm1pt1h.5a",   0x800002, 0x400000, CRC(5f6cebab) SHA1(95bd30d30ea25509b66a107fb255d0af1e6a357e) )
2896
2897   ROM_REGION( 0x800000, "c352", 0 ) /* C352 PCM samples */
2898        ROM_LOAD( "gm1wave.2c",   0x000000, 0x800000, CRC(7d5c79a4) SHA1(b800a46bcca10cb0d0d9e0acfa68af63ae64dcaf) )
2899ROM_END
2900
25352901/* Games */
2536GAME( 1997, rapidrvr, 0,      gorgon, ss23, ss23, ROT0, "Namco", "Rapid River (RD3 Ver. C)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2537GAME( 1997, finlflng, 0,      gorgon, ss23, ss23, ROT0, "Namco", "Final Furlong (FF2 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2538GAME( 1997, motoxgo,  0,         s23, ss23, ss23, ROT0, "Namco", "Motocross Go! (MG3 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2539GAME( 1997, timecrs2, 0,         s23, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS3 Ver. B)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2540GAME( 1997, timecrs2b,timecrs2,  s23, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS2 Ver. B)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2541GAME( 1997, timecrs2c,timecrs2, ss23, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS4 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2542GAME( 1998, panicprk, 0,         s23, ss23, ss23, ROT0, "Namco", "Panic Park (PNP2 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2543GAME( 1999, 500gp,    0,        ss23, ss23, ss23, ROT0, "Namco", "500GP", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2544GAME( 1999, finfurl2, 0,        ss23, ss23, ss23, ROT0, "Namco", "Final Furlong 2 (World)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2545GAME( 1999, finfurl2j,finfurl2, ss23, ss23, ss23, ROT0, "Namco", "Final Furlong 2 (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2902GAME( 1997, rapidrvr, 0,      gorgon, gorgon, ss23, ROT0, "Namco", "Rapid River (RD3 Ver. C)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2903GAME( 1997, finlflng, 0,      gorgon, gorgon, ss23, ROT0, "Namco", "Final Furlong (FF2 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2904GAME( 1997, motoxgo,  0,         s23,    s23, ss23, ROT0, "Namco", "Motocross Go! (MG3 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2905GAME( 1997, timecrs2, 0,         s23,    s23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS3 Ver. B)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2906GAME( 1997, timecrs2b,timecrs2,  s23,    s23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS2 Ver. B)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2907GAME( 1997, timecrs2c,timecrs2, ss23io, ss23, ss23, ROT0, "Namco", "Time Crisis 2 (TSS4 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2908GAME( 1998, panicprk, 0,         s23,    s23, ss23, ROT0, "Namco", "Panic Park (PNP2 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2909GAME( 1998, gunwars,  0,        gmen,   ss23, ss23, ROT0, "Namco", "Gunmen Wars (GM1 Ver. A)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2910GAME( 1999, 500gp,    0,        ss23,   ss23, ss23, ROT0, "Namco", "500GP", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2911GAME( 1999, finfurl2, 0,        gmen,   ss23, ss23, ROT0, "Namco", "Final Furlong 2 (World)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
2912GAME( 1999, finfurl2j,finfurl2, gmen,   ss23, ss23, ROT0, "Namco", "Final Furlong 2 (Japan)", GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_SOUND )
src/mame/drivers/laserbat.c
r7553r7554
10311031   ROM_LOAD( "catnmous.14l", 0x0000, 0x0800, CRC(af79179a) SHA1(de61af7d02c93be326a33ee51572e3da7a25dab0) )
10321032
10331033   ROM_REGION( 0x0100, "plds", 0 )
1034   ROM_LOAD( "82s100.13m", 0x0000, 0x00f5, NO_DUMP )
1034   ROM_LOAD( "catnmousa_82s100.13m", 0x0000, 0x00f5, NO_DUMP )
10351035ROM_END
10361036
10371037
src/mame/drivers/stv.c
r7553r7554
481481
482482   if (cpu_get_pc(space->cpu)==0x060020E6) return_data = 0x10;//???
483483
484   //if(LOG_SMPC) logerror ("cpu %s (PC=%08X) SMPC: Read from Byte Offset %02x Returns %02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), offset, return_data);
484   //if(LOG_SMPC) logerror ("cpu %s (PC=%08X) SMPC: Read from Byte Offset %02x Returns %02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), offset, return_data);
485485
486486
487487   return return_data;
r7553r7554
705705            smpc_ram[0x21] = (0x80) | ((NMI_reset & 1) << 6);
706706            break;
707707         default:
708            if(LOG_SMPC) logerror ("cpu '%s' (PC=%08X) SMPC: undocumented Command %02x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data);
708            if(LOG_SMPC) logerror ("cpu '%s' (PC=%08X) SMPC: undocumented Command %02x\n", space->cpu->tag(), cpu_get_pc(space->cpu), data);
709709      }
710710
711711      // we've processed the command, clear status flag
r7553r7554
895895         return 0xffffffff;
896896      }
897897      case 0x1c/4:
898      if(LOG_IOGA) logerror("(PC %s=%06x) Warning: READ from PORT_AD\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
898      if(LOG_IOGA) logerror("(PC %s=%06x) Warning: READ from PORT_AD\n", space->cpu->tag(), cpu_get_pc(space->cpu));
899899      popmessage("Read from PORT_AD");
900900      port_i++;
901901      return port_ad[port_i & 7];
r7553r7554
13571357         stv_scu[40] != 0xffffffff)
13581358      {
13591359         if(LOG_SCU) logerror("cpu %s (PC=%08X) IRQ mask reg set %08x = %d%d%d%d|%d%d%d%d|%d%d%d%d|%d%d%d%d\n",
1360         space->cpu->tag.cstr(), cpu_get_pc(space->cpu),
1360         space->cpu->tag(), cpu_get_pc(space->cpu),
13611361         stv_scu[offset],
13621362         stv_scu[offset] & 0x8000 ? 1 : 0, /*A-Bus irq*/
13631363         stv_scu[offset] & 0x4000 ? 1 : 0, /*<reserved>*/
r7553r7554
19651965 * Enter into Radiant Silver Gun specific menu for a test...                       */
19661966static WRITE32_HANDLER( minit_w )
19671967{
1968   logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu),data);
1968   logerror("cpu %s (PC=%08X) MINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data);
19691969   cpuexec_boost_interleave(space->machine, minit_boost_timeslice, ATTOTIME_IN_USEC(minit_boost));
19701970   cpuexec_trigger(space->machine, 1000);
19711971   sh2_set_frt_input(devtag_get_device(space->machine, "slave"), PULSE_LINE);
r7553r7554
19731973
19741974static WRITE32_HANDLER( sinit_w )
19751975{
1976   logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu),data);
1976   logerror("cpu %s (PC=%08X) SINIT write = %08x\n", space->cpu->tag(), cpu_get_pc(space->cpu),data);
19771977   cpuexec_boost_interleave(space->machine, sinit_boost_timeslice, ATTOTIME_IN_USEC(sinit_boost));
19781978   sh2_set_frt_input(devtag_get_device(space->machine, "maincpu"), PULSE_LINE);
19791979}
r7553r7554
23152315{
23162316   COMBINE_DATA(&stv_workram_h[0xffc44/4]);
23172317
2318   logerror("cpu %s (PC=%08X): 60ffc44_write write = %08X & %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, mem_mask);
2318   logerror("cpu %s (PC=%08X): 60ffc44_write write = %08X & %08X\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, mem_mask);
23192319   //sinit_w(offset,data,mem_mask);
23202320}
23212321
r7553r7554
23232323{
23242324   COMBINE_DATA(&stv_workram_h[0xffc48/4]);
23252325
2326   logerror("cpu %s (PC=%08X): 60ffc48_write write = %08X & %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu), data, mem_mask);
2326   logerror("cpu %s (PC=%08X): 60ffc48_write write = %08X & %08X\n", space->cpu->tag(), cpu_get_pc(space->cpu), data, mem_mask);
23272327   //minit_w(offset,data,mem_mask);
23282328}
23292329
r7553r7554
25732573SCU register[40] is for IRQ masking.
25742574*/
25752575
2576/* to do, update bios idle skips so they work better with this arrangement.. */
2576#ifdef UNUSED_FUNCTION
25772577
2578/* theoretical function about how this irq system should work, not yet implemented because the performance speed hits very very badly.
2579   It's not tested much either, but I'm aware that timer 1 doesn't work with this for whatever reason ... */
2580static TIMER_CALLBACK( stv_irq_callback )
2581{
2582   int hpos = video_screen_get_hpos(machine->primary_screen);
2583   int vpos = video_screen_get_vpos(machine->primary_screen);
2584   rectangle visarea = *video_screen_get_visible_area(machine->primary_screen);
2585
2586   h_sync = visarea.max_x+1;//horz
2587   v_sync = visarea.max_y+1;//vert
2588
2589   if(vpos == v_sync && hpos == 0)
2590      VBLANK_IN_IRQ;
2591   if(hpos == 0 && vpos == 0)
2592      VBLANK_OUT_IRQ;
2593   if(hpos == h_sync)
2594      TIMER_0_IRQ;
2595   if(hpos == h_sync && (vpos != 0 && vpos != v_sync))
2596   {
2597      HBLANK_IN_IRQ;
2598      timer_0++;
2599   }
2600
2601   /*TODO: timing of this one (related to the VDP1 speed)*/
2602   /*      (NOTE: value shouldn't be at h_sync/v_sync position (will break shienryu))*/
2603   if(hpos == 40 && vpos == 0)
2604      VDP1_IRQ;
2605
2606   if(hpos == timer_1)
2607      TIMER_1_IRQ;
2608
2609   if(hpos <= h_sync)
2610      timer_adjust_oneshot(scan_timer, video_screen_get_time_until_pos(machine->primary_screen, vpos, hpos+1), 0);
2611   else if(vpos <= v_sync)
2612      timer_adjust_oneshot(scan_timer, video_screen_get_time_until_pos(machine->primary_screen, vpos+1, 0), 0);
2613   else
2614      timer_adjust_oneshot(scan_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
2615}
2616
2617#endif
2618
2619
25782620static running_device *vblank_out_timer,*scan_timer,*t1_timer;
25792621static int h_sync,v_sync;
25802622static int cur_scan;
src/mame/drivers/galdrvr.c
r7553r7554
46764676ROM_START( froggers2 )
46774677   ROM_REGION( 0x10000, "maincpu", 0 )
46784678   ROM_LOAD( "epr-1012.ic5",  0x0000, 0x1000, CRC(efab0c79) SHA1(68c99b6cdcb9396bb473739a62ffc009b4bf57d5) )
4679   ROM_LOAD( "epr-1013.ic6", 0x1000, 0x1000, CRC(aeca9c13) SHA1(cdf560adbd7f2813e86e378da7781cccf7928a44) )
4679   ROM_LOAD( "epr-1013a.ic6", 0x1000, 0x1000, CRC(aeca9c13) SHA1(cdf560adbd7f2813e86e378da7781cccf7928a44) )
46804680   ROM_LOAD( "epr-1014.ic7",  0x2000, 0x1000, CRC(dd251066) SHA1(4612e1fe1ab7182a277140b1a1976cc17e0746a5) )
4681   ROM_LOAD( "epr-1018.ic8",  0x3000, 0x1000, CRC(bf293a02) SHA1(be94e9f5caa74c3de6fd95bd20928f4a9c514227) )
4681   ROM_LOAD( "epr-1015.ic8",  0x3000, 0x1000, CRC(bf293a02) SHA1(be94e9f5caa74c3de6fd95bd20928f4a9c514227) )
46824682
46834683   ROM_REGION( 0x10000, "audiocpu", 0 )
46844684   ROM_LOAD( "epr-608.ic32",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
src/mame/drivers/route16.c
r7553r7554
943943{
944944   if (cpu_get_pc(space->cpu) == 0x2f) return 0xfb;
945945
946   logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
946   logerror ("cpu '%s' (PC=%08X): unmapped prot read\n", space->cpu->tag(), cpu_get_pc(space->cpu));
947947   return 0x00;
948948
949949}
src/mame/drivers/legionna.c
r7553r7554
18471847
18481848ROM_START( cupsoca )
18491849   ROM_REGION( 0x100000, "maincpu", 0 )   /* 68000 code */
1850   ROM_LOAD32_BYTE( "1.bin",   0x000000, 0x040000, CRC(d5f76bd6) SHA1(5e7c3843f6f497a24b8236a9307d347fb24dd0d5) )
1851   ROM_LOAD32_BYTE( "2.bin",   0x000001, 0x040000, CRC(34966aa1) SHA1(f07bca19bd92a60c04aa9b23e5d2d2eac073d2e4) )
1852   ROM_LOAD32_BYTE( "3.bin",   0x000002, 0x040000, CRC(2b7934ec) SHA1(b78e7079e03b23853397a3848c93f60702ac1c33) )
1853   ROM_LOAD32_BYTE( "4.bin",   0x000003, 0x040000, CRC(f4aa1d90) SHA1(eb94efc8cc623434b4c9a22e63d262e80ca84d83) )
1850   ROM_LOAD32_BYTE( "soca_1.bin",   0x000000, 0x040000, CRC(d5f76bd6) SHA1(5e7c3843f6f497a24b8236a9307d347fb24dd0d5) )
1851   ROM_LOAD32_BYTE( "soca_2.bin",   0x000001, 0x040000, CRC(34966aa1) SHA1(f07bca19bd92a60c04aa9b23e5d2d2eac073d2e4) )
1852   ROM_LOAD32_BYTE( "soca_3.bin",   0x000002, 0x040000, CRC(2b7934ec) SHA1(b78e7079e03b23853397a3848c93f60702ac1c33) )
1853   ROM_LOAD32_BYTE( "soca_4.bin",   0x000003, 0x040000, CRC(f4aa1d90) SHA1(eb94efc8cc623434b4c9a22e63d262e80ca84d83) )
18541854
18551855   ROM_REGION( 0x20000, "audiocpu", 0 )   /* Z80 code, banked data */
18561856   ROM_LOAD( "seibu7.8a",    0x000000, 0x08000, CRC(f63329f9) SHA1(51736de48efc14415cfdf169b43623d4c95fde2b) )
r7553r7554
18581858   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
18591859
18601860   ROM_REGION( 0x020000, "gfx1", 0 )
1861   ROM_LOAD16_BYTE( "6.bin",   0x000000, 0x010000, CRC(a9e15910) SHA1(305541b16a87d0e38871240fa2e111bb9332e93c) )
1862   ROM_LOAD16_BYTE( "5.bin",   0x000001, 0x010000, CRC(73a3e024) SHA1(aeb359dd2dc9eb96330f494c44123bab3f5986a4) )
1861   ROM_LOAD16_BYTE( "soca_6.bin",   0x000000, 0x010000, CRC(a9e15910) SHA1(305541b16a87d0e38871240fa2e111bb9332e93c) )
1862   ROM_LOAD16_BYTE( "soca_5.bin",   0x000001, 0x010000, CRC(73a3e024) SHA1(aeb359dd2dc9eb96330f494c44123bab3f5986a4) )
18631863
18641864   ROM_REGION( 0x200000, "gfx2", 0 )
18651865   ROM_LOAD( "obj.8c",       0x000000, 0x100000, CRC(e2377895) SHA1(1d1c7f31a08a464139cdaf383a5e1ade0717dc9f) )
src/mame/drivers/aristmk4.c
r7553r7554
603603   ROM_LOAD("u59.bin", 0x02000, 0x2000, CRC(84226547) SHA1(df9c2c01a7ac4d930c06a8c4863853ddb1a2adbe)) // sound and video rom
604604
605605    /* GAME EPROMS */
606   ROM_LOAD("u87.bin", 0x06000, 0x2000, CRC(03c2890f) SHA1(10d479b7ccece813676ad815a96169bbf259c49d)) // game code
607   ROM_LOAD("u86.bin", 0x08000, 0x8000, CRC(36125194) SHA1(dc681dc60b25893ca3ee101f6813c22b914771f5)) // game code
606   ROM_LOAD("a_u87.bin", 0x06000, 0x2000, CRC(03c2890f) SHA1(10d479b7ccece813676ad815a96169bbf259c49d)) // game code
607   ROM_LOAD("a_u86.bin", 0x08000, 0x8000, CRC(36125194) SHA1(dc681dc60b25893ca3ee101f6813c22b914771f5)) // game code
608608
609609   /* SHAPE EPROMS */
610610   ROM_REGION(0xc000, "tile_gfx", 0 )
src/mame/drivers/kingdrby.c
r7553r7554
1010- inputs;
1111- Understand how tilemap color offsets really works;
1212- Discrete sound part? There's a Rossini's "William Tell" bgm on the Chinese bootlegs,
13  I think it's tied with ay8910 port B.
13  I think it's tied with ay8910 port B. Update: the 1986 version sounds that just fine, could be
14  that this is a btanb;
1415- unknown memories;
15- Garbage on the window tilemap if you win, it could be a BTANB (masked by the color prom).
16- Garbage on the window tilemap if you win, it could be a btanb (masked by the color prom).
1617- the name "King Derby" is a raw guess, there's a chance that it uses a different name
1718  (but there isn't any title screen in the game?)
1819- Fix I/O in the 1986 bootleg version;
r7553r7554
368369   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("DSW")
369370ADDRESS_MAP_END
370371
372static WRITE8_HANDLER( kingdrbb_lamps_w )
373{
374   // (same as the inputs but active high)
375}
376
371377static ADDRESS_MAP_START( slave_1986_map, ADDRESS_SPACE_PROGRAM, 8 )
372378   AM_RANGE(0x0000, 0x2fff) AM_ROM
373379   AM_RANGE(0x3000, 0x3fff) AM_ROM //sound rom tested for the post check
374380   AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) //backup ram
375381   AM_RANGE(0x5000, 0x5003) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)   /* I/O Ports */
376   AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)   /* I/O Ports */
382//  AM_RANGE(0x6000, 0x6003) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) /* I/O Ports */
377383   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("share1")
378384   AM_RANGE(0x7400, 0x74ff) AM_RAM AM_BASE_GENERIC(spriteram)
379385   AM_RANGE(0x7600, 0x7600) AM_DEVWRITE("crtc", mc6845_address_w)
380386   AM_RANGE(0x7601, 0x7601) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
381//  AM_RANGE(0x7800, 0x7803) AM_READ(test_r)
382   AM_RANGE(0x7a00, 0x7a00) AM_RAM //buffer for the key matrix
387   AM_RANGE(0x7800, 0x7800) AM_READ_PORT("KEY0")
388    AM_RANGE(0x7801, 0x7801) AM_READ_PORT("KEY1")
389   AM_RANGE(0x7802, 0x7802) AM_READ_PORT("KEY2")
390   AM_RANGE(0x7803, 0x7803) AM_READ_PORT("KEY3")
391   AM_RANGE(0x7800, 0x7803) AM_WRITE(kingdrbb_lamps_w)
392   AM_RANGE(0x7a00, 0x7a00) AM_READ_PORT("SYSTEM")
383393   AM_RANGE(0x7c00, 0x7c00) AM_READ_PORT("DSW")
384394ADDRESS_MAP_END
385395
r7553r7554
442452   }
443453};
444454
455static WRITE8_DEVICE_HANDLER( outportb_w )
456{
457//  printf("%02x B\n",data);
458}
459
460
445461static const ppi8255_interface ppi8255_1986_intf[2] =
446462{
447463   /* C as input, (all) as output */
448464   {
449465      DEVCB_NULL,                           /* Port A read */
450466      DEVCB_INPUT_PORT("IN0"),           /* Port B read */
451      DEVCB_INPUT_PORT("IN1"),      /* Port C read */
452      DEVCB_NULL,               /* Port A write */
453      DEVCB_NULL,               /* Port B write */
454      DEVCB_NULL   /* Port C write */
467      DEVCB_INPUT_PORT("IN1"),         /* Port C read */
468      DEVCB_HANDLER(sound_cmd_w),         /* Port A write */
469      DEVCB_HANDLER(outportb_w),         /* Port B write */
470      DEVCB_NULL                      /* Port C write */
455471   },
456472
457   /* */
473   /* actually unused */
458474   {
459475      DEVCB_NULL,               /* Port A read */
460      DEVCB_HANDLER(key_matrix_r),/* Port B read */
461      DEVCB_HANDLER(input_mux_r),   /* Port C read */
462      DEVCB_HANDLER(sound_cmd_w),  /* Port A write */
476      DEVCB_NULL,               /* Port B read */
477      DEVCB_NULL,               /* Port C read */
478      DEVCB_NULL,             /* Port A write */
463479      DEVCB_NULL,               /* Port B write */
464      DEVCB_HANDLER(outport2_w)   /* Port C write */
480      DEVCB_NULL               /* Port C write */
465481   }
466482};
467483
r7553r7554
623639   PORT_DIPNAME( 0x40, 0x40, "POST Check" )
624640   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
625641   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
626   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
642   PORT_DIPNAME( 0x80, 0x80, "Reset Backup RAM" )
627643   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
628644   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
629645INPUT_PORTS_END
r7553r7554
702718   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
703719   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
704720
705   PORT_START("KEY_1P")   // ppi1 (6001)
706   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("1P 1-2") PORT_CODE(KEYCODE_Q)
707   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("1P 1-3") PORT_CODE(KEYCODE_W)
708   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("1P 1-4") PORT_CODE(KEYCODE_E)
709   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("1P 1-5") PORT_CODE(KEYCODE_R)
710   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("1P 1-6") PORT_CODE(KEYCODE_T)
711   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("1P 2-3") PORT_CODE(KEYCODE_A)
712   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("1P 2-4") PORT_CODE(KEYCODE_S)
713   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("1P 2-5") PORT_CODE(KEYCODE_D)
714   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("1P 2-6") PORT_CODE(KEYCODE_F)
715   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("1P 3-4") PORT_CODE(KEYCODE_G)
716   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("1P 3-5") PORT_CODE(KEYCODE_H)
717   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("1P 3-6") PORT_CODE(KEYCODE_Z)
718   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("1P 4-5") PORT_CODE(KEYCODE_X)
719   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("1P 4-6") PORT_CODE(KEYCODE_C)
720   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON15 ) PORT_NAME("1P 5-6") PORT_CODE(KEYCODE_V)
721   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
722
723   PORT_START("KEY_2P")   // ppi1 (6001)
724   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("2P 1-2") PORT_CODE(KEYCODE_Q) PORT_COCKTAIL
725   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("2P 1-3") PORT_CODE(KEYCODE_W) PORT_COCKTAIL
726   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("2P 1-4") PORT_CODE(KEYCODE_E) PORT_COCKTAIL
727   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("2P 1-5") PORT_CODE(KEYCODE_R) PORT_COCKTAIL
728   PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("2P 1-6") PORT_CODE(KEYCODE_T) PORT_COCKTAIL
729   PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("2P 2-3") PORT_CODE(KEYCODE_A) PORT_COCKTAIL
730   PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("2P 2-4") PORT_CODE(KEYCODE_S) PORT_COCKTAIL
731   PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("2P 2-5") PORT_CODE(KEYCODE_D) PORT_COCKTAIL
732   PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("2P 2-6") PORT_CODE(KEYCODE_F) PORT_COCKTAIL
733   PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("2P 3-4") PORT_CODE(KEYCODE_G) PORT_COCKTAIL
734   PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("2P 3-5") PORT_CODE(KEYCODE_H) PORT_COCKTAIL
735   PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("2P 3-6") PORT_CODE(KEYCODE_Z) PORT_COCKTAIL
736   PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_BUTTON13 ) PORT_NAME("2P 4-5") PORT_CODE(KEYCODE_X) PORT_COCKTAIL
737   PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_BUTTON14 ) PORT_NAME("2P 4-6") PORT_CODE(KEYCODE_C) PORT_COCKTAIL
738   PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_BUTTON15 ) PORT_NAME("2P 5-6") PORT_CODE(KEYCODE_V) PORT_COCKTAIL
739   PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_UNUSED )
740
741   PORT_START("MUX0")   // ppi1 (6002)
742   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
743   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
744   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
745   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
721   PORT_START("SYSTEM")   // ppi0 (5001)
722   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
723   PORT_DIPNAME( 0x02, 0x02, "SYSTEM" )
746724   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
747725   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
748   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
749   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
750   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
726   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
751727   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
752728   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
753729   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r7553r7554
760736   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
761737   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
762738   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
763   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
739   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) //causes "hopper overpay" msg
764740   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
765741   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
766742
767   PORT_START("MUX1")
768   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
769   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
770   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
771   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
772   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
773   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
774   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
775   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
776   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
777   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
778   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
779   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
780   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
781   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
782   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
783   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
784   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
785   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
786   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
787   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
788   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
789   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
790   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
791   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
743   PORT_START("KEY0") // (7800)
744   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("1P 1-2") PORT_CODE(KEYCODE_Q)
745   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("1P 1-3") PORT_CODE(KEYCODE_W)
746   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("1P 1-4") PORT_CODE(KEYCODE_E)
747   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("1P 1-5") PORT_CODE(KEYCODE_R)
748   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
792749
750   PORT_START("KEY1") // (7801)
751   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("1P 1-6") PORT_CODE(KEYCODE_T)
752   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("1P 2-3") PORT_CODE(KEYCODE_A)
753   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("1P 2-4") PORT_CODE(KEYCODE_S)
754   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("1P 2-5") PORT_CODE(KEYCODE_D)
755   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
756
757   PORT_START("KEY2")
758   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("1P 2-6") PORT_CODE(KEYCODE_F)
759   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_NAME("1P 3-4") PORT_CODE(KEYCODE_G)
760   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_NAME("1P 3-5") PORT_CODE(KEYCODE_H)
761   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("1P 3-6") PORT_CODE(KEYCODE_Z)
762   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
763
764   PORT_START("KEY3")
765   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("1P 4-5") PORT_CODE(KEYCODE_X)
766   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("1P 4-6") PORT_CODE(KEYCODE_C)
767   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("1P 5-6") PORT_CODE(KEYCODE_V)
768   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
769   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
770
793771   PORT_START("DSW")
794772   PORT_DIPNAME( 0x01, 0x01, "SYSTEM" )
795773   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
r7553r7554
812790   PORT_DIPNAME( 0x40, 0x40, "POST Check" )
813791   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
814792   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
815   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
793   PORT_DIPNAME( 0x80, 0x80, "Reset Backup RAM" )
816794   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
817795   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
818796INPUT_PORTS_END
r7553r7554
955933   }
956934}
957935
936static PALETTE_INIT(kingdrbb)
937{
938   UINT8 *raw_prom = memory_region(machine, "raw_prom");
939   UINT8 *prom = memory_region(machine, "proms");
940   int   bit0, bit1, bit2 , r, g, b;
941   int   i;
942
943   for(i = 0; i < 0x200; i++)
944   {
945      /* this set has an extra address line shuffle applied on the prom */
946      prom[i] = raw_prom[BITSWAP16(i, 15,14,13,12,11,10,9,8,7,6,5,0,1,2,3,4)+0x1000];
947   }
948
949   for(i = 0; i < 0x200; i++)
950   {
951      bit0 = 0;
952      bit1 = (prom[i] >> 1) & 0x01;
953      bit2 = (prom[i] >> 0) & 0x01;
954      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
955      bit0 = (prom[i] >> 4) & 0x01;
956      bit1 = (prom[i] >> 3) & 0x01;
957      bit2 = (prom[i] >> 2) & 0x01;
958      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
959      bit0 = (prom[i] >> 7) & 0x01;
960      bit1 = (prom[i] >> 6) & 0x01;
961      bit2 = (prom[i] >> 5) & 0x01;
962      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
963
964      palette_set_color(machine, i, MAKE_RGB(r, g, b));
965   }
966}
967
958968static MACHINE_DRIVER_START( kingdrby )
959969   MDRV_CPU_ADD("master", Z80, CLK_2)
960970   MDRV_CPU_PROGRAM_MAP(master_map)
r7553r7554
10071017   MDRV_CPU_MODIFY("slave")
10081018   MDRV_CPU_PROGRAM_MAP(slave_1986_map)
10091019
1020   MDRV_PALETTE_INIT(kingdrbb)
1021
10101022   MDRV_PPI8255_RECONFIG( "ppi8255_0", ppi8255_1986_intf[0] )
10111023   MDRV_PPI8255_RECONFIG( "ppi8255_1", ppi8255_1986_intf[1] )
10121024MACHINE_DRIVER_END
r7553r7554
10191031   MDRV_CPU_IO_MAP(cowrace_sound_io)
10201032
10211033   MDRV_GFXDECODE(cowrace)
1034   MDRV_PALETTE_INIT(kingdrby)
10221035
10231036   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
10241037   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
r7553r7554
10891102   ROM_REGION( 0x4000, "raw_prom", 0 )
10901103   ROM_LOAD( "kingdrbb_u1.bin", 0x0000, 0x4000, CRC(97931952) SHA1(a0ef3be105f2ed7f744c73e92c583d25bb322e6a) ) // palette but in a normal rom?
10911104
1092   ROM_REGION( 0x200, "proms", 0 )
1093   ROM_COPY( "raw_prom", 0x1000, 0x000, 0x200 )
1105   ROM_REGION( 0x200, "proms", ROMREGION_ERASE00 ) // address shuffled, decoded inside PALETTE_INIT
1106//  ROM_COPY( "raw_prom", 0x1000, 0x000, 0x200 )
10941107//  ROM_COPY( "raw_prom", 0x3000, 0x200, 0x200 ) //identical to 0x1000 bank
10951108
10961109   ROM_REGION( 0x4000, "pals", 0 ) // all read protected
r7553r7554
11361149
11371150
11381151GAME( 1981, kingdrby,  0,             kingdrby,   kingdrby,   0,       ROT0,   "Tazmi",    "King Derby (1981)",   GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS| GAME_IMPERFECT_SOUND )
1139GAME( 1986, kingdrbb,  kingdrby,      kingdrbb,   kingdrbb,   0,       ROT0,   "bootleg",  "King Derby (1986 Taiwan bootleg)",   GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
1152GAME( 1986, kingdrbb,  kingdrby,      kingdrbb,   kingdrbb,   0,       ROT0,   "bootleg",  "King Derby (1986 Taiwan bootleg)",   GAME_IMPERFECT_GRAPHICS | GAME_WRONG_COLORS )
11401153GAME( 2000, cowrace,   kingdrby,      cowrace,    kingdrbb,   0,       ROT0,   "bootleg",  "Cow Race (1986 King Derby hack)", GAME_NOT_WORKING | GAME_WRONG_COLORS )
src/mame/drivers/gijoe.c
r7553r7554
365365
366366   ROM_REGION( 0x200000, "k054539", 0 )
367367   ROM_LOAD( "069a04", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
368
369   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
370   ROM_LOAD( "gijoe.nv", 0x0000, 0x080, CRC(a0d50a79) SHA1(972533ea45a0e84d9dd14c55f58cd7247926792e) )
368371ROM_END
369372
370373ROM_START( gijoeu )
r7553r7554
389392
390393   ROM_REGION( 0x200000, "k054539", 0 )
391394   ROM_LOAD( "069a04", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
395
396   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
397   ROM_LOAD( "gijoeu.nv", 0x0000, 0x080, CRC(ca966023) SHA1(6f07ece0f95213bc12387192986f468d23dfdfc8) )
392398ROM_END
393399
394400ROM_START( gijoej )
r7553r7554
413419
414420   ROM_REGION( 0x200000, "k054539", 0 )
415421   ROM_LOAD( "069a04", 0x000000, 0x200000, CRC(11d6dcd6) SHA1(04cbff9f61cd8641db538db809ddf20da29fd5ac) )
422
423   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
424   ROM_LOAD( "gijoej.nv", 0x0000, 0x080, CRC(c914fcf2) SHA1(b4f0a0b5d6d4075b004b061336d162336ce1a754) )
416425ROM_END
417426
418427
src/mame/drivers/ddragon.c
r7553r7554
14671467   ROM_LOAD( "63701.bin",    0xc000, 0x4000, CRC(f5232d03) SHA1(e2a194e38633592fd6587690b3cb2669d93985c7) )
14681468
14691469   ROM_REGION( 0x10000, "soundcpu", 0 ) /* audio cpu */
1470   ROM_LOAD( "3.bin",        0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) )
1470   ROM_LOAD( "b2_3.bin",     0x08000, 0x08000, CRC(9efa95bb) SHA1(da997d9cc7b9e7b2c70a4b6d30db693086a6f7d8) )
14711471
14721472   ROM_REGION( 0x08000, "gfx1", 0 )
14731473   ROM_LOAD( "8.bin",        0x00000, 0x08000, CRC(7a8b8db4) SHA1(8368182234f9d4d763d4714fd7567a9e31b7ebeb) )   /* chars */
r7553r7554
14891489   ROM_LOAD( "20.bin",       0x30000, 0x10000, CRC(5fb42e7c) SHA1(7953316712c56c6f8ca6bba127319e24b618b646) )
14901490
14911491   ROM_REGION( 0x20000, "adpcm", 0 ) /* adpcm samples */
1492   ROM_LOAD( "1.bin",        0x00000, 0x10000, CRC(34755de3) SHA1(57c06d6ce9497901072fa50a92b6ed0d2d4d6528) )
1492   ROM_LOAD( "b2_1.bin",     0x00000, 0x10000, CRC(34755de3) SHA1(57c06d6ce9497901072fa50a92b6ed0d2d4d6528) )
14931493   ROM_LOAD( "2.bin",        0x10000, 0x10000, CRC(904de6f8) SHA1(3623e5ea05fd7c455992b7ed87e605b87c3850aa) )
14941494
14951495   ROM_REGION( 0x0300, "proms", 0 )
r7553r7554
15301530   ROM_LOAD( "27.bin",        0x28000, 0x08000, CRC(15cd16cb) SHA1(ab2068ebba14da256e8f2600f34dca0e048a1de9) )
15311531   ROM_LOAD( "28.bin",        0x30000, 0x08000, CRC(51b8a217) SHA1(60c067cd7272f856e29cdb64312535236656891a) )
15321532   ROM_LOAD( "29.bin",        0x38000, 0x08000, CRC(e4ec2394) SHA1(43376ce2a07c1fc3053f7ac9b750e944d289105b) )
1533   ROM_LOAD( "1.bin",         0x40000, 0x08000, CRC(2485a71d) SHA1(3e987a2f3e9a59da5fdc7bb779a43736ca67aac7) )
1533   ROM_LOAD( "6809_1.bin",    0x40000, 0x08000, CRC(2485a71d) SHA1(3e987a2f3e9a59da5fdc7bb779a43736ca67aac7) )
15341534   ROM_LOAD( "2.bin",         0x48000, 0x08000, CRC(6940120d) SHA1(bbe94f095ef983f54658c936f916ba6a72a84ead) )
15351535   ROM_LOAD( "3.bin",         0x50000, 0x08000, CRC(c67aac12) SHA1(aab535507e3889bf1bdc2f4fe4828a70a350ba63) )
15361536   ROM_LOAD( "4.bin",         0x58000, 0x08000, CRC(941dcd08) SHA1(266dee264f28affe8c3f57fe569929817ae16508) )
r7553r7554
15411541
15421542   ROM_REGION( 0x40000, "gfx3", 0 )
15431543   ROM_LOAD( "9.bin",         0x00000, 0x10000, CRC(736eff0f) SHA1(ae2ec2d5c8ab1db579a08256d874426dc5d889c6) )
1544   ROM_LOAD( "10.bin",        0x10000, 0x10000, CRC(a670d088) SHA1(27e7b49645753dd039f104c3e0a7e6513a98710d) )
1544   ROM_LOAD( "6809_10.bin",   0x10000, 0x10000, CRC(a670d088) SHA1(27e7b49645753dd039f104c3e0a7e6513a98710d) )
15451545   ROM_LOAD( "11.bin",        0x20000, 0x10000, CRC(4171b70d) SHA1(dc300c9bca6481417e97ad03c973e47389f261c1) )
15461546   ROM_LOAD( "12.bin",        0x30000, 0x10000, CRC(5f6a6d6f) SHA1(7d546a226cda81c28e7ccfb4c5daebc65072198d) )
15471547
src/mame/drivers/asterix.c
r7553r7554
362362
363363   ROM_REGION( 0x200000, "k053260", 0 )
364364   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
365
366   ROM_REGION16_BE( 0x80, "eeprom", 0 )
367   ROM_LOAD( "asterix.nv", 0x0000, 0x0080, CRC(490085c8) SHA1(2a79e7c79db4b4fb0e6a7249cfd6a57e74b170e3) )
365368ROM_END
366369
367370ROM_START( asterixeac )
r7553r7554
384387
385388   ROM_REGION( 0x200000, "k053260", 0 )
386389   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
390
391   ROM_REGION16_BE( 0x80, "eeprom", 0 )
392   ROM_LOAD( "asterixeac.nv", 0x0000, 0x0080, CRC(490085c8) SHA1(2a79e7c79db4b4fb0e6a7249cfd6a57e74b170e3) )
387393ROM_END
388394
389395ROM_START( asterixeaa )
r7553r7554
406412
407413   ROM_REGION( 0x200000, "k053260", 0 )
408414   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
415
416   ROM_REGION16_BE( 0x80, "eeprom", 0 )
417   ROM_LOAD( "asterixeaa.nv", 0x0000, 0x0080, CRC(30275de0) SHA1(4bbf90a4e5b20406153329e9e7c4c2bf72676f8d) )
409418ROM_END
410419
411420ROM_START( asterixaad )
r7553r7554
428437
429438   ROM_REGION( 0x200000, "k053260", 0 )
430439   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
440
441   ROM_REGION16_BE( 0x80, "eeprom", 0 )
442   ROM_LOAD( "asterixaad.nv", 0x0000, 0x0080, CRC(bcca86a7) SHA1(1191b0011749e2516df723c9d63da9c2304fa594) )
431443ROM_END
432444
433445ROM_START( asterixj )
r7553r7554
450462
451463   ROM_REGION( 0x200000, "k053260", 0 )
452464   ROM_LOAD( "068a06.1e", 0x000000, 0x200000, CRC(6df9ec0e) SHA1(cee60312e9813bd6579f3ac7c3c2521a8e633eca) )
465
466   ROM_REGION16_BE( 0x80, "eeprom", 0 )
467   ROM_LOAD( "asterixj.nv", 0x0000, 0x0080, CRC(84229f2c) SHA1(34c7491c731fbf741dfd53bfc559d91201ccfb03) )
453468ROM_END
454469
455470
src/mame/drivers/moo.c
r7553r7554
646646   ROM_REGION( 0x200000, "k054539", 0 )
647647   /* K054539 samples */
648648   ROM_LOAD( "151a08", 0x000000, 0x200000, CRC(962251d7) SHA1(32dccf515d2ca8eeffb45cada3dcc60089991b77) )
649
650   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
651   ROM_LOAD( "moo.nv", 0x0000, 0x080, CRC(7bd904a8) SHA1(8747c5c62d1832e290be8ace73c61b1f228c0bec) )
649652ROM_END
650653
651654ROM_START( mooua ) /* Version UA - USA Ver A */
r7553r7554
678681   ROM_REGION( 0x200000, "k054539", 0 )
679682   /* K054539 samples */
680683   ROM_LOAD( "151a08", 0x000000, 0x200000, CRC(962251d7) SHA1(32dccf515d2ca8eeffb45cada3dcc60089991b77) )
684
685   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
686   ROM_LOAD( "moou.nv", 0x0000, 0x080, CRC(a5cb137a) SHA1(119df859d6b5c366481305b1433eea0deadc3fa9) )
681687ROM_END
682688
683689ROM_START( mooaa ) /* Version AA - Asia Ver A */
r7553r7554
710716   ROM_REGION( 0x200000, "k054539", 0 )
711717   /* K054539 samples */
712718   ROM_LOAD( "151a08", 0x000000, 0x200000, CRC(962251d7) SHA1(32dccf515d2ca8eeffb45cada3dcc60089991b77) )
719
720   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
721   ROM_LOAD( "moo.nv", 0x0000, 0x080, CRC(7bd904a8) SHA1(8747c5c62d1832e290be8ace73c61b1f228c0bec) )
713722ROM_END
714723
715724ROM_START( bucky )
r7553r7554
743752   /* K054539 samples */
744753   ROM_LOAD("173a08.b6", 0x000000, 0x200000, CRC(dcdded95) SHA1(8eeb546a0b60a35a6dce36c5ee872e6c93c577c9) )
745754   ROM_LOAD("173a09.a6", 0x200000, 0x200000, CRC(c93697c4) SHA1(0528a604868267a30d281b822c187df118566691) )
755
756   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
757   ROM_LOAD( "bucky.nv", 0x0000, 0x080, CRC(6a5986f3) SHA1(3efddeed261b09031c582e12318f00c2cbb214ea) )
746758ROM_END
747759
748760ROM_START( buckyua )
r7553r7554
776788   /* K054539 samples */
777789   ROM_LOAD("173a08.b6", 0x000000, 0x200000, CRC(dcdded95) SHA1(8eeb546a0b60a35a6dce36c5ee872e6c93c577c9) )
778790   ROM_LOAD("173a09.a6", 0x200000, 0x200000, CRC(c93697c4) SHA1(0528a604868267a30d281b822c187df118566691) )
791
792   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
793   ROM_LOAD( "buckyu.nv", 0x0000, 0x080, CRC(a5cb137a) SHA1(119df859d6b5c366481305b1433eea0deadc3fa9) )
779794ROM_END
780795
781796ROM_START( buckyaa )
r7553r7554
809824   /* K054539 samples */
810825   ROM_LOAD("173a08.b6", 0x000000, 0x200000, CRC(dcdded95) SHA1(8eeb546a0b60a35a6dce36c5ee872e6c93c577c9) )
811826   ROM_LOAD("173a09.a6", 0x200000, 0x200000, CRC(c93697c4) SHA1(0528a604868267a30d281b822c187df118566691) )
827
828   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
829   ROM_LOAD( "bucky.nv", 0x0000, 0x080, CRC(6a5986f3) SHA1(3efddeed261b09031c582e12318f00c2cbb214ea) )
812830ROM_END
813831
814832
r7553r7554
861879   ROM_CONTINUE(          0x280000+0x30000, 0x010000)//bank a hi
862880   ROM_CONTINUE(          0x2c0000+0x30000, 0x010000)//bank b hi
863881   ROM_CONTINUE(          0x300000+0x30000, 0x010000)//bank c hi
882
883   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
884   ROM_LOAD( "moo.nv", 0x0000, 0x080, CRC(7bd904a8) SHA1(8747c5c62d1832e290be8ace73c61b1f228c0bec) )
864885ROM_END
865886
866887static DRIVER_INIT( moo )
src/mame/drivers/vcombat.c
r7553r7554
197197
198198   if (bus_hold)
199199   {
200      fprintf(stderr, "M0 asserting bus HOLD to i860 %s\n", device->tag.cstr());
200      fprintf(stderr, "M0 asserting bus HOLD to i860 %s\n", device->tag());
201201      i860_set_pin(device, DEC_PIN_BUS_HOLD, 1);
202202   }
203203   else
204204   {
205      fprintf(stderr, "M0 clearing bus HOLD to i860 %s\n", device->tag.cstr());
205      fprintf(stderr, "M0 clearing bus HOLD to i860 %s\n", device->tag());
206206      i860_set_pin(device, DEC_PIN_BUS_HOLD, 0);
207207   }
208208
209209   if (reset)
210210   {
211      fprintf(stderr, "M0 asserting RESET to i860 %s\n", device->tag.cstr());
211      fprintf(stderr, "M0 asserting RESET to i860 %s\n", device->tag());
212212      i860_set_pin(device, DEC_PIN_RESET, 1);
213213   }
214214   else
src/mame/drivers/39in1.c
r7553r7554
16331633
16341634   // EEPROM - contains security data
16351635   ROM_REGION16_BE( 0x200, "eeprom", 0 )
1636   ROM_LOAD16_WORD_SWAP( "93c66_eeprom.bin", 0x000, 0x200, NO_DUMP )
1636   ROM_LOAD16_WORD_SWAP( "48in1_93c66_eeprom.bin", 0x000, 0x200, NO_DUMP )
16371637ROM_END
16381638
16391639ROM_START( 48in1a )
r7553r7554
16471647
16481648   // EEPROM - contains security data
16491649   ROM_REGION16_BE( 0x200, "eeprom", 0 )
1650   ROM_LOAD16_WORD_SWAP( "93c66_eeprom.bin", 0x000, 0x200, NO_DUMP )
1650   ROM_LOAD16_WORD_SWAP( "48in1_93c66_eeprom.bin", 0x000, 0x200, NO_DUMP )
16511651ROM_END
16521652
16531653GAME(2004, 39in1,  0,     39in1, 39in1, 39in1, ROT270, "<unknown>", "39 in 1 MAME bootleg", GAME_IMPERFECT_SOUND)
src/mame/drivers/rungun.c
r7553r7554
2626     - missing sprites and priority
2727
2828   Known Issues:
29     - no dual monitor support
30     - synchronization and other oddities (rungunu doesn't show attract mode)
31     - swapped P12 and P34 controls in 4-player mode team selectet (real puzzler)
32     - P3 and P4 coin chutes not working in 4-player mode
29     - no dual monitor support is broken
30        - games seem to think they're in dual-monitor mode when they're not
31        - speed in some sets is incorrect (for dual monitors I'm guessing it should
32          output alternate frames to alternate monitors, but due to other bugs it
33          just causes the game to run twice as fast as it should?)
34        - synchronization and other oddities (rungunu doesn't show attract mode)
35        - swapped P12 and P34 controls in 4-player mode team selectet (real puzzler)
36        - P3 and P4 coin chutes not working in 4-player mode
37
38
3339     - sprite palettes are not entirely right
34     - ROZ update causes music to stutter
3540
3641*************************************************************************/
3742
r7553r7554
481486   ROM_REGION( 0x400000, "shared", 0)
482487   ROM_LOAD( "247-a06", 0x000000, 0x200000, CRC(b8b2a67e) SHA1(a873d32f4b178c714743664fa53c0dca29cb3ce4) )
483488   ROM_LOAD( "247-a07", 0x200000, 0x200000, CRC(0108142d) SHA1(4dc6a36d976dad9c0da5a5b1f01f2eb3b369c99d) )
489
490   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
491   ROM_LOAD( "rungun.nv", 0x0000, 0x080, CRC(7bbf0e3c) SHA1(0fd3c9400e9b97a06517e0c8620f773a383100fd) )
484492ROM_END
485493
486494ROM_START( runguna )
r7553r7554
519527   ROM_REGION( 0x400000, "shared", 0)
520528   ROM_LOAD( "247-a06", 0x000000, 0x200000, CRC(b8b2a67e) SHA1(a873d32f4b178c714743664fa53c0dca29cb3ce4) )
521529   ROM_LOAD( "247-a07", 0x200000, 0x200000, CRC(0108142d) SHA1(4dc6a36d976dad9c0da5a5b1f01f2eb3b369c99d) )
530
531   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
532   ROM_LOAD( "runguna.nv", 0x0000, 0x080, CRC(7bbf0e3c) SHA1(0fd3c9400e9b97a06517e0c8620f773a383100fd) )
522533ROM_END
523534
524535ROM_START( rungunu )
r7553r7554
555566   ROM_REGION( 0x400000, "shared", 0)
556567   ROM_LOAD( "247-a06", 0x000000, 0x200000, CRC(b8b2a67e) SHA1(a873d32f4b178c714743664fa53c0dca29cb3ce4) )
557568   ROM_LOAD( "247-a07", 0x200000, 0x200000, CRC(0108142d) SHA1(4dc6a36d976dad9c0da5a5b1f01f2eb3b369c99d) )
569
570   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
571   ROM_LOAD( "rungunu.nv", 0x0000, 0x080, CRC(d501f579) SHA1(9e01d9a6a8cdc782dd2a92fbf2295e8df732f892) )
558572ROM_END
559573
560574ROM_START( rungunua )
r7553r7554
593607   ROM_REGION( 0x400000, "shared", 0)
594608   ROM_LOAD( "247-a06", 0x000000, 0x200000, CRC(b8b2a67e) SHA1(a873d32f4b178c714743664fa53c0dca29cb3ce4) )
595609   ROM_LOAD( "247-a07", 0x200000, 0x200000, CRC(0108142d) SHA1(4dc6a36d976dad9c0da5a5b1f01f2eb3b369c99d) )
610
611   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
612   ROM_LOAD( "rungunua.nv", 0x0000, 0x080, CRC(9890d304) SHA1(c94a77d1d45e372350456cf8eaa7e7ebd3cdbb84) )
596613ROM_END
597614
598615ROM_START( slmdunkj )
r7553r7554
631648   ROM_REGION( 0x400000, "shared", 0)
632649   ROM_LOAD( "247-a06", 0x000000, 0x200000, CRC(b8b2a67e) SHA1(a873d32f4b178c714743664fa53c0dca29cb3ce4) )
633650   ROM_LOAD( "247-a07", 0x200000, 0x200000, CRC(0108142d) SHA1(4dc6a36d976dad9c0da5a5b1f01f2eb3b369c99d) )
651
652   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
653   ROM_LOAD( "slmdunkj.nv", 0x0000, 0x080, CRC(531d27bd) SHA1(42251272691c66c1f89f99e6e5e2f300c1a7d69d) )
634654ROM_END
635655
636656
637657GAME( 1993, rungun,   0,      rng, rng, 0, ROT0, "Konami", "Run and Gun (ver EAA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
638658GAME( 1993, runguna,  rungun, rng, rng, 0, ROT0, "Konami", "Run and Gun (ver EAA 1993 10.4)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
639GAME( 1993, rungunu,  rungun, rng, rng, 0, ROT0, "Konami", "Run and Gun (ver UAB 1993 10.12)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
640GAME( 1993, rungunua, rungun, rng, rng, 0, ROT0, "Konami", "Run and Gun (ver UBA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
659GAME( 1993, rungunu,  rungun, rng, rng, 0, ROT0, "Konami", "Run and Gun (ver UAB 1993 10.12)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) // runs twice as fast as it should, broken inputs!
660GAME( 1993, rungunua, rungun, rng, rng, 0, ROT0, "Konami", "Run and Gun (ver UBA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )  // runs twice as fast as it should, broken inputs! broken attract!
641661GAME( 1993, slmdunkj, rungun, rng, rng, 0, ROT0, "Konami", "Slam Dunk (ver JAA 1993 10.8)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_COLORS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/midyunit.c
r7553r7554
17151715ROM_END
17161716
17171717
1718ROM_START( smashtv3 )
1719   ROM_REGION( 0x90000, "cvsdcpu", 0 )   /* sound CPU */
1720   ROM_LOAD (  "sl2.u4", 0x10000, 0x10000, CRC(29d3f6c8) SHA1(8a90cdff54f59ddb7dba521504d880515a59df08) )
1721   ROM_RELOAD(           0x20000, 0x10000 )
1722   ROM_LOAD ( "sl2.u19", 0x30000, 0x10000, CRC(ac5a402a) SHA1(c476018062126dc3936caa2c328de490737165ec) )
1723   ROM_RELOAD(           0x40000, 0x10000 )
1724   ROM_LOAD ( "sl2.u20", 0x50000, 0x10000, CRC(875c66d9) SHA1(51cdad62ec57e69bba6fcf14e59841ec628dec11) )
1725   ROM_RELOAD(           0x60000, 0x10000 )
1726
1727   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
1728   ROM_LOAD16_BYTE( "u105-la3",  0xc0000, 0x20000, CRC(33b626c3) SHA1(8f0582f6fe08dc7de920aeac578ed570ca4e717f) )
1729   ROM_LOAD16_BYTE( "u89-la3",   0xc0001, 0x20000, CRC(5f6fbc25) SHA1(d623f5e64ff4e70e24d770ac3ac0d32ff3928ce0) )
1730
1731   ROM_REGION( 0x800000, "gfx1", 0 )
1732   ROM_LOAD ( "la1.u111",  0x000000, 0x20000, CRC(72f0ba84) SHA1(2e925b3cdd3c8e14046b3948d82f0f3cde3c22c5) )
1733   ROM_LOAD ( "la1.u112",  0x020000, 0x20000, CRC(436f0283) SHA1(ec33a8942c0fc326db885e08dad9346ec5a63360) )
1734   ROM_LOAD ( "la1.u113",  0x040000, 0x20000, CRC(4a4b8110) SHA1(9f1881d1d2682764ab85aebd685d97eb8b4afe46) )
1735
1736   ROM_LOAD (  "la1.u95",  0x200000, 0x20000, CRC(e864a44b) SHA1(40eb8e11a183f4f82dc8decb36aaeded9cd1bc26) )
1737   ROM_LOAD (  "la1.u96",  0x220000, 0x20000, CRC(15555ea7) SHA1(4fefc059736ca424dc05a08cb55b9acf9e31228b) )
1738   ROM_LOAD (  "la1.u97",  0x240000, 0x20000, CRC(ccac9d9e) SHA1(a43d70d1a0bbd377f0fc539c2e8b725f7079f463) )
1739
1740   ROM_LOAD ( "la1.u106",  0x400000, 0x20000, CRC(5c718361) SHA1(6178b1d53411f24d5a5a01559727e300cd27d587) )
1741   ROM_LOAD ( "la1.u107",  0x420000, 0x20000, CRC(0fba1e36) SHA1(17038cf35a72678bba149a632f1ad1b80cc3a38c) )
1742   ROM_LOAD ( "la1.u108",  0x440000, 0x20000, CRC(cb0a092f) SHA1(33cbb87b4be1eadb1f3624ef5e218e65109fa3eb) )
1743ROM_END
1744
1745
17181746ROM_START( hiimpact )
17191747   ROM_REGION( 0x90000, "cvsdcpu", 0 )   /* sound CPU */
17201748   ROM_LOAD (  "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
r7553r7554
24822510GAME( 1990, smashtv6, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 6.00)", GAME_SUPPORTS_SAVE )
24832511GAME( 1990, smashtv5, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 5.00)", GAME_SUPPORTS_SAVE )
24842512GAME( 1990, smashtv4, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 4.00)", GAME_SUPPORTS_SAVE )
2513GAME( 1990, smashtv3, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 3.01)", GAME_SUPPORTS_SAVE )
24852514
24862515GAME( 1990, hiimpact,   0,        yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA5 02/15/91)", GAME_SUPPORTS_SAVE )
24872516GAME( 1990, hiimpact4,  hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE )
src/mame/drivers/galpani2.c
r7553r7554
276276static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w )
277277{
278278      UINT8 *ROM = memory_region(device->machine, "oki1");
279      logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag.cstr(),data);
279      logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag(),data);
280280      memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000);
281281}
282282
283283static WRITE8_DEVICE_HANDLER( galpani2_oki2_bank_w )
284284{
285285      okim6295_set_bank_base(device, 0x40000 * (data & 0xf) );
286      logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag.cstr(),data);
286      logerror("%s : %s bank %08X\n",cpuexec_describe_context(device->machine),device->tag(),data);
287287}
288288
289289
src/mame/drivers/gticlub.c
r7553r7554
262262{
263263   bitmap_fill(bitmap, cliprect, screen->machine->pens[0]);
264264
265   if (strcmp(screen->tag, "lscreen") == 0)
265   if (strcmp(screen->tag(), "lscreen") == 0)
266266   {
267267      running_device *k001604 = devtag_get_device(screen->machine, "k001604_1");
268268      running_device *voodoo = devtag_get_device(screen->machine, "voodoo0");
r7553r7554
273273
274274      k001604_draw_front_layer(k001604, bitmap, cliprect);
275275   }
276   else if (strcmp(screen->tag, "rscreen") == 0)
276   else if (strcmp(screen->tag(), "rscreen") == 0)
277277   {
278278      running_device *k001604 = devtag_get_device(screen->machine, "k001604_2");
279279      running_device *voodoo = devtag_get_device(screen->machine, "voodoo1");
r7553r7554
10001000   ROM_LOAD64_WORD( "688a14.13d", 0x000002, 0x200000, CRC(b9932735) SHA1(2492244d2acb350974202a6718bc7121325d2121) )
10011001   ROM_LOAD64_WORD( "688a15.9d",  0x000004, 0x200000, CRC(8aadee51) SHA1(be9020a47583da9d4ff586d227836dc5b7dc31f0) )
10021002   ROM_LOAD64_WORD( "688a16.4d",  0x000006, 0x200000, CRC(7f4e1893) SHA1(585be7b31ab7a48300c22b00443b00d631f4c49d) )
1003
1004   ROM_REGION16_BE( 0x200, "eeprom", 0 )
1005   ROM_LOAD( "gticlub.nv", 0x0000, 0x0200, CRC(eca78a49) SHA1(3dcaccc4bee58f7ff5d6ecae551887cc967deaf7) )
10031006ROM_END
10041007
10051008ROM_START( gticluba ) /* Asia version AAA */
r7553r7554
10271030   ROM_LOAD64_WORD( "688a14.13d", 0x000002, 0x200000, CRC(b9932735) SHA1(2492244d2acb350974202a6718bc7121325d2121) )
10281031   ROM_LOAD64_WORD( "688a15.9d",  0x000004, 0x200000, CRC(8aadee51) SHA1(be9020a47583da9d4ff586d227836dc5b7dc31f0) )
10291032   ROM_LOAD64_WORD( "688a16.4d",  0x000006, 0x200000, CRC(7f4e1893) SHA1(585be7b31ab7a48300c22b00443b00d631f4c49d) )
1033
1034   ROM_REGION16_BE( 0x200, "eeprom", 0 )
1035   ROM_LOAD( "gticlub.nv", 0x0000, 0x0200, CRC(eca78a49) SHA1(3dcaccc4bee58f7ff5d6ecae551887cc967deaf7) )
10301036ROM_END
10311037
10321038ROM_START( gticlubj ) /* Japan version JAA */
r7553r7554
10541060   ROM_LOAD64_WORD( "688a14.13d", 0x000002, 0x200000, CRC(b9932735) SHA1(2492244d2acb350974202a6718bc7121325d2121) )
10551061   ROM_LOAD64_WORD( "688a15.9d",  0x000004, 0x200000, CRC(8aadee51) SHA1(be9020a47583da9d4ff586d227836dc5b7dc31f0) )
10561062   ROM_LOAD64_WORD( "688a16.4d",  0x000006, 0x200000, CRC(7f4e1893) SHA1(585be7b31ab7a48300c22b00443b00d631f4c49d) )
1063
1064   ROM_REGION16_BE( 0x200, "eeprom", 0 )
1065   ROM_LOAD( "gticlub.nv", 0x0000, 0x0200, CRC(eca78a49) SHA1(3dcaccc4bee58f7ff5d6ecae551887cc967deaf7) )
10571066ROM_END
10581067
10591068ROM_START( thunderh ) /* Euro version EAA */
r7553r7554
11671176   ROM_REGION(0x800000, "user5", 0)   /* texture roms */
11681177   ROM_LOAD32_WORD( "685a13.4w",  0x000002, 0x400000, CRC(06329af4) SHA1(76cad9db604751ce48bb67bfd29e57bac0ee9a16) )
11691178   ROM_LOAD32_WORD( "685a14.12w", 0x000000, 0x400000, CRC(87437739) SHA1(0d45637af40938a54d5efd29c125b0fafd55f9a4) )
1179
1180   ROM_REGION16_BE( 0x200, "eeprom", 0 )
1181   ROM_LOAD( "hangplt.nv", 0x0000, 0x0200, CRC(35f482c8) SHA1(445918156770449dce1a010aab9d310f15670092) )
11701182ROM_END
11711183
11721184static DRIVER_INIT(gticlub)
src/mame/drivers/goldstar.c
r7553r7554
378378   AM_RANGE(0xf800, 0xffff) AM_RAM
379379ADDRESS_MAP_END
380380
381static WRITE8_HANDLER( magical_outb850_w )
382{
383   // guess, could be wrong, this might just be lights
384
385   goldstar_state *state = (goldstar_state *)space->machine->driver_data;
386
387   if (data&0x20)
388      state->tile_bank = 1;
389   else
390      state->tile_bank = 0;
391
392   //popmessage("magical_outb850_w %02x\n", data);
393
394   tilemap_mark_all_tiles_dirty (state->fg_tilemap);
395
396}
397
398static WRITE8_HANDLER( magical_outb860_w )
399{
400//  popmessage("magical_outb860_w %02x\n", data);
401}
402
403static ADDRESS_MAP_START(magical_map, ADDRESS_SPACE_PROGRAM, 8 )
404   AM_RANGE(0x0000, 0x7fff) AM_ROM
405   // where does the extra rom data map?? it seems like it should come straight after the existing rom, but it can't if this is a plain z80?
406   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE("share1") AM_BASE_MEMBER(goldstar_state,nvram) AM_SIZE_MEMBER(goldstar_state,nvram_size)
407   AM_RANGE(0x8800, 0x8fff) AM_RAM_WRITE(goldstar_fg_vidram_w) AM_BASE_MEMBER(goldstar_state,fg_vidram)
408   AM_RANGE(0x9000, 0x97ff) AM_RAM_WRITE(goldstar_fg_atrram_w) AM_BASE_MEMBER(goldstar_state,fg_atrram)
409   AM_RANGE(0x9800, 0x99ff) AM_RAM_WRITE(goldstar_reel1_ram_w) AM_BASE_MEMBER(goldstar_state,reel1_ram)
410   AM_RANGE(0xa000, 0xa1ff) AM_RAM_WRITE(goldstar_reel2_ram_w) AM_BASE_MEMBER(goldstar_state,reel2_ram)
411   AM_RANGE(0xa900, 0xaaff) AM_RAM_WRITE(goldstar_reel3_ram_w) AM_BASE_MEMBER(goldstar_state,reel3_ram) // +0x100 compared to lucky8
412   AM_RANGE(0xb040, 0xb07f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel1_scroll)
413   AM_RANGE(0xb080, 0xb0bf) AM_RAM AM_BASE_MEMBER(goldstar_state,reel2_scroll)
414   AM_RANGE(0xb100, 0xb17f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel3_scroll)
415
416   AM_RANGE(0xb800, 0xb803) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)   /* Input Ports */
417   AM_RANGE(0xb810, 0xb813) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)   /* Input Ports */
418   AM_RANGE(0xb820, 0xb823) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w)   /* Input/Output Ports */
419   AM_RANGE(0xb830, 0xb830) AM_DEVREADWRITE("aysnd", ay8910_r, ay8910_data_w)
420   AM_RANGE(0xb840, 0xb840) AM_DEVWRITE("aysnd", ay8910_address_w)   /* no sound... only use both ports for DSWs */
421   AM_RANGE(0xb850, 0xb850) AM_WRITE(magical_outb850_w) //lamps
422   AM_RANGE(0xb860, 0xb860) AM_WRITE(magical_outb860_w) //watchdog
423   AM_RANGE(0xb870, 0xb870) AM_DEVWRITE("snsnd", sn76496_w)   /* sound */
424   AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("maincpu",0xc000)
425ADDRESS_MAP_END
426
381427static ADDRESS_MAP_START( kkojnoli_map, ADDRESS_SPACE_PROGRAM, 8 )
382428   AM_RANGE(0x0000, 0x7fff) AM_ROM
383429   AM_RANGE(0x8000, 0x87ff) AM_RAM   /* definitely no NVRAM */
r7553r7554
463509ADDRESS_MAP_END
464510
465511
512/*
466513static READ8_HANDLER( unkch_unk_r )
467514{
468   return 0xff;
515    return 0xff;
469516}
517*/
470518
471// scrolling is wrong / different
519
520/* newer / more capable hw */
472521static ADDRESS_MAP_START( unkch_map, ADDRESS_SPACE_PROGRAM, 8 )
473522   AM_RANGE(0x0000, 0x9fff) AM_ROM
474523   AM_RANGE(0xc000, 0xc1ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE_GENERIC(paletteram)
475524   AM_RANGE(0xc800, 0xc9ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE_GENERIC(paletteram2)
476525
477526   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_MEMBER(goldstar_state,nvram) AM_SIZE_MEMBER(goldstar_state,nvram_size)
478   AM_RANGE(0xd800, 0xdfff) AM_RAM
479527
528   AM_RANGE(0xd840, 0xd87f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel1_scroll)
529   AM_RANGE(0xd880, 0xd8bf) AM_RAM AM_BASE_MEMBER(goldstar_state,reel2_scroll)
530   AM_RANGE(0xd900, 0xd93f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel3_scroll)
531   AM_RANGE(0xdfc0, 0xdfff) AM_RAM
480532
481533   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(goldstar_fg_vidram_w) AM_BASE_MEMBER(goldstar_state,fg_vidram)
482534   AM_RANGE(0xe800, 0xefff) AM_RAM_WRITE(goldstar_fg_atrram_w) AM_BASE_MEMBER(goldstar_state,fg_atrram)
r7553r7554
485537   AM_RANGE(0xf200, 0xf3ff) AM_RAM_WRITE( goldstar_reel2_ram_w ) AM_BASE_MEMBER(goldstar_state,reel2_ram)
486538   AM_RANGE(0xf400, 0xf5ff) AM_RAM_WRITE( goldstar_reel3_ram_w ) AM_BASE_MEMBER(goldstar_state,reel3_ram)
487539   AM_RANGE(0xf600, 0xf7ff) AM_RAM
488
489   AM_RANGE(0xf800, 0xf87f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel1_scroll)
490   AM_RANGE(0xf880, 0xf9ff) AM_RAM
491   AM_RANGE(0xfa00, 0xfa7f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel2_scroll)
492   AM_RANGE(0xfa80, 0xfbff) AM_RAM
493   AM_RANGE(0xfc00, 0xfc7f) AM_RAM AM_BASE_MEMBER(goldstar_state,reel3_scroll)
494   AM_RANGE(0xfc80, 0xffff) AM_RAM
540   AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE( unkch_reel1_attrram_w ) AM_BASE_MEMBER(goldstar_state,reel1_attrram)
541   AM_RANGE(0xfa00, 0xfbff) AM_RAM_WRITE( unkch_reel2_attrram_w ) AM_BASE_MEMBER(goldstar_state,reel2_attrram)
542   AM_RANGE(0xfc00, 0xfdff) AM_RAM_WRITE( unkch_reel3_attrram_w ) AM_BASE_MEMBER(goldstar_state,reel3_attrram)
543   AM_RANGE(0xfe00, 0xffff) AM_RAM
495544ADDRESS_MAP_END
496545
546static WRITE8_HANDLER( unkcm_0x02_w )
547{
548   //popmessage("unkcm_0x02_w %02x", data);
549}
550
551static WRITE8_HANDLER( unkcm_0x03_w )
552{
553   //popmessage("unkcm_0x03_w %02x", data);
554   goldstar_state *state = (goldstar_state *)space->machine->driver_data;
555
556   state->unkch_vidreg = data;
557
558   // -x-- ----   seems to toggle when a 'normal' tilemap should be displayed instead of the reels?
559}
560
561
562static WRITE8_HANDLER( unkcm_0x11_w )
563{
564   //popmessage("unkcm_0x11_w %02x", data);
565}
566
567static WRITE8_HANDLER( unkcm_0x12_w )
568{
569//  popmessage("unkcm_0x12_w %02x", data);
570}
571
572
497573static ADDRESS_MAP_START( unkch_portmap, ADDRESS_SPACE_IO, 8 )
498574   ADDRESS_MAP_GLOBAL_MASK(0xff)
499575//  AM_RANGE(0x01, 0x01) AM_DEVREAD("aysnd", ay8910_r)
500//  AM_RANGE(0x02, 0x03) AM_DEVWRITE("aysnd", ay8910_data_address_w)
576   AM_RANGE(0x02, 0x02) AM_WRITE(unkcm_0x02_w)
577   AM_RANGE(0x03, 0x03) AM_WRITE(unkcm_0x03_w)
578   AM_RANGE(0x11, 0x11) AM_WRITE(unkcm_0x11_w)
579   AM_RANGE(0x12, 0x12) AM_WRITE(unkcm_0x12_w)
580
501581//  AM_RANGE(0x04, 0x07) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w) /* Input Ports */
502582//  AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w) /* DIP switches */
503583//  AM_RANGE(0x10, 0x10) AM_WRITE (cm_outport0_w)   /* output port */
r7553r7554
506586//  AM_RANGE(0x13, 0x13) AM_WRITE(cm_background_col_w)
507587//  AM_RANGE(0x14, 0x14) AM_WRITE(cm_girl_scroll_w)
508588
509   AM_RANGE(0x08, 0x09) AM_READ(unkch_unk_r)
589   AM_RANGE(0x08, 0x08) AM_READ_PORT("IN0")
590   AM_RANGE(0x09, 0x09) AM_READ_PORT("IN1")
591   AM_RANGE(0x0a, 0x0a) AM_READ_PORT("IN2")
592   AM_RANGE(0x0b, 0x0b) AM_READ_PORT("IN3")
593   AM_RANGE(0x10, 0x10) AM_READ_PORT("IN4")
594
510595ADDRESS_MAP_END
511596
512597
r7553r7554
26092694   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
26102695INPUT_PORTS_END
26112696
2697/* not verified */
2698static INPUT_PORTS_START( magical )
2699   PORT_START("IN0")   /* d800 */
2700   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2701   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2702   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_X) PORT_NAME("P1 - Big / Switch Controls")
2703   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_B) PORT_NAME("P1 - Double-Up")
2704   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_Z) PORT_NAME("P1 - Take Score")
2705   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_V) PORT_NAME("P1 - Bet")
2706   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("P1 - Small / Info")
2707   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_N) PORT_NAME("P1 - Start")
2708
2709   PORT_START("IN1")   /* d801 */
2710   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2711   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2712   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_CODE(KEYCODE_S) PORT_NAME("P2 - Big / Switch Controls")
2713   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_CODE(KEYCODE_G) PORT_NAME("P2 - Double-Up")
2714   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_CODE(KEYCODE_A) PORT_NAME("P2 - Take Score")
2715   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_CODE(KEYCODE_F) PORT_NAME("P2 - Bet")
2716   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_D) PORT_NAME("P2 - Small / Info")
2717   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_CODE(KEYCODE_H) PORT_NAME("P2 - Start")
2718
2719   PORT_START("IN2")   /* d802 */
2720   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2721   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2722   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2723   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2724   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
2725   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
2726   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
2727   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
2728
2729   PORT_START("IN3")   /* d810 */
2730   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2731   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2732   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2733   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2734   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2)   // CoinD?
2735   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)   // CoinC?
2736   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN )
2737   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)   // CoinA?
2738
2739   PORT_START("IN4")   /* d811 */
2740   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
2741   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
2742   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
2743   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
2744   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Key Out / Attendant")
2745   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("Hopper")
2746   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_SERVICE ) PORT_NAME("Settings")
2747   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats")
2748
2749   PORT_START("DSW1")
2750   PORT_DIPNAME( 0x07, 0x00, "Coin A Rate" ) PORT_DIPLOCATION("DSW1:1,2,3")
2751   PORT_DIPSETTING(    0x05, "1" )
2752   PORT_DIPSETTING(    0x06, "2" )
2753   PORT_DIPSETTING(    0x07, "5" )
2754   PORT_DIPSETTING(    0x04, "10" )
2755   PORT_DIPSETTING(    0x03, "20" )
2756   PORT_DIPSETTING(    0x02, "30" )
2757   PORT_DIPSETTING(    0x01, "40" )
2758   PORT_DIPSETTING(    0x00, "50" )
2759   PORT_DIPNAME( 0x38, 0x00, "Key In" ) PORT_DIPLOCATION("DSW1:4,5,6") // aka 'Coin B'
2760   PORT_DIPSETTING(    0x10, "5" )
2761   PORT_DIPSETTING(    0x18, "10" )
2762   PORT_DIPSETTING(    0x20, "20" )
2763   PORT_DIPSETTING(    0x28, "25" )
2764   PORT_DIPSETTING(    0x30, "40" )
2765   PORT_DIPSETTING(    0x38, "50" )
2766   PORT_DIPSETTING(    0x08, "60" )
2767   PORT_DIPSETTING(    0x00, "100" )
2768   PORT_DIPNAME( 0xc0, 0x00, "Coin C Rate" ) PORT_DIPLOCATION("DSW1:7,8")
2769   PORT_DIPSETTING(    0x40, "5" )
2770   PORT_DIPSETTING(    0x80, "10" )
2771   PORT_DIPSETTING(    0xc0, "25" )
2772   PORT_DIPSETTING(    0x00, "50" )
2773
2774   PORT_START("DSW2")
2775   PORT_DIPNAME( 0x07, 0x04, "Main Game Level" )         PORT_DIPLOCATION("DSW2:1,2,3")
2776   PORT_DIPSETTING(    0x00, "+4" )
2777   PORT_DIPSETTING(    0x01, "+3" )
2778   PORT_DIPSETTING(    0x02, "+2" )
2779   PORT_DIPSETTING(    0x03, "+1" )
2780   PORT_DIPSETTING(    0x04, "0" )
2781   PORT_DIPSETTING(    0x05, "-1" )
2782   PORT_DIPSETTING(    0x06, "-2" )
2783   PORT_DIPSETTING(    0x07, "-3" )
2784   PORT_DIPNAME( 0x08, 0x08, "Nudity / Strip" )   PORT_DIPLOCATION("DSW2:4") // verified
2785   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2786   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2787   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:5")
2788   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2789   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2790   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:6")
2791   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2792   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2793   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:7")
2794   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2795   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2796   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW2:8")
2797   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2798   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2799
2800
2801   PORT_START("DSW3")
2802   PORT_DIPNAME( 0x03, 0x03, "Credit Limit" )   PORT_DIPLOCATION("DSW3:1,2")
2803   PORT_DIPSETTING(    0x00, "1000" )
2804   PORT_DIPSETTING(    0x01, "2000" )
2805   PORT_DIPSETTING(    0x02, "3000" )
2806   PORT_DIPSETTING(    0x03, "Unlimited?" )
2807   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:3")
2808   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2809   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2810   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW3:4")
2811   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2812   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2813   PORT_DIPNAME( 0xf0, 0xf0, "Coin D Rate" )         PORT_DIPLOCATION("DSW3:5,6,7,8")
2814   PORT_DIPSETTING(    0x00, "10-1" )
2815   PORT_DIPSETTING(    0x10, "5-1" )
2816   PORT_DIPSETTING(    0x20, "5-2" )
2817   PORT_DIPSETTING(    0x30, "4-1" )
2818   PORT_DIPSETTING(    0x40, "4-3" )
2819   PORT_DIPSETTING(    0x50, "3-2" )
2820   PORT_DIPSETTING(    0x60, "3-1" )
2821   PORT_DIPSETTING(    0x70, "2-1" )
2822   PORT_DIPSETTING(    0x80, "2-3" )
2823   PORT_DIPSETTING(    0x90, "2-5" )
2824   PORT_DIPSETTING(    0xf0, "1-1" )
2825   PORT_DIPSETTING(    0xe0, "1-2" )
2826   PORT_DIPSETTING(    0xd0, "1-3" )
2827   PORT_DIPSETTING(    0xc0, "1-4" )
2828   PORT_DIPSETTING(    0xb0, "1-5" )
2829   PORT_DIPSETTING(    0xa0, "1-10" )
2830
2831   PORT_START("DSW4")
2832   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:1")
2833   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2834   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2835   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:2")
2836   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2837   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2838   PORT_DIPNAME( 0x0c, 0x0c, "Max Bet" )   PORT_DIPLOCATION("DSW4:3,4")
2839   PORT_DIPSETTING(    0x00, "8" )
2840   PORT_DIPSETTING(    0x04, "16" )
2841   PORT_DIPSETTING(    0x08, "32" )
2842   PORT_DIPSETTING(    0x0c, "64" )
2843   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:5")
2844   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2845   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2846   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:6")
2847   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2848   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2849   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:7")
2850   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2851   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2852   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("DSW4:8")
2853   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2854   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2855INPUT_PORTS_END
2856
26122857static INPUT_PORTS_START( ns8lines )
26132858   PORT_START("IN0")   /* d800 */
26142859//  PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r7553r7554
41534398INPUT_PORTS_END
41544399
41554400
4401static INPUT_PORTS_START( unkch )
4402   PORT_START("IN0")
4403   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("Bet A / STOP 2")
4404   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )   PORT_IMPULSE(2)
4405   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4406   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4407   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4408   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4409   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4410   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4411   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C) PORT_NAME("Take / STOP1")
4412   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("Bet B / D-UP")
4413   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V) PORT_NAME("Small / STOP 3")
4414   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B) PORT_NAME("Big")
4415
4416   PORT_START("IN1")
4417   PORT_DIPNAME( 0x01, 0x01, "IN1" )
4418   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4419   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4420   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4421   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4422   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4423   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4424   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4425   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4426   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4427   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4428   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4429   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4430   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4431   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4432   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4433   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4434   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4435   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start")
4436   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4437   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4438   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4439
4440
4441   PORT_START("IN2")
4442   PORT_DIPNAME( 0x01, 0x01, "IN2")
4443   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4444   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4445   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4446   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4447   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4448   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4449   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4450   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4451   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4452   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4453   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4454   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4455   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4456   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4457   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4458   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4459   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4460   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4461   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4462   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4463   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4464   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4465   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4466
4467   PORT_START("IN3")
4468   PORT_DIPNAME( 0x01, 0x01, "IN3" )
4469   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4470   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4471   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4472   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4473   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4474   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4475   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4476   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4477   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4478   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4479   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4480   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4481   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4482   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4483   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4484   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4485   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4486   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4487   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4488   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4489   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4490   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4491   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4492
4493   PORT_START("IN4")
4494   PORT_DIPNAME( 0x01, 0x01, "IN4" )
4495   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4496   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4497   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4498   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4499   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4500   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4501   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4502   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4503   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4504   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4505   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4506   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4507   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4508   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4509   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4510   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4511   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4512   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4513   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4514   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4515   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4516   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4517   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4518INPUT_PORTS_END
4519
4520static INPUT_PORTS_START( mtonic )
4521   PORT_START("IN0")
4522   PORT_DIPNAME( 0x01, 0x01, "IN0")
4523   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4524   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4525   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4526   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4527   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4528   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4529   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4530   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4531   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4532   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4533   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4534   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4535   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4536   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4537   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4538   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4539   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4540   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4541   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4542   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4543   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4544   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4545   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4546
4547   PORT_START("IN1")
4548   PORT_DIPNAME( 0x01, 0x01, "IN1")
4549   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4550   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4551   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4552   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4553   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4554   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4555   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4556   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4557   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4558   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4559   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4560   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4561   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4562   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4563   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4564   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4565   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4566   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4567   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4568   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4569   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4570   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4571   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4572
4573   PORT_START("IN2")
4574   PORT_DIPNAME( 0x01, 0x01, "IN2")
4575   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4576   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4577   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4578   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4579   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4580   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4581   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4582   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4583   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4584   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4585   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4586   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4587   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4588   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4589   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4590   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4591   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4592   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4593   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4594   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4595   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4596   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4597   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4598
4599   PORT_START("IN3")
4600   PORT_DIPNAME( 0x01, 0x01, "IN3")
4601   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4602   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4603   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4604   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4605   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4606   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4607   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4608   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4609   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4610   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4611   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4612   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4613   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4614   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4615   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4616   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4617   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4618   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4619   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4620   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4621   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4622   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4623   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4624
4625   PORT_START("IN4")
4626   PORT_DIPNAME( 0x01, 0x01, "IN4")
4627   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4628   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4629   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4630   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4631   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4632   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4633   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4634   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4635   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4636   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4637   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4638   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4639   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4640   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4641   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4642   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4643   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4644   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4645   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4646   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4647   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4648   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4649   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4650
4651   PORT_START("DSW1")
4652   PORT_DIPNAME( 0x01, 0x01, "DSW1")
4653   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4654   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4655   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4656   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4657   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4658   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4659   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4660   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4661   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4662   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4663   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4664   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4665   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4666   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4667   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4668   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4669   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4670   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4671   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4672   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4673   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4674   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4675   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4676
4677   PORT_START("DSW2")
4678   PORT_DIPNAME( 0x01, 0x01, "DSW2")
4679   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4680   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4681   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4682   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4683   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4684   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4685   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4686   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4687   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4688   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4689   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4690   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4691   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4692   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4693   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4694   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4695   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4696   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4697   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4698   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4699   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4700   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4701   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4702
4703   PORT_START("DSW3")
4704   PORT_DIPNAME( 0x01, 0x01, "DSW3")
4705   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4706   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4707   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4708   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4709   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4710   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4711   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4712   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4713   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4714   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4715   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4716   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4717   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4718   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4719   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4720   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4721   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4722   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4723   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4724   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4725   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4726   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4727   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4728
4729   PORT_START("DSW4")
4730   PORT_DIPNAME( 0x01, 0x01, "DSW4")
4731   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4732   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4733   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
4734   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4735   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4736   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
4737   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4738   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4739   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
4740   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4741   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4742   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
4743   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4744   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4745   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
4746   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4747   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4748   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
4749   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4750   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4751   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
4752   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4753   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4754INPUT_PORTS_END
4755
41564756static const gfx_layout charlayout =
41574757{
41584758   8,8,    /* 8*8 characters */
r7553r7554
44485048
44495049static GFXDECODE_START( unkch )
44505050   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x4alt_layout, 0, 16 )
4451   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4alt2_layout, 128, 8 )
5051   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4alt2_layout, 0, 16 )
44525052GFXDECODE_END
44535053
44545054static const gfx_layout tilescherrys_layout =
r7553r7554
44685068GFXDECODE_END
44695069
44705070
5071static const gfx_layout tiles8x8x4pkr_layout =
5072{
5073   8,8,    /* 8*8 characters */
5074   RGN_FRAC(1,1),    /* 4096 characters */
5075   4,      /* 3 bits per pixel */
5076   { 0, 2, 4, 6 }, /* the bitplanes are packed in one byte */
5077   { 0*8+0, 0*8+1, 1*8+0, 1*8+1, 2*8+0, 2*8+1, 3*8+0, 3*8+1 },
5078   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
5079   32*8   /* every char takes 32 consecutive bytes */
5080};
44715081
5082static const gfx_layout tiles8x32x4pkr_layout =
5083{
5084   8,32,    /* 8*8 characters */
5085   RGN_FRAC(1,1),    /* 4096 characters */
5086   4,      /* 3 bits per pixel */
5087   { 0, 2, 4, 6 }, /* the bitplanes are packed in one byte */
5088   { 0*8+0, 0*8+1, 1*8+0, 1*8+1, 2*8+0, 2*8+1, 3*8+0, 3*8+1 },
5089   { 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,
5090    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},
5091   32*8*4   /* every char takes 32 consecutive bytes */
5092};
5093
5094static GFXDECODE_START( pkrmast )
5095   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x4pkr_layout, 0, 16 )
5096   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4pkr_layout, 0, 16 )
5097GFXDECODE_END
5098
5099
5100
44725101/*************************************
44735102*      PPI 8255 (x3) Interfaces      *
44745103*************************************/
r7553r7554
45215150   }
45225151};
45235152
5153
5154
5155
5156static WRITE8_DEVICE_HANDLER( system_outputa_w )
5157{
5158   //goldstar_state *state = (goldstar_state *)device->machine->driver_data;
5159   //popmessage("system_outputa_w %02x",data);
5160}
5161
5162
5163static WRITE8_DEVICE_HANDLER( system_outputb_w )
5164{
5165   //goldstar_state *state = (goldstar_state *)device->machine->driver_data;
5166   //popmessage("system_outputb_w %02x",data);
5167}
5168
5169
5170static WRITE8_DEVICE_HANDLER( system_outputc_w )
5171{
5172   goldstar_state *state = (goldstar_state *)device->machine->driver_data;
5173
5174   state->lucky8_nmi_enable = data & 8;
5175   state->unkch_vidreg = data & 2;
5176   //popmessage("system_outputc_w %02x",data);
5177}
5178
5179
45245180static const ppi8255_interface lucky8_ppi8255_intf[3] =
45255181{
45265182   {   /* A, B & C set as input */
r7553r7554
45435199      DEVCB_INPUT_PORT("DSW2"),   /* Port A read */
45445200      DEVCB_NULL,               /* Port B read */
45455201      DEVCB_NULL,               /* Port C read */
4546      DEVCB_NULL,               /* Port A write */
4547      DEVCB_NULL,               /* Port B write */
4548      DEVCB_NULL               /* Port C write */
5202      DEVCB_HANDLER(system_outputa_w),               /* Port A write */
5203      DEVCB_HANDLER(system_outputb_w),               /* Port B write */
5204      DEVCB_HANDLER(system_outputc_w)         /* Port C write */
45495205   }
45505206};
45515207
r7553r7554
46175273   DEVCB_NULL
46185274};
46195275
5276static WRITE8_DEVICE_HANDLER( ay8910_outputa_w )
5277{
5278   //goldstar_state *state = (goldstar_state *)device->machine->driver_data;
5279   //popmessage("ay8910_outputa_w %02x",data);
5280}
5281
5282static WRITE8_DEVICE_HANDLER( ay8910_outputb_w )
5283{
5284   //goldstar_state *state = (goldstar_state *)device->machine->driver_data;
5285   //popmessage("ay8910_outputb_w %02x",data);
5286}
5287
46205288static const ay8910_interface lucky8_ay8910_config =
46215289{
46225290   AY8910_LEGACY_OUTPUT,
46235291   AY8910_DEFAULT_LOADS,
46245292   DEVCB_INPUT_PORT("DSW3"),
46255293   DEVCB_INPUT_PORT("DSW4"),
4626   DEVCB_NULL,
4627   DEVCB_NULL
5294   DEVCB_HANDLER(ay8910_outputa_w),
5295   DEVCB_HANDLER(ay8910_outputb_w)
46285296};
46295297
46305298static const ay8910_interface ladylinr_ay8910_config =
r7553r7554
50165684   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
50175685MACHINE_DRIVER_END
50185686
5687static INTERRUPT_GEN( lucky8_irq )
5688{
5689   goldstar_state *state = (goldstar_state *)device->machine->driver_data;
5690
5691   if(state->lucky8_nmi_enable)
5692      cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
5693}
5694
50195695static MACHINE_DRIVER_START( lucky8 )
50205696
50215697   MDRV_DRIVER_DATA(goldstar_state)
r7553r7554
50245700   MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK)
50255701   MDRV_CPU_PROGRAM_MAP(lucky8_map)
50265702   //MDRV_CPU_IO_MAP(goldstar_readport)
5027   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
5028//  MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) // causes 'magical' to display 'wait' instead
5703   MDRV_CPU_VBLANK_INT("screen", lucky8_irq)
50295704
50305705   /* 3x 8255 */
50315706   MDRV_PPI8255_ADD( "ppi8255_0", lucky8_ppi8255_intf[0] )
r7553r7554
50605735
50615736MACHINE_DRIVER_END
50625737
5738static MACHINE_DRIVER_START( magical )
50635739
5740   MDRV_DRIVER_DATA(goldstar_state)
5741
5742   /* basic machine hardware */
5743   MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK)
5744   MDRV_CPU_PROGRAM_MAP(magical_map)
5745   //MDRV_CPU_IO_MAP(goldstar_readport)
5746   MDRV_CPU_VBLANK_INT("screen", lucky8_irq)
5747
5748   /* 3x 8255 */
5749   MDRV_PPI8255_ADD( "ppi8255_0", lucky8_ppi8255_intf[0] )
5750   MDRV_PPI8255_ADD( "ppi8255_1", lucky8_ppi8255_intf[1] )
5751   MDRV_PPI8255_ADD( "ppi8255_2", lucky8_ppi8255_intf[2] )
5752
5753   /* video hardware */
5754   MDRV_SCREEN_ADD("screen", RASTER)
5755   MDRV_SCREEN_REFRESH_RATE(60)
5756//  MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
5757   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
5758   MDRV_SCREEN_SIZE(64*8, 32*8)
5759   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
5760   MDRV_PALETTE_INIT(lucky8)
5761
5762   MDRV_GFXDECODE(ncb3)
5763   MDRV_PALETTE_LENGTH(256)
5764   MDRV_NVRAM_HANDLER(goldstar)
5765
5766   MDRV_VIDEO_START(magical)
5767   MDRV_VIDEO_UPDATE(magical)
5768
5769   /* sound hardware */
5770   MDRV_SPEAKER_STANDARD_MONO("mono")
5771
5772   MDRV_SOUND_ADD("snsnd", SN76489, PSG_CLOCK)
5773   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.00)  // shut up annoying whine
5774
5775   MDRV_SOUND_ADD("aysnd", AY8910, AY_CLOCK)
5776   MDRV_SOUND_CONFIG(lucky8_ay8910_config)
5777   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
5778MACHINE_DRIVER_END
5779
5780
50645781static MACHINE_DRIVER_START( kkojnoli )
50655782
50665783   MDRV_DRIVER_DATA(goldstar_state)
r7553r7554
53726089
53736090   //MDRV_NVRAM_HANDLER(goldstar)
53746091
5375   MDRV_VIDEO_START(cherrym)
5376   MDRV_VIDEO_UPDATE(goldstar)
6092   MDRV_VIDEO_START(unkch)
6093   MDRV_VIDEO_UPDATE(unkch)
53776094
53786095   /* sound hardware */
53796096   MDRV_SPEAKER_STANDARD_MONO("mono")
53806097
5381   MDRV_SOUND_ADD("aysnd", AY8910, AY_CLOCK)
5382   MDRV_SOUND_CONFIG(ay8910_config)
5383   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
6098//  MDRV_SOUND_ADD("aysnd", AY8910, AY_CLOCK)
6099//  MDRV_SOUND_CONFIG(ay8910_config)
6100//  MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
53846101MACHINE_DRIVER_END
53856102
53866103static MACHINE_DRIVER_START( cherrys )
r7553r7554
53906107
53916108MACHINE_DRIVER_END
53926109
6110// hw unknown
6111static MACHINE_DRIVER_START( pkrmast )
6112
6113   MDRV_DRIVER_DATA(goldstar_state)
6114
6115   /* basic machine hardware */
6116   MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK)
6117   MDRV_CPU_PROGRAM_MAP(cm_map)
6118   MDRV_CPU_IO_MAP(cm_portmap)
6119   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
6120
6121   /* 2x 8255 */
6122   MDRV_PPI8255_ADD( "ppi8255_0", cm_ppi8255_intf[0] )
6123   MDRV_PPI8255_ADD( "ppi8255_1", cm_ppi8255_intf[1] )
6124
6125   /* video hardware */
6126   MDRV_SCREEN_ADD("screen", RASTER)
6127   MDRV_SCREEN_REFRESH_RATE(60)
6128//  MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
6129   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
6130   MDRV_SCREEN_SIZE(64*8, 32*8)
6131   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
6132
6133   MDRV_GFXDECODE(pkrmast)
6134   MDRV_PALETTE_LENGTH(256)
6135   MDRV_PALETTE_INIT(cm)
6136   MDRV_NVRAM_HANDLER(goldstar)
6137
6138   MDRV_VIDEO_START(cherrym)
6139   MDRV_VIDEO_UPDATE(goldstar)
6140
6141   /* sound hardware */
6142   MDRV_SPEAKER_STANDARD_MONO("mono")
6143   MDRV_SOUND_ADD("aysnd", AY8910, AY_CLOCK)
6144   MDRV_SOUND_CONFIG(cm_ay8910_config)
6145   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
6146MACHINE_DRIVER_END
6147
53936148/***************************************************************************
53946149
53956150  Game driver(s)
r7553r7554
60066761   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
60076762ROM_END
60086763
6764
6765ROM_START( cmezspin )
6766   ROM_REGION( 0x10000, "maincpu", 0 )
6767   ROM_LOAD( "ezspin.rom",  0x0000,  0x1000, CRC(de92b85c) SHA1(36e99b1444980a279293839c6db10f577b9e8657) )
6768   ROM_CONTINUE(0x4000,0x1000)
6769   ROM_CONTINUE(0x3000,0x1000)
6770   ROM_CONTINUE(0x7000,0x1000)
6771   ROM_CONTINUE(0x1000,0x1000)
6772   ROM_CONTINUE(0x6000,0x1000)
6773   ROM_CONTINUE(0x2000,0x1000)
6774   ROM_CONTINUE(0x5000,0x1000)
6775
6776   ROM_REGION( 0x18000, "gfx1", 0 )
6777   ROM_LOAD( "u16.7", 0x00000,  0x8000, CRC(19cc1d67) SHA1(47487f9362bfb36a32100ed772960628844462bf) )
6778   ROM_LOAD( "up11.6", 0x08000,  0x8000, CRC(c1466efa) SHA1(d725fc507c77e66bde93d0c33bf469add15f39b9) ) // changed title
6779   ROM_LOAD( "u4.5",  0x10000,  0x8000, CRC(e39fff9c) SHA1(22fdc517fa478441622c6245cecb5728c5595757) )
6780
6781   ROM_REGION( 0x8000, "gfx2", 0 )
6782   ROM_LOAD( "u15.4",  0x0000,  0x2000, CRC(8607ffd9) SHA1(9bc94715554aa2473ae2ed249a47f29c7886b3dc) )
6783   ROM_LOAD( "u10.3",  0x2000,  0x2000, CRC(c32367be) SHA1(ff217021b9c58e23b2226f8b0a7f5da966225715) )
6784   ROM_LOAD( "u14.2",  0x4000,  0x2000, CRC(6dfcb188) SHA1(22430429c798954d9d979e62699b58feae7fdbf4) )
6785   ROM_LOAD( "u9.1",   0x6000,  0x2000, CRC(9678ead2) SHA1(e80aefa98b2363fe9e6b2415762695ace272e4d3) )
6786
6787   ROM_REGION( 0x10000, "user1", 0 )
6788   ROM_LOAD( "u53.8",  0x0000, 0x10000, CRC(e92443d3) SHA1(4b6ca4521841610054165f085ae05510e77af191) )
6789
6790   /* proms taken from cmv4, probably wrong  */
6791   ROM_REGION( 0x200, "proms", 0 )
6792   ROM_LOAD( "82s129.u84", 0x0000, 0x0100, CRC(0489b760) SHA1(78f8632b17a76335183c5c204cdec856988368b0) )
6793   ROM_LOAD( "82s129.u70", 0x0100, 0x0100, CRC(21eb5b19) SHA1(9b8425bdb97f11f4855c998c7792c3291fd07470) )
6794
6795   ROM_REGION( 0x100, "proms2", 0 )
6796   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
6797ROM_END
6798
60096799ROM_START( cmasterc )
60106800   ROM_REGION( 0x10000, "maincpu", 0 )
60116801   ROM_LOAD( "msii841.u81",  0x3000,  0x1000, CRC(977db602) SHA1(0fd3d6781b654ac6befdc9278f84ca708d5d448c) )
r7553r7554
62207010   ROM_LOAD( "82s129.u46", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) )
62217011ROM_END
62227012
7013// the program roms on these seem scrambled somehow, and there are no gfx roms dumped
7014ROM_START( jkrmast )
7015   ROM_REGION( 0x10000, "maincpu", 0 )
7016   ROM_LOAD( "jokermaster.rom",  0x0000, 0x10000, CRC(73caf824) SHA1(b7a7bb6190465f7c3b40f2ef97f4f6beeb89ec41) )
62237017
7018   // unknown # of roms / sizes
7019   ROM_REGION( 0x20000, "gfx1", 0 )
7020   ROM_LOAD( "gfx_roms", 0x00000,  0x8000, NO_DUMP )
7021   ROM_REGION( 0x20000, "gfx2", ROMREGION_ERASE00 )
7022
7023   ROM_REGION( 0x10000, "user1", ROMREGION_ERASE00 )
7024   ROM_REGION( 0x200, "proms", 0 )
7025   ROM_LOAD( "proms", 0x00000,  0x200, NO_DUMP )
7026   ROM_REGION( 0x100, "proms2", ROMREGION_ERASE00 )
7027ROM_END
7028
7029ROM_START( pkrmast )
7030   ROM_REGION( 0x10000, "maincpu", 0 )
7031   ROM_LOAD( "pokermastera.rom",  0x0000, 0x10000, CRC(467249f7) SHA1(efbab56896dc58d22ec921e7f5fd0befcfaadc52) )
7032
7033   ROM_REGION( 0x20000, "gfx1", 0 ) // tiles
7034   ROM_LOAD( "103-2.bin", 0x00000,  0x20000, CRC(ed0dfbfe) SHA1(c3a5b68e821461b161293eaec1515e2b0f26c4f9) )
7035
7036   ROM_REGION( 0x20000, "gfx2", 0 ) // reels + girl?
7037   ROM_LOAD( "103-1.bin", 0x00000,  0x20000, CRC(e375cd4b) SHA1(68888126ff9743cd589f3426205231bc3a896588) )
7038
7039   ROM_REGION( 0x10000, "user1", ROMREGION_ERASE00 )
7040   ROM_REGION( 0x200, "proms", 0 )
7041   ROM_LOAD( "proms", 0x00000,  0x200, NO_DUMP )
7042   ROM_REGION( 0x100, "proms2", ROMREGION_ERASE00 )
7043ROM_END
7044
7045
7046
7047ROM_START( pkrmasta )
7048   ROM_REGION( 0x10000, "maincpu", 0 )
7049   ROM_LOAD( "pokermasterb.rom",  0x0000, 0x10000, CRC(f59e0273) SHA1(160426b86dbb8a718cb3b886f90a231baed86a40) )
7050
7051   ROM_REGION( 0x20000, "gfx1", 0 ) // tiles
7052   ROM_LOAD( "103-2.bin", 0x00000,  0x20000, CRC(ed0dfbfe) SHA1(c3a5b68e821461b161293eaec1515e2b0f26c4f9) )
7053
7054   ROM_REGION( 0x20000, "gfx2", 0 ) // reels + girl?
7055   ROM_LOAD( "103-1.bin", 0x00000,  0x20000, CRC(e375cd4b) SHA1(68888126ff9743cd589f3426205231bc3a896588) )
7056
7057   ROM_REGION( 0x10000, "user1", ROMREGION_ERASE00 )
7058   ROM_REGION( 0x200, "proms", 0 )
7059   ROM_LOAD( "proms", 0x00000,  0x200, NO_DUMP )
7060   ROM_REGION( 0x100, "proms2", ROMREGION_ERASE00 )
7061ROM_END
7062
7063
7064
62247065/*
62257066
62267067Cherry Master '91
r7553r7554
63717212ROM_END
63727213
63737214ROM_START( magical )
6374   ROM_REGION( 0x10000, "maincpu", 0 )
7215   ROM_REGION( 0x20000, "maincpu", 0 )
63757216   ROM_LOAD( "8_p6_d12.512", 0x00000, 0x08000, CRC(6978c662) SHA1(cfdbcdcd4085c264e1d0ad4f18160b40d2d4e406) )
63767217   ROM_IGNORE(0x8000) // 1ST AND 2ND HALF IDENTICAL
6377   ROM_LOAD( "9_p7_d14.512", 0x08000, 0x04000, CRC(095230ba) SHA1(e60f5497c2cd5f1c0fc33b1e21303dd569654e6d) )
7218   ROM_LOAD( "9_p7_d14.512", 0x0c000, 0x04000, CRC(095230ba) SHA1(e60f5497c2cd5f1c0fc33b1e21303dd569654e6d) )
63787219   ROM_IGNORE(0xc000) // BADADDR        --xxxxxxxxxxxxxx
63797220
63807221   ROM_REGION( 0x30000, "gfx1", 0 )
r7553r7554
63927233   ROM_LOAD( "proms", 0x0000, 0x0200, NO_DUMP )
63937234
63947235   ROM_REGION( 0x20, "proms2", ROMREGION_ERASE00 )
6395   //ROM_LOAD( "d13", 0x0000, 0x0020, CRC(c6b41352) SHA1(d7c3b5aa32e4e456c9432a13bede1db6d62eb270) )
7236   ROM_COPY( "proms", 0x00000, 0x00000, 0x20 ) // copy some fake colours from the no dump region
63967237
63977238   ROM_REGION( 0x100, "unkprom", ROMREGION_ERASE00 )
63987239   //ROM_LOAD( "g14", 0x0000, 0x0100, CRC(bd48de71) SHA1(e4fa1e774af1499bc568be5b2deabb859d8c8172) )
r7553r7554
87359576GAME( 1995, cmfun,     cmv4,     cm,       cmv4,     cmv4,      ROT0, "Dyna",              "Cherry Master (Fun USA v2.5 bootleg / hack)",  0 )
87369577GAME( 1991, cmaster,   0,        cm,       cmaster,  0,         ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 1)",           0 )
87379578GAME( 1991, cmasterb,  cmaster,  cm,       cmasterb, cmv4,      ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 2)",           0 )
9579GAME( 1991, cmezspin,  cmaster,  cm,       cmasterb, cmv4,      ROT0, "Dyna",              "Cherry Master I (E-Z Spin bootleg / hack)",           0 )
87389580GAME( 1991, cmasterc,  cmaster,  cmasterc, cmasterc, cmv4,      ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 3)",           0 )
87399581GAME( 1991, cmasterbv, cmaster,  cm,       cmasterb, cmv4,      ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 4, with Blitz Poker ROM?)", GAME_NOT_WORKING ) // Cherry Master works, but no idea how to use the Blitz ROM
87409582GAME( 1991, cmasterd,  cmaster,  cm,       cmasterb, cmv4,      ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 5)", 0 )
87419583GAME( 1991, cmastere,  cmaster,  cm,       cmasterb, cmv4,      ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 6)", 0 )
87429584GAME( 1991, cmasterf,  cmaster,  cm,       cmasterb, cmv4,      ROT0, "Dyna",              "Cherry Master I (ver.1.01, set 7)", 0 )
87439585
9586GAME( 199?, jkrmast,   0,        pkrmast,  cmasterb, cmv4,      ROT0, "<unknown>",              "Joker Master", GAME_NOT_WORKING ) // incomplete dump + encrypted?
9587GAME( 199?, pkrmast,   jkrmast,  pkrmast,  cmasterb, cmv4,      ROT0, "<unknown>",              "Poker Master (set 1)", GAME_NOT_WORKING ) // incomplete dump + encrypted?
9588GAME( 199?, pkrmasta,  jkrmast,  pkrmast,  cmasterb, cmv4,      ROT0, "<unknown>",              "Poker Master (set 2)", GAME_NOT_WORKING ) // incomplete dump + encrypted?
87449589
9590
87459591GAME( 1991, cmast91,   0,        cmast91,  cmast91,  cmast91,   ROT0, "Dyna",              "Cherry Master '91 (ver.1.30)",                0 )
87469592
87479593GAME( 1992, cmast92,   0,        cmast91,  cmast91,  cmast91,   ROT0, "Dyna",              "Cherry Master '92",                GAME_NOT_WORKING ) // no gfx roms are dumped
r7553r7554
87559601GAME( 198?, kkojnoli,  0,        kkojnoli, kkojnoli, 0,         ROT0, "south korean hack", "Kkoj Noli (Kill the Bees)",                   GAME_IMPERFECT_COLORS )
87569602GAME( 198?, wcat3,     0,        wcat3,    lucky8,   0,         ROT0, "E.A.I.",            "Wild Cat 3",                                  GAME_NOT_WORKING )
87579603
8758GAME( 198?, mtonic,    0,        ncb3,     cmv801,   mtonic,    ROT0, "Tonic",             "Magical Tonic?",                              GAME_WRONG_COLORS | GAME_NOT_WORKING )
8759GAME( 198?, magical,   0,        lucky8,   lucky8,   0,         ROT0, "Micro Manufacturing Inc.", "Magical Tonic / Magical Odds?",                   GAME_NOT_WORKING )
9604GAME( 1992, magical,   0,        magical,   magical,   0,        ROT0, "Pal Company / Micro Manufacturing Inc.", "Magical Odds (set 1)",                   GAME_WRONG_COLORS|GAME_IMPERFECT_GRAPHICS )
9605GAME( 1991, mtonic,    magical,  magical,   mtonic,    mtonic,   ROT0, "Pal Company",                            "Magical Odds (set 2, alt hardware)",     GAME_WRONG_COLORS | GAME_NOT_WORKING |GAME_NO_SOUND) // Magical Odds logo / company in GFX
87609606
87619607
87629608/* --- Amcoe games --- */
r7553r7554
87999645GAME( 2003, nfm,       0,        nfm,      nfb96bl,   0,         ROT0, "Ming-Yang Electronic", "New Fruit Machine (Ming-Yang Electronic)",              GAME_NOT_WORKING )
88009646
88019647// these have 'cherry 1994' in the program roms, but also "Super Cherry / New Cherry Gold '99" probably hacks of a 1994 version of Cherry Bonus / Cherry Master (Super Cherry Master?)
8802GAME( 1999, unkch1,   0,         unkch,    schery97,  unkch1,    ROT0, "bootleg",              "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", GAME_NOT_WORKING )
8803GAME( 1999, unkch2,   unkch1,    unkch,    schery97,  unkch1,    ROT0, "bootleg",              "Super Cherry Gold (bootleg of Super Cherry Master)",           GAME_NOT_WORKING )
8804GAME( 1999, unkch3,   unkch1,    unkch,    schery97,  unkch3,    ROT0, "bootleg",              "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", GAME_NOT_WORKING ) // cards have been hacked to look like barrels
8805GAME( 1999, unkch4,   unkch1,    unkch,    schery97,  unkch4,    ROT0, "bootleg",              "Grand Cherry Master (bootleg of Super Cherry Master)",         GAME_NOT_WORKING ) // by 'toy system' hungary
9648GAME( 1999, unkch1,   0,         unkch,    unkch,  unkch1,    ROT0, "bootleg",              "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND )
9649GAME( 1999, unkch2,   unkch1,    unkch,    unkch,  unkch1,    ROT0, "bootleg",              "Super Cherry Gold (bootleg of Super Cherry Master)",           GAME_NOT_WORKING|GAME_NO_SOUND )
9650GAME( 1999, unkch3,   unkch1,    unkch,    unkch,  unkch3,    ROT0, "bootleg",              "New Cherry Gold '99 (bootleg of Super Cherry Master) (set 2)", GAME_NOT_WORKING|GAME_NO_SOUND ) // cards have been hacked to look like barrels, girl removed?
9651GAME( 1999, unkch4,   unkch1,    unkch,    unkch,  unkch4,    ROT0, "bootleg",              "Grand Cherry Master (bootleg of Super Cherry Master)",         GAME_NOT_WORKING|GAME_NO_SOUND ) // by 'toy system' hungary
88069652
88079653
88089654
src/mame/drivers/simpsons.c
r7553r7554
388388   ROM_REGION( 0x140000, "k053260", 0 ) /* samples for the 053260 */
389389   ROM_LOAD( "072-d05.1f", 0x000000, 0x100000, CRC(1397a73b) SHA1(369422c84cca5472967af54b8351e29fcd69f621) )
390390   ROM_LOAD( "072-d04.1d", 0x100000, 0x040000, CRC(78778013) SHA1(edbd6d83b0d1a20df39bb160b92395586fa3c32d) )
391
392   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
393   ROM_LOAD( "simpsons.nv", 0x0000, 0x080, CRC(ec3f0449) SHA1(da35b98cd10bfabe9df3ede05462fabeb0e01ca9) )
391394ROM_END
392395
393396ROM_START( simpsons4pa ) /* World 4 Player, later? (by use of later leters) */
r7553r7554
415418   ROM_REGION( 0x140000, "k053260", 0 ) /* samples for the 053260 */
416419   ROM_LOAD( "072-d05.1f", 0x000000, 0x100000, CRC(1397a73b) SHA1(369422c84cca5472967af54b8351e29fcd69f621) )
417420   ROM_LOAD( "072-d04.1d", 0x100000, 0x040000, CRC(78778013) SHA1(edbd6d83b0d1a20df39bb160b92395586fa3c32d) )
421
422   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
423   ROM_LOAD( "simpsons4pa.nv", 0x0000, 0x080, CRC(ec3f0449) SHA1(da35b98cd10bfabe9df3ede05462fabeb0e01ca9) )
418424ROM_END
419425
420426
r7553r7554
443449   ROM_REGION( 0x140000, "k053260", 0 ) /* samples for the 053260 */
444450   ROM_LOAD( "072-d05.1f", 0x000000, 0x100000, CRC(1397a73b) SHA1(369422c84cca5472967af54b8351e29fcd69f621) )
445451   ROM_LOAD( "072-d04.1d", 0x100000, 0x040000, CRC(78778013) SHA1(edbd6d83b0d1a20df39bb160b92395586fa3c32d) )
452
453   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
454   ROM_LOAD( "simpsons2p.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
446455ROM_END
447456
448457ROM_START( simpsons2p2 ) /* World 2 Player, alt */
449458   ROM_REGION( 0x88000, "maincpu", 0 ) /* code + banked roms + banked ram */
450        ROM_LOAD( "072-g02.16c", 0x10000, 0x20000, CRC(580ce1d6) SHA1(5b07fb8e8041e1663980aa35d853fdc13b22dac5) )
459    ROM_LOAD( "072-g02.16c", 0x10000, 0x20000, CRC(580ce1d6) SHA1(5b07fb8e8041e1663980aa35d853fdc13b22dac5) )
451460   ROM_LOAD( "072-p01.17c", 0x30000, 0x20000, CRC(07ceeaea) SHA1(c18255ae1d578c2d53de80d6323cdf41cbe47b57) )
452        ROM_LOAD( "072-_13.13c", 0x50000, 0x20000, CRC(54e6df66) SHA1(1b83ae56cf1deb51b04880fa421f06568c938a99) ) /* Uknown revision/region code */
453        ROM_LOAD( "072-_12.15c", 0x70000, 0x18000, CRC(96636225) SHA1(5de95606e5c9337f18bc42f4df791cacafa20399) ) /* Uknown revision/region code */
461    ROM_LOAD( "072-_13.13c", 0x50000, 0x20000, CRC(54e6df66) SHA1(1b83ae56cf1deb51b04880fa421f06568c938a99) ) /* Unknown revision/region code */
462    ROM_LOAD( "072-_12.15c", 0x70000, 0x18000, CRC(96636225) SHA1(5de95606e5c9337f18bc42f4df791cacafa20399) ) /* Unknown revision/region code */
454463   ROM_CONTINUE(       0x08000, 0x08000 )
455464
456465   ROM_REGION( 0x28000, "audiocpu", 0 ) /* Z80 code + banks */
r7553r7554
470479   ROM_REGION( 0x140000, "k053260", 0 ) /* samples for the 053260 */
471480   ROM_LOAD( "072-d05.1f", 0x000000, 0x100000, CRC(1397a73b) SHA1(369422c84cca5472967af54b8351e29fcd69f621) )
472481   ROM_LOAD( "072-d04.1d", 0x100000, 0x040000, CRC(78778013) SHA1(edbd6d83b0d1a20df39bb160b92395586fa3c32d) )
482
483   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
484   ROM_LOAD( "simpsons2p2.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
473485ROM_END
474486
475487ROM_START( simpsons2pa ) /* Asia 2 Player */
r7553r7554
497509   ROM_REGION( 0x140000, "k053260", 0 ) /* samples for the 053260 */
498510   ROM_LOAD( "072-d05.1f", 0x000000, 0x100000, CRC(1397a73b) SHA1(369422c84cca5472967af54b8351e29fcd69f621) )
499511   ROM_LOAD( "072-d04.1d", 0x100000, 0x040000, CRC(78778013) SHA1(edbd6d83b0d1a20df39bb160b92395586fa3c32d) )
512
513   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
514   ROM_LOAD( "simpsons2pa.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
500515ROM_END
501516
502517ROM_START( simpsons2pj ) /* Japan 2 Player */
r7553r7554
524539   ROM_REGION( 0x140000, "k053260", 0 ) /* samples for the 053260 */
525540   ROM_LOAD( "072-d05.1f", 0x000000, 0x100000, CRC(1397a73b) SHA1(369422c84cca5472967af54b8351e29fcd69f621) )
526541   ROM_LOAD( "072-d04.1d", 0x100000, 0x040000, CRC(78778013) SHA1(edbd6d83b0d1a20df39bb160b92395586fa3c32d) )
542
543   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
544   ROM_LOAD( "simpsons2pj.nv", 0x0000, 0x080, CRC(3550a54e) SHA1(370cd40a12c471b3b6690ecbdde9c7979bc2a652) )
527545ROM_END
528546
529547/***************************************************************************
src/mame/drivers/cps1.c
r7553r7554
22562256   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
22572257INPUT_PORTS_END
22582258
2259
2260static INPUT_PORTS_START( dinoh )
2261   PORT_INCLUDE( dino )
2262
2263   PORT_MODIFY("DSWA")
2264   CPS1_COINAGE_2( "SW(A)" )
2265   PORT_DIPNAME( 0x08, 0x08, "Coin Slots" )            PORT_DIPLOCATION("SW(B):4")
2266   PORT_DIPSETTING(    0x00, "1" )
2267   PORT_DIPSETTING(    0x08, "3" )               // This setting can't be used in two-player mode
2268   PORT_DIPNAME( 0x10, 0x10, "Play Mode" )               PORT_DIPLOCATION("SW(B):5")
2269   PORT_DIPSETTING(    0x00, "2 Players" )
2270   PORT_DIPSETTING(    0x10, "3 Players" )
2271   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW(A):6" )         // This switch is not documented in the manual
2272   PORT_DIPNAME( 0x40, 0x40, "2 Coins to Start, 1 to Continue" )      PORT_DIPLOCATION("SW(A):7")
2273   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2274   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2275   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(A):8" )         // This switch is not documented in the manual
2276
2277   PORT_MODIFY("DSWB")
2278   PORT_DIPNAME( 0x07, 0x04, "Difficulty Level 1" )         PORT_DIPLOCATION("SW(B):1,2,3")
2279   PORT_DIPSETTING(    0x07, DEF_STR( Easiest ) )         // "01"
2280   PORT_DIPSETTING(    0x06, DEF_STR( Easier ) )         // "02"
2281   PORT_DIPSETTING(    0x05, DEF_STR( Easy ) )         // "03"
2282   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )         // "04"
2283   PORT_DIPSETTING(    0x03, DEF_STR( Medium ) )         // "05"
2284   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )         // "06"
2285   PORT_DIPSETTING(    0x01, DEF_STR( Harder ) )         // "07"
2286   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )         // "08"
2287   PORT_DIPNAME( 0x18, 0x10, "Difficulty Level 2" )         PORT_DIPLOCATION("SW(B):4,5")
2288   PORT_DIPSETTING(    0x18, DEF_STR( Easy ) )         // "01"
2289   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )         // "02"
2290   PORT_DIPSETTING(    0x08, DEF_STR( Hard ) )         // "03"
2291   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )         // "04"
2292   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Bonus_Life ) )         PORT_DIPLOCATION("SW(B):6,7")
2293   PORT_DIPSETTING(    0x60, "300k and 700k" )
2294   PORT_DIPSETTING(    0x40, "500k and 1000k" )
2295   PORT_DIPSETTING(    0x20, "1000k" )
2296   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
2297   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW(B):8" )
2298
2299   PORT_MODIFY("DSWC")
2300   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )            PORT_DIPLOCATION("SW(C):1,2")
2301   PORT_DIPSETTING(    0x00, "4" )
2302   PORT_DIPSETTING(    0x01, "3" )
2303   PORT_DIPSETTING(    0x02, "2" )
2304   PORT_DIPSETTING(    0x03, "1" )
2305   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) )         PORT_DIPLOCATION("SW(C):3")
2306   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2307   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2308   PORT_DIPNAME( 0x08, 0x08, "Freeze" )               PORT_DIPLOCATION("SW(C):4")
2309   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2310   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2311   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) )         PORT_DIPLOCATION("SW(C):5")
2312   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2313   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2314   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )         PORT_DIPLOCATION("SW(C):6")
2315   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2316   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2317   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )         PORT_DIPLOCATION("SW(C):7")
2318   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
2319   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2320   PORT_DIPNAME( 0x80, 0x80, "Game Mode")               PORT_DIPLOCATION("SW(C):8")
2321   PORT_DIPSETTING(    0x80, "Game" )
2322   PORT_DIPSETTING(    0x00, DEF_STR( Test ) )
2323
2324   PORT_MODIFY("IN1")
2325   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2326   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(1)
2327   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(1)
2328   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
2329   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2330   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2331   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2332   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2333   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2334   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(2)
2335   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(2)
2336   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
2337   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2338   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2339   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2340   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2341
2342   PORT_MODIFY("IN2")      /* Player 3 */
2343   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
2344   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
2345   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
2346   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
2347   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
2348   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
2349//  PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
2350   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN3 )
2351   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START3 )
2352INPUT_PORTS_END
2353
22592354/* Needs further checking */
22602355static INPUT_PORTS_START( punipic )
22612356   PORT_INCLUDE( cps1_2b )
r7553r7554
22942389   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE("eeprom", eeprom_set_cs_line)
22952390INPUT_PORTS_END
22962391
2392
2393static INPUT_PORTS_START( punisherbz )
2394   PORT_INCLUDE( punisher )
2395
2396   PORT_MODIFY("DSWA")
2397   CPS1_COINAGE_2( "SW(A)" )
2398   PORT_DIPNAME( 0x08, 0x08, "2 Coins to Start, 1 to Continue" )   PORT_DIPLOCATION("SW(A):4")
2399   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2400   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2401   PORT_DIPNAME( 0x30, 0x20, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW(A):5,6")
2402   PORT_DIPSETTING(    0x30, "1" )
2403   PORT_DIPSETTING(    0x20, "2" )
2404   PORT_DIPSETTING(    0x10, "3" )
2405   PORT_DIPSETTING(    0x00, "4" )
2406   PORT_DIPNAME( 0x40, 0x40, "Sound" )            PORT_DIPLOCATION("SW(A):7")
2407   PORT_DIPSETTING(    0x40, "Q Sound" )
2408   PORT_DIPSETTING(    0x00, "Monaural" )
2409   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) )      PORT_DIPLOCATION("SW(A):8")
2410   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2411   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2412
2413   PORT_MODIFY("DSWB")
2414   PORT_DIPNAME( 0x07, 0x04, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW(B):1,2,3")
2415   PORT_DIPSETTING(    0x07, "Extra Easy" )
2416   PORT_DIPSETTING(    0x06, DEF_STR( Very_Easy) )
2417   PORT_DIPSETTING(    0x05, DEF_STR( Easy) )
2418   PORT_DIPSETTING(    0x04, DEF_STR( Normal) )
2419   PORT_DIPSETTING(    0x03, DEF_STR( Hard) )
2420   PORT_DIPSETTING(    0x02, DEF_STR( Very_Hard) )
2421   PORT_DIPSETTING(    0x01, "Extra Hard" )
2422   PORT_DIPSETTING(    0x00, DEF_STR( Hardest) )
2423   PORT_DIPNAME( 0x18, 0x10, "Extend" )            PORT_DIPLOCATION("SW(B):4,5")
2424   PORT_DIPSETTING(    0x18, "800000" )
2425   PORT_DIPSETTING(    0x10, "1800000" )
2426   PORT_DIPSETTING(    0x08, "2800000" )
2427   PORT_DIPSETTING(    0x00, "No Extend" )
2428   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Allow_Continue ) )      PORT_DIPLOCATION("SW(B):6")
2429   PORT_DIPSETTING(    0x20, DEF_STR( No ) )
2430   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
2431   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW(B):7")
2432   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2434   PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW(B):8" )
2435
2436   PORT_MODIFY("DSWC")
2437   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
2438
2439   PORT_MODIFY("IN1")
2440   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2441   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(1)
2442   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(1)
2443   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(1)
2444   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
2445   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
2446   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
2447   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
2448   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2449   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  ) PORT_8WAY PORT_PLAYER(2)
2450   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  ) PORT_8WAY PORT_PLAYER(2)
2451   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    ) PORT_8WAY PORT_PLAYER(2)
2452   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
2453   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
2454   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
2455   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
2456INPUT_PORTS_END
2457
22972458/* Needs further checking */
22982459static INPUT_PORTS_START( slammast )
22992460   PORT_INCLUDE( cps1_4players )
r7553r7554
78858046   ROM_LOAD( "palce16v8h-2.bin",    0x0, 0x117,  CRC(9ae375ba) SHA1(6f227c2a5b1170a41e6419f12d1e1f98edc6f8e5) )
78868047ROM_END
78878048
8049/* Chinese bootleg board */
8050ROM_START( dinohunt )
8051   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
8052   ROM_LOAD16_WORD_SWAP( "u23",  0x000000, 0x80000, CRC(8d5ddc5d) SHA1(3ed1da71d73425308d0c3ac1a01a7242e60b6677) )
8053   ROM_LOAD16_WORD_SWAP( "u22",  0x080000, 0x80000, CRC(f72cd219) SHA1(a3f580bd328b54d2546ae7e94262c1a706d27172) )
8054   ROM_LOAD16_WORD_SWAP( "u21",  0x100000, 0x80000, CRC(bc275b76) SHA1(1f7f7533b4ccb511dc479f531d9d6740d3ca6712) )
8055   ROM_LOAD16_WORD_SWAP( "u20",  0x180000, 0x80000, CRC(8987c975) SHA1(3fd856805d627f855f72acc7aacc2e8ecf0f12bd) )
8056
8057   ROM_REGION( 0x400000, "gfx", 0 )
8058   ROMX_LOAD( "u1",   0x000000, 0x80000, CRC(a01a9fb5) SHA1(d1ab4c7ead04932c60923363a0a661d0d1472aaa) , ROM_GROUPWORD | ROM_SKIP(6) )
8059   ROMX_LOAD( "u2",   0x000002, 0x80000, CRC(bdf02c17) SHA1(046ba4c589a22a7ac65c86baaae18eff0bff6ecb) , ROM_GROUPWORD | ROM_SKIP(6) )
8060   ROMX_LOAD( "u3",   0x000004, 0x80000, CRC(058beefa) SHA1(0d09ab5a200643b5a16e0313228f7ea243752bd0) , ROM_GROUPWORD | ROM_SKIP(6) )
8061   ROMX_LOAD( "u4",   0x000006, 0x80000, CRC(5028a9f1) SHA1(ff3a988153860e76beb79918ad896e702c3ecd3d) , ROM_GROUPWORD | ROM_SKIP(6) )
8062   ROMX_LOAD( "u5",   0x200000, 0x80000, CRC(d77f89ea) SHA1(1dd8c2a18742fd8483ecade31aed384c686ed244) , ROM_GROUPWORD | ROM_SKIP(6) )
8063   ROMX_LOAD( "u6",   0x200002, 0x80000, CRC(bfbcb034) SHA1(c1eb4d420b10ffa05197d9a82c7adac4d265c546) , ROM_GROUPWORD | ROM_SKIP(6) )
8064   ROMX_LOAD( "u7",   0x200004, 0x80000, CRC(a2544d4e) SHA1(def704055e041bc7c3b8cf7977249b69aa7924a8) , ROM_GROUPWORD | ROM_SKIP(6) )
8065   ROMX_LOAD( "u8",   0x200006, 0x80000, CRC(8869bbb1) SHA1(e53f77baffb913bf3ef5396d84fbfbaec6a90ca2) , ROM_GROUPWORD | ROM_SKIP(6) )
8066
8067   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
8068   ROM_LOAD( "u9",             0x00000, 0x08000, CRC(2eb16a83) SHA1(067ea0bfc2c1e73520d6b836c72fbb9da9998311) )
8069   ROM_CONTINUE(               0x10000, 0x08000 )
8070
8071   ROM_REGION( 0x40000, "oki", 0 ) /* samples */
8072   ROM_LOAD( "u18",            0x00000, 0x20000, CRC(8d2899ba) SHA1(0b3ac6cf2ce0323e3bfc9da3ebfcb0fd14bc405b) )
8073   ROM_LOAD( "u19",            0x20000, 0x20000, CRC(b34a4b42) SHA1(3eeb9e33bb911359e03d44949ac58439a3d3d54b) )
8074ROM_END
8075
8076/* Chinese bootleg board */
8077ROM_START( punisherbz )
8078   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
8079   ROM_LOAD16_WORD_SWAP( "23.096",   0x000000, 0x80000, CRC(bfa45d23) SHA1(56d04d02c9b9b22603205b1ce9e376874d2eaa05) )
8080   ROM_LOAD16_WORD_SWAP( "22.096",   0x080000, 0x80000, CRC(092578a4) SHA1(c3c8f98f8b8fc9c71b33fb906b4c591067b4355b) )
8081   ROM_LOAD16_WORD_SWAP( "21.096",   0x100000, 0x80000, CRC(d21ccddb) SHA1(295c886cd14ee54e12acfe3f1e8f13513442c8c0) )
8082   ROM_LOAD16_WORD_SWAP( "20.096",   0x180000, 0x80000, CRC(f9f334ce) SHA1(22e58ce5096b95138a30e9726e1169895118e990) )
8083
8084   ROM_REGION( 0x400000, "gfx", 0 )
8085   ROMX_LOAD( "1.096",         0x000000, 0x80000, CRC(ad468e07) SHA1(1ee8ecfd001b447982bc16972575eb2c5e01bc51) , ROM_GROUPWORD | ROM_SKIP(6) )
8086   ROMX_LOAD( "2.096",         0x000002, 0x80000, CRC(b9fdb6b5) SHA1(991fe0ded5c859f1e25766e9417e1ad691205e59) , ROM_GROUPWORD | ROM_SKIP(6) )
8087   ROMX_LOAD( "3.096",         0x000004, 0x80000, CRC(be0b1a78) SHA1(d002bd90d0f239d29f5ea481e455d85a1c088516) , ROM_GROUPWORD | ROM_SKIP(6) )
8088   ROMX_LOAD( "4.096",         0x000006, 0x80000, CRC(bba67a43) SHA1(9cd51a06a7661b2f78059ac392423f73de5cf56f) , ROM_GROUPWORD | ROM_SKIP(6) )
8089   ROMX_LOAD( "ps_gfx5.rom",   0x200000, 0x80000, CRC(c54ea839) SHA1(0733f37329edd9d0cace1319a7544b40aa7ecb0b) , ROM_GROUPWORD | ROM_SKIP(6) )
8090   ROMX_LOAD( "ps_gfx7.rom",   0x200002, 0x80000, CRC(04c5acbd) SHA1(fddc94b0f36d4d22d7c357856ae15b7514c342d3) , ROM_GROUPWORD | ROM_SKIP(6) )
8091   ROMX_LOAD( "ps_gfx6.rom",   0x200004, 0x80000, CRC(a544f4cc) SHA1(9552df8934ba25f19a22f2e07783712d8c8ef03c) , ROM_GROUPWORD | ROM_SKIP(6) )
8092   ROMX_LOAD( "ps_gfx8.rom",   0x200006, 0x80000, CRC(8f02f436) SHA1(a2f0ebb7e9593469c7b843f8962a66f3d77f79e5) , ROM_GROUPWORD | ROM_SKIP(6) )
8093
8094   ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
8095   ROM_LOAD( "9.512",          0x00000, 0x08000, CRC(b8367eb5) SHA1(ec3db29fdd6200e9a8f4f8073a7e34aef731354f) )
8096   ROM_CONTINUE(               0x10000, 0x08000 )
8097
8098   ROM_REGION( 0x40000, "oki", 0 ) /* samples */
8099   ROM_LOAD( "18.010",         0x00000, 0x20000, CRC(375c66e7) SHA1(36189e23209ce4ae5d9cbabd1574540d0591e7b3) )
8100   ROM_LOAD( "19.010",         0x20000, 0x20000, CRC(eb5ca884) SHA1(3592c69f77c7cd6ee241d6c1079c34a3e58abb5b) )
8101ROM_END
8102
78888103/* B-Board 91635B */
78898104ROM_START( punisher )
78908105   ROM_REGION( CODE_SIZE, "maincpu", 0 )      /* 68000 code */
r7553r7554
88329047   DRIVER_INIT_CALL(cps1);
88339048}
88349049
9050static DRIVER_INIT( dinohunt )
9051{
9052   // is this shared with the new sound hw?
9053   UINT8* ram = (UINT8*)memory_install_ram(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xf18000, 0xf19fff, 0, 0, 0);
9054   memset(ram,0xff,0x2000);
9055   DRIVER_INIT_CALL(cps1);
9056}
88359057
9058
88369059GAME( 1988, forgottn, 0,        cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (World)", GAME_SUPPORTS_SAVE )
88379060GAME( 1988, forgottnu,forgottn, cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (US)", GAME_SUPPORTS_SAVE )
88389061GAME( 1988, lostwrld, forgottn, cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Lost Worlds (Japan)", GAME_SUPPORTS_SAVE )
r7553r7554
89549177GAME( 1993, dinoj,    dino,     qsound,     dino,     dino,     ROT0,   "Capcom", "Cadillacs Kyouryuu-Shinseiki (Japan 930201)", GAME_SUPPORTS_SAVE )
89559178GAME( 1993, dinopic,  dino,     cpspicb,    dinopic,  dino,     ROT0,   "bootleg", "Cadillacs and Dinosaurs (bootleg with PIC16c57, set 1)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
89569179GAME( 1993, dinopic2, dino,     cpspicb,    dinopic,  dino,     ROT0,   "bootleg", "Cadillacs and Dinosaurs (bootleg with PIC16c57, set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
9180GAME( 1993, dinohunt, dino,     wofhfh,     dinoh,    dinohunt, ROT0,   "bootleg", "Dinosaur Hunter (Chinese bootleg of Cadillacs and Dinosaurs)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING )
89579181GAME( 1993, punisher, 0,        qsound,     punisher, punisher, ROT0,   "Capcom", "The Punisher (World 930422)", GAME_SUPPORTS_SAVE )      // "ETC"
89589182GAME( 1993, punisheru,punisher, qsound,     punisher, punisher, ROT0,   "Capcom", "The Punisher (US 930422)", GAME_SUPPORTS_SAVE )
89599183GAME( 1993, punisherj,punisher, qsound,     punisher, punisher, ROT0,   "Capcom", "The Punisher (Japan 930422)", GAME_SUPPORTS_SAVE )
89609184GAME( 1993, punipic,  punisher, cpspicb,    punipic,  punisher, ROT0,   "Capcom", "The Punisher (bootleg with PIC16c57, set 1)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
89619185GAME( 1993, punipic2, punisher, cpspicb,    punipic,  punisher, ROT0,   "Capcom", "The Punisher (bootleg with PIC16c57, set 2)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
89629186GAME( 1993, punipic3, punisher, cpspicb,    punipic,  punisher, ROT0,   "Capcom", "The Punisher (bootleg with PIC16c57, set 3)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
9187GAME( 1993, punisherbz,punisher,wofhfh,   punisherbz, cps1,     ROT0,   "bootleg","Biaofeng Zhanjing (Chinese bootleg of The Punisher)", GAME_SUPPORTS_SAVE ) // (c)2002, they ripped the sound from Final Fight!
89639188
89649189GAME( 1993, slammast, 0,        qsound,     slammast, slammast, ROT0,   "Capcom", "Saturday Night Slam Masters (World 930713)", GAME_SUPPORTS_SAVE )      // "ETC"
89659190GAME( 1993, slammastu,slammast, qsound,     slammast, slammast, ROT0,   "Capcom", "Saturday Night Slam Masters (US 930713)", GAME_SUPPORTS_SAVE )
src/mame/drivers/toaplan1.c
r7553r7554
200200    gives up or background scrolls enough to "free" you.
201201  - As you can play with 2 players at the same time, there is no need of a "Cabinet" setting,
202202    so DSWA bit 0 is unused (it is even no more tested).
203  - As other player can join in at any time, there is no need of a "Continue" setting,
204    so DSWB bit 7 is unused (it is even no more tested).
203  - DSWB bit 7 is unused (it is even no more tested).
205204  - Here are some differences I noticed with 'zerowing' :
206205      * you get the twin ships when starting a new life
207206      * speed range is 0x14-0x2c instead of 0x10-0x30 (but still +0x08)
r7553r7554
209208    many addresses in RAM are different, it isn't very easy to spot which ones :( Any help is welcome !
210209
211210
2115) 'demonwld' and "clones"
212
213    TO DO !
214
215
2166) 'fireshrk' and "clones"
217
218    TO DO !
219
220
2217) 'outzone' and "clones"
222
223    TO DO !
224
225
2268) 'vimana' and "clones"
227
2288a) 'vimana'
229
230  - Region read from Territory Jumper (0x440011.b).
231  - Coinage relies on bits 0 to 3 of the region :
232      * ....0010 : TOAPLAN_COINAGE_WORLD
233      *     else : TOAPLAN_COINAGE_JAPAN_OLD
234    This a guess based on the "test mode" (code at 0x01a804) because of the missing Z180 CPU.
235  - Notice screen relies on bits 0 to 3 of the region (code at 0x018bf2 - table at 0x019736) :
236      * ....0000 : "JAPAN ONLY"
237      * ....0001 : "U.S.A. ONLY"
238      * ....0010 : "EUROPE ONLY"
239      * ....0011 : "HONG KONG ONLY"
240      * ....0100 : "KOREA ONLY"
241      * ....0101 : "TAIWAN ONLY"
242      * ....0110 : "TAIWAN ONLY"
243      * ....0111 : "U.S.A. ONLY"
244      * ....1000 : "HONG KONG ONLY"
245      * ....1001 : ""
246      * ....1010 : ""
247      * ....1011 : ""
248      * ....1100 : ""
249      * ....1101 : ""
250      * ....1110 : ""
251      * ....1111 : "JAPAN ONLY"
252  - Copyright always displays "@ TOAPLAN CO. LTD. 1991" but the 2 other lines rely on bits 0 to 3
253    of the region (code at 0x016512 - tables at 0x01948e and 0x019496) :
254      * ....0000 : "DISTRIBUTED BY" / ""
255      * ....0001 : "ALL RIGHTS RESERVED" / ""
256      * ....0010 : "ALL RIGHTS RESERVED" / ""
257      * ....0011 : "ALL RIGHTS RESERVED" / ""
258      * ....0100 : "ALL RIGHTS RESERVED" / ""
259      * ....0101 : "ALL RIGHTS RESERVED" / ""
260      * ....0110 : "LICENCED TO SPACY CO., LTD" / "FOR TAIWAN"
261      * ....0111 : "LICENCED TO ROMSTAR, INC." / "FOR U.S.A."
262      * ....1000 : "LICENCED TO HONEST TRADING CO." / "FOR HONG KONG AND CHINA."
263      * ....1001 : "" / ""
264      * ....1010 : "" / ""
265      * ....1011 : "" / ""
266      * ....1100 : "" / ""
267      * ....1101 : "" / ""
268      * ....1110 : "" / ""
269      * ....1111 : "DISTRIBUTED BY" / ""
270    An additional Tecmo logo also relies on bits 0 to 3 of the region :
271      * ....0000 : display
272      * ....1111 : display
273      *     else : no display
274    So the Tecmo logo is only displayed when "Territory" set to "Japan" (right to the
275    "DISTRIBUTED BY" text).
276  - FBI logo (after diplsaying the hi-scores) relies on bits 0 to 3 of the region
277    (code at 0x0163f4) :
278      * ....0001 : display
279      * ....0111 : display
280      *     else : no display
281    So the FBI logo is only displayed when "Territory" set to "USA" or "USA (Romstar)".
282  - Number of letters for initials are always set to 3 regardless of the rgion.
283  - Jumper displayed in the Dip Switches screen relies on bits 0 to 3 of the region
284    (code at 0x01a89c - tables at 0x019d1e) :
285      * ....0000 : "FOR JAPAN.   "
286      * ....0001 : "FOR U.S.A.   "
287      * ....0010 : "FOR EUROPE   "
288      * ....0011 : "FOR HONG KONG"
289      * ....0100 : "FOR KOREA    "
290      * ....0101 : "FOR TAIWAN   "
291      * ....0110 : "FOR TAIWAN   "
292      * ....0111 : "FOR U.S.A.   "
293      * ....1000 : "FOR HONG KONG"
294      * ....1001 : "             "
295      * ....1010 : "             "
296      * ....1011 : "             "
297      * ....1100 : "             "
298      * ....1101 : "             "
299      * ....1110 : "             "
300      * ....1111 : "FOR JAPAN.   "
301  - When "Invulnerability" Dip Switch is ON, you can do the following with the STARTn buttons :
302      * press START2 to pause game
303      * press START1 to unpause game
304      * when START1 and START2 are pressed, the game enters in "slow motion" mode
305  - When "Invulnerability" Dip Switch is ON, you can press F1 ("Fast Scrolling", in fact
306    the unused 3rd button of player 1) to advance quickly to your desired area.
307  - When "Invulnerability" Dip Switch is ON, you can press the unused 3rd button of player 2,
308    but as its effect is completely unknown (code at 0x0010aa), I've decided not to map it for now.
309  - It's hard to tell which regions can be used for this set and which one is the default one.
310    However, as the text at the "end" (after the "CONGRATULATIONS" message) is in English,
311    I've decided to disable the ones related to Japan (0x00 and 0x0f).
312  - Routine at 0x017c18 is sound related and is seems to share memory with the Z180.
313    Unfortunately I haven't been able to understand yet how to produce a sound :(
314    Routine at 0x017ca6 stops producing a sound by reseting values in shared memory with the Z180.
315
3168b) 'vimanan'
317
318  - The only difference with 'vimana' is the different copyright when region is set to Europe :
319      * ....0010 : "NOVA APPARATE GMBH & CO" / ""
320    Because of this additional text, other texts, code and data are shifted after 0x019e9c.
321
3228c) 'vimana1'
323
324  - The only difference I've noticed with 'vimana' is the text at the "end" is in Japanese.
325    This is why I've disabled all regions which aren't related to Japan.
326  - Sound routines at 0x01792c and 0x0179ba.
327
328
212329To Do:
213330    Add support for HD647180 (Z180) sound CPUs (once their internal ROMS are dumped).
214331    These are:
215332        Fire Shark / Same! Same! Same!
216333        Vimana
217334    In the meantime, it can be interesting to simulate the basic communications (coinage and credits)
218    between the M68000 and the Z180 based on what is done for games with a Z80 sound CPU.  [stephh]
335    between the M68000 and the Z180.  [stephh]
219336
220337***************************************************************************/
221338
r7553r7554
411528   AM_RANGE(0x400008, 0x40000f) AM_WRITE(toaplan1_bcu_control_w)
412529   AM_RANGE(0x404000, 0x4047ff) AM_READWRITE(toaplan1_colorram1_r, toaplan1_colorram1_w) AM_BASE(&toaplan1_colorram1) AM_SIZE(&toaplan1_colorram1_size)
413530   AM_RANGE(0x406000, 0x4067ff) AM_READWRITE(toaplan1_colorram2_r, toaplan1_colorram2_w) AM_BASE(&toaplan1_colorram2) AM_SIZE(&toaplan1_colorram2_size)
414   AM_RANGE(0x440000, 0x440005) AM_READWRITE(vimana_mcu_r, vimana_mcu_w)
531   AM_RANGE(0x440000, 0x440005) AM_READWRITE(vimana_mcu_r, vimana_mcu_w)  /* shared memory from 0x440000 to 0x44ffff ? */
415532   AM_RANGE(0x440006, 0x440007) AM_READ_PORT("DSWA")
416   AM_RANGE(0x440008, 0x440009) AM_READ(vimana_input_port_5_word_r)
533   AM_RANGE(0x440008, 0x440009) AM_READ(vimana_system_port_r)   /* "SYSTEM" + coinage simulation */
417534   AM_RANGE(0x44000a, 0x44000b) AM_READ_PORT("P1")
418535   AM_RANGE(0x44000c, 0x44000d) AM_READ_PORT("P2")
419536   AM_RANGE(0x44000e, 0x44000f) AM_READ_PORT("DSWB")
r7553r7554
604721   TOAPLAN_DIFFICULTY
605722   PORT_DIPUNUSED( 0x04, IP_ACTIVE_HIGH )
606723   PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH )
607   PORT_DIPNAME( 0x30, 0x20, "Territory/Copyright" )       /* bits 4 and 5 listed as unused in the Dip Switches screen */
608   PORT_DIPSETTING(    0x20, "Europe/Taito Corp Japan" )
609   PORT_DIPSETTING(    0x10, "USA/Taito America" )
610   PORT_DIPSETTING(    0x30, "USA/Taito America (Romstar)" )
611   PORT_DIPSETTING(    0x00, "Japan/Taito Corp" )
724   PORT_DIPNAME( 0x30, 0x20, "Territory" )                 /* bits 4 and 5 listed as unused in the Dip Switches screen */
725   PORT_DIPSETTING(    0x20, DEF_STR( Europe ) )           /* Taito Corp. Japan */
726   PORT_DIPSETTING(    0x10, DEF_STR( USA ) )              /* Taito America Corp. */
727   PORT_DIPSETTING(    0x30, "USA (Romstar licence)" )     /* Taito America Corp. */
728   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )            /* Taito Corporation */
612729   PORT_DIPNAME( 0x40, 0x00, "Show Dip Switches Settings" )
613730   PORT_DIPSETTING(   0x00, DEF_STR( No ) )
614731   PORT_DIPSETTING(   0x40, DEF_STR( Yes ) )
r7553r7554
661778
662779   /* in 0x70 (CPU1) -> 0x8005 (CPU1 shared RAM) = 0x18000a.w (CPU0 shared RAM) -> 0x081b7c.w */
663780   PORT_START("TJUMP")       /* Territory Jumper Block - see notes */
664   PORT_DIPNAME( 0x07, 0x02, "Territory/Copyright" )
665   PORT_DIPSETTING(    0x02, "Europe/Taito Corp" )         /* TOAPLAN_COINAGE_WORLD */
666//  PORT_DIPSETTING(    0x03, "Europe/Taito Corp" )         /* TOAPLAN_COINAGE_JAPAN_OLD */
667//  PORT_DIPSETTING(    0x06, "Europe/Taito America" )      /* TOAPLAN_COINAGE_WORLD */
668//  PORT_DIPSETTING(    0x07, "Europe/Taito America" )      /* TOAPLAN_COINAGE_JAPAN_OLD */
669   PORT_DIPSETTING(    0x04, "USA/Taito America" )         /* TOAPLAN_COINAGE_JAPAN_OLD */
670//  PORT_DIPSETTING(    0x05, "USA/Taito America" )         /* TOAPLAN_COINAGE_JAPAN_OLD */
671   PORT_DIPSETTING(    0x01, "USA/Taito America (Romstar)" )/*TOAPLAN_COINAGE_JAPAN_OLD */
672   PORT_DIPSETTING(    0x00, "Japan/Taito Corp" )          /* TOAPLAN_COINAGE_JAPAN_OLD */
781   PORT_DIPNAME( 0x07, 0x02, "Territory" )
782   PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )           /* Taito Corporation */       /* TOAPLAN_COINAGE_WORLD */
783//  PORT_DIPSETTING(    0x03, DEF_STR( Europe ) )           /* Taito Corporation */       /* TOAPLAN_COINAGE_JAPAN_OLD */
784//  PORT_DIPSETTING(    0x06, DEF_STR( Europe ) )           /* Taito America Corp. */     /* TOAPLAN_COINAGE_WORLD */
785//  PORT_DIPSETTING(    0x07, DEF_STR( Europe ) )           /* Taito America Corp. */     /* TOAPLAN_COINAGE_JAPAN_OLD */
786   PORT_DIPSETTING(    0x04, DEF_STR( USA ) )              /* Taito America Corp. */     /* TOAPLAN_COINAGE_JAPAN_OLD */
787//  PORT_DIPSETTING(    0x05, DEF_STR( USA ) )              /* Taito America Corp. */     /* TOAPLAN_COINAGE_JAPAN_OLD */
788   PORT_DIPSETTING(    0x01, "USA (Romstar licence)" )     /* Taito America Corp. */     /* TOAPLAN_COINAGE_JAPAN_OLD */
789   PORT_DIPSETTING(    0x00, DEF_STR( Japan ) )            /* Taito Corporation */       /* TOAPLAN_COINAGE_JAPAN_OLD */
673790   PORT_DIPUNUSED( 0x08, IP_ACTIVE_HIGH )
674791   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
675792
r7553r7554
785902   PORT_DIPSETTING(    0x00, "3" )
786903   PORT_DIPSETTING(    0x20, "4" )
787904   PORT_DIPSETTING(    0x10, "5" )
788   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
905   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )           /* see notes */
789906   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
790907   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
791908   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
r7553r7554
824941   PORT_DIPUNUSED( 0x80, IP_ACTIVE_HIGH )
825942
826943   /* in 0x88 (CPU1) -> 0x8005 (CPU1 shared RAM) = 0x44000a.w (CPU0 shared RAM) -> 0x081ae2.w */
827   PORT_MODIFY("TJUMP")      /* Territory Jumper block */
944   PORT_MODIFY("TJUMP")      /* Territory Jumper block - see notes */
828945   PORT_DIPUNUSED( 0x01, IP_ACTIVE_HIGH )
829946   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Region ) )
830947   PORT_DIPSETTING(    0x00, DEF_STR( USA ) )
r7553r7554
11751292INPUT_PORTS_END
11761293
11771294
1295/* verified from M68000 - coinage based on "test mode" and handled by the MCU simulation */
11781296static INPUT_PORTS_START( vimana )
1179   TOAPLAN1_VBLANK_INPUT
1297   PORT_INCLUDE( toaplan1_2b )
11801298
1181   PORT_START("P1")
1182   TOAPLAN1_PLAYER_INPUT( 1, IPT_BUTTON3, )
1299   /* 0x440007.b */
1300   PORT_START("DSWA")
1301   TOAPLAN_MACHINE_NO_COCKTAIL
1302   TOAPLAN_COINAGE_DUAL(TJUMP, 0x0f, 0x02)                 /* see notes */
11831303
1184   PORT_START("P2")
1185   TOAPLAN1_PLAYER_INPUT( 2, IPT_BUTTON3, )
1186
1187   PORT_START("DSWA")      /* DSW A */
1188   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
1189   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1190   PORT_DIPSETTING(    0x01, DEF_STR( On ) )
1191   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Flip_Screen ) )
1192   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1193   PORT_DIPSETTING(    0x02, DEF_STR( On ) )
1194   PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
1195   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) )
1196   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1197   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1198   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
1199   PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
1200   PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1201   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1202   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1203   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
1204   PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1205   PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1206   PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1207   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1208
1209   PORT_START("DSWB")      /* DSW B */
1210   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
1211   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
1212   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
1213   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
1214   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1215   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
1216   PORT_DIPSETTING(    0x00, "70K and 200K" )
1217   PORT_DIPSETTING(    0x04, "100K and 250K" )
1218   PORT_DIPSETTING(    0x08, "100K" )
1219   PORT_DIPSETTING(    0x0c, "200K" )
1304   /* 0x44000f.b */
1305   PORT_START("DSWB")
1306   TOAPLAN_DIFFICULTY
1307   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )       /* table at 0x000998 */
1308   PORT_DIPSETTING(    0x00, "70k 270k 200k+" )
1309   PORT_DIPSETTING(    0x04, "100k 350k 250k+" )
1310   PORT_DIPSETTING(    0x08, "100k Only" )
1311   PORT_DIPSETTING(    0x0c, "200k Only" )
12201312   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
12211313   PORT_DIPSETTING(    0x30, "2" )
12221314   PORT_DIPSETTING(    0x00, "3" )
12231315   PORT_DIPSETTING(    0x20, "4" )
12241316   PORT_DIPSETTING(    0x10, "5" )
1225   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )
1317   PORT_DIPNAME( 0x40, 0x00, "Invulnerability" )           /* see notes */
12261318   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
12271319   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
12281320   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) )
12291321   PORT_DIPSETTING(    0x80, DEF_STR( No ) )
12301322   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
12311323
1232   TOAPLAN1_SYSTEM_INPUTS
1233
1234   PORT_START("TJUMP")      /* Territory Jumper Block */
1235   PORT_DIPNAME( 0x0f, 0x02, "Territory / License" )
1236   PORT_DIPSETTING(    0x00, "Japan (Distributed by Tecmo)" )
1237   PORT_DIPSETTING(    0x01, "US" )
1324   /* 0x440011.b */
1325   PORT_START("TJUMP")       /* Territory Jumper Block - see notes */
1326   PORT_DIPNAME( 0x0f, 0x02, "Territory" )
12381327   PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )
1328   PORT_DIPSETTING(    0x01, DEF_STR( USA ) )
1329   PORT_DIPSETTING(    0x07, "USA (Romstar license)" )
1330//  PORT_DIPSETTING(    0x00, "Japan (distributed by Tecmo)" )
1331//  PORT_DIPSETTING(    0x0f, "Japan (distributed by Tecmo)" )
1332   PORT_DIPSETTING(    0x04, "Korea" )
12391333   PORT_DIPSETTING(    0x03, "Hong Kong" )
1240   PORT_DIPSETTING(    0x04, "Korea" )
1334   PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading license)" )
12411335   PORT_DIPSETTING(    0x05, "Taiwan" )
1242   PORT_DIPSETTING(    0x06, "Taiwan (Spacy License)" )
1243   PORT_DIPSETTING(    0x07, "US (Romstar License)" )
1244   PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading Co. License)" )
1245//  PORT_DIPSETTING(    0x09, DEF_STR( Unused ) )
1246//  PORT_DIPSETTING(    0x0a, DEF_STR( Unused ) )
1247//  PORT_DIPSETTING(    0x0b, DEF_STR( Unused ) )
1248//  PORT_DIPSETTING(    0x0c, DEF_STR( Unused ) )
1249//  PORT_DIPSETTING(    0x0d, DEF_STR( Unused ) )
1250//  PORT_DIPSETTING(    0x0e, DEF_STR( Unused ) )
1251   PORT_DIPSETTING(    0x0f, "Japan (Distributed by Tecmo)" ) // duplicate of 0x00
1336   PORT_DIPSETTING(    0x06, "Taiwan (Spacy license)" )
1337//  PORT_DIPSETTING(    0x09, "???" )
1338//  PORT_DIPSETTING(    0x0a, "???" )
1339//  PORT_DIPSETTING(    0x0b, "???" )
1340//  PORT_DIPSETTING(    0x0c, "???" )
1341//  PORT_DIPSETTING(    0x0d, "???" )
1342//  PORT_DIPSETTING(    0x0e, "???" )
12521343   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1344
1345   /* P1 : 0x44000b.b */
1346   PORT_MODIFY("P1")
1347   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Fast Scrolling") PORT_CODE(KEYCODE_F1)   /* see notes */
1348
1349   /* P2 : 0x44000d.b */
1350
1351   /* SYSTEM : 0x440009.b */
1352
1353   /* VBLANK : 0x400001.b */
12531354INPUT_PORTS_END
12541355
1356/* verified from M68000 - coinage based on "test mode" and handled by the MCU simulation */
12551357static INPUT_PORTS_START( vimanan )
12561358   PORT_INCLUDE( vimana )
12571359
1258   PORT_MODIFY("DSWA")      /* DSW A */
1259   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unused ) )
1260   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
1261   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1262   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) )
1263   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1264   PORT_DIPSETTING(    0x10, DEF_STR( On ) )
1265   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) )
1266   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1267   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
1268   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
1269   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1270   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1271   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
1272   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1273   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
1274/* settings for other territories (non Nova license)
1275    PORT_DIPNAME( 0x30, 0x00, DEF_STR( Coin_A ) )
1276    PORT_DIPSETTING(    0x30, DEF_STR( 4C_1C ) )
1277    PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
1278    PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
1279    PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
1280    PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_B ) )
1281    PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
1282    PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
1283    PORT_DIPSETTING(    0x80, DEF_STR( 1C_4C ) )
1284    PORT_DIPSETTING(    0xc0, DEF_STR( 1C_6C ) )
1285*/
1360   /* DSWA : 0x440007.b */
1361   /* DSWB : 0x44000f.b */
12861362
1287   PORT_MODIFY("TJUMP")      /* Territory Jumper Block */
1288   PORT_DIPNAME( 0x0f, 0x02, "Territory / License" )
1289   PORT_DIPSETTING(    0x00, "Japan (Distributed by Tecmo)" )
1290   PORT_DIPSETTING(    0x01, "US" )
1291   PORT_DIPSETTING(    0x02, "Europe (Nova Apparate GMBH License)" )
1363   /* 0x440011.b */
1364   PORT_MODIFY("TJUMP")      /* Territory Jumper Block - see notes */
1365   PORT_DIPNAME( 0x0f, 0x02, "Territory" )
1366   PORT_DIPSETTING(    0x02, "Europe (Nova Apparate license)" )
1367   PORT_DIPSETTING(    0x01, DEF_STR( USA ) )
1368   PORT_DIPSETTING(    0x07, "USA (Romstar license)" )
1369//  PORT_DIPSETTING(    0x00, "Japan (distributed by Tecmo)" )        /* "ending" text in English */
1370//  PORT_DIPSETTING(    0x0f, "Japan (distributed by Tecmo)" )        /* "ending" text in English */
1371   PORT_DIPSETTING(    0x04, "Korea" )
12921372   PORT_DIPSETTING(    0x03, "Hong Kong" )
1293   PORT_DIPSETTING(    0x04, "Korea" )
1373   PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading license)" )
12941374   PORT_DIPSETTING(    0x05, "Taiwan" )
1295   PORT_DIPSETTING(    0x06, "Taiwan (Spacy License)" )
1296   PORT_DIPSETTING(    0x07, "US (Romstar License)" )
1297   PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading Co. License)" )
1298//  PORT_DIPSETTING(    0x09, DEF_STR( Unused ) )
1299//  PORT_DIPSETTING(    0x0a, DEF_STR( Unused ) )
1300//  PORT_DIPSETTING(    0x0b, DEF_STR( Unused ) )
1301//  PORT_DIPSETTING(    0x0c, DEF_STR( Unused ) )
1302//  PORT_DIPSETTING(    0x0d, DEF_STR( Unused ) )
1303//  PORT_DIPSETTING(    0x0e, DEF_STR( Unused ) )
1304//  PORT_DIPSETTING(    0x0f, "Japan (Distributed by Tecmo)" ) // duplicate of 0x00
1375   PORT_DIPSETTING(    0x06, "Taiwan (Spacy license)" )
1376//  PORT_DIPSETTING(    0x09, "???" )
1377//  PORT_DIPSETTING(    0x0a, "???" )
1378//  PORT_DIPSETTING(    0x0b, "???" )
1379//  PORT_DIPSETTING(    0x0c, "???" )
1380//  PORT_DIPSETTING(    0x0d, "???" )
1381//  PORT_DIPSETTING(    0x0e, "???" )
1382
1383   /* P1 : 0x44000b.b */
1384   /* P2 : 0x44000d.b */
1385
1386   /* SYSTEM : 0x440009.b */
1387
1388   /* VBLANK : 0x400001.b */
13051389INPUT_PORTS_END
13061390
1391/* verified from M68000 - coinage based on "test mode" and handled by the MCU simulation */
1392static INPUT_PORTS_START( vimana1 )
1393   PORT_INCLUDE( vimana )
13071394
1395   /* DSWA : 0x440007.b */
1396   /* DSWB : 0x44000f.b */
1397
1398   /* 0x440011.b */
1399   PORT_MODIFY("TJUMP")      /* Territory Jumper Block - see notes */
1400   PORT_DIPNAME( 0x0f, 0x00, "Territory" )
1401//  PORT_DIPSETTING(    0x02, DEF_STR( Europe ) )
1402//  PORT_DIPSETTING(    0x01, DEF_STR( USA ) )
1403//  PORT_DIPSETTING(    0x07, "USA (Romstar license)" )
1404   PORT_DIPSETTING(    0x00, "Japan (distributed by Tecmo)" )
1405//  PORT_DIPSETTING(    0x0f, "Japan (distributed by Tecmo)" )
1406//  PORT_DIPSETTING(    0x04, "Korea" )
1407//  PORT_DIPSETTING(    0x03, "Hong Kong" )
1408//  PORT_DIPSETTING(    0x08, "Hong Kong (Honest Trading license)" )
1409//  PORT_DIPSETTING(    0x05, "Taiwan" )
1410//  PORT_DIPSETTING(    0x06, "Taiwan (Spacy license)" )
1411//  PORT_DIPSETTING(    0x09, "???" )
1412//  PORT_DIPSETTING(    0x0a, "???" )
1413//  PORT_DIPSETTING(    0x0b, "???" )
1414//  PORT_DIPSETTING(    0x0c, "???" )
1415//  PORT_DIPSETTING(    0x0d, "???" )
1416//  PORT_DIPSETTING(    0x0e, "???" )
1417   PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
1418
1419   /* P1 : 0x44000b.b */
1420   /* P2 : 0x44000d.b */
1421
1422   /* SYSTEM : 0x440009.b */
1423
1424   /* VBLANK : 0x400001.b */
1425INPUT_PORTS_END
1426
1427
13081428static const gfx_layout tilelayout =
13091429{
13101430   8,8,   /* 8x8 */
r7553r7554
23552475   ROM_LOAD( "tp019-10.bpr",  0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) )   /* ??? */
23562476ROM_END
23572477
2358ROM_START( vimana1 )
2478ROM_START( vimanan )
23592479   ROM_REGION( 0x040000, "maincpu", 0 )   /* Main 68K code */
2360   ROM_LOAD16_BYTE( "vim07.bin",  0x000000, 0x20000, CRC(1efaea84) SHA1(f9c5d2365d8948fa66dbe61d355919db15843a28) )
2361   ROM_LOAD16_BYTE( "vim08.bin",  0x000001, 0x20000, CRC(e45b7def) SHA1(6b92a91d64581954da8ecdbeb5fed79bcc9c5217) )
2480   ROM_LOAD16_BYTE( "tp019-07.rom",  0x000000, 0x20000, CRC(78888ff2) SHA1(7e1d248f806d585952eb35ceec6a7e63ae4e22f9) )
2481   ROM_LOAD16_BYTE( "tp019-08.rom",  0x000001, 0x20000, CRC(6cd2dc3c) SHA1(029d974eb938c5e2fbe7575f0dda342b4b12b731) )
23622482
23632483   ROM_REGION( 0x10000, "cpu1", 0 )   /* Sound HD647180 code */
23642484   /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
r7553r7554
23792499   ROM_LOAD( "tp019-10.bpr",  0x20, 0x20, CRC(a1e17492) SHA1(9ddec4c97f2d541f69f3c32c47aaa21fd9699ae2) )   /* ??? */
23802500ROM_END
23812501
2382ROM_START( vimanan )
2502ROM_START( vimana1 )
23832503   ROM_REGION( 0x040000, "maincpu", 0 )   /* Main 68K code */
2384   ROM_LOAD16_BYTE( "tp019-07.rom",  0x000000, 0x20000, CRC(78888ff2) SHA1(7e1d248f806d585952eb35ceec6a7e63ae4e22f9) )
2385   ROM_LOAD16_BYTE( "tp019-08.rom",  0x000001, 0x20000, CRC(6cd2dc3c) SHA1(029d974eb938c5e2fbe7575f0dda342b4b12b731) )
2504   ROM_LOAD16_BYTE( "vim07.bin",  0x000000, 0x20000, CRC(1efaea84) SHA1(f9c5d2365d8948fa66dbe61d355919db15843a28) )
2505   ROM_LOAD16_BYTE( "vim08.bin",  0x000001, 0x20000, CRC(e45b7def) SHA1(6b92a91d64581954da8ecdbeb5fed79bcc9c5217) )
23862506
23872507   ROM_REGION( 0x10000, "cpu1", 0 )   /* Sound HD647180 code */
23882508   /* sound CPU is a HD647180 (Z180) with internal ROM - not yet supported */
r7553r7554
24472567GAME( 1990, outzonec,   outzone,  outzone,  outzonec,  toaplan1, ROT270, "Toaplan", "Out Zone (set 4)", 0 )
24482568GAME( 1990, outzoned,   outzone,  outzone,  outzonec,  toaplan1, ROT270, "Toaplan", "Out Zone (set 5)", 0 )
24492569GAME( 1991, vimana,     0,        vimana,   vimana,    vimana,   ROT270, "Toaplan", "Vimana", GAME_NO_SOUND )
2450GAME( 1991, vimana1,    vimana,   vimana,   vimana,    vimana,   ROT270, "Toaplan", "Vimana (old set)", GAME_NO_SOUND )
2451GAME( 1991, vimanan,    vimana,   vimana,   vimanan,   vimana,   ROT270, "Toaplan (Nova Apparate GMBH & Co license)", "Vimana (Nova Apparate GMBH & Co)", GAME_NO_SOUND )
2570GAME( 1991, vimanan,    vimana,   vimana,   vimanan,   vimana,   ROT270, "Toaplan", "Vimana (Nova Apparate GMBH & Co)", GAME_NO_SOUND )
2571GAME( 1991, vimana1,    vimana,   vimana,   vimana1,   vimana,   ROT270, "Toaplan", "Vimana (Japan)", GAME_NO_SOUND )
src/mame/drivers/tmnt.c
r7553r7554
34503450
34513451   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
34523452   ROM_LOAD( "060e04.d1",  0x0000, 0x100000, CRC(c680395d) SHA1(acde593a5ec501e89c8aaca6c4fbacf707a727e1) )
3453
3454   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3455   ROM_LOAD( "blswhstl.nv", 0x0000, 0x080, CRC(87434e3f) SHA1(458d21cfc0ef3415c0b09d8d748263b9218bdb24) )
34533456ROM_END
34543457
34553458ROM_START( detatwin )
r7553r7554
34723475
34733476   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
34743477   ROM_LOAD( "060e04.d1",  0x0000, 0x100000, CRC(c680395d) SHA1(acde593a5ec501e89c8aaca6c4fbacf707a727e1) )
3478
3479   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3480   ROM_LOAD( "blswhstl.nv", 0x0000, 0x080, CRC(87434e3f) SHA1(458d21cfc0ef3415c0b09d8d748263b9218bdb24) )
34753481ROM_END
34763482
34773483ROM_START( glfgreat )
r7553r7554
35583564
35593565   ROM_REGION( 0x200000, "k053260", 0 )   /* samples for the 053260 */
35603566   ROM_LOAD( "063b06",  0x0000, 0x200000, CRC(1e510aa5) SHA1(02b9bd6bb6b098026a620e4d671c40a31ad9e318) )
3567
3568   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3569   ROM_LOAD( "tmnt2_uaa.nv", 0x0000, 0x080, CRC(284357bd) SHA1(4f1c78b7cc86379678b1b84bcf59f8599a8c3686) )
35613570ROM_END
35623571
35633572ROM_START( tmnt22pu )
r7553r7554
35843593
35853594   ROM_REGION( 0x200000, "k053260", 0 )   /* samples for the 053260 */
35863595   ROM_LOAD( "063b06",  0x0000, 0x200000, CRC(1e510aa5) SHA1(02b9bd6bb6b098026a620e4d671c40a31ad9e318) )
3596
3597   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with invisible error message
3598   ROM_LOAD( "tmnt2_uda.nv", 0x0000, 0x080, CRC(44928d33) SHA1(44024927987f6bb8bdac3dbd1fdc81d7b55c0f5a) )
35873599ROM_END
35883600
3601
35893602ROM_START( tmht22pe )
35903603   ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */
35913604   ROM_LOAD16_BYTE( "063eba02.e8",  0x000000, 0x20000, CRC(99409094) SHA1(18059da85c59eb6ce193111bb8c7bd6601b1e698) )
r7553r7554
36103623
36113624   ROM_REGION( 0x200000, "k053260", 0 )   /* samples for the 053260 */
36123625   ROM_LOAD( "063b06",  0x0000, 0x200000, CRC(1e510aa5) SHA1(02b9bd6bb6b098026a620e4d671c40a31ad9e318) )
3626
3627   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with invisible error message
3628   ROM_LOAD( "tmnt2_eba.nv", 0x0000, 0x080, CRC(c0a3ed50) SHA1(6deec720c7f1c607740076cb8b5b5becd175aed0) )
36133629ROM_END
36143630
3631
36153632ROM_START( tmnt2a )
36163633   ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*128k for 68000 code */
36173634   ROM_LOAD16_BYTE( "063ada02.e8",  0x000000, 0x20000, CRC(4f11b587) SHA1(111051da23ce7035405b4d12c0f18dcc1d6c8ddc) )
r7553r7554
36363653
36373654   ROM_REGION( 0x200000, "k053260", 0 )   /* samples for the 053260 */
36383655   ROM_LOAD( "063b06",  0x0000, 0x200000, CRC(1e510aa5) SHA1(02b9bd6bb6b098026a620e4d671c40a31ad9e318) )
3656
3657   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3658   ROM_LOAD( "tmnt2_ada.nv", 0x0000, 0x080, CRC(063068a0) SHA1(c1da5319428fd8fb60305a2d7cc166596b2fe5a4) )
36393659ROM_END
36403660
3661
36413662ROM_START( qgakumon )
36423663   ROM_REGION( 0x100000, "maincpu", 0 ) /* 4*256k for 68000 code */
36433664   ROM_LOAD16_BYTE( "248jaa02.8e",  0x000000, 0x40000, CRC(fab79410) SHA1(8b1a8946ee65505608cf026c9fca87365ccef089) )
r7553r7554
36583679
36593680   ROM_REGION( 0x200000, "k053260", 0 )   /* samples for the 053260 */
36603681   ROM_LOAD( "248a06.1d",       0x0000, 0x200000, CRC(0fba1def) SHA1(f2ba23213effd06f14c7a179acea974c78c2198f) )
3682
3683   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
3684   ROM_LOAD( "qgakumon.nv", 0x0000, 0x080, CRC(847bd238) SHA1(d6f7bf215055b7e9ea1027f4b4e34fea25b3273b) )
36613685ROM_END
36623686
36633687ROM_START( ssriders )
r7553r7554
36803704
36813705   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
36823706   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3707
3708   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3709   ROM_LOAD( "ssriders_eac.nv", 0x0000, 0x080, CRC(f6d641a7) SHA1(6c680d49e1b07a47b29ff263a6009d226bd120cf) )
36833710ROM_END
36843711
36853712ROM_START( ssridersebd )
r7553r7554
37023729
37033730   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
37043731   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3732
3733   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3734   ROM_LOAD( "ssriders_ebd.nv", 0x0000, 0x080, CRC(cbc903f6) SHA1(43cb8e7f9b1da05da93878bd236f63036e32e379) )
37053735ROM_END
37063736
37073737ROM_START( ssridersebc )
r7553r7554
37243754
37253755   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
37263756   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3757
3758   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3759   ROM_LOAD( "ssriders_ebc.nv", 0x0000, 0x080, CRC(1918e90f) SHA1(edddbe80a5c9dd64411596b1aa4d7fce7b7090ae) )
37273760ROM_END
37283761
37293762ROM_START( ssriderseaa )
r7553r7554
37463779
37473780   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
37483781   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3782
3783   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3784   ROM_LOAD( "ssriders_eaa.nv", 0x0000, 0x080, CRC(74a45ef5) SHA1(da01f14684315bfb5c180f0c64a14350c34ae945) )
37493785ROM_END
37503786
37513787ROM_START( ssridersuda )
r7553r7554
37683804
37693805   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
37703806   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3807
3808   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3809   ROM_LOAD( "ssriders_uda.nv", 0x0000, 0x080, CRC(148c6d64) SHA1(38016ba7e29f821a4c0de67a7ddc686d307e4659) )
37713810ROM_END
37723811
37733812ROM_START( ssridersuac )
r7553r7554
37903829
37913830   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
37923831   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3832
3833   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3834   ROM_LOAD( "ssriders_uac.nv", 0x0000, 0x080, CRC(26c8f1a0) SHA1(56b933d61fb3a3da787db8e6714b53178f3c98db) )
37933835ROM_END
37943836
37953837ROM_START( ssridersubc )
r7553r7554
38123854
38133855   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
38143856   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3857
3858   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3859   ROM_LOAD( "ssriders_ubc.nv", 0x0000, 0x080, CRC(31c5504f) SHA1(fa6ed1860122552e94abb27a6ea75f4cb8054e76) )
38153860ROM_END
38163861
38173862ROM_START( ssridersabd )
r7553r7554
38343879
38353880   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
38363881   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3882
3883   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3884   ROM_LOAD( "ssriders_abd.nv", 0x0000, 0x080, CRC(bfdafedf) SHA1(bc786d4fb3495a6baf2ae13c19392c6740a2be6d) )
38373885ROM_END
38383886
38393887ROM_START( ssridersadd )
r7553r7554
38563904
38573905   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
38583906   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3907
3908   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3909   ROM_LOAD( "ssriders_add.nv", 0x0000, 0x080, CRC(f06242d5) SHA1(181732b07c74c3f5cfa7838ec029ed42d5216b17) )
38593910ROM_END
38603911
38613912ROM_START( ssridersjbd )
r7553r7554
38783929
38793930   ROM_REGION( 0x100000, "k053260", 0 )   /* samples for the 053260 */
38803931   ROM_LOAD( "064e06.1d",    0x0000, 0x100000, CRC(59810df9) SHA1(a0affc6330bdbfab1447dc0cf13c20ff708c2c71) )
3932
3933   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with invisible error
3934   ROM_LOAD( "ssriders_jbd.nv", 0x0000, 0x080, CRC(006200e3) SHA1(a6a0640c1a6d69a41db90f1fc935e97f2fa68553) )
38813935ROM_END
38823936
38833937ROM_START( ssridersb )
r7553r7554
39193973
39203974   ROM_REGION( 0x80000, "k053260", 0 )   /* samples for the 053260 */
39213975   ROM_LOAD( "073-b04.2d",   0x0000, 0x80000, CRC(05287a0b) SHA1(10784b8be6a93a5ebf22a884f99c116e51ae8743) )
3976
3977   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
3978   ROM_LOAD( "thndrx2.nv", 0x0000, 0x080, CRC(ca613e98) SHA1(bde0d1722acfef19cf8ec091bdc296f8b9fa8125) )
39223979ROM_END
39233980
39243981ROM_START( thndrx2a )
r7553r7554
39393996
39403997   ROM_REGION( 0x80000, "k053260", 0 )   /* samples for the 053260 */
39413998   ROM_LOAD( "073-b04.2d",   0x0000, 0x80000, CRC(05287a0b) SHA1(10784b8be6a93a5ebf22a884f99c116e51ae8743) )
3999
4000   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
4001   ROM_LOAD( "thndrx2a.nv", 0x0000, 0x080, CRC(f7893d00) SHA1(1165ad3485749015458df2840a34b5b0e1810aad) )
39424002ROM_END
39434003
39444004ROM_START( thndrx2j )
r7553r7554
39594019
39604020   ROM_REGION( 0x80000, "k053260", 0 )   /* samples for the 053260 */
39614021   ROM_LOAD( "073-b04.2d",   0x0000, 0x80000, CRC(05287a0b) SHA1(10784b8be6a93a5ebf22a884f99c116e51ae8743) )
4022
4023   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
4024   ROM_LOAD( "thndrx2j.nv", 0x0000, 0x080, CRC(83b4799b) SHA1(da4f443cbcb06aa5983423cb6fecc1f803235f61) )
39624025ROM_END
39634026
4027
39644028ROM_START( prmrsocr )
39654029   ROM_REGION( 0x80000, "maincpu", 0 ) /* 2*256k for 68000 code */
39664030   ROM_LOAD16_BYTE( "101eab08.1h", 0x000000, 0x40000, CRC(47208de6) SHA1(fe4ef56688d4a50f67a604357e7beea785106cd1) ) // 3.bin
r7553r7554
39874051
39884052   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
39894053   ROM_LOAD( "101a06.1d",    0x0000, 0x200000, CRC(4f48e043) SHA1(f50e8642d9d3a028c243777640e7cd13da1abf86) )
4054
4055   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
4056   ROM_LOAD( "prmrsocr_eab.nv", 0x0000, 0x080, CRC(daf60801) SHA1(de21774c4276ec399745c26a9278f7c58dbe6ad0) )
39904057ROM_END
39914058
39924059ROM_START( prmrsocrj )
r7553r7554
40154082
40164083   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
40174084   ROM_LOAD( "101a06.1d",    0x0000, 0x200000, CRC(4f48e043) SHA1(f50e8642d9d3a028c243777640e7cd13da1abf86) )
4085
4086   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
4087   ROM_LOAD( "prmrsocr_jab.nv", 0x0000, 0x080, CRC(5a88f95a) SHA1(18fdb598eee3958c45694bdac77e02790c936968) )
40184088ROM_END
40194089
40204090
src/mame/drivers/esd16.c
r7553r7554
927927
928928   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
929929   ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) /* AT27010 mask rom */
930
931   ROM_REGION( 0x80, "eeprom", 0 )
932   ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) )
930933ROM_END
931934
932935
r7553r7554
952955
953956   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
954957   ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) /* AT27010 mask rom */
958
959   ROM_REGION( 0x80, "eeprom", 0 )
960   ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) )
955961ROM_END
956962
957963
r7553r7554
980986
981987   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
982988   ROM_LOAD( "esd4.rom", 0x000000, 0x020000, CRC(d7ca6806) SHA1(8ad668bfb5b7561cc0f3e36dfc3c936b136a4274) )
989
990   ROM_REGION( 0x80, "eeprom", 0 )
991   ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) )
983992ROM_END
984993
985994
src/mame/drivers/model3.c
r7553r7554
46074607ROM_END
46084608
46094609ROM_START( oceanhun )   /* Step 2.0   317-0244-COM security chip (837-13666-com security board) */
4610   ROM_REGION64_BE( 0x4800000, "user1", 0 ) /* program + data ROMs */
4610   ROM_REGION64_BE( 0x8800000, "user1", 0 ) /* program + data ROMs */
46114611   // CROM
46124612   ROM_LOAD64_WORD_SWAP( "epr21114.17", 0x000006, 0x200000, CRC(3adfcb9d) SHA1(22307e36a48e59ab881d6df2fbf2864f6a8b239c) )
46134613   ROM_LOAD64_WORD_SWAP( "epr21115.18", 0x000004, 0x200000, CRC(0bb9c107) SHA1(9778b9d020669a5f5736c80e77f0fb1c7d0e1f1b) )
r7553r7554
46154615   ROM_LOAD64_WORD_SWAP( "epr21117.20", 0x000000, 0x200000, CRC(58d985f1) SHA1(1a3376906212a8a3bfb196ea29b5e4455a30e8f2) )
46164616
46174617   // CROM1
4618   ROM_LOAD64_WORD_SWAP( "mpr21082.5",  0x1800006, 0x400000, CRC(5bfeaa64) SHA1(3aa9f0b10c17e999dc917e3ff888887f42c54d31) )
4619   ROM_LOAD64_WORD_SWAP( "mpr21083.6",  0x1800004, 0x400000, CRC(667e236f) SHA1(a3354a72ba3f535cbe54af592eafda1a9816a6e6) )
4620   ROM_LOAD64_WORD_SWAP( "mpr21084.7",  0x1800002, 0x400000, CRC(36d5c4c1) SHA1(827590934023313e006330c66fe69763559effae) )
4621   ROM_LOAD64_WORD_SWAP( "mpr21085.8",  0x1800000, 0x400000, CRC(8d62406a) SHA1(d8be8a7bf6f8c48c07a5532f772101888e65f9d4) )
4618   ROM_LOAD64_WORD_SWAP( "mpr21082.5",  0x1800006, 0x800000, CRC(5056ad33) SHA1(b8aa4edcf6ae78f23ee1c6c02a9d5aef9c4e2eda) )
4619   ROM_LOAD64_WORD_SWAP( "mpr21083.6",  0x1800004, 0x800000, CRC(fdec6a23) SHA1(88abe005c7f5f8423aa62ebc741e0b132b3a1fef) )
4620   ROM_LOAD64_WORD_SWAP( "mpr21084.7",  0x1800002, 0x800000, CRC(c1c6b554) SHA1(596059872c0bbe39a78425cefe8cd2e17aa4b1ee) )
4621   ROM_LOAD64_WORD_SWAP( "mpr21085.8",  0x1800000, 0x800000, CRC(2b7224d3) SHA1(195fb6eeaef6f2c66e780cc844d3d69ea587269b) )
46224622
46234623   // CROM2
4624   ROM_LOAD64_WORD_SWAP( "mpr21086.9",  0x2800006, 0x400000, CRC(1e704e51) SHA1(970f19521aea6802276f46a20b39d23f23e09b84) )
4625   ROM_LOAD64_WORD_SWAP( "mpr21087.10", 0x2800004, 0x400000, CRC(5db59035) SHA1(6e511e1819a48ca4d437587f3c9a14dc530352fe) )
4626   ROM_LOAD64_WORD_SWAP( "mpr21088.11", 0x2800002, 0x400000, CRC(7730742b) SHA1(267444812a07ff4cf69da8545d4a7a2de1a3ba29) )
4627   ROM_LOAD64_WORD_SWAP( "mpr21089.12", 0x2800000, 0x400000, CRC(a74d2dcb) SHA1(449a188a7e5a21e2b51748cf7ceae84e2e3beab4) )
4624   ROM_LOAD64_WORD_SWAP( "mpr21086.9",  0x2800006, 0x800000, CRC(3f12e1d0) SHA1(739347a6c51350b686124511be477cb5d643c0b9) )
4625   ROM_LOAD64_WORD_SWAP( "mpr21087.10", 0x2800004, 0x800000, CRC(cff28641) SHA1(8982b39b71f95f8db0d599be41fb8592210be779) )
4626   ROM_LOAD64_WORD_SWAP( "mpr21088.11", 0x2800002, 0x800000, CRC(7ed71c8c) SHA1(642b6e81f5e532afa972b47df3ba451829bfd591) )
4627   ROM_LOAD64_WORD_SWAP( "mpr21089.12", 0x2800000, 0x800000, CRC(2e8f88bd) SHA1(468c5e1d6596c8247ba94c02f6e519a091a78506) )
46284628
46294629   // CROM3
4630   ROM_LOAD64_WORD_SWAP( "mpr21090.13", 0x3800006, 0x400000, CRC(7a95c388) SHA1(9a0f8b4e3bf0670d4f838a6fb18f29f5e1b3721b) )
4631   ROM_LOAD64_WORD_SWAP( "mpr21091.14", 0x3800004, 0x400000, CRC(4031b961) SHA1(0c663171f15dea67709e7ffc3f45b7571e745232) )
4632   ROM_LOAD64_WORD_SWAP( "mpr21092.15", 0x3800002, 0x400000, CRC(0ce200d9) SHA1(dd27ee6754df1330544a61ca6ec1ec2e79d11284) )
4633   ROM_LOAD64_WORD_SWAP( "mpr21093.16", 0x3800000, 0x400000, CRC(6eae1fc4) SHA1(e83671d1ba7bcc8c8a577c725b54b7caa2e3666e) )
4630   ROM_LOAD64_WORD_SWAP( "mpr21090.13", 0x3800006, 0x800000, CRC(749d7979) SHA1(20e6d318cbdbefc84002111336cc336143c7b757) )
4631   ROM_LOAD64_WORD_SWAP( "mpr21091.14", 0x3800004, 0x800000, CRC(10671951) SHA1(1eeb5cded07380c06aca29379f3683977679c22b) )
4632   ROM_LOAD64_WORD_SWAP( "mpr21092.15", 0x3800002, 0x800000, CRC(5b1ced40) SHA1(d1946563215797df1e6e71ee1a92f70a59a60392) )
4633   ROM_LOAD64_WORD_SWAP( "mpr21093.16", 0x3800000, 0x800000, CRC(bdfbf357) SHA1(e324bbbc0ad17f365879c8be085ccde365445dd9) )
46344634
46354635   ROM_REGION( 0x2000000, "user3", 0 )  /* Video ROMs Part 1 */
46364636   ROM_LOAD_VROM( "mpr21098.26",  0x000002, 0x400000, CRC(91e71855) SHA1(d3dcea5e983b3a9139e0091a13e3f4b2764417b8) )
src/mame/drivers/xexex.c
r7553r7554
618618   ROM_REGION( 0x300000, "k054539", 0 )
619619   ROM_LOAD( "067_b06.rom", 0x000000, 0x200000, CRC(3b12fce4) SHA1(c69172d9965b8da8a539812fac92d5f1a3c80d17) )
620620   ROM_LOAD( "067_b07.rom", 0x200000, 0x100000, CRC(ec87fe1b) SHA1(ec9823aea5a1fc5c47c8262e15e10b28be87231c) )
621
622   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
623   ROM_LOAD( "xexex.nv", 0x0000, 0x080, CRC(155624cc) SHA1(457f921e3a5d053c53e4f1a44941eb0a1f22e1b2) )
621624ROM_END
622625
623626ROM_START( xexexa ) /* Asia, Version AA */
r7553r7554
647650   ROM_REGION( 0x300000, "k054539", 0 )
648651   ROM_LOAD( "067_b06.rom", 0x000000, 0x200000, CRC(3b12fce4) SHA1(c69172d9965b8da8a539812fac92d5f1a3c80d17) )
649652   ROM_LOAD( "067_b07.rom", 0x200000, 0x100000, CRC(ec87fe1b) SHA1(ec9823aea5a1fc5c47c8262e15e10b28be87231c) )
653
654   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
655   ROM_LOAD( "xexexa.nv", 0x0000, 0x080, CRC(051c14c6) SHA1(23addbaa2ce323c06551b343ca45dea4fd2b9eee) )
650656ROM_END
651657
652658ROM_START( xexexj ) /* Japan, Version AA */
r7553r7554
676682   ROM_REGION( 0x300000, "k054539", 0 )
677683   ROM_LOAD( "067_b06.rom", 0x000000, 0x200000, CRC(3b12fce4) SHA1(c69172d9965b8da8a539812fac92d5f1a3c80d17) )
678684   ROM_LOAD( "067_b07.rom", 0x200000, 0x100000, CRC(ec87fe1b) SHA1(ec9823aea5a1fc5c47c8262e15e10b28be87231c) )
685
686   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
687   ROM_LOAD( "xexexj.nv", 0x0000, 0x080, CRC(79a79c7b) SHA1(02eb235226949af0147d6d0fd2bd3d7a68083ae6) )
679688ROM_END
680689
681690
src/mame/drivers/jchan.c
r7553r7554
286286
287287static READ16_HANDLER( jchan_mcu_status_r )
288288{
289   logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag.cstr(), cpu_get_previouspc(space->cpu));
289   logerror("cpu '%s' (PC=%06X): read mcu status\n", space->cpu->tag(), cpu_get_previouspc(space->cpu));
290290   return 0;
291291}
292292
src/mame/drivers/galaxold.c
r7553r7554
25732573
25742574ROM_START( ckongg )
25752575   ROM_REGION( 0x10000, "maincpu", 0 )
2576   ROM_LOAD( "ck1.bin",       0x2400, 0x0400, CRC(a4323b94) SHA1(1fed47e1df5efa8f40585bedab07b60067edc2bb) )
2576   ROM_LOAD( "g_ck1.bin",     0x2400, 0x0400, CRC(a4323b94) SHA1(1fed47e1df5efa8f40585bedab07b60067edc2bb) )
25772577   ROM_CONTINUE(              0x1C00, 0x0400)
25782578   ROM_CONTINUE(              0x4800, 0x0400)
25792579   ROM_CONTINUE(              0x0C00, 0x0400)
src/mame/drivers/opwolf.c
r7553r7554
469469static void opwolf_msm5205_vck( running_device *device )
470470{
471471   opwolf_state *state = (opwolf_state *)device->machine->driver_data;
472   int chip = (strcmp(device->tag, "msm1") == 0) ? 0 : 1;
472   int chip = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1;
473473   if (state->adpcm_data[chip] != -1)
474474   {
475475      msm5205_data_w(device, state->adpcm_data[chip] & 0x0f);
src/mame/drivers/spdodgeb.c
r7553r7554
8787
8888static void spd_adpcm_int(running_device *device)
8989{
90   int chip = (strcmp(device->tag, "msm1") == 0) ? 0 : 1;
90   int chip = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1;
9191   if (adpcm_pos[chip] >= adpcm_end[chip] || adpcm_pos[chip] >= 0x10000)
9292   {
9393      adpcm_idle[chip] = 1;
src/mame/drivers/plygonet.c
r7553r7554
795795   /* sound data */
796796   ROM_REGION( 0x200000, "shared", 0 )
797797   ROM_LOAD( "305b08.2e", 0x000000, 0x200000, CRC(874607df) SHA1(763b44a80abfbc355bcb9be8bf44373254976019) )
798
799   ROM_REGION16_BE( 0x80, "eeprom", 0 )
800   ROM_LOAD( "plygonet.nv", 0x0000, 0x0080, CRC(627748ac) SHA1(ea1b06739fee235b049ff8daffff7d43cb093112) )
798801ROM_END
799802
800803ROM_START( polynetw )
r7553r7554
822825   ROM_REGION( 0x400000, "shared", 0 )
823826   ROM_LOAD( "305a08.2e", 0x000000, 0x200000, CRC(7ddb8a52) SHA1(3199b347fc433ffe0de8521001df77672d40771e) )
824827   ROM_LOAD( "305a09.3e", 0x200000, 0x200000, CRC(6da1be58) SHA1(d63ac16ac551193ff8a6036724fb59e1d702e06b) )
828
829   ROM_REGION16_BE( 0x80, "eeprom", 0 )
830   ROM_LOAD( "polynetw.nv", 0x0000, 0x0080, CRC(8f39d644) SHA1(8733e1a288ba20c4b04b3aedde52801d05cebdf9) )
825831ROM_END
826832
827833/*          ROM       parent   machine   inp        init */
src/mame/drivers/galaga.c
r7553r7554
29152915
29162916ROM_START( digdug1 )
29172917   ROM_REGION( 0x10000, "maincpu", 0 )   /* 64k for code for the first CPU  */
2918   ROM_LOAD( "dd1a.1",       0x0000, 0x1000, CRC(b9198079) SHA1(1d3fe04020f584ed250e32fdc6f6a3b769342884) )
2919   ROM_LOAD( "dd1a.2",       0x1000, 0x1000, CRC(b2acbe49) SHA1(c8f713e8cfa70d3bc64d3002ff7bffc65ee138e2) )
2920   ROM_LOAD( "dd1a.3",       0x2000, 0x1000, CRC(d6407b49) SHA1(0e71a8f02778286488865e20439776dbb2a8ec78) )
2918   ROM_LOAD( "dd1.1",        0x0000, 0x1000, CRC(b9198079) SHA1(1d3fe04020f584ed250e32fdc6f6a3b769342884) )
2919   ROM_LOAD( "dd1.2",        0x1000, 0x1000, CRC(b2acbe49) SHA1(c8f713e8cfa70d3bc64d3002ff7bffc65ee138e2) )
2920   ROM_LOAD( "dd1.3",        0x2000, 0x1000, CRC(d6407b49) SHA1(0e71a8f02778286488865e20439776dbb2a8ec78) )
29212921   ROM_LOAD( "dd1.4b",       0x3000, 0x1000, CRC(f4cebc16) SHA1(19b568f92069a1cfe1c07287408efe3b0e253375) )
29222922
29232923   ROM_REGION( 0x10000, "sub", 0 )   /* 64k for the second CPU */
src/mame/drivers/merit.c
r7553r7554
18191819amount of points (there is a dip switch to select the trigger: 150.000 or 200.000*/
18201820ROM_START( couplep )
18211821   ROM_REGION( 0x20000, "maincpu", 0 )
1822   ROM_LOAD( "1.1d", 0x00000, 0x8000, CRC(4601ace6) SHA1(a824ceebf8b9ce77ef2c8e92636e4261f2ae0420) )
1822   ROM_LOAD( "p_1.1d", 0x00000, 0x8000, CRC(4601ace6) SHA1(a824ceebf8b9ce77ef2c8e92636e4261f2ae0420) )
18231823   ROM_LOAD( "2.1e",  0x10000, 0x8000, CRC(17372a93) SHA1(e0f0980003473555c2543d98d1494f82afa49f1a) )
18241824
18251825   ROM_REGION( 0x18000, "gfx1", 0 )
r7553r7554
18381838it has same dips as set1, but remaining machine code is the same as set2*/
18391839ROM_START( couplei )
18401840   ROM_REGION( 0x20000, "maincpu", 0 )
1841   ROM_LOAD( "1.1d", 0x00000, 0x8000, CRC(760fa29e) SHA1(a37a1562028d9615adff3d2ef88e0156354c720a) )
1841   ROM_LOAD( "i_1.1d", 0x00000, 0x8000, CRC(760fa29e) SHA1(a37a1562028d9615adff3d2ef88e0156354c720a) )
18421842   ROM_LOAD( "2.1e",  0x10000, 0x8000, CRC(17372a93) SHA1(e0f0980003473555c2543d98d1494f82afa49f1a) )
18431843
18441844   ROM_REGION( 0x18000, "gfx1", 0 )
src/mame/drivers/zr107.c
r7553r7554
869869   ROM_LOAD32_BYTE( "477a16.2h", 0x000003, 0x200000, CRC(2c03ee63) SHA1(6b74d340dddf92bb4e4b1e037f003d58c65d8d9b) )
870870
871871   ROM_REGION(0x600000, "shared", 0)   /* Sound data */
872   ROM_LOAD( "477a09.3r", 0x000000, 0x200000, CRC(f431e29f) SHA1(e6082d88f86abb63d02ac34e70873b58f88b0ddc) )
873   ROM_LOAD( "477a10.5n", 0x200000, 0x200000, CRC(8db31bd4) SHA1(d662d3bb6e8b44a01ffa158f5d7425454aad49a3) )
874   ROM_LOAD( "477a08.5r", 0x400000, 0x200000, CRC(d320dbde) SHA1(eb602cad6ac7c7151c9f29d39b10041d5a354164) )
872   ROM_LOAD( "477a08.5r", 0x000000, 0x200000, CRC(d320dbde) SHA1(eb602cad6ac7c7151c9f29d39b10041d5a354164) )
873   ROM_LOAD( "477a09.3r", 0x200000, 0x200000, CRC(f431e29f) SHA1(e6082d88f86abb63d02ac34e70873b58f88b0ddc) )
874   ROM_LOAD( "477a10.5n", 0x400000, 0x200000, CRC(8db31bd4) SHA1(d662d3bb6e8b44a01ffa158f5d7425454aad49a3) )
875875ROM_END
876876
877877ROM_START( windheat )
r7553r7554
895895   ROM_LOAD32_BYTE( "677a16.2h", 0x000003, 0x200000, CRC(7cc75539) SHA1(4bd8d88debf7489f30008bd4cbded67cb1a20ab0) )
896896
897897   ROM_REGION(0x600000, "shared", 0)   /* Sound data */
898   ROM_LOAD( "677a09.3r", 0x000000, 0x200000, CRC(4dfc1ea9) SHA1(4ab264c1902b522bc0589766e42f2b6ca276808d) )
899   ROM_LOAD( "677a10.5n", 0x200000, 0x200000, CRC(d8f77a68) SHA1(ff251863ef096f0864f6cbe6caa43b0aa299d9ee) )
900   ROM_LOAD( "677a08.5r", 0x400000, 0x200000, CRC(bde38850) SHA1(aaf1bdfc25ecdffc1f6076c9c1b2edbe263171d2) )
898   ROM_LOAD( "677a08.5r", 0x000000, 0x200000, CRC(bde38850) SHA1(aaf1bdfc25ecdffc1f6076c9c1b2edbe263171d2) )
899   ROM_LOAD( "677a09.3r", 0x200000, 0x200000, CRC(4dfc1ea9) SHA1(4ab264c1902b522bc0589766e42f2b6ca276808d) )
900   ROM_LOAD( "677a10.5n", 0x400000, 0x200000, CRC(d8f77a68) SHA1(ff251863ef096f0864f6cbe6caa43b0aa299d9ee) )
901901ROM_END
902902
903903ROM_START( windheatu )
r7553r7554
921921   ROM_LOAD32_BYTE( "677a16.2h", 0x000003, 0x200000, CRC(7cc75539) SHA1(4bd8d88debf7489f30008bd4cbded67cb1a20ab0) )
922922
923923   ROM_REGION(0x600000, "shared", 0)   /* Sound data */
924   ROM_LOAD( "677a09.3r", 0x000000, 0x200000, CRC(4dfc1ea9) SHA1(4ab264c1902b522bc0589766e42f2b6ca276808d) )
925   ROM_LOAD( "677a10.5n", 0x200000, 0x200000, CRC(d8f77a68) SHA1(ff251863ef096f0864f6cbe6caa43b0aa299d9ee) )
926   ROM_LOAD( "677a08.5r", 0x400000, 0x200000, CRC(bde38850) SHA1(aaf1bdfc25ecdffc1f6076c9c1b2edbe263171d2) )
924   ROM_LOAD( "677a08.5r", 0x000000, 0x200000, CRC(bde38850) SHA1(aaf1bdfc25ecdffc1f6076c9c1b2edbe263171d2) )
925   ROM_LOAD( "677a09.3r", 0x200000, 0x200000, CRC(4dfc1ea9) SHA1(4ab264c1902b522bc0589766e42f2b6ca276808d) )
926   ROM_LOAD( "677a10.5n", 0x400000, 0x200000, CRC(d8f77a68) SHA1(ff251863ef096f0864f6cbe6caa43b0aa299d9ee) )
927927ROM_END
928928
929929ROM_START( windheatj )
r7553r7554
947947   ROM_LOAD32_BYTE( "677a16.2h", 0x000003, 0x200000, CRC(7cc75539) SHA1(4bd8d88debf7489f30008bd4cbded67cb1a20ab0) )
948948
949949   ROM_REGION(0x600000, "shared", 0)   /* Sound data */
950   ROM_LOAD( "677a09.3r", 0x000000, 0x200000, CRC(4dfc1ea9) SHA1(4ab264c1902b522bc0589766e42f2b6ca276808d) )
951   ROM_LOAD( "677a10.5n", 0x200000, 0x200000, CRC(d8f77a68) SHA1(ff251863ef096f0864f6cbe6caa43b0aa299d9ee) )
952   ROM_LOAD( "677a08.5r", 0x400000, 0x200000, CRC(bde38850) SHA1(aaf1bdfc25ecdffc1f6076c9c1b2edbe263171d2) )
950   ROM_LOAD( "677a08.5r", 0x000000, 0x200000, CRC(bde38850) SHA1(aaf1bdfc25ecdffc1f6076c9c1b2edbe263171d2) )
951   ROM_LOAD( "677a09.3r", 0x200000, 0x200000, CRC(4dfc1ea9) SHA1(4ab264c1902b522bc0589766e42f2b6ca276808d) )
952   ROM_LOAD( "677a10.5n", 0x400000, 0x200000, CRC(d8f77a68) SHA1(ff251863ef096f0864f6cbe6caa43b0aa299d9ee) )
953953ROM_END
954954
955ROM_START( jetwave )
955ROM_START( waveshrk )
956956   ROM_REGION(0x200000, "user1", 0)   /* PowerPC program roms */
957957   ROM_LOAD32_BYTE( "678uab01.20u", 0x000003, 0x080000, CRC(a9b9ceed) SHA1(36f0d18481d7c3e7358e02473e54bc6b52d5c26b) )
958958   ROM_LOAD32_BYTE( "678uab02.17u", 0x000002, 0x080000, CRC(5ed24ac8) SHA1(d659c751558d4f8d89314466a37c04ac2df46879) )
r7553r7554
967967   ROM_LOAD32_WORD_SWAP( "685a06.8u",  0x000002, 0x200000, CRC(fc98c6a5) SHA1(a84583bb7296fa9e0c284b2ac59e2dc7b2689eee) )
968968
969969   ROM_REGION(0x800000, "gfx1", 0)   /* Texture data */
970   ROM_LOAD64_WORD( "678a13.18d", 0x000000, 0x200000, CRC(ccf75722) SHA1(f48d21dfc4f82adbb4c9c841a809267cfd028a3d) )
971   ROM_LOAD64_WORD( "678a14.13d", 0x000002, 0x200000, CRC(333a1ab4) SHA1(79df4a98b7871eba4157307a7709da8f8b5da39b) )
972   ROM_LOAD64_WORD( "678a15.9d",  0x000004, 0x200000, CRC(58b670f8) SHA1(5d4facb00e34de3ad11ed60c19835918a9cf6cb9) )
973   ROM_LOAD64_WORD( "678a16.4d",  0x000006, 0x200000, CRC(137b9bff) SHA1(5052c1fa30cc1d6affd78f48d483415dca89d10b) )
970   ROM_LOAD32_BYTE( "678a13.18d", 0x000000, 0x200000, CRC(ccf75722) SHA1(f48d21dfc4f82adbb4c9c841a809267cfd028a3d) )
971   ROM_LOAD32_BYTE( "678a14.13d", 0x000001, 0x200000, CRC(333a1ab4) SHA1(79df4a98b7871eba4157307a7709da8f8b5da39b) )
972   ROM_LOAD32_BYTE( "678a15.9d",  0x000002, 0x200000, CRC(58b670f8) SHA1(5d4facb00e34de3ad11ed60c19835918a9cf6cb9) )
973   ROM_LOAD32_BYTE( "678a16.4d",  0x000003, 0x200000, CRC(137b9bff) SHA1(5052c1fa30cc1d6affd78f48d483415dca89d10b) )
974974
975975   ROM_REGION(0x600000, "shared", 0)   /* Sound data */
976   ROM_LOAD( "678a09.3r", 0x000000, 0x200000, CRC(39baef23) SHA1(9f7bda0f9c06eee94703f9ceb06975c8e28338cc) )
977   ROM_LOAD( "678a10.5n", 0x200000, 0x200000, CRC(0508280e) SHA1(a36c5dc377b0ba597f131bd9dfc6019e7fc2d243) )
978   ROM_LOAD( "678a08.5r", 0x400000, 0x200000, CRC(4aeb61ad) SHA1(ec6872cb2e4776849963f48c1c245ca7697849e0) )
976   ROM_LOAD( "678a08.5r", 0x000000, 0x200000, CRC(4aeb61ad) SHA1(ec6872cb2e4776849963f48c1c245ca7697849e0) )
977   ROM_LOAD( "678a09.3r", 0x200000, 0x200000, CRC(39baef23) SHA1(9f7bda0f9c06eee94703f9ceb06975c8e28338cc) )
978   ROM_LOAD( "678a10.5n", 0x400000, 0x200000, CRC(0508280e) SHA1(a36c5dc377b0ba597f131bd9dfc6019e7fc2d243) )
979979ROM_END
980980
981981/*****************************************************************************/
r7553r7554
984984GAME( 1996, windheat, 0,        zr107,   windheat, zr107,   ROT0, "Konami", "Winding Heat (EAA, Euro v2.11)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
985985GAME( 1996, windheatu,windheat, zr107,   windheat, zr107,   ROT0, "Konami", "Winding Heat (UBC, USA v2.22)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
986986GAME( 1996, windheatj,windheat, zr107,   windheat, zr107,   ROT0, "Konami", "Winding Heat (JAA, JPN v2.11)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
987GAME( 1996, jetwave, 0,        jetwave, jetwave,  jetwave, ROT0, "Konami", "Jet Wave (UAB, USA v1.04)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
987GAME( 1996, waveshrk, 0,        jetwave, jetwave,  jetwave, ROT0, "Konami", "Wave Shark (UAB, USA v1.04)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND|GAME_NOT_WORKING )
src/mame/drivers/funworld.c
r7553r7554
578578  - Added a external default NVRAM for Jolly Card Professional 2.0.
579579  - Updated technical notes.
580580
581  [2010/03/09]
582  - Added external default NVRAM support to the following games:
583     bottle10, bottl10b, elephfam, elephfmb, jollycrd, jolyc3x3,
584     jolyccra, jolyccrb, jolycdev, jolycdib, jolycdit, jolyjokr,
585     jolyjokra, jolyjokrb, lluck3x3, lluck4x1, magicrd2, pool10,
586     pool10b, pool10c, pool10d, potgame, royalcrd, royalcdb,
587     sjcd2kx3, tortufam, vegasfst, vegasfte and vegasslw.
588  - Changed default settings for some games, now that NVRAM is
589     loaded externally.
581590
591
582592  *** TO DO ***
583593
584594  - Figure out the royalcdc & jokercrd encryption.
r7553r7554
802812
803813   /* after nvram init, set the following one to 'manual'
804814    to allow the remote credits mode to work */
805   PORT_DIPNAME( 0x80, 0x00, "Payout" )         PORT_DIPLOCATION("SW1:1")
815   PORT_DIPNAME( 0x80, 0x80, "Payout" )         PORT_DIPLOCATION("SW1:1")
806816   PORT_DIPSETTING(    0x00, "Hopper" )
807817   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
808818INPUT_PORTS_END
r7553r7554
863873
864874   /* after nvram init, set the following one to 'manual'
865875    to allow the remote credits mode to work */
866   PORT_DIPNAME( 0x80, 0x00, "Payout" )         PORT_DIPLOCATION("SW1:1")
876   PORT_DIPNAME( 0x80, 0x80, "Payout" )         PORT_DIPLOCATION("SW1:1")
867877   PORT_DIPSETTING(    0x00, "Hopper" )
868878   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
869879INPUT_PORTS_END
r7553r7554
923933
924934   /* after nvram init, set the following one to 'manual'
925935    to allow the remote credits mode to work */
926   PORT_DIPNAME( 0x80, 0x00, "Payout" )         PORT_DIPLOCATION("SW1:1")
936   PORT_DIPNAME( 0x80, 0x80, "Payout" )         PORT_DIPLOCATION("SW1:1")
927937   PORT_DIPSETTING(    0x00, "Hopper" )
928938   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
929939INPUT_PORTS_END
r7553r7554
984994
985995   /* after nvram init, set the following one to 'manual'
986996    to allow the remote credits mode to work */
987   PORT_DIPNAME( 0x80, 0x00, "Payout" )         PORT_DIPLOCATION("SW1:1")
997   PORT_DIPNAME( 0x80, 0x80, "Payout" )         PORT_DIPLOCATION("SW1:1")
988998   PORT_DIPSETTING(    0x00, "Hopper" )
989999   PORT_DIPSETTING(    0x80, "Manual Payout SW" )
9901000INPUT_PORTS_END
r7553r7554
17731783   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
17741784   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
17751785
1776   ROM_REGION( 0x0200, "proms", 0 )
1777   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
1778ROM_END
1786   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1787   ROM_LOAD( "jollycrd_nvram.bin",  0x0000, 0x0800, CRC(8f0a86c9) SHA1(467bd4f601ac6aa818c036f1269c2d43d27854f6) )
17791788
1780
1781ROM_START( jolycdae )   /* encrypted roms...*/
1782   ROM_REGION( 0x18000, "maincpu", 0 )
1783   ROM_LOAD( "pokeru0.bin", 0x8000, 0x10000, CRC(7732f177) SHA1(b75fca596a7315d1379fa5bcf07c449ec32c90f5) )
1784
1785   ROM_REGION( 0x20000, "gfx1", 0 )
1786   ROM_LOAD( "pokeru1.bin", 0x00000, 0x10000, CRC(878d695b) SHA1(0e1ea455e991e591316a340c56b23fa26764988d) )
1787   ROM_LOAD( "pokeru2.bin", 0x10000, 0x10000, CRC(b7b2946a) SHA1(25b15296b32bf88db6d60991105bba667f7940cc) )
1788   ROM_COPY( "gfx1",    0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
1789
17901789   ROM_REGION( 0x0200, "proms", 0 )
17911790   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
17921791ROM_END
r7553r7554
18001799   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
18011800   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
18021801
1802   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1803   ROM_LOAD( "jolyc3x3_nvram.bin",  0x0000, 0x0800, CRC(727c70cf) SHA1(3639b0891514064e21ebdb280791cc9c8f5ba481) )
1804
18031805   ROM_REGION( 0x0200, "proms", 0 )
18041806   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18051807ROM_END
r7553r7554
18241826    inputs correlated to a code that pops up on the screen.
18251827    This code should be inserted into a PC-DOS program, that program is nowhere to be found right now.
18261828*/
1827   ROM_REGION( 0x0800,   "nvram", 0 )
1828   ROM_LOAD( "jolyc980_nv.bin",  0x0000, 0x0800, CRC(c917f071) SHA1(fdcd974d3acd4acf2e0ff5fca820cfc65fe18867) )   /* default NVRAM */
1829   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1830   ROM_LOAD( "jolyc980_nvram.bin",  0x0000, 0x0800, CRC(c917f071) SHA1(fdcd974d3acd4acf2e0ff5fca820cfc65fe18867) )
18291831
18301832   ROM_REGION( 0x0200, "proms", 0 )
18311833   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
r7553r7554
18401842   ROM_LOAD( "jollyb.bin", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
18411843   ROM_LOAD( "jollya.bin", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
18421844
1845   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1846   ROM_LOAD( "jolycdev_nvram.bin",  0x0000, 0x0800, CRC(ae2c2fb8) SHA1(912d673ea8e26ff62520a7b86e702e5260cff4c0) )
1847
18431848   ROM_REGION( 0x0200, "proms", 0 )
18441849   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18451850
r7553r7554
18711876   ROM_LOAD( "jollyb.bin", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
18721877   ROM_LOAD( "jollya.bin", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
18731878
1879   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1880   ROM_LOAD( "jolyccra_nvram.bin",  0x0000, 0x0800, CRC(478ab0a9) SHA1(8c5160d2ac8d4a9db0ae1e478d3bb1513a04544f) )
1881
18741882   ROM_REGION( 0x0200, "proms", 0 )
18751883   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18761884ROM_END
r7553r7554
18841892   ROM_LOAD( "jolycard.ch2", 0x0000, 0x8000, CRC(c512b103) SHA1(1f4e78e97855afaf0332fb75e1b5571aafd01c29) )
18851893   ROM_LOAD( "jolycard.ch1", 0x8000, 0x8000, CRC(0f24f39d) SHA1(ac1f6a8a4a2a37cbc0d45c15187b33c25371bffb) )
18861894
1895   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1896   ROM_LOAD( "jolyccrb_nvram.bin",  0x0000, 0x0800, CRC(c1d49c88) SHA1(27ffdedfc7f09ff11c3b2537db3681473b776074) )
1897
18871898   ROM_REGION( 0x0200, "proms", 0 )
18881899   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
18891900ROM_END
r7553r7554
19191930   ROM_LOAD( "2.bin", 0x0000, 0x8000, CRC(46805150) SHA1(63687ac44f6ace6d8924b2629536bcc7d3979ed2) )
19201931   ROM_LOAD( "1.bin", 0x8000, 0x8000, CRC(43bcb2df) SHA1(5022bc3a0b852a7cd433e25c3c90a720e6328261) )
19211932
1933   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1934   ROM_LOAD( "jolycdit_nvram.bin",  0x0000, 0x0800, CRC(c55c6706) SHA1(a38ae926f057fb47e48ca841b2d097fc4fd06416) )
1935
19221936   ROM_REGION( 0x0200, "proms", 0 )
19231937   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
19241938
r7553r7554
19631977   ROM_LOAD( "2.bin", 0x0000, 0x8000, CRC(46805150) SHA1(63687ac44f6ace6d8924b2629536bcc7d3979ed2) )
19641978   ROM_LOAD( "1.bin", 0x8000, 0x8000, CRC(43bcb2df) SHA1(5022bc3a0b852a7cd433e25c3c90a720e6328261) )
19651979
1980   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
1981   ROM_LOAD( "jolycdib_nvram.bin",  0x0000, 0x0800, CRC(038a71fe) SHA1(99d3befbee8f9f86ce7f074de7f16fb25053c077) )
1982
19661983   ROM_REGION( 0x0200, "proms", 0 )
19671984   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
19681985
r7553r7554
19791996   ROM_LOAD( "sj2.bin", 0x0000, 0x8000, CRC(d7253325) SHA1(ad40e662519da9b11f77690b7d41c5007f74e280) )
19801997   ROM_LOAD( "sj1.bin", 0x8000, 0x8000, CRC(82741749) SHA1(d0bf3073dff9ba1c4913fd754f965951e9cb5b03) )
19811998
1999   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2000   ROM_LOAD( "sjcd2kx3_nvram.bin",  0x0000, 0x0800, CRC(1141368b) SHA1(b4af2d59b5e8115440e1219a621cfd2fb8c2c978) )
2001
19822002   ROM_REGION( 0x0200, "proms", 0 )
19832003   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
19842004
r7553r7554
20942114   ROM_LOAD( "cuore1b.u21", 0x0000, 0x8000, CRC(14eca2b8) SHA1(35cba415800c6cd3e6ed9946057f33510ad2bfc9) )
20952115   ROM_LOAD( "cuore1c.u22", 0x8000, 0x8000, CRC(253fac84) SHA1(1ad104ab8e8d73df6397a840a4b26565b245d7a3) )
20962116
2117   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2118   ROM_LOAD( "cuoreuno_nvram.bin",  0x0000, 0x0800, CRC(b5a1bf25) SHA1(c2996a28c080debf10ab7a7dc47c305aed172a83) )
2119
20972120   ROM_REGION( 0x0200, "proms", 0 )
20982121   ROM_LOAD( "am27s29_cu.bin",    0x0000, 0x0200, CRC(7ea61749) SHA1(3167acd79f9bda2078c2af3e049ad6abf160aeae) )
20992122
r7553r7554
21332156   ROM_LOAD( "eleph_b.u21", 0x10000, 0x10000, CRC(e3612670) SHA1(beb65f7d2bd6d7bc68cfd876af51910cf6417bd0) )
21342157   ROM_COPY( "gfx1",    0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
21352158
2159   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2160   ROM_LOAD( "elephfam_nvram.bin",  0x0000, 0x0800, CRC(fb9b1100) SHA1(cf15ce55042f1c4399fec480c2f862622905a8b5) )
2161
21362162   ROM_REGION( 0x0200, "proms", 0 )
21372163   ROM_LOAD( "am27s29_ef.u25",    0x0000, 0x0200, CRC(bca8b82a) SHA1(4aa19f5ecd9953bf8792dceb075a746f77c01cfc) )
21382164
r7553r7554
21512177   ROM_LOAD( "elephb.u21", 0x0000, 0x8000, CRC(3c60549c) SHA1(c839b3ea415a877e5eac04e0522c342cce8d6e64) )
21522178   ROM_LOAD( "elephc.u20", 0x8000, 0x8000, CRC(448ba955) SHA1(2785cbc8cd42a7dda85bd8b81d5fbec01a1ba0bd) )
21532179
2180   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2181   ROM_LOAD( "elephfmb_nvram.bin",  0x0000, 0x0800, CRC(13a0cfea) SHA1(9c8ce509ef1076e88ea853347b64c5591bc2e18c) )
2182
21542183   ROM_REGION( 0x0200, "proms", 0 )
21552184   ROM_LOAD( "am27s29_ef.u25",    0x0000, 0x0200, CRC(bca8b82a) SHA1(4aa19f5ecd9953bf8792dceb075a746f77c01cfc) )
21562185
r7553r7554
22672296   ROM_LOAD( "2.u21", 0x0000, 0x8000, CRC(99c8c074) SHA1(f8082b08e895cbcd028a2b7cd961a7a2c8b2762c) )
22682297   ROM_LOAD( "1.u20", 0x8000, 0x8000, CRC(9abedd0c) SHA1(f184a82e8ec2387069d631bcb77e890acd44b3f5) )
22692298
2299   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2300   ROM_LOAD( "pool10_nvram.bin",  0x0000, 0x0800, CRC(2f2fab43) SHA1(f815b70c171bad99fa6a60c256e4fdc85dd6b290) )
2301
22702302   ROM_REGION( 0x0200, "proms", 0 )
22712303   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
22722304
r7553r7554
22872319   ROM_LOAD( "u21.bin", 0x10000, 0x10000, CRC(581c4878) SHA1(5ae61af090feea1745e22f46b33b2c01e6013fbe) )
22882320   ROM_COPY( "gfx1",    0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
22892321
2322   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2323   ROM_LOAD( "pool10b_nvram.bin",  0x0000, 0x0800, CRC(d9f35299) SHA1(2c3608bc9c322a9cc86f74d8fa2f660804a8cf3c) )
2324
22902325   ROM_REGION( 0x0200, "proms", 0 )
22912326   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
22922327
r7553r7554
23052340   ROM_LOAD( "b.u21", 0x0000, 0x8000, CRC(99c8c074) SHA1(f8082b08e895cbcd028a2b7cd961a7a2c8b2762c) )
23062341   ROM_LOAD( "c.u20", 0x8000, 0x8000, CRC(9abedd0c) SHA1(f184a82e8ec2387069d631bcb77e890acd44b3f5) )
23072342
2343   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2344   ROM_LOAD( "pool10c_nvram.bin",  0x0000, 0x0800, CRC(396aefed) SHA1(066b87ff054dfb37f733a812ad0dc1b1bd2478e6) )
2345
23082346   ROM_REGION( 0x0200, "proms", 0 )
23092347   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
23102348
r7553r7554
23232361   ROM_LOAD( "2.u21", 0x0000, 0x8000, CRC(99c8c074) SHA1(f8082b08e895cbcd028a2b7cd961a7a2c8b2762c) )
23242362   ROM_LOAD( "1.u20", 0x8000, 0x8000, CRC(9abedd0c) SHA1(f184a82e8ec2387069d631bcb77e890acd44b3f5) )
23252363
2364   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2365   ROM_LOAD( "pool10d_nvram.bin",  0x0000, 0x0800, CRC(6b5984a0) SHA1(156a94e74e33b1a15222cffff9b62e65f6f5f2f5) )
2366
23262367   ROM_REGION( 0x0200, "proms", 0 )
23272368   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
23282369
r7553r7554
23622403   ROM_LOAD( "tortu.b.u21", 0x0000, 0x8000, CRC(e7b18584) SHA1(fa1c367469d4ced5d7c83c15a25ec5fd6afcca10) )
23632404   ROM_LOAD( "tortu.c.u20", 0x8000, 0x8000, CRC(3cda6f73) SHA1(b4f3d2d3c652ebf6973358ae33b7808de5939acd) )
23642405
2406   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2407   ROM_LOAD( "tortufam_nvram.bin",  0x0000, 0x0800, CRC(e5a08b1b) SHA1(6575ed3ec66ef0e42129225fe1679519e5e1c946) )
2408
23652409   ROM_REGION( 0x0200, "proms", 0 )
23662410   ROM_LOAD( "am27s29pc_tf.u25",    0x0000, 0x0200, CRC(c6d433fb) SHA1(065de832bbe8765eb0aacc2029e587a4f5362f8a) )
23672411
r7553r7554
23802424   ROM_LOAD( "potg.b.u21", 0x0000, 0x8000, CRC(32fc1d4f) SHA1(cc533a44498338bc0cbb7c7b9c42559ce7ff1337) )
23812425   ROM_LOAD( "potg.c.u20", 0x8000, 0x8000, CRC(0331eb42) SHA1(a8e838d644fc6d93a9632070b305e44e4242ce94) )
23822426
2427   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2428   ROM_LOAD( "potgame_nvram.bin",  0x0000, 0x0800, CRC(2b07fb37) SHA1(9cbd3d8fb076d683a7853b3dd8a39a27f1c8872b) )
2429
23832430   ROM_REGION( 0x0200, "proms", 0 )
23842431   ROM_LOAD( "am27s29_pot.u25",    0x0000, 0x0200, CRC(a221f151) SHA1(270c57c9b7de912b136686bc6720eb8f12dbb805) )
23852432
r7553r7554
23982445   ROM_LOAD( "boat_2.bin", 0x0000, 0x8000, CRC(a6b36c3f) SHA1(90b12d9552ad5dbf11a30fc7451da1f3e6763cc3) )
23992446   ROM_LOAD( "boat_1.bin", 0x8000, 0x8000, CRC(61fd8c19) SHA1(eb8fd8bd7de38a6c8a435e9e36daf699162138a5) )
24002447
2448   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2449   ROM_LOAD( "bottle10_nvram.bin",  0x0000, 0x0800, CRC(82927c53) SHA1(8cde91588cb53fefc84f0b14fc5c0b26a3a445eb) )
2450
24012451   ROM_REGION( 0x0200, "proms", 0 )
24022452   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
24032453
r7553r7554
24162466   ROM_LOAD( "2.u21", 0x0000, 0x8000, CRC(9395c15b) SHA1(e4caefc6f55b07f5c4370a3b8652fa93e08987ce) )
24172467   ROM_LOAD( "1.u20", 0x8000, 0x8000, CRC(61fd8c19) SHA1(eb8fd8bd7de38a6c8a435e9e36daf699162138a5) )
24182468
2469   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2470   ROM_LOAD( "bottl10b_nvram.bin",  0x0000, 0x0800, CRC(59976182) SHA1(f8d26169e86444607bc5a6649f41e7f5c05ddbb4) )
2471
24192472   ROM_REGION( 0x0200, "proms", 0 )
24202473   ROM_LOAD( "n82s147an_p10.u25",    0x0000, 0x0200, CRC(1de03d14) SHA1(d8eda20865c1d885a428931f4380032e103b252c) )
24212474
r7553r7554
24592512   ROM_LOAD( "2.bin", 0x0000, 0x8000, CRC(85e77661) SHA1(7d7a765c1bfcfeb9eb91d2519b22d734f20eab24) )
24602513   ROM_LOAD( "1.bin", 0x8000, 0x8000, CRC(41f7a0b3) SHA1(9aff2b8832d2a4f868daa9849a0bfe5e44f88fc0) )
24612514
2515   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2516   ROM_LOAD( "royalcrd_nvram.bin",  0x0000, 0x0800, CRC(335bfa5a) SHA1(7e9cbb502f450c515ea03ffcf4b7fbae60af4e73) )
2517
24622518   ROM_REGION( 0x0200, "proms", 0 )
24632519   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
24642520
r7553r7554
24982554   ROM_LOAD( "2a.bin", 0x10000, 0x10000, CRC(3af71cf8) SHA1(3a0ce0d0abebf386573c5936545dada1d3558e55) )
24992555   ROM_COPY( "gfx1",    0x10000, 0x00000, 0x8000 )   /* rgn, srcoffset, offset, length */
25002556
2557   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2558   ROM_LOAD( "royalcdb_nvram.bin",  0x0000, 0x0800, CRC(3b03440f) SHA1(49e51b8c9e1404d39c479a2d0619aab43f1a6529) )
2559
25012560   ROM_REGION( 0x0200, "proms", 0 )
25022561   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
25032562
r7553r7554
25712630   ROM_LOAD( "l2.bin", 0x0000, 0x8000, CRC(8ca90a8f) SHA1(bc3db3f8c097f89eff488e3aca39bf24ff2b5cff) )
25722631   ROM_LOAD( "l1.bin", 0x8000, 0x8000, CRC(beadc35c) SHA1(8a6a5954a827def8c4c3b904d8ee58a4bde53d85) )
25732632
2633   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2634   ROM_LOAD( "lluck3x3_nvram.bin",  0x0000, 0x0800, CRC(2fe79cff) SHA1(7839c04336b7702c7bdcd2b6917a353f4376f824) )
2635
25742636   ROM_REGION( 0x0200, "proms", 0 )
25752637   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
25762638ROM_END
r7553r7554
25842646   ROM_LOAD( "l2.bin", 0x0000, 0x8000, CRC(8ca90a8f) SHA1(bc3db3f8c097f89eff488e3aca39bf24ff2b5cff) )
25852647   ROM_LOAD( "l1.bin", 0x8000, 0x8000, CRC(beadc35c) SHA1(8a6a5954a827def8c4c3b904d8ee58a4bde53d85) )
25862648
2649   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2650   ROM_LOAD( "lluck4x1_nvram.bin",  0x0000, 0x0800, CRC(05d2d7b8) SHA1(1188b2b4835cadd95b1e9160c2948a2e3457afd2) )
2651
25872652   ROM_REGION( 0x0200, "proms", 0 )
25882653   ROM_LOAD( "n82s147.bin",    0x0000, 0x0200, CRC(8bc86f48) SHA1(4c677ab9314a1f571e35104b22659e6811aeb194) )
25892654ROM_END
r7553r7554
26132678   ROM_LOAD( "mc2gr2.bin",   0x0000, 0x8000, CRC(733da697) SHA1(45122c64d5a371ec91cecc67b7faf179078e714d) )
26142679   ROM_LOAD( "mc2gr1.bin",   0x8000, 0x8000, CRC(2406b8d2) SHA1(e9d7a25562fd5adee351d7ef6ba02fff6aab021a) )
26152680
2681   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2682   ROM_LOAD( "magicrd2_nvram.bin",  0x0000, 0x0800, CRC(343b3162) SHA1(1524959dbbc0c6d7c5c3a4a6b20976382cfbe88f) )
2683
26162684   ROM_REGION( 0x0200, "proms", 0 )
26172685   ROM_LOAD( "mc2-82s147.bin",   0x0000, 0x0200, CRC(aa91cc35) SHA1(79f9a755441500e618c4183f524f969fffd44100) )
26182686
r7553r7554
26632731   ROM_LOAD( "v2.bin", 0x0000, 0x8000, CRC(af7ab460) SHA1(01ea400424152c09c10eb83a1bd569019969ccb7) )
26642732   ROM_LOAD( "v1.bin", 0x8000, 0x8000, CRC(23e0d1c6) SHA1(98967b14d3264c444a1dfbd15c57cde70f41f09d) )
26652733
2734   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2735   ROM_LOAD( "vegasslw_nvram.bin",  0x0000, 0x0800, CRC(59b84075) SHA1(964531320d29adc42c3d8f0a28df395354a51d9b) )
2736
26662737   ROM_REGION( 0x0200, "proms", 0 )
26672738   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
26682739ROM_END
r7553r7554
26762747   ROM_LOAD( "v2.bin", 0x0000, 0x8000, CRC(af7ab460) SHA1(01ea400424152c09c10eb83a1bd569019969ccb7) )
26772748   ROM_LOAD( "v1.bin", 0x8000, 0x8000, CRC(23e0d1c6) SHA1(98967b14d3264c444a1dfbd15c57cde70f41f09d) )
26782749
2750   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2751   ROM_LOAD( "vegasfst_nvram.bin",  0x0000, 0x0800, CRC(627d13d7) SHA1(03ac605c589c645b672c57b0695dcb90240068e1) )
2752
26792753   ROM_REGION( 0x0200, "proms", 0 )
26802754   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
26812755ROM_END
r7553r7554
26892763   ROM_LOAD( "ch2.bin", 0x0000, 0x8000, CRC(af7ab460) SHA1(01ea400424152c09c10eb83a1bd569019969ccb7) )
26902764   ROM_LOAD( "ch1.bin", 0x8000, 0x8000, CRC(0a3679c0) SHA1(ce8a067e1a2eccf9fabb16733ef3a14e0e8129e5) )   /* X & Y in txt layer */
26912765
2766   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2767   ROM_LOAD( "vegasfte_nvram.bin",  0x0000, 0x0800, CRC(c09e49a2) SHA1(e95f444f1bfda0a2f2af6045f6079e16f13d244d) )
2768
26922769   ROM_REGION( 0x0200, "proms", 0 )
26932770   ROM_LOAD( "82s147.bin",   0x0000, 0x0200, CRC(5ebc5659) SHA1(8d59011a181399682ab6e8ed14f83101e9bfa0c6) )
26942771ROM_END
r7553r7554
27842861   ROM_LOAD( "impera2.bin", 0x0000, 0x8000, CRC(f0fa5941) SHA1(1fcade31ed6893ffcfd4efe97dfaaa31d24283ec) )
27852862   ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(c3ab44dd) SHA1(e46c0fd94da561f57033647f1703fa135777ece5) )
27862863
2864   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2865   ROM_LOAD( "jolyjokr_nvram.bin",  0x0000, 0x0800, CRC(f33e66ed) SHA1(7a4b9a1b2f976d5d26f54915a213d5ac5eca0a42) )
2866
27872867   ROM_REGION( 0x0200, "proms", 0 )
27882868   ROM_LOAD( "am27s29.bin", 0x0000, 0x0200, CRC(0b671bba) SHA1(92d512e02b50f98b7bc5a60deee4fee722656c4f) )
27892869ROM_END
r7553r7554
27972877   ROM_LOAD( "impera2.bin", 0x0000, 0x8000, CRC(f0fa5941) SHA1(1fcade31ed6893ffcfd4efe97dfaaa31d24283ec) )
27982878   ROM_LOAD( "impera1.bin", 0x8000, 0x8000, CRC(c3ab44dd) SHA1(e46c0fd94da561f57033647f1703fa135777ece5) )
27992879
2880   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2881   ROM_LOAD( "jolyjokra_nvram.bin",  0x0000, 0x0800, CRC(ed43693c) SHA1(d4aa4e539ab12c97bc9b9b1077997195a11d782b) )
2882
28002883   ROM_REGION( 0x0200, "proms", 0 )
28012884   ROM_LOAD( "am27s29.bin", 0x0000, 0x0200, CRC(0b671bba) SHA1(92d512e02b50f98b7bc5a60deee4fee722656c4f) )
28022885ROM_END
r7553r7554
28282911   ROM_LOAD( "ic26.bin", 0x10000, 0x10000, CRC(3e45dfc6) SHA1(8fd0b0cc00cdd96244ae7e7a91f6613b1c144ee0) )
28292912   ROM_COPY( "gfx1",     0x10000, 0x00000, 0x8000 ) /* rgn, srcoffset, offset, length */
28302913
2914   ROM_REGION( 0x0800,   "nvram", 0 )   /* default NVRAM */
2915   ROM_LOAD( "jolyjokrb_nvram.bin",  0x0000, 0x0800, CRC(17007bb5) SHA1(72e08096293ce4fbde205a63b5ecd9641dbee017) )
2916
28312917   ROM_REGION( 0x0200, "proms", 0 )
28322918   ROM_LOAD( "am27s29_ic40.bin",   0x0000, 0x0200, CRC(0b671bba) SHA1(92d512e02b50f98b7bc5a60deee4fee722656c4f) )
28332919ROM_END
src/mame/drivers/xmen.c
r7553r7554
595595
596596   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
597597   ROM_LOAD( "065-a06.1f",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
598
599   ROM_REGION16_BE( 0x80, "eeprom", 0 )
600   ROM_LOAD( "xmen_ubb.nv", 0x0000, 0x0080, CRC(52f334ba) SHA1(171c22b5ac41bcbbcfc31528cf49c096f6829a72) )
598601ROM_END
599602
600603ROM_START( xmenj )
r7553r7554
620623
621624   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
622625   ROM_LOAD( "065-a06.1f",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
626
627   ROM_REGION16_BE( 0x80, "eeprom", 0 )
628   ROM_LOAD( "xmen_jba.nv", 0x0000, 0x0080, CRC(7439cea7) SHA1(d34b8ed0549b0457362159098e5c86b1356e35d0) )
623629ROM_END
624630
625631ROM_START( xmene )
r7553r7554
645651
646652   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
647653   ROM_LOAD( "065-a06.1f",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
654
655   ROM_REGION16_BE( 0x80, "eeprom", 0 )
656   ROM_LOAD( "xmen_eba.nv", 0x0000, 0x0080, CRC(37f8e77a) SHA1(0b92caba33486c6fd104806aa96f735743bb2221) )
648657ROM_END
649658
650659ROM_START( xmen2pe )
r7553r7554
670679
671680   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
672681   ROM_LOAD( "065-a06.1f",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
682
683   ROM_REGION16_BE( 0x80, "eeprom", 0 )
684   ROM_LOAD( "xmen_eaa.nv", 0x0000, 0x0080, CRC(1cbcb653) SHA1(a86b4ad34ccbd868662ff8c61eb21ec07e8bf8b1) )
673685ROM_END
674686
675687ROM_START( xmen2pa )
r7553r7554
695707
696708   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
697709   ROM_LOAD( "065-a06.1f",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
710
711   ROM_REGION16_BE( 0x80, "eeprom", 0 )
712   ROM_LOAD( "xmen_aaa.nv", 0x0000, 0x0080, CRC(750fd447) SHA1(27884c1ceb0b5174f7d06e1e06bbbd6d6c5b47e7) )
698713ROM_END
699714
700715ROM_START( xmen2pj )
r7553r7554
720735
721736   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
722737   ROM_LOAD( "065-a06.1f",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
738
739   ROM_REGION16_BE( 0x80, "eeprom", 0 )
740   ROM_LOAD( "xmen_jaa.nv", 0x0000, 0x0080, CRC(849a9e19) SHA1(bd335a2d33bf4433de4fd57b8108b216eb3a2cf1) )
723741ROM_END
724742
725743/*
r7553r7554
799817
800818   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
801819   ROM_LOAD( "065-a06.1d",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
820
821   ROM_REGION16_BE( 0x80, "eeprom", 0 )
822   ROM_LOAD( "xmen_ecb.nv", 0x0000, 0x0080, CRC(462c6e1a) SHA1(a57087163d7a760d5922c70842cfae20e6a2f5b5) )
802823ROM_END
803824
804825
r7553r7554
825846
826847   ROM_REGION( 0x200000, "k054539", 0 )   /* samples for the 054539 */
827848   ROM_LOAD( "065-a06.1d",  0x000000, 0x200000, CRC(5adbcee0) SHA1(435feda697193bc51db80eba46be474cbbc1de4b) )
849
850   ROM_REGION16_BE( 0x80, "eeprom", 0 )
851   ROM_LOAD( "xmen_ucb.nv", 0x0000, 0x0080, CRC(f3d0f682) SHA1(b0d4655c651238ae028ffb59a704acba798f93f8) )
828852ROM_END
829853
830854GAME( 1992, xmen,    0,    xmen,   xmen,    0,   ROT0, "Konami", "X-Men (4 Players ver UBB)", GAME_SUPPORTS_SAVE ) /* Second "version" letter denotes players, A=2 players, B=4 players, C=6 players ??? */
src/mame/drivers/lethal.c
r7553r7554
736736   ROM_REGION( 0x200000, "k054539", 0 )
737737   /* K054539 samples */
738738   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
739
740   ROM_REGION16_BE( 0x80, "eeprom", 0 )
741   ROM_LOAD( "lethalen.nv", 0x0000, 0x0080, CRC(6e7224e6) SHA1(86dea9262d55e58b573d397d0fea437c58728707) )
739742ROM_END
740743
741744ROM_START( lethalenj )   // Japan version JAD
r7553r7554
770773   ROM_REGION( 0x200000, "k054539", 0 )
771774   /* K054539 samples */
772775   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
776
777   ROM_REGION16_BE( 0x80, "eeprom", 0 )
778   ROM_LOAD( "lethalenj.nv", 0x0000, 0x0080, CRC(20b28f2f) SHA1(53d212f2c006729a01dfdb49cb36b67b9425172e) )
773779ROM_END
774780
775781ROM_START( lethalenux )   // US version ?, proto / hack?, very different to other sets
776782   ROM_REGION( 0x50000, "maincpu", 0 )
777783   /* main program */
778   ROM_LOAD( "191xxx01.u4",    0x10000,  0x40000, CRC(a3b9e790) SHA1(868b422850be129952c8b11c3c4aa730d8ea1544) ) // hacked? fails rom test
784   ROM_LOAD( "191xxx01.u4",    0x10000,  0x40000, CRC(a3b9e790) SHA1(868b422850be129952c8b11c3c4aa730d8ea1544) ) // hacked? fails rom test, verified on multiple boards
779785
780786   ROM_REGION( 0x020000, "soundcpu", 0 )
781787   /* Z80 sound program */
r7553r7554
804810   ROM_REGION( 0x200000, "k054539", 0 )
805811   /* K054539 samples */
806812   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
813
814   ROM_REGION16_BE( 0x80, "eeprom", 0 )
815   ROM_LOAD( "lethalenux.nv", 0x0000, 0x0080, CRC(5d69c39d) SHA1(e468df829ee5094792289f9166d7e39b638ab70d) )
807816ROM_END
808817
809818ROM_START( lethaleneab )   // Euro ver. EAB
r7553r7554
838847   ROM_REGION( 0x200000, "k054539", 0 )
839848   /* K054539 samples */
840849   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
850
851   ROM_REGION16_BE( 0x80, "eeprom", 0 )
852   ROM_LOAD( "lethaleneab.nv", 0x0000, 0x0080, CRC(4e9bb34d) SHA1(9502583bc9f5f6fc5bba333869398b24bf154b73) )
841853ROM_END
842854
843855ROM_START( lethaleneae )   // Euro ver. EAE
r7553r7554
872884   ROM_REGION( 0x200000, "k054539", 0 )
873885   /* K054539 samples */
874886   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
887
888   ROM_REGION16_BE( 0x80, "eeprom", 0 )
889   ROM_LOAD( "lethaleneae.nv", 0x0000, 0x0080, CRC(eb369a67) SHA1(6c67294669614e96de5efb38372dbed435ee04d3) )
875890ROM_END
876891
877892ROM_START( lethalenua )   // *might* be UAA (writes UA to Eeprom)
r7553r7554
906921   ROM_REGION( 0x200000, "k054539", 0 )
907922   /* K054539 samples */
908923   ROM_LOAD( "191a03", 0x000000, 0x200000, CRC(9b13fbe8) SHA1(19b02dbd9d6da54045b0ba4dfe7b282c72745c9c))
924
925   ROM_REGION16_BE( 0x80, "eeprom", 0 )
926   ROM_LOAD( "lethalenua.nv", 0x0000, 0x0080, CRC(f71ad1c3) SHA1(04c7052d0895797af8a06183b8a877795bf2dbb3) )
909927ROM_END
910928
911929
r7553r7554
917935
918936GAME( 1992, lethalen,   0,        lethalen, lethalen, lethalen, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers (ver UAE, 11/19/92 15:04)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // writes UE to eeprom
919937GAME( 1992, lethalenua, lethalen, lethalen, lethalen, lethalen, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers (ver unknown, US, 08/17/92 21:38)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // UAA? (writes UA to eeprom)
920GAME( 1992, lethalenux, lethalen, lethalen, lethalen, lethalen, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers (ver unknown, US, 08/06/92 15:11, hacked/proto?)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // writes UA to eeprom but earlier than suspected UAA set, might be a proto, might be hacked, fails rom test
938GAME( 1992, lethalenux, lethalen, lethalen, lethalen, lethalen, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers (ver unknown, US, 08/06/92 15:11, hacked/proto?)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // writes UA to eeprom but earlier than suspected UAA set, might be a proto, might be hacked, fails rom test, definitely a good dump, another identical set was found in Italy
921939GAME( 1992, lethaleneab,lethalen, lethalen, lethalen, lethalen, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers (ver EAB, 10/14/92 19:53)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // writes EC to eeprom?!
922940GAME( 1992, lethaleneae,lethalen, lethalen, lethalen, lethalen, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers (ver EAE, 11/19/92 16:24)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // writes EE to eeprom
923941// different mirror / display setup, shoot off the top of the screen to reload..
src/mame/drivers/pzletime.c
r7553r7554
337337
338338   ROM_REGION( 0x80000, "gfx3", 0 )
339339   ROM_LOAD( "9.bin",   0x000000, 0x80000, CRC(a8144a7e) SHA1(9dfdd6c17a91cad6b56c622671042ac2ee2c9ec8) )
340
341   ROM_REGION16_BE( 0x80, "eeprom", 0 )
342   ROM_LOAD( "pzletime.nv", 0x0000, 0x0080, CRC(e5ed3d40) SHA1(8c163a6e5839e5c82d52f046d3268202fdf9f4d1) )
340343ROM_END
341344
342345GAME( 199?, pzletime, 0, pzletime,  pzletime,  0, ROT0, "Elettronica Video-Games S.R.L.", "Puzzle Time (Prototype)", 0 )
src/mame/drivers/mystwarr.c
r7553r7554
11551155   ROM_REGION( 0x400000, "shared", 0 )
11561156   ROM_LOAD( "128a06.2d", 0x000000, 2*1024*1024, CRC(88ed598c) SHA1(3c123e26b3a12541df77b368bc0e0d486f5622b6) )
11571157   ROM_LOAD( "128a07.1d", 0x200000, 2*1024*1024, CRC(db79a66e) SHA1(b7e118ed26bac557038e8ae6cb77f23f3da5646f) )
1158
1159   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1160   ROM_LOAD( "mystwarr.nv", 0x0000, 0x080, CRC(28df2269) SHA1(3f071c97662745a199f96964e2e79f795bd5a391) )
11581161ROM_END
11591162
11601163ROM_START( mystwarru )
r7553r7554
11921195   ROM_REGION( 0x400000, "shared", 0 )
11931196   ROM_LOAD( "128a06.2d", 0x000000, 2*1024*1024, CRC(88ed598c) SHA1(3c123e26b3a12541df77b368bc0e0d486f5622b6) )
11941197   ROM_LOAD( "128a07.1d", 0x200000, 2*1024*1024, CRC(db79a66e) SHA1(b7e118ed26bac557038e8ae6cb77f23f3da5646f) )
1198
1199   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1200   ROM_LOAD( "mystwarru.nv", 0x0000, 0x080, CRC(1a2597c7) SHA1(3d85817fe42776c862a5930b8ad131443bc0172e) )
11951201ROM_END
11961202
11971203ROM_START( mystwarrj )
r7553r7554
12291235   ROM_REGION( 0x400000, "shared", 0 )
12301236   ROM_LOAD( "128a06.2d", 0x000000, 2*1024*1024, CRC(88ed598c) SHA1(3c123e26b3a12541df77b368bc0e0d486f5622b6) )
12311237   ROM_LOAD( "128a07.1d", 0x200000, 2*1024*1024, CRC(db79a66e) SHA1(b7e118ed26bac557038e8ae6cb77f23f3da5646f) )
1238
1239   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1240   ROM_LOAD( "mystwarrj.nv", 0x0000, 0x080, CRC(8e259918) SHA1(5eb46b0d96278648e8d2e84304d9bccd8dd68430) )
12321241ROM_END
12331242
12341243ROM_START( viostorm )
r7553r7554
12611270   ROM_REGION( 0x400000, "shared", 0)
12621271   ROM_LOAD( "168a06.1c", 0x000000, 2*1024*1024, CRC(25404fd7) SHA1(282cf523728b38d0bf14d765dd7257aa1fb2af39) )
12631272   ROM_LOAD( "168a07.1e", 0x200000, 2*1024*1024, CRC(fdbbf8cc) SHA1(a8adf72a25fe2b9c4c338350d02c92deb5f8c8e9) )
1273
1274   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1275   ROM_LOAD( "viostorm.nv", 0x0000, 0x080, CRC(28b5fe49) SHA1(0ef51ae4b012a7d680543747fd4b6dd9dfb5f560) )
12641276ROM_END
12651277
12661278ROM_START( viostormu )
r7553r7554
12931305   ROM_REGION( 0x400000, "shared", 0)
12941306   ROM_LOAD( "168a06.1c", 0x000000, 2*1024*1024, CRC(25404fd7) SHA1(282cf523728b38d0bf14d765dd7257aa1fb2af39) )
12951307   ROM_LOAD( "168a07.1e", 0x200000, 2*1024*1024, CRC(fdbbf8cc) SHA1(a8adf72a25fe2b9c4c338350d02c92deb5f8c8e9) )
1308
1309   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1310   ROM_LOAD( "viostormu.nv", 0x0000, 0x080, CRC(797042a1) SHA1(f33eb8b1b21f3d41372694fa6297bc2cc802c2eb) )
12961311ROM_END
12971312
12981313ROM_START( viostormub )
r7553r7554
13251340   ROM_REGION( 0x400000, "shared", 0)
13261341   ROM_LOAD( "168a06.1c", 0x000000, 2*1024*1024, CRC(25404fd7) SHA1(282cf523728b38d0bf14d765dd7257aa1fb2af39) )
13271342   ROM_LOAD( "168a07.1e", 0x200000, 2*1024*1024, CRC(fdbbf8cc) SHA1(a8adf72a25fe2b9c4c338350d02c92deb5f8c8e9) )
1343
1344   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1345   ROM_LOAD( "viostormub.nv", 0x0000, 0x080, CRC(b6937413) SHA1(eabc2ea661201f5ed42ab541aee765480bbdd5bc) )
13281346ROM_END
13291347
13301348ROM_START( viostorma )
r7553r7554
13571375   ROM_REGION( 0x400000, "shared", 0 )
13581376   ROM_LOAD( "168a06.1c", 0x000000, 2*1024*1024, CRC(25404fd7) SHA1(282cf523728b38d0bf14d765dd7257aa1fb2af39) )
13591377   ROM_LOAD( "168a07.1e", 0x200000, 2*1024*1024, CRC(fdbbf8cc) SHA1(a8adf72a25fe2b9c4c338350d02c92deb5f8c8e9) )
1378
1379   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1380   ROM_LOAD( "viostorma.nv", 0x0000, 0x080, CRC(2cfbf966) SHA1(fb9c4a47bac20a7f820a1fa178fc9f9079101cb8) )
13601381ROM_END
13611382
13621383ROM_START( viostormj )
r7553r7554
13891410   ROM_REGION( 0x400000, "shared", 0 )
13901411   ROM_LOAD( "168a06.1c", 0x000000, 2*1024*1024, CRC(25404fd7) SHA1(282cf523728b38d0bf14d765dd7257aa1fb2af39) )
13911412   ROM_LOAD( "168a07.1e", 0x200000, 2*1024*1024, CRC(fdbbf8cc) SHA1(a8adf72a25fe2b9c4c338350d02c92deb5f8c8e9) )
1413
1414   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1415   ROM_LOAD( "viostormj.nv", 0x0000, 0x080, CRC(32f5d8bc) SHA1(0c486ce80b62bfaf4f3c0be7653c0beaf4cfafbd) )
13921416ROM_END
13931417
13941418ROM_START( metamrph )
r7553r7554
14241448   ROM_REGION( 0x400000, "shared", 0 )
14251449   ROM_LOAD( "224a06", 0x000000, 2*1024*1024, CRC(972f6abe) SHA1(30907495fc49fe3424c092b074c1dc137aa14306) )
14261450   ROM_LOAD( "224a07", 0x200000, 1*1024*1024, CRC(61b2f97a) SHA1(34bf835d6361c7809d40fa20fd238c9e2a84b101) )
1451
1452   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1453   ROM_LOAD( "metamrph.nv", 0x0000, 0x080, CRC(2c51229a) SHA1(7f056792cc44ec3d4aacc33c825ab796a913488e) )
14271454ROM_END
14281455
14291456ROM_START( metamrphu )
r7553r7554
14591486   ROM_REGION( 0x400000, "shared", 0 )
14601487   ROM_LOAD( "224a06", 0x000000, 2*1024*1024, CRC(972f6abe) SHA1(30907495fc49fe3424c092b074c1dc137aa14306) )
14611488   ROM_LOAD( "224a07", 0x200000, 1*1024*1024, CRC(61b2f97a) SHA1(34bf835d6361c7809d40fa20fd238c9e2a84b101) )
1489
1490   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1491   ROM_LOAD( "metamrphu.nv", 0x0000, 0x080, CRC(1af2f855) SHA1(5f2fbb172f56867ee6f782cda8da65451b02435e) )
14621492ROM_END
14631493
14641494ROM_START( metamrphj )
r7553r7554
14941524   ROM_REGION( 0x400000, "shared", 0 )
14951525   ROM_LOAD( "224a06", 0x000000, 2*1024*1024, CRC(972f6abe) SHA1(30907495fc49fe3424c092b074c1dc137aa14306) )
14961526   ROM_LOAD( "224a07", 0x200000, 1*1024*1024, CRC(61b2f97a) SHA1(34bf835d6361c7809d40fa20fd238c9e2a84b101) )
1527
1528   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1529   ROM_LOAD( "metamrphj.nv", 0x0000, 0x080, CRC(30497478) SHA1(60acfbd25ac29c7b5a2571e274704205fc64424a) )
14971530ROM_END
14981531
14991532ROM_START( mtlchamp )
r7553r7554
15281561   ROM_REGION( 0x400000, "shared", 0 )
15291562   ROM_LOAD( "234a06.2d", 0x000000, 2*1024*1024, CRC(12d32384) SHA1(ecd6cd752b0e20339e17a7652ed843fbb43f7595) )
15301563   ROM_LOAD( "234a07.1d", 0x200000, 2*1024*1024, CRC(05ee239f) SHA1(f4e6e7568dc73666a2b5e0c3fe743432e0436464) )
1564
1565   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1566   ROM_LOAD( "mtlchamp.nv", 0x0000, 0x080, CRC(cd47858e) SHA1(8effdcd631516d537f956509111cb3d4d18040db) )
15311567ROM_END
15321568
15331569ROM_START( mtlchamp1 )
r7553r7554
15621598   ROM_REGION( 0x400000, "shared", 0 )
15631599   ROM_LOAD( "234a06.2d", 0x000000, 2*1024*1024, CRC(12d32384) SHA1(ecd6cd752b0e20339e17a7652ed843fbb43f7595) )
15641600   ROM_LOAD( "234a07.1d", 0x200000, 2*1024*1024, CRC(05ee239f) SHA1(f4e6e7568dc73666a2b5e0c3fe743432e0436464) )
1601
1602   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1603   ROM_LOAD( "mtlchamp1.nv", 0x0000, 0x080, CRC(202f6968) SHA1(38fc82a77896607c7fc09b75309f80048b52eb05) )
15651604ROM_END
15661605
15671606ROM_START( mtlchampa )
r7553r7554
15961635   ROM_REGION( 0x400000, "shared", 0 )
15971636   ROM_LOAD( "234a06.2d", 0x000000, 2*1024*1024, CRC(12d32384) SHA1(ecd6cd752b0e20339e17a7652ed843fbb43f7595) )
15981637   ROM_LOAD( "234a07.1d", 0x200000, 2*1024*1024, CRC(05ee239f) SHA1(f4e6e7568dc73666a2b5e0c3fe743432e0436464) )
1638
1639   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1640   ROM_LOAD( "mtlchampa.nv", 0x0000, 0x080, CRC(79a6f420) SHA1(c2889bbb86a3f56d4f5544b6dadede0c715c59ca) )
15991641ROM_END
16001642
16011643ROM_START( mtlchampj )
r7553r7554
16301672   ROM_REGION( 0x400000, "shared", 0 )
16311673   ROM_LOAD( "234a06.2d", 0x000000, 2*1024*1024, CRC(12d32384) SHA1(ecd6cd752b0e20339e17a7652ed843fbb43f7595) )
16321674   ROM_LOAD( "234a07.1d", 0x200000, 2*1024*1024, CRC(05ee239f) SHA1(f4e6e7568dc73666a2b5e0c3fe743432e0436464) )
1675
1676   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1677   ROM_LOAD( "mtlchampj.nv", 0x0000, 0x080, CRC(e311816f) SHA1(1e8ece157e6b3978d11bc9a4a6015c6004f7a375) )
16331678ROM_END
16341679
16351680ROM_START( mtlchampu )
r7553r7554
16641709   ROM_REGION( 0x400000, "shared", 0 )
16651710   ROM_LOAD( "234a06.2d", 0x000000, 2*1024*1024, CRC(12d32384) SHA1(ecd6cd752b0e20339e17a7652ed843fbb43f7595) )
16661711   ROM_LOAD( "234a07.1d", 0x200000, 2*1024*1024, CRC(05ee239f) SHA1(f4e6e7568dc73666a2b5e0c3fe743432e0436464) )
1712
1713   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1714   ROM_LOAD( "mtlchampu.nv", 0x0000, 0x080, CRC(f5d84df7) SHA1(a14dca3ca275a754f1f46eab220a24b77ada23a5) )
16671715ROM_END
16681716
16691717ROM_START( gaiapols )
r7553r7554
17091757   ROM_REGION( 0x400000, "shared", 0 )
17101758   ROM_LOAD( "123e14.2g", 0x000000, 2*1024*1024, CRC(65dfd3ff) SHA1(57e13c05f420747c1c2010cc5340dd70e2c28971) )
17111759   ROM_LOAD( "123e15.2m", 0x200000, 2*1024*1024, CRC(7017ff07) SHA1(37ecd54f2c757c5385305ab726d9f66aa1afd456) )
1760
1761   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1762   ROM_LOAD( "gaiapols.nv", 0x0000, 0x080, CRC(44c78184) SHA1(19343b47b60bf4e212d844fce28e7a1bd54c7012) )
17121763ROM_END
17131764
17141765ROM_START( gaiapolsu )
r7553r7554
17541805   ROM_REGION( 0x400000, "shared", 0 )
17551806   ROM_LOAD( "123e14.2g", 0x000000, 2*1024*1024, CRC(65dfd3ff) SHA1(57e13c05f420747c1c2010cc5340dd70e2c28971) )
17561807   ROM_LOAD( "123e15.2m", 0x200000, 2*1024*1024, CRC(7017ff07) SHA1(37ecd54f2c757c5385305ab726d9f66aa1afd456) )
1808
1809   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1810   ROM_LOAD( "gaiapolsu.nv", 0x0000, 0x080, CRC(7ece27b6) SHA1(f0671c5e6db665c86afcef563ff1dbcbf083b380) )
17571811ROM_END
17581812
17591813ROM_START( gaiapolsj )
r7553r7554
17991853   ROM_REGION( 0x400000, "shared", 0 )
18001854   ROM_LOAD( "123e14.2g", 0x000000, 2*1024*1024, CRC(65dfd3ff) SHA1(57e13c05f420747c1c2010cc5340dd70e2c28971) )
18011855   ROM_LOAD( "123e15.2m", 0x200000, 2*1024*1024, CRC(7017ff07) SHA1(37ecd54f2c757c5385305ab726d9f66aa1afd456) )
1856
1857   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1858   ROM_LOAD( "gaiapolsj.nv", 0x0000, 0x080, CRC(c4b970df) SHA1(d4a24b4950ee33a832342c752c24b58e033d9240) )
18021859ROM_END
18031860
18041861ROM_START( mmaulers )
r7553r7554
18441901   ROM_REGION( 0x400000, "shared", 0 )
18451902   ROM_LOAD("170a14.2g", 0x000000, 2*1024*1024, CRC(83317cda) SHA1(c5398c5959ef3ea73835e13db69660dd28c31486) )
18461903   ROM_LOAD("170a15.2m", 0x200000, 2*1024*1024, CRC(d4113ae9) SHA1(e234d06f462e3db64455c384c2f42174f9ef9c6a) )
1904
1905   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1906   ROM_LOAD( "mmaulers.nv", 0x0000, 0x080, CRC(8324f517) SHA1(4697d091a1924e1a5d6c3ffc64a40fd36eebe557) )
18471907ROM_END
18481908
18491909ROM_START( dadandrn )
r7553r7554
18891949   ROM_REGION( 0x400000, "shared", 0 )
18901950   ROM_LOAD("170a14.2g", 0x000000, 2*1024*1024, CRC(83317cda) SHA1(c5398c5959ef3ea73835e13db69660dd28c31486) )
18911951   ROM_LOAD("170a15.2m", 0x200000, 2*1024*1024, CRC(d4113ae9) SHA1(e234d06f462e3db64455c384c2f42174f9ef9c6a) )
1952
1953   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
1954   ROM_LOAD( "dadandrn.nv", 0x0000, 0x080, CRC(346ae0cf) SHA1(1f79b2e21766f7a971c7d0f618700deb8a32f78a) )
18921955ROM_END
18931956
18941957static DRIVER_INIT(metamrph)
r7553r7554
19011964GAME( 1993, mystwarr,  0,        mystwarr, mystwarr, 0,        ROT0,  "Konami", "Mystic Warriors (ver EAA)", GAME_IMPERFECT_GRAPHICS )
19021965GAME( 1993, mystwarru, mystwarr, mystwarr, mystwarr, 0,        ROT0,  "Konami", "Mystic Warriors (ver UAA)", GAME_IMPERFECT_GRAPHICS )
19031966GAME( 1993, mystwarrj, mystwarr, mystwarr, mystwarr, 0,        ROT0,  "Konami", "Mystic Warriors (ver JAA)", GAME_IMPERFECT_GRAPHICS )
1967
19041968GAME( 1993, mmaulers,  0,        dadandrn, dadandrn, 0,        ROT0,  "Konami", "Monster Maulers (ver EAA)", GAME_IMPERFECT_GRAPHICS )
19051969GAME( 1993, dadandrn,  mmaulers, dadandrn, dadandrn, 0,        ROT0,  "Konami", "Kyukyoku Sentai Dadandarn (ver JAA)", GAME_IMPERFECT_GRAPHICS )
1970
19061971GAME( 1993, viostorm,  0,        viostorm, viostorm, 0,        ROT0,  "Konami", "Violent Storm (ver EAB)", GAME_IMPERFECT_GRAPHICS )
19071972GAME( 1993, viostormu, viostorm, viostorm, viostorm, 0,        ROT0,  "Konami", "Violent Storm (ver UAC)", GAME_IMPERFECT_GRAPHICS )
19081973GAME( 1993, viostormub,viostorm, viostorm, viostorm, 0,        ROT0,  "Konami", "Violent Storm (ver UAB)", GAME_IMPERFECT_GRAPHICS )
19091974GAME( 1993, viostormj, viostorm, viostorm, viostorm, 0,        ROT0,  "Konami", "Violent Storm (ver JAC)", GAME_IMPERFECT_GRAPHICS )
19101975GAME( 1993, viostorma, viostorm, viostorm, viostorm, 0,        ROT0,  "Konami", "Violent Storm (ver AAC)", GAME_IMPERFECT_GRAPHICS )
1976
19111977GAME( 1993, metamrph,  0,        metamrph, metamrph, metamrph, ROT0,  "Konami", "Metamorphic Force (ver EAA)", GAME_IMPERFECT_GRAPHICS )
19121978GAME( 1993, metamrphu, metamrph, metamrph, metamrph, metamrph, ROT0,  "Konami", "Metamorphic Force (ver UAA)", GAME_IMPERFECT_GRAPHICS )
19131979GAME( 1993, metamrphj, metamrph, metamrph, metamrph, metamrph, ROT0,  "Konami", "Metamorphic Force (ver JAA)", GAME_IMPERFECT_GRAPHICS )
1980
19141981GAME( 1993, mtlchamp,  0,        martchmp, martchmp, 0,        ROT0,  "Konami", "Martial Champion (ver EAB)", GAME_IMPERFECT_GRAPHICS )
19151982GAME( 1993, mtlchamp1, mtlchamp, martchmp, martchmp, 0,        ROT0,  "Konami", "Martial Champion (ver EAA)", GAME_IMPERFECT_GRAPHICS )
19161983GAME( 1993, mtlchampu, mtlchamp, martchmp, martchmp, 0,        ROT0,  "Konami", "Martial Champion (ver UAD)", GAME_IMPERFECT_GRAPHICS )
19171984GAME( 1993, mtlchampj, mtlchamp, martchmp, martchmp, 0,        ROT0,  "Konami", "Martial Champion (ver JAA)", GAME_IMPERFECT_GRAPHICS )
19181985GAME( 1993, mtlchampa, mtlchamp, martchmp, martchmp, 0,        ROT0,  "Konami", "Martial Champion (ver AAA)", GAME_IMPERFECT_GRAPHICS )
1986
19191987GAME( 1993, gaiapols,  0,        gaiapols, dadandrn, 0,        ROT90, "Konami", "Gaiapolis (ver EAF)", GAME_IMPERFECT_GRAPHICS )
19201988GAME( 1993, gaiapolsu, gaiapols, gaiapols, dadandrn, 0,        ROT90, "Konami", "Gaiapolis (ver UAF)", GAME_IMPERFECT_GRAPHICS )
19211989GAME( 1993, gaiapolsj, gaiapols, gaiapols, dadandrn, 0,        ROT90, "Konami", "Gaiapolis (ver JAF)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/segas24.c
r7553r7554
699699static void resetcontrol_w(const address_space *space, UINT8 data)
700700{
701701   resetcontrol = data;
702   logerror("Reset control %02x ('%s':%x)\n", resetcontrol, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
702   logerror("Reset control %02x ('%s':%x)\n", resetcontrol, space->cpu->tag(), cpu_get_pc(space->cpu));
703703   reset_reset(space->machine);
704704}
705705
r7553r7554
756756      int i;
757757      UINT8 mxor = 0;
758758      if(!mlatch_table) {
759         logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
759         logerror("Protection: magic latch accessed but no table loaded (%s:%x)\n", space->cpu->tag(), cpu_get_pc(space->cpu));
760760         return;
761761      }
762762
r7553r7554
767767            if(mlatch & (1<<i))
768768               mxor |= 1 << mlatch_table[i];
769769         mlatch = data ^ mxor;
770         logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
770         logerror("Magic latching %02x ^ %02x as %02x (%s:%x)\n", data & 0xff, mxor, mlatch, space->cpu->tag(), cpu_get_pc(space->cpu));
771771      } else {
772         logerror("Magic latch reset (%s:%x)\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
772         logerror("Magic latch reset (%s:%x)\n", space->cpu->tag(), cpu_get_pc(space->cpu));
773773         mlatch = 0x00;
774774      }
775775   }
src/mame/drivers/konamigx.c
r7553r7554
15111511   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2)
15121512INPUT_PORTS_END
15131513
1514
1515static INPUT_PORTS_START( le2_flip )
1516   PORT_INCLUDE( le2 )
1517
1518   PORT_MODIFY("LIGHT0_Y")
1519   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_REVERSE
1520
1521   PORT_MODIFY("LIGHT1_Y")
1522   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_REVERSE
1523INPUT_PORTS_END
1524
15141525static INPUT_PORTS_START( gokuparo )
15151526   PORT_INCLUDE( common )
15161527
r7553r7554
19982009   ROM_REGION( 0x400000, "shared", 0 )
19992010   ROM_LOAD( "321b17.9g", 0x000000, 2*1024*1024, CRC(b3e8d5d8) SHA1(6644a414e7f0e69ded9aa1bf892566002cebae26) )
20002011   ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) )
2012
2013   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2014   ROM_LOAD( "gokuparo.nv", 0x0000, 0x080, CRC(15c0f2d9) SHA1(57c7462e3b1e15652ec5d682a1be3786926ddecd) )
20012015ROM_END
20022016
20032017/* Fantastic Journey version EAA (Euro) */
r7553r7554
20282042   ROM_REGION( 0x400000, "shared", 0 )
20292043   ROM_LOAD( "321b17.9g", 0x000000, 2*1024*1024, CRC(b3e8d5d8) SHA1(6644a414e7f0e69ded9aa1bf892566002cebae26) )
20302044   ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) )
2045
2046   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2047   ROM_LOAD( "fantjour.nv", 0x0000, 0x080, CRC(35b7d8e1) SHA1(5f0e3799ff9c63af3e55b040cc52b2a9e7a76168) )
20312048ROM_END
20322049
20332050/* Fantastic Journey version AAA (Asia) */
r7553r7554
20582075   ROM_REGION( 0x400000, "shared", 0 )
20592076   ROM_LOAD( "321b17.9g", 0x000000, 2*1024*1024, CRC(b3e8d5d8) SHA1(6644a414e7f0e69ded9aa1bf892566002cebae26) )
20602077   ROM_LOAD( "321b18.7g", 0x200000, 2*1024*1024, CRC(2c561ad0) SHA1(6265054072ba1c2837dd96e0259b20bc50457160) )
2078
2079   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2080   ROM_LOAD( "fantjoura.nv", 0x0000, 0x080, CRC(d13b1ec1) SHA1(0f4aedd0aa9682b0b68b9f7745946a3bc1e76714) )
20612081ROM_END
20622082
20632083/* Salamander 2 version JAA (Japan) */
r7553r7554
20892109   ROM_REGION( 0x400000, "shared", 0 )
20902110   ROM_LOAD( "521-a12.9g", 0x000000, 2*1024*1024, CRC(66614d3b) SHA1(e1e5ebe546bced6ab74b0af500acf0f3308902a4) )
20912111   ROM_LOAD( "521-a13.7g", 0x200000, 1*1024*1024, CRC(c3322475) SHA1(1774524ff031e0c4a7f3432810e968d37f9c6331) )
2112
2113   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2114   ROM_LOAD( "salmndr2.nv", 0x0000, 0x080, CRC(60cdea03) SHA1(6aa597d391b5d7db67e599ec54d98600983966fc) )
20922115ROM_END
20932116
20942117/* Salamander 2 version AAB (Asia) */
r7553r7554
21202143   ROM_REGION( 0x400000, "shared", 0 )
21212144   ROM_LOAD( "521-a12.9g", 0x000000, 2*1024*1024, CRC(66614d3b) SHA1(e1e5ebe546bced6ab74b0af500acf0f3308902a4) )
21222145   ROM_LOAD( "521-a13.7g", 0x200000, 1*1024*1024, CRC(c3322475) SHA1(1774524ff031e0c4a7f3432810e968d37f9c6331) )
2146
2147   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2148   ROM_LOAD( "salmndr2a.nv", 0x0000, 0x080, CRC(3a98a8f9) SHA1(08c2d164620a4d8ad902d502acea8ad621931198) )
21232149ROM_END
21242150
2125/* Twinbee Yahoo! */
2151/* Twinbee Yahhoo! */
21262152ROM_START( tbyahhoo )
21272153   /* main program */
21282154   ROM_REGION( 0x800000, "maincpu", 0 )
r7553r7554
21502176   ROM_REGION( 0x400000, "shared", 0 )
21512177   ROM_LOAD( "424a17.9g", 0x000000, 2*1024*1024, CRC(e9dd9692) SHA1(c289019c8d1dd71b3cec26479c39b649de804707) )
21522178   ROM_LOAD( "424a18.7g", 0x200000, 2*1024*1024, CRC(0f0d9f3a) SHA1(57f6b113b80f06964b7e672ad517c1654c5569c5) )
2179
2180   // reports RAMs as bad on first boot due to TMS emulation problems, but automatically resets
2181   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2182   ROM_LOAD( "tbyahhoo.nv", 0x0000, 0x080, CRC(1e6fa2f8) SHA1(fceb6617a4e02babfc1678bae9f6a131c1d759f5) )
21532183ROM_END
21542184
21552185/* Daisu-Kiss */
r7553r7554
23832413   ROM_REGION( 0x400000, "shared", 0 )
23842414   ROM_LOAD( "615a22.9g", 0x000000, 2*1024*1024, CRC(ea7e47dd) SHA1(5bf5bad9427b083757c400eaf58c63a6267c1caf) )
23852415   ROM_LOAD( "615a23.7g", 0x200000, 2*1024*1024, CRC(22d71f36) SHA1(3f24bb4cd8e1d693b42219e05960ad0c756b08cb) )
2416
2417   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2418   ROM_LOAD( "tokkae.nv", 0x0000, 0x080, CRC(5a6f8da6) SHA1(f68c67c98e99669904e23d5eac7e13a9c57bc394) )
23862419ROM_END
23872420
23882421/* Tokimeki Memorial Taisen Puzzle-dama */
r7553r7554
24152448   ROM_REGION( 0x400000, "shared", 0 )
24162449   ROM_LOAD( "515a13.9g", 0x000000, 2*1024*1024, CRC(4b066b00) SHA1(874dd49847b10e6d9c39decb81557534baa36d79) )
24172450   ROM_LOAD( "515a14.7g", 0x200000, 2*1024*1024, CRC(128cc944) SHA1(b0cd2ec1b9a2ac936d57b6d6c2a70f9c13dc97a5) )
2451
2452   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2453   ROM_LOAD( "tkmmpzdm.nv", 0x0000, 0x080, CRC(850ab8c4) SHA1(fea5ceb3f2cea61fb19bdb1b8f1496d1c06bfff1) )
24182454ROM_END
24192455
24202456/* Winning Spike - Version EAA (Euro) */
r7553r7554
24332469   /* tiles: length of 1 meg each is TRUSTED by the internal checksum code */
24342470   /* do NOT change these to the 4 meg dumps again, those are WRONG!!!!!!! */
24352471   ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
2436       ROM_LOAD16_BYTE( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
2472   ROM_LOAD16_BYTE( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
24372473   ROM_LOAD16_BYTE( "705a18.22h", 0x000001, 0x100000, CRC(eb97fb5f) SHA1(13de0ad060fd6f1312fa10edde1fef6481e8df64) )
24382474
24392475   /* sprites */
24402476   ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
2441        _64_WORD_ROM_LOAD( "705a10.33g",   0x000000, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
2442        _64_WORD_ROM_LOAD( "705a11.30g",   0x000002, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2443        _64_WORD_ROM_LOAD( "705a13.28g",   0x000004, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2444        _64_WORD_ROM_LOAD( "705a17.25g",   0x000006, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
2477   _64_WORD_ROM_LOAD( "705a10.33g",   0x000000, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
2478   _64_WORD_ROM_LOAD( "705a11.30g",   0x000002, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2479   _64_WORD_ROM_LOAD( "705a13.28g",   0x000004, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2480   _64_WORD_ROM_LOAD( "705a17.25g",   0x000006, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
24452481
24462482   /* sound data */
24472483   ROM_REGION( 0x400000, "shared", 0 )
r7553r7554
24922528   /* tiles: length of 1 meg each is TRUSTED by the internal checksum code */
24932529   /* do NOT change these to the 4 meg dumps again, those are WRONG!!!!!!! */
24942530   ROM_REGION( 0x800000, "gfx1", ROMREGION_ERASE00 )
2495       ROM_LOAD16_BYTE( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
2531   ROM_LOAD16_BYTE( "705a19.17h", 0x000000, 0x100000, CRC(bab84b30) SHA1(8522a0dc5e37524f51d632e9d975e949a14c0dc3) )
24962532   ROM_LOAD16_BYTE( "705a18.22h", 0x000001, 0x100000, CRC(eb97fb5f) SHA1(13de0ad060fd6f1312fa10edde1fef6481e8df64) )
24972533
24982534   /* sprites */
24992535   ROM_REGION( 0x1000000, "gfx2", ROMREGION_ERASE00 )
2500        _64_WORD_ROM_LOAD( "705a10.33g",   0x000000, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
2501        _64_WORD_ROM_LOAD( "705a11.30g",   0x000002, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2502        _64_WORD_ROM_LOAD( "705a13.28g",   0x000004, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2503        _64_WORD_ROM_LOAD( "705a17.25g",   0x000006, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
2536   _64_WORD_ROM_LOAD( "705a10.33g",   0x000000, 0x400000, CRC(fc4dc78b) SHA1(520cdcf9ca20ec1c84be734e06e183e7a871090b) )
2537   _64_WORD_ROM_LOAD( "705a11.30g",   0x000002, 0x400000, CRC(68542ce9) SHA1(a4294da1d1026e3a9d070575e5855935389a705f) )
2538   _64_WORD_ROM_LOAD( "705a13.28g",   0x000004, 0x400000, CRC(3b62584b) SHA1(69718f47ff1e8d65a11972af1ed5068db175f625) )
2539   _64_WORD_ROM_LOAD( "705a17.25g",   0x000006, 0x400000, CRC(971d2812) SHA1(ee0819faf6f6c8420d5d3742cb39dfb76b9ce7a4) )
25042540
25052541   /* sound data */
25062542   ROM_REGION( 0x400000, "shared", 0 )
r7553r7554
25352571   ROM_REGION( 0x400000, "shared", 0 )
25362572   ROM_LOAD( "315a17.9g", 0x000000, 2*1024*1024, CRC(ea763d61) SHA1(2a7dcb2a2a23c9fea62fb82ffc18949bf15b9f6f) )
25372573   ROM_LOAD( "315a18.7g", 0x200000, 2*1024*1024, CRC(6e416cee) SHA1(145a766ad2fa2b692692053dd36e0caf51d67a56) )
2574
2575   // the TMS emulation is causing problems which means you have to reset this one anyway
2576   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
2577   ROM_LOAD( "puzldama.nv", 0x0000, 0x080, CRC(bda98b84) SHA1(f4b03130bdc2a5bc6f0fc9ca21603109d82703b4) )
25382578ROM_END
25392579
25402580/* Dragoon Might */
r7553r7554
25722612   /* sound data */
25732613   ROM_REGION( 0x200000, "shared", 0 )
25742614   ROM_LOAD( "417a17.9g", 0x000000, 2*1024*1024, CRC(88d47dfd) SHA1(b5d6dd7ee9ac0c427dc3e714a97945c954260913) )
2615
2616   // game is currently broken due to TMS emulation anyway..
2617   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2618   ROM_LOAD( "dragoonj.nv", 0x0000, 0x080, CRC(cbe16082) SHA1(da48893f3584ae2e034c73d4338b220107a884da) )
25752619ROM_END
25762620
25772621/* Dragoon Might (Asia) */
r7553r7554
26092653   /* sound data */
26102654   ROM_REGION( 0x200000, "shared", 0 )
26112655   ROM_LOAD( "417a17.9g", 0x000000, 2*1024*1024, CRC(88d47dfd) SHA1(b5d6dd7ee9ac0c427dc3e714a97945c954260913) )
2656
2657   // game is currently broken due to TMS emulation anyway..
2658   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2659   ROM_LOAD( "dragoona.nv", 0x0000, 0x080, CRC(7980ad2b) SHA1(dccaab02d23edbd81ae13441fbac0dbd7112c258) )
26122660ROM_END
26132661
26142662/* Soccer Superstars (Europe ver EAA)*/
r7553r7554
26652713   /* sound data */
26662714   ROM_REGION( 0x400000, "shared", 0 )
26672715   ROM_LOAD( "427a16.9r", 0x000000, 2*1024*1024,  CRC(39547265) SHA1(c0efd68c0c1ea59141045150842f36d43e1f01d8) )
2716
2717   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2718   ROM_LOAD( "soccerss.nv", 0x0000, 0x080, CRC(f222dae4) SHA1(fede48a4e1fe91cf2b17ff3f3996bca4816fc283) )
26682719ROM_END
26692720
26702721/* Soccer Superstars (Japan ver JAC)*/
r7553r7554
27092760   /* sound data */
27102761   ROM_REGION( 0x400000, "shared", 0 )
27112762   ROM_LOAD( "427a16.9r", 0x000000, 2*1024*1024,  CRC(39547265) SHA1(c0efd68c0c1ea59141045150842f36d43e1f01d8) )
2763
2764   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2765   ROM_LOAD( "soccerssj.nv", 0x0000, 0x080, CRC(7440255e) SHA1(af379b5b1f765f9050f18fbd41c5031c5ad4918b) )
27122766ROM_END
27132767
27142768/* Soccer Superstars (Japan ver JAA)*/
r7553r7554
27532807   /* sound data */
27542808   ROM_REGION( 0x400000, "shared", 0 )
27552809   ROM_LOAD( "427a16.9r", 0x000000, 2*1024*1024,  CRC(39547265) SHA1(c0efd68c0c1ea59141045150842f36d43e1f01d8) )
2810
2811   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2812   ROM_LOAD( "soccerssja.nv", 0x0000, 0x080, CRC(60dba700) SHA1(087b086b29748727b41fdd4c154ff9b4bef42959) )
27562813ROM_END
27572814
27582815/* Soccer Superstars (Asian ver AAA) */
r7553r7554
27972854   /* sound data */
27982855   ROM_REGION( 0x400000, "shared", 0 )
27992856   ROM_LOAD( "427a16.9r", 0x000000, 2*1024*1024,  CRC(39547265) SHA1(c0efd68c0c1ea59141045150842f36d43e1f01d8) )
2857
2858   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
2859   ROM_LOAD( "soccerssa.nv", 0x0000, 0x080, CRC(e3a3f3d5) SHA1(374cf5bbcc459c56ebbba5068406f6d767bcb608) )
28002860ROM_END
28012861
28022862/* Vs. Net Soccer TODO:
28032863
28042864 Redump sound ROM
2805 Check naming of data roms, I believe they're swapped on either this or all the other games.
2806 Add 'Roz Doubling' support to the Type-4 roz rendering when width > 512
2807 Fix issues with FG Tilemaps (the hack used for Soccer Superstars clearly doesn't work here causing most of the left screen tilemaps to vanish)
2808 See if there is any other protection
28092865 Hook up ROM tests.
28102866
28112867*/
r7553r7554
31603216   ROM_REGION( 0x400000, "shared", 0 )
31613217   ROM_LOAD( "312a17.9g", 0x000000, 2*1024*1024, CRC(ed101448) SHA1(ef1342f37fbbb092eddee0c237b40989ad42cf26) )
31623218   ROM_LOAD( "312a18.7g", 0x200000, 1*1024*1024, CRC(5717abd7) SHA1(d304d733e7fca0363ea6b3872c2d3bbe4edf1179) )
3219
3220   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with invisible error
3221   ROM_LOAD( "le2.nv", 0x0000, 0x080, CRC(fec3bc2e) SHA1(64040364d7db12f54e5c11f28a28e030bcf9a0f7) )
31633222ROM_END
31643223
31653224/* Lethal Enforcers II (US Version) */
r7553r7554
31953254   ROM_REGION( 0x400000, "shared", 0 )
31963255   ROM_LOAD( "312a17.9g", 0x000000, 2*1024*1024, CRC(ed101448) SHA1(ef1342f37fbbb092eddee0c237b40989ad42cf26) )
31973256   ROM_LOAD( "312a18.7g", 0x200000, 1*1024*1024, CRC(5717abd7) SHA1(d304d733e7fca0363ea6b3872c2d3bbe4edf1179) )
3257
3258   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with invisible error
3259   ROM_LOAD( "le2u.nv", 0x0000, 0x080, CRC(d46b3878) SHA1(81bf4331547ce977eaa185f7281625fb695f6deb) )
31983260ROM_END
31993261
3200/* Lethal Enforcers II (version) */
3262/* Lethal Enforcers II (Japan version) */
32013263ROM_START( le2j )
32023264   /* main program */
32033265   ROM_REGION( 0x800000, "maincpu", 0 )
32043266   GX_BIOS
3205        ROM_LOAD32_BYTE( "312jaa05.26b", 0x200000, 0x020000, BAD_DUMP CRC(7eaa6ce2) SHA1(59d3460be98ac32ebea0422c2a9962556a9e964e) )
3206        ROM_LOAD32_BYTE( "312jaa04.28b", 0x200001, 0x020000, BAD_DUMP CRC(c3d19ddc) SHA1(3bc3e705567e8e59e56a40ae64381082c4f22271) )
3207        ROM_LOAD32_BYTE( "312jaa03.30b", 0x200002, 0x020000, BAD_DUMP CRC(465e3d03) SHA1(8efeb775f6d9f1dfcebdbc79d0c832107278c063) )
3208        ROM_LOAD32_BYTE( "312jaa02.33b", 0x200003, 0x020000, BAD_DUMP CRC(e971cb87) SHA1(53e2e7c4b96e4331df27d4788aa1bb81efddf9f0) )
32093267
3268   ROM_LOAD32_BYTE( "312jaa05.26b", 0x200000, 0x020000, CRC(7eaa6ce2) SHA1(59d3460be98ac32ebea0422c2a9962556a9e964e) )
3269    ROM_LOAD32_BYTE( "312jaa04.28b", 0x200001, 0x020000, CRC(c3d19ddc) SHA1(3bc3e705567e8e59e56a40ae64381082c4f22271) )
3270    ROM_LOAD32_BYTE( "312jaa03.30b", 0x200002, 0x020000, CRC(9ad95a7c) SHA1(397b301f8bc4d5f039f47263ad73da5afc14712c) )
3271    ROM_LOAD32_BYTE( "312jaa02.33b", 0x200003, 0x020000, CRC(e971cb87) SHA1(53e2e7c4b96e4331df27d4788aa1bb81efddf9f0) )
3272
32103273   /* sound program */
32113274   ROM_REGION( 0x40000, "soundcpu", 0 )
32123275   ROM_LOAD16_BYTE("312b06.9c", 0x000000, 128*1024, CRC(a6f62539) SHA1(b333e02c55237a0429d8c5386ec68b67797a1107) )
r7553r7554
32303293   ROM_REGION( 0x400000, "shared", 0 )
32313294   ROM_LOAD( "312a17.9g", 0x000000, 2*1024*1024, CRC(ed101448) SHA1(ef1342f37fbbb092eddee0c237b40989ad42cf26) )
32323295   ROM_LOAD( "312a18.7g", 0x200000, 1*1024*1024, CRC(5717abd7) SHA1(d304d733e7fca0363ea6b3872c2d3bbe4edf1179) )
3296
3297   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with invisible error
3298   ROM_LOAD( "le2j.nv", 0x0000, 0x080, CRC(f6790425) SHA1(f233f3c09c4cdbd1c6e5204fc6554a4826b44c59) )
32333299ROM_END
32343300
32353301/* Racin' Force */
r7553r7554
32773343   ROM_REGION( 0x400000, "shared", 0 )
32783344   ROM_LOAD( "250a17.14y", 0x000000, 2*1024*1024, CRC(adefa079) SHA1(d25911e3a02d92dc936c3d7e9d76fc270bd1a75a) )
32793345   ROM_LOAD( "250a18.12y", 0x200000, 2*1024*1024, CRC(8014a2eb) SHA1(d82f0a7d559340ae05a78ecc8bb69bb35b9c0658) )
3346
3347   // note, it seems impossible to calibrate the controls (again!), this has nothing to do with the default eeprom!
3348   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
3349   ROM_LOAD( "racinfrc.nv", 0x0000, 0x080, CRC(dc88c693) SHA1(a7967f390db043570803c79edf984a3e6bdbd172) )
32803350ROM_END
32813351
32823352
r7553r7554
33253395   ROM_REGION( 0x400000, "shared", 0 )
33263396   ROM_LOAD( "250a17.14y", 0x000000, 2*1024*1024, CRC(adefa079) SHA1(d25911e3a02d92dc936c3d7e9d76fc270bd1a75a) )
33273397   ROM_LOAD( "250a18.12y", 0x200000, 2*1024*1024, CRC(8014a2eb) SHA1(d82f0a7d559340ae05a78ecc8bb69bb35b9c0658) )
3398
3399   // note, it seems impossible to calibrate the controls (again!), this has nothing to do with the default eeprom!
3400   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
3401   ROM_LOAD( "racinfrcu.nv", 0x0000, 0x080, CRC(369e1a84) SHA1(bfed0145d89550b1a1661f3ccc612505053063f8) )
33283402ROM_END
33293403
33303404
r7553r7554
34083482   ROM_REGION( 0x400000, "shared", 0 )
34093483   ROM_LOAD( "218a17.14y", 0x000000, 2*1024*1024, CRC(0b525127) SHA1(218b306c12e1094a676815b7dddaf13bf19be2d5) )
34103484   ROM_LOAD( "218a18.12y", 0x200000, 1*1024*1024, CRC(98ec4cfb) SHA1(638753f9d9269719a37133b9c39c242507fdd8ac) )
3485
3486   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
3487   ROM_LOAD( "opengolf.nv", 0x0000, 0x080, CRC(d49bf7c3) SHA1(294c772a2f562c01e7c4d15068ba4e80e9522f9f) )
34113488ROM_END
34123489
34133490/* Konami's Open Golf Championship - version EAD */
r7553r7554
34603537   ROM_REGION( 0x400000, "shared", 0 )
34613538   ROM_LOAD( "218a17.14y", 0x000000, 2*1024*1024, CRC(0b525127) SHA1(218b306c12e1094a676815b7dddaf13bf19be2d5) )
34623539   ROM_LOAD( "218a18.12y", 0x200000, 1*1024*1024, CRC(98ec4cfb) SHA1(638753f9d9269719a37133b9c39c242507fdd8ac) )
3540
3541   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
3542   ROM_LOAD( "opengolf2.nv", 0x0000, 0x080, CRC(c09fc0e6) SHA1(32807752344763613440bee46da24d605e62eace) )
34633543ROM_END
34643544
34653545/* Golfing Greats 2 */
r7553r7554
34673547   /* main program */
34683548   ROM_REGION( 0x800000, "maincpu", 0 )
34693549   GX_BIOS
3470        ROM_LOAD32_WORD_SWAP( "218jac02.34n", 0x200000, 0x080000, CRC(e4d47f92) SHA1(4761cf69670d97db548b146b127c9af04f8809d6) )
3471        ROM_LOAD32_WORD_SWAP( "218jac03.31n", 0x200002, 0x080000, CRC(ec10c0b2) SHA1(4084d8420c53e73630786adf1a4f0fde548fa212) )
34723550
3551   ROM_LOAD32_WORD_SWAP( "218jac02.34n", 0x200000, 0x080000, CRC(e4d47f92) SHA1(4761cf69670d97db548b146b127c9af04f8809d6) )
3552   ROM_LOAD32_WORD_SWAP( "218jac03.31n", 0x200002, 0x080000, CRC(ec10c0b2) SHA1(4084d8420c53e73630786adf1a4f0fde548fa212) )
3553
34733554   /* data roms */
34743555   ROM_LOAD32_WORD_SWAP( "218a04.34s", 0x400000, 512*1024, CRC(e50043a7) SHA1(d3a8e214362c34c4151408f422c9b1c723f7f01c) )
34753556   ROM_LOAD32_WORD_SWAP( "218a05.31s", 0x400002, 512*1024, CRC(46c6b5d3) SHA1(e59c6d2dac9db635589149e4b4852e5f6a9c3c4f) )
r7553r7554
35103591   ROM_REGION( 0x400000, "shared", 0 )
35113592   ROM_LOAD( "218a17.14y", 0x000000, 2*1024*1024, CRC(0b525127) SHA1(218b306c12e1094a676815b7dddaf13bf19be2d5) )
35123593   ROM_LOAD( "218a18.12y", 0x200000, 1*1024*1024, CRC(98ec4cfb) SHA1(638753f9d9269719a37133b9c39c242507fdd8ac) )
3594
3595   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting with error
3596   ROM_LOAD( "ggreats2.nv", 0x0000, 0x080, CRC(4db10b5c) SHA1(29e3a59e4101349ace33d49b5fe59f0c785979b3) )
35133597ROM_END
35143598
35153599/**********************************************************************************/
r7553r7554
35853669   { "ggreats2", 11, 12, 0, BPP4 },
35863670   { "le2",      13, 1, 1, BPP4 },
35873671   { "le2u",     13, 1, 1, BPP4 },
3672   { "le2j",     13, 1, 1, BPP4 },
35883673   { "gokuparo",  7, 0, 0, BPP5 },
35893674   { "fantjour",  7, 0, 9, BPP5 },
3675   { "fantjoura", 7, 0, 9, BPP5 },
35903676   { "puzldama",  7, 0, 0, BPP5 },
35913677   { "tbyahhoo",  7, 0, 8, BPP5 },
35923678   { "tkmmpzdm",  7, 0, 2, BPP6 },
r7553r7554
37223808/* dummy parent for the BIOS */
37233809GAME( 1994, konamigx, 0, konamigx, konamigx, konamigx, ROT0, "Konami", "System GX", GAME_IS_BIOS_ROOT )
37243810
3725
3811/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
37263812/* Type 1: standard with an add-on 53936 on the ROM board, analog inputs, */
37273813/* and optional LAN capability (only on Racin' Force - chips aren't present on the golf games) */
37283814/* needs the ROZ layer to be playable */
3815/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
3816
37293817GAME( 1994, racinfrc, konamigx, racinfrc,  racinfrc, konamigx, ROT0, "Konami", "Racin' Force (ver EAC)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING  )
37303818GAME( 1994, racinfrcu,racinfrc, racinfrc,  racinfrc, konamigx, ROT0, "Konami", "Racin' Force (ver UAB)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING  )
3819
37313820GAME( 1994, opengolf, konamigx, opengolf,  racinfrc, konamigx, ROT0, "Konami", "Konami's Open Golf Championship (ver EAE)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING  )
37323821GAME( 1994, opengolf2,opengolf, opengolf,  racinfrc, konamigx, ROT0, "Konami", "Konami's Open Golf Championship (ver EAD)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING  )
37333822GAME( 1994, ggreats2, opengolf, opengolf,  racinfrc, konamigx, ROT0, "Konami", "Golfing Greats 2 (ver JAC)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
37343823
3735
3824/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
37363825/* Type 2: totally stock, sometimes with funny protection chips on the ROM board */
37373826/* these games work and are playable with minor graphics glitches */
3827/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
3828
37383829GAME( 1994, le2,      konamigx, le2,      le2,      konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3739GAME( 1994, le2u,     le2,      le2,      le2,      konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", GAME_IMPERFECT_GRAPHICS )
3740GAME( 1994, le2j,     le2,      le2,      le2,      konamigx, ROT0, "Konami", "Lethal Enforcers II: Gun Fighters (ver JAA)", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING)
3830GAME( 1994, le2u,     le2,      le2,      le2_flip, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", GAME_IMPERFECT_GRAPHICS )
3831GAME( 1994, le2j,     le2,      le2,      le2_flip, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3832
37413833GAME( 1994, fantjour, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", GAME_IMPERFECT_GRAPHICS )
3742GAME( 1994, fantjoura,fantjour, konamigx, gokuparo, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
3834GAME( 1994, fantjoura,fantjour, konamigx, gokuparo, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS )
37433835GAME( 1994, gokuparo, fantjour, konamigx, gokuparo, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS )
3836
37443837GAME( 1994, puzldama, konamigx, konamigx, puzldama, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3838
37453839GAME( 1995, tbyahhoo, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3840
37463841GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, puzldama, konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", GAME_IMPERFECT_GRAPHICS )
3842
37473843GAME( 1995, dragoona, konamigx, dragoonj, dragoonj, konamigx, ROT0, "Konami", "Dragoon Might (ver AAB)", GAME_IMPERFECT_GRAPHICS )
37483844GAME( 1995, dragoonj, dragoona, dragoonj, dragoonj, konamigx, ROT0, "Konami", "Dragoon Might (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3845
37493846GAME( 1996, sexyparo, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3847
37503848GAME( 1996, daiskiss, konamigx, konamigx, gokuparo, konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3849
37513850GAME( 1996, tokkae,   konamigx, konamigx_6bpp, puzldama, konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3851
37523852/* protection controls player ship direction in attract mode - doesn't impact playability */
37533853GAME( 1996, salmndr2, konamigx, konamigx_6bpp_2, gokuparo, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
37543854GAME( 1996, salmndr2a,salmndr2, konamigx_6bpp_2, gokuparo, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION )
3855
37553856/* bad sprite colours, part of tilemap gets blanked out when a game starts (might be more protection) */
37563857GAME( 1997, winspike, konamigx, winspike, konamigx, konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
37573858GAME( 1997, winspikej,winspike, winspike, konamigx, konamigx, ROT0, "Konami", "Winning Spike (ver JAA)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
37583859
3860/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
37593861/* Type 3: dual monitor output and 53936 on the ROM board, external palette RAM */
3862/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
3863
37603864GAME( 1994, soccerss,  konamigx, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver EAA)", GAME_IMPERFECT_GRAPHICS )
37613865GAME( 1994, soccerssj, soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver JAC)", GAME_IMPERFECT_GRAPHICS ) // writes JAB to EEPROM, but should be version JAC according to labels
37623866GAME( 1994, soccerssja,soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver JAA)", GAME_IMPERFECT_GRAPHICS )
37633867GAME( 1994, soccerssa, soccerss, gxtype3,  type3, konamigx, ROT0, "Konami", "Soccer Superstars (ver AAA)", GAME_IMPERFECT_GRAPHICS )
37643868
3869/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
37653870/* Type 4: dual monitor output and 53936 on the ROM board, external palette RAM, DMA protection */
3871/* --------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
3872
37663873GAME( 1996, vsnetscr,  konamigx, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAD)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
37673874GAME( 1996, vsnetscreb,vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver EAB)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
37683875GAME( 1996, vsnetscru, vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver UAB)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
37693876GAME( 1996, vsnetscra, vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver AAA)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
37703877GAME( 1996, vsnetscrj, vsnetscr, gxtype4_vsn, type3, konamigx, ROT0, "Konami", "Versus Net Soccer (ver JAB)", GAME_IMPERFECT_GRAPHICS|GAME_IMPERFECT_SOUND )
3878
37713879GAME( 1996, rungun2,   konamigx, gxtype4sd2,  type3, konamigx, ROT0, "Konami", "Run and Gun 2 (ver UAA)", GAME_IMPERFECT_GRAPHICS )
37723880GAME( 1996, slamdnk2,  rungun2,  gxtype4sd2,  type3, konamigx, ROT0, "Konami", "Slam Dunk 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS )
3881
37733882GAME( 1996, rushhero,  konamigx, gxtype4,     type3, konamigx, ROT0, "Konami", "Rushing Heroes (ver UAB)", GAME_IMPERFECT_GRAPHICS  )
src/mame/drivers/vendetta.c
r7553r7554
595595
596596   ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
597597   ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
598
599   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
600   ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
598601ROM_END
599602
600603ROM_START( vendettar )
r7553r7554
617620
618621   ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
619622   ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
623
624   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
625   ROM_LOAD( "vendettar.nv", 0x0000, 0x080, CRC(ec3f0449) SHA1(da35b98cd10bfabe9df3ede05462fabeb0e01ca9) )
620626ROM_END
621627
622628ROM_START( vendetta2p )
r7553r7554
639645
640646   ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
641647   ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
648
649   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
650   ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
642651ROM_END
643652
644653ROM_START( vendetta2pu )
r7553r7554
661670
662671   ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
663672   ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
673
674   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
675   ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
664676ROM_END
665677
666678ROM_START( vendetta2pd )
r7553r7554
683695
684696   ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
685697   ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
698
699   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
700   ROM_LOAD( "vendetta.nv", 0x0000, 0x080, CRC(fbac4e30) SHA1(d3ff3a392550d9b06400b9292a44bdac7ba5c801) )
686701ROM_END
687702
688703ROM_START( vendettaj )
r7553r7554
705720
706721   ROM_REGION( 0x100000, "k053260", 0 ) /* 053260 samples */
707722   ROM_LOAD( "081a03", 0x000000, 0x100000, CRC(14b6baea) SHA1(fe15ee57f19f5acaad6c1642d51f390046a7468a) )
723
724   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
725   ROM_LOAD( "vendettaj.nv", 0x0000, 0x080, CRC(3550a54e) SHA1(370cd40a12c471b3b6690ecbdde9c7979bc2a652) )
708726ROM_END
709727
710728ROM_START( esckids )
r7553r7554
727745
728746   ROM_REGION( 0x100000, "k053260", 0 )   // Samples MASK-ROM (4M x 1)
729747   ROM_LOAD( "975c03", 0x000000, 0x080000, CRC(dc4a1707) SHA1(f252d08483fd664f8fc03bf8f174efd452b4cdc5) )
748
749   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
750   ROM_LOAD( "esckids.nv", 0x0000, 0x080, CRC(a8522e1f) SHA1(43f82fce3c3b854bc8898c63dffc7c01b288c8aa) )
730751ROM_END
731752
732753
r7553r7554
750771
751772   ROM_REGION( 0x100000, "k053260", 0 )   // Samples MASK-ROM (4M x 1)
752773   ROM_LOAD( "975c03", 0x000000, 0x080000, CRC(dc4a1707) SHA1(f252d08483fd664f8fc03bf8f174efd452b4cdc5) )
774
775   ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
776   ROM_LOAD( "esckidsj.nv", 0x0000, 0x080, CRC(985e2a2d) SHA1(afd9e5fc014d593d0a384326f32caf2a73fba867) )
753777ROM_END
754778
755779
src/mame/drivers/taito_f3.c
r7553r7554
1010    Thank you to Shiriru for the scanline rendering (including alpha blending),
1111    sprite sync fixes, sprite zoom fixes and others!
1212
13    Main Issues:
14    - Sound eats lots of memory as 8 bit PCM data is decoded as 16 bit for
15      use by the current ES5505 core (which rightly should be 16 bit).
16
1713    Other Issues:
1814    - Dsp isn't hooked up.
1915    - Crowd/boards not shown in the football games
2016    - Sound doesn't work in RidingF/RingRage?
17      (for RingRage it's probably a timing / cpu sync bug, if you go into test mode
18       for a while then exit you'll have sound, this doesn't work on RidingF)
2119    - It does work in ringrage but you have to enter test mode first
2220    - Sound balance is not emulated (see arabianm test mode)
2321    - When playing space invaders dx in original mode, t.t. with overlay, the
2422    alpha blending effect is wrong (see Taito B version of game)
2523    - Bubble Symphony has an alpha transition effect that doesn't appear in Mame
24    - Various other missing blending effects (see Mametesters)
2625
2726    Feel free to report any other issues to me.
2827
r7553r7554
28322831   ROM_REGION16_BE(0x800000, "ensoniq.0" , ROMREGION_ERASE00 )   // V2: 4 banks, only 2 populated
28332832   ROM_LOAD16_BYTE("e21-03.rom", 0x000000, 0x200000, CRC(54c5f83d) SHA1(10a993199c8d5a1361bd29a4b92c404451c6da01) )   // C8 C9 CA CB
28342833   ROM_LOAD16_BYTE("e21-04.rom", 0x400000, 0x200000, CRC(e5af2a2d) SHA1(62a49504decc7160b710260218920d2d6d2af8f0) )   // CC CD -std-
2834
2835   ROM_REGION16_BE( 0x80, "eeprom", 0 )
2836   ROM_LOAD( "bubblem.nv", 0x0000, 0x0080, CRC(9a59326e) SHA1(071dbfbfd77f7020476ddb54c93f5fafa7a08159) )
28352837ROM_END
28362838
28372839ROM_START( bubblemj )
r7553r7554
28592861   ROM_REGION16_BE(0x800000, "ensoniq.0" , ROMREGION_ERASE00 )   // V2: 4 banks, only 2 populated
28602862   ROM_LOAD16_BYTE("e21-03.rom", 0x000000, 0x200000, CRC(54c5f83d) SHA1(10a993199c8d5a1361bd29a4b92c404451c6da01) )   // C8 C9 CA CB
28612863   ROM_LOAD16_BYTE("e21-04.rom", 0x400000, 0x200000, CRC(e5af2a2d) SHA1(62a49504decc7160b710260218920d2d6d2af8f0) )   // CC CD -std-
2864
2865   ROM_REGION16_BE( 0x80, "eeprom", 0 )
2866   ROM_LOAD( "bubblemj.nv", 0x0000, 0x0080, CRC(cb4ef35c) SHA1(e0202b775d2494b77b1c08bafbfd239e40555dc6) )
28622867ROM_END
28632868
28642869ROM_START( cleopatr )
src/mame/drivers/konamim2.c
r7553r7554
317317   {
318318      if (data & 0x800000)
319319      {
320         mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", space->cpu->tag.cstr(), cpu_get_pc(space->cpu));
320         mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", space->cpu->tag(), cpu_get_pc(space->cpu));
321321         cputag_set_input_line(space->machine, "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
322322      }
323323
src/mame/drivers/williams.c
r7553r7554
18851885
18861886ROM_START( startrkd )
18871887   ROM_REGION( 0x19000, "maincpu", 0 )
1888   ROM_LOAD( "rom8.bin",     0x0d000, 0x1000, CRC(5af871e3) SHA1(f9a42619b37db2eb07d0302ac9d0ff5c1923c21d) )
1889   ROM_LOAD( "rom9.bin",     0x0e000, 0x1000, CRC(1126adc9) SHA1(526cf1ca3a7eefd6115d74ac9af1a50774cc258e) )
1890   ROM_LOAD( "rom10.bin",    0x0f000, 0x1000, CRC(4097b46b) SHA1(8f506dc59b129c9441d813062fc38747619678db) )
1891   ROM_LOAD( "rom6.bin",     0x10000, 0x0800, CRC(93012991) SHA1(9e06ed4a489b2ed063f83b708d3e7c6a02e45389) )
1892   ROM_LOAD( "rom5.bin",     0x10800, 0x0800, CRC(c6f0c004) SHA1(57c547b804ad3eceb33a9390bbffcfc0b63f16dd) )
1893   ROM_LOAD( "rom4.bin",     0x11000, 0x0800, CRC(b48430bf) SHA1(6572812f3a1e6eede3dff3273f16846799e79ed9) )
1894   ROM_LOAD( "rom3.bin",     0x11800, 0x0800, CRC(d068f0c5) SHA1(d32a4232756ca05972780cb35b0add12b31e8283) )
1895   ROM_LOAD( "rom2.bin",     0x12000, 0x0800, CRC(fef4cb77) SHA1(96202e97f3392bc043a252e78d1c42b51c38d269) )
1896   ROM_LOAD( "rom1.bin",     0x12800, 0x0800, CRC(d23d6cdb) SHA1(2ce9fe269598919f994339c8f8685d6a79e417d8) )
1897   ROM_LOAD( "rom7.bin",     0x16000, 0x0800, CRC(43d42a1b) SHA1(b13d59940646451c00b49bbe4a41b9e2df4d7758) )
1888   ROM_LOAD( "st_rom8.bin",     0x0d000, 0x1000, CRC(5af871e3) SHA1(f9a42619b37db2eb07d0302ac9d0ff5c1923c21d) )
1889   ROM_LOAD( "st_rom9.bin",     0x0e000, 0x1000, CRC(1126adc9) SHA1(526cf1ca3a7eefd6115d74ac9af1a50774cc258e) )
1890   ROM_LOAD( "st_rom10.bin",    0x0f000, 0x1000, CRC(4097b46b) SHA1(8f506dc59b129c9441d813062fc38747619678db) )
1891   ROM_LOAD( "st_rom6.bin",     0x10000, 0x0800, CRC(93012991) SHA1(9e06ed4a489b2ed063f83b708d3e7c6a02e45389) )
1892   ROM_LOAD( "st_rom5.bin",     0x10800, 0x0800, CRC(c6f0c004) SHA1(57c547b804ad3eceb33a9390bbffcfc0b63f16dd) )
1893   ROM_LOAD( "st_rom4.bin",     0x11000, 0x0800, CRC(b48430bf) SHA1(6572812f3a1e6eede3dff3273f16846799e79ed9) )
1894   ROM_LOAD( "st_rom3.bin",     0x11800, 0x0800, CRC(d068f0c5) SHA1(d32a4232756ca05972780cb35b0add12b31e8283) )
1895   ROM_LOAD( "st_rom2.bin",     0x12000, 0x0800, CRC(fef4cb77) SHA1(96202e97f3392bc043a252e78d1c42b51c38d269) )
1896   ROM_LOAD( "st_rom1.bin",     0x12800, 0x0800, CRC(d23d6cdb) SHA1(2ce9fe269598919f994339c8f8685d6a79e417d8) )
1897   ROM_LOAD( "st_rom7.bin",     0x16000, 0x0800, CRC(43d42a1b) SHA1(b13d59940646451c00b49bbe4a41b9e2df4d7758) )
18981898
18991899   ROM_REGION( 0x10000, "soundcpu", 0 )
19001900   ROM_LOAD( "defend.snd",   0xf800, 0x0800, CRC(fefd5b48) SHA1(ceb0d18483f0691978c604db94417e6941ad7ff2) )
src/mame/drivers/tbowl.c
r7553r7554
181181
182182static void tbowl_adpcm_int(running_device *device)
183183{
184   int num = (strcmp(device->tag, "msm1") == 0) ? 0 : 1;
184   int num = (strcmp(device->tag(), "msm1") == 0) ? 0 : 1;
185185   if (adpcm_pos[num] >= adpcm_end[num] ||
186186            adpcm_pos[num] >= memory_region_length(device->machine, "adpcm")/2)
187187      msm5205_reset_w(device,1);
src/mame/drivers/rabbit.c
r7553r7554
1616Year + Game                     PCB         Video Chip  Issues / Notes
1717---------------------------------------------------------------------------
181897  Rabbit                      VG5330-B    15000
1997? Tokimeki Mahjong Paradise   VG5550-B    15000
1997? Tokimeki Mahjong Paradise(1)VG5550-B    15000
2020---------------------------------------------------------------------------
2121Not dumped yet:
2222unknown
r7553r7554
2727- clean up zoom code and make zoom effect more accurate
2828- sound (adpcm of some kind)
2929- status bar in rabbit is the wrong colour, timing of blitter / interrupts?
30- eeprom hookup seems flakey
3130
31Notes:
32
33(1) This is currently in it's own driver "tmmjprd.c" because it uses the
34    chip in a completely different way to Rabbit.  They should be merged
35    again later, once the chip is better understood.
36
37
3238*/
3339
3440/*
r7553r7554
10031009   ROM_REGION( 0x400000, "unknown", 0 ) /* sound rom */
10041010   ROM_LOAD( "jsn0.11", 0x0000000, 0x400000, CRC(e1f726e8) SHA1(598d75f3ff9e43ec8ce6131ed37f4345bf2f2d8e) )
10051011
1012   ROM_REGION16_BE( 0x80, "eeprom", 0 )
1013   ROM_LOAD( "rabbit.nv", 0x0000, 0x0080, CRC(73d471ed) SHA1(45e045f5ea9036342b88013e021d402741d98537) )
10061014ROM_END
10071015
10081016
1009GAME( 1997, rabbit,        0, rabbit,  rabbit,  rabbit,  ROT0, "Electronic Arts / Aorn", "Rabbit", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) // somewhat playable
1017GAME( 1997, rabbit,        0, rabbit,  rabbit,  rabbit,  ROT0, "Electronic Arts / Aorn", "Rabbit (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND ) // somewhat playable
src/osd/sdl/video.c
r7553r7554
620620
621621static void extract_window_config(running_machine *machine, int index, sdl_window_config *conf)
622622{
623   char buf[10];
623   char buf[20];
624624
625625   sprintf(buf,SDLOPTION_RESOLUTION("%d"), index);
626626   // per-window options: extract the data
src/emu/debug/debugcpu.c
r7553r7554
554554   if (info != NULL && (info->flags & DEBUG_FLAG_STOP_INTERRUPT) != 0 && (info->stopirq == -1 || info->stopirq == irqline))
555555   {
556556      global->execution_state = EXECUTION_STATE_STOPPED;
557      debug_console_printf(device->machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", device->tag.cstr(), irqline);
557      debug_console_printf(device->machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", device->tag(), irqline);
558558      compute_debug_flags(device);
559559   }
560560}
r7553r7554
574574   if ((info->flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (info->stopexception == -1 || info->stopexception == exception))
575575   {
576576      global->execution_state = EXECUTION_STATE_STOPPED;
577      debug_console_printf(device->machine, "Stopped on exception (CPU '%s', exception %d)\n", device->tag.cstr(), exception);
577      debug_console_printf(device->machine, "Stopped on exception (CPU '%s', exception %d)\n", device->tag(), exception);
578578      compute_debug_flags(device);
579579   }
580580}
r7553r7554
641641      /* check the temp running breakpoint and break if we hit it */
642642      else if ((info->flags & DEBUG_FLAG_STOP_PC) != 0 && info->stopaddr == curpc)
643643      {
644         debug_console_printf(device->machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", info->stopaddr, device->tag.cstr());
644         debug_console_printf(device->machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", info->stopaddr, device->tag());
645645         global->execution_state = EXECUTION_STATE_STOPPED;
646646      }
647647
r7553r7554
24482448   running_device *device;
24492449
24502450   for (device = machine->devicelist.first(); device != NULL; device = device->next)
2451      if (mame_stricmp(device->tag, tag) == 0)
2451      if (mame_stricmp(device->tag(), tag) == 0)
24522452         return device;
24532453
24542454   return NULL;
src/emu/debug/debugvw.c
r7553r7554
10361036      /* populate the subview */
10371037      subview->next = NULL;
10381038      subview->index = curindex++;
1039      subview->name.printf("CPU '%s' (%s)", cpu->tag.cstr(), cpu->name());
1039      subview->name.printf("CPU '%s' (%s)", cpu->tag(), cpu->name());
10401040      subview->device = cpu;
10411041
10421042      /* add to the list */
r7553r7554
14921492         /* populate the subview */
14931493         subview->next = NULL;
14941494         subview->index = curindex++;
1495         subview->name.printf("CPU '%s' (%s)", cpu->tag.cstr(), cpu->name());
1495         subview->name.printf("CPU '%s' (%s)", cpu->tag(), cpu->name());
14961496         subview->space = space;
14971497
14981498         /* add to the list */
r7553r7554
23652365            subview->next = NULL;
23662366            subview->index = curindex++;
23672367            if (device->type == CPU)
2368               subview->name.printf("CPU '%s' (%s) %s memory", device->tag.cstr(), device->name(), space->name);
2368               subview->name.printf("CPU '%s' (%s) %s memory", device->tag(), device->name(), space->name);
23692369            else
2370               subview->name.printf("%s '%s' space #%d memory", device->name(), device->tag.cstr(), spacenum);
2370               subview->name.printf("%s '%s' space #%d memory", device->name(), device->tag(), spacenum);
23712371            subview->space = space;
23722372            subview->endianness = space->endianness;
23732373            subview->prefsize = space->dbits / 8;
src/emu/debug/debugcmd.c
r7553r7554
571571   *result = cpu_get_address_space(cpu, spacenum);
572572   if (*result == NULL)
573573   {
574      debug_console_printf(machine, "No %s memory space found for CPU '%s'\n", address_space_names[spacenum], cpu->tag.cstr());
574      debug_console_printf(machine, "No %s memory space found for CPU '%s'\n", address_space_names[spacenum], cpu->tag());
575575      return FALSE;
576576   }
577577   return TRUE;
r7553r7554
987987   for (scancpu = machine->firstcpu; scancpu != NULL; scancpu = cpu_next(scancpu))
988988      if (scancpu != cpu)
989989         debug_cpu_ignore_cpu(scancpu, 1);
990   debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag.cstr());
990   debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag());
991991}
992992
993993
r7553r7554
10151015         if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) == 0)
10161016         {
10171017            if (buflen == 0)
1018               buflen += sprintf(&buffer[buflen], "Currently ignoring CPU '%s'", cpu->tag.cstr());
1018               buflen += sprintf(&buffer[buflen], "Currently ignoring CPU '%s'", cpu->tag());
10191019            else
1020               buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag.cstr());
1020               buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag());
10211021         }
10221022      }
10231023
r7553r7554
10491049         }
10501050
10511051         debug_cpu_ignore_cpu(cpuwhich[paramnum], 1);
1052         debug_console_printf(machine, "Now ignoring CPU '%s'\n", cpuwhich[paramnum]->tag.cstr());
1052         debug_console_printf(machine, "Now ignoring CPU '%s'\n", cpuwhich[paramnum]->tag());
10531053      }
10541054   }
10551055}
r7553r7554
10791079         if ((cpuinfo->flags & DEBUG_FLAG_OBSERVING) != 0)
10801080         {
10811081            if (buflen == 0)
1082               buflen += sprintf(&buffer[buflen], "Currently observing CPU '%s'", cpu->tag.cstr());
1082               buflen += sprintf(&buffer[buflen], "Currently observing CPU '%s'", cpu->tag());
10831083            else
1084               buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag.cstr());
1084               buflen += sprintf(&buffer[buflen], ", '%s'", cpu->tag());
10851085         }
10861086      }
10871087
r7553r7554
11031103      for (paramnum = 0; paramnum < params; paramnum++)
11041104      {
11051105         debug_cpu_ignore_cpu(cpuwhich[paramnum], 0);
1106         debug_console_printf(machine, "Now observing CPU '%s'\n", cpuwhich[paramnum]->tag.cstr());
1106         debug_console_printf(machine, "Now observing CPU '%s'\n", cpuwhich[paramnum]->tag());
11071107      }
11081108   }
11091109}
r7553r7554
13091309      {
13101310         debug_cpu_breakpoint *bp;
13111311
1312         debug_console_printf(machine, "CPU '%s' breakpoints:\n", cpu->tag.cstr());
1312         debug_console_printf(machine, "CPU '%s' breakpoints:\n", cpu->tag());
13131313
13141314         /* loop over the breakpoints */
13151315         for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
r7553r7554
14971497            const address_space *space = cpu_get_address_space(cpu, spacenum);
14981498            debug_cpu_watchpoint *wp;
14991499
1500            debug_console_printf(machine, "CPU '%s' %s space watchpoints:\n", cpu->tag.cstr(), address_space_names[spacenum]);
1500            debug_console_printf(machine, "CPU '%s' %s space watchpoints:\n", cpu->tag(), address_space_names[spacenum]);
15011501
15021502            /* loop over the watchpoints */
15031503            for (wp = cpuinfo->wplist[spacenum]; wp != NULL; wp = wp->next)
r7553r7554
15461546         if (cpuinfo->hotspots != NULL)
15471547         {
15481548            debug_cpu_hotspot_track(cpuinfo->device, 0, 0);
1549            debug_console_printf(machine, "Cleared hotspot tracking on CPU '%s'\n", cpu->tag.cstr());
1549            debug_console_printf(machine, "Cleared hotspot tracking on CPU '%s'\n", cpu->tag());
15501550            cleared = TRUE;
15511551         }
15521552      }
r7553r7554
15681568
15691569   /* attempt to install */
15701570   if (debug_cpu_hotspot_track(cpu, count, threshhold))
1571      debug_console_printf(machine, "Now tracking hotspots on CPU '%s' using %d slots with a threshhold of %d\n", cpu->tag.cstr(), (int)count, (int)threshhold);
1571      debug_console_printf(machine, "Now tracking hotspots on CPU '%s' using %d slots with a threshhold of %d\n", cpu->tag(), (int)count, (int)threshhold);
15721572   else
15731573      debug_console_printf(machine, "Error setting up the hotspot tracking\n");
15741574}
r7553r7554
21002100            active_cheat++;
21012101            fprintf(f, "  <cheat desc=\"Possibility %d : %s (%s)\">\n", active_cheat, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(value, cheat.width * 2));
21022102            fprintf(f, "    <script state=\"run\">\n");
2103            fprintf(f, "      <action>%s.p%c%c@%s=%s</action>\n", cpu->tag.cstr(), spaceletter, sizeletter, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2));
2103            fprintf(f, "      <action>%s.p%c%c@%s=%s</action>\n", cpu->tag(), spaceletter, sizeletter, core_i64_hex_format(address, space->logaddrchars), core_i64_hex_format(cheat_byte_swap(&cheat, cheat.cheatmap[cheatindex].first_value) & sizemask, cheat.width * 2));
21042104            fprintf(f, "    </script>\n");
21052105            fprintf(f, "  </cheat>\n\n");
21062106         }
r7553r7554
23992399   /* do it */
24002400   debug_cpu_trace(cpu, f, trace_over, action);
24012401   if (f)
2402      debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag.cstr(), filename);
2402      debug_console_printf(machine, "Tracing CPU '%s' to file %s\n", cpu->tag(), filename);
24032403   else
2404      debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag.cstr());
2404      debug_console_printf(machine, "Stopped tracing on CPU '%s'\n", cpu->tag());
24052405}
24062406
24072407
r7553r7554
26222622   if (cpu != NULL)
26232623   {
26242624      symtable = debug_cpu_get_symtable(cpu);
2625      debug_console_printf(machine, "CPU '%s' symbols:\n", cpu->tag.cstr());
2625      debug_console_printf(machine, "CPU '%s' symbols:\n", cpu->tag());
26262626   }
26272627   else
26282628   {
src/emu/debug/debugcmt.c
r7553r7554
393393      xml_data_node *curnode = xml_add_child(systemnode, "cpu", NULL);
394394      if (curnode == NULL)
395395         goto error;
396      xml_set_attribute(curnode, "tag", cpu->tag);
396      xml_set_attribute(curnode, "tag", cpu->tag());
397397
398398      for (j = 0; j < comments->comment_count; j++)
399399      {
src/emu/cpu/m6809/m6809.c
r7553r7554
438438   {
439439      if (m68_state->nmi_state == state) return;
440440      m68_state->nmi_state = state;
441      LOG(("M6809 '%s' set_irq_line (NMI) %d\n", m68_state->device->tag.cstr(), state));
441      LOG(("M6809 '%s' set_irq_line (NMI) %d\n", m68_state->device->tag(), state));
442442      if( state == CLEAR_LINE ) return;
443443
444444      /* if the stack was not yet initialized */
r7553r7554
469469   }
470470   else if (irqline < 2)
471471   {
472       LOG(("M6809 '%s' set_irq_line %d, %d\n", m68_state->device->tag.cstr(), irqline, state));
472       LOG(("M6809 '%s' set_irq_line %d, %d\n", m68_state->device->tag(), irqline, state));
473473      m68_state->irq_state[irqline] = state;
474474      if (state == CLEAR_LINE) return;
475475      check_irq_lines(m68_state);
src/emu/cpu/h83002/h8_8.c
r7553r7554
567567   case 0xdd:      // serial Rx 0
568568      val = memory_read_byte(h8->io, H8_SERIAL_0);
569569      break;
570   case 0xe0:   // ADC 0 low byte
571      val = memory_read_byte(h8->io, H8_ADC_0_L);
572      break;
573   case 0xe1:   // ADC 0 high byte
574      val = memory_read_byte(h8->io, H8_ADC_0_H);
575      break;
576   case 0xe2:   // ADC 1 low byte
577      val = memory_read_byte(h8->io, H8_ADC_1_L);
578      break;
579   case 0xe3:   // ADC 1 high byte
580      val = memory_read_byte(h8->io, H8_ADC_1_H);
581      break;
582   case 0xe4:   // ADC 2 low byte
583      val = memory_read_byte(h8->io, H8_ADC_2_L);
584      break;
585   case 0xe5:   // ADC 2 high byte
586      val = memory_read_byte(h8->io, H8_ADC_2_H);
587      break;
588   case 0xe6:   // ADC 3 low byte
589      val = memory_read_byte(h8->io, H8_ADC_3_L);
590      break;
591   case 0xe7:   // ADC 3 high byte
592      val = memory_read_byte(h8->io, H8_ADC_3_H);
593      break;
594   case 0xe8:   // ADCSR: A/D control/status
595      val = 0x80;   // return conversion completed
596      break;
570597   default:
571598      val = h8->per_regs[reg];
572599      break;
src/emu/cpu/h83002/h8periph.c
r7553r7554
749749      case 0xfee018:   return h8->per_regs[0xF8];   // IPRA
750750   }
751751
752   logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte read from %08X\n",h8->device->tag.cstr(),h8->pc,address);
752   logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte read from %08X\n",h8->device->tag(),h8->pc,address);
753753   return 0;
754754}
755755
r7553r7554
761761      case 0xfee016:   h8_ISR_w(h8, val);      return;   // ISR
762762      case 0xfee018:   h8->per_regs[0xF8] = val;   return;   // IPRA
763763   }
764   logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",h8->device->tag.cstr(),h8->pc,address,val);
764   logerror("cpu '%s' (PC=%08X): unmapped I/O(1) byte write to %08X = %02X\n",h8->device->tag(),h8->pc,address,val);
765765}
766766
767767void h8_3007_itu_init(h83xx_state *h8)
src/emu/cpu/unsp/unsp.c
r7553r7554
648648               }
649649               break;
650650
651            // Far Jump
652            case 0x2f: case 0x3f: case 0x6f: case 0x7f:
653               if (OPA == 7 && OP1 == 2)
654               {
655                  UNSP_REG(PC) = READ16(unsp, UNSP_LPC);
656                  UNSP_REG(SR) &= 0xffc0;
657                  UNSP_REG(SR) |= OPIMM;
658               }
659               break;
660
651661            // Multiply, Unsigned * Signed
652662            case 0x0f:
653663               if(OPN == 1 && OPA != 7)
src/emu/cpu/unsp/unspdasm.c
r7553r7554
205205         }
206206         return UNSP_DASM_OK;
207207
208      // Far Jump
209      case 0x2f: case 0x3f: case 0x6f: case 0x7f:
210         if (OPA == 7 && OPA == 2)
211         {
212            print("goto %06x", ((OPIMM << 16) | imm16) << 1);
213         }
214         return UNSP_DASM_OK;
215
208216      // Multiply, Unsigned * Signed
209217      case 0x0f:
210218         if(OPN == 1 && OPA != 7)
src/emu/cpu/m68000/m68000.h
r7553r7554
5858   M68K_SFC, M68K_DFC, M68K_CACR, M68K_CAAR, M68K_PREF_ADDR, M68K_PREF_DATA,
5959   M68K_D0, M68K_D1, M68K_D2, M68K_D3, M68K_D4, M68K_D5, M68K_D6, M68K_D7,
6060   M68K_A0, M68K_A1, M68K_A2, M68K_A3, M68K_A4, M68K_A5, M68K_A6, M68K_A7,
61   M68K_FP0, M68K_FP1, M68K_FP2, M68K_FP3, M68K_FP4, M68K_FP5, M68K_FP6, M68K_FP7,
62   M68K_FPSR, M68K_FPCR,
6163
6264   M68K_GENPC = REG_GENPC,
6365   M68K_GENSP = REG_GENSP,
src/emu/cpu/m68000/m68kdasm.c
r7553r7554
480480               strcat(mode, "[");
481481            if(base)
482482            {
483               strcat(mode, make_signed_hex_str_16(base));
483               if (EXT_BASE_DISPLACEMENT_LONG(extension))
484               {
485                  strcat(mode, make_signed_hex_str_32(base));
486               }
487               else
488               {
489                  strcat(mode, make_signed_hex_str_16(base));
490               }
484491               comma = 1;
485492            }
486493            if(*base_reg)
r7553r7554
16901697   {
16911698      ".l", ".s", ".x", ".p", ".w", ".d", ".b", ".?"
16921699   };
1700   const char *spec_reg[8] =
1701   {
1702      "?", "FPIAR", "FPSR", "?", "FPCR", "?", "?", "?"
1703   };
16931704
16941705   char mnemonic[40];
16951706   UINT32 w2, src, dst_reg;
r7553r7554
17761787
17771788      case 0x3:
17781789      {
1779         sprintf(g_dasm_str, "fmove /todo");
1790         sprintf(g_dasm_str, "fmove   FP%d, %s", dst_reg, get_ea_mode_str_32(g_cpu_ir));
17801791         break;
17811792      }
17821793
1783      case 0x4:
1784      case 0x5:
1794      case 0x4:   // ea to control
17851795      {
1786         sprintf(g_dasm_str, "fmove /todo");
1796         sprintf(g_dasm_str, "fmove.l   %s, %s", get_ea_mode_str_32(g_cpu_ir), spec_reg[(w2>>10)&7]);
17871797         break;
17881798      }
17891799
1790      case 0x6:
1791      case 0x7:
1800      case 0x5:   // control to ea
17921801      {
1793         sprintf(g_dasm_str, "fmovem /todo");
1802         sprintf(g_dasm_str, "fmove.l   %s, %s", spec_reg[(w2>>10)&7], get_ea_mode_str_32(g_cpu_ir));
17941803         break;
17951804      }
17961805
1806      case 0x6:   // memory to FPU, list
1807      {
1808         char temp[32];
1809
1810         if ((w2>>11) & 1)   // dynamic register list
1811         {
1812            sprintf(g_dasm_str, "fmovem.x   %s, D%d", get_ea_mode_str_32(g_cpu_ir), (w2>>4)&7);
1813         }
1814         else   // static register list
1815         {
1816            int i;
1817
1818            sprintf(g_dasm_str, "fmovem.x   %s, ", get_ea_mode_str_32(g_cpu_ir));
1819
1820            for (i = 0; i < 8; i++)
1821            {
1822               if (w2 & (1<<i))
1823               {
1824                  if ((w2>>12) & 1)   // postincrement or control
1825                  {
1826                     sprintf(temp, "FP%d ", 7-i);
1827                  }
1828                  else         // predecrement
1829                  {
1830                     sprintf(temp, "FP%d ", i);
1831                  }
1832                  strcat(g_dasm_str, temp);
1833               }
1834            }
1835         }
1836         break;
1837      }
1838
1839      case 0x7:   // FPU to memory, list
1840      {
1841         char temp[32];
1842
1843         if ((w2>>11) & 1)   // dynamic register list
1844         {
1845            sprintf(g_dasm_str, "fmovem.x   D%d, %s", (w2>>4)&7, get_ea_mode_str_32(g_cpu_ir));
1846         }
1847         else   // static register list
1848         {
1849            int i;
1850
1851            sprintf(g_dasm_str, "fmovem.x   ");
1852
1853            for (i = 0; i < 8; i++)
1854            {
1855               if (w2 & (1<<i))
1856               {
1857                  if ((w2>>12) & 1)   // postincrement or control
1858                  {
1859                     sprintf(temp, "FP%d ", 7-i);
1860                  }
1861                  else         // predecrement
1862                  {
1863                     sprintf(temp, "FP%d ", i);
1864                  }
1865                  strcat(g_dasm_str, temp);
1866               }
1867            }
1868
1869            strcat(g_dasm_str, ", ");
1870            strcat(g_dasm_str, get_ea_mode_str_32(g_cpu_ir));
1871         }
1872         break;
1873      }
1874
17971875      default:
17981876      {
17991877         sprintf(g_dasm_str, "FPU (?) ");
src/emu/cpu/m68000/m68k_in.c
r7553r7554
32883288      REG_PC += 2;
32893289(void)ea;   /* just to avoid an 'unused variable' warning */
32903290      logerror("%s at %08x: called unimplemented instruction %04x (callm)\n",
3291                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
3291                m68k->device->tag(), REG_PC - 2, m68k->ir);
32923292      return;
32933293   }
32943294   m68ki_exception_illegal(m68k);
r7553r7554
43664366   if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
43674367   {
43684368      logerror( "%s at %08x: called unimplemented instruction %04x (cpbcc)\n",
4369                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
4369                m68k->device->tag(), REG_PC - 2, m68k->ir);
43704370      return;
43714371   }
43724372   m68ki_exception_1111(m68k);
r7553r7554
43784378   if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
43794379   {
43804380      logerror("%s at %08x: called unimplemented instruction %04x (cpdbcc)\n",
4381                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
4381                m68k->device->tag(), REG_PC - 2, m68k->ir);
43824382      return;
43834383   }
43844384   m68ki_exception_1111(m68k);
r7553r7554
43904390   if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
43914391   {
43924392      logerror("%s at %08x: called unimplemented instruction %04x (cpgen)\n",
4393                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
4393                m68k->device->tag(), REG_PC - 2, m68k->ir);
43944394      return;
43954395   }
43964396   m68ki_exception_1111(m68k);
r7553r7554
44024402   if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
44034403   {
44044404      logerror("%s at %08x: called unimplemented instruction %04x (cpscc)\n",
4405                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
4405                m68k->device->tag(), REG_PC - 2, m68k->ir);
44064406      return;
44074407   }
44084408   m68ki_exception_1111(m68k);
r7553r7554
44144414   if(CPU_TYPE_IS_EC020_PLUS(m68k->cpu_type))
44154415   {
44164416      logerror("%s at %08x: called unimplemented instruction %04x (cptrapcc)\n",
4417                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
4417                m68k->device->tag(), REG_PC - 2, m68k->ir);
44184418      return;
44194419   }
44204420   m68ki_exception_1111(m68k);
r7553r7554
88128812   {
88138813      m68ki_trace_t0();            /* auto-disable (see m68kcpu.h) */
88148814      logerror("%s at %08x: called unimplemented instruction %04x (rtm)\n",
8815                m68k->device->tag.cstr(), REG_PC - 2, m68k->ir);
8815                m68k->device->tag(), REG_PC - 2, m68k->ir);
88168816      return;
88178817   }
88188818   m68ki_exception_illegal(m68k);
src/emu/cpu/m68000/m68kcpu.c
r7553r7554
540540
541541   M68K_STATE_ENTRY(CACR, "%08X", cacr, 0xffffffff, 0, MASK_020_OR_LATER)
542542   M68K_STATE_ENTRY(CAAR, "%08X", caar, 0xffffffff, 0, MASK_020_OR_LATER)
543
544   M68K_STATE_ENTRY(FP0, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
545   M68K_STATE_ENTRY(FP1, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
546   M68K_STATE_ENTRY(FP2, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
547   M68K_STATE_ENTRY(FP3, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
548   M68K_STATE_ENTRY(FP4, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
549   M68K_STATE_ENTRY(FP5, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
550   M68K_STATE_ENTRY(FP6, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
551   M68K_STATE_ENTRY(FP7, "%s", iotemp, 0xffffffff, CPUSTATE_EXPORT, MASK_030_OR_LATER)
552   M68K_STATE_ENTRY(FPSR, "%08X", fpsr, 0xffffffff, 0, MASK_040_OR_LATER)
553   M68K_STATE_ENTRY(FPCR, "%08X", fpcr, 0xffffffff, 0, MASK_040_OR_LATER)
543554};
544555
545556static const cpu_state_table state_table_template =
r7553r7554
847858         m68k->iotemp = (m68k->s_flag && m68k->m_flag) ? REG_SP : REG_MSP;
848859         break;
849860
861      case M68K_FP0:
862      case M68K_FP1:
863      case M68K_FP2:
864      case M68K_FP3:
865      case M68K_FP4:
866      case M68K_FP5:
867      case M68K_FP6:
868      case M68K_FP7:
869         break;
870
850871      default:
851872         fatalerror("CPU_EXPORT_STATE(m68k) called for unexpected value\n");
852873         break;
r7553r7554
873894   }
874895}
875896
897static CPU_EXPORT_STRING( m68k )
898{
899   m68ki_cpu_core *m68k = get_safe_token(device);
900
901   switch (entry->index)
902   {
903      case M68K_FP0:
904         sprintf(string, "%f", REG_FP[0].f);
905         break;
906
907      case M68K_FP1:
908         sprintf(string, "%f", REG_FP[1].f);
909         break;
910
911      case M68K_FP2:
912         sprintf(string, "%f", REG_FP[2].f);
913         break;
914
915      case M68K_FP3:
916         sprintf(string, "%f", REG_FP[3].f);
917         break;
918
919      case M68K_FP4:
920         sprintf(string, "%f", REG_FP[4].f);
921         break;
922
923      case M68K_FP5:
924         sprintf(string, "%f", REG_FP[5].f);
925         break;
926
927      case M68K_FP6:
928         sprintf(string, "%f", REG_FP[6].f);
929         break;
930
931      case M68K_FP7:
932         sprintf(string, "%f", REG_FP[7].f);
933         break;
934
935   }
936}
937
876938static CPU_GET_INFO( m68k )
877939{
878940   m68ki_cpu_core *m68k = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
r7553r7554
913975      case CPUINFO_FCT_DISASSEMBLE:   info->disassemble = CPU_DISASSEMBLE_NAME(m68k);         break;
914976      case CPUINFO_FCT_IMPORT_STATE:   info->import_state = CPU_IMPORT_STATE_NAME(m68k);      break;
915977      case CPUINFO_FCT_EXPORT_STATE:   info->export_state = CPU_EXPORT_STATE_NAME(m68k);      break;
978      case CPUINFO_FCT_EXPORT_STRING: info->export_string = CPU_EXPORT_STRING_NAME(m68k);      break;
916979      case CPUINFO_FCT_TRANSLATE:          info->translate = CPU_TRANSLATE_NAME(m68k);      break;
917980
918981      /* --- the following bits of info are returned as pointers --- */
src/emu/cpu/tms34010/tms34010.c
r7553r7554
599599   /* check for NMI first */
600600   if (IOREG(tms, REG_HSTCTLH) & 0x0100)
601601   {
602      LOG(("TMS34010 '%s' takes NMI\n", tms->device->tag.cstr()));
602      LOG(("TMS34010 '%s' takes NMI\n", tms->device->tag()));
603603
604604      /* ack the NMI */
605605      IOREG(tms, REG_HSTCTLH) &= ~0x0100;
r7553r7554
626626   /* host interrupt */
627627   if (irq & TMS34010_HI)
628628   {
629      LOG(("TMS34010 '%s' takes HI\n", tms->device->tag.cstr()));
629      LOG(("TMS34010 '%s' takes HI\n", tms->device->tag()));
630630      vector = 0xfffffec0;
631631   }
632632
633633   /* display interrupt */
634634   else if (irq & TMS34010_DI)
635635   {
636      LOG(("TMS34010 '%s' takes DI\n", tms->device->tag.cstr()));
636      LOG(("TMS34010 '%s' takes DI\n", tms->device->tag()));
637637      vector = 0xfffffea0;
638638   }
639639
640640   /* window violation interrupt */
641641   else if (irq & TMS34010_WV)
642642   {
643      LOG(("TMS34010 '%s' takes WV\n", tms->device->tag.cstr()));
643      LOG(("TMS34010 '%s' takes WV\n", tms->device->tag()));
644644      vector = 0xfffffe80;
645645   }
646646
647647   /* external 1 interrupt */
648648   else if (irq & TMS34010_INT1)
649649   {
650      LOG(("TMS34010 '%s' takes INT1\n", tms->device->tag.cstr()));
650      LOG(("TMS34010 '%s' takes INT1\n", tms->device->tag()));
651651      vector = 0xffffffc0;
652652      irqline = 0;
653653   }
r7553r7554
655655   /* external 2 interrupt */
656656   else if (irq & TMS34010_INT2)
657657   {
658      LOG(("TMS34010 '%s' takes INT2\n", tms->device->tag.cstr()));
658      LOG(("TMS34010 '%s' takes INT2\n", tms->device->tag()));
659659      vector = 0xffffffa0;
660660      irqline = 1;
661661   }
r7553r7554
781781
782782static void set_irq_line(tms34010_state *tms, int irqline, int linestate)
783783{
784   LOG(("TMS34010 '%s' set irq line %d state %d\n", tms->device->tag.cstr(), irqline, linestate));
784   LOG(("TMS34010 '%s' set irq line %d state %d\n", tms->device->tag(), irqline, linestate));
785785
786786   /* set the pending interrupt */
787787   switch (irqline)
r7553r7554
815815
816816   /* call through to the CPU to generate the int */
817817   IOREG(tms, REG_INTPEND) |= type;
818   LOG(("TMS34010 '%s' set internal interrupt $%04x\n", tms->device->tag.cstr(), type));
818   LOG(("TMS34010 '%s' set internal interrupt $%04x\n", tms->device->tag(), type));
819819
820820   /* generate triggers so that spin loops can key off them */
821821   cpu_triggerint(tms->device);
r7553r7554
11511151      }
11521152   }
11531153   if (tms == NULL)
1154      fatalerror("Unable to locate matching CPU for screen '%s'\n", screen->tag.cstr());
1154      fatalerror("Unable to locate matching CPU for screen '%s'\n", screen->tag());
11551155
11561156   /* get the display parameters for the screen */
11571157   tms34010_get_display_params(tms->device, &params);
src/emu/cpu/tms32031/tms32031.c
r7553r7554
388388
389389   state_save_register_device_item(device, 0, tms->pc);
390390   for (i = 0; i < 36; i++)
391      state_save_register_generic(device->machine, "tms32031", device->tag, i, "reg", tms->r[i].i8, UINT8, 8);
391      state_save_register_generic(device->machine, "tms32031", device->tag(), i, "reg", tms->r[i].i8, UINT8, 8);
392392   state_save_register_device_item(device, 0, tms->bkmask);
393393   state_save_register_device_item(device, 0, tms->irq_state);
394394   state_save_register_device_item(device, 0, tms->delayed);
src/emu/cpu/z180/z180op.c
r7553r7554
315315      else
316316         irq_vector = (*cpustate->irq_callback)(cpustate->device, 0);
317317
318      LOG(("Z180 '%s' single int. irq_vector $%02x\n", cpustate->device->tag.cstr(), irq_vector));
318      LOG(("Z180 '%s' single int. irq_vector $%02x\n", cpustate->device->tag(), irq_vector));
319319
320320      /* Interrupt mode 2. Call [cpustate->I:databyte] */
321321      if( cpustate->IM == 2 )
r7553r7554
323323         irq_vector = (irq_vector & 0xff) + (cpustate->I << 8);
324324         PUSH(cpustate,  PC );
325325         RM16( cpustate, irq_vector, &cpustate->PC );
326         LOG(("Z180 '%s' IM2 [$%04x] = $%04x\n",cpustate->device->tag.cstr() , irq_vector, cpustate->_PCD));
326         LOG(("Z180 '%s' IM2 [$%04x] = $%04x\n",cpustate->device->tag() , irq_vector, cpustate->_PCD));
327327         /* CALL opcode timing */
328328         cpustate->icount -= cpustate->cc[Z180_TABLE_op][0xcd];
329329      }
r7553r7554
331331      /* Interrupt mode 1. RST 38h */
332332      if( cpustate->IM == 1 )
333333      {
334         LOG(("Z180 '%s' IM1 $0038\n",cpustate->device->tag.cstr() ));
334         LOG(("Z180 '%s' IM1 $0038\n",cpustate->device->tag() ));
335335         PUSH(cpustate,  PC );
336336         cpustate->_PCD = 0x0038;
337337         /* RST $38 + 'interrupt latency' cycles */
r7553r7554
342342         /* Interrupt mode 0. We check for CALL and JP instructions, */
343343         /* if neither of these were found we assume a 1 byte opcode */
344344         /* was placed on the databus                                */
345         LOG(("Z180 '%s' IM0 $%04x\n",cpustate->device->tag.cstr() , irq_vector));
345         LOG(("Z180 '%s' IM0 $%04x\n",cpustate->device->tag() , irq_vector));
346346         switch (irq_vector & 0xff0000)
347347         {
348348            case 0xcd0000:   /* call */
r7553r7554
371371      irq_vector = (cpustate->I << 8) + (irq_vector & 0xff);
372372      PUSH(cpustate,  PC );
373373      RM16( cpustate, irq_vector, &cpustate->PC );
374      LOG(("Z180 '%s' INT%d [$%04x] = $%04x\n", cpustate->device->tag.cstr(), irq, irq_vector, cpustate->_PCD));
374      LOG(("Z180 '%s' INT%d [$%04x] = $%04x\n", cpustate->device->tag(), irq, irq_vector, cpustate->_PCD));
375375      /* CALL opcode timing */
376376      cpustate->icount -= cpustate->cc[Z180_TABLE_op][0xcd];
377377   }
src/emu/cpu/z180/z180.c
r7553r7554
937937   {
938938   case Z180_CNTLA0:
939939      data = cpustate->IO_CNTLA0 & Z180_CNTLA0_RMASK;
940      LOG(("Z180 '%s' CNTLA0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
940      LOG(("Z180 '%s' CNTLA0 rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
941941      break;
942942
943943   case Z180_CNTLA1:
944944      data = cpustate->IO_CNTLA1 & Z180_CNTLA1_RMASK;
945      LOG(("Z180 '%s' CNTLA1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
945      LOG(("Z180 '%s' CNTLA1 rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
946946      break;
947947
948948   case Z180_CNTLB0:
949949      data = cpustate->IO_CNTLB0 & Z180_CNTLB0_RMASK;
950      LOG(("Z180 '%s' CNTLB0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
950      LOG(("Z180 '%s' CNTLB0 rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
951951      break;
952952
953953   case Z180_CNTLB1:
954954      data = cpustate->IO_CNTLB1 & Z180_CNTLB1_RMASK;
955      LOG(("Z180 '%s' CNTLB1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
955      LOG(("Z180 '%s' CNTLB1 rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
956956      break;
957957
958958   case Z180_STAT0:
959959      data = cpustate->IO_STAT0 & Z180_STAT0_RMASK;
960960data |= 0x02; // kludge for 20pacgal
961      LOG(("Z180 '%s' STAT0  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
961      LOG(("Z180 '%s' STAT0  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
962962      break;
963963
964964   case Z180_STAT1:
965965      data = cpustate->IO_STAT1 & Z180_STAT1_RMASK;
966      LOG(("Z180 '%s' STAT1  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
966      LOG(("Z180 '%s' STAT1  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
967967      break;
968968
969969   case Z180_TDR0:
970970      data = cpustate->IO_TDR0 & Z180_TDR0_RMASK;
971      LOG(("Z180 '%s' TDR0   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
971      LOG(("Z180 '%s' TDR0   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
972972      break;
973973
974974   case Z180_TDR1:
975975      data = cpustate->IO_TDR1 & Z180_TDR1_RMASK;
976      LOG(("Z180 '%s' TDR1   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
976      LOG(("Z180 '%s' TDR1   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
977977      break;
978978
979979   case Z180_RDR0:
980980      data = cpustate->IO_RDR0 & Z180_RDR0_RMASK;
981      LOG(("Z180 '%s' RDR0   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
981      LOG(("Z180 '%s' RDR0   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
982982      break;
983983
984984   case Z180_RDR1:
985985      data = cpustate->IO_RDR1 & Z180_RDR1_RMASK;
986      LOG(("Z180 '%s' RDR1   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
986      LOG(("Z180 '%s' RDR1   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
987987      break;
988988
989989   case Z180_CNTR:
990990      data = cpustate->IO_CNTR & Z180_CNTR_RMASK;
991      LOG(("Z180 '%s' CNTR   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
991      LOG(("Z180 '%s' CNTR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
992992      break;
993993
994994   case Z180_TRDR:
995995      data = cpustate->IO_TRDR & Z180_TRDR_RMASK;
996      LOG(("Z180 '%s' TRDR   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
996      LOG(("Z180 '%s' TRDR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
997997      break;
998998
999999   case Z180_TMDR0L:
10001000      data = cpustate->tmdr_value[0] & Z180_TMDR0L_RMASK;
1001      LOG(("Z180 '%s' TMDR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1001      LOG(("Z180 '%s' TMDR0L rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10021002      /* if timer is counting, latch the MSB and set the latch flag */
10031003      if ((cpustate->IO_TCR & Z180_TCR_TDE0) == 0)
10041004      {
r7553r7554
10381038      {
10391039         cpustate->read_tcr_tmdr[0] = 1;
10401040      }
1041      LOG(("Z180 '%s' TMDR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1041      LOG(("Z180 '%s' TMDR0H rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10421042      break;
10431043
10441044   case Z180_RLDR0L:
10451045      data = cpustate->IO_RLDR0L & Z180_RLDR0L_RMASK;
1046      LOG(("Z180 '%s' RLDR0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1046      LOG(("Z180 '%s' RLDR0L rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10471047      break;
10481048
10491049   case Z180_RLDR0H:
10501050      data = cpustate->IO_RLDR0H & Z180_RLDR0H_RMASK;
1051      LOG(("Z180 '%s' RLDR0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1051      LOG(("Z180 '%s' RLDR0H rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10521052      break;
10531053
10541054   case Z180_TCR:
r7553r7554
10741074         cpustate->read_tcr_tmdr[1] = 1;
10751075      }
10761076
1077      LOG(("Z180 '%s' TCR    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1077      LOG(("Z180 '%s' TCR    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10781078      break;
10791079
10801080   case Z180_IO11:
10811081      data = cpustate->IO_IO11 & Z180_IO11_RMASK;
1082      LOG(("Z180 '%s' IO11   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1082      LOG(("Z180 '%s' IO11   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10831083      break;
10841084
10851085   case Z180_ASEXT0:
10861086      data = cpustate->IO_ASEXT0 & Z180_ASEXT0_RMASK;
1087      LOG(("Z180 '%s' ASEXT0 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1087      LOG(("Z180 '%s' ASEXT0 rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10881088      break;
10891089
10901090   case Z180_ASEXT1:
10911091      data = cpustate->IO_ASEXT1 & Z180_ASEXT1_RMASK;
1092      LOG(("Z180 '%s' ASEXT1 rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1092      LOG(("Z180 '%s' ASEXT1 rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10931093      break;
10941094
10951095   case Z180_TMDR1L:
10961096      data = cpustate->tmdr_value[1] & Z180_TMDR1L_RMASK;
1097      LOG(("Z180 '%s' TMDR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1097      LOG(("Z180 '%s' TMDR1L rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
10981098      /* if timer is counting, latch the MSB and set the latch flag */
10991099      if ((cpustate->IO_TCR & Z180_TCR_TDE1) == 0)
11001100      {
r7553r7554
11341134      {
11351135         cpustate->read_tcr_tmdr[1] = 1;
11361136      }
1137      LOG(("Z180 '%s' TMDR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1137      LOG(("Z180 '%s' TMDR1H rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11381138      break;
11391139
11401140   case Z180_RLDR1L:
11411141      data = cpustate->IO_RLDR1L & Z180_RLDR1L_RMASK;
1142      LOG(("Z180 '%s' RLDR1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1142      LOG(("Z180 '%s' RLDR1L rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11431143      break;
11441144
11451145   case Z180_RLDR1H:
11461146      data = cpustate->IO_RLDR1H & Z180_RLDR1H_RMASK;
1147      LOG(("Z180 '%s' RLDR1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1147      LOG(("Z180 '%s' RLDR1H rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11481148      break;
11491149
11501150   case Z180_FRC:
11511151      data = cpustate->IO_FRC & Z180_FRC_RMASK;
1152      LOG(("Z180 '%s' FRC    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1152      LOG(("Z180 '%s' FRC    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11531153      break;
11541154
11551155   case Z180_IO19:
11561156      data = cpustate->IO_IO19 & Z180_IO19_RMASK;
1157      LOG(("Z180 '%s' IO19   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1157      LOG(("Z180 '%s' IO19   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11581158      break;
11591159
11601160   case Z180_ASTC0L:
11611161      data = cpustate->IO_ASTC0L & Z180_ASTC0L_RMASK;
1162      LOG(("Z180 '%s' ASTC0L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1162      LOG(("Z180 '%s' ASTC0L rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11631163      break;
11641164
11651165   case Z180_ASTC0H:
11661166      data = cpustate->IO_ASTC0H & Z180_ASTC0H_RMASK;
1167      LOG(("Z180 '%s' ASTC0H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1167      LOG(("Z180 '%s' ASTC0H rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11681168      break;
11691169
11701170   case Z180_ASTC1L:
11711171      data = cpustate->IO_ASTC1L & Z180_ASTC1L_RMASK;
1172      LOG(("Z180 '%s' ASTC1L rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1172      LOG(("Z180 '%s' ASTC1L rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11731173      break;
11741174
11751175   case Z180_ASTC1H:
11761176      data = cpustate->IO_ASTC1H & Z180_ASTC1H_RMASK;
1177      LOG(("Z180 '%s' ASTC1H rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1177      LOG(("Z180 '%s' ASTC1H rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11781178      break;
11791179
11801180   case Z180_CMR:
11811181      data = cpustate->IO_CMR & Z180_CMR_RMASK;
1182      LOG(("Z180 '%s' CMR    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1182      LOG(("Z180 '%s' CMR    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11831183      break;
11841184
11851185   case Z180_CCR:
11861186      data = cpustate->IO_CCR & Z180_CCR_RMASK;
1187      LOG(("Z180 '%s' CCR    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1187      LOG(("Z180 '%s' CCR    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11881188      break;
11891189
11901190   case Z180_SAR0L:
11911191      data = cpustate->IO_SAR0L & Z180_SAR0L_RMASK;
1192      LOG(("Z180 '%s' SAR0L  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1192      LOG(("Z180 '%s' SAR0L  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11931193      break;
11941194
11951195   case Z180_SAR0H:
11961196      data = cpustate->IO_SAR0H & Z180_SAR0H_RMASK;
1197      LOG(("Z180 '%s' SAR0H  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1197      LOG(("Z180 '%s' SAR0H  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
11981198      break;
11991199
12001200   case Z180_SAR0B:
12011201      data = cpustate->IO_SAR0B & Z180_SAR0B_RMASK;
1202      LOG(("Z180 '%s' SAR0B  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1202      LOG(("Z180 '%s' SAR0B  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12031203      break;
12041204
12051205   case Z180_DAR0L:
12061206      data = cpustate->IO_DAR0L & Z180_DAR0L_RMASK;
1207      LOG(("Z180 '%s' DAR0L  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1207      LOG(("Z180 '%s' DAR0L  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12081208      break;
12091209
12101210   case Z180_DAR0H:
12111211      data = cpustate->IO_DAR0H & Z180_DAR0H_RMASK;
1212      LOG(("Z180 '%s' DAR0H  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1212      LOG(("Z180 '%s' DAR0H  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12131213      break;
12141214
12151215   case Z180_DAR0B:
12161216      data = cpustate->IO_DAR0B & Z180_DAR0B_RMASK;
1217      LOG(("Z180 '%s' DAR0B  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1217      LOG(("Z180 '%s' DAR0B  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12181218      break;
12191219
12201220   case Z180_BCR0L:
12211221      data = cpustate->IO_BCR0L & Z180_BCR0L_RMASK;
1222      LOG(("Z180 '%s' BCR0L  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1222      LOG(("Z180 '%s' BCR0L  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12231223      break;
12241224
12251225   case Z180_BCR0H:
12261226      data = cpustate->IO_BCR0H & Z180_BCR0H_RMASK;
1227      LOG(("Z180 '%s' BCR0H  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1227      LOG(("Z180 '%s' BCR0H  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12281228      break;
12291229
12301230   case Z180_MAR1L:
12311231      data = cpustate->IO_MAR1L & Z180_MAR1L_RMASK;
1232      LOG(("Z180 '%s' MAR1L  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1232      LOG(("Z180 '%s' MAR1L  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12331233      break;
12341234
12351235   case Z180_MAR1H:
12361236      data = cpustate->IO_MAR1H & Z180_MAR1H_RMASK;
1237      LOG(("Z180 '%s' MAR1H  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1237      LOG(("Z180 '%s' MAR1H  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12381238      break;
12391239
12401240   case Z180_MAR1B:
12411241      data = cpustate->IO_MAR1B & Z180_MAR1B_RMASK;
1242      LOG(("Z180 '%s' MAR1B  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1242      LOG(("Z180 '%s' MAR1B  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12431243      break;
12441244
12451245   case Z180_IAR1L:
12461246      data = cpustate->IO_IAR1L & Z180_IAR1L_RMASK;
1247      LOG(("Z180 '%s' IAR1L  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1247      LOG(("Z180 '%s' IAR1L  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12481248      break;
12491249
12501250   case Z180_IAR1H:
12511251      data = cpustate->IO_IAR1H & Z180_IAR1H_RMASK;
1252      LOG(("Z180 '%s' IAR1H  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1252      LOG(("Z180 '%s' IAR1H  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12531253      break;
12541254
12551255   case Z180_IAR1B:
12561256      data = cpustate->IO_IAR1B & Z180_IAR1B_RMASK;
1257      LOG(("Z180 '%s' IAR1B  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1257      LOG(("Z180 '%s' IAR1B  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12581258      break;
12591259
12601260   case Z180_BCR1L:
12611261      data = cpustate->IO_BCR1L & Z180_BCR1L_RMASK;
1262      LOG(("Z180 '%s' BCR1L  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1262      LOG(("Z180 '%s' BCR1L  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12631263      break;
12641264
12651265   case Z180_BCR1H:
12661266      data = cpustate->IO_BCR1H & Z180_BCR1H_RMASK;
1267      LOG(("Z180 '%s' BCR1H  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1267      LOG(("Z180 '%s' BCR1H  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12681268      break;
12691269
12701270   case Z180_DSTAT:
12711271      data = cpustate->IO_DSTAT & Z180_DSTAT_RMASK;
1272      LOG(("Z180 '%s' DSTAT  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1272      LOG(("Z180 '%s' DSTAT  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12731273      break;
12741274
12751275   case Z180_DMODE:
12761276      data = cpustate->IO_DMODE & Z180_DMODE_RMASK;
1277      LOG(("Z180 '%s' DMODE  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1277      LOG(("Z180 '%s' DMODE  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12781278      break;
12791279
12801280   case Z180_DCNTL:
12811281      data = cpustate->IO_DCNTL & Z180_DCNTL_RMASK;
1282      LOG(("Z180 '%s' DCNTL  rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1282      LOG(("Z180 '%s' DCNTL  rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12831283      break;
12841284
12851285   case Z180_IL:
12861286      data = cpustate->IO_IL & Z180_IL_RMASK;
1287      LOG(("Z180 '%s' IL     rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1287      LOG(("Z180 '%s' IL     rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12881288      break;
12891289
12901290   case Z180_ITC:
12911291      data = cpustate->IO_ITC & Z180_ITC_RMASK;
1292      LOG(("Z180 '%s' ITC    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1292      LOG(("Z180 '%s' ITC    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12931293      break;
12941294
12951295   case Z180_IO35:
12961296      data = cpustate->IO_IO35 & Z180_IO35_RMASK;
1297      LOG(("Z180 '%s' IO35   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1297      LOG(("Z180 '%s' IO35   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
12981298      break;
12991299
13001300   case Z180_RCR:
13011301      data = cpustate->IO_RCR & Z180_RCR_RMASK;
1302      LOG(("Z180 '%s' RCR    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1302      LOG(("Z180 '%s' RCR    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13031303      break;
13041304
13051305   case Z180_IO37:
13061306      data = cpustate->IO_IO37 & Z180_IO37_RMASK;
1307      LOG(("Z180 '%s' IO37   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1307      LOG(("Z180 '%s' IO37   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13081308      break;
13091309
13101310   case Z180_CBR:
13111311      data = cpustate->IO_CBR & Z180_CBR_RMASK;
1312      LOG(("Z180 '%s' CBR    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1312      LOG(("Z180 '%s' CBR    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13131313      break;
13141314
13151315   case Z180_BBR:
13161316      data = cpustate->IO_BBR & Z180_BBR_RMASK;
1317      LOG(("Z180 '%s' BBR    rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1317      LOG(("Z180 '%s' BBR    rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13181318      break;
13191319
13201320   case Z180_CBAR:
13211321      data = cpustate->IO_CBAR & Z180_CBAR_RMASK;
1322      LOG(("Z180 '%s' CBAR   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1322      LOG(("Z180 '%s' CBAR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13231323      break;
13241324
13251325   case Z180_IO3B:
13261326      data = cpustate->IO_IO3B & Z180_IO3B_RMASK;
1327      LOG(("Z180 '%s' IO3B   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1327      LOG(("Z180 '%s' IO3B   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13281328      break;
13291329
13301330   case Z180_IO3C:
13311331      data = cpustate->IO_IO3C & Z180_IO3C_RMASK;
1332      LOG(("Z180 '%s' IO3C   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1332      LOG(("Z180 '%s' IO3C   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13331333      break;
13341334
13351335   case Z180_IO3D:
13361336      data = cpustate->IO_IO3D & Z180_IO3D_RMASK;
1337      LOG(("Z180 '%s' IO3D   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1337      LOG(("Z180 '%s' IO3D   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13381338      break;
13391339
13401340   case Z180_OMCR:
13411341      data = cpustate->IO_OMCR & Z180_OMCR_RMASK;
1342      LOG(("Z180 '%s' OMCR   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1342      LOG(("Z180 '%s' OMCR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13431343      break;
13441344
13451345   case Z180_IOCR:
13461346      data = cpustate->IO_IOCR & Z180_IOCR_RMASK;
1347      LOG(("Z180 '%s' IOCR   rd $%02x ($%02x)\n", cpustate->device->tag.cstr(), data, cpustate->io[port & 0x3f]));
1347      LOG(("Z180 '%s' IOCR   rd $%02x ($%02x)\n", cpustate->device->tag(), data, cpustate->io[port & 0x3f]));
13481348      break;
13491349   }
13501350
r7553r7554
13641364   switch (port + Z180_CNTLA0)
13651365   {
13661366   case Z180_CNTLA0:
1367      LOG(("Z180 '%s' CNTLA0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CNTLA0_WMASK));
1367      LOG(("Z180 '%s' CNTLA0 wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CNTLA0_WMASK));
13681368      cpustate->IO_CNTLA0 = (cpustate->IO_CNTLA0 & ~Z180_CNTLA0_WMASK) | (data & Z180_CNTLA0_WMASK);
13691369      break;
13701370
13711371   case Z180_CNTLA1:
1372      LOG(("Z180 '%s' CNTLA1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CNTLA1_WMASK));
1372      LOG(("Z180 '%s' CNTLA1 wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CNTLA1_WMASK));
13731373      cpustate->IO_CNTLA1 = (cpustate->IO_CNTLA1 & ~Z180_CNTLA1_WMASK) | (data & Z180_CNTLA1_WMASK);
13741374      break;
13751375
13761376   case Z180_CNTLB0:
1377      LOG(("Z180 '%s' CNTLB0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CNTLB0_WMASK));
1377      LOG(("Z180 '%s' CNTLB0 wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CNTLB0_WMASK));
13781378      cpustate->IO_CNTLB0 = (cpustate->IO_CNTLB0 & ~Z180_CNTLB0_WMASK) | (data & Z180_CNTLB0_WMASK);
13791379      break;
13801380
13811381   case Z180_CNTLB1:
1382      LOG(("Z180 '%s' CNTLB1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CNTLB1_WMASK));
1382      LOG(("Z180 '%s' CNTLB1 wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CNTLB1_WMASK));
13831383      cpustate->IO_CNTLB1 = (cpustate->IO_CNTLB1 & ~Z180_CNTLB1_WMASK) | (data & Z180_CNTLB1_WMASK);
13841384      break;
13851385
13861386   case Z180_STAT0:
1387      LOG(("Z180 '%s' STAT0  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_STAT0_WMASK));
1387      LOG(("Z180 '%s' STAT0  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_STAT0_WMASK));
13881388      cpustate->IO_STAT0 = (cpustate->IO_STAT0 & ~Z180_STAT0_WMASK) | (data & Z180_STAT0_WMASK);
13891389      break;
13901390
13911391   case Z180_STAT1:
1392      LOG(("Z180 '%s' STAT1  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_STAT1_WMASK));
1392      LOG(("Z180 '%s' STAT1  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_STAT1_WMASK));
13931393      cpustate->IO_STAT1 = (cpustate->IO_STAT1 & ~Z180_STAT1_WMASK) | (data & Z180_STAT1_WMASK);
13941394      break;
13951395
13961396   case Z180_TDR0:
1397      LOG(("Z180 '%s' TDR0   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TDR0_WMASK));
1397      LOG(("Z180 '%s' TDR0   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TDR0_WMASK));
13981398      cpustate->IO_TDR0 = (cpustate->IO_TDR0 & ~Z180_TDR0_WMASK) | (data & Z180_TDR0_WMASK);
13991399      break;
14001400
14011401   case Z180_TDR1:
1402      LOG(("Z180 '%s' TDR1   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TDR1_WMASK));
1402      LOG(("Z180 '%s' TDR1   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TDR1_WMASK));
14031403      cpustate->IO_TDR1 = (cpustate->IO_TDR1 & ~Z180_TDR1_WMASK) | (data & Z180_TDR1_WMASK);
14041404      break;
14051405
14061406   case Z180_RDR0:
1407      LOG(("Z180 '%s' RDR0   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RDR0_WMASK));
1407      LOG(("Z180 '%s' RDR0   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RDR0_WMASK));
14081408      cpustate->IO_RDR0 = (cpustate->IO_RDR0 & ~Z180_RDR0_WMASK) | (data & Z180_RDR0_WMASK);
14091409      break;
14101410
14111411   case Z180_RDR1:
1412      LOG(("Z180 '%s' RDR1   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RDR1_WMASK));
1412      LOG(("Z180 '%s' RDR1   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RDR1_WMASK));
14131413      cpustate->IO_RDR1 = (cpustate->IO_RDR1 & ~Z180_RDR1_WMASK) | (data & Z180_RDR1_WMASK);
14141414      break;
14151415
14161416   case Z180_CNTR:
1417      LOG(("Z180 '%s' CNTR   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CNTR_WMASK));
1417      LOG(("Z180 '%s' CNTR   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CNTR_WMASK));
14181418      cpustate->IO_CNTR = (cpustate->IO_CNTR & ~Z180_CNTR_WMASK) | (data & Z180_CNTR_WMASK);
14191419      break;
14201420
14211421   case Z180_TRDR:
1422      LOG(("Z180 '%s' TRDR   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TRDR_WMASK));
1422      LOG(("Z180 '%s' TRDR   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TRDR_WMASK));
14231423      cpustate->IO_TRDR = (cpustate->IO_TRDR & ~Z180_TRDR_WMASK) | (data & Z180_TRDR_WMASK);
14241424      break;
14251425
14261426   case Z180_TMDR0L:
1427      LOG(("Z180 '%s' TMDR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TMDR0L_WMASK));
1427      LOG(("Z180 '%s' TMDR0L wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TMDR0L_WMASK));
14281428      cpustate->IO_TMDR0L = data & Z180_TMDR0L_WMASK;
14291429      cpustate->tmdr_value[0] = (cpustate->tmdr_value[0] & 0xff00) | cpustate->IO_TMDR0L;
14301430      break;
14311431
14321432   case Z180_TMDR0H:
1433      LOG(("Z180 '%s' TMDR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TMDR0H_WMASK));
1433      LOG(("Z180 '%s' TMDR0H wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TMDR0H_WMASK));
14341434      cpustate->IO_TMDR0H = data & Z180_TMDR0H_WMASK;
14351435      cpustate->tmdr_value[0] = (cpustate->tmdr_value[0] & 0x00ff) | (cpustate->IO_TMDR0H << 8);
14361436      break;
14371437
14381438   case Z180_RLDR0L:
1439      LOG(("Z180 '%s' RLDR0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RLDR0L_WMASK));
1439      LOG(("Z180 '%s' RLDR0L wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RLDR0L_WMASK));
14401440      cpustate->IO_RLDR0L = (cpustate->IO_RLDR0L & ~Z180_RLDR0L_WMASK) | (data & Z180_RLDR0L_WMASK);
14411441      break;
14421442
14431443   case Z180_RLDR0H:
1444      LOG(("Z180 '%s' RLDR0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RLDR0H_WMASK));
1444      LOG(("Z180 '%s' RLDR0H wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RLDR0H_WMASK));
14451445      cpustate->IO_RLDR0H = (cpustate->IO_RLDR0H & ~Z180_RLDR0H_WMASK) | (data & Z180_RLDR0H_WMASK);
14461446      break;
14471447
14481448   case Z180_TCR:
1449      LOG(("Z180 '%s' TCR    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TCR_WMASK));
1449      LOG(("Z180 '%s' TCR    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TCR_WMASK));
14501450      cpustate->IO_TCR = (cpustate->IO_TCR & ~Z180_TCR_WMASK) | (data & Z180_TCR_WMASK);
14511451      break;
14521452
14531453   case Z180_IO11:
1454      LOG(("Z180 '%s' IO11   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO11_WMASK));
1454      LOG(("Z180 '%s' IO11   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO11_WMASK));
14551455      cpustate->IO_IO11 = (cpustate->IO_IO11 & ~Z180_IO11_WMASK) | (data & Z180_IO11_WMASK);
14561456      break;
14571457
14581458   case Z180_ASEXT0:
1459      LOG(("Z180 '%s' ASEXT0 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ASEXT0_WMASK));
1459      LOG(("Z180 '%s' ASEXT0 wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ASEXT0_WMASK));
14601460      cpustate->IO_ASEXT0 = (cpustate->IO_ASEXT0 & ~Z180_ASEXT0_WMASK) | (data & Z180_ASEXT0_WMASK);
14611461      break;
14621462
14631463   case Z180_ASEXT1:
1464      LOG(("Z180 '%s' ASEXT1 wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ASEXT1_WMASK));
1464      LOG(("Z180 '%s' ASEXT1 wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ASEXT1_WMASK));
14651465      cpustate->IO_ASEXT1 = (cpustate->IO_ASEXT1 & ~Z180_ASEXT1_WMASK) | (data & Z180_ASEXT1_WMASK);
14661466      break;
14671467
14681468   case Z180_TMDR1L:
1469      LOG(("Z180 '%s' TMDR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TMDR1L_WMASK));
1469      LOG(("Z180 '%s' TMDR1L wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TMDR1L_WMASK));
14701470      cpustate->IO_TMDR1L = data & Z180_TMDR1L_WMASK;
14711471      cpustate->tmdr_value[1] = (cpustate->tmdr_value[1] & 0xff00) | cpustate->IO_TMDR1L;
14721472      break;
14731473
14741474   case Z180_TMDR1H:
1475      LOG(("Z180 '%s' TMDR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_TMDR1H_WMASK));
1475      LOG(("Z180 '%s' TMDR1H wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_TMDR1H_WMASK));
14761476      cpustate->IO_TMDR1H = data & Z180_TMDR1H_WMASK;
14771477      cpustate->tmdr_value[1] = (cpustate->tmdr_value[1] & 0x00ff) | cpustate->IO_TMDR1H;
14781478      break;
14791479
14801480   case Z180_RLDR1L:
1481      LOG(("Z180 '%s' RLDR1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RLDR1L_WMASK));
1481      LOG(("Z180 '%s' RLDR1L wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RLDR1L_WMASK));
14821482      cpustate->IO_RLDR1L = (cpustate->IO_RLDR1L & ~Z180_RLDR1L_WMASK) | (data & Z180_RLDR1L_WMASK);
14831483      break;
14841484
14851485   case Z180_RLDR1H:
1486      LOG(("Z180 '%s' RLDR1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RLDR1H_WMASK));
1486      LOG(("Z180 '%s' RLDR1H wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RLDR1H_WMASK));
14871487      cpustate->IO_RLDR1H = (cpustate->IO_RLDR1H & ~Z180_RLDR1H_WMASK) | (data & Z180_RLDR1H_WMASK);
14881488      break;
14891489
14901490   case Z180_FRC:
1491      LOG(("Z180 '%s' FRC    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_FRC_WMASK));
1491      LOG(("Z180 '%s' FRC    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_FRC_WMASK));
14921492      cpustate->IO_FRC = (cpustate->IO_FRC & ~Z180_FRC_WMASK) | (data & Z180_FRC_WMASK);
14931493      break;
14941494
14951495   case Z180_IO19:
1496      LOG(("Z180 '%s' IO19   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO19_WMASK));
1496      LOG(("Z180 '%s' IO19   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO19_WMASK));
14971497      cpustate->IO_IO19 = (cpustate->IO_IO19 & ~Z180_IO19_WMASK) | (data & Z180_IO19_WMASK);
14981498      break;
14991499
15001500   case Z180_ASTC0L:
1501      LOG(("Z180 '%s' ASTC0L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ASTC0L_WMASK));
1501      LOG(("Z180 '%s' ASTC0L wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ASTC0L_WMASK));
15021502      cpustate->IO_ASTC0L = (cpustate->IO_ASTC0L & ~Z180_ASTC0L_WMASK) | (data & Z180_ASTC0L_WMASK);
15031503      break;
15041504
15051505   case Z180_ASTC0H:
1506      LOG(("Z180 '%s' ASTC0H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ASTC0H_WMASK));
1506      LOG(("Z180 '%s' ASTC0H wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ASTC0H_WMASK));
15071507      cpustate->IO_ASTC0H = (cpustate->IO_ASTC0H & ~Z180_ASTC0H_WMASK) | (data & Z180_ASTC0H_WMASK);
15081508      break;
15091509
15101510   case Z180_ASTC1L:
1511      LOG(("Z180 '%s' ASTC1L wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ASTC1L_WMASK));
1511      LOG(("Z180 '%s' ASTC1L wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ASTC1L_WMASK));
15121512      cpustate->IO_ASTC1L = (cpustate->IO_ASTC1L & ~Z180_ASTC1L_WMASK) | (data & Z180_ASTC1L_WMASK);
15131513      break;
15141514
15151515   case Z180_ASTC1H:
1516      LOG(("Z180 '%s' ASTC1H wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ASTC1H_WMASK));
1516      LOG(("Z180 '%s' ASTC1H wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ASTC1H_WMASK));
15171517      cpustate->IO_ASTC1H = (cpustate->IO_ASTC1H & ~Z180_ASTC1H_WMASK) | (data & Z180_ASTC1H_WMASK);
15181518      break;
15191519
15201520   case Z180_CMR:
1521      LOG(("Z180 '%s' CMR    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CMR_WMASK));
1521      LOG(("Z180 '%s' CMR    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CMR_WMASK));
15221522      cpustate->IO_CMR = (cpustate->IO_CMR & ~Z180_CMR_WMASK) | (data & Z180_CMR_WMASK);
15231523      break;
15241524
15251525   case Z180_CCR:
1526      LOG(("Z180 '%s' CCR    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CCR_WMASK));
1526      LOG(("Z180 '%s' CCR    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CCR_WMASK));
15271527      cpustate->IO_CCR = (cpustate->IO_CCR & ~Z180_CCR_WMASK) | (data & Z180_CCR_WMASK);
15281528      break;
15291529
15301530   case Z180_SAR0L:
1531      LOG(("Z180 '%s' SAR0L  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_SAR0L_WMASK));
1531      LOG(("Z180 '%s' SAR0L  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_SAR0L_WMASK));
15321532      cpustate->IO_SAR0L = (cpustate->IO_SAR0L & ~Z180_SAR0L_WMASK) | (data & Z180_SAR0L_WMASK);
15331533      break;
15341534
15351535   case Z180_SAR0H:
1536      LOG(("Z180 '%s' SAR0H  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_SAR0H_WMASK));
1536      LOG(("Z180 '%s' SAR0H  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_SAR0H_WMASK));
15371537      cpustate->IO_SAR0H = (cpustate->IO_SAR0H & ~Z180_SAR0H_WMASK) | (data & Z180_SAR0H_WMASK);
15381538      break;
15391539
15401540   case Z180_SAR0B:
1541      LOG(("Z180 '%s' SAR0B  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_SAR0B_WMASK));
1541      LOG(("Z180 '%s' SAR0B  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_SAR0B_WMASK));
15421542      cpustate->IO_SAR0B = (cpustate->IO_SAR0B & ~Z180_SAR0B_WMASK) | (data & Z180_SAR0B_WMASK);
15431543      break;
15441544
15451545   case Z180_DAR0L:
1546      LOG(("Z180 '%s' DAR0L  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_DAR0L_WMASK));
1546      LOG(("Z180 '%s' DAR0L  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_DAR0L_WMASK));
15471547      cpustate->IO_DAR0L = (cpustate->IO_DAR0L & ~Z180_DAR0L_WMASK) | (data & Z180_DAR0L_WMASK);
15481548      break;
15491549
15501550   case Z180_DAR0H:
1551      LOG(("Z180 '%s' DAR0H  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_DAR0H_WMASK));
1551      LOG(("Z180 '%s' DAR0H  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_DAR0H_WMASK));
15521552      cpustate->IO_DAR0H = (cpustate->IO_DAR0H & ~Z180_DAR0H_WMASK) | (data & Z180_DAR0H_WMASK);
15531553      break;
15541554
15551555   case Z180_DAR0B:
1556      LOG(("Z180 '%s' DAR0B  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_DAR0B_WMASK));
1556      LOG(("Z180 '%s' DAR0B  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_DAR0B_WMASK));
15571557      cpustate->IO_DAR0B = (cpustate->IO_DAR0B & ~Z180_DAR0B_WMASK) | (data & Z180_DAR0B_WMASK);
15581558      break;
15591559
15601560   case Z180_BCR0L:
1561      LOG(("Z180 '%s' BCR0L  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_BCR0L_WMASK));
1561      LOG(("Z180 '%s' BCR0L  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_BCR0L_WMASK));
15621562      cpustate->IO_BCR0L = (cpustate->IO_BCR0L & ~Z180_BCR0L_WMASK) | (data & Z180_BCR0L_WMASK);
15631563      break;
15641564
15651565   case Z180_BCR0H:
1566      LOG(("Z180 '%s' BCR0H  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_BCR0H_WMASK));
1566      LOG(("Z180 '%s' BCR0H  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_BCR0H_WMASK));
15671567      cpustate->IO_BCR0H = (cpustate->IO_BCR0H & ~Z180_BCR0H_WMASK) | (data & Z180_BCR0H_WMASK);
15681568      break;
15691569
15701570   case Z180_MAR1L:
1571      LOG(("Z180 '%s' MAR1L  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_MAR1L_WMASK));
1571      LOG(("Z180 '%s' MAR1L  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_MAR1L_WMASK));
15721572      cpustate->IO_MAR1L = (cpustate->IO_MAR1L & ~Z180_MAR1L_WMASK) | (data & Z180_MAR1L_WMASK);
15731573      break;
15741574
15751575   case Z180_MAR1H:
1576      LOG(("Z180 '%s' MAR1H  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_MAR1H_WMASK));
1576      LOG(("Z180 '%s' MAR1H  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_MAR1H_WMASK));
15771577      cpustate->IO_MAR1H = (cpustate->IO_MAR1H & ~Z180_MAR1H_WMASK) | (data & Z180_MAR1H_WMASK);
15781578      break;
15791579
15801580   case Z180_MAR1B:
1581      LOG(("Z180 '%s' MAR1B  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_MAR1B_WMASK));
1581      LOG(("Z180 '%s' MAR1B  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_MAR1B_WMASK));
15821582      cpustate->IO_MAR1B = (cpustate->IO_MAR1B & ~Z180_MAR1B_WMASK) | (data & Z180_MAR1B_WMASK);
15831583      break;
15841584
15851585   case Z180_IAR1L:
1586      LOG(("Z180 '%s' IAR1L  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IAR1L_WMASK));
1586      LOG(("Z180 '%s' IAR1L  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IAR1L_WMASK));
15871587      cpustate->IO_IAR1L = (cpustate->IO_IAR1L & ~Z180_IAR1L_WMASK) | (data & Z180_IAR1L_WMASK);
15881588      break;
15891589
15901590   case Z180_IAR1H:
1591      LOG(("Z180 '%s' IAR1H  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IAR1H_WMASK));
1591      LOG(("Z180 '%s' IAR1H  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IAR1H_WMASK));
15921592      cpustate->IO_IAR1H = (cpustate->IO_IAR1H & ~Z180_IAR1H_WMASK) | (data & Z180_IAR1H_WMASK);
15931593      break;
15941594
15951595   case Z180_IAR1B:
1596      LOG(("Z180 '%s' IAR1B  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IAR1B_WMASK));
1596      LOG(("Z180 '%s' IAR1B  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IAR1B_WMASK));
15971597      cpustate->IO_IAR1B = (cpustate->IO_IAR1B & ~Z180_IAR1B_WMASK) | (data & Z180_IAR1B_WMASK);
15981598      break;
15991599
16001600   case Z180_BCR1L:
1601      LOG(("Z180 '%s' BCR1L  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_BCR1L_WMASK));
1601      LOG(("Z180 '%s' BCR1L  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_BCR1L_WMASK));
16021602      cpustate->IO_BCR1L = (cpustate->IO_BCR1L & ~Z180_BCR1L_WMASK) | (data & Z180_BCR1L_WMASK);
16031603      break;
16041604
16051605   case Z180_BCR1H:
1606      LOG(("Z180 '%s' BCR1H  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_BCR1H_WMASK));
1606      LOG(("Z180 '%s' BCR1H  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_BCR1H_WMASK));
16071607      cpustate->IO_BCR1H = (cpustate->IO_BCR1H & ~Z180_BCR1H_WMASK) | (data & Z180_BCR1H_WMASK);
16081608      break;
16091609
16101610   case Z180_DSTAT:
1611      LOG(("Z180 '%s' DSTAT  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_DSTAT_WMASK));
1611      LOG(("Z180 '%s' DSTAT  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_DSTAT_WMASK));
16121612      cpustate->IO_DSTAT = (cpustate->IO_DSTAT & ~Z180_DSTAT_WMASK) | (data & Z180_DSTAT_WMASK);
16131613      if ((data & (Z180_DSTAT_DE1 | Z180_DSTAT_DWE1)) == Z180_DSTAT_DE1)
16141614         cpustate->IO_DSTAT |= Z180_DSTAT_DME;  /* DMA enable */
r7553r7554
16171617      break;
16181618
16191619   case Z180_DMODE:
1620      LOG(("Z180 '%s' DMODE  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_DMODE_WMASK));
1620      LOG(("Z180 '%s' DMODE  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_DMODE_WMASK));
16211621      cpustate->IO_DMODE = (cpustate->IO_DMODE & ~Z180_DMODE_WMASK) | (data & Z180_DMODE_WMASK);
16221622      break;
16231623
16241624   case Z180_DCNTL:
1625      LOG(("Z180 '%s' DCNTL  wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_DCNTL_WMASK));
1625      LOG(("Z180 '%s' DCNTL  wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_DCNTL_WMASK));
16261626      cpustate->IO_DCNTL = (cpustate->IO_DCNTL & ~Z180_DCNTL_WMASK) | (data & Z180_DCNTL_WMASK);
16271627      break;
16281628
16291629   case Z180_IL:
1630      LOG(("Z180 '%s' IL     wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IL_WMASK));
1630      LOG(("Z180 '%s' IL     wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IL_WMASK));
16311631      cpustate->IO_IL = (cpustate->IO_IL & ~Z180_IL_WMASK) | (data & Z180_IL_WMASK);
16321632      break;
16331633
16341634   case Z180_ITC:
1635      LOG(("Z180 '%s' ITC    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_ITC_WMASK));
1635      LOG(("Z180 '%s' ITC    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_ITC_WMASK));
16361636      cpustate->IO_ITC = (cpustate->IO_ITC & ~Z180_ITC_WMASK) | (data & Z180_ITC_WMASK);
16371637      break;
16381638
16391639   case Z180_IO35:
1640      LOG(("Z180 '%s' IO35   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO35_WMASK));
1640      LOG(("Z180 '%s' IO35   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO35_WMASK));
16411641      cpustate->IO_IO35 = (cpustate->IO_IO35 & ~Z180_IO35_WMASK) | (data & Z180_IO35_WMASK);
16421642      break;
16431643
16441644   case Z180_RCR:
1645      LOG(("Z180 '%s' RCR    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_RCR_WMASK));
1645      LOG(("Z180 '%s' RCR    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_RCR_WMASK));
16461646      cpustate->IO_RCR = (cpustate->IO_RCR & ~Z180_RCR_WMASK) | (data & Z180_RCR_WMASK);
16471647      break;
16481648
16491649   case Z180_IO37:
1650      LOG(("Z180 '%s' IO37   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO37_WMASK));
1650      LOG(("Z180 '%s' IO37   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO37_WMASK));
16511651      cpustate->IO_IO37 = (cpustate->IO_IO37 & ~Z180_IO37_WMASK) | (data & Z180_IO37_WMASK);
16521652      break;
16531653
16541654   case Z180_CBR:
1655      LOG(("Z180 '%s' CBR    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CBR_WMASK));
1655      LOG(("Z180 '%s' CBR    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CBR_WMASK));
16561656      cpustate->IO_CBR = (cpustate->IO_CBR & ~Z180_CBR_WMASK) | (data & Z180_CBR_WMASK);
16571657      z180_mmu(cpustate);
16581658      break;
16591659
16601660   case Z180_BBR:
1661      LOG(("Z180 '%s' BBR    wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_BBR_WMASK));
1661      LOG(("Z180 '%s' BBR    wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_BBR_WMASK));
16621662      cpustate->IO_BBR = (cpustate->IO_BBR & ~Z180_BBR_WMASK) | (data & Z180_BBR_WMASK);
16631663      z180_mmu(cpustate);
16641664      break;
16651665
16661666   case Z180_CBAR:
1667      LOG(("Z180 '%s' CBAR   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_CBAR_WMASK));
1667      LOG(("Z180 '%s' CBAR   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_CBAR_WMASK));
16681668      cpustate->IO_CBAR = (cpustate->IO_CBAR & ~Z180_CBAR_WMASK) | (data & Z180_CBAR_WMASK);
16691669      z180_mmu(cpustate);
16701670      break;
16711671
16721672   case Z180_IO3B:
1673      LOG(("Z180 '%s' IO3B   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO3B_WMASK));
1673      LOG(("Z180 '%s' IO3B   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO3B_WMASK));
16741674      cpustate->IO_IO3B = (cpustate->IO_IO3B & ~Z180_IO3B_WMASK) | (data & Z180_IO3B_WMASK);
16751675      break;
16761676
16771677   case Z180_IO3C:
1678      LOG(("Z180 '%s' IO3C   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO3C_WMASK));
1678      LOG(("Z180 '%s' IO3C   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO3C_WMASK));
16791679      cpustate->IO_IO3C = (cpustate->IO_IO3C & ~Z180_IO3C_WMASK) | (data & Z180_IO3C_WMASK);
16801680      break;
16811681
16821682   case Z180_IO3D:
1683      LOG(("Z180 '%s' IO3D   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IO3D_WMASK));
1683      LOG(("Z180 '%s' IO3D   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IO3D_WMASK));
16841684      cpustate->IO_IO3D = (cpustate->IO_IO3D & ~Z180_IO3D_WMASK) | (data & Z180_IO3D_WMASK);
16851685      break;
16861686
16871687   case Z180_OMCR:
1688      LOG(("Z180 '%s' OMCR   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_OMCR_WMASK));
1688      LOG(("Z180 '%s' OMCR   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_OMCR_WMASK));
16891689      cpustate->IO_OMCR = (cpustate->IO_OMCR & ~Z180_OMCR_WMASK) | (data & Z180_OMCR_WMASK);
16901690      break;
16911691
16921692   case Z180_IOCR:
1693      LOG(("Z180 '%s' IOCR   wr $%02x ($%02x)\n", cpustate->device->tag.cstr(), data,  data & Z180_IOCR_WMASK));
1693      LOG(("Z180 '%s' IOCR   wr $%02x ($%02x)\n", cpustate->device->tag(), data,  data & Z180_IOCR_WMASK));
16941694      cpustate->IO_IOCR = (cpustate->IO_IOCR & ~Z180_IOCR_WMASK) | (data & Z180_IOCR_WMASK);
16951695      break;
16961696   }
r7553r7554
18931893    /* I/O asynchronous clock 0 (active high) or DREQ0 (mux) */
18941894   if (changes & Z180_CKA0)
18951895   {
1896      LOG(("Z180 '%s' CKA0   %d\n", cpustate->device->tag.cstr(), data & Z180_CKA0 ? 1 : 0));
1896      LOG(("Z180 '%s' CKA0   %d\n", cpustate->device->tag(), data & Z180_CKA0 ? 1 : 0));
18971897      cpustate->iol = (cpustate->iol & ~Z180_CKA0) | (data & Z180_CKA0);
18981898    }
18991899
19001900    /* I/O asynchronous clock 1 (active high) or TEND1 (mux) */
19011901   if (changes & Z180_CKA1)
19021902   {
1903      LOG(("Z180 '%s' CKA1   %d\n", cpustate->device->tag.cstr(), data & Z180_CKA1 ? 1 : 0));
1903      LOG(("Z180 '%s' CKA1   %d\n", cpustate->device->tag(), data & Z180_CKA1 ? 1 : 0));
19041904      cpustate->iol = (cpustate->iol & ~Z180_CKA1) | (data & Z180_CKA1);
19051905    }
19061906
19071907    /* I/O serial clock (active high) */
19081908   if (changes & Z180_CKS)
19091909   {
1910      LOG(("Z180 '%s' CKS    %d\n", cpustate->device->tag.cstr(), data & Z180_CKS ? 1 : 0));
1910      LOG(("Z180 '%s' CKS    %d\n", cpustate->device->tag(), data & Z180_CKS ? 1 : 0));
19111911      cpustate->iol = (cpustate->iol & ~Z180_CKS) | (data & Z180_CKS);
19121912    }
19131913
19141914    /* I   clear to send 0 (active low) */
19151915   if (changes & Z180_CTS0)
19161916   {
1917      LOG(("Z180 '%s' CTS0   %d\n", cpustate->device->tag.cstr(), data & Z180_CTS0 ? 1 : 0));
1917      LOG(("Z180 '%s' CTS0   %d\n", cpustate->device->tag(), data & Z180_CTS0 ? 1 : 0));
19181918      cpustate->iol = (cpustate->iol & ~Z180_CTS0) | (data & Z180_CTS0);
19191919    }
19201920
19211921    /* I   clear to send 1 (active low) or RXS (mux) */
19221922   if (changes & Z180_CTS1)
19231923   {
1924      LOG(("Z180 '%s' CTS1   %d\n", cpustate->device->tag.cstr(), data & Z180_CTS1 ? 1 : 0));
1924      LOG(("Z180 '%s' CTS1   %d\n", cpustate->device->tag(), data & Z180_CTS1 ? 1 : 0));
19251925      cpustate->iol = (cpustate->iol & ~Z180_CTS1) | (data & Z180_CTS1);
19261926    }
19271927
19281928    /* I   data carrier detect (active low) */
19291929   if (changes & Z180_DCD0)
19301930   {
1931      LOG(("Z180 '%s' DCD0   %d\n", cpustate->device->tag.cstr(), data & Z180_DCD0 ? 1 : 0));
1931      LOG(("Z180 '%s' DCD0   %d\n", cpustate->device->tag(), data & Z180_DCD0 ? 1 : 0));
19321932      cpustate->iol = (cpustate->iol & ~Z180_DCD0) | (data & Z180_DCD0);
19331933    }
19341934
19351935    /* I   data request DMA ch 0 (active low) or CKA0 (mux) */
19361936   if (changes & Z180_DREQ0)
19371937   {
1938      LOG(("Z180 '%s' DREQ0  %d\n", cpustate->device->tag.cstr(), data & Z180_DREQ0 ? 1 : 0));
1938      LOG(("Z180 '%s' DREQ0  %d\n", cpustate->device->tag(), data & Z180_DREQ0 ? 1 : 0));
19391939      cpustate->iol = (cpustate->iol & ~Z180_DREQ0) | (data & Z180_DREQ0);
19401940    }
19411941
19421942    /* I   data request DMA ch 1 (active low) */
19431943   if (changes & Z180_DREQ1)
19441944   {
1945      LOG(("Z180 '%s' DREQ1  %d\n", cpustate->device->tag.cstr(), data & Z180_DREQ1 ? 1 : 0));
1945      LOG(("Z180 '%s' DREQ1  %d\n", cpustate->device->tag(), data & Z180_DREQ1 ? 1 : 0));
19461946      cpustate->iol = (cpustate->iol & ~Z180_DREQ1) | (data & Z180_DREQ1);
19471947    }
19481948
19491949    /* I   asynchronous receive data 0 (active high) */
19501950   if (changes & Z180_RXA0)
19511951   {
1952      LOG(("Z180 '%s' RXA0   %d\n", cpustate->device->tag.cstr(), data & Z180_RXA0 ? 1 : 0));
1952      LOG(("Z180 '%s' RXA0   %d\n", cpustate->device->tag(), data & Z180_RXA0 ? 1 : 0));
19531953        cpustate->iol = (cpustate->iol & ~Z180_RXA0) | (data & Z180_RXA0);
19541954    }
19551955
19561956    /* I   asynchronous receive data 1 (active high) */
19571957   if (changes & Z180_RXA1)
19581958   {
1959      LOG(("Z180 '%s' RXA1   %d\n", cpustate->device->tag.cstr(), data & Z180_RXA1 ? 1 : 0));
1959      LOG(("Z180 '%s' RXA1   %d\n", cpustate->device->tag(), data & Z180_RXA1 ? 1 : 0));
19601960      cpustate->iol = (cpustate->iol & ~Z180_RXA1) | (data & Z180_RXA1);
19611961    }
19621962
19631963    /* I   clocked serial receive data (active high) or CTS1 (mux) */
19641964   if (changes & Z180_RXS)
19651965   {
1966      LOG(("Z180 '%s' RXS    %d\n", cpustate->device->tag.cstr(), data & Z180_RXS ? 1 : 0));
1966      LOG(("Z180 '%s' RXS    %d\n", cpustate->device->tag(), data & Z180_RXS ? 1 : 0));
19671967        cpustate->iol = (cpustate->iol & ~Z180_RXS) | (data & Z180_RXS);
19681968    }
19691969
19701970    /*   O request to send (active low) */
19711971   if (changes & Z180_RTS0)
19721972   {
1973      LOG(("Z180 '%s' RTS0   won't change output\n", cpustate->device->tag.cstr()));
1973      LOG(("Z180 '%s' RTS0   won't change output\n", cpustate->device->tag()));
19741974    }
19751975
19761976    /*   O transfer end 0 (active low) or CKA1 (mux) */
19771977   if (changes & Z180_TEND0)
19781978   {
1979      LOG(("Z180 '%s' TEND0  won't change output\n", cpustate->device->tag.cstr()));
1979      LOG(("Z180 '%s' TEND0  won't change output\n", cpustate->device->tag()));
19801980    }
19811981
19821982    /*   O transfer end 1 (active low) */
19831983   if (changes & Z180_TEND1)
19841984   {
1985      LOG(("Z180 '%s' TEND1  won't change output\n", cpustate->device->tag.cstr()));
1985      LOG(("Z180 '%s' TEND1  won't change output\n", cpustate->device->tag()));
19861986    }
19871987
19881988    /*   O transfer out (PRT channel, active low) or A18 (mux) */
19891989   if (changes & Z180_A18_TOUT)
19901990   {
1991      LOG(("Z180 '%s' TOUT   won't change output\n", cpustate->device->tag.cstr()));
1991      LOG(("Z180 '%s' TOUT   won't change output\n", cpustate->device->tag()));
19921992    }
19931993
19941994    /*   O asynchronous transmit data 0 (active high) */
19951995   if (changes & Z180_TXA0)
19961996   {
1997      LOG(("Z180 '%s' TXA0   won't change output\n", cpustate->device->tag.cstr()));
1997      LOG(("Z180 '%s' TXA0   won't change output\n", cpustate->device->tag()));
19981998    }
19991999
20002000    /*   O asynchronous transmit data 1 (active high) */
20012001   if (changes & Z180_TXA1)
20022002   {
2003      LOG(("Z180 '%s' TXA1   won't change output\n", cpustate->device->tag.cstr()));
2003      LOG(("Z180 '%s' TXA1   won't change output\n", cpustate->device->tag()));
20042004    }
20052005
20062006    /*   O clocked serial transmit data (active high) */
20072007   if (changes & Z180_TXS)
20082008   {
2009      LOG(("Z180 '%s' TXS    won't change output\n", cpustate->device->tag.cstr()));
2009      LOG(("Z180 '%s' TXS    won't change output\n", cpustate->device->tag()));
20102010    }
20112011}
20122012
r7553r7554
23202320   /* to just check here */
23212321   if (cpustate->nmi_pending)
23222322   {
2323      LOG(("Z180 '%s' take NMI\n", cpustate->device->tag.cstr()));
2323      LOG(("Z180 '%s' take NMI\n", cpustate->device->tag()));
23242324      cpustate->_PPC = -1;         /* there isn't a valid previous program counter */
23252325      LEAVE_HALT(cpustate);      /* Check if processor was halted */
23262326
r7553r7554
24262426   }
24272427   else
24282428   {
2429      LOG(("Z180 '%s' set_irq_line %d = %d\n",cpustate->device->tag.cstr() , irqline,state));
2429      LOG(("Z180 '%s' set_irq_line %d = %d\n",cpustate->device->tag() , irqline,state));
24302430
24312431      /* update the IRQ state */
24322432      cpustate->irq_state[irqline] = state;
src/emu/cpu/z180/z180ops.h
r7553r7554
236236 * RETN
237237 ***************************************************************/
238238#define RETN   {                                    \
239   LOG(("Z180 '%s' RETN IFF1:%d IFF2:%d\n", cpustate->device->tag.cstr(), cpustate->IFF1, cpustate->IFF2)); \
239   LOG(("Z180 '%s' RETN IFF1:%d IFF2:%d\n", cpustate->device->tag(), cpustate->IFF1, cpustate->IFF2)); \
240240   POP(cpustate, PC);                                       \
241241   cpustate->IFF1 = cpustate->IFF2;                                    \
242242}
src/emu/cpu/z180/z180dd.c
r7553r7554
11OP(illegal,1) {
22   logerror("Z180 '%s' ill. opcode $%02x $%02x\n",
3         cpustate->device->tag.cstr(), memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff), memory_decrypted_read_byte(cpustate->program, cpustate->_PCD));
3         cpustate->device->tag(), memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff), memory_decrypted_read_byte(cpustate->program, cpustate->_PCD));
44}
55
66/**********************************************************
src/emu/cpu/z180/z180ed.c
r7553r7554
11OP(illegal,2)
22{
33   logerror("Z180 '%s' ill. opcode $ed $%02x\n",
4         cpustate->device->tag.cstr(), memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff));
4         cpustate->device->tag(), memory_decrypted_read_byte(cpustate->program, (cpustate->_PCD-1)&0xffff));
55}
66
77/**********************************************************
src/emu/cpu/upd7810/7810ops.c
r7553r7554
99
1010static void illegal(upd7810_state *cpustate)
1111{
12   logerror("uPD7810 '%s': illegal opcode %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, PC);
12   logerror("uPD7810 '%s': illegal opcode %02x at PC:%04x\n", cpustate->device->tag(), OP, PC);
1313}
1414
1515static void illegal2(upd7810_state *cpustate)
1616{
17   logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, OP2, PC);
17   logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag(), OP, OP2, PC);
1818}
1919
2020/* prefix 48 */
r7553r7554
86488648         val = RP( cpustate, UPD7807_PORTT );
86498649         break;
86508650      default:
8651         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
8651         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag(), OP, imm, PC);
86528652         val = 0;
86538653         break;
86548654   }
r7553r7554
87028702//          PT is input only
87038703//          break;
87048704      default:
8705         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
8705         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag(), OP, imm, PC);
87068706         break;
87078707   }
87088708}
r7553r7554
87528752//          PT is input only
87538753//          break;
87548754      default:
8755         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
8755         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag(), OP, imm, PC);
87568756         break;
87578757   }
87588758}
r7553r7554
88018801         val = RP( cpustate, UPD7807_PORTT );
88028802         break;
88038803      default:
8804         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag.cstr(), OP, imm, PC);
8804         logerror("uPD7810 '%s': illegal opcode %02x %02x at PC:%04x\n", cpustate->device->tag(), OP, imm, PC);
88058805         val = 0;
88068806         break;
88078807   }
src/emu/cpu/hd6309/hd6309.c
r7553r7554
584584   {
585585      if (m68_state->nmi_state == state) return;
586586      m68_state->nmi_state = state;
587      LOG(("HD6309 '%s' set_irq_line (NMI) %d (PC=%4.4X)\n", m68_state->device->tag.cstr(), state, pPC.d));
587      LOG(("HD6309 '%s' set_irq_line (NMI) %d (PC=%4.4X)\n", m68_state->device->tag(), state, pPC.d));
588588      if( state == CLEAR_LINE ) return;
589589
590590      /* if the stack was not yet initialized */
r7553r7554
622622   }
623623   else if (irqline < 2)
624624   {
625      LOG(("HD6309 '%s' set_irq_line %d, %d (PC=%4.4X)\n", m68_state->device->tag.cstr(), irqline, state, pPC.d));
625      LOG(("HD6309 '%s' set_irq_line %d, %d (PC=%4.4X)\n", m68_state->device->tag(), irqline, state, pPC.d));
626626      m68_state->irq_state[irqline] = state;
627627      if (state == CLEAR_LINE) return;
628628      check_irq_lines(m68_state);
src/emu/cpu/avr8/avr8.c
r7553r7554
9393
9494/*****************************************************************************/
9595
96INLINE bool avr8_is_long_opcode(UINT16 op)
97{
98   if((op & 0xf000) == 0x9000)
99   {
100      if((op & 0x0f00) < 0x0400)
101      {
102         if((op & 0x000f) == 0x0000)
103         {
104            return true;
105         }
106      }
107      else if((op & 0x0f00) < 0x0600)
108      {
109         if((op & 0x000f) >= 0x000c)
110         {
111            return true;
112         }
113      }
114   }
115   return false;
116}
117
96118INLINE UINT8 READ_PRG_8(avr8_state *cpustate, UINT32 address)
97119{
98120    return memory_read_byte_16le(cpustate->program, address);
r7553r7554
149171    // Horrible hack, not accurate
150172    if(state)
151173    {
152        SREG_W(AVR8_SREG_I, 0);
153        PUSH(cpustate, (cpustate->pc >> 8) & 0x00ff);
154        PUSH(cpustate, cpustate->pc & 0x00ff);
155        cpustate->pc = vector;
174      if(SREG_R(AVR8_SREG_I))
175      {
176         SREG_W(AVR8_SREG_I, 0);
177         PUSH(cpustate, (cpustate->pc >> 8) & 0x00ff);
178         PUSH(cpustate, cpustate->pc & 0x00ff);
179         cpustate->pc = vector;
180      }
156181    }
157182}
158183
r7553r7554
828853                        opcycles = 2;
829854                        break;
830855                    case 0x0900:    // SBIC A,b
831                        //output += sprintf( output, "SBIC    0x%02x, %d", ACONST5(op), RR3(op) );
832                        unimplemented_opcode(cpustate, op);
856                         if(!(READ_IO_8(cpustate, ACONST5(op)) & (1 << RR3(op))))
857                         {
858                     opcycles += avr8_is_long_opcode(op) ? 2 : 1;
859                            cpustate->pc += avr8_is_long_opcode(op) ? 2 : 1;
860                  }
833861                        break;
834862                    case 0x0a00:    // SBI A,b
835863                        //output += sprintf( output, "SBI     0x%02x, %d", ACONST5(op), RR3(op) );
r7553r7554
844872                    case 0x0d00:
845873                    case 0x0e00:
846874                    case 0x0f00:    // MUL Rd,Rr
875                        sd = (UINT8)READ_IO_8(cpustate, RD5(op)) * (UINT8)READ_IO_8(cpustate, RR5(op));
876                        WRITE_IO_8(cpustate, 1, (sd >> 8) & 0x00ff);
877                        WRITE_IO_8(cpustate, 0, sd & 0x00ff);
878                        SREG_W(AVR8_SREG_C, (sd & 0x8000) ? 1 : 0);
879                        SREG_W(AVR8_SREG_Z, (sd == 0) ? 1 : 0);
880                        opcycles = 2;
847881                        //output += sprintf( output, "MUL     R%d, R%d", RD5(op), RR5(op) );
848                        unimplemented_opcode(cpustate, op);
849882                        break;
850883                }
851884                break;
src/emu/cpu/cdp1802/cdp1802.c
r7553r7554
923923         {
924924         case CDP1802_MODE_LOAD:
925925            // RUN mode cannot be initiated from LOAD mode
926            logerror("CDP1802 '%s' Tried to initiate RUN mode from LOAD mode\n", device->tag.cstr());
926            logerror("CDP1802 '%s' Tried to initiate RUN mode from LOAD mode\n", device->tag());
927927            cpustate->mode = CDP1802_MODE_LOAD;
928928            break;
929929
src/emu/cpu/i860/i860dec.c
r7553r7554
44654465      if (cpustate->pc == 0xfffc0370 ||
44664466         cpustate->pc == 0xfffc03a4)
44674467      {
4468         fprintf(stderr, "(%s) 0x%08x: snag 0x20000000\n", cpustate->device->tag.cstr(), cpustate->pc);
4468         fprintf(stderr, "(%s) 0x%08x: snag 0x20000000\n", cpustate->device->tag(), cpustate->pc);
44694469         cpustate->single_stepping = 0;
44704470      }
44714471      else if (cpustate->pc == 0xfffc0384 ||
44724472             cpustate->pc == 0xfffc03b8)
44734473      {
4474         fprintf(stderr, "(%s) 0x%08x: passed 0x20000000\n", cpustate->device->tag.cstr(), cpustate->pc);
4474         fprintf(stderr, "(%s) 0x%08x: passed 0x20000000\n", cpustate->device->tag(), cpustate->pc);
44754475         cpustate->single_stepping = 0;
44764476      }
44774477#endif
r7553r7554
45514551
45524552      /* Note that we print the incoming (possibly virtual) address as the
45534553           PC rather than the translated address.  */
4554      fprintf (stderr, "  (%s) 0x%08x: ", cpustate->device->tag.cstr(), addr);
4554      fprintf (stderr, "  (%s) 0x%08x: ", cpustate->device->tag(), addr);
45554555      insn = memory_read_dword_64le(cpustate->program, phys_addr);
45564556#ifdef HOST_MSB
45574557      BYTE_REV32 (insn);
src/emu/cpu/mcs51/mcs51.c
r7553r7554
20262026      case ADDR_SCON:
20272027         break;
20282028      default:
2029         LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", mcs51_state->device->tag.cstr(), (UINT32)offset,PC,data));
2029         LOG(("mcs51 '%s': attemping to write to an invalid/non-implemented SFR address: %x at 0x%04x, data=%x\n", mcs51_state->device->tag(), (UINT32)offset,PC,data));
20302030         /* no write in this case according to manual */
20312031         return;
20322032   }
r7553r7554
20662066         return memory_read_byte_8le(mcs51_state->data, (size_t) offset | 0x100);
20672067      /* Illegal or non-implemented sfr */
20682068      default:
2069         LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", mcs51_state->device->tag.cstr(), (UINT32)offset,PC));
2069         LOG(("mcs51 '%s': attemping to read an invalid/non-implemented SFR address: %x at 0x%04x\n", mcs51_state->device->tag(), (UINT32)offset,PC));
20702070         /* according to the manual, the read may return random bits */
20712071         return 0xff;
20722072   }
r7553r7554
23182318 ****************************************************************************/
23192319
23202320
2321#define DS5_LOGW(a, d)   LOG(("ds5002fp '%s': write to  " # a " register at 0x%04x, data=%x\n", mcs51_state->device->tag.cstr(), PC, d))
2322#define DS5_LOGR(a, d)   LOG(("ds5002fp '%s': read from " # a " register at 0x%04x\n", mcs51_state->device->tag.cstr(), PC))
2321#define DS5_LOGW(a, d)   LOG(("ds5002fp '%s': write to  " # a " register at 0x%04x, data=%x\n", mcs51_state->device->tag(), PC, d))
2322#define DS5_LOGR(a, d)   LOG(("ds5002fp '%s': read from " # a " register at 0x%04x\n", mcs51_state->device->tag(), PC))
23232323
23242324INLINE UINT8 ds5002fp_protected(mcs51_state_t *mcs51_state, size_t offset, UINT8 data, UINT8 ta_mask, UINT8 mask)
23252325{
r7553r7554
23452345         if ((data == 0xaa) && (mcs51_state->ds5002fp.ta_window == 0))
23462346         {
23472347            mcs51_state->ds5002fp.ta_window = 6; /* 4*12 + 2*12 */
2348            LOG(("ds5002fp '%s': TA window initiated at 0x%04x\n", mcs51_state->device->tag.cstr(), PC));
2348            LOG(("ds5002fp '%s': TA window initiated at 0x%04x\n", mcs51_state->device->tag(), PC));
23492349         }
23502350         break;
23512351      case ADDR_MCON:    data = ds5002fp_protected(mcs51_state, ADDR_MCON, data, 0x0f, 0xf7);   DS5_LOGW(MCON, data); break;
src/emu/cpu/mcs51/mcs51ops.c
r7553r7554
976976//illegal opcodes
977977OPHANDLER( illegal )
978978{
979   LOG(("i8051 '%s': illegal opcode at 0x%03x: %02x\n", mcs51_state->device->tag.cstr(), PC-1, r));
979   LOG(("i8051 '%s': illegal opcode at 0x%03x: %02x\n", mcs51_state->device->tag(), PC-1, r));
980980}
src/emu/cpu/m6502/m4510.c
r7553r7554
272272      P = (P & ~F_D) | F_I;      /* knock out D and set I flag */
273273      PCL = RDMEM(EAD);
274274      PCH = RDMEM(EAD+1);
275      LOG(("M4510 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
275      LOG(("M4510 '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), PCD));
276276      /* call back the cpuintrf to let it clear the line */
277277      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
278278   }
r7553r7554
302302      /* check if the I flag was just reset (interrupts enabled) */
303303      if( cpustate->after_cli )
304304      {
305         LOG(("M4510 '%s' after_cli was >0", cpustate->device->tag.cstr()));
305         LOG(("M4510 '%s' after_cli was >0", cpustate->device->tag()));
306306         cpustate->after_cli = 0;
307307         if (cpustate->irq_state != CLEAR_LINE)
308308         {
r7553r7554
331331      cpustate->nmi_state = state;
332332      if( state != CLEAR_LINE )
333333      {
334         LOG(("M4510 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
334         LOG(("M4510 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
335335         EAD = M4510_NMI_VEC;
336336         cpustate->icount -= 7;
337337         PUSH(PCH);
r7553r7554
340340         P = (P & ~F_D) | F_I;      /* knock out D and set I flag */
341341         PCL = RDMEM(EAD);
342342         PCH = RDMEM(EAD+1);
343         LOG(("M4510 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
343         LOG(("M4510 '%s' takes NMI ($%04x)\n", cpustate->device->tag(), PCD));
344344      }
345345   }
346346   else
r7553r7554
348348      cpustate->irq_state = state;
349349      if( state != CLEAR_LINE )
350350      {
351         LOG(("M4510 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
351         LOG(("M4510 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
352352         cpustate->pending_irq = 1;
353353      }
354354   }
src/emu/cpu/m6502/ops02.h
r7553r7554
623623   if ( P & F_I ) {                                 \
624624      PULL(P);                                    \
625625      if ((cpustate->irq_state != CLEAR_LINE) && !(P & F_I)) {   \
626         LOG(("M6502 '%s' PLP sets after_cli\n",cpustate->device->tag.cstr()));   \
626         LOG(("M6502 '%s' PLP sets after_cli\n",cpustate->device->tag()));   \
627627         cpustate->after_cli = 1;                        \
628628      }                                          \
629629   } else {                                       \
r7553r7554
665665   P |= F_T | F_B;                                  \
666666   if( (cpustate->irq_state != CLEAR_LINE) && !(P & F_I) )         \
667667   {                                             \
668      LOG(("M6502 '%s' RTI sets after_cli\n",cpustate->device->tag.cstr()));   \
668      LOG(("M6502 '%s' RTI sets after_cli\n",cpustate->device->tag()));   \
669669      cpustate->after_cli = 1;                           \
670670   }
671671
src/emu/cpu/m6502/m6502.c
r7553r7554
216216      P |= F_I;      /* set I flag */
217217      PCL = RDMEM(EAD);
218218      PCH = RDMEM(EAD+1);
219      LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
219      LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), PCD));
220220      /* call back the cpuintrf to let it clear the line */
221221      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
222222   }
r7553r7554
246246      /* check if the I flag was just reset (interrupts enabled) */
247247      if( cpustate->after_cli )
248248      {
249         LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag.cstr()));
249         LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag()));
250250         cpustate->after_cli = 0;
251251         if (cpustate->irq_state != CLEAR_LINE)
252252         {
r7553r7554
284284      cpustate->nmi_state = state;
285285      if( state != CLEAR_LINE )
286286      {
287         LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
287         LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
288288         EAD = M6502_NMI_VEC;
289289         cpustate->icount -= 2;
290290         PUSH(PCH);
r7553r7554
293293         P |= F_I;      /* set I flag */
294294         PCL = RDMEM(EAD);
295295         PCH = RDMEM(EAD+1);
296         LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
296         LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag(), PCD));
297297      }
298298   }
299299   else
r7553r7554
302302      {
303303         if( cpustate->so_state && !state )
304304         {
305            LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag.cstr()));
305            LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag()));
306306            P|=F_V;
307307         }
308308         cpustate->so_state=state;
r7553r7554
311311      cpustate->irq_state = state;
312312      if( state != CLEAR_LINE )
313313      {
314         LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
314         LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
315315         cpustate->pending_irq = 1;
316316//          cpustate->pending_irq = 2;
317317         cpustate->int_occured = cpustate->icount;
r7553r7554
437437      P = (P & ~F_D) | F_I;      /* knock out D and set I flag */
438438      PCL = RDMEM(EAD);
439439      PCH = RDMEM(EAD+1);
440      LOG(("M65c02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
440      LOG(("M65c02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), PCD));
441441      /* call back the cpuintrf to let it clear the line */
442442      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
443443   }
r7553r7554
468468      /* check if the I flag was just reset (interrupts enabled) */
469469      if( cpustate->after_cli )
470470      {
471         LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag.cstr()));
471         LOG(("M6502 '%s' after_cli was >0", cpustate->device->tag()));
472472         cpustate->after_cli = 0;
473473         if (cpustate->irq_state != CLEAR_LINE)
474474         {
r7553r7554
497497      cpustate->nmi_state = state;
498498      if( state != CLEAR_LINE )
499499      {
500         LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
500         LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
501501         EAD = M6502_NMI_VEC;
502502         cpustate->icount -= 2;
503503         PUSH(PCH);
r7553r7554
506506         P = (P & ~F_D) | F_I;      /* knock out D and set I flag */
507507         PCL = RDMEM(EAD);
508508         PCH = RDMEM(EAD+1);
509         LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
509         LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag(), PCD));
510510      }
511511   }
512512   else
r7553r7554
562562      P |= F_I;      /* set I flag */
563563      PCL = RDMEM(EAD+1);
564564      PCH = RDMEM(EAD);
565      LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
565      LOG(("M6502 '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), PCD));
566566      /* call back the cpuintrf to let it clear the line */
567567      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
568568   }
r7553r7554
577577      cpustate->nmi_state = state;
578578      if( state != CLEAR_LINE )
579579      {
580         LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
580         LOG(( "M6502 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
581581         EAD = DECO16_NMI_VEC;
582582         cpustate->icount -= 7;
583583         PUSH(PCH);
r7553r7554
586586         P |= F_I;      /* set I flag */
587587         PCL = RDMEM(EAD+1);
588588         PCH = RDMEM(EAD);
589         LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
589         LOG(("M6502 '%s' takes NMI ($%04x)\n", cpustate->device->tag(), PCD));
590590      }
591591   }
592592   else
r7553r7554
595595      {
596596         if( cpustate->so_state && !state )
597597         {
598            LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag.cstr()));
598            LOG(( "M6502 '%s' set overflow\n", cpustate->device->tag()));
599599            P|=F_V;
600600         }
601601         cpustate->so_state=state;
r7553r7554
604604      cpustate->irq_state = state;
605605      if( state != CLEAR_LINE )
606606      {
607         LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
607         LOG(( "M6502 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
608608         cpustate->pending_irq = 1;
609609      }
610610   }
r7553r7554
634634      /* check if the I flag was just reset (interrupts enabled) */
635635      if( cpustate->after_cli )
636636      {
637         LOG(("M6502 %s after_cli was >0", cpustate->device->tag.cstr()));
637         LOG(("M6502 %s after_cli was >0", cpustate->device->tag()));
638638         cpustate->after_cli = 0;
639639         if (cpustate->irq_state != CLEAR_LINE)
640640         {
src/emu/cpu/m6502/m6509.c
r7553r7554
200200      P |= F_I;      /* knock out D and set I flag */
201201      PCL = RDMEM(EAD);
202202      PCH = RDMEM(EAD+1);
203      LOG(("M6509 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
203      LOG(("M6509 '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), PCD));
204204      /* call back the cpuintrf to let it clear the line */
205205      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
206206   }
r7553r7554
230230      /* check if the I flag was just reset (interrupts enabled) */
231231      if( cpustate->after_cli )
232232      {
233         LOG(("M6509 '%s' after_cli was >0", cpustate->device->tag.cstr()));
233         LOG(("M6509 '%s' after_cli was >0", cpustate->device->tag()));
234234         cpustate->after_cli = 0;
235235         if (cpustate->irq_state != CLEAR_LINE)
236236         {
r7553r7554
259259      cpustate->nmi_state = state;
260260      if( state != CLEAR_LINE )
261261      {
262         LOG(( "M6509 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
262         LOG(( "M6509 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
263263         EAD = M6509_NMI_VEC;
264264         EAWH = PBWH;
265265         cpustate->icount -= 2;
r7553r7554
269269         P |= F_I;      /* knock out D and set I flag */
270270         PCL = RDMEM(EAD);
271271         PCH = RDMEM(EAD+1);
272         LOG(("M6509 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
272         LOG(("M6509 '%s' takes NMI ($%04x)\n", cpustate->device->tag(), PCD));
273273      }
274274   }
275275   else
r7553r7554
278278      {
279279         if( cpustate->so_state && !state )
280280         {
281            LOG(( "M6509 '%s' set overflow\n", cpustate->device->tag.cstr()));
281            LOG(( "M6509 '%s' set overflow\n", cpustate->device->tag()));
282282            P|=F_V;
283283         }
284284         cpustate->so_state=state;
r7553r7554
287287      cpustate->irq_state = state;
288288      if( state != CLEAR_LINE )
289289      {
290         LOG(( "M6509 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
290         LOG(( "M6509 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
291291         cpustate->pending_irq = 1;
292292      }
293293   }
src/emu/cpu/m6502/opsce02.h
r7553r7554
676676      PULL(temp);                        \
677677      P=(P&F_E)|F_B|(temp&~F_E);                  \
678678      if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) {         \
679         LOG(("M65ce02 '%s' PLP sets after_cli\n", cpustate->device->tag.cstr()));   \
679         LOG(("M65ce02 '%s' PLP sets after_cli\n", cpustate->device->tag()));   \
680680         AFTER_CLI = 1;                  \
681681      }                           \
682682   } else {                           \
r7553r7554
756756   PULL(PCH);                           \
757757   if( IRQ_STATE != CLEAR_LINE && !(P & F_I) )            \
758758   {                              \
759      LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag.cstr()));      \
759      LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag()));      \
760760      AFTER_CLI = 1;                     \
761761   }
762762
r7553r7554
787787   PULL(PCL);                           \
788788   PULL(PCH);                           \
789789   if( IRQ_STATE != CLEAR_LINE && !(P & F_I) ) {            \
790   LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag.cstr()));         \
790   LOG(("M65ce02 '%s' RTI sets after_cli\n", cpustate->device->tag()));         \
791791      AFTER_CLI = 1;                     \
792792   }
793793
src/emu/cpu/m6502/m65ce02.c
r7553r7554
159159      P = (P & ~F_D) | F_I;      /* knock out D and set I flag */
160160      PCL = RDMEM(EAD);
161161      PCH = RDMEM(EAD+1);
162      LOG(("M65ce02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), PCD));
162      LOG(("M65ce02 '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), PCD));
163163      /* call back the cpuintrf to let it clear the line */
164164      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, 0);
165165   }
r7553r7554
189189      /* check if the I flag was just reset (interrupts enabled) */
190190      if( cpustate->after_cli )
191191      {
192         LOG(("M65ce02 '%s' after_cli was >0", cpustate->device->tag.cstr()));
192         LOG(("M65ce02 '%s' after_cli was >0", cpustate->device->tag()));
193193         cpustate->after_cli = 0;
194194         if (cpustate->irq_state != CLEAR_LINE)
195195         {
r7553r7554
218218      cpustate->nmi_state = state;
219219      if( state != CLEAR_LINE )
220220      {
221         LOG(("M65ce02 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
221         LOG(("M65ce02 '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
222222         EAD = M65CE02_NMI_VEC;
223223         cpustate->icount -= 7;
224224         PUSH(PCH);
r7553r7554
227227         P = (P & ~F_D) | F_I;      /* knock out D and set I flag */
228228         PCL = RDMEM(EAD);
229229         PCH = RDMEM(EAD+1);
230         LOG(("M65ce02 '%s' takes NMI ($%04x)\n", cpustate->device->tag.cstr(), PCD));
230         LOG(("M65ce02 '%s' takes NMI ($%04x)\n", cpustate->device->tag(), PCD));
231231      }
232232   }
233233   else
r7553r7554
235235      cpustate->irq_state = state;
236236      if( state != CLEAR_LINE )
237237      {
238         LOG(("M65ce02 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
238         LOG(("M65ce02 '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
239239         cpustate->pending_irq = 1;
240240      }
241241   }
src/emu/cpu/z8000/z8000.c
r7553r7554
233233            cpustate->irq_req = type;
234234            break;
235235        case Z8000_SYSCALL >> 8:
236            LOG(("Z8K '%s' SYSCALL $%02x\n", cpustate->device->tag.cstr(), type & 0xff));
236            LOG(("Z8K '%s' SYSCALL $%02x\n", cpustate->device->tag(), type & 0xff));
237237            cpustate->irq_req = type;
238238            break;
239239        default:
r7553r7554
271271        cpustate->irq_srv = cpustate->irq_req;
272272        cpustate->irq_req &= ~Z8000_TRAP;
273273        cpustate->pc = TRAP;
274        LOG(("Z8K '%s' trap $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
274        LOG(("Z8K '%s' trap $%04x\n", cpustate->device->tag(), cpustate->pc));
275275    }
276276    else
277277    if (cpustate->irq_req & Z8000_SYSCALL)
r7553r7554
283283        cpustate->irq_srv = cpustate->irq_req;
284284        cpustate->irq_req &= ~Z8000_SYSCALL;
285285        cpustate->pc = SYSCALL;
286        LOG(("Z8K '%s' syscall $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
286        LOG(("Z8K '%s' syscall $%04x\n", cpustate->device->tag(), cpustate->pc));
287287    }
288288    else
289289    if (cpustate->irq_req & Z8000_SEGTRAP)
r7553r7554
295295        cpustate->irq_srv = cpustate->irq_req;
296296        cpustate->irq_req &= ~Z8000_SEGTRAP;
297297        cpustate->pc = SEGTRAP;
298        LOG(("Z8K '%s' segtrap $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
298        LOG(("Z8K '%s' segtrap $%04x\n", cpustate->device->tag(), cpustate->pc));
299299    }
300300    else
301301    if (cpustate->irq_req & Z8000_NMI)
r7553r7554
310310        cpustate->irq_req &= ~Z8000_NMI;
311311        CHANGE_FCW(cpustate, fcw);
312312        cpustate->pc = NMI;
313        LOG(("Z8K '%s' NMI $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
313        LOG(("Z8K '%s' NMI $%04x\n", cpustate->device->tag(), cpustate->pc));
314314    }
315315    else
316316    if ((cpustate->irq_req & Z8000_NVI) && (cpustate->fcw & F_NVIE))
r7553r7554
324324        cpustate->pc = RDMEM_W(cpustate,  NVI + 2);
325325        cpustate->irq_req &= ~Z8000_NVI;
326326        CHANGE_FCW(cpustate, fcw);
327        LOG(("Z8K '%s' NVI $%04x\n", cpustate->device->tag.cstr(), cpustate->pc));
327        LOG(("Z8K '%s' NVI $%04x\n", cpustate->device->tag(), cpustate->pc));
328328    }
329329    else
330330    if ((cpustate->irq_req & Z8000_VI) && (cpustate->fcw & F_VIE))
r7553r7554
338338        cpustate->pc = RDMEM_W(cpustate,  VEC00 + 2 * (cpustate->irq_req & 0xff));
339339        cpustate->irq_req &= ~Z8000_VI;
340340        CHANGE_FCW(cpustate, fcw);
341        LOG(("Z8K '%s' VI [$%04x/$%04x] fcw $%04x, pc $%04x\n", cpustate->device->tag.cstr(), cpustate->irq_vec, VEC00 + VEC00 + 2 * (cpustate->irq_req & 0xff), cpustate->fcw, cpustate->pc));
341        LOG(("Z8K '%s' VI [$%04x/$%04x] fcw $%04x, pc $%04x\n", cpustate->device->tag(), cpustate->irq_vec, VEC00 + VEC00 + 2 * (cpustate->irq_req & 0xff), cpustate->fcw, cpustate->pc));
342342    }
343343}
344344
src/emu/cpu/z8000/z8000ops.c
r7553r7554
15301530static void Z0E_imm8(z8000_state *cpustate)
15311531{
15321532   GET_IMM8(0);
1533   LOG(("Z8K '%s' %04x: ext0e  $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
1533   LOG(("Z8K '%s' %04x: ext0e  $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
15341534    if (cpustate->fcw & F_EPU) {
15351535      /* Z8001 EPU code goes here */
15361536      (void)imm8;
r7553r7554
15441544static void Z0F_imm8(z8000_state *cpustate)
15451545{
15461546   GET_IMM8(0);
1547   LOG(("Z8K '%s' %04x: ext0f  $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
1547   LOG(("Z8K '%s' %04x: ext0f  $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
15481548    if (cpustate->fcw & F_EPU) {
15491549      /* Z8001 EPU code goes here */
15501550      (void)imm8;
r7553r7554
22722272static void Z36_imm8(z8000_state *cpustate)
22732273{
22742274   GET_IMM8(0);
2275   LOG(("Z8K '%s' %04x: rsvd36 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
2275   LOG(("Z8K '%s' %04x: rsvd36 $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
22762276    if (cpustate->fcw & F_EPU) {
22772277      /* Z8001 EPU code goes here */
22782278      (void)imm8;
r7553r7554
23102310static void Z38_imm8(z8000_state *cpustate)
23112311{
23122312   GET_IMM8(0);
2313   LOG(("Z8K '%s' %04x: rsvd38 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
2313   LOG(("Z8K '%s' %04x: rsvd38 $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
23142314    if (cpustate->fcw & F_EPU) {
23152315      /* Z8001 EPU code goes here */
23162316      (void)imm8;
r7553r7554
43474347static void Z78_imm8(z8000_state *cpustate)
43484348{
43494349   GET_IMM8(0);
4350   LOG(("Z8K '%s' %04x: rsvd78 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
4350   LOG(("Z8K '%s' %04x: rsvd78 $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
43514351    if (cpustate->fcw & F_EPU) {
43524352      /* Z8001 EPU code goes here */
43534353      (void)imm8;
r7553r7554
44044404   cpustate->pc   = POPW(cpustate, SP);   /* get cpustate->pc   */
44054405    cpustate->irq_srv &= ~tag;    /* remove IRQ serviced flag */
44064406   CHANGE_FCW(cpustate, fcw);       /* check for user/system mode change */
4407   LOG(("Z8K '%s' IRET tag $%04x, fcw $%04x, pc $%04x\n", cpustate->device->tag.cstr(), tag, fcw, cpustate->pc));
4407   LOG(("Z8K '%s' IRET tag $%04x, fcw $%04x, pc $%04x\n", cpustate->device->tag(), tag, fcw, cpustate->pc));
44084408}
44094409
44104410/******************************************
r7553r7554
44894489         cpustate->RW(dst) = cpustate->nsp;
44904490         break;
44914491      default:
4492         LOG(("Z8K '%s' LDCTL R%d,%d\n", cpustate->device->tag.cstr(), dst, imm3));
4492         LOG(("Z8K '%s' LDCTL R%d,%d\n", cpustate->device->tag(), dst, imm3));
44934493    }
44944494}
44954495
r7553r7554
45194519         cpustate->nsp = cpustate->RW(src);
45204520         break;
45214521      default:
4522         LOG(("Z8K '%s' LDCTL %d,R%d\n", cpustate->device->tag.cstr(), imm3, src));
4522         LOG(("Z8K '%s' LDCTL %d,R%d\n", cpustate->device->tag(), imm3, src));
45234523    }
45244524}
45254525
r7553r7554
45304530static void Z7E_imm8(z8000_state *cpustate)
45314531{
45324532   GET_IMM8(0);
4533   LOG(("Z8K '%s' %04x: rsvd7e $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
4533   LOG(("Z8K '%s' %04x: rsvd7e $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
45344534    if (cpustate->fcw & F_EPU) {
45354535      /* Z8001 EPU code goes here */
45364536      (void)imm8;
r7553r7554
48264826static void Z8E_imm8(z8000_state *cpustate)
48274827{
48284828   GET_IMM8(0);
4829   LOG(("Z8K '%s' %04x: ext8e  $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
4829   LOG(("Z8K '%s' %04x: ext8e  $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
48304830    if (cpustate->fcw & F_EPU) {
48314831      /* Z8001 EPU code goes here */
48324832      (void)imm8;
r7553r7554
48404840static void Z8F_imm8(z8000_state *cpustate)
48414841{
48424842   GET_IMM8(0);
4843   LOG(("Z8K '%s' %04x: ext8f  $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
4843   LOG(("Z8K '%s' %04x: ext8f  $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
48444844    if (cpustate->fcw & F_EPU) {
48454845      /* Z8001 EPU code goes here */
48464846      (void)imm8;
r7553r7554
49984998static void Z9D_imm8(z8000_state *cpustate)
49994999{
50005000   GET_IMM8(0);
5001   LOG(("Z8K '%s' %04x: rsvd9d $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
5001   LOG(("Z8K '%s' %04x: rsvd9d $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
50025002    if (cpustate->fcw & F_EPU) {
50035003      /* Z8001 EPU code goes here */
50045004      (void)imm8;
r7553r7554
50395039static void Z9F_imm8(z8000_state *cpustate)
50405040{
50415041   GET_IMM8(0);
5042   LOG(("Z8K '%s' %04x: rsvd9f $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
5042   LOG(("Z8K '%s' %04x: rsvd9f $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
50435043    if (cpustate->fcw & F_EPU) {
50445044      /* Z8001 EPU code goes here */
50455045      (void)imm8;
r7553r7554
57405740static void ZB9_imm8(z8000_state *cpustate)
57415741{
57425742   GET_IMM8(0);
5743   LOG(("Z8K '%s' %04x: rsvdb9 $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
5743   LOG(("Z8K '%s' %04x: rsvdb9 $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
57445744    if (cpustate->fcw & F_EPU) {
57455745      /* Z8001 EPU code goes here */
57465746      (void)imm8;
r7553r7554
63986398static void ZBF_imm8(z8000_state *cpustate)
63996399{
64006400   GET_IMM8(0);
6401   LOG(("Z8K '%s' %04x: rsvdbf $%02x\n", cpustate->device->tag.cstr(), cpustate->pc, imm8));
6401   LOG(("Z8K '%s' %04x: rsvdbf $%02x\n", cpustate->device->tag(), cpustate->pc, imm8));
64026402    if (cpustate->fcw & F_EPU) {
64036403      /* Z8001 EPU code goes here */
64046404      (void)imm8;
src/emu/cpu/sh2/sh2comn.c
r7553r7554
101101         sh2->frc_base = cpu_get_total_cycles(sh2->device);
102102         timer_adjust_oneshot(sh2->timer, cpu_clocks_to_attotime(sh2->device, max_delta), 0);
103103      } else {
104         logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag.cstr(), max_delta);
104         logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag(), max_delta);
105105      }
106106   }
107107}
r7553r7554
138138   int dma = param & 1;
139139   SH2 *sh2 = (SH2 *)ptr;
140140
141   LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag.cstr(), dma));
141   LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag(), dma));
142142   sh2->m[0x63+4*dma] |= 2;
143143   sh2->dma_timer_active[dma] = 0;
144144   sh2_recalc_irq(sh2);
r7553r7554
306306   case 0x04: // TIER, FTCSR, FRC
307307      if((mem_mask & 0x00ffffff) != 0)
308308         sh2_timer_resync(sh2);
309//      printf("SH2.%s: TIER write %04x @ %04x\n", sh2->device->tag.cstr(), data >> 16, mem_mask>>16);
309//      printf("SH2.%s: TIER write %04x @ %04x\n", sh2->device->tag(), data >> 16, mem_mask>>16);
310310      sh2->m[4] = (sh2->m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2->m[4] & (ICF|OCFA|OCFB|OVF));
311311      COMBINE_DATA(&sh2->frc);
312312      if((mem_mask & 0x00ffffff) != 0)
r7553r7554
314314      sh2_recalc_irq(sh2);
315315      break;
316316   case 0x05: // OCRx, TCR, TOCR
317//      printf("SH2.%s: TCR write %08x @ %08x\n", sh2->device->tag.cstr(), data, mem_mask);
317//      printf("SH2.%s: TCR write %08x @ %08x\n", sh2->device->tag(), data, mem_mask);
318318      sh2_timer_resync(sh2);
319319      if(sh2->m[5] & 0x10)
320320         sh2->ocrb = (sh2->ocrb & (~mem_mask >> 16)) | ((data & mem_mask) >> 16);
r7553r7554
358358      {
359359         INT32 a = sh2->m[0x41];
360360         INT32 b = sh2->m[0x40];
361         LOG(("SH2 '%s' div+mod %d/%d\n", sh2->device->tag.cstr(), a, b));
361         LOG(("SH2 '%s' div+mod %d/%d\n", sh2->device->tag(), a, b));
362362         if (b)
363363         {
364364            sh2->m[0x45] = a / b;
r7553r7554
386386      {
387387         INT64 a = sh2->m[0x45] | ((UINT64)(sh2->m[0x44]) << 32);
388388         INT64 b = (INT32)sh2->m[0x40];
389         LOG(("SH2 '%s' div+mod %" I64FMT "d/%" I64FMT "d\n", sh2->device->tag.cstr(), a, b));
389         LOG(("SH2 '%s' div+mod %" I64FMT "d/%" I64FMT "d\n", sh2->device->tag(), a, b));
390390         if (b)
391391         {
392392            INT64 q = a / b;
r7553r7554
536536   sh2_timer_resync(sh2);
537537   sh2->icr = sh2->frc;
538538   sh2->m[4] |= ICF;
539   logerror("SH2.%s: ICF activated (%x)\n", sh2->device->tag.cstr(), sh2->pc & AM);
539   logerror("SH2.%s: ICF activated (%x)\n", sh2->device->tag(), sh2->pc & AM);
540540   sh2_recalc_irq(sh2);
541541}
542542
r7553r7554
550550
551551      if( state == CLEAR_LINE )
552552      {
553         LOG(("SH-2 '%s' cleared nmi\n", sh2->device->tag.cstr()));
553         LOG(("SH-2 '%s' cleared nmi\n", sh2->device->tag()));
554554      }
555555      else
556556      {
557         LOG(("SH-2 '%s' assert nmi\n", sh2->device->tag.cstr()));
557         LOG(("SH-2 '%s' assert nmi\n", sh2->device->tag()));
558558
559559         sh2_exception(sh2, "Set IRQ line", 16);
560560
r7553r7554
571571
572572      if( state == CLEAR_LINE )
573573      {
574         LOG(("SH-2 '%s' cleared irq #%d\n", sh2->device->tag.cstr(), irqline));
574         LOG(("SH-2 '%s' cleared irq #%d\n", sh2->device->tag(), irqline));
575575         sh2->pending_irq &= ~(1 << irqline);
576576      }
577577      else
578578      {
579         LOG(("SH-2 '%s' assert irq #%d\n", sh2->device->tag.cstr(), irqline));
579         LOG(("SH-2 '%s' assert irq #%d\n", sh2->device->tag(), irqline));
580580         sh2->pending_irq |= 1 << irqline;
581581         #ifdef USE_SH2DRC
582582         sh2->test_irq = 1;
r7553r7554
647647      if (sh2->internal_irq_level == irqline)
648648      {
649649         vector = sh2->internal_irq_vector;
650         LOG(("SH-2 '%s' exception #%d (internal vector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
650         LOG(("SH-2 '%s' exception #%d (internal vector: $%x) after [%s]\n", sh2->device->tag(), irqline, vector, message));
651651      }
652652      else
653653      {
654654         if(sh2->m[0x38] & 0x00010000)
655655         {
656656            vector = sh2->irq_callback(sh2->device, irqline);
657            LOG(("SH-2 '%s' exception #%d (external vector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
657            LOG(("SH-2 '%s' exception #%d (external vector: $%x) after [%s]\n", sh2->device->tag(), irqline, vector, message));
658658         }
659659         else
660660         {
661661            sh2->irq_callback(sh2->device, irqline);
662662            vector = 64 + irqline/2;
663            LOG(("SH-2 '%s' exception #%d (autovector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
663            LOG(("SH-2 '%s' exception #%d (autovector: $%x) after [%s]\n", sh2->device->tag(), irqline, vector, message));
664664         }
665665      }
666666   }
667667   else
668668   {
669669      vector = 11;
670      LOG(("SH-2 '%s' nmi exception (autovector: $%x) after [%s]\n", sh2->device->tag.cstr(), vector, message));
670      LOG(("SH-2 '%s' nmi exception (autovector: $%x) after [%s]\n", sh2->device->tag(), vector, message));
671671   }
672672
673673   #ifdef USE_SH2DRC
src/emu/cpu/sh4/sh4comn.c
r7553r7554
179179      sh4->m[INTEVT] = 0x1c0;
180180      vector = 0x600;
181181      sh4->irq_callback(sh4->device, INPUT_LINE_NMI);
182      LOG(("SH-4 '%s' nmi exception after [%s]\n", sh4->device->tag.cstr(), message));
182      LOG(("SH-4 '%s' nmi exception after [%s]\n", sh4->device->tag(), message));
183183   } else {
184184//      if ((sh4->m[ICR] & 0x4000) && (sh4->nmi_line_state == ASSERT_LINE))
185185//          return;
r7553r7554
193193         sh4->irq_callback(sh4->device, SH4_INTC_IRL0-exception+SH4_IRL0);
194194      else
195195         sh4->irq_callback(sh4->device, SH4_IRL3+1);
196      LOG(("SH-4 '%s' interrupt exception #%d after [%s]\n", sh4->device->tag.cstr(), exception, message));
196      LOG(("SH-4 '%s' interrupt exception #%d after [%s]\n", sh4->device->tag(), exception, message));
197197   }
198198   sh4_exception_checkunrequest(sh4, exception);
199199
r7553r7554
407407   SH4 *sh4 = (SH4 *)ptr;
408408   int channel = param;
409409
410   LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag.cstr(), channel));
410   LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag(), channel));
411411   sh4->dma_timer_active[channel] = 0;
412412   switch (channel)
413413   {
r7553r7554
10281028   sh4_timer_resync();
10291029   sh4->icr = sh4->frc;
10301030   sh4->m[4] |= ICF;
1031   logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag.cstr(), sh4->pc & AM);
1031   logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag(), sh4->pc & AM);
10321032   sh4_recalc_irq();
10331033#endif
10341034}
r7553r7554
10561056      {
10571057         if ((state == CLEAR_LINE) && (sh4->nmi_line_state == ASSERT_LINE))  // rising
10581058         {
1059            LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag.cstr()));
1059            LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag()));
10601060            sh4_exception_request(sh4, SH4_INTC_NMI);
10611061            sh4_dmac_nmi(sh4);
10621062         }
r7553r7554
10651065      {
10661066         if ((state == ASSERT_LINE) && (sh4->nmi_line_state == CLEAR_LINE)) // falling
10671067         {
1068            LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag.cstr()));
1068            LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag()));
10691069            sh4_exception_request(sh4, SH4_INTC_NMI);
10701070            sh4_dmac_nmi(sh4);
10711071         }
r7553r7554
10881088
10891089         if( state == CLEAR_LINE )
10901090         {
1091            LOG(("SH-4 '%s' cleared external irq IRL%d\n", sh4->device->tag.cstr(), irqline));
1091            LOG(("SH-4 '%s' cleared external irq IRL%d\n", sh4->device->tag(), irqline));
10921092            sh4_exception_unrequest(sh4, SH4_INTC_IRL0+irqline-SH4_IRL0);
10931093         }
10941094         else
10951095         {
1096            LOG(("SH-4 '%s' assert external irq IRL%d\n", sh4->device->tag.cstr(), irqline));
1096            LOG(("SH-4 '%s' assert external irq IRL%d\n", sh4->device->tag(), irqline));
10971097            sh4_exception_request(sh4, SH4_INTC_IRL0+irqline-SH4_IRL0);
10981098         }
10991099      }
r7553r7554
11071107            sh4_exception_unrequest(sh4, SH4_INTC_IRLn0+s);
11081108         if (sh4->irln < 15)
11091109            sh4_exception_request(sh4, SH4_INTC_IRLn0+sh4->irln);
1110         LOG(("SH-4 '%s' IRLn0-IRLn3 level #%d\n", sh4->device->tag.cstr(), sh4->irln));
1110         LOG(("SH-4 '%s' IRLn0-IRLn3 level #%d\n", sh4->device->tag(), sh4->irln));
11111111      }
11121112   }
11131113   if (sh4->test_irq && (!sh4->delay))
src/emu/cpu/tms7000/tms7000.c
r7553r7554
366366   {   /* check for transition */
367367      cpustate->irq_state[irqline] = state;
368368
369      LOG(("tms7000: (cpu '%s') set_irq_line (INT%d, state %d)\n", cpustate->device->tag.cstr(), irqline+1, state));
369      LOG(("tms7000: (cpu '%s') set_irq_line (INT%d, state %d)\n", cpustate->device->tag(), irqline+1, state));
370370
371371      if (state == CLEAR_LINE)
372372      {
src/emu/cpu/z80/z80.c
r7553r7554
824824 ***************************************************************/
825825#define RETN(Z) do {                                 \
826826   LOG(("Z80 '%s' RETN z80->iff1:%d z80->iff2:%d\n",         \
827      (Z)->device->tag.cstr(), (Z)->iff1, (Z)->iff2));      \
827      (Z)->device->tag(), (Z)->iff1, (Z)->iff2));      \
828828   POP((Z), pc);                                    \
829829   (Z)->WZ = (Z)->PC;                                 \
830830   (Z)->iff1 = (Z)->iff2;                              \
r7553r7554
20932093
20942094OP(illegal,1) {
20952095   logerror("Z80 '%s' ill. opcode $%02x $%02x\n",
2096         z80->device->tag.cstr(), memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff), memory_decrypted_read_byte(z80->program, z80->PCD));
2096         z80->device->tag(), memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff), memory_decrypted_read_byte(z80->program, z80->PCD));
20972097}
20982098
20992099/**********************************************************
r7553r7554
26812681OP(illegal,2)
26822682{
26832683   logerror("Z80 '%s' ill. opcode $ed $%02x\n",
2684         z80->device->tag.cstr(), memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff));
2684         z80->device->tag(), memory_decrypted_read_byte(z80->program, (z80->PCD-1)&0xffff));
26852685}
26862686
26872687/**********************************************************
r7553r7554
32893289   else
32903290      irq_vector = (*z80->irq_callback)(z80->device, 0);
32913291
3292   LOG(("Z80 '%s' single int. irq_vector $%02x\n", z80->device->tag.cstr(), irq_vector));
3292   LOG(("Z80 '%s' single int. irq_vector $%02x\n", z80->device->tag(), irq_vector));
32933293
32943294   /* Interrupt mode 2. Call [i:databyte] */
32953295   if( z80->im == 2 )
r7553r7554
32973297      irq_vector = (irq_vector & 0xff) | (z80->i << 8);
32983298      PUSH(z80, pc);
32993299      RM16(z80, irq_vector, &z80->pc);
3300      LOG(("Z80 '%s' IM2 [$%04x] = $%04x\n", z80->device->tag.cstr(), irq_vector, z80->PCD));
3300      LOG(("Z80 '%s' IM2 [$%04x] = $%04x\n", z80->device->tag(), irq_vector, z80->PCD));
33013301      /* CALL opcode timing + 'interrupt latency' cycles */
33023302      z80->icount -= z80->cc_op[0xcd] + z80->cc_ex[0xff];
33033303   }
r7553r7554
33053305   /* Interrupt mode 1. RST 38h */
33063306   if( z80->im == 1 )
33073307   {
3308      LOG(("Z80 '%s' IM1 $0038\n", z80->device->tag.cstr()));
3308      LOG(("Z80 '%s' IM1 $0038\n", z80->device->tag()));
33093309      PUSH(z80, pc);
33103310      z80->PCD = 0x0038;
33113311      /* RST $38 + 'interrupt latency' cycles */
r7553r7554
33163316      /* Interrupt mode 0. We check for CALL and JP instructions, */
33173317      /* if neither of these were found we assume a 1 byte opcode */
33183318      /* was placed on the databus                                */
3319      LOG(("Z80 '%s' IM0 $%04x\n", z80->device->tag.cstr(), irq_vector));
3319      LOG(("Z80 '%s' IM0 $%04x\n", z80->device->tag(), irq_vector));
33203320
33213321      /* check for nop */
33223322      if (irq_vector != 0x00)
r7553r7554
35303530   /* to just check here */
35313531   if (z80->nmi_pending)
35323532   {
3533      LOG(("Z80 '%s' take NMI\n", z80->device->tag.cstr()));
3533      LOG(("Z80 '%s' take NMI\n", z80->device->tag()));
35343534      z80->PRVPC = -1;         /* there isn't a valid previous program counter */
35353535      LEAVE_HALT(z80);         /* Check if processor was halted */
35363536
src/emu/cpu/m6800/m6800.c
r7553r7554
546546/* IRQ enter */
547547static void enter_interrupt(m6800_state *cpustate, const char *message,UINT16 irq_vector)
548548{
549   LOG((message, cpustate->device->tag.cstr()));
549   LOG((message, cpustate->device->tag()));
550550   if( cpustate->wai_state & (M6800_WAI|M6800_SLP) )
551551   {
552552      if( cpustate->wai_state & M6800_WAI )
r7553r7554
965965   {
966966      //int eddge;
967967
968      LOG(("M6800 '%s' set_irq_line %d,%d\n", cpustate->device->tag.cstr(), irqline, state));
968      LOG(("M6800 '%s' set_irq_line %d,%d\n", cpustate->device->tag(), irqline, state));
969969      cpustate->irq_state[irqline] = state;
970970
971971      if (irqline == M6800_TIN_LINE && state != cpustate->irq_state[irqline])
r7553r7554
24112411      case 0x0e:
24122412         return (cpustate->input_capture >> 8) & 0xff;
24132413      case 0x0f:
2414         logerror("CPU '%s' PC %04x: warning - read from unsupported register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),offset);
2414         logerror("CPU '%s' PC %04x: warning - read from unsupported register %02x\n",space->cpu->tag(),cpu_get_pc(space->cpu),offset);
24152415         return 0;
24162416      case 0x10:
24172417         return cpustate->rmcr;
r7553r7554
24282428      case 0x13:
24292429         return cpustate->tdr;
24302430      case 0x14:
2431         logerror("CPU '%s' PC %04x: read RAM control register\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu));
2431         logerror("CPU '%s' PC %04x: read RAM control register\n",space->cpu->tag(),cpu_get_pc(space->cpu));
24322432         return cpustate->ram_ctrl;
24332433      case 0x15:
24342434      case 0x16:
r7553r7554
24422442      case 0x1e:
24432443      case 0x1f:
24442444      default:
2445         logerror("CPU '%s' PC %04x: warning - read from reserved internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),offset);
2445         logerror("CPU '%s' PC %04x: warning - read from reserved internal register %02x\n",space->cpu->tag(),cpu_get_pc(space->cpu),offset);
24462446         return 0;
24472447   }
24482448}
r7553r7554
24752475                  | (memory_read_byte_8be(cpustate->io, M6803_PORT2) & (cpustate->port2_ddr ^ 0xff)));
24762476
24772477            if (cpustate->port2_ddr & 2)
2478               logerror("CPU '%s' PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu));
2478               logerror("CPU '%s' PC %04x: warning - port 2 bit 1 set as output (OLVL) - not supported\n",space->cpu->tag(),cpu_get_pc(space->cpu));
24792479         }
24802480         break;
24812481      case 0x02:
r7553r7554
25742574      case 0x0d:
25752575      case 0x0e:
25762576      case 0x12:
2577         logerror("CPU '%s' PC %04x: warning - write %02x to read only internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data,offset);
2577         logerror("CPU '%s' PC %04x: warning - write %02x to read only internal register %02x\n",space->cpu->tag(),cpu_get_pc(space->cpu),data,offset);
25782578         break;
25792579      case 0x0f:
2580         logerror("CPU '%s' PC %04x: warning - write %02x to unsupported internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data,offset);
2580         logerror("CPU '%s' PC %04x: warning - write %02x to unsupported internal register %02x\n",space->cpu->tag(),cpu_get_pc(space->cpu),data,offset);
25812581         break;
25822582      case 0x10:
25832583         cpustate->rmcr = data & 0x0f;
r7553r7554
26172617         cpustate->tdr = data;
26182618         break;
26192619      case 0x14:
2620         logerror("CPU '%s' PC %04x: write %02x to RAM control register\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data);
2620         logerror("CPU '%s' PC %04x: write %02x to RAM control register\n",space->cpu->tag(),cpu_get_pc(space->cpu),data);
26212621         cpustate->ram_ctrl = data;
26222622         break;
26232623      case 0x15:
r7553r7554
26322632      case 0x1e:
26332633      case 0x1f:
26342634      default:
2635         logerror("CPU '%s' PC %04x: warning - write %02x to reserved internal register %02x\n",space->cpu->tag.cstr(),cpu_get_pc(space->cpu),data,offset);
2635         logerror("CPU '%s' PC %04x: warning - write %02x to reserved internal register %02x\n",space->cpu->tag(),cpu_get_pc(space->cpu),data,offset);
26362636         break;
26372637   }
26382638}
src/emu/cpu/saturn/sattable.c
r7553r7554
3838static void saturn_invalid3( saturn_state *cpustate, int op1, int op2, int op3 )
3939{
4040   logerror( "SATURN '%s' invalid opcode %x%x%x at %05x\n",
41        cpustate->device->tag.cstr(), op1, op2, op3, cpustate->pc-3 );
41        cpustate->device->tag(), op1, op2, op3, cpustate->pc-3 );
4242}
4343
4444static void saturn_invalid4( saturn_state *cpustate, int op1, int op2, int op3, int op4 )
4545{
4646   logerror( "SATURN '%s' invalid opcode %x%x%x%x at %05x\n",
47        cpustate->device->tag.cstr(), op1, op2, op3, op4, cpustate->pc-4 );
47        cpustate->device->tag(), op1, op2, op3, op4, cpustate->pc-4 );
4848}
4949
5050static void saturn_invalid5( saturn_state *cpustate, int op1, int op2, int op3, int op4, int op5 )
5151{
5252   logerror( "SATURN '%s' invalid opcode %x%x%x%x%x at %05x\n",
53        cpustate->device->tag.cstr(), op1, op2, op3, op4, op5, cpustate->pc-5 );
53        cpustate->device->tag(), op1, op2, op3, op4, op5, cpustate->pc-5 );
5454}
5555
5656static void saturn_invalid6( saturn_state *cpustate, int op1, int op2, int op3, int op4, int op5, int op6 )
5757{
5858   logerror( "SATURN '%s' invalid opcode %x%x%x%x%x%x at %05x\n",
59        cpustate->device->tag.cstr(), op1, op2, op3, op4, op5, op6, cpustate->pc-6 );
59        cpustate->device->tag(), op1, op2, op3, op4, op5, op6, cpustate->pc-6 );
6060}
6161
6262
src/emu/cpu/saturn/satops.c
r7553r7554
11#define IRQ_ADDRESS   0xf
22
33#define saturn_assert(x) \
4   do { if (!(x)) logerror("SATURN '%s' assertion failed: %s at %s:%i, pc=%05x\n", cpustate->device->tag.cstr(), #x, __FILE__, __LINE__, cpustate->pc); } while (0)
4   do { if (!(x)) logerror("SATURN '%s' assertion failed: %s at %s:%i, pc=%05x\n", cpustate->device->tag(), #x, __FILE__, __LINE__, cpustate->pc); } while (0)
55
66INLINE int READ_OP(saturn_state *cpustate)
77{
r7553r7554
186186
187187INLINE void saturn_interrupt_on(saturn_state *cpustate)
188188{
189   LOG(( "SATURN '%s' at %05x: INTON\n", cpustate->device->tag.cstr(), cpustate->pc-4 ));
189   LOG(( "SATURN '%s' at %05x: INTON\n", cpustate->device->tag(), cpustate->pc-4 ));
190190   cpustate->irq_enable=1;
191191   if (cpustate->irq_state)
192192   {
193      LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
193      LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
194194      cpustate->pending_irq=1;
195195   }
196196}
197197
198198INLINE void saturn_interrupt_off(saturn_state *cpustate)
199199{
200   LOG(( "SATURN '%s' at %05x: INTOFF\n", cpustate->device->tag.cstr(), cpustate->pc-4 ));
200   LOG(( "SATURN '%s' at %05x: INTOFF\n", cpustate->device->tag(), cpustate->pc-4 ));
201201   cpustate->irq_enable=0;
202202}
203203
204204INLINE void saturn_reset_interrupt(saturn_state *cpustate)
205205{
206   LOG(( "SATURN '%s' at %05x: RSI\n", cpustate->device->tag.cstr(), cpustate->pc-5 ));
206   LOG(( "SATURN '%s' at %05x: RSI\n", cpustate->device->tag(), cpustate->pc-5 ));
207207   if (cpustate->config&&cpustate->config->rsi) cpustate->config->rsi(cpustate->device);
208208}
209209
r7553r7554
234234{
235235   cpustate->sleeping=1;
236236   cpustate->irq_enable=1;
237   LOG(( "SATURN '%s' at %05x: SHUTDN\n", cpustate->device->tag.cstr(), cpustate->pc-3 ));
237   LOG(( "SATURN '%s' at %05x: SHUTDN\n", cpustate->device->tag(), cpustate->pc-3 ));
238238}
239239
240240INLINE void saturn_bus_command_b(saturn_state *cpustate)
241241{
242   logerror( "SATURN '%s' at %05x: BUSCB opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-4 );
242   logerror( "SATURN '%s' at %05x: BUSCB opcode not handled\n", cpustate->device->tag(), cpustate->pc-4 );
243243}
244244
245245INLINE void saturn_bus_command_c(saturn_state *cpustate)
246246{
247   logerror( "SATURN '%s' at %05x: BUSCC opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-3 );
247   logerror( "SATURN '%s' at %05x: BUSCC opcode not handled\n", cpustate->device->tag(), cpustate->pc-3 );
248248}
249249
250250INLINE void saturn_bus_command_d(saturn_state *cpustate)
251251{
252   logerror( "SATURN '%s' at %05x: BUSCD opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-4 );
252   logerror( "SATURN '%s' at %05x: BUSCD opcode not handled\n", cpustate->device->tag(), cpustate->pc-4 );
253253}
254254
255255INLINE void saturn_serial_request(saturn_state *cpustate)
256256{
257   logerror( "SATURN '%s' at %05x: SREQ? opcode not handled\n", cpustate->device->tag.cstr(), cpustate->pc-3 );
257   logerror( "SATURN '%s' at %05x: SREQ? opcode not handled\n", cpustate->device->tag(), cpustate->pc-3 );
258258}
259259
260260INLINE void saturn_out_c(saturn_state *cpustate)
r7553r7554
275275   saturn_assert(reg>=0 && reg<9);
276276   if (!(cpustate->pc&1))
277277      logerror( "SATURN '%s' at %05x: reg=IN opcode at odd addresse\n",
278           cpustate->device->tag.cstr(), cpustate->pc-3 );
278           cpustate->device->tag(), cpustate->pc-3 );
279279   if (cpustate->config&&cpustate->config->in) in = cpustate->config->in(cpustate->device);
280280   S64_WRITE_WORD(cpustate, reg,in);
281281   cpustate->monitor_in = in;
r7553r7554
459459
460460INLINE void saturn_return_interrupt(saturn_state *cpustate)
461461{
462   LOG(( "SATURN '%s' at %05x: RTI\n", cpustate->device->tag.cstr(), cpustate->pc-2 ));
462   LOG(( "SATURN '%s' at %05x: RTI\n", cpustate->device->tag(), cpustate->pc-2 ));
463463   cpustate->in_irq=0; /* set to 1 when an IRQ is taken */
464464   cpustate->pc=saturn_pop(cpustate);
465465//  cpustate->icount-=10;
src/emu/cpu/saturn/saturn.c
r7553r7554
162162   saturn_push(cpustate, cpustate->pc);
163163   cpustate->pc=IRQ_ADDRESS;
164164
165   LOG(("Saturn '%s' takes IRQ ($%04x)\n", cpustate->device->tag.cstr(), cpustate->pc));
165   LOG(("Saturn '%s' takes IRQ ($%04x)\n", cpustate->device->tag(), cpustate->pc));
166166
167167   if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, SATURN_IRQ_LINE);
168168}
r7553r7554
206206   cpustate->nmi_state = state;
207207   if ( state != CLEAR_LINE )
208208   {
209      LOG(( "SATURN '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag.cstr()));
209      LOG(( "SATURN '%s' set_nmi_line(ASSERT)\n", cpustate->device->tag()));
210210      cpustate->pending_irq = 1;
211211   }
212212}
r7553r7554
217217   cpustate->irq_state = state;
218218   if ( state != CLEAR_LINE && cpustate->irq_enable )
219219   {
220      LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag.cstr()));
220      LOG(( "SATURN '%s' set_irq_line(ASSERT)\n", cpustate->device->tag()));
221221      cpustate->pending_irq = 1;
222222   }
223223}
r7553r7554
226226{
227227   if (cpustate->sleeping && state==1)
228228   {
229      LOG(( "SATURN '%s' set_wakeup_line(ASSERT)\n", cpustate->device->tag.cstr()));
229      LOG(( "SATURN '%s' set_wakeup_line(ASSERT)\n", cpustate->device->tag()));
230230      if (cpustate->irq_callback) (*cpustate->irq_callback)(cpustate->device, SATURN_WAKEUP_LINE);
231231      cpustate->sleeping = 0;
232232   }
src/emu/devcb.c
r7553r7554
4343   {
4444      resolved->target = device->machine->port(config->tag);
4545      if (resolved->target == NULL)
46         fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
46         fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
4747      resolved->read = trampoline_read_port_to_read_line;
4848   }
4949
r7553r7554
5959         cpu = device->machine->device(config->tag);
6060
6161      if (cpu == NULL)
62         fatalerror("devcb_resolve_read_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
62         fatalerror("devcb_resolve_read_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
6363      resolved->target = resolved;
6464      resolved->read = trampoline_read8_to_read_line;
6565      resolved->realtarget = cpu->space(spacenum);
6666      if (resolved->realtarget == NULL)
67         fatalerror("devcb_resolve_read_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag.cstr());
67         fatalerror("devcb_resolve_read_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag());
6868      resolved->real.readspace = config->readspace;
6969   }
7070
r7553r7554
8080         resolved->target = device->machine->device(config->tag);
8181
8282      if (resolved->target == NULL)
83         fatalerror("devcb_resolve_read_line: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
83         fatalerror("devcb_resolve_read_line: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
8484
8585      /* read_line to read_line is direct */
8686      if (config->readline != NULL)
r7553r7554
130130   {
131131      resolved->target = device->machine->port(config->tag);
132132      if (resolved->target == NULL)
133         fatalerror("devcb_resolve_write_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
133         fatalerror("devcb_resolve_write_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
134134      resolved->write = trampoline_write_port_to_write_line;
135135   }
136136
r7553r7554
146146         cpu = device->machine->device(config->tag);
147147
148148      if (cpu == NULL)
149         fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
149         fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
150150      resolved->target = resolved;
151151      resolved->write = trampoline_write8_to_write_line;
152152      resolved->realtarget = cpu->space(spacenum);
153153      if (resolved->realtarget == NULL)
154         fatalerror("devcb_resolve_write_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag.cstr());
154         fatalerror("devcb_resolve_write_line: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag());
155155      resolved->real.writespace = config->writespace;
156156   }
157157
r7553r7554
167167         cpu = device->machine->device(config->tag);
168168
169169      if (cpu == NULL)
170         fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
170         fatalerror("devcb_resolve_write_line: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
171171      resolved->target = resolved;
172172      resolved->write = trampoline_writecpu_to_write_line;
173173      resolved->realtarget = cpu;
r7553r7554
186186         resolved->target = device->machine->device(config->tag);
187187
188188      if (resolved->target == NULL)
189         fatalerror("devcb_resolve_write_line: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
189         fatalerror("devcb_resolve_write_line: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
190190
191191      /* write_line to write_line is direct */
192192      if (config->writeline != NULL)
r7553r7554
230230   {
231231      resolved->target = device->machine->port(config->tag);
232232      if (resolved->target == NULL)
233         fatalerror("devcb_resolve_read8: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
233         fatalerror("devcb_resolve_read8: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
234234      resolved->read = trampoline_read_port_to_read8;
235235   }
236236
r7553r7554
246246         cpu = device->machine->device(config->tag);
247247
248248      if (cpu == NULL)
249         fatalerror("devcb_resolve_read8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
249         fatalerror("devcb_resolve_read8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
250250      resolved->target = cpu->space(spacenum);
251251      if (resolved->target == NULL)
252         fatalerror("devcb_resolve_read8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag.cstr());
252         fatalerror("devcb_resolve_read8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag());
253253      resolved->read = (read8_device_func)config->readspace;
254254   }
255255
r7553r7554
258258   {
259259      resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : device->machine->device(config->tag);
260260      if (resolved->target == NULL)
261         fatalerror("devcb_resolve_read8: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
261         fatalerror("devcb_resolve_read8: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
262262
263263      /* read8 to read8 is direct */
264264      if (config->readdevice != NULL)
r7553r7554
301301   {
302302      resolved->target = device->machine->port(config->tag);
303303      if (resolved->target == NULL)
304         fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
304         fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
305305      resolved->write = trampoline_write_port_to_write8;
306306   }
307307
r7553r7554
317317         cpu = device->machine->device(config->tag);
318318
319319      if (cpu == NULL)
320         fatalerror("devcb_resolve_write8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
320         fatalerror("devcb_resolve_write8: unable to find CPU '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
321321      resolved->target = cpu->space(spacenum);
322322      if (resolved->target == NULL)
323         fatalerror("devcb_resolve_write8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag.cstr());
323         fatalerror("devcb_resolve_write8: unable to find CPU '%s' %s space (requested by %s '%s')", config->tag, address_space_names[spacenum], device->name(), device->tag());
324324      resolved->write = (write8_device_func)config->writespace;
325325   }
326326
r7553r7554
329329   {
330330      resolved->target = (config->type == DEVCB_TYPE_SELF) ? device : device->machine->device(config->tag);
331331      if (resolved->target == NULL)
332         fatalerror("devcb_resolve_write8: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag.cstr());
332         fatalerror("devcb_resolve_write8: unable to find device '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
333333
334334      /* write8 to write8 is direct */
335335      if (config->writedevice != NULL)
src/emu/video/voodoo.c
r7553r7554
45384538   }
45394539
45404540   /* set the type, and initialize the chip mask */
4541   v->index = device->machine->devicelist.index(device->type, device->tag);
4541   v->index = device->machine->devicelist.index(device->type, device->tag());
45424542   v->screen = device->machine->device(config->screen);
45434543   assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
45444544   v->cpu = device->machine->device(config->cputag);
src/emu/info.c
r7553r7554
633633   {
634634      fprintf(out, "\t\t<chip");
635635      fprintf(out, " type=\"cpu\"");
636      fprintf(out, " tag=\"%s\"", xml_normalize_string(devconfig->tag));
636      fprintf(out, " tag=\"%s\"", xml_normalize_string(devconfig->tag()));
637637      fprintf(out, " name=\"%s\"", xml_normalize_string(devconfig->name()));
638638      fprintf(out, " clock=\"%d\"", devconfig->clock);
639639      fprintf(out, "/>\n");
r7553r7554
644644   {
645645      fprintf(out, "\t\t<chip");
646646      fprintf(out, " type=\"audio\"");
647      fprintf(out, " tag=\"%s\"", xml_normalize_string(devconfig->tag));
647      fprintf(out, " tag=\"%s\"", xml_normalize_string(devconfig->tag()));
648648      fprintf(out, " name=\"%s\"", xml_normalize_string(devconfig->name()));
649649      if (devconfig->clock != 0)
650650         fprintf(out, " clock=\"%d\"", devconfig->clock);
src/emu/video.c
r7553r7554
610610   /* validate arguments */
611611   assert(scanline >= 0);
612612
613   LOG_PARTIAL_UPDATES(("Partial: video_screen_update_partial(%s, %d): ", screen->tag.cstr(), scanline));
613   LOG_PARTIAL_UPDATES(("Partial: video_screen_update_partial(%s, %d): ", screen->tag(), scanline));
614614
615615   /* these two checks only apply if we're allowed to skip frames */
616616   if (!(screen->machine->config->video_attributes & VIDEO_ALWAYS_UPDATE))
r7553r7554
20782078   /* select the appropriate view in our dummy target */
20792079   if (global.snap_native && screen != NULL)
20802080   {
2081      view_index = screen->machine->devicelist.index(VIDEO_SCREEN, screen->tag.cstr());
2081      view_index = screen->machine->devicelist.index(VIDEO_SCREEN, screen->tag());
20822082      assert(view_index != -1);
20832083      render_target_set_view(global.snap_target, view_index);
20842084   }
r7553r7554
25872587      /* write the final PNG */
25882588
25892589      /* compute the name and create the file */
2590      fname.printf("%s" PATH_SEPARATOR "burnin-%s.png", screen->machine->basename, screen->tag.cstr());
2590      fname.printf("%s" PATH_SEPARATOR "burnin-%s.png", screen->machine->basename, screen->tag());
25912591      filerr = mame_fopen(SEARCHPATH_SCREENSHOT, fname, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &file);
25922592      if (filerr == FILERR_NONE)
25932593      {
src/emu/memory.c
r7553r7554
913913
914914         /* fatal error if the decrypted region straddles the bank */
915915         else if (bank->bytestart < byteend && bank->byteend > bytestart)
916            fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag.cstr());
916            fatalerror("memory_set_decrypted_region found straddled region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag());
917917      }
918918   }
919919
920920   /* fatal error as well if we didn't find any relevant memory banks */
921921   if (!found)
922      fatalerror("memory_set_decrypted_region unable to find matching region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag.cstr());
922      fatalerror("memory_set_decrypted_region unable to find matching region %08X-%08X for device '%s'", bytestart, byteend, space->cpu->tag());
923923}
924924
925925
r7553r7554
981981      spacerw->direct.byteend = 0;
982982      spacerw->direct.bytestart = 1;
983983      if (!spacerw->debugger_access)
984         logerror("Device '%s': warning - attempt to direct-map address %s in %s space\n", space->cpu->tag.cstr(), core_i64_hex_format(overrideaddress, space->addrchars), space->name);
984         logerror("Device '%s': warning - attempt to direct-map address %s in %s space\n", space->cpu->tag(), core_i64_hex_format(overrideaddress, space->addrchars), space->name);
985985      return FALSE;
986986   }
987987
r7553r7554
12101210{
12111211   address_space *spacerw = (address_space *)space;
12121212   if (rhandler >= STATIC_COUNT)
1213      fatalerror("Attempted to install non-static read handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1213      fatalerror("Attempted to install non-static read handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12141214   if (whandler >= STATIC_COUNT)
1215      fatalerror("Attempted to install non-static write handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1215      fatalerror("Attempted to install non-static write handler via memory_install_handler() in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12161216   if (rhandler != 0)
12171217      space_map_range(spacerw, ROW_READ, spacerw->dbits, 0, addrstart, addrend, addrmask, addrmirror, (genf *)(FPTR)rhandler, spacerw, NULL);
12181218   if (whandler != 0)
r7553r7554
12311231{
12321232   address_space *spacerw = (address_space *)space;
12331233   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1234      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1234      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12351235   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1236      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1236      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12371237   if (rhandler != NULL)
12381238      space_map_range(spacerw, ROW_READ, 8, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
12391239   if (whandler != NULL)
r7553r7554
12521252{
12531253   address_space *spacerw = (address_space *)space;
12541254   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1255      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1255      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12561256   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1257      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1257      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12581258   if (rhandler != NULL)
12591259      space_map_range(spacerw, ROW_READ, 16, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
12601260   if (whandler != NULL)
r7553r7554
12731273{
12741274   address_space *spacerw = (address_space *)space;
12751275   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1276      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1276      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12771277   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1278      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1278      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12791279   if (rhandler != NULL)
12801280      space_map_range(spacerw, ROW_READ, 32, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
12811281   if (whandler != NULL)
r7553r7554
12941294{
12951295   address_space *spacerw = (address_space *)space;
12961296   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1297      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1297      fatalerror("Attempted to install invalid read handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
12981298   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1299      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1299      fatalerror("Attempted to install invalid write handler in space %s of device '%s'\n", space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13001300   if (rhandler != NULL)
13011301      space_map_range(spacerw, ROW_READ, 64, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, spacerw, rhandler_name);
13021302   if (whandler != NULL)
r7553r7554
13151315{
13161316   address_space *spacerw = (address_space *)space;
13171317   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1318      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1318      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13191319   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1320      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1320      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13211321   if (rhandler != NULL)
13221322      space_map_range(spacerw, ROW_READ, 8, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
13231323   if (whandler != NULL)
r7553r7554
13361336{
13371337   address_space *spacerw = (address_space *)space;
13381338   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1339      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1339      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13401340   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1341      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1341      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13421342   if (rhandler != NULL)
13431343      space_map_range(spacerw, ROW_READ, 16, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
13441344   if (whandler != NULL)
r7553r7554
13571357{
13581358   address_space *spacerw = (address_space *)space;
13591359   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1360      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1360      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13611361   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1362      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1362      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13631363   if (rhandler != NULL)
13641364      space_map_range(spacerw, ROW_READ, 32, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
13651365   if (whandler != NULL)
r7553r7554
13781378{
13791379   address_space *spacerw = (address_space *)space;
13801380   if (rhandler != NULL && (FPTR)rhandler < STATIC_COUNT)
1381      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1381      fatalerror("Attempted to install invalid read handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13821382   if (whandler != NULL && (FPTR)whandler < STATIC_COUNT)
1383      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag.cstr(), space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1383      fatalerror("Attempted to install invalid write handler for device '%s' in space %s of device '%s'\n", device->tag(), space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
13841384   if (rhandler != NULL)
13851385      space_map_range(spacerw, ROW_READ, 64, handlerunitmask, addrstart, addrend, addrmask, addrmirror, (genf *)rhandler, (void *)device, rhandler_name);
13861386   if (whandler != NULL)
r7553r7554
14151415   {
14161416      const input_port_config *port = space->machine->port(rtag);
14171417      if (port == NULL)
1418         fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1418         fatalerror("Attempted to map non-existent port '%s' for read in space %s of device '%s'\n", rtag, space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
14191419      space_map_range(spacerw, ROW_READ, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, rhandler, (void *)port, rtag);
14201420   }
14211421
r7553r7554
14241424   {
14251425      const input_port_config *port = space->machine->port(wtag);
14261426      if (port == NULL)
1427         fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1427         fatalerror("Attempted to map non-existent port '%s' for write in space %s of device '%s'\n", wtag, space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
14281428      space_map_range(spacerw, ROW_WRITE, space->dbits, 0, addrstart, addrend, addrmask, addrmirror, whandler, (void *)port, wtag);
14291429   }
14301430
r7553r7554
16551655      fprintf(file, "\n\n"
16561656                    "====================================================\n"
16571657                    "Device '%s' %s address space read handler dump\n"
1658                    "====================================================\n", space->cpu->tag.cstr(), space->name);
1658                    "====================================================\n", space->cpu->tag(), space->name);
16591659      dump_map(file, space, &space->read);
16601660
16611661      fprintf(file, "\n\n"
16621662                    "====================================================\n"
16631663                    "Device '%s' %s address space write handler dump\n"
1664                    "====================================================\n", space->cpu->tag.cstr(), space->name);
1664                    "====================================================\n", space->cpu->tag(), space->name);
16651665      dump_map(file, space, &space->write);
16661666   }
16671667}
r7553r7554
18001800   /* loop over valid address spaces */
18011801   for (space = (address_space *)memdata->spacelist; space != NULL; space = (address_space *)space->next)
18021802   {
1803      int regionsize = (space->spacenum == ADDRESS_SPACE_0) ? memory_region_length(space->machine, space->cpu->tag) : 0;
1803      int regionsize = (space->spacenum == ADDRESS_SPACE_0) ? memory_region_length(space->machine, space->cpu->tag()) : 0;
18041804      address_map_entry *entry;
18051805      int entrynum;
18061806
r7553r7554
18311831            /* make sure it fits within the memory region before doing so, however */
18321832            if (entry->byteend < regionsize)
18331833            {
1834               entry->region = space->cpu->tag;
1834               entry->region = space->cpu->tag();
18351835               entry->rgnoffs = entry->bytestart;
18361836            }
18371837         }
r7553r7554
18441844
18451845            /* validate the region */
18461846            if (base == NULL)
1847               fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", space->cpu->tag.cstr(), space->name, entry->addrstart, entry->addrend, entry->region);
1847               fatalerror("Error: device '%s' %s space memory map entry %X-%X references non-existant region \"%s\"", space->cpu->tag(), space->name, entry->addrstart, entry->addrend, entry->region);
18481848            if (entry->rgnoffs + (entry->byteend - entry->bytestart + 1) > length)
1849               fatalerror("Error: device '%s' %s space memory map entry %X-%X extends beyond region \"%s\" size (%X)", space->cpu->tag.cstr(), space->name, entry->addrstart, entry->addrend, entry->region, length);
1849               fatalerror("Error: device '%s' %s space memory map entry %X-%X extends beyond region \"%s\" size (%X)", space->cpu->tag(), space->name, entry->addrstart, entry->addrend, entry->region, length);
18501850         }
18511851
18521852         /* convert any region-relative entries to their memory pointers */
r7553r7554
19711971      case AMH_DEVICE_HANDLER:
19721972         device = space->machine->device(handler->tag);
19731973         if (device == NULL)
1974            fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", handler->tag, space->name, (space->cpu != NULL) ? space->cpu->tag.cstr() : "??");
1974            fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", handler->tag, space->name, (space->cpu != NULL) ? space->cpu->tag() : "??");
19751975         switch ((handler->bits != 0) ? handler->bits : space->dbits)
19761976         {
19771977            case 8:
r7553r7554
24902490   address_map_entry *entry;
24912491   memory_block *block;
24922492
2493   VPRINTF(("space_find_backing_memory('%s',%s,%08X-%08X) -> ", space->cpu->tag.cstr(), space->name, bytestart, byteend));
2493   VPRINTF(("space_find_backing_memory('%s',%s,%08X-%08X) -> ", space->cpu->tag(), space->name, bytestart, byteend));
24942494
24952495   /* look in the address map first */
24962496   for (entry = space->map->entrylist; entry != NULL; entry = entry->next)
r7553r7554
25352535
25362536   /* if we're reading from RAM or from ROM outside of address space 0 or its region, then yes, we do need backing */
25372537   if (entry->read.type == AMH_RAM ||
2538      (entry->read.type == AMH_ROM && (space->spacenum != ADDRESS_SPACE_0 || entry->addrstart >= memory_region_length(space->machine, space->cpu->tag))))
2538      (entry->read.type == AMH_ROM && (space->spacenum != ADDRESS_SPACE_0 || entry->addrstart >= memory_region_length(space->machine, space->cpu->tag()))))
25392539      return TRUE;
25402540
25412541   /* all other cases don't need backing */
r7553r7554
33203320   size_t bytestoalloc;
33213321   const char *region;
33223322
3323   VPRINTF(("block_allocate('%s',%s,%08X,%08X,%p)\n", space->cpu->tag.cstr(), space->name, bytestart, byteend, memory));
3323   VPRINTF(("block_allocate('%s',%s,%08X,%08X,%p)\n", space->cpu->tag(), space->name, bytestart, byteend, memory));
33243324
33253325   /* determine how much memory to allocate for this */
33263326   bytestoalloc = sizeof(*block);
r7553r7554
33513351      char name[256];
33523352
33533353      sprintf(name, "%08x-%08x", bytestart, byteend);
3354      state_save_register_memory(space->machine, "memory", space->cpu->tag, space->spacenum, name, memory, bytes_per_element, (UINT32)(byteend - bytestart + 1) / bytes_per_element, __FILE__, __LINE__);
3354      state_save_register_memory(space->machine, "memory", space->cpu->tag(), space->spacenum, name, memory, bytes_per_element, (UINT32)(byteend - bytestart + 1) / bytes_per_element, __FILE__, __LINE__);
33553355   }
33563356
33573357   /* fill in the tracking block */
src/emu/devintrf.c
r7553r7554
7676
7777   // append each device from the configuration list
7878   for (const device_config *devconfig = list.first(); devconfig != NULL; devconfig = devconfig->next)
79      append(devconfig->tag, new running_device(_machine, *devconfig));
79      append(devconfig->tag(), new running_device(_machine, *devconfig));
8080}
8181
8282
r7553r7554
169169device_config::device_config(const device_config *_owner, device_type _type, const char *_tag, UINT32 _clock)
170170   : next(NULL),
171171     owner(const_cast<device_config *>(_owner)),
172     tag(_tag),
173172     type(_type),
174173     devclass(DEVICE_CLASS_GENERAL),
175174     clock(_clock),
176175     static_config(NULL),
177     inline_config(NULL)
176     inline_config(NULL),
177     m_tag(_tag)
178178{
179179   // initialize remaining members
180180   memset(address_map, 0, sizeof(address_map));
r7553r7554
303303
304304astring &device_config::subtag(astring &dest, const char *_tag) const
305305{
306   return (this != NULL) ? dest.cpy(tag).cat(":").cat(_tag) : dest.cpy(_tag);
306   return (this != NULL) ? dest.cpy(m_tag).cat(":").cat(_tag) : dest.cpy(_tag);
307307}
308308
309309
r7553r7554
333333   : m_baseconfig(_config),
334334     machine(&_machine),
335335     next(NULL),
336     owner((_config.owner != NULL) ? _machine.devicelist.find(_config.owner->tag) : NULL),
337     tag(_config.tag),
336     owner((_config.owner != NULL) ? _machine.devicelist.find(_config.owner->tag()) : NULL),
338337     type(_config.type),
339338     devclass(_config.devclass),
340339     clock(_config.clock),
r7553r7554
343342     tokenbytes(_config.get_config_int(DEVINFO_INT_TOKEN_BYTES)),
344343     region(NULL),
345344     execute(NULL),
346     get_runtime_info(NULL)
345     get_runtime_info(NULL),
346     m_tag(_config.tag())
347347{
348348   memset(addrspace, 0, sizeof(addrspace));
349349
350350   if (tokenbytes == 0)
351      throw emu_fatalerror("Device %s specifies a 0 token length!\n", tag.cstr());
351      throw emu_fatalerror("Device %s specifies a 0 token length!\n", tag());
352352
353353   // allocate memory for the token
354354   token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
r7553r7554
433433void running_device::start()
434434{
435435   // find our region
436   region = machine->regionlist.find(baseconfig().tag);
436   region = machine->regionlist.find(baseconfig().tag());
437437
438438   // start functions are required
439439   device_start_func start = (device_start_func)get_config_fct(DEVINFO_FCT_START);
src/emu/machine/6526cia.c
r7553r7554
173173   cia->sp = 0;
174174
175175   /* initialize data direction registers */
176   cia->port[0].ddr = !strcmp(device->tag, "cia_0") ? 0x03 : 0xff;
177   cia->port[1].ddr = !strcmp(device->tag, "cia_0") ? 0x00 : 0xff;
176   cia->port[0].ddr = !strcmp(device->tag(), "cia_0") ? 0x03 : 0xff;
177   cia->port[1].ddr = !strcmp(device->tag(), "cia_0") ? 0x00 : 0xff;
178178
179179   /* TOD running by default */
180180   cia->tod_running = TRUE;
src/emu/machine/74123.c
r7553r7554
8787
8888   timer_set( device->machine, attotime_zero, (void *) device, output, output_callback );
8989
90   if (LOG) logerror("74123 %s:  Output: %d\n", device->tag.cstr(), output);
90   if (LOG) logerror("74123 %s:  Output: %d\n", device->tag(), output);
9191}
9292
9393
r7553r7554
118118      {
119119         timer_adjust_oneshot(chip->timer, duration, 0);
120120
121         if (LOG) logerror("74123 %s:  Retriggering pulse.  Duration: %f\n", device->tag.cstr(), attotime_to_double(duration));
121         if (LOG) logerror("74123 %s:  Retriggering pulse.  Duration: %f\n", device->tag(), attotime_to_double(duration));
122122      }
123123      else
124124      {
125         if (LOG) logerror("74123 %s:  Retriggering failed.\n", device->tag.cstr());
125         if (LOG) logerror("74123 %s:  Retriggering failed.\n", device->tag());
126126      }
127127   }
128128   else
r7553r7554
132132
133133      set_output(device);
134134
135      if (LOG) logerror("74123 %s:  Starting pulse.  Duration: %f\n", device->tag.cstr(), attotime_to_double(duration));
135      if (LOG) logerror("74123 %s:  Starting pulse.  Duration: %f\n", device->tag(), attotime_to_double(duration));
136136   }
137137}
138138
r7553r7554
172172   {
173173      timer_adjust_oneshot(chip->timer, attotime_zero, 0);
174174
175      if (LOG) logerror("74123 #%s:  Cleared\n", device->tag.cstr() );
175      if (LOG) logerror("74123 #%s:  Cleared\n", device->tag() );
176176   }
177177   chip->clear = data;
178178}
src/emu/machine/idectrl.c
r7553r7554
18011801
18021802   /* set MAME harddisk handle */
18031803   config = (const ide_config *)device->baseconfig().inline_config;
1804   ide->handle = get_disk_handle(device->machine, (config->master != NULL) ? config->master : device->tag.cstr());
1804   ide->handle = get_disk_handle(device->machine, (config->master != NULL) ? config->master : device->tag());
18051805   ide->disk = hard_disk_open(ide->handle);
18061806   assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n");
18071807
src/emu/machine/6821pia.c
r7553r7554
301301
302302         if (!p->logged_port_a_not_connected && (p->ddr_a != 0xff))
303303         {
304            logerror("PIA #%s: Warning! No port A read handler. Assuming pins 0x%02X not connected\n", device->tag.cstr(), p->ddr_a ^ 0xff);
304            logerror("PIA #%s: Warning! No port A read handler. Assuming pins 0x%02X not connected\n", device->tag(), p->ddr_a ^ 0xff);
305305            p->logged_port_a_not_connected = TRUE;
306306         }
307307      }
r7553r7554
345345         {
346346            if (!p->logged_port_b_not_connected && (p->ddr_b != 0xff))
347347            {
348               logerror("PIA #%s: Error! No port B read handler. Three-state pins 0x%02X are undefined\n", device->tag.cstr(), p->ddr_b ^ 0xff);
348               logerror("PIA #%s: Error! No port B read handler. Three-state pins 0x%02X are undefined\n", device->tag(), p->ddr_b ^ 0xff);
349349               p->logged_port_b_not_connected = TRUE;
350350            }
351351
r7553r7554
413413      else
414414      {
415415         if (p->out_ca2_needs_pulled)
416            logerror("PIA #%s: Warning! No port CA2 write handler. Previous value has been lost!\n", device->tag.cstr());
416            logerror("PIA #%s: Warning! No port CA2 write handler. Previous value has been lost!\n", device->tag());
417417
418418         p->out_ca2_needs_pulled = TRUE;
419419      }
r7553r7554
442442      else
443443      {
444444         if (p->out_cb2_needs_pulled)
445            logerror("PIA #%s: Warning! No port CB2 write handler. Previous value has been lost!\n", device->tag.cstr());
445            logerror("PIA #%s: Warning! No port CB2 write handler. Previous value has been lost!\n", device->tag());
446446
447447         p->out_cb2_needs_pulled = TRUE;
448448      }
r7553r7554
476476         set_out_ca2(device, TRUE);
477477   }
478478
479   LOG(("PIA #%s: port A read = %02X\n", device->tag.cstr(), ret));
479   LOG(("PIA #%s: port A read = %02X\n", device->tag(), ret));
480480
481481   return ret;
482482}
r7553r7554
492492
493493   UINT8 ret = p->ddr_a;
494494
495   LOG(("PIA #%s: DDR A read = %02X\n", device->tag.cstr(), ret));
495   LOG(("PIA #%s: DDR A read = %02X\n", device->tag(), ret));
496496
497497   return ret;
498498}
r7553r7554
520520   p->irq_b2 = FALSE;
521521   update_interrupts(device);
522522
523   LOG(("PIA #%s: port B read = %02X\n", device->tag.cstr(), ret));
523   LOG(("PIA #%s: port B read = %02X\n", device->tag(), ret));
524524
525525   return ret;
526526}
r7553r7554
536536
537537   UINT8 ret = p->ddr_b;
538538
539   LOG(("PIA #%s: DDR B read = %02X\n", device->tag.cstr(), ret));
539   LOG(("PIA #%s: DDR B read = %02X\n", device->tag(), ret));
540540
541541   return ret;
542542}
r7553r7554
556556      pia6821_ca1_w(device, 0, devcb_call_read_line(&p->in_ca1_func));
557557   else if (!p->logged_ca1_not_connected && (!p->in_ca1_pushed))
558558   {
559      logerror("PIA #%s: Warning! No CA1 read handler. Assuming pin not connected\n", device->tag.cstr());
559      logerror("PIA #%s: Warning! No CA1 read handler. Assuming pin not connected\n", device->tag());
560560      p->logged_ca1_not_connected = TRUE;
561561   }
562562
r7553r7554
564564      pia6821_ca2_w(device, 0, devcb_call_read_line(&p->in_ca2_func));
565565   else if ( !p->logged_ca2_not_connected && C2_INPUT(p->ctl_a) && !p->in_ca2_pushed)
566566   {
567      logerror("PIA #%s: Warning! No CA2 read handler. Assuming pin not connected\n", device->tag.cstr());
567      logerror("PIA #%s: Warning! No CA2 read handler. Assuming pin not connected\n", device->tag());
568568      p->logged_ca2_not_connected = TRUE;
569569   }
570570
r7553r7554
578578   if (p->irq_a2 && C2_INPUT(p->ctl_a))
579579      ret |= PIA_IRQ2;
580580
581   LOG(("PIA #%s: control A read = %02X\n", device->tag.cstr(), ret));
581   LOG(("PIA #%s: control A read = %02X\n", device->tag(), ret));
582582
583583   return ret;
584584}
r7553r7554
598598      pia6821_cb1_w(device, 0, devcb_call_read_line(&p->in_cb1_func));
599599   else if (!p->logged_cb1_not_connected && !p->in_cb1_pushed)
600600   {
601      logerror("PIA #%s: Error! no CB1 read handler. Three-state pin is undefined\n", device->tag.cstr());
601      logerror("PIA #%s: Error! no CB1 read handler. Three-state pin is undefined\n", device->tag());
602602      p->logged_cb1_not_connected = TRUE;
603603   }
604604
r7553r7554
606606      pia6821_cb2_w(device, 0, devcb_call_read_line(&p->in_cb2_func));
607607   else if (!p->logged_cb2_not_connected && C2_INPUT(p->ctl_b) && !p->in_cb2_pushed)
608608   {
609      logerror("PIA #%s: Error! No CB2 read handler. Three-state pin is undefined\n", device->tag.cstr());
609      logerror("PIA #%s: Error! No CB2 read handler. Three-state pin is undefined\n", device->tag());
610610      p->logged_cb2_not_connected = TRUE;
611611   }
612612
r7553r7554
620620   if (p->irq_b2 && C2_INPUT(p->ctl_b))
621621      ret |= PIA_IRQ2;
622622
623   LOG(("PIA #%s: control B read = %02X\n", device->tag.cstr(), ret));
623   LOG(("PIA #%s: control B read = %02X\n", device->tag(), ret));
624624
625625   return ret;
626626}
r7553r7554
697697   /* input pins are pulled high */
698698   UINT8 data = get_out_a_value(device);
699699
700   LOG(("PIA #%s: %s = %02X\n", device->tag.cstr(), message, data));
700   LOG(("PIA #%s: %s = %02X\n", device->tag(), message, data));
701701
702702   if (p->out_a_func.write != NULL)
703703      devcb_call_write8(&p->out_a_func, 0, data);
704704   else
705705   {
706706      if (p->out_a_needs_pulled)
707         logerror("PIA #%s: Warning! No port A write handler. Previous value has been lost!\n", device->tag.cstr());
707         logerror("PIA #%s: Warning! No port A write handler. Previous value has been lost!\n", device->tag());
708708
709709      p->out_a_needs_pulled = TRUE;
710710   }
r7553r7554
722722   /* input pins are high-impedance - we just send them as zeros for backwards compatibility */
723723   UINT8 data = get_out_b_value(device);
724724
725   LOG(("PIA #%s: %s = %02X\n", device->tag.cstr(), message, data));
725   LOG(("PIA #%s: %s = %02X\n", device->tag(), message, data));
726726
727727   if (p->out_b_func.write != NULL)
728728      devcb_call_write8(&p->out_b_func, 0, data);
729729   else
730730   {
731731      if (p->out_b_needs_pulled)
732         logerror("PIA #%s: Warning! No port B write handler. Previous value has been lost!\n", device->tag.cstr());
732         logerror("PIA #%s: Warning! No port B write handler. Previous value has been lost!\n", device->tag());
733733
734734      p->out_b_needs_pulled = TRUE;
735735   }
r7553r7554
760760   pia6821_state *p = get_token(device);
761761
762762   if (data == 0x00)
763      LOG(("PIA #%s: DDR A write = %02X (input mode)\n", device->tag.cstr(), data));
763      LOG(("PIA #%s: DDR A write = %02X (input mode)\n", device->tag(), data));
764764   else if (data == 0xff)
765      LOG(("PIA #%s: DDR A write = %02X (output mode)\n", device->tag.cstr(), data));
765      LOG(("PIA #%s: DDR A write = %02X (output mode)\n", device->tag(), data));
766766   else
767      LOG(("PIA #%s: DDR A write = %02X (mixed mode)\n", device->tag.cstr(), data));
767      LOG(("PIA #%s: DDR A write = %02X (mixed mode)\n", device->tag(), data));
768768
769769   if (p->ddr_a != data)
770770   {
r7553r7554
811811   pia6821_state *p = get_token(device);
812812
813813   if (data == 0x00)
814      LOG(("PIA #%s: DDR B write = %02X (input mode)\n", device->tag.cstr(), data));
814      LOG(("PIA #%s: DDR B write = %02X (input mode)\n", device->tag(), data));
815815   else if (data == 0xff)
816      LOG(("PIA #%s: DDR B write = %02X (output mode)\n", device->tag.cstr(), data));
816      LOG(("PIA #%s: DDR B write = %02X (output mode)\n", device->tag(), data));
817817   else
818      LOG(("PIA #%s: DDR B write = %02X (mixed mode)\n", device->tag.cstr(), data));
818      LOG(("PIA #%s: DDR B write = %02X (mixed mode)\n", device->tag(), data));
819819
820820   if (p->ddr_b != data)
821821   {
r7553r7554
838838   /* bit 7 and 6 are read only */
839839   data &= 0x3f;
840840
841   LOG(("PIA #%s: control A write = %02X\n", device->tag.cstr(), data));
841   LOG(("PIA #%s: control A write = %02X\n", device->tag(), data));
842842
843843   /* update the control register */
844844   p->ctl_a = data;
r7553r7554
875875   /* bit 7 and 6 are read only */
876876   data &= 0x3f;
877877
878   LOG(("PIA #%s: control B write = %02X\n", device->tag.cstr(), data));
878   LOG(("PIA #%s: control B write = %02X\n", device->tag(), data));
879879
880880   /* update the control register */
881881   p->ctl_b = data;
r7553r7554
974974
975975   assert_always(p->in_a_func.read == NULL, "pia6821_porta_w() called when in_a_func implemented");
976976
977   LOG(("PIA #%s: set input port A = %02X\n", device->tag.cstr(), data));
977   LOG(("PIA #%s: set input port A = %02X\n", device->tag(), data));
978978
979979   p->in_a = data;
980980   p->port_a_z_mask = z_mask;
r7553r7554
10291029   /* limit the data to 0 or 1 */
10301030   data = data ? TRUE : FALSE;
10311031
1032   LOG(("PIA #%s: set input CA1 = %d\n", device->tag.cstr(), data));
1032   LOG(("PIA #%s: set input CA1 = %d\n", device->tag(), data));
10331033
10341034   /* the new state has caused a transition */
10351035   if ((p->in_ca1 != data) &&
10361036      ((data && C1_LOW_TO_HIGH(p->ctl_a)) || (!data && C1_HIGH_TO_LOW(p->ctl_a))))
10371037   {
1038      LOG(("PIA #%s: CA1 triggering\n", device->tag.cstr()));
1038      LOG(("PIA #%s: CA1 triggering\n", device->tag()));
10391039
10401040      /* mark the IRQ */
10411041      p->irq_a1 = TRUE;
r7553r7554
10771077   /* limit the data to 0 or 1 */
10781078   data = data ? 1 : 0;
10791079
1080   LOG(("PIA #%s: set input CA2 = %d\n", device->tag.cstr(), data));
1080   LOG(("PIA #%s: set input CA2 = %d\n", device->tag(), data));
10811081
10821082   /* if input mode and the new state has caused a transition */
10831083   if (C2_INPUT(p->ctl_a) &&
10841084      (p->in_ca2 != data) &&
10851085      ((data && C2_LOW_TO_HIGH(p->ctl_a)) || (!data && C2_HIGH_TO_LOW(p->ctl_a))))
10861086   {
1087      LOG(("PIA #%s: CA2 triggering\n", device->tag.cstr()));
1087      LOG(("PIA #%s: CA2 triggering\n", device->tag()));
10881088
10891089      /* mark the IRQ */
10901090      p->irq_a2 = TRUE;
r7553r7554
11541154
11551155   assert_always(p->in_b_func.read == NULL, "pia_set_input_b() called when in_b_func implemented");
11561156
1157   LOG(("PIA #%s: set input port B = %02X\n", device->tag.cstr(), data));
1157   LOG(("PIA #%s: set input port B = %02X\n", device->tag(), data));
11581158
11591159   p->in_b = data;
11601160   p->in_b_pushed = TRUE;
r7553r7554
11981198   /* limit the data to 0 or 1 */
11991199   data = data ? 1 : 0;
12001200
1201   LOG(("PIA #%s: set input CB1 = %d\n", device->tag.cstr(), data));
1201   LOG(("PIA #%s: set input CB1 = %d\n", device->tag(), data));
12021202
12031203   /* the new state has caused a transition */
12041204   if ((p->in_cb1 != data) &&
12051205      ((data && C1_LOW_TO_HIGH(p->ctl_b)) || (!data && C1_HIGH_TO_LOW(p->ctl_b))))
12061206   {
1207      LOG(("PIA #%s: CB1 triggering\n", device->tag.cstr()));
1207      LOG(("PIA #%s: CB1 triggering\n", device->tag()));
12081208
12091209      /* mark the IRQ */
12101210      p->irq_b1 = 1;
r7553r7554
12471247   /* limit the data to 0 or 1 */
12481248   data = data ? 1 : 0;
12491249
1250   LOG(("PIA #%s: set input CB2 = %d\n", device->tag.cstr(), data));
1250   LOG(("PIA #%s: set input CB2 = %d\n", device->tag(), data));
12511251
12521252   /* if input mode and the new state has caused a transition */
12531253   if (C2_INPUT(p->ctl_b) &&
12541254      (p->in_cb2 != data) &&
12551255      ((data && C2_LOW_TO_HIGH(p->ctl_b)) || (!data && C2_HIGH_TO_LOW(p->ctl_b))))
12561256   {
1257      LOG(("PIA #%s: CB2 triggering\n", device->tag.cstr()));
1257      LOG(("PIA #%s: CB2 triggering\n", device->tag()));
12581258
12591259      /* mark the IRQ */
12601260      p->irq_b2 = 1;
src/emu/machine/68681.c
r7553r7554
462462
463463   offset &= 0xf;
464464
465   LOG(( "Reading 68681 (%s) reg %x (%s) ", device->tag.cstr(), offset, duart68681_reg_read_names[offset] ));
465   LOG(( "Reading 68681 (%s) reg %x (%s) ", device->tag(), offset, duart68681_reg_read_names[offset] ));
466466
467467   switch (offset)
468468   {
r7553r7554
582582   duart68681_state* duart68681 = get_safe_token(device);
583583
584584   offset &= 0x0f;
585   LOG(( "Writing 68681 (%s) reg %x (%s) with %04x\n", device->tag.cstr(), offset, duart68681_reg_write_names[offset], data ));
585   LOG(( "Writing 68681 (%s) reg %x (%s) with %04x\n", device->tag(), offset, duart68681_reg_write_names[offset], data ));
586586
587587   switch(offset)
588588   {
r7553r7554
605605         switch ((data >> 4) & 0x07)
606606         {
607607            case 0: case 1: case 2: case 4: case 5: // TODO: handle these cases!
608            logerror( "68681 (%s): Unhandled timer/counter mode %d\n", device->tag.cstr(), (data >> 4) & 0x07);
608            logerror( "68681 (%s): Unhandled timer/counter mode %d\n", device->tag(), (data >> 4) & 0x07);
609609            break;
610610            case 3: case 6: case 7:
611611            break;
r7553r7554
641641         break;
642642      case 0x0d: /* OPCR */
643643         if (data != 0x00)
644            logerror( "68681 (%s): Unhandled OPCR value: %02x\n", device->tag.cstr(), data);
644            logerror( "68681 (%s): Unhandled OPCR value: %02x\n", device->tag(), data);
645645         duart68681->OPCR = data;
646646         break;
647647      case 0x0e: /* Set Output Port Bits */
src/emu/machine/6532riot.c
r7553r7554
262262         if (port->out_func.write != NULL)
263263            devcb_call_write8(&port->out_func, 0, data);
264264         else
265            logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), 'A' + (offset & 1), data);
265            logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", cpuexec_describe_context(device->machine), device->tag(), 'A' + (offset & 1), data);
266266      }
267267
268268      /* writes to port A need to update the PA7 state */
r7553r7554
331331               update_pa7_state(device);
332332         }
333333         else
334            logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr(), 'A' + (offset & 1));
334            logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag(), 'A' + (offset & 1));
335335
336336         /* apply the DDR to the result */
337337         val = apply_ddr(port);
r7553r7554
429429
430430   /* validate arguments */
431431   assert(device != NULL);
432   assert(strlen(device->tag) < 20);
433432
434433   /* set static values */
435434   riot->device = device;
436435   riot->intf = (riot6532_interface *)device->baseconfig().static_config;
437   riot->index = device->machine->devicelist.index(RIOT6532, device->tag);
436   riot->index = device->machine->devicelist.index(RIOT6532, device->tag());
438437
439438   /* configure the ports */
440439   devcb_resolve_read8(&riot->port[0].in_func, &riot->intf->in_a_func, device);
src/emu/machine/6522via.c
r7553r7554
306306
307307   v->ifr |= data;
308308   if (TRACE_VIA)
309      logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), v->ifr);
309      logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag(), v->ifr);
310310
311311   if (v->ier & v->ifr)
312312    {
r7553r7554
327327   v->ifr = (v->ifr & ~data) & 0x7f;
328328
329329   if (TRACE_VIA)
330      logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), v->ifr);
330      logerror("%s:6522VIA chip %s: IFR = %02X\n", cpuexec_describe_context(device->machine), device->tag(), v->ifr);
331331
332332   if (v->ifr & v->ier)
333333      v->ifr |= INT_ANY;
r7553r7554
523523            if (v->in_b_func.read != NULL)
524524               v->in_b = devcb_call_read8(&v->in_b_func, 0);
525525            else
526               logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
526               logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag());
527527         }
528528      }
529529
r7553r7554
545545            if (v->in_a_func.read != NULL)
546546               v->in_a = devcb_call_read8(&v->in_a_func, 0);
547547            else
548               logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
548               logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag());
549549         }
550550      }
551551
r7553r7554
577577         if (v->in_a_func.read != NULL)
578578            v->in_a = devcb_call_read8(&v->in_a_func, 0);
579579         else
580            logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
580            logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag());
581581      }
582582
583583      /* combine input and output values */
r7553r7554
845845      v->pcr = data;
846846
847847      if (TRACE_VIA)
848         logerror("%s:6522VIA chip %s: PCR = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), data);
848         logerror("%s:6522VIA chip %s: PCR = %02X\n", cpuexec_describe_context(device->machine), device->tag(), data);
849849
850850      if (CA2_FIX_OUTPUT(data) && CA2_OUTPUT_LEVEL(data) ^ v->out_ca2)
851851      {
r7553r7554
957957   if (state != v->in_ca1)
958958    {
959959      if (TRACE_VIA)
960         logerror("%s:6522VIA chip %s: CA1 = %02X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), state);
960         logerror("%s:6522VIA chip %s: CA1 = %02X\n", cpuexec_describe_context(device->machine), device->tag(), state);
961961
962962      if ((CA1_LOW_TO_HIGH(v->pcr) && state) || (CA1_HIGH_TO_LOW(v->pcr) && !state))
963963      {
r7553r7554
966966            if (v->in_a_func.read != NULL)
967967               v->in_a = devcb_call_read8(&v->in_a_func, 0);
968968            else
969               logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
969               logerror("%s:6522VIA chip %s: Port A is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag());
970970         }
971971
972972         via_set_int (device, INT_CA1);
r7553r7554
10901090            if (v->in_b_func.read != NULL)
10911091               v->in_b = devcb_call_read8(&v->in_b_func, 0);
10921092            else
1093               logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag.cstr());
1093               logerror("%s:6522VIA chip %s: Port B is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag());
10941094         }
10951095         if (SO_EXT_CONTROL(v->acr) || SI_EXT_CONTROL(v->acr))
10961096            via_shift (device);
src/emu/machine/6840ptm.c
r7553r7554
290290   /* If there's no timer, return the count */
291291   if (!ptm6840->enabled[counter])
292292   {
293      PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag.cstr(), counter, ptm6840->counter[counter]));
293      PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag(), counter, ptm6840->counter[counter]));
294294      return ptm6840->counter[counter];
295295   }
296296
r7553r7554
298298   if (ptm6840->control_reg[counter] & 0x02)
299299   {
300300      clock = ptm6840->internal_clock;
301      PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag.cstr(), counter, clock));
301      PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag(), counter, clock));
302302   }
303303   else
304304   {
305305      clock = ptm6840->external_clock[counter];
306      PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag.cstr(), counter, clock));
306      PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag(), counter, clock));
307307   }
308308   /* See how many are left */
309309   remaining = attotime_to_double(attotime_mul(timer_timeleft(ptm6840->timer[counter]), clock));
r7553r7554
316316      int lsb = remaining % divisor;
317317      remaining = (msb << 8) | lsb;
318318   }
319   PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag.cstr(), counter, remaining));
319   PLOG(("MC6840 #%s: read counter(%d): %d\n", device->tag(), counter, remaining));
320320   return remaining;
321321}
322322
r7553r7554
338338   if (ptm6840->control_reg[idx] & 0x02)
339339   {
340340      clock = ptm6840->internal_clock;
341      PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag.cstr(), idx, clock));
341      PLOG(("MC6840 #%s: %d internal clock freq %d \n", device->tag(), idx, clock));
342342   }
343343   else
344344   {
345345      clock = ptm6840->external_clock[idx];
346      PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag.cstr(), idx, clock));
346      PLOG(("MC6840 #%s: %d external clock freq %d \n", device->tag(), idx, clock));
347347   }
348348
349349   /* Determine the number of clock periods before we expire */
r7553r7554
363363   }
364364
365365   /* Set the timer */
366   PLOG(("MC6840 #%s: reload_count(%d): clock = %d  count = %d\n", device->tag.cstr(), idx, clock, count));
366   PLOG(("MC6840 #%s: reload_count(%d): clock = %d  count = %d\n", device->tag(), idx, clock, count));
367367
368368   duration = attotime_mul(ATTOTIME_IN_HZ(clock), count);
369369   if (idx == 2)
370370      duration = attotime_mul(duration, ptm6840->t3_divisor);
371371
372   PLOG(("MC6840 #%s: reload_count(%d): output = %lf\n", device->tag.cstr(), idx, attotime_to_double(duration)));
372   PLOG(("MC6840 #%s: reload_count(%d): output = %lf\n", device->tag(), idx, attotime_to_double(duration)));
373373
374374   if (!(ptm6840->control_reg[idx] & 0x02))
375375   {
r7553r7554
407407
408408      case PTM_6840_STATUS:
409409      {
410         PLOG(("%s: MC6840 #%s: Status read = %04X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), ptm6840->status_reg));
410         PLOG(("%s: MC6840 #%s: Status read = %04X\n", cpuexec_describe_context(device->machine), device->tag(), ptm6840->status_reg));
411411         ptm6840->status_read_since_int |= ptm6840->status_reg & 0x07;
412412         val = ptm6840->status_reg;
413413         break;
r7553r7554
429429
430430         ptm6840->lsb_buffer = result & 0xff;
431431
432         PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), idx, result >> 8));
432         PLOG(("%s: MC6840 #%s: Counter %d read = %04X\n", cpuexec_describe_context(device->machine), device->tag(), idx, result >> 8));
433433         val = result >> 8;
434434         break;
435435      }
r7553r7554
474474         ptm6840->mode[idx] = (data >> 3) & 0x07;
475475         ptm6840->control_reg[idx] = data;
476476
477         PLOG(("MC6840 #%s : Control register %d selected\n", device->tag.cstr(), idx));
477         PLOG(("MC6840 #%s : Control register %d selected\n", device->tag(), idx));
478478         PLOG(("operation mode   = %s\n", opmode[ ptm6840->mode[idx] ]));
479479         PLOG(("value            = %04X\n", ptm6840->control_reg[idx]));
480480         PLOG(("t3divisor        = %d\n", ptm6840->t3_divisor));
r7553r7554
491491            /* Holding reset down */
492492            if (data & 0x01)
493493            {
494               PLOG(("MC6840 #%s : Timer reset\n", device->tag.cstr()));
494               PLOG(("MC6840 #%s : Timer reset\n", device->tag()));
495495               for (i = 0; i < 3; i++)
496496               {
497497                  timer_enable(ptm6840->timer[i], FALSE);
r7553r7554
519519      case PTM_6840_MSBBUF2:
520520      case PTM_6840_MSBBUF3:
521521      {
522         PLOG(("MC6840 #%s msbbuf%d = %02X\n", device->tag.cstr(), offset / 2, data));
522         PLOG(("MC6840 #%s msbbuf%d = %02X\n", device->tag(), offset / 2, data));
523523         ptm6840->msb_buffer = data;
524524         break;
525525      }
r7553r7554
539539         if (!(ptm6840->control_reg[idx] & 0x10))
540540            reload_count(device,idx);
541541
542         PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", cpuexec_describe_context(device->machine), device->tag.cstr(), idx, ptm6840->latch[idx]));
542         PLOG(("%s:MC6840 #%s: Counter %d latch = %04X\n", cpuexec_describe_context(device->machine), device->tag(), idx, ptm6840->latch[idx]));
543543         break;
544544      }
545545   }
r7553r7554
553553{
554554   ptm6840_state *ptm6840 = get_safe_token(device);
555555
556   PLOG(("**ptm6840 %s t%d timeout**\n", device->tag.cstr(), idx + 1));
556   PLOG(("**ptm6840 %s t%d timeout**\n", device->tag(), idx + 1));
557557
558558   if ( ptm6840->control_reg[idx] & 0x40 )
559559   {
r7553r7554
568568      if ((ptm6840->mode[idx] == 0)||(ptm6840->mode[idx] == 2))
569569      {
570570         ptm6840->output[idx] = ptm6840->output[idx] ? 0 : 1;
571         PLOG(("**ptm6840 %s t%d output %d **\n", device->tag.cstr(), idx + 1, ptm6840->output[idx]));
571         PLOG(("**ptm6840 %s t%d output %d **\n", device->tag(), idx + 1, ptm6840->output[idx]));
572572
573573         if (ptm6840->out_func[idx].write != NULL)
574574            devcb_call_write8(&ptm6840->out_func[idx], 0, ptm6840->output[idx]);
r7553r7554
578578         if (!ptm6840->fired[idx])
579579         {
580580            ptm6840->output[idx] = 1;
581            PLOG(("**ptm6840 %s t%d output %d **\n", device->tag.cstr(), idx + 1, ptm6840->output[idx]));
581            PLOG(("**ptm6840 %s t%d output %d **\n", device->tag(), idx + 1, ptm6840->output[idx]));
582582
583583            if (ptm6840->out_func[idx].write != NULL)
584584               devcb_call_write8(&ptm6840->out_func[idx], 0, ptm6840->output[idx]);
src/emu/machine/z80dma.c
r7553r7554
222222
223223      z80dma->status &= ~0x08;
224224
225      if (LOG) logerror("Z80DMA '%s' Interrupt Pending\n", device->tag.cstr());
225      if (LOG) logerror("Z80DMA '%s' Interrupt Pending\n", device->tag());
226226
227227      interrupt_check(z80dma);
228228   }
r7553r7554
390390      if(TRANSFER_MODE(z80dma) == TM_TRANSFER)     z80dma->status |= 0x10;   // no match found
391391
392392      z80dma_update_status(device);
393      if (LOG) logerror("Z80DMA '%s' End of Block\n", device->tag.cstr());
393      if (LOG) logerror("Z80DMA '%s' End of Block\n", device->tag());
394394
395395      if (INT_ON_END_OF_BLOCK(z80dma))
396396        {
r7553r7554
711711      state = Z80_DAISY_IEO;
712712   }
713713
714   if (LOG) logerror("Z80DMA '%s' Interrupt State: %u\n", device->tag.cstr(), state);
714   if (LOG) logerror("Z80DMA '%s' Interrupt State: %u\n", device->tag(), state);
715715
716716   return state;
717717}
r7553r7554
726726
727727   if (z80dma->ip)
728728   {
729       if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", device->tag.cstr());
729       if (LOG) logerror("Z80DMA '%s' Interrupt Acknowledge\n", device->tag());
730730
731731      /* clear interrupt pending flag */
732732      z80dma->ip = 0;
r7553r7554
756756
757757   if (z80dma->ius)
758758   {
759       if (LOG) logerror("Z80DMA '%s' Return from Interrupt\n", device->tag.cstr());
759       if (LOG) logerror("Z80DMA '%s' Return from Interrupt\n", device->tag());
760760
761761      /* clear interrupt under service flag */
762762      z80dma->ius = 0;
src/emu/machine/ins8154.c
r7553r7554
8080   if (offset > 0x24)
8181   {
8282      if (VERBOSE)
83         logerror("%s: INS8154 '%s' Read from invalid offset %02x!\n", cpuexec_describe_context(device->machine), device->tag.cstr(), offset);
83         logerror("%s: INS8154 '%s' Read from invalid offset %02x!\n", cpuexec_describe_context(device->machine), device->tag(), offset);
8484      return 0xff;
8585   }
8686
r7553r7554
146146   if (offset > 0x24)
147147   {
148148      if (VERBOSE)
149         logerror("%s: INS8154 '%s' Write %02x to invalid offset %02x!\n", cpuexec_describe_context(device->machine), device->tag.cstr(), data, offset);
149         logerror("%s: INS8154 '%s' Write %02x to invalid offset %02x!\n", cpuexec_describe_context(device->machine), device->tag(), data, offset);
150150      return;
151151   }
152152
r7553r7554
162162
163163   case 0x22:
164164      if (VERBOSE)
165         logerror("%s: INS8154 '%s' ODRA set to %02x\n", cpuexec_describe_context(device->machine), device->tag.cstr(), data);
165         logerror("%s: INS8154 '%s' ODRA set to %02x\n", cpuexec_describe_context(device->machine), device->tag(), data);
166166
167167      ins8154->odra = data;
168168      break;
169169
170170   case 0x23:
171171      if (VERBOSE)
172         logerror("%s: INS8154 '%s' ODRB set to %02x\n", cpuexec_describe_context(device->machine), device->tag.cstr(), data);
172         logerror("%s: INS8154 '%s' ODRB set to %02x\n", cpuexec_describe_context(device->machine), device->tag(), data);
173173
174174      ins8154->odrb = data;
175175      break;
176176
177177   case 0x24:
178178      if (VERBOSE)
179         logerror("%s: INS8154 '%s' MDR set to %02x\n", cpuexec_describe_context(device->machine), device->tag.cstr(), data);
179         logerror("%s: INS8154 '%s' MDR set to %02x\n", cpuexec_describe_context(device->machine), device->tag(), data);
180180
181181      ins8154->mdr = data;
182182      break;
r7553r7554
232232   devcb_resolve_write_line(&ins8154->out_irq_func, &intf->out_irq_func, device);
233233
234234   /* register for state saving */
235   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->in_a);
236   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->in_b);
237   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->out_a);
238   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->out_b);
239   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->mdr);
240   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->odra);
241   state_save_register_item(device->machine, "ins8154", device->tag, 0, ins8154->odrb);
235   state_save_register_device_item(device, 0, ins8154->in_a);
236   state_save_register_device_item(device, 0, ins8154->in_b);
237   state_save_register_device_item(device, 0, ins8154->out_a);
238   state_save_register_device_item(device, 0, ins8154->out_b);
239   state_save_register_device_item(device, 0, ins8154->mdr);
240   state_save_register_device_item(device, 0, ins8154->odra);
241   state_save_register_device_item(device, 0, ins8154->odrb);
242242}
243243
244244static DEVICE_RESET( ins8154 )
src/emu/machine/z80pio.c
r7553r7554
129129         {
130130            /* trigger interrupt */
131131            port->ip = 1;
132            if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Pending\n", device->tag.cstr(), 'A' + index);
132            if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Pending\n", device->tag(), 'A' + index);
133133         }
134134
135135         port->match = match;
r7553r7554
150150   pio_port *port = &z80pio->port[index];
151151
152152   port->ip = 1;
153   if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Pending\n", device->tag.cstr(), 'A' + index);
153   if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Pending\n", device->tag(), 'A' + index);
154154
155155   check_interrupts(device);
156156}
r7553r7554
162162
163163   if (port->rdy == state) return;
164164
165   if (LOG) logerror("Z80PIO '%s' Port %c Ready: %u\n", device->tag.cstr(), 'A' + index, state);
165   if (LOG) logerror("Z80PIO '%s' Port %c Ready: %u\n", device->tag(), 'A' + index, state);
166166
167167   port->rdy = state;
168168   devcb_call_write_line(&port->out_rdy_func, state);
r7553r7554
188188   z80pio_t *z80pio = get_safe_token(device);
189189   pio_port *port = &z80pio->port[index];
190190
191   if (LOG) logerror("Z80PIO '%s' Port %c Mode: %u\n", device->tag.cstr(), 'A' + index, mode);
191   if (LOG) logerror("Z80PIO '%s' Port %c Mode: %u\n", device->tag(), 'A' + index, mode);
192192
193193   switch (mode)
194194   {
r7553r7554
211211   case MODE_BIDIRECTIONAL:
212212      if (index == PORT_B)
213213      {
214         logerror("Z80PIO '%s' Port %c Invalid Mode: %u!\n", device->tag.cstr(), 'A' + index, mode);
214         logerror("Z80PIO '%s' Port %c Invalid Mode: %u!\n", device->tag(), 'A' + index, mode);
215215      }
216216      else
217217      {
r7553r7554
260260      {
261261         /* load interrupt vector */
262262         port->vector = data;
263         if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Vector: %02x\n", device->tag.cstr(), 'A' + index, data);
263         if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Vector: %02x\n", device->tag(), 'A' + index, data);
264264
265265         /* set interrupt enable */
266266         port->icw |= ICW_ENABLE_INT;
r7553r7554
280280
281281            if (LOG)
282282            {
283               logerror("Z80PIO '%s' Port %c Interrupt Enable: %u\n", device->tag.cstr(), 'A' + index, BIT(data, 7));
284               logerror("Z80PIO '%s' Port %c Logic: %s\n", device->tag.cstr(), 'A' + index, BIT(data, 6) ? "AND" : "OR");
285               logerror("Z80PIO '%s' Port %c Active %s\n", device->tag.cstr(), 'A' + index, BIT(data, 5) ? "High" : "Low");
286               logerror("Z80PIO '%s' Port %c Mask Follows: %u\n", device->tag.cstr(), 'A' + index, BIT(data, 4));
283               logerror("Z80PIO '%s' Port %c Interrupt Enable: %u\n", device->tag(), 'A' + index, BIT(data, 7));
284               logerror("Z80PIO '%s' Port %c Logic: %s\n", device->tag(), 'A' + index, BIT(data, 6) ? "AND" : "OR");
285               logerror("Z80PIO '%s' Port %c Active %s\n", device->tag(), 'A' + index, BIT(data, 5) ? "High" : "Low");
286               logerror("Z80PIO '%s' Port %c Mask Follows: %u\n", device->tag(), 'A' + index, BIT(data, 4));
287287            }
288288
289289            if (port->icw & ICW_MASK_FOLLOWS)
r7553r7554
305305
306306         case 0x03: /* set interrupt enable flip-flop */
307307            port->icw = (data & 0x80) | (port->icw & 0x7f);
308            if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Enable: %u\n", device->tag.cstr(), 'A' + index, BIT(data, 7));
308            if (LOG) logerror("Z80PIO '%s' Port %c Interrupt Enable: %u\n", device->tag(), 'A' + index, BIT(data, 7));
309309
310310            /* set interrupt enable */
311311            port->ie = BIT(port->icw, 7);
r7553r7554
313313            break;
314314
315315         default:
316            logerror("Z80PIO '%s' Port %c Invalid Control Word: %02x!\n", device->tag.cstr(), 'A' + index, data);
316            logerror("Z80PIO '%s' Port %c Invalid Control Word: %02x!\n", device->tag(), 'A' + index, data);
317317         }
318318      }
319319      break;
320320
321321   case IOR: /* data direction register */
322322      port->ior = data;
323      if (LOG) logerror("Z80PIO '%s' Port %c IOR: %02x\n", device->tag.cstr(), 'A' + index, data);
323      if (LOG) logerror("Z80PIO '%s' Port %c IOR: %02x\n", device->tag(), 'A' + index, data);
324324
325325      /* set interrupt enable */
326326      port->ie = BIT(port->icw, 7);
r7553r7554
332332
333333   case MASK: /* interrupt mask */
334334      port->mask = data;
335      if (LOG) logerror("Z80PIO '%s' Port %c Mask: %02x\n", device->tag.cstr(), 'A' + index, data);
335      if (LOG) logerror("Z80PIO '%s' Port %c Mask: %02x\n", device->tag(), 'A' + index, data);
336336
337337      /* set interrupt enable */
338338      port->ie = BIT(port->icw, 7);
r7553r7554
622622   z80pio_t *z80pio = get_safe_token(device);
623623   pio_port *port = &z80pio->port[index];
624624
625   if (LOG) logerror("Z80PIO '%s' Port %c Strobe: %u\n", device->tag.cstr(), 'A' + index, state);
625   if (LOG) logerror("Z80PIO '%s' Port %c Strobe: %u\n", device->tag(), 'A' + index, state);
626626
627627   if (z80pio->port[PORT_A].mode == MODE_BIDIRECTIONAL)
628628   {
r7553r7554
763763
764764      if (port->ip)
765765      {
766         if (LOG) logerror("Z80PIO '%s' Interrupt Acknowledge\n", device->tag.cstr());
766         if (LOG) logerror("Z80PIO '%s' Interrupt Acknowledge\n", device->tag());
767767
768768         /* clear interrupt pending flag */
769769         port->ip = 0;
r7553r7554
796796
797797      if (port->ius)
798798      {
799         if (LOG) logerror("Z80PIO '%s' Return from Interrupt\n", device->tag.cstr());
799         if (LOG) logerror("Z80PIO '%s' Return from Interrupt\n", device->tag());
800800
801801         /* clear interrupt under service flag */
802802         port->ius = 0;
src/emu/machine/adc083x.c
r7553r7554
117117
118118   if( adc083x->cs != state )
119119   {
120      verboselog( 2, device->machine, "adc083x_cs_write( %s, %d )\n", device->tag.cstr(), state );
120      verboselog( 2, device->machine, "adc083x_cs_write( %s, %d )\n", device->tag(), state );
121121   }
122122
123123   if( adc083x->cs == 0 && state != 0 )
r7553r7554
235235
236236   if( adc083x->clk != state )
237237   {
238      verboselog( 2, device->machine, "adc083x_clk_write( %s, %d )\n", device->tag.cstr(), state );
238      verboselog( 2, device->machine, "adc083x_clk_write( %s, %d )\n", device->tag(), state );
239239   }
240240
241241   if( adc083x->cs == 0 )
r7553r7554
247247         case STATE_WAIT_FOR_START:
248248            if( adc083x->di != 0 )
249249            {
250               verboselog( 1, device->machine, "adc083x %s got start bit\n", device->tag.cstr() );
250               verboselog( 1, device->machine, "adc083x %s got start bit\n", device->tag() );
251251               adc083x->state = STATE_SHIFT_MUX;
252252               adc083x->sars = 0;
253253               adc083x->sgl = 0;
r7553r7554
258258            }
259259            else
260260            {
261               verboselog( 1, device->machine, "adc083x %s not start bit\n", device->tag.cstr() );
261               verboselog( 1, device->machine, "adc083x %s not start bit\n", device->tag() );
262262            }
263263            break;
264264
r7553r7554
270270               {
271271                  adc083x->sgl = 1;
272272               }
273               verboselog( 1, device->machine, "adc083x %s sgl <- %d\n", device->tag.cstr(), adc083x->sgl );
273               verboselog( 1, device->machine, "adc083x %s sgl <- %d\n", device->tag(), adc083x->sgl );
274274               break;
275275
276276            case 1:
r7553r7554
278278               {
279279                  adc083x->odd = 1;
280280               }
281               verboselog( 1, device->machine, "adc083x %s odd <- %d\n", device->tag.cstr(), adc083x->odd );
281               verboselog( 1, device->machine, "adc083x %s odd <- %d\n", device->tag(), adc083x->odd );
282282               break;
283283
284284            case 2:
r7553r7554
286286               {
287287                  adc083x->sel1 = 1;
288288               }
289               verboselog( 1, device->machine, "adc083x %s sel1 <- %d\n", device->tag.cstr(), adc083x->sel1 );
289               verboselog( 1, device->machine, "adc083x %s sel1 <- %d\n", device->tag(), adc083x->sel1 );
290290               break;
291291
292292            case 3:
r7553r7554
294294               {
295295                  adc083x->sel0 = 1;
296296               }
297               verboselog( 1, device->machine, "adc083x %s sel0 <- %d\n", device->tag.cstr(), adc083x->sel0 );
297               verboselog( 1, device->machine, "adc083x %s sel0 <- %d\n", device->tag(), adc083x->sel0 );
298298               break;
299299            }
300300
r7553r7554
310310            adc083x->sars = 0;
311311            if( device->type == ADC0838 && adc083x->se != 0 )
312312            {
313               verboselog( 1, device->machine, "adc083x %s not se\n", device->tag.cstr() );
313               verboselog( 1, device->machine, "adc083x %s not se\n", device->tag() );
314314            }
315315            else
316316            {
317               verboselog( 1, device->machine, "adc083x %s got se\n", device->tag.cstr() );
317               verboselog( 1, device->machine, "adc083x %s got se\n", device->tag() );
318318               adc083x->state = STATE_OUTPUT_LSB_FIRST;
319319               adc083x->bit = 1;
320320            }
r7553r7554
327327         switch( adc083x->state )
328328         {
329329         case STATE_MUX_SETTLE:
330            verboselog( 1, device->machine, "adc083x %s mux settle\n", device->tag.cstr() );
330            verboselog( 1, device->machine, "adc083x %s mux settle\n", device->tag() );
331331            adc083x->output = adc083x_conversion( device );
332332            adc083x->state = STATE_OUTPUT_MSB_FIRST;
333333            adc083x->bit = 7;
r7553r7554
337337
338338         case STATE_OUTPUT_MSB_FIRST:
339339            adc083x->_do = ( adc083x->output >> adc083x->bit ) & 1;
340            verboselog( 1, device->machine, "adc083x %s msb %d -> %d\n", device->tag.cstr(), adc083x->bit, adc083x->_do );
340            verboselog( 1, device->machine, "adc083x %s msb %d -> %d\n", device->tag(), adc083x->bit, adc083x->_do );
341341
342342            adc083x->bit--;
343343            if( adc083x->bit < 0 )
r7553r7554
355355
356356         case STATE_OUTPUT_LSB_FIRST:
357357            adc083x->_do = ( adc083x->output >> adc083x->bit ) & 1;
358            verboselog( 1, device->machine, "adc083x %s lsb %d -> %d\n", device->tag.cstr(), adc083x->bit, adc083x->_do );
358            verboselog( 1, device->machine, "adc083x %s lsb %d -> %d\n", device->tag(), adc083x->bit, adc083x->_do );
359359
360360            adc083x->bit++;
361361            if( adc083x->bit == 8 )
r7553r7554
385385
386386   if( adc083x->di != state )
387387   {
388      verboselog( 2, device->machine, "adc083x_di_write( %s, %d )\n", device->tag.cstr(), state );
388      verboselog( 2, device->machine, "adc083x_di_write( %s, %d )\n", device->tag(), state );
389389   }
390390
391391   adc083x->di = state;
r7553r7554
401401
402402   if( adc083x->se != state )
403403   {
404      verboselog( 2, device->machine, "adc083x_se_write( %s, %d )\n", device->tag.cstr(), state );
404      verboselog( 2, device->machine, "adc083x_se_write( %s, %d )\n", device->tag(), state );
405405   }
406406
407407   adc083x->se = state;
r7553r7554
415415{
416416   adc0831_state *adc083x = get_safe_token( device );
417417
418   verboselog( 1, device->machine, "adc083x_sars_read( %s ) %d\n", device->tag.cstr(), adc083x->sars );
418   verboselog( 1, device->machine, "adc083x_sars_read( %s ) %d\n", device->tag(), adc083x->sars );
419419   return adc083x->sars;
420420}
421421
r7553r7554
427427{
428428   adc0831_state *adc083x = get_safe_token( device );
429429
430   verboselog( 1, device->machine, "adc083x_do_read( %s ) %d\n", device->tag.cstr(), adc083x->_do );
430   verboselog( 1, device->machine, "adc083x_do_read( %s ) %d\n", device->tag(), adc083x->_do );
431431   return adc083x->_do;
432432}
433433
src/emu/machine/z80sti.c
r7553r7554
336336      switch (z80sti->pvr & 0x07)
337337      {
338338      case Z80STI_REGISTER_IR_SCR:
339         LOG(("Z80STI '%s' Sync Character Register: %x\n", device->tag.cstr(), data));
339         LOG(("Z80STI '%s' Sync Character Register: %x\n", device->tag(), data));
340340         z80sti->scr = data;
341341         break;
342342
343343      case Z80STI_REGISTER_IR_TDDR:
344         LOG(("Z80STI '%s' Timer D Data Register: %x\n", device->tag.cstr(), data));
344         LOG(("Z80STI '%s' Timer D Data Register: %x\n", device->tag(), data));
345345         z80sti->tdr[TIMER_D] = data;
346346         break;
347347
348348      case Z80STI_REGISTER_IR_TCDR:
349         LOG(("Z80STI '%s' Timer C Data Register: %x\n", device->tag.cstr(), data));
349         LOG(("Z80STI '%s' Timer C Data Register: %x\n", device->tag(), data));
350350         z80sti->tdr[TIMER_C] = data;
351351         break;
352352
353353      case Z80STI_REGISTER_IR_AER:
354         LOG(("Z80STI '%s' Active Edge Register: %x\n", device->tag.cstr(), data));
354         LOG(("Z80STI '%s' Active Edge Register: %x\n", device->tag(), data));
355355         z80sti->aer = data;
356356         break;
357357
358358      case Z80STI_REGISTER_IR_IERB:
359         LOG(("Z80STI '%s' Interrupt Enable Register B: %x\n", device->tag.cstr(), data));
359         LOG(("Z80STI '%s' Interrupt Enable Register B: %x\n", device->tag(), data));
360360         z80sti->ier = (z80sti->ier & 0xff00) | data;
361361         check_interrupts(z80sti);
362362         break;
363363
364364      case Z80STI_REGISTER_IR_IERA:
365         LOG(("Z80STI '%s' Interrupt Enable Register A: %x\n", device->tag.cstr(), data));
365         LOG(("Z80STI '%s' Interrupt Enable Register A: %x\n", device->tag(), data));
366366         z80sti->ier = (data << 8) | (z80sti->ier & 0xff);
367367         check_interrupts(z80sti);
368368         break;
369369
370370      case Z80STI_REGISTER_IR_DDR:
371         LOG(("Z80STI '%s' Data Direction Register: %x\n", device->tag.cstr(), data));
371         LOG(("Z80STI '%s' Data Direction Register: %x\n", device->tag(), data));
372372         z80sti->ddr = data;
373373         break;
374374
r7553r7554
379379
380380         z80sti->tcdc = data;
381381
382         LOG(("Z80STI '%s' Timer C Prescaler: %u\n", device->tag.cstr(), tcc));
383         LOG(("Z80STI '%s' Timer D Prescaler: %u\n", device->tag.cstr(), tdc));
382         LOG(("Z80STI '%s' Timer C Prescaler: %u\n", device->tag(), tcc));
383         LOG(("Z80STI '%s' Timer D Prescaler: %u\n", device->tag(), tdc));
384384
385385         if (tcc)
386386            timer_adjust_periodic(z80sti->timer[TIMER_C], ATTOTIME_IN_HZ(device->clock / tcc), 0, ATTOTIME_IN_HZ(device->clock / tcc));
r7553r7554
394394
395395         if (BIT(data, 7))
396396         {
397            LOG(("Z80STI '%s' Timer A Reset\n", device->tag.cstr()));
397            LOG(("Z80STI '%s' Timer A Reset\n", device->tag()));
398398            z80sti->to[TIMER_A] = 0;
399399
400400            devcb_call_write_line(&z80sti->out_tao_func, z80sti->to[TIMER_A]);
r7553r7554
402402
403403         if (BIT(data, 3))
404404         {
405            LOG(("Z80STI '%s' Timer B Reset\n", device->tag.cstr()));
405            LOG(("Z80STI '%s' Timer B Reset\n", device->tag()));
406406            z80sti->to[TIMER_B] = 0;
407407
408408            devcb_call_write_line(&z80sti->out_tbo_func, z80sti->to[TIMER_B]);
r7553r7554
413413      break;
414414
415415   case Z80STI_REGISTER_GPIP:
416      LOG(("Z80STI '%s' General Purpose I/O Register: %x\n", device->tag.cstr(), data));
416      LOG(("Z80STI '%s' General Purpose I/O Register: %x\n", device->tag(), data));
417417      z80sti->gpip = data & z80sti->ddr;
418418      devcb_call_write8(&z80sti->out_gpio_func, 0, z80sti->gpip);
419419      break;
r7553r7554
421421   case Z80STI_REGISTER_IPRB:
422422      {
423423      int i;
424      LOG(("Z80STI '%s' Interrupt Pending Register B: %x\n", device->tag.cstr(), data));
424      LOG(("Z80STI '%s' Interrupt Pending Register B: %x\n", device->tag(), data));
425425      z80sti->ipr &= (z80sti->ipr & 0xff00) | data;
426426
427427      for (i = 0; i < 16; i++)
r7553r7554
436436   case Z80STI_REGISTER_IPRA:
437437      {
438438      int i;
439      LOG(("Z80STI '%s' Interrupt Pending Register A: %x\n", device->tag.cstr(), data));
439      LOG(("Z80STI '%s' Interrupt Pending Register A: %x\n", device->tag(), data));
440440      z80sti->ipr &= (data << 8) | (z80sti->ipr & 0xff);
441441
442442      for (i = 0; i < 16; i++)
r7553r7554
449449      break;
450450
451451   case Z80STI_REGISTER_ISRB:
452      LOG(("Z80STI '%s' Interrupt In-Service Register B: %x\n", device->tag.cstr(), data));
452      LOG(("Z80STI '%s' Interrupt In-Service Register B: %x\n", device->tag(), data));
453453      z80sti->isr &= (z80sti->isr & 0xff00) | data;
454454      break;
455455
456456   case Z80STI_REGISTER_ISRA:
457      LOG(("Z80STI '%s' Interrupt In-Service Register A: %x\n", device->tag.cstr(), data));
457      LOG(("Z80STI '%s' Interrupt In-Service Register A: %x\n", device->tag(), data));
458458      z80sti->isr &= (data << 8) | (z80sti->isr & 0xff);
459459      break;
460460
461461   case Z80STI_REGISTER_IMRB:
462      LOG(("Z80STI '%s' Interrupt Mask Register B: %x\n", device->tag.cstr(), data));
462      LOG(("Z80STI '%s' Interrupt Mask Register B: %x\n", device->tag(), data));
463463      z80sti->imr = (z80sti->imr & 0xff00) | data;
464464      z80sti->isr &= z80sti->imr;
465465      check_interrupts(z80sti);
466466      break;
467467
468468   case Z80STI_REGISTER_IMRA:
469      LOG(("Z80STI '%s' Interrupt Mask Register A: %x\n", device->tag.cstr(), data));
469      LOG(("Z80STI '%s' Interrupt Mask Register A: %x\n", device->tag(), data));
470470      z80sti->imr = (data << 8) | (z80sti->imr & 0xff);
471471      z80sti->isr &= z80sti->imr;
472472      check_interrupts(z80sti);
473473      break;
474474
475475   case Z80STI_REGISTER_PVR:
476      LOG(("Z80STI '%s' Interrupt Vector: %02x\n", device->tag.cstr(), data & 0xe0));
477      LOG(("Z80STI '%s' IR Address: %01x\n", device->tag.cstr(), data & 0x07));
476      LOG(("Z80STI '%s' Interrupt Vector: %02x\n", device->tag(), data & 0xe0));
477      LOG(("Z80STI '%s' IR Address: %01x\n", device->tag(), data & 0x07));
478478      z80sti->pvr = data;
479479      break;
480480
r7553r7554
485485
486486      z80sti->tabc = data;
487487
488      LOG(("Z80STI '%s' Timer A Prescaler: %u\n", device->tag.cstr(), tac));
489      LOG(("Z80STI '%s' Timer B Prescaler: %u\n", device->tag.cstr(), tbc));
488      LOG(("Z80STI '%s' Timer A Prescaler: %u\n", device->tag(), tac));
489      LOG(("Z80STI '%s' Timer B Prescaler: %u\n", device->tag(), tbc));
490490
491491      if (tac)
492492         timer_adjust_periodic(z80sti->timer[TIMER_A], ATTOTIME_IN_HZ(device->clock / tac), 0, ATTOTIME_IN_HZ(device->clock / tac));
r7553r7554
501501      break;
502502
503503   case Z80STI_REGISTER_TBDR:
504      LOG(("Z80STI '%s' Timer B Data Register: %x\n", device->tag.cstr(), data));
504      LOG(("Z80STI '%s' Timer B Data Register: %x\n", device->tag(), data));
505505      z80sti->tdr[TIMER_B] = data;
506506      break;
507507
508508   case Z80STI_REGISTER_TADR:
509      LOG(("Z80STI '%s' Timer A Data Register: %x\n", device->tag.cstr(), data));
509      LOG(("Z80STI '%s' Timer A Data Register: %x\n", device->tag(), data));
510510      z80sti->tdr[TIMER_A] = data;
511511      break;
512512#if 0
r7553r7554
527527        break;
528528#endif
529529   default:
530      LOG(("Z80STI '%s' Unsupported Register %x\n", device->tag.cstr(), offset & 0x0f));
530      LOG(("Z80STI '%s' Unsupported Register %x\n", device->tag(), offset & 0x0f));
531531   }
532532}
533533
r7553r7554
584584
585585      if (z80sti->ier & (1 << INT_LEVEL_TIMER[index]))
586586      {
587         LOG(("Z80STI '%s' Interrupt Pending for Timer %c\n", device->tag.cstr(), 'A' + index));
587         LOG(("Z80STI '%s' Interrupt Pending for Timer %c\n", device->tag(), 'A' + index));
588588
589589         /* signal timer elapsed interrupt */
590590         take_interrupt(z80sti, INT_LEVEL_TIMER[index]);
r7553r7554
622622
623623   if ((old_state ^ aer) && !(state ^ aer))
624624   {
625      LOG(("Z80STI '%s' Edge Transition Detected on Bit: %u\n", device->tag.cstr(), bit));
625      LOG(("Z80STI '%s' Edge Transition Detected on Bit: %u\n", device->tag(), bit));
626626
627627      if (z80sti->ier & (1 << INT_LEVEL_GPIP[bit]))
628628      {
629         LOG(("Z80STI '%s' Interrupt Pending for P%u\n", device->tag.cstr(), bit));
629         LOG(("Z80STI '%s' Interrupt Pending for P%u\n", device->tag(), bit));
630630
631631         take_interrupt(z80sti, INT_LEVEL_GPIP[bit]);
632632      }
r7553r7554
673673      }
674674   }
675675
676   LOG(("Z80STI '%s' Interrupt State: %u\n", device->tag.cstr(), state));
676   LOG(("Z80STI '%s' Interrupt State: %u\n", device->tag(), state));
677677
678678   return state;
679679}
r7553r7554
706706
707707         check_interrupts(z80sti);
708708
709         LOG(("Z80STI '%s' Interrupt Acknowledge Vector: %02x\n", device->tag.cstr(), vector));
709         LOG(("Z80STI '%s' Interrupt Acknowledge Vector: %02x\n", device->tag(), vector));
710710
711711         return vector;
712712      }
r7553r7554
726726   z80sti_t *z80sti = get_safe_token(device);
727727   int i;
728728
729   LOG(("Z80STI '%s' Return from Interrupt\n", device->tag.cstr()));
729   LOG(("Z80STI '%s' Return from Interrupt\n", device->tag()));
730730
731731   /* loop over all interrupt sources */
732732   for (i = 15; i >= 0; i--)
src/emu/machine/z80dart.c
r7553r7554
242242   UINT8 vector = ch->wr[2];
243243   int priority = (channel << 2) | level;
244244
245   LOG(("Z80DART \"%s\" Channel %c : Interrupt Request %u\n", device->tag.cstr(), 'A' + channel, level));
245   LOG(("Z80DART \"%s\" Channel %c : Interrupt Request %u\n", device->tag(), 'A' + channel, level));
246246
247247   if ((channel == Z80DART_CH_B) && (ch->wr[1] & Z80DART_WR1_STATUS_VECTOR))
248248   {
r7553r7554
696696      break;
697697   }
698698
699   LOG(("Z80DART \"%s\" Channel %c : Control Register Read '%02x'\n", device->tag.cstr(), 'A' + channel, data));
699   LOG(("Z80DART \"%s\" Channel %c : Control Register Read '%02x'\n", device->tag(), 'A' + channel, data));
700700
701701   return data;
702702}
r7553r7554
713713
714714   int reg = ch->wr[0] & Z80DART_WR0_REGISTER_MASK;
715715
716   LOG(("Z80DART \"%s\" Channel %c : Control Register Write '%02x'\n", device->tag.cstr(), 'A' + channel, data));
716   LOG(("Z80DART \"%s\" Channel %c : Control Register Write '%02x'\n", device->tag(), 'A' + channel, data));
717717
718718   /* write data to selected register */
719719   ch->wr[reg] = data;
r7553r7554
739739
740740         ch->rx_rr0_latch = 0;
741741
742         LOG(("Z80DART \"%s\" Channel %c : Reset External/Status Interrupt\n", device->tag.cstr(), 'A' + channel));
742         LOG(("Z80DART \"%s\" Channel %c : Reset External/Status Interrupt\n", device->tag(), 'A' + channel));
743743         break;
744744
745745      case Z80DART_WR0_CHANNEL_RESET:
746746         /* channel reset */
747         LOG(("Z80DART \"%s\" Channel %c : Channel Reset\n", device->tag.cstr(), 'A' + channel));
747         LOG(("Z80DART \"%s\" Channel %c : Channel Reset\n", device->tag(), 'A' + channel));
748748         reset_channel(device, channel);
749749         break;
750750
751751      case Z80DART_WR0_ENABLE_INT_NEXT_RX:
752752         /* enable interrupt on next receive character */
753         LOG(("Z80DART \"%s\" Channel %c : Enable Interrupt on Next Received Character\n", device->tag.cstr(), 'A' + channel));
753         LOG(("Z80DART \"%s\" Channel %c : Enable Interrupt on Next Received Character\n", device->tag(), 'A' + channel));
754754         ch->rx_first = 1;
755755         break;
756756
757757      case Z80DART_WR0_RESET_TX_INT:
758758         /* reset transmitter interrupt pending */
759         LOG(("Z80DART \"%s\" Channel %c : Reset Transmitter Interrupt Pending\n", device->tag.cstr(), 'A' + channel));
759         LOG(("Z80DART \"%s\" Channel %c : Reset Transmitter Interrupt Pending\n", device->tag(), 'A' + channel));
760760         break;
761761
762762      case Z80DART_WR0_ERROR_RESET:
763763         /* error reset */
764         LOG(("Z80DART \"%s\" Channel %c : Error Reset\n", device->tag.cstr(), 'A' + channel));
764         LOG(("Z80DART \"%s\" Channel %c : Error Reset\n", device->tag(), 'A' + channel));
765765         ch->rr[1] &= ~(Z80DART_RR1_FRAMING_ERROR | Z80DART_RR1_RX_OVERRUN_ERROR | Z80DART_RR1_PARITY_ERROR);
766766         break;
767767
768768      case Z80DART_WR0_RETURN_FROM_INT:
769769         /* return from interrupt */
770         LOG(("Z80DART \"%s\" Channel %c : Return from Interrupt\n", device->tag.cstr(), 'A' + channel));
770         LOG(("Z80DART \"%s\" Channel %c : Return from Interrupt\n", device->tag(), 'A' + channel));
771771         z80dart_irq_reti(device);
772772         break;
773773      }
774774      break;
775775
776776   case 1:
777      LOG(("Z80DART \"%s\" Channel %c : External Interrupt Enable %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR1_EXT_INT_ENABLE) ? 1 : 0));
778      LOG(("Z80DART \"%s\" Channel %c : Transmit Interrupt Enable %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR1_TX_INT_ENABLE) ? 1 : 0));
779      LOG(("Z80DART \"%s\" Channel %c : Status Affects Vector %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR1_STATUS_VECTOR) ? 1 : 0));
780      LOG(("Z80DART \"%s\" Channel %c : Wait/Ready Enable %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR1_WRDY_ENABLE) ? 1 : 0));
777      LOG(("Z80DART \"%s\" Channel %c : External Interrupt Enable %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR1_EXT_INT_ENABLE) ? 1 : 0));
778      LOG(("Z80DART \"%s\" Channel %c : Transmit Interrupt Enable %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR1_TX_INT_ENABLE) ? 1 : 0));
779      LOG(("Z80DART \"%s\" Channel %c : Status Affects Vector %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR1_STATUS_VECTOR) ? 1 : 0));
780      LOG(("Z80DART \"%s\" Channel %c : Wait/Ready Enable %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR1_WRDY_ENABLE) ? 1 : 0));
781781
782782      switch (data & Z80DART_WR1_RX_INT_ENABLE_MASK)
783783      {
784784      case Z80DART_WR1_RX_INT_DISABLE:
785         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt Disabled\n", device->tag.cstr(), 'A' + channel));
785         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt Disabled\n", device->tag(), 'A' + channel));
786786         break;
787787
788788      case Z80DART_WR1_RX_INT_FIRST:
789         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt on First Character\n", device->tag.cstr(), 'A' + channel));
789         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt on First Character\n", device->tag(), 'A' + channel));
790790         break;
791791
792792      case Z80DART_WR1_RX_INT_ALL_PARITY:
793         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt on All Characters, Parity Affects Vector\n", device->tag.cstr(), 'A' + channel));
793         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt on All Characters, Parity Affects Vector\n", device->tag(), 'A' + channel));
794794         break;
795795
796796      case Z80DART_WR1_RX_INT_ALL:
797         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt on All Characters\n", device->tag.cstr(), 'A' + channel));
797         LOG(("Z80DART \"%s\" Channel %c : Receiver Interrupt on All Characters\n", device->tag(), 'A' + channel));
798798         break;
799799      }
800800
r7553r7554
804804   case 2:
805805      /* interrupt vector */
806806      check_interrupts(device);
807      LOG(("Z80DART \"%s\" Channel %c : Interrupt Vector %02x\n", device->tag.cstr(), 'A' + channel, data));
807      LOG(("Z80DART \"%s\" Channel %c : Interrupt Vector %02x\n", device->tag(), 'A' + channel, data));
808808      break;
809809
810810   case 3:
811      LOG(("Z80DART \"%s\" Channel %c : Receiver Enable %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR3_RX_ENABLE) ? 1 : 0));
812      LOG(("Z80DART \"%s\" Channel %c : Auto Enables %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR3_AUTO_ENABLES) ? 1 : 0));
813      LOG(("Z80DART \"%s\" Channel %c : Receiver Bits/Character %u\n", device->tag.cstr(), 'A' + channel, get_rx_word_length(ch)));
811      LOG(("Z80DART \"%s\" Channel %c : Receiver Enable %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR3_RX_ENABLE) ? 1 : 0));
812      LOG(("Z80DART \"%s\" Channel %c : Auto Enables %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR3_AUTO_ENABLES) ? 1 : 0));
813      LOG(("Z80DART \"%s\" Channel %c : Receiver Bits/Character %u\n", device->tag(), 'A' + channel, get_rx_word_length(ch)));
814814      break;
815815
816816   case 4:
817      LOG(("Z80DART \"%s\" Channel %c : Parity Enable %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR4_PARITY_ENABLE) ? 1 : 0));
818      LOG(("Z80DART \"%s\" Channel %c : Parity %s\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR4_PARITY_EVEN) ? "Even" : "Odd"));
819      LOG(("Z80DART \"%s\" Channel %c : Stop Bits %f\n", device->tag.cstr(), 'A' + channel, get_stop_bits(ch)));
820      LOG(("Z80DART \"%s\" Channel %c : Clock Mode %uX\n", device->tag.cstr(), 'A' + channel, get_clock_mode(ch)));
817      LOG(("Z80DART \"%s\" Channel %c : Parity Enable %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR4_PARITY_ENABLE) ? 1 : 0));
818      LOG(("Z80DART \"%s\" Channel %c : Parity %s\n", device->tag(), 'A' + channel, (data & Z80DART_WR4_PARITY_EVEN) ? "Even" : "Odd"));
819      LOG(("Z80DART \"%s\" Channel %c : Stop Bits %f\n", device->tag(), 'A' + channel, get_stop_bits(ch)));
820      LOG(("Z80DART \"%s\" Channel %c : Clock Mode %uX\n", device->tag(), 'A' + channel, get_clock_mode(ch)));
821821      break;
822822
823823   case 5:
824      LOG(("Z80DART \"%s\" Channel %c : Transmitter Enable %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR5_TX_ENABLE) ? 1 : 0));
825      LOG(("Z80DART \"%s\" Channel %c : Transmitter Bits/Character %u\n", device->tag.cstr(), 'A' + channel, get_tx_word_length(ch)));
826      LOG(("Z80DART \"%s\" Channel %c : Send Break %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR5_SEND_BREAK) ? 1 : 0));
827      LOG(("Z80DART \"%s\" Channel %c : Request to Send %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR5_RTS) ? 1 : 0));
828      LOG(("Z80DART \"%s\" Channel %c : Data Terminal Ready %u\n", device->tag.cstr(), 'A' + channel, (data & Z80DART_WR5_DTR) ? 1 : 0));
824      LOG(("Z80DART \"%s\" Channel %c : Transmitter Enable %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR5_TX_ENABLE) ? 1 : 0));
825      LOG(("Z80DART \"%s\" Channel %c : Transmitter Bits/Character %u\n", device->tag(), 'A' + channel, get_tx_word_length(ch)));
826      LOG(("Z80DART \"%s\" Channel %c : Send Break %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR5_SEND_BREAK) ? 1 : 0));
827      LOG(("Z80DART \"%s\" Channel %c : Request to Send %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR5_RTS) ? 1 : 0));
828      LOG(("Z80DART \"%s\" Channel %c : Data Terminal Ready %u\n", device->tag(), 'A' + channel, (data & Z80DART_WR5_DTR) ? 1 : 0));
829829
830830      if (data & Z80DART_WR5_RTS)
831831      {
r7553r7554
876876      }
877877   }
878878
879   LOG(("Z80DART \"%s\" Channel %c : Data Register Read '%02x'\n", device->tag.cstr(), 'A' + channel, data));
879   LOG(("Z80DART \"%s\" Channel %c : Data Register Read '%02x'\n", device->tag(), 'A' + channel, data));
880880
881881   return data;
882882}
r7553r7554
896896   ch->rr[0] &= ~Z80DART_RR0_TX_BUFFER_EMPTY;
897897   ch->rr[1] &= ~Z80DART_RR1_ALL_SENT;
898898
899   LOG(("Z80DART \"%s\" Channel %c : Data Register Write '%02x'\n", device->tag.cstr(), 'A' + channel, data));
899   LOG(("Z80DART \"%s\" Channel %c : Data Register Write '%02x'\n", device->tag(), 'A' + channel, data));
900900}
901901
902902/*-------------------------------------------------
r7553r7554
908908   z80dart_t *z80dart = get_safe_token(device);
909909   dart_channel *ch = &z80dart->channel[channel];
910910
911   LOG(("Z80DART \"%s\" Channel %c : Receive Data Byte '%02x'\n", device->tag.cstr(), 'A' + channel, data));
911   LOG(("Z80DART \"%s\" Channel %c : Receive Data Byte '%02x'\n", device->tag(), 'A' + channel, data));
912912
913913   if (ch->rx_fifo == 2)
914914   {
r7553r7554
969969   z80dart_t *z80dart = get_safe_token(device);
970970   dart_channel *ch = &z80dart->channel[channel];
971971
972   LOG(("Z80DART \"%s\" Channel %c : CTS %u\n", device->tag.cstr(), 'A' + channel, state));
972   LOG(("Z80DART \"%s\" Channel %c : CTS %u\n", device->tag(), 'A' + channel, state));
973973
974974   if (ch->cts != state)
975975   {
r7553r7554
10281028   z80dart_t *z80dart = get_safe_token(device);
10291029   dart_channel *ch = &z80dart->channel[channel];
10301030
1031   LOG(("Z80DART \"%s\" Channel %c : DCD %u\n", device->tag.cstr(), 'A' + channel, state));
1031   LOG(("Z80DART \"%s\" Channel %c : DCD %u\n", device->tag(), 'A' + channel, state));
10321032
10331033   if (ch->dcd != state)
10341034   {
r7553r7554
10881088   z80dart_t *z80dart = get_safe_token(device);
10891089   dart_channel *ch = &z80dart->channel[channel];
10901090
1091   LOG(("Z80DART \"%s\" Channel %c : RI %u\n", device->tag.cstr(), 'A' + channel, state));
1091   LOG(("Z80DART \"%s\" Channel %c : RI %u\n", device->tag(), 'A' + channel, state));
10921092
10931093   if (ch->ri != state)
10941094   {
r7553r7554
11451145
11461146   if (!state) return;
11471147
1148   LOG(("Z80DART \"%s\" Channel A : Receiver Clock Pulse\n", device->tag.cstr()));
1148   LOG(("Z80DART \"%s\" Channel A : Receiver Clock Pulse\n", device->tag()));
11491149
11501150   ch->rx_clock++;
11511151
r7553r7554
11711171
11721172   if (!state) return;
11731173
1174   LOG(("Z80DART \"%s\" Channel A : Transmitter Clock Pulse\n", device->tag.cstr()));
1174   LOG(("Z80DART \"%s\" Channel A : Transmitter Clock Pulse\n", device->tag()));
11751175
11761176   ch->tx_clock++;
11771177
r7553r7554
11981198
11991199   if (!state) return;
12001200
1201   LOG(("Z80DART \"%s\" Channel A : Receiver/Transmitter Clock Pulse\n", device->tag.cstr()));
1201   LOG(("Z80DART \"%s\" Channel A : Receiver/Transmitter Clock Pulse\n", device->tag()));
12021202
12031203   ch->rx_clock++;
12041204   ch->tx_clock++;
r7553r7554
12511251   int state = 0;
12521252   int i;
12531253
1254   LOG(("Z80DART \"%s\" : Interrupt State B:%d%d%d%d A:%d%d%d%d\n", device->tag.cstr(),
1254   LOG(("Z80DART \"%s\" : Interrupt State B:%d%d%d%d A:%d%d%d%d\n", device->tag(),
12551255            z80dart->int_state[0], z80dart->int_state[1], z80dart->int_state[2], z80dart->int_state[3],
12561256            z80dart->int_state[4], z80dart->int_state[5], z80dart->int_state[6], z80dart->int_state[7]));
12571257
r7553r7554
12671267      state |= z80dart->int_state[i];
12681268   }
12691269
1270   LOG(("Z80DART \"%s\" : Interrupt State %u\n", device->tag.cstr(), state));
1270   LOG(("Z80DART \"%s\" : Interrupt State %u\n", device->tag(), state));
12711271
12721272   return state;
12731273}
r7553r7554
12811281   z80dart_t *z80dart = get_safe_token( device );
12821282   int i;
12831283
1284   LOG(("Z80DART \"%s\" Interrupt Acknowledge\n", device->tag.cstr()));
1284   LOG(("Z80DART \"%s\" Interrupt Acknowledge\n", device->tag()));
12851285
12861286   /* loop over all interrupt sources */
12871287   for (i = 0; i < 8; i++)
r7553r7554
12941294         z80dart->channel[Z80DART_CH_A].rr[0] &= ~Z80DART_RR0_INTERRUPT_PENDING;
12951295         check_interrupts(device);
12961296
1297         LOG(("Z80DART \"%s\" : Interrupt Acknowledge Vector %02x\n", device->tag.cstr(), z80dart->channel[Z80DART_CH_B].rr[2]));
1297         LOG(("Z80DART \"%s\" : Interrupt Acknowledge Vector %02x\n", device->tag(), z80dart->channel[Z80DART_CH_B].rr[2]));
12981298
12991299         return z80dart->channel[Z80DART_CH_B].rr[2];
13001300      }
r7553r7554
13141314   z80dart_t *z80dart = get_safe_token( device );
13151315   int i;
13161316
1317   LOG(("Z80DART \"%s\" Return from Interrupt\n", device->tag.cstr()));
1317   LOG(("Z80DART \"%s\" Return from Interrupt\n", device->tag()));
13181318
13191319   /* loop over all interrupt sources */
13201320   for (i = 0; i < 8; i++)
r7553r7554
14631463{
14641464   int channel;
14651465
1466   LOG(("Z80DART \"%s\" Reset\n", device->tag.cstr()));
1466   LOG(("Z80DART \"%s\" Reset\n", device->tag()));
14671467
14681468   for (channel = Z80DART_CH_A; channel <= Z80DART_CH_B; channel++)
14691469   {
src/emu/machine/ldcore.c
r7553r7554
11411141         int changed = FALSE;
11421142
11431143         /* output the basics */
1144         xml_set_attribute(ldnode, "tag", device->tag);
1144         xml_set_attribute(ldnode, "tag", device->tag());
11451145
11461146         /* add an overlay node */
11471147         overnode = xml_add_child(ldnode, "overlay", NULL);
r7553r7554
13331333   if (config->getdisc != NULL)
13341334      ldcore->disc = (*config->getdisc)(device);
13351335   else
1336      ldcore->disc = get_disk_handle(device->machine, device->tag);
1336      ldcore->disc = get_disk_handle(device->machine, device->tag());
13371337
13381338   /* set default parameters */
13391339   ldcore->width = 720;
src/emu/machine/i8255a.c
r7553r7554
476476      case MODE_1: data = read_mode1(i8255a, PORT_A); break;
477477      case MODE_2: data = read_mode2(i8255a); break;
478478      }
479      if (LOG) logerror("8255A '%s' Port A Read: %02x\n", device->tag.cstr(), data);
479      if (LOG) logerror("8255A '%s' Port A Read: %02x\n", device->tag(), data);
480480      break;
481481
482482   case PORT_B:
r7553r7554
485485      case MODE_0: data = read_mode0(i8255a, PORT_B); break;
486486      case MODE_1: data = read_mode1(i8255a, PORT_B); break;
487487      }
488      if (LOG) logerror("8255A '%s' Port B Read: %02x\n", device->tag.cstr(), data);
488      if (LOG) logerror("8255A '%s' Port B Read: %02x\n", device->tag(), data);
489489      break;
490490
491491   case PORT_C:
492492      data = read_pc(i8255a);
493      //if (LOG) logerror("8255A '%s' Port C Read: %02x\n", device->tag.cstr(), data);
493      //if (LOG) logerror("8255A '%s' Port C Read: %02x\n", device->tag(), data);
494494      break;
495495
496496   case CONTROL:
497497      data = i8255a->control;
498      if (LOG) logerror("8255A '%s' Mode Control Word Read: %02x\n", device->tag.cstr(), data);
498      if (LOG) logerror("8255A '%s' Mode Control Word Read: %02x\n", device->tag(), data);
499499      break;
500500   }
501501
r7553r7554
599599      devcb_call_write8(&i8255a->out_port_func[PORT_A], 0, 0xff);
600600   }
601601
602   if (LOG) logerror("8255A '%s' Group A Mode: %u\n", device->tag.cstr(), group_mode(i8255a, GROUP_A));
603   if (LOG) logerror("8255A '%s' Port A Mode: %s\n", device->tag.cstr(), (port_mode(i8255a, PORT_A) == MODE_OUTPUT) ? "output" : "input");
604   if (LOG) logerror("8255A '%s' Port C Upper Mode: %s\n", device->tag.cstr(), (port_c_upper_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
605   if (LOG) logerror("8255A '%s' Group B Mode: %u\n", device->tag.cstr(), group_mode(i8255a, GROUP_B));
606   if (LOG) logerror("8255A '%s' Port B Mode: %s\n", device->tag.cstr(), (port_mode(i8255a, PORT_B) == MODE_OUTPUT) ? "output" : "input");
607   if (LOG) logerror("8255A '%s' Port C Lower Mode: %s\n", device->tag.cstr(), (port_c_lower_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
602   if (LOG) logerror("8255A '%s' Group A Mode: %u\n", device->tag(), group_mode(i8255a, GROUP_A));
603   if (LOG) logerror("8255A '%s' Port A Mode: %s\n", device->tag(), (port_mode(i8255a, PORT_A) == MODE_OUTPUT) ? "output" : "input");
604   if (LOG) logerror("8255A '%s' Port C Upper Mode: %s\n", device->tag(), (port_c_upper_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
605   if (LOG) logerror("8255A '%s' Group B Mode: %u\n", device->tag(), group_mode(i8255a, GROUP_B));
606   if (LOG) logerror("8255A '%s' Port B Mode: %s\n", device->tag(), (port_mode(i8255a, PORT_B) == MODE_OUTPUT) ? "output" : "input");
607   if (LOG) logerror("8255A '%s' Port C Lower Mode: %s\n", device->tag(), (port_c_lower_mode(i8255a) == MODE_OUTPUT) ? "output" : "input");
608608
609609   /* group B */
610610   i8255a->output[PORT_B] = 0;
r7553r7554
697697   switch (offset & 0x03)
698698   {
699699   case PORT_A:
700      if (LOG) logerror("8255A '%s' Port A Write: %02x\n", device->tag.cstr(), data);
700      if (LOG) logerror("8255A '%s' Port A Write: %02x\n", device->tag(), data);
701701
702702      switch (group_mode(i8255a, GROUP_A))
703703      {
r7553r7554
708708      break;
709709
710710   case PORT_B:
711      if (LOG) logerror("8255A '%s' Port B Write: %02x\n", device->tag.cstr(), data);
711      if (LOG) logerror("8255A '%s' Port B Write: %02x\n", device->tag(), data);
712712
713713      switch (group_mode(i8255a, GROUP_B))
714714      {
r7553r7554
718718      break;
719719
720720   case PORT_C:
721      if (LOG) logerror("8255A '%s' Port C Write: %02x\n", device->tag.cstr(), data);
721      if (LOG) logerror("8255A '%s' Port C Write: %02x\n", device->tag(), data);
722722
723723      write_pc(i8255a, data);
724724      break;
r7553r7554
726726   case CONTROL:
727727      if (data & I8255A_CONTROL_MODE_SET)
728728      {
729         if (LOG) logerror("8255A '%s' Mode Control Word: %02x\n", device->tag.cstr(), data);
729         if (LOG) logerror("8255A '%s' Mode Control Word: %02x\n", device->tag(), data);
730730
731731         set_mode(device, data);
732732      }
r7553r7554
735735         int bit = (data >> 1) & 0x07;
736736         int state = BIT(data, 0);
737737
738         if (LOG) logerror("8255A '%s' %s Bit %u\n", device->tag.cstr(), state ? "Set" : "Reset", bit);
738         if (LOG) logerror("8255A '%s' %s Bit %u\n", device->tag(), state ? "Set" : "Reset", bit);
739739
740740         set_pc_bit(device, bit, state);
741741      }
r7553r7554
782782         /* port B acknowledge */
783783         if (!i8255a->obf[PORT_B] && !state)
784784         {
785            if (LOG) logerror("8255A '%s' Port B Acknowledge\n", device->tag.cstr());
785            if (LOG) logerror("8255A '%s' Port B Acknowledge\n", device->tag());
786786
787787            /* clear output buffer flag */
788788            set_obf(i8255a, PORT_B, 1);
r7553r7554
793793         /* port B strobe */
794794         if (!i8255a->ibf[PORT_B] && !state)
795795         {
796            if (LOG) logerror("8255A '%s' Port B Strobe\n", device->tag.cstr());
796            if (LOG) logerror("8255A '%s' Port B Strobe\n", device->tag());
797797
798798            /* read port into latch */
799799            i8255a->input[PORT_B] = devcb_call_read8(&i8255a->in_port_func[PORT_B], 0);
r7553r7554
814814      /* port A strobe */
815815      if (!i8255a->ibf[PORT_A] && !state)
816816      {
817         if (LOG) logerror("8255A '%s' Port A Strobe\n", device->tag.cstr());
817         if (LOG) logerror("8255A '%s' Port A Strobe\n", device->tag());
818818
819819         /* read port into latch */
820820         i8255a->input[PORT_A] = devcb_call_read8(&i8255a->in_port_func[PORT_A], 0);
r7553r7554
834834      /* port A acknowledge */
835835      if (!i8255a->obf[PORT_A] && !state)
836836      {
837         if (LOG) logerror("8255A '%s' Port A Acknowledge\n", device->tag.cstr());
837         if (LOG) logerror("8255A '%s' Port A Acknowledge\n", device->tag());
838838
839839         /* clear output buffer flag */
840840         set_obf(i8255a, PORT_A, 1);
src/emu/machine/latch8.c
r7553r7554
197197      if (latch8->intf->node_map[i] )
198198      {
199199         if (!latch8->intf->node_device[i])
200            fatalerror("Device %s: Bit %d has invalid discrete device\n", device->tag.cstr(), i);
200            fatalerror("Device %s: Bit %d has invalid discrete device\n", device->tag(), i);
201201         latch8->has_node_map = 1;
202202      }
203203
r7553r7554
206206      if (latch8->intf->devread[i].tag != NULL)
207207      {
208208         if (latch8->devices[i] != NULL)
209            fatalerror("Device %s: Bit %d already has a handler.\n", device->tag.cstr(), i);
209            fatalerror("Device %s: Bit %d already has a handler.\n", device->tag(), i);
210210         latch8->devices[i] = device->machine->device(latch8->intf->devread[i].tag);
211211         if (latch8->devices[i] == NULL)
212            fatalerror("Device %s: Unable to find device %s\n", device->tag.cstr(), latch8->intf->devread[i].tag);
212            fatalerror("Device %s: Unable to find device %s\n", device->tag(), latch8->intf->devread[i].tag);
213213         latch8->has_devread = 1;
214214      }
215215
r7553r7554
218218      if (latch8->intf->devread[i].read_handler != NULL)
219219      {
220220         if (latch8->devices[i] != NULL)
221            fatalerror("Device %s: Bit %d already has a handler.\n", device->tag.cstr(), i);
221            fatalerror("Device %s: Bit %d already has a handler.\n", device->tag(), i);
222222         latch8->has_read = 1;
223223      }
224224
src/emu/machine/eeprom.c
r7553r7554
361361      if (device->region != NULL)
362362      {
363363         if (device->region->length != eeprom_bytes)
364            fatalerror("eeprom region '%s' wrong size (expected size = 0x%X)", device->tag.cstr(), eeprom_bytes);
364            fatalerror("eeprom region '%s' wrong size (expected size = 0x%X)", device->tag(), eeprom_bytes);
365365         if (eestate->intf->data_bits == 8 && (device->region->flags & ROMREGION_WIDTHMASK) != ROMREGION_8BIT)
366            fatalerror("eeprom region '%s' needs to be an 8-bit region", device->tag.cstr());
366            fatalerror("eeprom region '%s' needs to be an 8-bit region", device->tag());
367367         if (eestate->intf->data_bits == 16 && ((device->region->flags & ROMREGION_WIDTHMASK) != ROMREGION_16BIT || (device->region->flags & ROMREGION_ENDIANMASK) != ROMREGION_BE))
368            fatalerror("eeprom region '%s' needs to be a 16-bit big-endian region (flags=%08x)", device->tag.cstr(), device->region->flags);
368            fatalerror("eeprom region '%s' needs to be a 16-bit big-endian region (flags=%08x)", device->tag(), device->region->flags);
369369
370370         for (offs = 0; offs < eeprom_length; offs++)
371371            if (eestate->intf->data_bits == 8)
src/emu/machine/pci.c
r7553r7554
136136   }
137137
138138   if (LOG_PCI)
139      logerror("pci_32le_r('%s'): offset=%d result=0x%08X\n", device->tag.cstr(), offset, result);
139      logerror("pci_32le_r('%s'): offset=%d result=0x%08X\n", device->tag(), offset, result);
140140
141141   return result;
142142}
r7553r7554
150150   offset %= 2;
151151
152152   if (LOG_PCI)
153      logerror("pci_32le_w('%s'): offset=%d data=0x%08X\n", device->tag.cstr(), offset, data);
153      logerror("pci_32le_w('%s'): offset=%d data=0x%08X\n", device->tag(), offset, data);
154154
155155   switch (offset)
156156   {
src/emu/devintrf.h
r7553r7554
404404   virtual const char *version() const { return get_config_string(DEVINFO_STR_VERSION); }
405405   virtual const char *source_file() const { return get_config_string(DEVINFO_STR_SOURCE_FILE); }
406406   virtual const char *credits() const { return get_config_string(DEVINFO_STR_CREDITS); }
407   const char *tag() const { return m_tag; }
407408
408409   INT64 get_config_int(UINT32 state) const;
409410   void *get_config_ptr(UINT32 state) const;
r7553r7554
418419   device_config *         owner;               // device that owns us, or NULL if nobody
419420
420421   // device properties
421   astring             tag;               // tag for this instance
422422   device_type            type;               // device type
423423   device_class         devclass;            // device class
424424
r7553r7554
427427   const addrmap_token *   address_map[ADDRESS_SPACES]; // address maps for each address space
428428   const void *         static_config;         // static device configuration
429429   void *               inline_config;         // inline device configuration
430
431private:
432   astring             m_tag;               // tag for this instance
430433};
431434
432435
r7553r7554
490493   const char *version() const { return m_baseconfig.version(); }
491494   const char *source_file() const { return m_baseconfig.source_file(); }
492495   const char *credits() const { return m_baseconfig.credits(); }
496   const char *tag() const { return m_tag; }
493497
494498   INT64 get_config_int(UINT32 state) const { return m_baseconfig.get_config_int(state); }
495499   void *get_config_ptr(UINT32 state) const { return m_baseconfig.get_config_ptr(state); }
r7553r7554
510514   running_device *      owner;               // device that owns us, or NULL if nobody
511515
512516   // device properties
513   astring             tag;               // tag for this instance
514517   device_type            type;               // device type
515518   device_class         devclass;            // device class
516519
r7553r7554
525528
526529   device_execute_func    execute;            // quick pointer to execute callback
527530   device_get_runtime_info_func get_runtime_info;
531
532private:
533   astring               m_tag;
528534};
529535
530536
src/emu/cpuexec.c
r7553r7554
312312            {
313313               /* compute how many cycles we want to execute */
314314               ran = classdata->cycles_running = divu_64x32((UINT64)delta >> classdata->divshift, classdata->divisor);
315               LOG(("  cpu '%s': %d cycles\n", classdata->device->tag.cstr(), classdata->cycles_running));
315               LOG(("  cpu '%s': %d cycles\n", classdata->device->tag(), classdata->cycles_running));
316316
317317               /* if we're not suspended, actually execute */
318318               if (classdata->suspend == 0)
r7553r7554
423423   if (executingcpu != NULL)
424424   {
425425      const address_space *space = cpu_get_address_space(executingcpu, ADDRESS_SPACE_PROGRAM);
426      sprintf(global->statebuf, "'%s' (%s)", executingcpu->tag.cstr(), core_i64_hex_format(cpu_get_pc(executingcpu), space->logaddrchars));
426      sprintf(global->statebuf, "'%s' (%s)", executingcpu->tag(), core_i64_hex_format(cpu_get_pc(executingcpu), space->logaddrchars));
427427   }
428428   else
429429      strcpy(global->statebuf, "(no context)");
r7553r7554
530530   /* if no state registered for saving, we can't save */
531531   if (num_regs == 0)
532532   {
533      logerror("CPU '%s' did not register any state to save!\n", device->tag.cstr());
533      logerror("CPU '%s' did not register any state to save!\n", device->tag());
534534      if (device->machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
535         fatalerror("CPU '%s' did not register any state to save!", device->tag.cstr());
535         fatalerror("CPU '%s' did not register any state to save!", device->tag());
536536   }
537537
538538   /* register some internal states as well */
r7553r7554
12121212      classdata->input[line].vector = vector;
12131213      return;
12141214   }
1215   LOG(("cpu_set_input_line_vector CPU '%s' line %d > max input lines\n", device->tag.cstr(), line));
1215   LOG(("cpu_set_input_line_vector CPU '%s' line %d > max input lines\n", device->tag(), line));
12161216}
12171217
12181218
r7553r7554
12281228
12291229   /* catch errors where people use PULSE_LINE for CPUs that don't support it */
12301230   if (state == PULSE_LINE && line != INPUT_LINE_NMI && line != INPUT_LINE_RESET)
1231      fatalerror("CPU %s: PULSE_LINE can only be used for NMI and RESET lines\n", device->tag.cstr());
1231      fatalerror("CPU %s: PULSE_LINE can only be used for NMI and RESET lines\n", device->tag());
12321232
12331233   if (line >= 0 && line < MAX_INPUT_LINES)
12341234   {
r7553r7554
12361236      INT32 input_event = (state & 0xff) | (vector << 8);
12371237      int event_index = inputline->qindex++;
12381238
1239      LOG(("cpu_set_input_line_and_vector('%s',%d,%d,%02x)\n", device->tag.cstr(), line, state, vector));
1239      LOG(("cpu_set_input_line_and_vector('%s',%d,%d,%02x)\n", device->tag(), line, state, vector));
12401240
12411241      /* if we're full of events, flush the queue and log a message */
12421242      if (event_index >= ARRAY_LENGTH(inputline->queue))
r7553r7554
12441244         inputline->qindex--;
12451245         empty_event_queue(device->machine, (void *)device, line);
12461246         event_index = inputline->qindex++;
1247         logerror("Exceeded pending input line event queue on CPU '%s'!\n", device->tag.cstr());
1247         logerror("Exceeded pending input line event queue on CPU '%s'!\n", device->tag());
12481248      }
12491249
12501250      /* enqueue the event */
r7553r7554
13911391
13921392         /* for new style declaration, we need to compare the tags */
13931393         else if (config->vblank_interrupt_screen != NULL)
1394            cpu_interested = (strcmp(config->vblank_interrupt_screen, device->tag) == 0);
1394            cpu_interested = (strcmp(config->vblank_interrupt_screen, device->tag()) == 0);
13951395
13961396         /* no VBLANK interrupt, not interested */
13971397         else
r7553r7554
15411541               break;
15421542
15431543            default:
1544               logerror("empty_event_queue cpu '%s', line %d, unknown state %d\n", device->tag.cstr(), param, state);
1544               logerror("empty_event_queue cpu '%s', line %d, unknown state %d\n", device->tag(), param, state);
15451545               break;
15461546         }
15471547
r7553r7554
15681568   cpu_input_data *inputline = &classdata->input[irqline];
15691569   int vector = inputline->curvector;
15701570
1571   LOG(("standard_irq_callback('%s', %d) $%04x\n", device->tag.cstr(), irqline, vector));
1571   LOG(("standard_irq_callback('%s', %d) $%04x\n", device->tag(), irqline, vector));
15721572
15731573   /* if the IRQ state is HOLD_LINE, clear it */
15741574   if (inputline->curstate == HOLD_LINE)
15751575   {
1576      LOG(("->set_irq_line('%s',%d,%d)\n", device->tag.cstr(), irqline, CLEAR_LINE));
1576      LOG(("->set_irq_line('%s',%d,%d)\n", device->tag(), irqline, CLEAR_LINE));
15771577      cpu_set_info(device, CPUINFO_INT_INPUT_STATE + irqline, CLEAR_LINE);
15781578      inputline->curstate = CLEAR_LINE;
15791579   }
src/emu/rendlay.c
r7553r7554
13421342   /* screen 0 parameters */
13431343   for (devconfig = video_screen_first(config); devconfig != NULL; devconfig = video_screen_next(devconfig))
13441344   {
1345      int scrnum = config->devicelist.index(VIDEO_SCREEN, devconfig->tag);
1345      int scrnum = config->devicelist.index(VIDEO_SCREEN, devconfig->tag());
13461346      const screen_config *scrconfig = (const screen_config *)devconfig->inline_config;
13471347
13481348      /* native X aspect factor */
src/emu/cpuintrf.h
r7553r7554
212212#define cpu_count(config)            (config)->devicelist.count(CPU)
213213#define cpu_first(config)            (config)->devicelist.first(CPU)
214214#define cpu_next(previous)            (previous)->typenext()
215#define cpu_get_index(cpu)            (cpu)->machine->devicelist.index(CPU, (cpu)->tag)
215#define cpu_get_index(cpu)            (cpu)->machine->devicelist.index(CPU, (cpu)->tag())
216216
217217
218218/* IRQ callback to be called by CPU cores when an IRQ is actually taken */
src/emu/sound/disc_sys.c
r7553r7554
176176   log_num = node_module_index(node);
177177   context->sample_num = 0;
178178
179   sprintf(context->name, "discrete_%s_%d.csv", node->info->device->tag.cstr(), log_num);
179   sprintf(context->name, "discrete_%s_%d.csv", node->info->device->tag(), log_num);
180180   context->csv_file = fopen(context->name, "w");
181181   /* Output some header info */
182182   fprintf(context->csv_file, "\"MAME Discrete System Node Log\"\n");
r7553r7554
220220   int log_num;
221221
222222   log_num = node_module_index(node);
223   sprintf(context->name, "discrete_%s_%d.wav", node->info->device->tag.cstr(), log_num);
223   sprintf(context->name, "discrete_%s_%d.wav", node->info->device->tag(), log_num);
224224   context->wavfile = wav_open(context->name, node->info->sample_rate, node->active_inputs/2);
225225}
226226
src/emu/sound/msm5205.c
r7553r7554
217217
218218   if( voice->prescaler != 0 )
219219   {
220      logerror("error: msm5205_vclk_w() called with chip = '%s', but VCLK selected master mode\n", device->tag.cstr());
220      logerror("error: msm5205_vclk_w() called with chip = '%s', but VCLK selected master mode\n", device->tag());
221221   }
222222   else
223223   {
src/emu/sound/saa1099.c
r7553r7554
340340   if ((data & 0xff) > 0x1c)
341341   {
342342      /* Error! */
343                logerror("%s: (SAA1099 '%s') Unknown register selected\n",cpuexec_describe_context(device->machine), device->tag.cstr());
343                logerror("%s: (SAA1099 '%s') Unknown register selected\n",cpuexec_describe_context(device->machine), device->tag());
344344   }
345345
346346   saa->selected_reg = data & 0x1f;
r7553r7554
426426         int i;
427427
428428         /* Synch & Reset generators */
429         logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",cpuexec_describe_context(device->machine), device->tag.cstr());
429         logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",cpuexec_describe_context(device->machine), device->tag());
430430         for (i = 0; i < 6; i++)
431431         {
432432                saa->channels[i].level = 0;
r7553r7554
435435      }
436436      break;
437437   default:   /* Error! */
438      logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",cpuexec_describe_context(device->machine), device->tag.cstr(), reg, data);
438      logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",cpuexec_describe_context(device->machine), device->tag(), reg, data);
439439   }
440440}
441441
src/emu/sound/digitalk.c
r7553r7554
651651{
652652   digitalker *dg = get_safe_token(device);
653653   dg->device = device;
654   dg->rom = memory_region(device->machine, device->tag);
654   dg->rom = memory_region(device->machine, device->tag());
655655   dg->stream = stream_create(device, 0, 1, device->clock/4, dg, digitalker_update);
656656   dg->dac_index = 128;
657657   dg->data = 0xff;
src/emu/sound/pokey.c
r7553r7554
805805      {
806806         int r = devcb_call_read8(&p->pot_r[pot], pot);
807807
808         LOG(("POKEY %s pot_r(%d) returned $%02x\n", p->device->tag.cstr(), pot, r));
808         LOG(("POKEY %s pot_r(%d) returned $%02x\n", p->device->tag(), pot, r));
809809         if( r != -1 )
810810         {
811811            if (r > 228)
r7553r7554
840840         if( p->ALLPOT & (1 << pot) )
841841         {
842842            data = timer_timeelapsed(p->ptimer[pot]).attoseconds / AD_TIME.attoseconds;
843            LOG(("POKEY '%s' read POT%d (interpolated) $%02x\n", p->device->tag.cstr(), pot, data));
843            LOG(("POKEY '%s' read POT%d (interpolated) $%02x\n", p->device->tag(), pot, data));
844844            }
845845         else
846846         {
847847            data = p->POTx[pot];
848            LOG(("POKEY '%s' read POT%d (final value)  $%02x\n", p->device->tag.cstr(), pot, data));
848            LOG(("POKEY '%s' read POT%d (final value)  $%02x\n", p->device->tag(), pot, data));
849849         }
850850      }
851851      else
852         logerror("%s: warning - read '%s' POT%d\n", cpuexec_describe_context(p->device->machine), p->device->tag.cstr(), pot);
852         logerror("%s: warning - read '%s' POT%d\n", cpuexec_describe_context(p->device->machine), p->device->tag(), pot);
853853      break;
854854
855855    case ALLPOT_C:
r7553r7554
860860      if( (p->SKCTL & SK_RESET) == 0)
861861      {
862862         data = 0;
863         LOG(("POKEY '%s' ALLPOT internal $%02x (reset)\n", p->device->tag.cstr(), data));
863         LOG(("POKEY '%s' ALLPOT internal $%02x (reset)\n", p->device->tag(), data));
864864      }
865865      else if( p->allpot_r.read )
866866      {
867867         data = devcb_call_read8(&p->allpot_r, offset);
868         LOG(("POKEY '%s' ALLPOT callback $%02x\n", p->device->tag.cstr(), data));
868         LOG(("POKEY '%s' ALLPOT callback $%02x\n", p->device->tag(), data));
869869      }
870870      else
871871      {
872872         data = p->ALLPOT;
873         LOG(("POKEY '%s' ALLPOT internal $%02x\n", p->device->tag.cstr(), data));
873         LOG(("POKEY '%s' ALLPOT internal $%02x\n", p->device->tag(), data));
874874      }
875875      break;
876876
r7553r7554
898898         adjust = 1;
899899         p->r9 = 0;
900900         p->r17 = 0;
901            LOG_RAND(("POKEY '%s' rand17 frozen (SKCTL): $%02x\n", p->device->tag.cstr(), p->RANDOM));
901            LOG_RAND(("POKEY '%s' rand17 frozen (SKCTL): $%02x\n", p->device->tag(), p->RANDOM));
902902      }
903903      if( p->AUDCTL & POLY9 )
904904      {
905905         p->RANDOM = p->rand9[p->r9];
906         LOG_RAND(("POKEY '%s' adjust %u rand9[$%05x]: $%02x\n", p->device->tag.cstr(), adjust, p->r9, p->RANDOM));
906         LOG_RAND(("POKEY '%s' adjust %u rand9[$%05x]: $%02x\n", p->device->tag(), adjust, p->r9, p->RANDOM));
907907      }
908908      else
909909      {
910910         p->RANDOM = p->rand17[p->r17];
911         LOG_RAND(("POKEY '%s' adjust %u rand17[$%05x]: $%02x\n", p->device->tag.cstr(), adjust, p->r17, p->RANDOM));
911         LOG_RAND(("POKEY '%s' adjust %u rand17[$%05x]: $%02x\n", p->device->tag(), adjust, p->r17, p->RANDOM));
912912      }
913913      if (adjust > 0)
914914         timer_adjust_oneshot(p->rtimer, attotime_never, 0);
r7553r7554
919919      if( p->serin_r.read )
920920         p->SERIN = devcb_call_read8(&p->serin_r, offset);
921921      data = p->SERIN;
922      LOG(("POKEY '%s' SERIN  $%02x\n", p->device->tag.cstr(), data));
922      LOG(("POKEY '%s' SERIN  $%02x\n", p->device->tag(), data));
923923      break;
924924
925925   case IRQST_C:
926926      /* IRQST is an active low input port; we keep it active high */
927927      /* internally to ease the (un-)masking of bits */
928928      data = p->IRQST ^ 0xff;
929      LOG(("POKEY '%s' IRQST  $%02x\n", p->device->tag.cstr(), data));
929      LOG(("POKEY '%s' IRQST  $%02x\n", p->device->tag(), data));
930930      break;
931931
932932   case SKSTAT_C:
933933      /* SKSTAT is also an active low input port */
934934      data = p->SKSTAT ^ 0xff;
935      LOG(("POKEY '%s' SKSTAT $%02x\n", p->device->tag.cstr(), data));
935      LOG(("POKEY '%s' SKSTAT $%02x\n", p->device->tag(), data));
936936      break;
937937
938938   default:
939      LOG(("POKEY '%s' register $%02x\n", p->device->tag.cstr(), offset));
939      LOG(("POKEY '%s' register $%02x\n", p->device->tag(), offset));
940940        break;
941941    }
942942    return data;
r7553r7554
966966    case AUDF1_C:
967967      if( data == p->AUDF[CHAN1] )
968968            return;
969      LOG_SOUND(("POKEY '%s' AUDF1  $%02x\n", p->device->tag.cstr(), data));
969      LOG_SOUND(("POKEY '%s' AUDF1  $%02x\n", p->device->tag(), data));
970970      p->AUDF[CHAN1] = data;
971971        ch_mask = 1 << CHAN1;
972972      if( p->AUDCTL & CH12_JOINED )      /* if ch 1&2 tied together */
r7553r7554
976976    case AUDC1_C:
977977      if( data == p->AUDC[CHAN1] )
978978            return;
979      LOG_SOUND(("POKEY '%s' AUDC1  $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
979      LOG_SOUND(("POKEY '%s' AUDC1  $%02x (%s)\n", p->device->tag(), data, audc2str(data)));
980980      p->AUDC[CHAN1] = data;
981981        ch_mask = 1 << CHAN1;
982982        break;
r7553r7554
984984    case AUDF2_C:
985985      if( data == p->AUDF[CHAN2] )
986986            return;
987      LOG_SOUND(("POKEY '%s' AUDF2  $%02x\n", p->device->tag.cstr(), data));
987      LOG_SOUND(("POKEY '%s' AUDF2  $%02x\n", p->device->tag(), data));
988988      p->AUDF[CHAN2] = data;
989989        ch_mask = 1 << CHAN2;
990990        break;
r7553r7554
992992    case AUDC2_C:
993993      if( data == p->AUDC[CHAN2] )
994994            return;
995      LOG_SOUND(("POKEY '%s' AUDC2  $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
995      LOG_SOUND(("POKEY '%s' AUDC2  $%02x (%s)\n", p->device->tag(), data, audc2str(data)));
996996      p->AUDC[CHAN2] = data;
997997        ch_mask = 1 << CHAN2;
998998        break;
r7553r7554
10001000    case AUDF3_C:
10011001      if( data == p->AUDF[CHAN3] )
10021002            return;
1003      LOG_SOUND(("POKEY '%s' AUDF3  $%02x\n", p->device->tag.cstr(), data));
1003      LOG_SOUND(("POKEY '%s' AUDF3  $%02x\n", p->device->tag(), data));
10041004      p->AUDF[CHAN3] = data;
10051005        ch_mask = 1 << CHAN3;
10061006
r7553r7554
10111011    case AUDC3_C:
10121012      if( data == p->AUDC[CHAN3] )
10131013            return;
1014      LOG_SOUND(("POKEY '%s' AUDC3  $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
1014      LOG_SOUND(("POKEY '%s' AUDC3  $%02x (%s)\n", p->device->tag(), data, audc2str(data)));
10151015      p->AUDC[CHAN3] = data;
10161016        ch_mask = 1 << CHAN3;
10171017        break;
r7553r7554
10191019    case AUDF4_C:
10201020      if( data == p->AUDF[CHAN4] )
10211021            return;
1022      LOG_SOUND(("POKEY '%s' AUDF4  $%02x\n", p->device->tag.cstr(), data));
1022      LOG_SOUND(("POKEY '%s' AUDF4  $%02x\n", p->device->tag(), data));
10231023      p->AUDF[CHAN4] = data;
10241024        ch_mask = 1 << CHAN4;
10251025        break;
r7553r7554
10271027    case AUDC4_C:
10281028      if( data == p->AUDC[CHAN4] )
10291029            return;
1030      LOG_SOUND(("POKEY '%s' AUDC4  $%02x (%s)\n", p->device->tag.cstr(), data, audc2str(data)));
1030      LOG_SOUND(("POKEY '%s' AUDC4  $%02x (%s)\n", p->device->tag(), data, audc2str(data)));
10311031      p->AUDC[CHAN4] = data;
10321032        ch_mask = 1 << CHAN4;
10331033        break;
r7553r7554
10351035    case AUDCTL_C:
10361036      if( data == p->AUDCTL )
10371037            return;
1038      LOG_SOUND(("POKEY '%s' AUDCTL $%02x (%s)\n", p->device->tag.cstr(), data, audctl2str(data)));
1038      LOG_SOUND(("POKEY '%s' AUDCTL $%02x (%s)\n", p->device->tag(), data, audctl2str(data)));
10391039      p->AUDCTL = data;
10401040        ch_mask = 15;       /* all channels */
10411041        /* determine the base multiplier for the 'div by n' calculations */
r7553r7554
10441044
10451045    case STIMER_C:
10461046        /* first remove any existing timers */
1047      LOG_TIMER(("POKEY '%s' STIMER $%02x\n", p->device->tag.cstr(), data));
1047      LOG_TIMER(("POKEY '%s' STIMER $%02x\n", p->device->tag(), data));
10481048
10491049      timer_adjust_oneshot(p->timer[TIMER1], attotime_never, p->timer_param[TIMER1]);
10501050      timer_adjust_oneshot(p->timer[TIMER2], attotime_never, p->timer_param[TIMER2]);
r7553r7554
10621062        {
10631063         if( p->divisor[CHAN2] > 4 )
10641064         {
1065            LOG_TIMER(("POKEY '%s' timer1+2 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN2]));
1065            LOG_TIMER(("POKEY '%s' timer1+2 after %d clocks\n", p->device->tag(), p->divisor[CHAN2]));
10661066            /* set timer #1 _and_ #2 event after timer_div clocks of joined CHAN1+CHAN2 */
10671067            p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
10681068            p->timer_param[TIMER2] = IRQ_TIMR2|IRQ_TIMR1;
r7553r7554
10731073        {
10741074         if( p->divisor[CHAN1] > 4 )
10751075         {
1076            LOG_TIMER(("POKEY '%s' timer1 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN1]));
1076            LOG_TIMER(("POKEY '%s' timer1 after %d clocks\n", p->device->tag(), p->divisor[CHAN1]));
10771077            /* set timer #1 event after timer_div clocks of CHAN1 */
10781078            p->timer_period[TIMER1] = attotime_mul(p->clock_period, p->divisor[CHAN1]);
10791079            p->timer_param[TIMER1] = IRQ_TIMR1;
r7553r7554
10821082
10831083         if( p->divisor[CHAN2] > 4 )
10841084         {
1085            LOG_TIMER(("POKEY '%s' timer2 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN2]));
1085            LOG_TIMER(("POKEY '%s' timer2 after %d clocks\n", p->device->tag(), p->divisor[CHAN2]));
10861086            /* set timer #2 event after timer_div clocks of CHAN2 */
10871087            p->timer_period[TIMER2] = attotime_mul(p->clock_period, p->divisor[CHAN2]);
10881088            p->timer_param[TIMER2] = IRQ_TIMR2;
r7553r7554
10991099            {
11001100            if( p->divisor[CHAN4] > 4 )
11011101            {
1102               LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN4]));
1102               LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag(), p->divisor[CHAN4]));
11031103               /* set timer #4 event after timer_div clocks of CHAN4 */
11041104               p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
11051105               p->timer_param[TIMER4] = IRQ_TIMR4;
r7553r7554
11111111        {
11121112         if( p->divisor[CHAN4] > 4 )
11131113         {
1114            LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag.cstr(), p->divisor[CHAN4]));
1114            LOG_TIMER(("POKEY '%s' timer4 after %d clocks\n", p->device->tag(), p->divisor[CHAN4]));
11151115            /* set timer #4 event after timer_div clocks of CHAN4 */
11161116            p->timer_period[TIMER4] = attotime_mul(p->clock_period, p->divisor[CHAN4]);
11171117            p->timer_param[TIMER4] = IRQ_TIMR4;
r7553r7554
11261126
11271127    case SKREST_C:
11281128        /* reset SKSTAT */
1129      LOG(("POKEY '%s' SKREST $%02x\n", p->device->tag.cstr(), data));
1129      LOG(("POKEY '%s' SKREST $%02x\n", p->device->tag(), data));
11301130      p->SKSTAT &= ~(SK_FRAME|SK_OVERRUN|SK_KBERR);
11311131        break;
11321132
11331133    case POTGO_C:
1134      LOG(("POKEY '%s' POTGO  $%02x\n", p->device->tag.cstr(), data));
1134      LOG(("POKEY '%s' POTGO  $%02x\n", p->device->tag(), data));
11351135      pokey_potgo(p);
11361136        break;
11371137
11381138    case SEROUT_C:
1139      LOG(("POKEY '%s' SEROUT $%02x\n", p->device->tag.cstr(), data));
1139      LOG(("POKEY '%s' SEROUT $%02x\n", p->device->tag(), data));
11401140      devcb_call_write8(&p->serout_w, offset, data);
11411141      p->SKSTAT |= SK_SEROUT;
11421142        /*
r7553r7554
11501150        break;
11511151
11521152    case IRQEN_C:
1153      LOG(("POKEY '%s' IRQEN  $%02x\n", p->device->tag.cstr(), data));
1153      LOG(("POKEY '%s' IRQEN  $%02x\n", p->device->tag(), data));
11541154
11551155        /* acknowledge one or more IRQST bits ? */
11561156      if( p->IRQST & ~data )
r7553r7554
11761176    case SKCTL_C:
11771177      if( data == p->SKCTL )
11781178            return;
1179      LOG(("POKEY '%s' SKCTL  $%02x\n", p->device->tag.cstr(), data));
1179      LOG(("POKEY '%s' SKCTL  $%02x\n", p->device->tag(), data));
11801180      p->SKCTL = data;
11811181        if( !(data & SK_RESET) )
11821182        {
r7553r7554
12041204        else
12051205         new_val = (p->AUDF[CHAN1] + DIVADD_LOCLK) * p->clockmult;
12061206
1207      LOG_SOUND(("POKEY '%s' chan1 %d\n", p->device->tag.cstr(), new_val));
1207      LOG_SOUND(("POKEY '%s' chan1 %d\n", p->device->tag(), new_val));
12081208
12091209      p->volume[CHAN1] = (p->AUDC[CHAN1] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
12101210        p->divisor[CHAN1] = new_val;
r7553r7554
12341234            new_val = p->AUDF[CHAN2] * 256 + p->AUDF[CHAN1] + DIVADD_HICLK_JOINED;
12351235            else
12361236            new_val = (p->AUDF[CHAN2] * 256 + p->AUDF[CHAN1] + DIVADD_LOCLK) * p->clockmult;
1237         LOG_SOUND(("POKEY '%s' chan1+2 %d\n", p->device->tag.cstr(), new_val));
1237         LOG_SOUND(("POKEY '%s' chan1+2 %d\n", p->device->tag(), new_val));
12381238        }
12391239        else
12401240      {
12411241         new_val = (p->AUDF[CHAN2] + DIVADD_LOCLK) * p->clockmult;
1242         LOG_SOUND(("POKEY '%s' chan2 %d\n", p->device->tag.cstr(), new_val));
1242         LOG_SOUND(("POKEY '%s' chan2 %d\n", p->device->tag(), new_val));
12431243      }
12441244
12451245      p->volume[CHAN2] = (p->AUDC[CHAN2] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
r7553r7554
12691269        else
12701270         new_val = (p->AUDF[CHAN3] + DIVADD_LOCLK) * p->clockmult;
12711271
1272      LOG_SOUND(("POKEY '%s' chan3 %d\n", p->device->tag.cstr(), new_val));
1272      LOG_SOUND(("POKEY '%s' chan3 %d\n", p->device->tag(), new_val));
12731273
12741274      p->volume[CHAN3] = (p->AUDC[CHAN3] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
12751275      p->divisor[CHAN3] = new_val;
r7553r7554
12991299            new_val = p->AUDF[CHAN4] * 256 + p->AUDF[CHAN3] + DIVADD_HICLK_JOINED;
13001300            else
13011301            new_val = (p->AUDF[CHAN4] * 256 + p->AUDF[CHAN3] + DIVADD_LOCLK) * p->clockmult;
1302         LOG_SOUND(("POKEY '%s' chan3+4 %d\n", p->device->tag.cstr(), new_val));
1302         LOG_SOUND(("POKEY '%s' chan3+4 %d\n", p->device->tag(), new_val));
13031303        }
13041304        else
13051305      {
13061306         new_val = (p->AUDF[CHAN4] + DIVADD_LOCLK) * p->clockmult;
1307         LOG_SOUND(("POKEY '%s' chan4 %d\n", p->device->tag.cstr(), new_val));
1307         LOG_SOUND(("POKEY '%s' chan4 %d\n", p->device->tag(), new_val));
13081308      }
13091309
13101310      p->volume[CHAN4] = (p->AUDC[CHAN4] & VOLUME_MASK) * POKEY_DEFAULT_GAIN;
src/emu/sound/ay8910.c
r7553r7554
527527            if (psg->portAwrite.write)
528528               devcb_call_write8(&psg->portAwrite, 0, psg->regs[AY_PORTA]);
529529            else
530               logerror("warning - write %02x to 8910 '%s' Port A\n",psg->regs[AY_PORTA],psg->device->tag.cstr());
530               logerror("warning - write %02x to 8910 '%s' Port A\n",psg->regs[AY_PORTA],psg->device->tag());
531531         }
532532         else
533533         {
534            logerror("warning: write to 8910 '%s' Port A set as input - ignored\n",psg->device->tag.cstr());
534            logerror("warning: write to 8910 '%s' Port A set as input - ignored\n",psg->device->tag());
535535         }
536536         break;
537537      case AY_PORTB:
r7553r7554
540540            if (psg->portBwrite.write)
541541               devcb_call_write8(&psg->portBwrite, 0, psg->regs[AY_PORTB]);
542542            else
543               logerror("warning - write %02x to 8910 '%s' Port B\n",psg->regs[AY_PORTB],psg->device->tag.cstr());
543               logerror("warning - write %02x to 8910 '%s' Port B\n",psg->regs[AY_PORTB],psg->device->tag());
544544         }
545545         else
546546         {
547            logerror("warning: write to 8910 '%s' Port B set as input - ignored\n",psg->device->tag.cstr());
547            logerror("warning: write to 8910 '%s' Port B set as input - ignored\n",psg->device->tag());
548548         }
549549         break;
550550   }
r7553r7554
881881   {
882882   case AY_PORTA:
883883      if ((psg->regs[AY_ENABLE] & 0x40) != 0)
884         logerror("warning: read from 8910 '%s' Port A set as output\n",psg->device->tag.cstr());
884         logerror("warning: read from 8910 '%s' Port A set as output\n",psg->device->tag());
885885      /*
886886           even if the port is set as output, we still need to return the external
887887           data. Some games, like kidniki, need this to work.
r7553r7554
889889      if (psg->portAread.read)
890890         psg->regs[AY_PORTA] = devcb_call_read8(&psg->portAread, 0);
891891      else
892         logerror("%s: warning - read 8910 '%s' Port A\n",cpuexec_describe_context(psg->device->machine),psg->device->tag.cstr());
892         logerror("%s: warning - read 8910 '%s' Port A\n",cpuexec_describe_context(psg->device->machine),psg->device->tag());
893893      break;
894894   case AY_PORTB:
895895      if ((psg->regs[AY_ENABLE] & 0x80) != 0)
896         logerror("warning: read from 8910 '%s' Port B set as output\n",psg->device->tag.cstr());
896         logerror("warning: read from 8910 '%s' Port B set as output\n",psg->device->tag());
897897      if (psg->portBread.read)
898898         psg->regs[AY_PORTB] = devcb_call_read8(&psg->portBread, 0);
899899      else
900         logerror("%s: warning - read 8910 '%s' Port B\n",cpuexec_describe_context(psg->device->machine),psg->device->tag.cstr());
900         logerror("%s: warning - read 8910 '%s' Port B\n",cpuexec_describe_context(psg->device->machine),psg->device->tag());
901901      break;
902902   }
903903   return psg->regs[r];
src/emu/sound/discrete.c
r7553r7554
496496   info->total_stream_updates = 0;
497497
498498   /* create the logfile */
499   sprintf(name, "discrete%s.log", device->tag.cstr());
499   sprintf(name, "discrete%s.log", device->tag());
500500   if (DISCRETE_DEBUGLOG)
501501      info->disclogfile = fopen(name, "w");
502502
src/emu/sound/c6280.c
r7553r7554
112112    p->device = device;
113113    p->cpudevice = device->machine->device(intf->cpu);
114114    if (p->cpudevice == NULL)
115       fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag.cstr());
115       fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag());
116116
117117    /* Make waveform frequency table */
118118    for(i = 0; i < 4096; i += 1)
src/emu/sound/scsp.c
r7553r7554
528528   SCSP->MidiOutR=SCSP->MidiOutW=0;
529529
530530   // get SCSP RAM
531   if (strcmp(device->tag, "scsp") == 0 || strcmp(device->tag, "scsp1") == 0)
531   if (strcmp(device->tag(), "scsp") == 0 || strcmp(device->tag(), "scsp1") == 0)
532532   {
533533      SCSP->Master=1;
534534   }
src/emu/sound/2610intf.c
r7553r7554
167167   /* setup adpcm buffers */
168168   pcmbufa  = *device->region;
169169   pcmsizea = device->region->bytes();
170   name.printf("%s.deltat", device->tag.cstr());
170   name.printf("%s.deltat", device->tag());
171171   pcmbufb  = (void *)(memory_region(device->machine, name));
172172   pcmsizeb = memory_region_length(device->machine, name);
173173   if (pcmbufb == NULL || pcmsizeb == 0)
src/emu/sound/okim6376.c
r7553r7554
429429               }
430430               else
431431               {
432                  logerror("OKIM6376:'%s' requested to play sample %02x on non-stopped voice\n",device->tag.cstr(),info->command);
432                  logerror("OKIM6376:'%s' requested to play sample %02x on non-stopped voice\n",device->tag(),info->command);
433433               }
434434            }
435435         }
src/emu/sound/okim6295.c
r7553r7554
405405   if (!info->bank_installed && base != 0)
406406   {
407407      /* override our memory map with a bank */
408      memory_install_read_bank(device->space(), 0x00000, 0x3ffff, 0, 0, device->tag);
408      memory_install_read_bank(device->space(), 0x00000, 0x3ffff, 0, 0, device->tag());
409409      info->bank_installed = TRUE;
410410   }
411411
r7553r7554
413413   if (info->bank_installed)
414414   {
415415      info->bank_offs = base;
416      memory_set_bankptr(device->machine, device->tag, device->region->base.u8 + base);
416      memory_set_bankptr(device->machine, device->tag(), device->region->base.u8 + base);
417417   }
418418}
419419
r7553r7554
522522               }
523523               else
524524               {
525                  logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",device->tag.cstr(),info->command);
525                  logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",device->tag(),info->command);
526526               }
527527            }
528528            /* invalid samples go here */
529529            else
530530            {
531               logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag.cstr(),info->command);
531               logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag(),info->command);
532532               voice->playing = 0;
533533            }
534534         }
src/emu/sound/sn76477.c
r7553r7554
650650      "Enabled", "Inhibited"
651651   };
652652
653   LOG(1, ("SN76477 '%s':              Enable line (9): %d [%s]\n", sn->device->tag.cstr(), sn->enable, desc[sn->enable]));
653   LOG(1, ("SN76477 '%s':              Enable line (9): %d [%s]\n", sn->device->tag(), sn->enable, desc[sn->enable]));
654654}
655655
656656
r7553r7554
662662      "SLF/Noise", "SLF/VCO/Noise", "SLF/VCO", "Inhibit"
663663   };
664664
665   LOG(1, ("SN76477 '%s':           Mixer mode (25-27): %d [%s]\n", sn->device->tag.cstr(), sn->mixer_mode, desc[sn->mixer_mode]));
665   LOG(1, ("SN76477 '%s':           Mixer mode (25-27): %d [%s]\n", sn->device->tag(), sn->mixer_mode, desc[sn->mixer_mode]));
666666}
667667
668668
r7553r7554
673673      "VCO", "One-Shot", "Mixer Only", "VCO with Alternating Polarity"
674674   };
675675
676   LOG(1, ("SN76477 '%s':         Envelope mode (1,28): %d [%s]\n", sn->device->tag.cstr(), sn->envelope_mode, desc[sn->envelope_mode]));
676   LOG(1, ("SN76477 '%s':         Envelope mode (1,28): %d [%s]\n", sn->device->tag(), sn->envelope_mode, desc[sn->envelope_mode]));
677677}
678678
679679
r7553r7554
684684      "External (Pin 16)", "Internal (SLF)"
685685   };
686686
687   LOG(1, ("SN76477 '%s':                VCO mode (22): %d [%s]\n", sn->device->tag.cstr(), sn->vco_mode, desc[sn->vco_mode]));
687   LOG(1, ("SN76477 '%s':                VCO mode (22): %d [%s]\n", sn->device->tag(), sn->vco_mode, desc[sn->vco_mode]));
688688}
689689
690690
r7553r7554
694694   {
695695      if (compute_one_shot_cap_charging_rate(sn) > 0)
696696      {
697         LOG(1, ("SN76477 '%s':        One-shot time (23,24): %.4f sec\n", sn->device->tag.cstr(), ONE_SHOT_CAP_VOLTAGE_RANGE * (1 / compute_one_shot_cap_charging_rate(sn))));
697         LOG(1, ("SN76477 '%s':        One-shot time (23,24): %.4f sec\n", sn->device->tag(), ONE_SHOT_CAP_VOLTAGE_RANGE * (1 / compute_one_shot_cap_charging_rate(sn))));
698698      }
699699      else
700700      {
701         LOG(1, ("SN76477 '%s':        One-shot time (23,24): N/A\n", sn->device->tag.cstr()));
701         LOG(1, ("SN76477 '%s':        One-shot time (23,24): N/A\n", sn->device->tag()));
702702      }
703703   }
704704   else
705705   {
706      LOG(1, ("SN76477 '%s':        One-shot time (23,24): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->one_shot_cap_voltage));
706      LOG(1, ("SN76477 '%s':        One-shot time (23,24): External (cap = %.2fV)\n", sn->device->tag(), sn->one_shot_cap_voltage));
707707   }
708708}
709709
r7553r7554
717717         double charging_time = (1 / compute_slf_cap_charging_rate(sn)) * SLF_CAP_VOLTAGE_RANGE;
718718         double discharging_time = (1 / compute_slf_cap_discharging_rate(sn)) * SLF_CAP_VOLTAGE_RANGE;
719719
720         LOG(1, ("SN76477 '%s':        SLF frequency (20,21): %.2f Hz\n", sn->device->tag.cstr(), 1 / (charging_time + discharging_time)));
720         LOG(1, ("SN76477 '%s':        SLF frequency (20,21): %.2f Hz\n", sn->device->tag(), 1 / (charging_time + discharging_time)));
721721      }
722722      else
723723      {
724         LOG(1, ("SN76477 '%s':        SLF frequency (20,21): N/A\n", sn->device->tag.cstr()));
724         LOG(1, ("SN76477 '%s':        SLF frequency (20,21): N/A\n", sn->device->tag()));
725725      }
726726   }
727727   else
728728   {
729      LOG(1, ("SN76477 '%s':        SLF frequency (20,21): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->slf_cap_voltage));
729      LOG(1, ("SN76477 '%s':        SLF frequency (20,21): External (cap = %.2fV)\n", sn->device->tag(), sn->slf_cap_voltage));
730730   }
731731}
732732
733733
734734static void log_vco_pitch_voltage(sn76477_state *sn)
735735{
736   LOG(1, ("SN76477 '%s':       VCO pitch voltage (19): %.2fV\n", sn->device->tag.cstr(), sn->pitch_voltage));
736   LOG(1, ("SN76477 '%s':       VCO pitch voltage (19): %.2fV\n", sn->device->tag(), sn->pitch_voltage));
737737}
738738
739739
740740static void log_vco_duty_cycle(sn76477_state *sn)
741741{
742   LOG(1, ("SN76477 '%s':       VCO duty cycle (16,19): %.0f%%\n", sn->device->tag.cstr(), compute_vco_duty_cycle(sn) * 100.0));
742   LOG(1, ("SN76477 '%s':       VCO duty cycle (16,19): %.0f%%\n", sn->device->tag(), compute_vco_duty_cycle(sn) * 100.0));
743743}
744744
745745
r7553r7554
752752         double min_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_CAP_VOLTAGE_RANGE);
753753         double max_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_TO_SLF_VOLTAGE_DIFF);
754754
755         LOG(1, ("SN76477 '%s':        VCO frequency (17,18): %.2f Hz - %.1f Hz\n", sn->device->tag.cstr(), min_freq, max_freq));
755         LOG(1, ("SN76477 '%s':        VCO frequency (17,18): %.2f Hz - %.1f Hz\n", sn->device->tag(), min_freq, max_freq));
756756      }
757757      else
758758      {
759         LOG(1, ("SN76477 '%s':        VCO frequency (17,18): N/A\n", sn->device->tag.cstr()));
759         LOG(1, ("SN76477 '%s':        VCO frequency (17,18): N/A\n", sn->device->tag()));
760760      }
761761   }
762762   else
763763   {
764      LOG(1, ("SN76477 '%s':        VCO frequency (17,18): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->vco_cap_voltage));
764      LOG(1, ("SN76477 '%s':        VCO frequency (17,18): External (cap = %.2fV)\n", sn->device->tag(), sn->vco_cap_voltage));
765765   }
766766}
767767
r7553r7554
773773      double min_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_CAP_VOLTAGE_RANGE);
774774      double max_freq = compute_vco_cap_charging_discharging_rate(sn) / (2 * VCO_TO_SLF_VOLTAGE_DIFF);
775775
776      LOG(1, ("SN76477 '%s':        VCO ext. voltage (16): %.2fV (%.2f Hz)\n", sn->device->tag.cstr(),
776      LOG(1, ("SN76477 '%s':        VCO ext. voltage (16): %.2fV (%.2f Hz)\n", sn->device->tag(),
777777            sn->vco_voltage,
778778            min_freq + ((max_freq - min_freq) * sn->vco_voltage / VCO_MAX_EXT_VOLTAGE)));
779779   }
780780   else
781781   {
782      LOG(1, ("SN76477 '%s':        VCO ext. voltage (16): %.2fV (saturated, no output)\n", sn->device->tag.cstr(), sn->vco_voltage));
782      LOG(1, ("SN76477 '%s':        VCO ext. voltage (16): %.2fV (saturated, no output)\n", sn->device->tag(), sn->vco_voltage));
783783   }
784784}
785785
r7553r7554
788788{
789789   if (sn->noise_clock_ext)
790790   {
791      LOG(1, ("SN76477 '%s':      Noise gen frequency (4): External\n", sn->device->tag.cstr()));
791      LOG(1, ("SN76477 '%s':      Noise gen frequency (4): External\n", sn->device->tag()));
792792   }
793793   else
794794   {
795795      if (compute_noise_gen_freq(sn) > 0)
796796      {
797         LOG(1, ("SN76477 '%s':      Noise gen frequency (4): %d Hz\n", sn->device->tag.cstr(), compute_noise_gen_freq(sn)));
797         LOG(1, ("SN76477 '%s':      Noise gen frequency (4): %d Hz\n", sn->device->tag(), compute_noise_gen_freq(sn)));
798798      }
799799      else
800800      {
801         LOG(1, ("SN76477 '%s':      Noise gen frequency (4): N/A\n", sn->device->tag.cstr()));
801         LOG(1, ("SN76477 '%s':      Noise gen frequency (4): N/A\n", sn->device->tag()));
802802      }
803803   }
804804}
r7553r7554
817817            double charging_time = (1 / charging_rate) * NOISE_CAP_VOLTAGE_RANGE;
818818            double discharging_time = (1 / charging_rate) * NOISE_CAP_VOLTAGE_RANGE;
819819
820            LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): %.0f Hz\n", sn->device->tag.cstr(), 1 / (charging_time + discharging_time)));
820            LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): %.0f Hz\n", sn->device->tag(), 1 / (charging_time + discharging_time)));
821821         }
822822         else
823823         {
824            LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): Very Large (Filtering Disabled)\n", sn->device->tag.cstr()));
824            LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): Very Large (Filtering Disabled)\n", sn->device->tag()));
825825         }
826826      }
827827      else
828828      {
829         LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): N/A\n", sn->device->tag.cstr()));
829         LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): N/A\n", sn->device->tag()));
830830      }
831831   }
832832   else
833833   {
834      LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->noise_filter_cap));
834      LOG(1, ("SN76477 '%s': Noise filter frequency (5,6): External (cap = %.2fV)\n", sn->device->tag(), sn->noise_filter_cap));
835835   }
836836}
837837
r7553r7554
842842   {
843843      if (compute_attack_decay_cap_charging_rate(sn) > 0)
844844      {
845         LOG(1, ("SN76477 '%s':           Attack time (8,10): %.4f sec\n", sn->device->tag.cstr(), AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_charging_rate(sn))));
845         LOG(1, ("SN76477 '%s':           Attack time (8,10): %.4f sec\n", sn->device->tag(), AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_charging_rate(sn))));
846846      }
847847      else
848848      {
849         LOG(1, ("SN76477 '%s':           Attack time (8,10): N/A\n", sn->device->tag.cstr()));
849         LOG(1, ("SN76477 '%s':           Attack time (8,10): N/A\n", sn->device->tag()));
850850      }
851851   }
852852   else
853853   {
854      LOG(1, ("SN76477 '%s':           Attack time (8,10): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->attack_decay_cap_voltage));
854      LOG(1, ("SN76477 '%s':           Attack time (8,10): External (cap = %.2fV)\n", sn->device->tag(), sn->attack_decay_cap_voltage));
855855   }
856856}
857857
r7553r7554
862862   {
863863      if (compute_attack_decay_cap_discharging_rate(sn) > 0)
864864      {
865         LOG(1, ("SN76477 '%s':             Decay time (7,8): %.4f sec\n", sn->device->tag.cstr(), AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_discharging_rate(sn))));
865         LOG(1, ("SN76477 '%s':             Decay time (7,8): %.4f sec\n", sn->device->tag(), AD_CAP_VOLTAGE_RANGE * (1 / compute_attack_decay_cap_discharging_rate(sn))));
866866      }
867867      else
868868      {
869         LOG(1, ("SN76477 '%s':            Decay time (8,10): N/A\n", sn->device->tag.cstr()));
869         LOG(1, ("SN76477 '%s':            Decay time (8,10): N/A\n", sn->device->tag()));
870870      }
871871   }
872872   else
873873   {
874      LOG(1, ("SN76477 '%s':             Decay time (7, 8): External (cap = %.2fV)\n", sn->device->tag.cstr(), sn->attack_decay_cap_voltage));
874      LOG(1, ("SN76477 '%s':             Decay time (7, 8): External (cap = %.2fV)\n", sn->device->tag(), sn->attack_decay_cap_voltage));
875875   }
876876}
877877
r7553r7554
879879static void log_voltage_out(sn76477_state *sn)
880880{
881881   LOG(1, ("SN76477 '%s':    Voltage OUT range (11,12): %.2fV - %.2fV (clips above %.2fV)\n",
882         sn->device->tag.cstr(),
882         sn->device->tag(),
883883         OUT_CENTER_LEVEL_VOLTAGE + compute_center_to_peak_voltage_out(sn) * out_neg_gain[(int)(AD_CAP_VOLTAGE_MAX * 10)],
884884         OUT_CENTER_LEVEL_VOLTAGE + compute_center_to_peak_voltage_out(sn) * out_pos_gain[(int)(AD_CAP_VOLTAGE_MAX * 10)],
885885         OUT_HIGH_CLIP_THRESHOLD));
r7553r7554
918918{
919919   char wav_file_name[30];
920920
921   sprintf(wav_file_name, LOG_WAV_FILE_NAME, sn->device->tag.cstr());
921   sprintf(wav_file_name, LOG_WAV_FILE_NAME, sn->device->tag());
922922   sn->file = wav_open(wav_file_name, sn->sample_rate, 2);
923923
924   LOG(1, ("SN76477 '%s':         Logging output: %s\n", sn->device->tag.cstr(), wav_file_name));
924   LOG(1, ("SN76477 '%s':         Logging output: %s\n", sn->device->tag(), wav_file_name));
925925}
926926
927927
src/emu/sound/es8712.c
r7553r7554
320320   /* invalid samples go here */
321321   else
322322   {
323      logerror("ES871295:'%s' requested to play invalid sample range %06x-%06x\n",device->tag.cstr(),chip->start,chip->end);
323      logerror("ES871295:'%s' requested to play invalid sample range %06x-%06x\n",device->tag(),chip->start,chip->end);
324324
325325      if (chip->playing)
326326      {
src/emu/ui.c
r7553r7554
16181618      for (device = machine->firstcpu; device != NULL; device = cpu_next(device))
16191619      {
16201620         void *param = (void *)device;
1621         string.printf("Overclock CPU %s", device->tag.cstr());
1621         string.printf("Overclock CPU %s", device->tag());
16221622         *tailptr = slider_alloc(machine, string, 10, 1000, 2000, 1, slider_overclock, param);
16231623         tailptr = &(*tailptr)->next;
16241624      }
r7553r7554
21122112   static char descbuf[256];
21132113
21142114   if (screen_count > 1)
2115      sprintf(descbuf, "Screen '%s'", screen->tag.cstr());
2115      sprintf(descbuf, "Screen '%s'", screen->tag());
21162116   else
21172117      strcpy(descbuf, "Screen");
21182118
r7553r7554
21312131   static char descbuf[256];
21322132
21332133   if (ldcount > 1)
2134      sprintf(descbuf, "Laserdisc '%s'", laserdisc->tag.cstr());
2134      sprintf(descbuf, "Laserdisc '%s'", laserdisc->tag());
21352135   else
21362136      strcpy(descbuf, "Laserdisc");
21372137
src/emu/profiler.c
r7553r7554
186186
187187         /* and then the text */
188188         if (curtype >= PROFILER_CPU_FIRST && curtype <= PROFILER_CPU_MAX)
189            string.catprintf("CPU '%s'", machine->devicelist.find(CPU, curtype - PROFILER_CPU_FIRST)->tag.cstr());
189            string.catprintf("CPU '%s'", machine->devicelist.find(CPU, curtype - PROFILER_CPU_FIRST)->tag());
190190         else
191191            for (nameindex = 0; nameindex < ARRAY_LENGTH(names); nameindex++)
192192               if (names[nameindex].type == curtype)
src/emu/sound.c
r7553r7554
315315   /* if no state registered for saving, we can't save */
316316   if (num_regs == 0)
317317   {
318      logerror("Sound chip '%s' did not register any state to save!\n", device->tag.cstr());
318      logerror("Sound chip '%s' did not register any state to save!\n", device->tag());
319319      if (device->machine->gamedrv->flags & GAME_SUPPORTS_SAVE)
320         fatalerror("Sound chip '%s' did not register any state to save!", device->tag.cstr());
320         fatalerror("Sound chip '%s' did not register any state to save!", device->tag());
321321   }
322322}
323323
r7553r7554
488488                  speaker_info *speakerinfo = get_safe_token(target_device);
489489
490490                  /* generate text for the UI */
491                  tempstring.printf("Speaker '%s': %s '%s'", target_device->tag.cstr(), sound->name(), sound->tag.cstr());
491                  tempstring.printf("Speaker '%s': %s '%s'", target_device->tag(), sound->name(), sound->tag());
492492                  if (numoutputs > 1)
493493                     tempstring.catprintf(" Ch.%d", outputnum);
494494
r7553r7554
864864
865865   /* copy in all the relevant info */
866866   info->speaker = (const speaker_config *)device->baseconfig().inline_config;
867   info->tag = device->tag;
867   info->tag = device->tag();
868868}
869869
870870
src/emu/render.c
r7553r7554
963963   assert(screen != NULL);
964964   assert(screen->machine != NULL);
965965   assert(screen->machine->config != NULL);
966   assert(screen->tag != NULL);
967966
968   screen_index = screen->machine->devicelist.index(VIDEO_SCREEN, screen->tag);
967   screen_index = screen->machine->devicelist.index(VIDEO_SCREEN, screen->tag());
969968
970969   assert(screen_index != -1);
971970
r7553r7554
14701469         {
14711470            const device_config *screen = target->machine->config->devicelist.find(VIDEO_SCREEN, item->index);
14721471            const screen_config *scrconfig = (const screen_config *)screen->inline_config;
1473            running_device *screendev = target->machine->device(screen->tag);
1472            running_device *screendev = target->machine->device(screen->tag());
14741473            const rectangle vectorvis = { 0, 639, 0, 479 };
14751474            const rectangle *visarea = NULL;
14761475            render_container *container = get_screen_container_by_index(item->index);
src/emu/clifront.c
r7553r7554
676676               case DEVICE_CLASS_TIMER:      printf("  Timer: ");   break;
677677               default:                  printf("  Other: ");   break;
678678            }
679            printf("%s ('%s')", devconfig->name(), devconfig->tag.cstr());
679            printf("%s ('%s')", devconfig->name(), devconfig->tag());
680680            if (devconfig->clock >= 1000000000)
681681               printf(" @ %d.%02d GHz\n", devconfig->clock / 1000000000, (devconfig->clock / 10000000) % 100);
682682            else if (devconfig->clock >= 1000000)
src/emu/state.h
r7553r7554
9494
9595/* register device items */
9696#define state_save_register_device_item(_dev, _index, _val) \
97   state_save_register_generic((_dev)->machine, (_dev)->name(), (_dev)->tag, _index, #_val, &_val, _val, 1)
97   state_save_register_generic((_dev)->machine, (_dev)->name(), (_dev)->tag(), _index, #_val, &_val, _val, 1)
9898
9999#define state_save_register_device_item_pointer(_dev, _index, _val, _count) \
100   state_save_register_generic((_dev)->machine, (_dev)->name(), (_dev)->tag, _index, #_val, &_val[0], _val[0], _count)
100   state_save_register_generic((_dev)->machine, (_dev)->name(), (_dev)->tag(), _index, #_val, &_val[0], _val[0], _count)
101101
102102#define state_save_register_device_item_array(_dev, _index, _val) \
103   state_save_register_item_pointer((_dev)->machine, (_dev)->name(), (_dev)->tag, _index, _val, sizeof(_val)/sizeof(_val[0]))
103   state_save_register_item_pointer((_dev)->machine, (_dev)->name(), (_dev)->tag(), _index, _val, sizeof(_val)/sizeof(_val[0]))
104104
105105#define state_save_register_device_item_2d_array(_dev, _index, _val) \
106   state_save_register_item_pointer((_dev)->machine, (_dev)->name(), (_dev)->tag, _index, _val[0], sizeof(_val)/sizeof(_val[0][0]))
106   state_save_register_item_pointer((_dev)->machine, (_dev)->name(), (_dev)->tag(), _index, _val[0], sizeof(_val)/sizeof(_val[0][0]))
107107
108108#define state_save_register_device_item_bitmap(_dev, _index, _val)   \
109   state_save_register_bitmap((_dev)->machine, (_dev)->name(), (_dev)->tag, _index, #_val, _val, __FILE__, __LINE__)
109   state_save_register_bitmap((_dev)->machine, (_dev)->name(), (_dev)->tag(), _index, #_val, _val, __FILE__, __LINE__)
110110
111111
112112
src/emu/validity.c
r7553r7554
620620      {
621621         if (video_screen_count(config) == 0)
622622         {
623            mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, devconfig->tag.cstr());
623            mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt, but the driver is screenless !\n", driver->source_file, driver->name, devconfig->tag());
624624            error = TRUE;
625625         }
626626         else if (cpuconfig->vblank_interrupt_screen != NULL && cpuconfig->vblank_interrupts_per_frame != 0)
627627         {
628            mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, devconfig->tag.cstr());
628            mame_printf_error("%s: %s cpu '%s' has a new VBLANK interrupt handler with >1 interrupts!\n", driver->source_file, driver->name, devconfig->tag());
629629            error = TRUE;
630630         }
631631         else if (cpuconfig->vblank_interrupt_screen != NULL && config->devicelist.find(cpuconfig->vblank_interrupt_screen) == NULL)
632632         {
633            mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, devconfig->tag.cstr(), cpuconfig->vblank_interrupt_screen);
633            mame_printf_error("%s: %s cpu '%s' VBLANK interrupt with a non-existant screen tag (%s)!\n", driver->source_file, driver->name, devconfig->tag(), cpuconfig->vblank_interrupt_screen);
634634            error = TRUE;
635635         }
636636         else if (cpuconfig->vblank_interrupt_screen == NULL && cpuconfig->vblank_interrupts_per_frame == 0)
637637         {
638            mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, devconfig->tag.cstr());
638            mame_printf_error("%s: %s cpu '%s' has a VBLANK interrupt handler with 0 interrupts!\n", driver->source_file, driver->name, devconfig->tag());
639639            error = TRUE;
640640         }
641641      }
642642      else if (cpuconfig->vblank_interrupts_per_frame != 0)
643643      {
644         mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, devconfig->tag.cstr());
644         mame_printf_error("%s: %s cpu '%s' has no VBLANK interrupt handler but a non-0 interrupt count is given!\n", driver->source_file, driver->name, devconfig->tag());
645645         error = TRUE;
646646      }
647647
648648      if (cpuconfig->timed_interrupt != NULL && cpuconfig->timed_interrupt_period == 0)
649649      {
650         mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, devconfig->tag.cstr());
650         mame_printf_error("%s: %s cpu '%s' has a timer interrupt handler with 0 period!\n", driver->source_file, driver->name, devconfig->tag());
651651         error = TRUE;
652652      }
653653      else if (cpuconfig->timed_interrupt == NULL && cpuconfig->timed_interrupt_period != 0)
654654      {
655         mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, devconfig->tag.cstr());
655         mame_printf_error("%s: %s cpu '%s' has a no timer interrupt handler but has a non-0 period given!\n", driver->source_file, driver->name, devconfig->tag());
656656         error = TRUE;
657657      }
658658   }
r7553r7554
681681      /* sanity check dimensions */
682682      if ((scrconfig->width <= 0) || (scrconfig->height <= 0))
683683      {
684         mame_printf_error("%s: %s screen '%s' has invalid display dimensions\n", driver->source_file, driver->name, devconfig->tag.cstr());
684         mame_printf_error("%s: %s screen '%s' has invalid display dimensions\n", driver->source_file, driver->name, devconfig->tag());
685685         error = TRUE;
686686      }
687687
r7553r7554
693693            (scrconfig->visarea.max_x >= scrconfig->width) ||
694694            (scrconfig->visarea.max_y >= scrconfig->height))
695695         {
696            mame_printf_error("%s: %s screen '%s' has an invalid display area\n", driver->source_file, driver->name, devconfig->tag.cstr());
696            mame_printf_error("%s: %s screen '%s' has an invalid display area\n", driver->source_file, driver->name, devconfig->tag());
697697            error = TRUE;
698698         }
699699
r7553r7554
702702            scrconfig->format != BITMAP_FORMAT_RGB15 &&
703703            scrconfig->format != BITMAP_FORMAT_RGB32)
704704         {
705            mame_printf_error("%s: %s screen '%s' has unsupported format\n", driver->source_file, driver->name, devconfig->tag.cstr());
705            mame_printf_error("%s: %s screen '%s' has unsupported format\n", driver->source_file, driver->name, devconfig->tag());
706706            error = TRUE;
707707         }
708708         if (scrconfig->format == BITMAP_FORMAT_INDEXED16)
r7553r7554
712712      /* check for zero frame rate */
713713      if (scrconfig->refresh == 0)
714714      {
715         mame_printf_error("%s: %s screen '%s' has a zero refresh rate\n", driver->source_file, driver->name, devconfig->tag.cstr());
715         mame_printf_error("%s: %s screen '%s' has a zero refresh rate\n", driver->source_file, driver->name, devconfig->tag());
716716         error = TRUE;
717717      }
718718   }
r7553r7554
12161216   {
12171217      /* check for duplicate tags */
12181218      for (checkspeak = speaker_output_first(config); checkspeak != NULL; checkspeak = speaker_output_next(checkspeak))
1219         if (checkspeak != curspeak && strcmp(checkspeak->tag, curspeak->tag) == 0)
1219         if (checkspeak != curspeak && strcmp(checkspeak->tag(), curspeak->tag()) == 0)
12201220         {
1221            mame_printf_error("%s: %s has multiple speakers tagged as '%s'\n", driver->source_file, driver->name, checkspeak->tag.cstr());
1221            mame_printf_error("%s: %s has multiple speakers tagged as '%s'\n", driver->source_file, driver->name, checkspeak->tag());
12221222            error = TRUE;
12231223         }
12241224
12251225      /* make sure there are no sound chips with the same tag */
12261226      for (checksound = sound_first(config); checksound != NULL; checksound = sound_next(checksound))
1227         if (strcmp(curspeak->tag, checksound->tag) == 0)
1227         if (strcmp(curspeak->tag(), checksound->tag()) == 0)
12281228         {
1229            mame_printf_error("%s: %s has both a speaker and a sound chip tagged as '%s'\n", driver->source_file, driver->name, curspeak->tag.cstr());
1229            mame_printf_error("%s: %s has both a speaker and a sound chip tagged as '%s'\n", driver->source_file, driver->name, curspeak->tag());
12301230            error = TRUE;
12311231         }
12321232   }
r7553r7554
12421242      {
12431243         /* find a speaker with the requested tag */
12441244         for (checkspeak = speaker_output_first(config); checkspeak != NULL; checkspeak = speaker_output_next(checkspeak))
1245            if (strcmp(route->target, checkspeak->tag) == 0)
1245            if (strcmp(route->target, checkspeak->tag()) == 0)
12461246               break;
12471247
12481248         /* if we didn't find one, look for another sound chip with the tag */
12491249         if (checkspeak == NULL)
12501250         {
12511251            for (checksound = sound_first(config); checksound != NULL; checksound = sound_next(checksound))
1252               if (checksound != cursound && strcmp(route->target, checksound->tag) == 0)
1252               if (checksound != cursound && strcmp(route->target, checksound->tag()) == 0)
12531253                  break;
12541254
12551255            /* if we didn't find one, it's an error */
r7553r7554
12841284      int spacenum;
12851285
12861286      /* validate the device tag */
1287      error |= validate_tag(driver, devconfig->get_config_string(DEVINFO_STR_NAME), devconfig->tag);
1287      error |= validate_tag(driver, devconfig->get_config_string(DEVINFO_STR_NAME), devconfig->tag());
12881288
12891289      /* look for duplicates */
12901290      for (scanconfig = config->devicelist.first(); scanconfig != devconfig; scanconfig = scanconfig->next)
1291         if (strcmp(scanconfig->tag, devconfig->tag) == 0)
1291         if (strcmp(scanconfig->tag(), devconfig->tag()) == 0)
12921292         {
1293            mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr());
1293            mame_printf_warning("%s: %s has multiple devices with the tag '%s'\n", driver->source_file, driver->name, devconfig->tag());
12941294            break;
12951295         }
12961296
r7553r7554
13221322         /* validate the global map parameters */
13231323         if (map->spacenum != spacenum)
13241324         {
1325            mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, devconfig->tag.cstr(), spacenum, map->spacenum);
1325            mame_printf_error("%s: %s device '%s' space %d has address space %d handlers!\n", driver->source_file, driver->name, devconfig->tag(), spacenum, map->spacenum);
13261326            error = TRUE;
13271327         }
13281328         if (map->databits != databus_width)
13291329         {
1330            mame_printf_error("%s: %s device '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], databus_width, map->databits);
1330            mame_printf_error("%s: %s device '%s' uses wrong memory handlers for %s space! (width = %d, memory = %08x)\n", driver->source_file, driver->name, devconfig->tag(), address_space_names[spacenum], databus_width, map->databits);
13311331            error = TRUE;
13321332         }
13331333
r7553r7554
13461346                     ((entry->read.type != AMH_NONE && scan->read.type != AMH_NONE) ||
13471347                      (entry->write.type != AMH_NONE && scan->write.type != AMH_NONE)))
13481348                  {
1349                     mame_printf_warning("%s: %s '%s' %s space has overlapping memory (%X-%X,%d,%d) vs (%X-%X,%d,%d)\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->read.type, entry->write.type, scan->addrstart, scan->addrend, scan->read.type, scan->write.type);
1349                     mame_printf_warning("%s: %s '%s' %s space has overlapping memory (%X-%X,%d,%d) vs (%X-%X,%d,%d)\n", driver->source_file, driver->name, devconfig->tag(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->read.type, entry->write.type, scan->addrstart, scan->addrend, scan->read.type, scan->write.type);
13501350                     detected_overlap = TRUE;
13511351                     break;
13521352                  }
r7553r7554
13691369            /* if this is a program space, auto-assign implicit ROM entries */
13701370            if (entry->read.type == AMH_ROM && entry->region == NULL)
13711371            {
1372               entry->region = devconfig->tag;
1372               entry->region = devconfig->tag();
13731373               entry->rgnoffs = entry->addrstart;
13741374            }
13751375
r7553r7554
13841384                  /* stop if we hit an empty */
13851385                  if (rgninfo->entries[rgnnum].tag == NULL)
13861386                  {
1387                     mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X references non-existant region '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region);
1387                     mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X references non-existant region '%s'\n", driver->source_file, driver->name, devconfig->tag(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region);
13881388                     error = TRUE;
13891389                     break;
13901390                  }
r7553r7554
13951395                     offs_t length = rgninfo->entries[rgnnum].length;
13961396                     if (entry->rgnoffs + (byteend - bytestart + 1) > length)
13971397                     {
1398                        mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region, length);
1398                        mame_printf_error("%s: %s device '%s' %s space memory map entry %X-%X extends beyond region '%s' size (%X)\n", driver->source_file, driver->name, devconfig->tag(), address_space_names[spacenum], entry->addrstart, entry->addrend, entry->region, length);
13991399                        error = TRUE;
14001400                     }
14011401                     break;
r7553r7554
14071407            if ((entry->read.type == AMH_DEVICE_HANDLER && entry->read.tag != NULL && config->devicelist.find(entry->read.tag) == NULL) ||
14081408               (entry->write.type == AMH_DEVICE_HANDLER && entry->write.tag != NULL && config->devicelist.find(entry->write.tag) == NULL))
14091409            {
1410               mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->write.tag);
1410               mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant device '%s'\n", driver->source_file, driver->name, devconfig->tag(), address_space_names[spacenum], entry->write.tag);
14111411               error = TRUE;
14121412            }
14131413
r7553r7554
14151415            if ((entry->read.type == AMH_PORT && entry->read.tag != NULL && portlist.find(entry->read.tag) == NULL) ||
14161416               (entry->write.type == AMH_PORT && entry->write.tag != NULL && portlist.find(entry->write.tag) == NULL))
14171417            {
1418               mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver->source_file, driver->name, devconfig->tag.cstr(), address_space_names[spacenum], entry->read.tag);
1418               mame_printf_error("%s: %s device '%s' %s space memory map entry references nonexistant port tag '%s'\n", driver->source_file, driver->name, devconfig->tag(), address_space_names[spacenum], entry->read.tag);
14191419               error = TRUE;
14201420            }
14211421
src/emu/romload.c
r7553r7554
272272   else
273273   {
274274      const device_config *devconfig = (const device_config *)source;
275      result.printf("%s:%s", devconfig->tag.cstr(), ROMREGION_GETTAG(romp));
275      result.printf("%s:%s", devconfig->tag(), ROMREGION_GETTAG(romp));
276276   }
277277   return result;
278278}
docs/messnew.txt
r7553r7554
10.136.1
10.137
22
33New System Drivers Supported:
44-----------------------------
whatsnew.txt
r7553r7554
10.136
10.137
22-----
33
4IMPORTANT NOTE: As of this release of MAME, several important things
5about the system have changed. Please read the following items before
6attempting to compile this new version.
47
81. A new tool chain for Windows, based off of gcc 4.4.3 prerelease,
9is now REQUIRED. Go to http://mamedev.org/tools to get the new tools.
10The code included with 0.137 WILL NOT BUILD with the old tools.
11The new tool chain has support for building 64-bit MAME builds with
12gcc, as well as built-in DirectX headers, and C++ support, which was
13missing from the old tools.
14
152. Non-Unicode builds of Windows MAME are no longer supported. The
16options to turn this off in the makefile have been removed, and
17future changes are likely to solidify this requirement. If you are
18still (God forbid) running on Win9x, you will need the unicows.dll
19library to run MAME. Download unicows from Microsoft.
20
213. All code in MAME is now compiled as C++, plus there have been a few
22small changes that take advantage of the C++ language. For the most
23part, there is no effect on how drivers are written, except for some
24nicer accessors to devices and address spaces. Future improvements to
25take advantage of the C++ syntax will evolve slowly, and will be done
26internally. We are not interested in outside attempts to do this work
27for now.
28
294. The SDL OSD for MAME is now shipped as part of the main source
30package. SDL builds for Windows are now regularly built as part of the
31validation sequence for a new release. Thanks to R. Belmont,
32couriersud, and Olivier Galibert for their work on the SDL port over
33the years.
34
35
36
537MAMETesters Bugs Fixed
638----------------------
7- 03603: [DIP/Input] karnov, karnovj: incorrect difficulty dipswitch
8         (Tafoid)
9- 03604: [DIP/Input] oscar, oscaru, oscarj1, oscarj2: Incorrect
10         difficulty dipswitch (Tafoid)
11- 03142: [DIP/Input] All drivers using PORT_CHANGED callbacks: Input
12         port callback functions are not triggered correctly during
13         INP playback. (mahlemiut)
14- 03493: [Gameplay] spacedxo: The game reboots itself after title
15         screen (Fabio Priuli)
16- 03608: [Multisession] scontra, scontraj: Tile/graphic corruption on
17         multiple launches of Super Contra (Fabio Priuli)
18- 03611: [Crash/Freeze] 1943, 1943j, 1943kai: Crash when starting
19         1943 in Service Mode (Fabio Priuli)
20- 03598: [Original Reference] plotting, flipull: YM2203 speed
21         adjustment (Tafoid)
22- 03593: [Graphics] captaven & clones: Intro text scrolls from wrong
23         direction (Pierpaolo Prazzoli)
24- 03596: [Crash/Freeze] All sets in konamigv.c, mitchell.c: Attempt to
25         register save state entry after state registration is closed
26         (Aaron Giles)
27- 03597: [Original Reference] outrun, outrunra, outruno, outrundx,
28         outrunb: Incorrect vsync speed on Outrun (Tafoid)
39- 03533: [Debugger] All 68020 cpu based drivers: 68020 disassembler
40         bug: a 32-bit address displacement's upper 16-bit is
41         desappear (R. Belmont)
2942
3043
3144
3245Source Changes
3346--------------
34hng64 improvements: [Andrew Gardner]
35 - RoadsEdge & XRally polygons are now visible.
36 - Improved geometry chunk type 0x2e.
37 - Fleshed out the 'chunk type bits' a little. This will be verified
38    against type 0x24.
39 - Xrally and roadedge hng64 screens no longer run at 10fps.
40 - Fixed polygon lookup in driving games.
47snes.c: simplified drawing routines, added support for
48offset-per-tile, cleaned up the code [Fabio Priuli]
4149
42Changed behavior of -watchdog option to act like a real watchdog. It
43now specifies the number of seconds after the last video update that
44will cause auto-termination of MAME. Also modified it to output a
45message when the watchdog triggers the exit. [Aaron Giles]
50H8/3334: add analog input ports [R. Belmont]
4651
47Updated windows.txt to reflect this option and the debugger_font
48options which were never previously documented. [Aaron Giles]
52snes.c: fixed remaining issues in hires modes [Fabio Priuli]
4953
50EEPROM changes: [Aaron Giles]
51 - Fixed auto EEPROM region to properly handle 16-bit data.
52 - Changed EEPROM device to initialize EEPROM at NVRAM load time
53    rather than init time, giving DEVICE_INIT handlers a chance to
54    muck with the data first.
55 - Removed _NODEFAULT_ forms of EEPROM driver macros. If you need to
56    add default data, follow the MDRV_EEPROM_ADD() with
57    MDRV_EEPROM_DATA().
58 - Updated remaining drivers to the new EEPROM device code. Many of
59    them now require a default EEPROM to be loaded along with the
60    ROMs, rather than hard-coded data in the driver
61 - Exposed an address space for EEPROM devices, meaning the memory
62    is now visible in the debugger and can be accessed via expressions
63 - Updated all systems that muck directly with EEPROM memory to
64    use memory accessors instead on the EEPROM address space.
65 - Removed old EEPROM implementation
66 
67cb2001: added many new opcodes [robiza]
54snes.c: fixed serial joystick reads [Fabio Priuli]
6855
69Split ADC1038, Konami 033906 and Konami 056230 emulation from
70gticlub.c and konppc.c. Also, converted them to be devices and updated
71PPC Konami games to use the new code. [Fabio Priuli]
56snes.c: slightly simplified palette handling [Fabio Priuli]
7257
73Added a bunch of new protection handlers for Spark Man [Angelo Salese]
58Re-dumped oceanhun CROMs 5-16 as 64Mb [ANY]
7459
75sub.c - Put in board XTAL and came up with some seeming better clock
76speed approximations until board readings can be done. [Tafoid]
60namcos23: Cleanups [O. Galibert]
7761
78mcr.c - Sets tron3 and tron4 don't appear to have a valid working
79cocktail mode video or controls (upright player2 works fine). Flagged
80as GAME_NO_COCKTAIL. [Tafoid]
62namcos23: Add dips [O. Galibert]
8163
82subs.c - Added DIP LOCATIONS. [Tafoid]
64snes.c: Added very preliminary driver_data class for snes based
65drivers (it only contains input-related items for the moment, because
66these are needed to add support for additional controller types in
67MESS) [Fabio Priuli]
8368
84Updated qdrmfgp.c to use Konami video devices. [Fabio Priuli]
69snes.c: Fixed Offset-per-tile graphics [jbo_85]
8570
86Cleaned up a bunch of things in the gladiatr.c driver [Angelo Salese]
71snes.c: Fixed scrolling problems [Fabio Priuli]
8772
88Removed sysconfig section from game_driver struct. Made
89compatible_with attribute available for MAME too (with NULL value set
90in GAMEL macro). [Miodrag Milanovic]
73namcos23: More cleanups [O. Galibert]
9174
92Added preliminary device version of Konami video ICs used in PowerPC
93games (001005, 001006, 001604 and 037122). [Fabio Priuli]
75Implemented default EEPROMs to the following drivers [David Haywood]
76 * deco_mlc.c
77 * esd16.c
78 * gijoe.c
79 * konamigx.c
80 * moo.c
81 * mystwarr.c
82 * rabbit.c
83 * rungun.c
84 * tmnt.c
85 * vendetta.c
86 * xexex.c
9487
95Converted all Taito custom I/O and video ICs to devices and updated
96all drivers to use them. [Fabio Priuli]
88Added support for the 'simple' rowscroll mode used by sams64_2
89[David Haywood]
9790
98Simplified bloodbro gfx decoding and removed unnecessary DRIVER_INIT.
99Marked two weststry sprite ROMs as BAD_DUMP [David Haywood]
91Fixed Z80 DMA ready signal handling. [Curt Coder]
10092
101Converted Namco IO chips 56xx, 58xx and 59xx to be devices and
102converted gaplus.c, mappy.c and toypop.c to use the new code.
103[Fabio Priuli]
93namcos23 update: [R. Belmont, Guru]
94 * Updated Guru Readme
95 * More IRQ tests pass
96 * Gunmen Wars I/O board runs and syncs
97 * SH-2 shared RAM added for Gunmen Wars
10498
105Allow any device memory (not just CPU's) to be accessed via debug
106expressions. Removed support in the expression engine for EEPROM-
107specific accesses. [Aaron Giles]
99Implemented default EEPROMs to Bubble Memories, Lethal Enforcers and
100Puzzle Time [David Haywood]
108101
109Converted Fujitsu MB87078 Volume Controller to be a device and
110updated taito_b.c to use the new code (it's the only driver
111emulating this chip atm). [Fabio Priuli]
102Implemented default EEPROMs for GTIClub, Hang Pilot, Asterix, X-Men
103and Polygonet Commanders [David Haywood]
112104
113merit.c - Fixed what might be a copy/paste error in two sets
114(trvwz3h, trvwz3v) where two roms had the same filename in the same
115romset. [Tafoid]
105Fixed the texture ROM loading/order in Wave Shark.  Textures look
106better now, and the ROM check passes [David Haywood]
116107
117Renamed tilemap -> tilemap_t, as the name 'tilemap' is too commonly
118used for statics and structure members, and some compilers (esp. C++
119compilers) don't allow that. [Aaron Giles]
108namcos23: pass C422 IRQ test [R. Belmont]
120109
121Fix for INP recording ports that have changed notification. Also
122prevents new inputs from affecting recorded inputs during playback.
123[mahlemiut]
110Added ARDY/BRDY signal read handlers to Z80 PIO. [Curt Coder]
124111
125Updated srcclean to remove "invisible spaces" immediately preceding
126tabs. [Atari Ace]
112Implemented 'key matrix' inputs in King Derby (1986 version)
113[Angelo Salese]
127114
128Cleaned up braces in the code so that they are properly balanced.
129[Atari Ace]
115namcos23 updates: [R. Belmont]
116 * Preliminary SH-2 hookup for GMEN games.  SH-2 boots and copies the
117    loader to private RAM then jumps to it.  Transfer protocol for
118    main program not yet understood.
119 * Final Furlong 2 has a GMEN board and camera; update it to use that
120    subdriver.
130121
131Optimized RDP implementation further with more flattened branches.
132[Harmony]
122Implemented sound to King Derby (1986 version) [Angelo Salese]
133123
134Converted a number of vector opcodes to the RSP DRC core. [Harmony]
124Implemented coins to King Derby (1986 version), game can be considered
125as working right now [Angelo Salese]
135126
136Unrolled and optimized a number of vector opcodes in the interpreter
137RSP core. [Harmony]
127namcos23 updates: [R. Belmont]
128 * Hooked up start/coin/buttons for Gorgon
129 * Fixed Panic Park crash
130 * Enabled I/O board for timecrs2c so it can coin up
131 * Cleanup
138132
139Extended the devtempl.h file to support device address spaces.
140[Aaron Giles]
133SDL: fix Fortify-reported stack smash [Belegdol]
141134
142cmmb.c - Identified and marked Service Mode DIP. [Tafoid]
135New driver for Five Clown, from IGS. This is a dual 6502 system with
136CRT controller, AY8910 and OKI M6295. Main program, graphics and sound
137samples are encrypted. [Roberto Fresca, Grull Osgo]
138 * Hooked both 6502 CPU's.
139 * Hooked the M6845 CRT.
140 * Decrypted main program and bulk GFX.
141 * Decoded GFX and color PROM.
142 * Hooked both PIA's 6821.
143 * Worked inputs from the scratch.
144 * Hooked DIP Switches banks 2 & 4.
145 * Hooked proper interrupts for audio CPU.
146 * Hooked the AY8910 latches...
147 * Hooked the OKI6295.
148 * Hooked DIP switches ports $C400 & $CC00.
149 * Found the sound samples decryption algorithm.
150 * Added NVRAM support.
151 * Added a complete PCB layout.
152 * Added game notes.
153 * Added technical notes.
143154
144Converted the NMK112 to be a device and updated drivers using it
145accordingly. [Fabio Priuli]
155z80sio: Added register access functions to prevent trampoline
156functions [Dirk Best]
146157
147Added GAME_SUPPORTS_SAVE flag to psikyosh.c, since the conversion to
148eeprom devices fixed the remaining issues with save states.
149[Fabio Priuli, Aaron Giles]
158Fixed debugger memdump command [Robbbert]
150159
151Changed Caveman Ninja driver to use Partial Updates for Raster Effects
152instead of buffering scanline data [David Haywood]
160Improvements to the unkch1/4 sets [David Haywood]
153161
154Changed Deco32 driver to use Partial Updates for Raster Effects
155instead of buffering scanline data (but left Dragon Gun using the
156buffering, because the video rendering code is far too slow with 224
157partial updates for now) [David Haywood]
162Decrypted the color prom in King Derby (1986 version) [Angelo Salese]
158163
159Commented out some harmful and suspicious looking interrupt generation
160in NamcoND1 driver until it's being properly verified; fixes Game
161Options menu in NCV2 test mode.  [David Haywood]
164Made device->tag and devconfig->tag into private member variables
165(m_tag). Added inline tag() function to return a const char * version.
166Updated callers to use this instead of directly accessing tag.cstr()
167which was awkward. [Aaron Giles]
162168
163adp.c improvements: [Angelo Salese]
164 - Fixed some minor quirks
165 - Improved Backgammon memory map
166 - Implemented RAMDAC for Fun Land Deluxe
169snes.c: Fixed OAM overflow [jbo_85, Fabio Priuli]
167170
168Fixed error in codegen for drol/dror opcodes in the x86 back-end.
169[Aaron Giles]
171Improvements to funworld.c driver. [Roberto Fresca]
172 * Added external default NVRAM support to the following games:
173    bottle10, bottl10b, elephfam, elephfmb, jollycrd, jolyc3x3,
174    jolyccra, jolyccrb, jolycdev, jolycdib, jolycdit, jolyjokr,
175    jolyjokra, jolyjokrb, lluck3x3, lluck4x1, magicrd2, pool10,
176    pool10b, pool10c, pool10d, potgame, royalcrd, royalcdb, sjcd2kx3,
177    tortufam, vegasfst, vegasfte and vegasslw.
178 * Changed default settings for some games, now that NVRAM is loaded
179    externally.
170180
171Re-implemented misaligned memory handling in the RSP DRC as before.
172[Aaron Giles]
181Confirmed and hooked up i/o ports in Magical Tonic / Odds, doesn't
182work due of nested NMI [Angelo Salese]
173183
174Explicitly sign-extend 32-bit indexes for load/loads/store on 64-bit
175machines to prevent overflow issues. Fixes DRC crash in mtetrisc.
176[Aaron Giles]
184snes.c: refactored joypad inputs to be consistent with other input
185devices (used in MESS) [Fabio Priuli]
177186
178Fixed a few DRC-ized vector load/store opcodes in the RSP core.
179[Harmony]
187Implemented NMI enable flag in Lucky 8 Lines and Magical Odds, fixes
188logic quirks in the latter [Angelo Salese]
180189
181Hardware multiplication and division on the SNES takes 8 machine
182cycles to complete. [Wilbert Pol]
190Improvements to Magical Odds graphics [David Haywood]
183191
184Fixed x86 HLT instruction handling [Phill Harvey-Smith]
192Written a per-pixel function for the irq system in the ST-V driver,
193disabled by default [Angelo Salese]
185194
186Made LA Girls and clone of Play Girls. It's clearly a bootleg
187hardware clone. Title & background change, but the demo play and
188block arrangement are identical. Added info from the Guru's website
189about the reported manufacture company and year for LA Girls. Added a
190note about Tube-it having the copyright and manufacture info removed.
191[Brian Troha]
195vimana, vimanan, vimana1 (toaplan1.c driver) [stephh] :
196 * Fixed Dip Switches and Inputs (after verification of the M68000
197    code)
198 * Improved MCU emulation to correctly handle coinage based on Dip
199    Switches settings and Territory Jumper
192200
193Added additional information to the dipswitches and configurations
194sections in the -listxml output [Oliver Stoneberg]
201Implemented sound NMI enable flag to the Munch Mobile driver
202[Angelo Salese]
195203
196Changed Green Beret sound chip to SN76489 and indicated that the
197bootleg has an undumped PAL and PROMs [Kevin Eshbach]
204m680x0: show FPU registers in the debugger for 030+ [R. Belmont]
198205
206680x0: Improve disassembly for various FMOVE forms [R. Belmont]
199207
208Slightly fixed interrupt handling and added SBIC and MUL opcodes to
209the Atmel AVR8 core. [Harmony]
200210
211Added FJMP/JMPF opcode to the SunPlus u'nSP core. [Segher, Harmony]
212
213Performed an initial code cleanup pass on the N64 rendering code to
214make use of booleans and inline variable instantiation, and removed a
215number of unused variables that were exposed as a result of the
216latter. [Harmony]
217
218
219
201220New games added or promoted from NOT_WORKING status
202221---------------------------------------------------
203Final Fight (Japan, hack) [bonky0013, JacKc, Fabio Priuli]
222Five Clown (english, set 1) [Roberto Fresca, Grull Osgo]
223Five Clown (english, set 2) [Roberto Fresca, Grull Osgo]
224Five Clown (spanish hack) [Roberto Fresca, Grull Osgo]
225Magical Odds [David Haywood, Angelo Salese]
204226
205227
206228
207229New clones added
208230----------------
209Spark Man (v 2.0, set 2) [Stefan Lindberg] (Not Working)
210Cherry Master I (ver.1.01) (various bootleg? sets) [David Haywood]
211Block (Game Corporation bootleg, set 3) [David Haywood]
212Multi Fish (030124) [MetalliC]
213Shaolin's Road (bootleg) [Kevin Eshbach]
231Dinosaur Hunter (Chinese bootleg of Cadillacs and Dinosaurs)
232  [Anonymous] (not working)
233Biaofeng Zhanjing (Chinese bootleg of The Punisher) [Anonymous]
234Cherry Master I (E-Z Spin bootleg / hack) [William Ostronic]
235Lethal Enforcers II: The Western (ver JAA) [David Haywood]
236Fantastic Journey (ver AAA) [David Haywood, Tirino73]
237Smash T.V. (rev 3.01) [Brian Troha, The Dumping Union]
214238
215239
216240
217241New games marked as GAME_NOT_WORKING
218242------------------------------------
219Cycle Mahbou [Angelo Salese, Chack'n, Team Japump, Dumping Union]
220Race Drivin' Panorama [David Haywood]
221Metal Maniax (prototype) [David Haywood]
243Joker Master / Poker Master
244  [William Ostronic] (incomplete + encrypted)
245Gunmen Wars [Guru]
222246
223247
224248
2250.135u4
2490.136u4
226250-------
227251
228252
229253MAMETesters Bugs Fixed
230254----------------------
231- 03583: [Core] Windows Debug: Stack crawl is not generated anymore
232         (Firewave)
233- 03588: [Sound] mystston, myststono: Music is faster than original
234         PCB (Kold666)
235- 03589: [Graphics] mystston, myststono: VSYNC does not match original
236         PCB (Kold666)
237- 03592: [Original Reference] outrun, outrunra, outruno, outrundx,
238         outrunb: Master clock is incorrect (Tafoid)
239- 00400: [Graphics] combascb: Graphic issues on the "players" screen
240         as scrolling problems on 1st stage. (Fabio Priuli)
241- 03575: [Crash/Freeze] block2: [debug] Memory Leak in Debug
255- 03268: [Save/Restore] All sets in galaga.c: Problem with Savestates
256         (couriersud)
257- 03698: [Compiling] NOWERROR=1 casues -fno-strict-aliasing to be
258         dropped (couriersud)
259- 03749: [Crash/Freeze] All sets in micro3d.c : [debug] Assert in
260         debug build (couriersud)
261- 03746: [Core] [debug] Overloaded C++ operator new/operator delete is
262         too restrictive (couriersud)
263- 03748: [Documentation] ncv1, ncv2 and clones: Namco 'Classics'
264         Collection description incorrect (Tafoid)
265- 03634: [Graphics] quantum: Draws wrong lines (MathisRosenhauer)
266- 03739: [Crash/Freeze] backgamn: Access Violation after OK
242267         (Fabio Priuli)
243- 03569: [Crash/Freeze] escounts: Access Violation after OK
244         (Phil Bennett)
245- 03444: [Debugger] Registered ram blocks registered with save state
246         cannot be viewed with debugger (Aaron Giles)
247- 03567: [Crash/Freeze] trvquest: Access Violation after OK
248         (Fabio Priuli)
249- 03574: [Crash/Freeze] All sets in drivers using s2636 video chip:
250         [debug] assert: src/emu/video/s2636.c:320: offset < 8
251         (Fabio Priuli)
252- 03570: [Crash/Freeze] kf2k3pcb: Access Violation after OK
253         (Fabio Priuli)
268- 03249: [Misc.] motoxgo, timecrs2b: H8/3xx: Unknown opcode (PC=2)
269         100 (R. Belmont)
270- 03740: [Crash/Freeze] atomicp, snapper: Duplicate save state entry
271         (Tafoid)
272- 03699: [Crash/Freeze] masterw: Game freezes (Fabio Priuli)
273- 03697: [Misc.] bigrun: Missing gfx and terrible music (Mamesick)
274- 02960: [Graphics] speglsht: Regression in Super Eagle Shot, looping
275         broken attract mode (Mamesick)
276- 03034: [DIP/Input] scross, scrossu: Control Issues (M.A.S.H.)
277- 03731: [DIP/Input] ixion: Unable to rotate cannon clockwise (M.A.S.H.)
278- 03727: [Misc.] spiders: Source typo in discrete sound system
279         (M.A.S.H.)
254280
255281
256282
257283Source Changes
258284--------------
259Added driver data struct to: [Fabio Priuli]
260 - airbustr.c
261 - cvs.c
262 - 8080bw.c and mw8080bw.c
263 - 88games.c, combatsc.c and rockrage.c
264 - psikyo4.c and psikyosh.c
285Removed window config from video_config [couriersud]
265286
266Added driver data struct and save states to: [Fabio Priuli]
267 - djboy.c
268 - toratora.c and sf.c
269 - neogeo.c
270 - cps1.c, cps2.c and fcrash.c
271 - cbasebal.c, chinsan.c, mitchell.c and quasar.c
272 - malzak.c
273 - battlnts.c, bladestl.c, crshrace.c and contra.c
274 - f1gp.c, fastlane.c, flkatck.c, hcastle.c, labyrunr.c and suprslam.c
275 - psikyo.c and pgm.c
287Mapped player 2 inputs and buttons 4-6 in Mortal Kombat 3 (bootleg of
288Megadrive version) [Mariusz Wojcieszek].
276289
277Removed old index-based DISCRETE_ADJUSTMENT and then renamed the newer
278DISCRETE_ADJUSTMENT_TAG to replace it. Updated all callers.
279[Aaron Giles]
290{megadriv} Fixed compile by removing "static" [Miodrag Milanovic]
280291
281Removed all uses of input_port_by_index(), and removed the function.
282[Fabio Priuli, Aaron Giles]
292Moved global new/delete operators into inlines in emualloc.h to avoid
293link errors with certain architectures. [couriersud]
283294
284Added saves to 6522via.c. This fixes problems of gameplan.c and
285trvquest.c games with -autosave. [Fabio Priuli]
295Some minor cleanup/normalizing of emualloc in general. [Aaron Giles]
286296
287Enabled GAME_SUPPORTS_SAVE flag to dday.c because some of the core
288changes have fixed the sound problem at loading. [Fabio Priuli]
297namcops2 updates [Guru]
298 * Moved Kinnikuman Muscle Grand Prix and Taiko No Tatsujin 9 to
299   System 256
300 * Added DVD images for netchu02, soulcl2a, tekken4b, tekken51,
301   sukuinuf, and soulclb3
289302
290Imported SAA5050 emulation from MESS and made it a device. Updated
291malzak.c to use it, removing the almost identical implementation in
292the driver. [Fabio Priuli]
303Fixed TI PSG (sn76489 and friends) noise and square-wave period to be
304maximum length when period register is set to 0. Fixed white-noise
305phase/XOR issue: got rid of noise XOR/XNOR select, as all chips seem
306to use XOR. [Lord Nightmare, Michael Zapf, PlgDavid]
293307
294Added TILE_GET_INFO_DEVICE and SET_TILE_INFO_DEVICE macros to
295tilemap.c. [Fabio Priuli]
308Preliminary DIP coverage (lives/coinage/test mode) and Player 2
309control fix for unclepoo. [Tafoid]
296310
297Made MB14241 Shifter IC a device and moved its source to emu/machine.
298Updated mw8080bw.c and 8080bw.c accordingly. Also converted fgoal.c
299to use this implementation in place of its own version. [Fabio Priuli]
311Implemented Z80-DMA interrupts. [Curt Coder]
300312
301Enhanced the UML opcodes for LOAD, LOADS, and STORE to support
302arbitrary scaling factors. Previously, specifying a size implied
303a scaling factor equal to the size (i.e., specifying DWORD meant
304the index was scaled by 4). This is still the default. However,
305now you can specify the scale explicitly for other cases. For
306example, you can specify DWORD_x1 to fetch a DWORD but don't
307scale the index at all, or BYTE_x8 to fetch a BYTE while scaling
308the index by 8. Updated all backends to make this work. [Aaron Giles]
313Fixed a bug in emu/sound/disc_mth.c. This affected spiders.c fire
314sound. [MASH]
309315
310Konami devic-fication and improvements: [Fabio Priuli]
311 - Added device versions of all the Konami custom ICs currently
312    emulated in machine/konamiic.c and video/konamiic.c
313 - Updated combatsc.c, contra.c, crshrace.c, f1gp.c, fastlane.c,
314    flkatck.c, hcastle.c, labyrunr.c and suprslam.c to use the
315    new code.
316 - Moved k056800 sound device to emu/sound and removed the old code;
317    updated gticlub.c, hornet.c, nwk-tr.c, ultrsprt.c and zr107.c to
318    use this implementation
319 - Updated 88games.c, battlnts.c, bladestl.c and rockrage.c to use new
320    devices
321 - Updated asterix.c and moo.c to use the new devices.
322 - Converted aliens.c, blockhl.c, crimfght.c and gbusters.c to use
323    Konami video devices
324 - Updated parodius.c, simpsons.c, thunderx.c, vendetta.c and
325    xexex.c to use the new video devices
326 - Updated overdriv.c to use the Konami video devices
327 - Updated gradius3.c, mainevt.c & gijoe.c to use Konami video devices
328 - Updated ajax.c, bottom9.c, chqflag.c, rollerg.c, spy.c, surpratk.c
329    to use Konami video devices
330 - Updated dbz.c, lethal.c, metro.c, rungun.c, tail2nos.c, tmnt.c,
331    ultraman.c, wecleman.c, xmen.c & zr107.c to use Konami video
332    devices instead of konamiic.h code
333 - Updated bishi.c and djmain.c to use Konami video devices
334 - Updated plygonet.c to use Konami video devices and
335    input_port_write for eepromdev_read_bit
336 - Updated asterix.c, gijoe.c, hornet.c, lethal.c, moo.c, overdriv.c,
337    rungun.c, vendetta.c, xexex.c & xmen.c to use eeprom device
338 - Updated konamigx.c, tmnt.c and mystwarr.c to use eeprom device
316Minor fix to sn76489: sn76489 wasn't using the correct noise taps (now
317matches sn94624, still need to test a real chip) Removed a piece of
318useless code, and fixed a comment. [Lord Nightmare]
339319
340Fixed tilemaps so they can be initialized at device start time.
341[Aaron Giles]
320ui.c,ui.h,windows/input.c: [Miodrag Milanovic]
321 * removed ui_use_new_ui check used by MESS code
322 * moved ui_mess_handler_ingame call in proper place, so device UI
323   callbacks works again
324 * removed toggle of menu bar (MESS related)
342325
343Added redumped roms to coolridr. [David Haywood]
326info.c: Moved print_game_categories into info.c, since it can be used
327by any driver anyway. [Miodrag Milanovic]
344328
345Fixed crash on exit for systems with no tilemaps. [Aaron Giles]
329Fresh driver notes added for unclepoo based analysis of the Z80 code.
330[Stephh]
346331
347Added warning messages for auto_malloc, timer, and save state
348allocations done after init time. These should be fixed when detected,
349and will soon be disallowed entirely. Fixed many cases in the code
350where this was being done. [Aaron Giles]
332k051649.c: fixed bogus for loop in device reset [Fabio Priuli]
351333
352Converted Taito F3 sound to a separate machine driver which is
353imported into games that use it. [Aaron Giles]
334z80ctc: Fixed Z80CTC read handler [Tim Schuerewegen]
354335
355Converted the balsente driver to driver_data structure. [Aaron Giles]
336Complete rewrite of the Z80-PIO implementation. The handshaking
337signals are now more accurately emulated. As a result, the Merit
338Megatouch games are no longer working since they relied on the earlier
339incorrect behavior. [Curt Coder]
356340
357Some more Atari driver shuffling. Added atarigen_init() function
358which allocates all timers and registers for save states. Updated
359all drivers to call it. Converted some drivers to use device timers.
360[Aaron Giles]
341attckufo: Imported MOS6560 device emulation from MESS and removed the
342existent custom audio/video emulation [Fabio Priuli]
361343
362Changed ticket.c into a device, updated all users. [Aaron Giles]
344Corrected visible area and timer speeds to make the fix up some
345audio/video problems. [Angelo Salese]
363346
364CIA6526: fixed FLAG handling and slight interface cleanup.
347Preliminary merging of hexa.c into the arkanoid.c driver. [Tafoid]
348
349meritm.c: Added scanline timer-based vblank interrupt to work around
350the broken V9938 interrupts. Megatouch games are now working again.
365351[Curt Coder]
366352
367Moved SNES timer allocation to MACHINE_START. [Fabio Priuli]
353zaxxon.c: Fixed Ixion (prototype) inputs [MASH]
368354
369Koi Koi Part 2: written an hardcoded table (disabled by default),
370concluded that a color prom is currently undumped. Also documented a
371bunch of unused ports [Angelo Salese]
355i386: Small fix for the i386 core, correcting the LLDT instruction.
356This fix sets up the LDTR base and limit values correctly, fixing use
357of the LDT. [Barry Rodewald]
372358
373Carrera: fixed colors [Angelo Salese]
359Implemented proper irq ack to the deniam.c driver [Angelo Salese]
374360
375Sky Army: cleaned up the driver, also removed the GAME_WRONG_COLORS
376flag since the colors actually seems correct according to the
377references. [Angelo Salese]
361Implemented irq ack to Big 10 [Angelo Salese]
378362
379Trivia Madness: Improved graphics & colors [Angelo Salese]
363Implemented irq ack to Aeroboto / Formation Z [Angelo Salese]
380364
381Super Rider: improved bitplane order and colors [Angelo Salese]
365segas32.c: Fixed Stadium Cross inputs [MASH]
382366
383Preliminary RSP recompiler, with all vector ops stubbed out to C
384functions for now. [Harmony]
367hexa: merged the remaining code into arkanoid.c [Fabio Priuli]
385368
386sbowling.c - Added proper COINAGE selections as well DIP LOCATIONS to
387the driver. Added mapping for button 1 which is used to allow change
388from curve to straight throw. Replaced clock speeds with XTAL values.
389[Tafoid]
369skyfox.c: added driver data struct and save states [Fabio Priuli]
390370
391Re-implemented 3d rasterization in the hng64 driver as a FIFO system.
392[Andrew Gardner]
371Hooked up bare bones z180 communication CPU in Cadash [Angelo Salese]
393372
394ggconnie.c - Added DIP LOCATIONS to match those showing in service
395mode.  Added game year to source from title screen. [Tafoid]
373Make mips register names accessible in the debugger expressions
374[Olivier Galibert]
396375
397Added preliminary decryption to Victor 5, Victor 21 and Cross Bingo
398[David Haywood]
376Some improvements to Lucky Girl (New HW) [Angelo Salese]
399377
400Decoded Cross Bingo proms [Angelo Salese]
378Fixed a bug in debugint.c: Actually make Del and BS delete the last
379character. [sz72]
401380
402hexa.c - Added DIP LOCATIONS as well as assigned XTAL for the clock
403speeds, using those from Arkanoid, since the boards are nearly
404identical in many aspects. [Tafoid]
381Added driver_data struct and save states to the following drivers:
382lkage.c, lockon.c & lsasquad.c. [Fabio Priuli]
405383
406RSP recompiler improvements / optimizations: [Harmony]
407 - Split SATURATE_ACCUM into a signed and unsigned version to reduce
408    stack usage.
409 - Corrected an issue with the 0h variants of VMRG, VAND, VNAND, VOR,
410    VNOR, VXOR and VNXOR.
411 - Slightly optimized unaligned reads and writes
412 - Optimized unaligned dword reads
413 - Corrected an issue where badly-written RSP programs could jump to
414    invalid addresses
384Added save states to liberate.c. [Fabio Priuli]
415385
416Added new profiler bucket for DRC recompilation. [Aaron Giles]
386Moved ins8154 emulation from MESS to MAME, needed by future drivers.
387[Dirk Best]
417388
418luckgrln: Implemented CRT Controller hook-up [Angelo Salese]
389H8: fix stack trashing when simultaneous IRQ sources asserted
390[R. Belmont]
419391
420gomoku.c, sspeedr.c - Added DIPS and changed clock values to XTAL
421[Tafoid]
392namcos23 update: [R. Belmont, Olivier Galibert]
393 * motoxgo and timecrs2 are now able to sync up and communicate with
394   the emulated JVS I/O board
395 * Fixed all games to run VBL toggle
396 * Documented data and point ROM checks for future use
422397
423nitedrvr.c, tourtabl.c - Changed clock values to XTAL [Tafoid]
398es5506.c: added save state to both ES5505 and ES5506 [Fabio Priuli]
424399
425Added new option "numprocessors" (see windows.txt for an explanation).
426[couriersud]
400added driver_data struct and save states to the following drivers:
401attckufo.c, m79amb.c, macrossp.c, marinedt.c, markham.c, mayumi.c and
402mcatadv.c. [Fabio Priuli]
427403
428Optimized N64 RDP renderer by using function pointers to function
429variants that eliminate costly branches. [Harmony]
404Added driver_data struct and save states to the following drivers:
405madmotor.c, mazerbla.c, mikie.c, mjsister.c, mogura.c, mole.c and
406momoko.c. [Fabio Priuli]
430407
431Minor drc improvments: [Aaron Giles]
432 - simplified RSP's misaligned memory accesses
433 - removed now-unnecessary shifts from direct memory accesses in
434    mips3/powerpc drcs
435 - optimized AND with 0xff/0xffff/0xffffffff cases for x86/x64
436 - added rudimentary memory/register tracking in x86 backend to
437    remove redundant loads
408namcos23: Panic Park uses the motoxgo I/O board, now it syncs too
409[R. Belmont]
438410
439cb2001 improvements: [robiza]
440 - added ay8910 and 8255ppi devices
441 - added some info about relation between cmast91 and cb2001
442 - added many opcodes
411namcos23 update: improved "Gorgon" h/w support [R. Belmont]
443412
444Fixed sprite-tilemap priorities in Super Slams [Angelo Salese]
413Added driver_data struct and save states to the following drivers:
414megazone.c, meijinsn.c and mermaid.c. [Fabio Priuli]
445415
446Worked around protection in sranger, srangerw and srangerb
447[Angelo Salese]
416namcos23: improved documentation, fixed a few POST fails [R. Belmont]
448417
449Converted 7474, 74148, and 74153 TTL implementations to devices.
450[Aaron Giles]
418exerion, exeriont, exerionb (exerion.c driver) : [stephh]
419 * Fixed Dip Switches and Inputs (after verification of the Z80 code)
451420
452More rom name corrections for the merit.c driver [Brian Troha]
421namcos23 updates: [R. Belmont]
422 * Documented clocks and syncs measured by Guru
423 * Added Gorgon JVS I/O board.  Final Furlong now gets farther
453424
454Added Guru's board notes to the Outrun/Super Hang-on Driver.
455[Guru]
425H8: add bild and bist opcodes [R. Belmont]
456426
457Converted the ds2404 to a device. [Aaron Giles]
427namcos23: added nvram for Gorgon. finlflng gets farther. [R. Belmont]
458428
459Removed deprecated core function decodegfx() [Christophe Jaillet]
429ins8154: Updated to use devcb calls, cleaned up. [Dirk Best]
460430
461Removed the global "includes" include and instead specify the
462"includes" path in all #include occurences. [Oliver Stoneberg]
431Namco Super System 23: Add a whole bunch of ram, chips and data roms
432mappings [O. Galibert, R. Belmont]
463433
464Eliminated the use of generic.colorram and generic.videoram in
465several drivers [Atari Ace]
434Changed Tecmo World Cup 90 main z80 cpus to 8mhz and vsync to 59.17hz
435/ Hard Head sound z80 to 3mhz and vsync to 59.10hz to match original
436PCB readings. [Corrado Tomaselli]
466437
467Fixed Brick Zone parent set bitplane graphics [Angelo Salese]
438Fixed inverted buttons 1 and 2 on f1gp, f1gp2 and Super Formula.  They
439are Jamma standards boards: brake button is wired to pin 22 and
440acceleration button to pin 23 which are respectively button 1 and 2 in
441a jamma standard pinout. [Corrado Tomaselli]
468442
469Fix megadrive emulation to use the SMSIII version of the sn76489
470sound chip. [Lord Nightmare, DFJustin]
443Added driver_data struct and save states to the following drivers:
444matmania.c, metlclsh.c, mexico86.c, mouser.c, mrflea.c, mrjong.c,
445munchmo.c and mwarr.c. [Fabio Priuli]
471446
472Added save states to ics2115 sound device. [Fabio Priuli]
447Added driver_data struct to the following drivers: mgolf.c,
448minivadr.c, mosaic.c and mrdo.c. [Fabio Priuli]
473449
474Changed EEPROM usage in many drivers to use the new device version.
475[Aaron Giles, Fabio Priuli]
450Enabled save states to mugsmash.c (everything was already saved)
451[Fabio Priuli]
476452
477Removed auto-init hack from some Konami games. Hold down F2 and reset
478(via F3) to initialize the EEPROM, like all the other Konami games.
453hng64: Added sub-page texture indexing.  Fixes many texture lookups in
454roadedge and xrally.  [Andrew Gardner]
455
456Added driver_data struct and save states to the following drivers:
457news.c, nightgal.c and nycaptor.c. [Fabio Priuli]
458
459Added driver_data struct to the following drivers: nitedrvr.c and
460nmg5.c. [Fabio Priuli]
461
462enabled save flag in othunder.c (everything is properly saved, but it
463seems I forgot about this driver when I device-fied Taito video chips)
479464[Fabio Priuli]
480465
481Cleaned up EEPROM device implementation a bit. [Aaron Giles]
466pic8259: replaced pic8259_set_irq_line with pic8259_irX_w write line
467handlers. [Dirk Best]
482468
483Added flickering effect in Super Slams title screen
484[Angelo Salese, Guru]
469pic8259: updated to use devcb calls. [Dirk Best]
485470
486Fixed sprite bank bit in Spark Man [Angelo Salese]
471Improved gfxs in Lucky Girl (New version) [David Haywood]
487472
488Converted gaelco3d.c to use eeprom device code. [Fabio Priuli]
473Implemented device version of the deco16ic tilemap chip [Fabio Priuli]
489474
490Spark Man: Refactored the protection, implemented thrash protection
491that's used after the title screen. [Angelo Salese]
475Converted backfire.c, boogwing.c, dietgo.c, mirage.c, pktgaldx.c,
476simpl156.c, supbtime.c, tumblep.c to use the device-fied video chips
477[Fabio Priuli]
492478
493EEPROM device now looks for a matching memory region to fetch the
494default values from. Fixed bug in ROM loader that would change the
495memory region flags to match devices with no address bus. Updated
496groundfx to use the new default loading scheme. [Aaron Giles]
479Added driver data struct and save states to the following drivers:
480dietgo.c, mirage.c, pktgaldx.c, supbtime.c and tumblep.c
481[Fabio Priuli]
497482
498Reworked the hng64 polygon chunk recovery code to be more crash-proof.
499Documented what's known about the 3d data much better. Fixed vertex
500ROM loading for fatfurwa and buriki. [Andrew Gardner]
483hng64 : More accurately emulated intrinsic camera matrix. 
484[Andrew Gardner]
501485
502Converted rtc65271 to a device. [Aaron Giles]
486Changed all driver_data structs into classes with a simple constructor
487and a static allocation function. [Aaron Giles]
503488
504Added "new" command -listdevices (or -ld) to list the devices attached
505to a driver. I notice that MESS has a command with the same name;
506hopefully the behaviors can be combined eventually. [Aaron Giles]
489Changed MDRV_DRIVER_DATA to reference driver_data::alloc instead of
490just providing a size. This function is called to allocate the driver
491data. This allows objects to be embedded in the state data and be
492properly initialized. [Aaron Giles]
507493
508Got rid of explicit resource tracking for state saving. Now we just
509use the auto_ allocators, since registration is restricted to
510initialization. [Aaron Giles]
494Moved driver data allocation after device list construction so that
495devices can be found when the driver data is constructed. [Aaron Giles]
511496
512Moved machine->gfx initialization out of the video module and into
513drawgfx. We now call this before devices are initialized, so that
514devices can dynamically append to the machine->gfx as needed.
515[Aaron Giles]
497wardner, wardnerj, pyros (wardner.c driver) : [stephh]
498 * Fixed Dip Switches and Inputs (after verification of the Z80 code)
516499
517i386 improvements: [Barry Rodewald]
518 * minimal implementation of the LSL protected mode instruction
519 * fixed the REP instruction when used with a segment prefix.
500Converted cbuster.c, cninja.c, dassault.c, funkyjet.c, rohga.c and
501vaportra.c to use device versions of the deco16 video chips
502[Fabio Priuli]
520503
521Updated readme for Race Drivin' Compact. [Guru]
504Made deco32.c independent of deco16ic.c (it only needed a drawing
505routine) and removed deco16ic.c now that it is not needed anymore
506[Fabio Priuli]
522507
523Fixed a couple of edge case parsing bugs in srcclean.c. [Atari Ace]
508avgdvg: Fixed mametesters bug 03634. Reduced flickering in
509Tempest/Quantum. [Mathis Rosenhauer]
524510
525Fixed some unbalanced quotes/braces lurking in the source (mostly in
526disabled code). [Atari Ace]
511pit8253: Updated to use devcb calls, cleanups. [Dirk Bst]
527512
528Added a new CPU core for the PIC 16c62x series of processors.
529[Samuele Zannoli]
513Renamed decodev->deco16ic [Fabio Priuli]
530514
515Added driver data class to funkyjet.c [Fabio Priuli]
531516
517Added driver data class and save states to vaportra.c and tumbleb.c
518[Fabio Priuli]
532519
520Added driver_data class and save states to the following drivers:
521backfire.c, boogwing.c, cbuster.c, cninja.c, dassault.c, dblewing.c,
522deco156.c, rohga.c, simpl156.c [Fabio Priuli]
523
524twincobr, twincobru, ktiger, gulfwar2 (twincobr.c driver) : [stephh]
525 * Fixed Dip Switches and Inputs (after verification of the M68000 and
526   Z80 code)
527
528fshark, skyshark, hishouza, fsharkbt (twincobr.c driver) : [stephh]
529 * Fixed Dip Switches and Inputs (after verification of the M68000
530   code)
531
532Corrected default assignment of F10 as the default throttle on/off key
533for MAME.  The #ifdef MESS is needed here due to it's unique old/new
534UI setup.  [Miodrag Milanovic]
535
536Naomi updates: [R. Belmont, David Haywood, Andreas Naive, Deunan
537Knute, Guru, ANY]
538 * Fix ROM mirroring in gram2000 and friends
539 * Preliminary hookup of live decryption.  Decryption + decompression
540   is not yet supported so some games still load trojaned data
541   instead.
542
543naomi: Fixed decrypt method 2, added many more game keys
544[Deunan Knute, R. Belmont]
545
546namcos23.c: Add comments about the irq testing code [O. Galibert]
547
548Tidied up includes in a number of files in src/osd/sdl. [couriersud]
549
550Hook up vblank and just enough controls to pass error screens
551[O. Galibert]
552
553namcos23: get Gorgon games out of service mode, fix finlflng sound ROM
554loading [R. Belmont]
555
556namcos23: comment the probable dips a tad better [O. Galibert]
557
558Added driver_data class and save states to the following drivers:
559ohmygod.c, ojankohs.c and olibochu.c. [Fabio Priuli]
560
561Added driver_data class and save states to the following drivers:
562oneshot.c, onetwo.c, orbit.c, othello.c and othldrby.c.
563[Fabio Priuli]
564
565Added driver_data class to the following drivers: nemesis.c and nyny.c
566[Fabio Priuli]
567
568Improvements to Funworld driver. [Roberto Fresca]
569 * Fixed Jolly Joker graphics and colors.
570 * Changed Jolly Joker description to Jolly Joker (98bet).
571 * Added a new croatian set of Jolly Joker with maximum bet = 40.
572 * Moved the hardware description and tech notes to the ROM_LOAD
573   section.
574 * Added a external default NVRAM for Jolly Card Professional 2.0.
575 * Updated technical notes.
576
577Implemented proper BIOS/Cart ROM bankswitch in the MACS driver, this
578improves program logic in Kisekae Mahjong [Angelo Salese]
579
580Removed the coin latch kludge in the MACS driver [Angelo Salese]
581
582snes.c: minor refactorization [Fabio Priuli]
583
584namcos23: fix the data rom mappings [O. Galibert]
585
586rallybik, truxton (toaplan1.c driver)  [stephh]:
587 * Fixed Dip Switches and Inputs (after verification of the M68000 and
588   Z80 code)
589
590snes.c: temporarily reverted implementation of mult/div through timers
591since it breaks some SNES games on the MESS side [Fabio Priuli]
592
593namcos23: timecrs2c reaches the test mode [O. Galibert]
594
595Fixed MT3698 (NOWERROR=1 casues -fno-strict-aliasing  to be dropped).
596[couriersud]
597
598Fixed save state support in custom namco devices (50,51,53) and
599galaga.c. Also resolves MT03268: All sets in galaga.c: Problem with
600Savestates. [couriersud]
601
602naomi: convert GD-ROM games to use real PIC dumps [David Haywood]
603
604Add MAME-ified version of SoftFloat library [John R. Hauser]
605
606Merged kingdrby.c and cowrace.c drivers [Angelo Salese]
607
608namcos23: working inputs for TC2 test mode [R. Belmont]
609
610namcos23: Document gun I/O boards [Guru]
611
612hng64 : An initial implementation of hardware lighting. 
613[Andrew Gardner]
614
615zerowing, zerowing2 (toaplan1.c driver) [stephh] :
616 * Fixed Dip Switches and Inputs (after verification of the M68000 and
617   Z80 code)
618
619namcos23: fix Time Crisis 2 coin input [R. Belmont]
620
621
622
533623New games added or promoted from NOT_WORKING status
534624---------------------------------------------------
535Shark Party (Italy, v1.3) [David Haywood, Angelo Salese]
536Victor 5 [David Haywood, Angelo Salese]
537Victor 21 [David Haywood, Angelo Salese]
538Poker Carnival [David Haywood, Angelo Salese]
625Mortal Kombat 3 (bootleg of Megadrive version)
626  [Mariusz Wojcieszek, Patrick McCarron, Smitdogg, The Dumping Union]
627Bug Fever (5 sets) [Brian Troha, Dumping Union]
628Uncle Poo
629  [Team Europe, Dumping Union, Rene Single, David Haywood, Angelo Salese]
630Champion Number [f205v, David Haywood, Angelo Salese]
539631
540632
541
542633New clones added
543634----------------
544Hyper Street Fighter 2: The Anniversary Edition (USA 040202)
545   [Artemio Urbina, David Haywood]
546ST-V BIOS 1.11 [2 sets - Japan and Taiwan] [XingXing]
547Blood Bros. (set 3) [Dlfrsilver]
548Caveman Ninja (bootleg) [Dlfrsilver] (NOT WORKING)
549Pipi & Bibis / Whoopee!! (Z80 sound cpu, set 2) [Dlfrsilver]
550Mortal Kombat 4 v1.0 (not working)
551   [xrodney, HobbyRoms, Patrick McCarron]
635Pit Fighter (rev 9) [B. Sparks, Smitdogg, The Dumping Union]
636Time Crisis 2 (TSS4 Ver.A, Super System 23) [Guru]
637Pushman (Top Tronic license)
638  [MrGoodwraith, Ren?\195?\169 Single, Smitdogg, The Dumping Union]
639Blades of Steel (Version L)
640  [R. Mucciarelli, Phil Bennett, Smitdogg, The Dumping Union]
641Touchmaster 4000 (v6.03 Standard)
642  [jeremymtc, Brian Troha, Smitdogg, The Dumping Union]
643Alien Invasion [Andrew Welburn, Brian Troha, The Dumping Union]
644Soul Calibur (SOC14/VER.B) [Guru]
645Jolly Joker (40bet, croatian hack) [Roberto Fresca, Team Europe]
646Touchmaster (v2.2-01 Standard)
647  [S. Austin, Smitdogg, The Dumping Union]
648Smash [Trevor Brown]
649X-Men: Children of the Atom (Japan 950105) [Razoola]
650Maya (set 1)
651  [Team Europe, Dumping Union, Rene Single, David Haywood]
652King Derby (Taiwan bootleg) [Team Europe, Dumping Union] (not working)
653Cherry Master (Watermelon bootleg / hack) [William Ostronic]
654Cherry Master (Fun USA v2.5 bootleg / hack) [William Ostronic]
655Aracnis (bootleg of Scorpion on Moon Cresta hardware) [f205v]
656The Pit (bootleg on Moon Quasar hardware)
657  [Andrew Welburn, David Haywood]
658Safari (set 2, bootleg?) [f205v]
659Moon Cresta (Nichibutsu UK) [Andrew Welburn]
660Armed Police Batrider (Taiwan Revision A) [Anonymous]
552661
553662
554
555663New games marked as GAME_NOT_WORKING
556664------------------------------------
557Happy 6-in-1 [XX]
665L.A. Machineguns [ANY]
666The Ocean Hunter [ANY]
667Royal Gum [Siftware]
558668
559669
560670
5610.135u3
6710.136u3
562672-------
563673
564674
565675MAMETesters Bugs Fixed
566676----------------------
567- 03565: [Color/Palette] astrof, astrof2, astrof3: blue background is
568         supposed to be black (David Haywood)
569- 03557: [Sound] All sets in namcos12.c: Music is slower than
570         original (Phil Bennett)
571- 03561: [Crash/Freeze] robokid, robokidj, robokidj2: Segmentation
572         Fault after OK (Fabio Priuli)
573- 03562: [Crash/Freeze] fcombat: Segmentation Fault after OK
574         (Fabio Priuli)
575- 03560: [Crash/Freeze] missb2, saiyugoub1, saiyugoub2: Driver Data
576         Struct Issues (Fabio Priuli)
577- 03559: [Crash/Freeze] All sets in viper.c, subsino.c and coolridr.c:
578         Segmentation Fault before OK (Fabio Priuli)
677- 03724: [Speed] mrdo: Incorrect XTALs cause for problems with
678         refresh rate and game speed. (Tafoid)
679- 03706: [Sound] lastday, gulfstrm: Audio Regression (M.A.S.H.)
680- 03704: [Sound] evilston: Missing sound (M.A.S.H.)
681- 00993: [Crash/Freeze] sharrier: [debug] Crashes when a specific
682         sample is being played during gameplay. (Phil Bennett)
683- 03692: [Crash/Freeze] kurikint: Service Switch error (M.A.S.H.)
579684
580685
581686
582687Source Changes
583688--------------
584Kusayakyu improvements [Angelo Salese]
585 - fixed color prom hook-up, tilemap color offsets and tilemap
586    flipping
587 - fixed sound and tweaked the frequencies in the driver
689Fixed Dip Switches and Inputs (after verification of the Z80 code)
690for 'scramblb', 'scramb2', 'bagmanmc', 'dkongjrm', 'rockclim' (also
691updated memory map for this last game). [stephh]
588692
589Tron: Hooked up cocktail (P2) fire button so that it can be used
590in-game and in test mode. [Tafoid]
693am29k: fix PPC GCC compile error [R. Belmont]
591694
592Added driver data struct and save states to: [Fabio Priuli]
593 - gberet.c, ddrible.c, gaelco.c, trackfld.c, hyperspt.c, yiear.c
594 - hnayayoi.c, hanaawas.c, higemaru.c, himesiki.c and sonson.c
595 - galspnbl.c, gcpinbal.c, ginganin.c, go2000.c, goal92.c, goindol.c,
596    good.c, gotcha.c, gotya.c, gstream.c, gumbo.c, gundealr.c,
597    hitme.c, holeland.c & homerun.c
598 - glass.c & homedata.c
599 - fromance.c, fromanc2.c, ikki.c, imolagp.c, inufuku.c
600 - jack.c
601 - jangou.c, jantotsu.c, jollyjgr.c and jongkyo.c
602 - kangaroo.c, karnov.c, kchamp.c, kickgoal.c, kingobox.c,
603    kncljoe.c, koikoi.c, kopunch.c, ksayakyu.c and kyugo.c
604 - ladybug.c, ladyfrog.c, lastduel.c, lwings.c, redclash.c and
605    yunsung8.c
606 - laserbas.c, laserbat.c, lastfght.c, lazercmd.c and lemmings.c
695Added Sega ID# for newly added version of INDY 500 and correct the
696spelling of attract. [Brian Troha]
607697
608Added driver data struct to: [Fabio Priuli]
609 - galivan.c, jailbrek.c, sbasketb.c
610 - alpha68k.c, amspdwy.c, gng.c, gunsmoke.c, hotblock.c
611 - aerofgt.c and gyruss.c
612 - hyprduel.c
613 - pipedrm.c
614 - ironhors.c
615 - jackal.c
616 - lasso.c
698minor information update for Viper 1 games in seibuspi.c.
699[Brian Troha]
617700
618Changed CDP1869 PAL/NTSC signal to use devcb. [Curt Coder]
701Fixed disassembly of PDP1,TX0 and APEXC [Robbbert]
619702
620Converted cabal, mappy, toypop and zaxxon to use driver_data
621structure [Atari Ace]
703Fix immediate crash on startup of GTK debugger. [R. Belmont]
622704
623Fixed CP1610 disassembler. [Robbbert]
705namcos11: use real C76 BIOS for audio and I/O
706[R. Belmont, Olivier Galibert, Guru]
624707
625Cool Riders improvements: [Angelo Salese, David Haywood]
626 - fixed regression
627 - hooked up what it looks like a ROM->to->VRAM transfer...
628 - slightly improved booting
629 - some hooks to allow FBI logo drawing
630 - basic DMA hooked up
631 - fixed program ROM memory map loading as per the service mode item
632 - allow it to draw RAM-based chars, starts to show correct gfxs
633 - fixed paletteram and implemented basic inputs
634 - implemented DMA vram transfers
635 - added Guru readme
636 - hooked up videoram reading in drawing functions
637 - some hook-ups for the text blitter
708Cleaned up comments refering to old driver names, and updated clone
709names in drivers from 0-K. [Tafoid]
638710
639Wink: Fixed colors [Angelo Salese]
711[APEXC] 1. Added pseudo PC register for the debugger, it will now
712highlight the next instruction to be executed. 2. Added "normal"
713addresses to disassembler output, so anyone can see the program flow.
714[Robbbert]
640715
641Mostly resolved mix of intel and motorola notation in tms32025
642disassembler [Lord Nightmare]
716Sega misc wip: [Fabio Priuli]
717 - split dependences of system16 games from bootleg ones
718 - moved some .h files to includes/
719 - removed some unneeded include
720 - removed some dead code
721 - added driver data struct to segahang.c, segaorun.c, segas16a.c,
722    sega16b.c, segas18.c, segaxbd.c & segaybd.c
723 - added save states to segas16a.c
643724
644Cosmic: fixed cosmica2 romset rom split and names to match romset as
645described in mameinfo, which it matches (except for one rom which
646mameinfo is probably wrong about). The romset uses a different rom
647daughterboard to the other cosmica romsets, and different sized roms.
648[Lord Nightmare]
725Fixed Dip Switches and Inputs (after verification of the Z80 code) for
726'ozon1', 'ladybugg', 'vpool'. [stephh]
649727
650Added shared driver data struct to 40love.c, bking.c, buggychl.c and
651msisaac.c (they use the same mcu emulation) [Fabio Priuli]
728Added driver data struct to system 16/18 bootlegs and removed most
729unused code. [Fabio Priuli]
652730
653Added preliminary HNG64 additive tilemap blending [David Haywood]
731Implemented reels in Treasure Island (Subsino), same as goldstar.c
732[David Haywood]
654733
655Fixed srcclean handling of embedded comments within strings
656[Atari Ace]
734Converted Sega 315-5248, 315-5249 and 315-5250 custom ICs to be
735devices and updated drivers accordingly. [Fabio Priuli]
657736
658PCB documentation updates: [Kevin Eshbach]
659 * Added the board xtal's for Battlantis, Contra and Pandora's Palace
660 * Corrected the MCU dump for Pandora's Palace
661 * Added indication of an undumped PAL for Contra/Gryzor
662 * Added PAL dumps for Cruis'n USA - rev L4.1
663 * Added information on the PROM from the 2 Board version of Congo
664    Bongo
737[PDP1] Display the PC in hex as well as octal. [Robbbert]
665738
666Noraut Poker driver improvements: [Roberto Fresca]
667 * Added new technical notes.
668 * Added Kimble Z80 hardware support.
669 * Added Prologic-Noraut hardware support.
670 * Added proper discrete sound support to Kimble games,
671   and Prologic-Noraut Joker Poker.
672 * Slightly adjusted the visual area.
673   This can be wrong and must be rechecked.
674 * Relocated the hardware notes and layouts to ROM_LOAD section,
675   so can be seen/maintained in a cleaner way.
676 * Fixed the default lamps state.
739Converted hornet.c to use the Konami 037122 device and removed the
740old code. [Fabio Priuli]
677741
678Cleaned-up several drivers; added missing prototypes and removed dead
679ones, marked non-exported functions as static and removed cases of
680#include "deprecat.h" [Atari Ace]
742Converted gticlub.c, nwk-tr.c and zr107.c to use the Konami 001604
743device and removed the old code. [Fabio Priuli]
681744
682Aleck 64: Implemented player 2 inputs [Angelo Salese]
745carjmbre.c - Added XTAL, corrected second z80 speed and added DIP
746LOCATIONS for driver. [Tafoid]
683747
684Added a PCB layout for M.Kramer's Black Jack Poker, based on a hi-res
685pic. Also added undumped devices as NO_DUMP. [Roberto Fresca]
748Improvements to Treasure Island: [Roberto Fresca]
749 - Added proper inputs.
750 - Added coin/keyin/keyout/payout counters.
751 - Limited the bet and coin pulses to avoid repeats and coin jams.
752 - Added complete coinage and keyin DIP switches.
753 - Added main game and double-up rates DIP switches.
754 - Added minimum bet DIP switches.
755 - Added maximum bet DIP switches.
756 - Added main game and double-up limit DIP switches.
757 - Added payout mode and auto take DIP switches.
758 - Added DIP locations as seen in the settings mode.
759 - Added demo sounds DIP switch.
760 - Created proper button-lamps layout.
761 - Added technical notes.
762 - Some clean-ups...
686763
687Added common driver data struct to timeplt.c, tutankhm.c, junofrst.c,
688pooyan.c, rallyx.c and rocnrope.c (these drivers all use
689audio/timeplt.c). As a side effect, we now have save states in
690junofrst.c and rallyx.c. [Fabio Priuli]
764Dumped IC1 from Giant Gram 2000 [Joerg Hartenberger]
691765
692Converted atari drivers over to using driver_data for the most
693part. Some shared systems still exist with globals, but this
694tackles the atarigen module and the variables local to each
695driver. [Aaron Giles]
766Fixed bonus game gfxs in Treasure Island (Subsino) [Angelo Salese]
696767
697Added validity check that AM_BASE_MEMBER and AM_SIZE_MEMBER items
698point within the bounds of the driver_data structure. [Aaron Giles]
768Fix os2 auto-detect [KO Myung-Hun]
699769
700Fixed DMADAC wrapping behavior. [Tim Schuerewegen]
770Preliminary Panasonic MN10200 CPU core and Taito ZOOM ZSG-1 sound
771system [Olivier Galibert]
701772
702Added Driver Configuration to astrof.c to emulate common wire hack
703which causes black background [David Haywood]
773Document FPGA-provided "ic1" data in gram2000 [Joerg Hartenberger]
704774
705Aleck 64: Worked around hard-locks at start-up. [Angelo Salese]
775Implemented flip screen in Hanaroku [Angelo Salese]
706776
707Identified Semicom's Dream World hardware as a copy of Psikyo's
70868020 hardware (it was already known that their older platforms were
709copied from Snow Bros, and Tumble Pop) [David Haywood]
777Fixed video emulation in Best League (World Cup version)
778[Angelo Salese]
710779
711i386 core improvements: [Barry Rodewald]
712 * Fixed EIP displacement when executing FPU instructions with no
713    80387 present
714 * Added 32-bit implementations of SLDT and STR
780Fix DISTRO=gcc44-generic make shortcut to use gcc-4.4 properly
781(-V 4.4 does not work for linking) [couriersud]
715782
716Converted Kaneko Pandora sprite chip to be a MAME device and updated
717drivers accordingly. [Fabio Priuli]
783Minor changes for internal render debugger [couriersud]
784 - ui_input_frame_update is now global
785 - moved element_component from rendlay.c to rendlay.h
786 - added ability to rendlay.c to define "container" components. These
787    simply provide a render_container.
718788
719Added tilemap_create_device() function which lets you create a tilemap
720from within a device, and be passed that device in your callback.
721[Aaron Giles]
789Added DEBUG_FLAG_OSD_ENABLED to allow coexistence of debuggers going
790forward. Replaced all occurrences of OPTION_DEBUG in src/osd/* by
791checking machine->debug_flags. Replaced all occurrences of
792DEBUG_FLAG_ENABLED in src/osd/* by DEBUG_FLAG_OSD_ENABLED For the
793time being, DEBUG_FLAG_OSD_ENABLED is default (set in mame.c).
794[couriersud]
722795
723Converted Signetics 2636 video chip to be a MAME device and updated
724drivers using it accordingly. [Fabio Priuli]
796Fixed Dip Switches and Inputs (after verification of the Z80 code) for
797'bongo', 'porter'. [stephh]
725798
726Memory system changes: [Aaron Giles]
727 - Memory banks are now referenced by tag rather than index.
728    Changed all memory_bank_* functions to specify a tag.
729    Bulk-converted existing banks to be tagged "bank##" in
730    order to ensure consistency. However, going forward, the
731    tags don't matter, so please name them something useful.
799Implemented Actel FPGA ID, used by some Naomi games for accessing a
800special ROM check mode [Deunan Knute, Angelo Salese]
732801
733 - Added AM_BANK_READ/AM_BANK_WRITE macros to let you specify
734    bank tags. Also changed AM_ROMBANK and AM_RAMBANK macros to
735    accept tags as well.
802Documentation update for Hotdog Storm, IE: The PCB ID number and tile
803map chip info. [Brian Troha]
736804
737 - Added new functions memory_install_read_bank_handler and
738    memory_install_write_bank_handler to install banks by tag
739    name, similar to input ports.
805Add and hook up ZOOM ZSG-2 skeleton [Olivier Galibert]
740806
741 - Changed internals of memory system to dynamically allocate
742    all banks. The first time a bank with an unknown tag is
743    installed, a new bank object is created and tracked
744    internally.
807Doesn't do much at the moment, but the increase in documentation value is
808significant (we're documenting the sample compression format, for one thing).
745809
746 - Removed SMH_* macros entirely. In their place are a series of
747    expanded macros and new memory installation helpers. Some
748    mappings below (not all are new):
810New driver for Sigma B52 system. ACRTC implementation is a bit hacky
811due to its preliminary emulation status. [Roberto Fresca]
749812
750     AM_READ(SMH_RAM)                       -> AM_READONLY
751     AM_WRITE(SMH_RAM)                      -> AM_WRITEONLY
752     AM_READWRITE(SMH_RAM, SMH_RAM)         -> AM_RAM
753     AM_READ(rhandler) AM_WRITE(SMH_RAM)    -> AM_RAM_READ(rhandler)
754     AM_READ(SMH_RAM) AM_WRITE(whandler)    -> AM_RAM_WRITE(whandler)
755     AM_DEVREAD(tag, rhandler) AM_WRITE(SMH_RAM)
756                                  -> AM_RAM_DEVREAD(tag, rhandler)
757     AM_READ(SMH_RAM) AM_DEVWRITE(tag, whandler)
758                                  -> AM_RAM_DEVWRITE(tag, whandler)
813lethal.c - Verified clocks and vsync from orginal PCB
814[Corrado Tomaselli]
759815
760     AM_READ(SMH_ROM)                       -> AM_ROM
761     AM_WRITE(SMH_ROM)                      -> (was a no-op)
816astrocorp.c update: [Luca Elia]
817 - Added frame buffer
818 - Fixed sprite list end, negative coordinates, wrap around
819 - Added battery backed RAM
762820
763     AM_READ(SMH_NOP)                       -> AM_READNOP
764     AM_WRITE(SMH_NOP)                      -> AM_WRITENOP
765     AM_READWRITE(SMH_NOP, SMH_NOP)         -> AM_NOP
821adp.c: hooked up (with a hack) gfx rom in hd63484 memory map [robiza]
766822
767   For dynamic memory handler installation of the various types,
768   use the new functions:
823Hooked up coin input and start input in skattv. [robiza]
769824
770     memory_unmap_read()
771     memory_unmap_write()
772     memory_unmap_readwrite() -- unmaps a section of address space
825astrocde.c - Fixed the Bonus Life dipswitch for gorf and clones.
826It's state was inverted. [Tafoid]
773827
774     memory_nop_read()
775     memory_nop_write()
776     memory_nop_readwrite() -- nops a section of address space
828[I8255] Clear output lines to 0 on write to mode register, and float
829input lines to 1. [Curt Coder]
777830
778 - Cleaned up the internals of the address_map_entry structure, and
779    also normalized the way the address map macros work to remove a
780    lot of redundancy.
831Simplified/combined MAME and MESS code: [Miodrag Milanovic]
832 - Moved compatibility validation into MAME core from MESS.
833 - Made GAME_NO_SOUND check done on MESS too.
834 - Removed MESS dependent checks
835 - Renamed GAME_COMPUTER_MODIFIED to GAME_UNOFFICIAL to mark
836    unofficial hardware modifications
837 - Removed GAME_COMPUTER it is distinct by IPT_KEYBOARD
838 - Added GAME_NO_SOUND_HW (to mark that there is no sound hardware)
839    and marked drivers in dotrikun.c, minivadr.c and tgtpanic.c as
840    such
841 - Removed GAME_SHARE_ROMS flag and commented old check for
842    duplicate ROM entries
843 - Moved natural keyboard support from MESS to MAME
844 - Moved OSD file functions and clipboard access functions into OSD
845    core
846 - Significantly reduced the number of new OSD functions needed by
847    MESS [with couriersud]
781848
782 - Renamed functions: memory_install_read/write_port_handler to
783    memory_install_read/write_port
849Fixed Dip Switches and Inputs (after verification of the Z80 code) for
850'tazzmang'. [stephh]
784851
785 - Memory shares are now specified by tag instead of index.
786    The AM_SHARE() macro now takes a tag parameter. All existing
787    shares have been bulk renamed to "share##". However, the name
788    does not matter, so please use descriptive tags going forward.
852snes wip: [Fabio Priuli]
853 * added a couple of registers to snes_ppu struct
854 * moved color blending (background & subscreen color
855    addition/subtraction) at the end of the drawing process.
856 * removed some unused (and not working anymore) debug code
857 * fixed the remaining debug functionalities
858 * moved colour struct to be another layer (simplifying some code)
859 * updated hires blending to work with two pixel at time.
860 * fixed clipmasks with hires modes
789861
790 - Added tag validation for bank and share tags.
862hng64 : Initial implementation of 0x10-sized palette pages for 3d
863objects. This makes most environment colors correct in sams64.
864[Andrew Gardner]
791865
792 - Added flag to tagmap_add functions that optionally will
793    replace existing objects if a duplicate is found.
866[VIA6522] Read port A/B only if some pins are inputs. [Curt Coder]
794867
795 - Internal code shuffling. Address maps initialized internally
796    now call the same installation handlers that drivers do for
797    dynamic installation. Cleaned up some parameter ordering and
798    error detection.
868Fixed Dip Switches and Inputs (after verification of the Z80 code)
869for 'dambustr' and clones. [stephh]
799870
800 - Added new functions:
871Internal debugger using the mame rendering infrastructure [couriersud]
872 - added support for arbitrary number of containers for render_target
873 - added command-line parameter -debug_internal (-di) to use the
874    internal debugger when in debug mode
875 - internal debugger supports all views except memory view
876 - added "Debug" view to layout/vertical.lay to create more place for
877    debug views in vertical games.
801878
802     memory_install_ram() to assign a un-named bank to a region and
803       specify a pointer to where the RAM lives. If this is called in
804       the DRIVER_INIT function or MACHINE/SOUND/VIDEO_START
805       functions, then it is permissible to specify NULL, in which
806       case the memory system will allocate memory and register it
807       for save states.
879 NOTE: The colors are ugly. Font rendering needs improvement. There
880 are no shortcut keys right now. There is still a lot of room for more
881 improvements. However, it works and does not depend on any ui
882 toolkit. The interface has been designed to support displaying views
883 programmatically e.g. from the ui.
808884
809     memory_install_rom() is like the above except that it only
810       installs a read handler.
885 Short HowTo:
886  - Start MAME with "-debug -di"
887  - Console, register and disasm views will be shown. Place them by
888     dragging the view on the title bar.
889  - Views can be resized by dragging the bottom-right yellow square.
890  - The view having the focus has a green background title bar.
891  - Hit "Tab" (IPT_UI_CONFIGURE) to show the menu.
892  - Console and disasm views support a very simple facility to
893     support entering commands and addresses. Just start typing.
894     Hit "enter" when finished.
811895
812     memory_install_writeonly() is like the above except that it
813     only installs a write handler.
896irobot.c - Added XTAL values from manual and hooked up to driver for
897main/sound CPU.  [Phil Bennett/Tafoid]
814898
815 - Updated several instances in the code that were assigning banks
816    to these sorts of static RAM regions and simplified the code.
899rungun: fix text tilemap lookup for big-endian targets. [R. Belmont]
817900
818 - Apply mirrors and global masks at address map detokenizing time
819    rather than later.
901Added Intel 8021/8022 CPU types. [Curt Coder]
820902
903irobot.c - Added/verified Dip Locations per manual and test mode.
904[Tafoid]
821905
906Workaround for gcc-4.3 reporting a false warning on solaris: disable
907-Werror for this file only. [couriersud]
822908
909Cleaned up SDL OSD functions after merging in code from MESS.
910[couriersud]
911
912wrally.c - Added/verified DIP Locations for World Rally [Guru]
913
914Fixed long-standing (day one?) bug with ADPCM samples in Trojan /
915Tatakai no Banka [Mamesick, Angelo Salese]
916
917Fixed Dip Switches and Inputs (after verification of the Z80 code) for
918'espial', 'espialu' and 'netwars". [stephh]
919
920Got Mortal Kombat 3 (bootleg of Megadrive version) to boot. Still
921missing some key inputs. [Mariusz Wojcieszek]
922
923
924
823925New games added or promoted from NOT_WORKING status
824926---------------------------------------------------
825Top Shooter [Mariusz Wojcieszek]
826LA Girl [Tomasz Slanina, Guru]
827Noraut Joker Poker (Prologic HW) [Roberto Fresca, Alan Griffin]
927Midnight Resistance (bootleg with 68705) [IQ_132]
928Sexy Boom [Mariusz Wojcieszek]
929Treasure Island (Subsino)
930   [Team Europe, Dumping Union, Angelo Salese, David Haywood,
931    Roberto Fresca]
932Ghost Chaser Densei (SNES bootleg) [Tomasz Slanina, XingXing]
933Skill Drop Georgia
934   [Luca Elia, Smitdogg, Brian Troha, The Dumping Union]
935Logic Pro Adventure
936   [Guru, D. Beneke, snoopy, pongplaya, W. Belk, hap, S. S. Neilson,
937    JacKc, The Dumping Union]
938Pachifever [Tomasz Slanina]
828939
829940
830941
831942New clones added
832943----------------
833Domino Block ver.2 [Guru]
834Tower of Druaga (Manufactured by Sidam) [Corrado Tomaselli]
835Invasion (4 bootleg sets) [f205v, ANY]
836Head On (Sidam bootleg, set 2) [f205v, ANY]
837Head On 2 (Sidam bootleg) [f205v, ANY]
838Arkanoid (bootleg on Block hardware, set 2) [f205v, ANY]
839Gals Panic (Korea, EXPRO-02 PCB) [Guru]
840Strikers 1945 (Hong Kong, Bootleg)
841   [David Haywood, Brian Troha, Dumping Union]
842Fighting Fantasy (bootleg with 68705) [f205v] (not working)
843Phantom (Spectar bootleg) [Team Europe & rades]
844Panzar (Spectar bootleg) [f205v]
845Fatsy Gambler (Video Hustler bootleg) [f205v]
846Fitter (bootleg) [f205v]
847Vs. Super Mario Bros. (bootleg with Z80) (2 sets) [f205v, Dante Profeta] (not working)
944INDY 500 Twin (Revision A, Newer) [Brian Troha, Dumping Union]
945Fantastic Journey (ver AAA) [Tirino73]
946Name That Tune (3-23-86) [Kevin Eshbach]
947E.D.F. : Earth Defense Force (bootleg)
948   [Team Europe, Rene Single, Dumping Union] - not working
949Out Zone (set 5) [Corrado Tomaselli]
950Ghosts'n Goblins (World? set 3) [Corrado Tomaselli]
951Bagman (bootleg on Crazy Kong hardware)
952   [Team Europe & Volker Hahn] - not working
953Magical Tonic / Magical Odds? [David Haywood] - not working
954Spiders (set 3) [Team Europe]
955Raiden (US, SEI8904 + SEI9008 PCBs)
956   [tormod, Smitdogg, The Dumping Union, David Haywood]
957Asterix (ver AAD) [Luis "Datasat"]
958Pang! 3 (Euro 950601)
959   [Gerald (COY), B. Sparks, Smitdogg, The Dumping Union]
848960
849961
850962
851963New games marked as GAME_NOT_WORKING
852964------------------------------------
853White Tiger - 3VXFC5342 (New Zealand) [Heihachi_73]
854Magic Mask (A - 09/05/2000, Export) [Heihachi_73]
855Geisha (A - 05/03/01, New Zealand) [Heihachi_73]
856Kimble Double HI-LO (z80 version) [Roberto Fresca, Alan Griffin]
857Fast Draw (poker conversion kit)? [Roberto Fresca]
858Draw Poker HI-LO (unknown, rev 1) [Roberto Fresca, Dumping Union]
859Draw Poker HI-LO (unknown, rev 2) [Roberto Fresca, Dumping Union]
860Video Stars [Andrew Welburn]
861
862
863
8640.135u2
965Mr. Kicker [krick, MrGoodwraith, Smitdogg, The Dumping Union]
966Crackin' DJ [Guru, R. Belmont]
967Joker's Wild (B52 system, set 1)
968   [Roberto Fresca, Tomasz Slanina, Gerald Vanderick]
969Joker's Wild (B52 system, set 2) [Roberto Fresca, Tomasz Slanina]
970Joker's Wild (B52 system, Harrah's GFX)
971   [Roberto Fresca, Tomasz Slanina, Gerald Vanderick]
972   
973   
974   
9750.136u2
865976-------
866977
867978
868979MAMETesters Bugs Fixed
869980----------------------
870- 03553: [Crash/Freeze] extdwnhl: Game does not start (Phil Bennett)
871- 03544: [DIP/Input] mgdh, sdmg2: The joystick function missed in
872         mgdh and sdmg2 (Luca Elia)
873- 03547: [Graphics] mgdh,sdmg2: Donden graphics in mgdh and sdmg2 are
874         inaccurate (Luca Elia)
875- 03546: [Documentation] nkishusp: Black screen after the game start.
876         (Luca Elia)
877- 03540: [Sound] glpracr3, hvnsgate, raystorm: Missing sound.
878         (Phil Bennett)
879- 03545: [Graphics] tekken3, tektagt: Tekken games do not proceed
880         into attract mode after initial screen (Phil Bennett)
881- 03542: [Sound] Sets/Drivers using YM2610: Missing sounds
882         (Phil Bennett)
981- 03667: [Interface] All default/per-game .cfg files are not saved
982         correctly (Aaron Giles)
983- 03671: [Sound] fcrash: Bad sound ingame (Mamesick)
984- 03663: [Graphics] tgm2, tgm2p: The warning boot screen has a black
985         background which should be blue.
883986
884987
885988
886989Source Changes
887990--------------
888Added driver data structs to: [Fabio Priuli]
889 - beaminv.c
890 - cball.c and capbowl.c
891 - changela.c, circus.c and circusc.c
892 - crgolf.c and clayshoo.c
893 - decocass.c
894 - docastle.c, dotrikun.c, cloud9.c and destroyr.c
895 - cheekyms.c
896 - embargo.c
897 - ddragon.c, ddragon3.c and fgoal.c
898 - bwing.c
899 - dday.c
900 - dcheese.c
901 - flyball.c
902 - freekick.c
991Replaced vsnetscr GFX ROMs with correct dumps
992[Team Japump, Dumping Union]
903993
904Added driver data and save state support to: [Fabio Priuli]
905 - blmbycar.c
906 - zerozone.c, yunsun16.c, dominob.c, dogfgt.c and bogeyman.c
907 - blockout.c and bigevglf.c
908 - chaknpop.c
909 - albazg.c
910 - chinagat.c, esd16.c, f-32.c, fcombat.c, finalizr.c
911 - fantland.c and firetrap.c
912 - btime.c and scregg.c
913 - fitfight.c, flstory.c and funkybee.c
914 - fuukifg2.c and fuukifg3.c
994Fixed memory allocation issue in debug builds. [Aaron Giles]
915995
916Added save state support to: [Fabio Priuli]
917 - 2mindril.c, ashnojoe.c, bigfghtr.c, bublbobl.c, cchance.c,
918    champbwl.c, missb2.c
919 - compgolf.c, champbas.c, copsnrob.c, cop01.c, cosmic.c, cntsteer.c,
920    dacholer.c and dec8.c
921 - armedf.c, calorie.c, canyon.c, chanbara.c, citycon.c, commando.c,
922    crospang.c & cultures.c
923 - astrocorp.c
924 - ddayjlc.c, ddealer.c, deniam.c, discoboy.c, diverboy.c, dorachan.c,
925    dragrace.c, dreamwld.c, dribling.c, drmicro.c, drtomy.c
926 - dynadice.c, dwarfd.c, dunhuang.c, enigma2.c, epos.c, drgnmst.c
927    and egghunt.c
928 - equites.c, exedexes.c, exerion.c and exprraid.c
929 - funybubl.c, galaxi.c, gaiden.c and rocnrope.c
996Added makefile autotest for BIGENDIAN. A bit hacked, though.
997[couriersud]
930998
931Removed some rogue occurrences of 'x1snd' resulting from device tag
932mass-change. [Phil Bennett]
999Redumped sound roms in Cyber Tank
1000[Antonio Gonzalez Jr., Dumping Union]
9331001
934drw80pkr.c updates: [Jim Stolis]
935 - Added Save State Support
936 - Added Preliminary Dip Switch Settings
937 - Corrected CPU Clock Value
938 - Corrected Sound (Now Works)
939 - Narrowed Down More IO R/W Areas
1002psikyosh improvements: [PsikyoFan]
1003 * Add support for per-scanline scroll/zoom and per-column effects.
1004   This is adds a significant performance penalty when enabled.
1005   Removed warning flag from s1945ii and s1945iii. s1945iii needs
1006   confirmation of correctness and x-zoom is a guess.
1007 * Virtually completed video rendering. Only flipscreen missing (and
1008    conversion to tilemaps one day). Per-line effects now respect
1009    per-line alpha, priority and bank. As a result daraku text works
1010    without any hacks.
1011 * Added various optimisations to get back all games to a playable
1012    speed.
1013 * Fixed missing soldivid effect on final boss that was broken due to
1014    above daraku hack.
1015 * Added accurate scaling effects based on measurements from hardware.
9401016
941tms7000: Fixed disassembly of PCREL addressing mode. [Wilbert Pol]
1017cybertnk improvements: [Angelo Salese]
1018 * Fixed sprite height
1019 * Implemented flip x and negative y offsets
1020 * Implemented preliminary zooming
9421021
943Added device support to the input system. Internally this replaces
944PORT_CUSTOM/PORT_CHANGED, backward compatibility is achieved with an
945internal dummy device. Added output lines (IPT_OUTPUT), which can be
946written using new input_port_write* functions or directly from a
947memory map using AM_WRITE_PORT converted adc083x to use io lines.
948[smf]
1022sdl.mak rewrite [couriersud]
1023 - TARGETOS=freebsd may now be given on make invocation
1024 - modular approach, separate sections for opengl, x11, debugger
1025 - most target specific settings parametrized.
1026 - Added GTL_INSTLL_ROOT to optionally build win32 with the mame
1027    debugger.
1028 - On targets supporting "-m64" and "-m32" use them.
1029 - On unix ppc targets, add -Dpowerpc automatically
9491030
950ADC devices updates: [smf]
951 - adc08x chips are all hooked up using input/output ports
952 - reversed racing force steering wheel input and gas pedal, which
953    is enough to get the game to boot.
954 - reversed steering wheel input on winding heat, the usa cabinets
955    are however hooked up the other way.
956 - renamed adc0831_interface to adc083x_interface.
957 - fixed adc083x gnd input
958 - removed stray call logerror from adc083x.c
959 - fixed default adc083x sars value
960 - adc083x reset only affects outputs
1031Improved stack walking on crash in Windows. Now using StackWalk64 to
1032do the stack walk, resulting in cleaner logs. Also will try to use
1033system function to look up symbol and source/line information if
1034present. [Aaron Giles]
9611035
962Added set name to -romident. [smf]
1036Improvements to subsino.c [Roberto Fresca]
1037 (general):
1038 - Lowered CPU clock to 1.5 MHz.
1039 - Reworked former inputs.
1040 - Added specific game and technical notes.
1041 - Added lamps support.
1042 - Cleaned-up a bit the driver.
9631043
964Updated ddr 3rd mix plus protection to remove display corruption.
965[smf]
1044 Victor 5:
1045 - Mapped the M6295 but commented out due to missing sample roms.
1046 - Added keyin, keyout, payout, stats and settings inputs.
1047 - Added coin/keyin/keyout counters.
1048 - Limited the bet and coin pulses to avoid repeats and coin jams.
1049 - Added complete coinage and keyin DIP switches.
1050 - Added main game and double-up rates DIP switches.
1051 - Added minimum bet DIP switches.
1052 - Added maximum bet DIP switches.
1053 - Added attract music DIP switch.
1054 - Added button-lamps layout.
9661055
967RDP Updates: Fixed TMEM size, removed separate tlut, fixed tlut
968uploads [angrylion]
1056 Victor 21:
1057 - Mapped the M6295 but commented out due to missing sample roms.
1058 - Added bet x10, keyin, keyout, stats and settings inputs.
1059 - Added coin/keyin/keyout/payout counters.
1060 - Limited the bet and coin pulses to avoid repeats and coin jams.
1061 - Added complete coinage and keyin DIP switches.
1062 - Added main game rate DIP switches.
1063 - Added minimum bet DIP switches.
1064 - Added attract music DIP switch.
1065 - Added button-lamps layout.
9691066
970hng64 updates:
971 - Added preliminary hook-up for multi-byte chain mode for sprites,
972    used by Buriki One and the two Samurai Shodown games
973    [David Haywood, Angelo Salese]
974 - Fixed back plane color, thus giving characteristic blue background
975    for POST screen [Angelo Salese]
976 - Improved Dual Port emulation, fixing the POST errors about it
977    [Angelo Salese]
978 - Implemented "simple" scroll register layout [David Haywood]
979 - Implemented "complex" scroll register layout [David Haywood]
980 - Corrected sprite end boundary, fixes credit messages in Buriki One
981    [Angelo Salese]
982 - Fixed scrolling text in Buriki One attract mode [Angelo Salese]
983 - Hooked up global bpp switch for sprites, HW doesn't seem capable
984    of doing per-sprite bpp switch, fixes coin credit text in Buriki
985    One [Angelo Salese]
986 - Implemented V-Blank register, fixes palette uploading in Samurai
987    Shodown 1 & 2 [Angelo Salese]
988 - Fixed sprite wrap-around [David Haywood]
989 - Implemented irq 11, used by the racing games for network check,
990    currently crashes due to an invalid parameter inside the 3d
991    packets [Angelo Salese]
992 - Added 16x16 / 8x8 tilemap mode select, fixes one scene in Extreme
993    Rally and transition layer in Fatal Fury WA (squares on title
994    screen) [David Haywood]
995 - Added alt layout for the roz, fixes Roads Edge graphics before the
996    title screen [David Haywood]
997 - Implemented sprite clearance capability, fixes garbage gfxs as
998    seen in Samurai Shodown 64 1 & 2 [Angelo Salese]
999 - Implemented x/y sprite global offsets, used by Samurai Shodown 64
1000    1 ranking screen [David Haywood]
1001 - Hooked-up backup ram [Angelo Salese]
1002 - Documented some sprite findings [Angelo Salese]
1003 - Re-implemented zooming in Fatal Fury WA, and added alternative
1004    zooming mode used by the other games, they have some precision
1005    bugs though [Angelo Salese]
1006 - Implemented preliminary additive blending [David Haywood]
1007 - Slight optimization to the tile dirty marking [David Haywood]
1008 - Better documentation of mosaic and floor modes [David Haywood]
1009 - Implemented sprite disable bit [David Haywood]
1010 - Implemented dynamic visible area [Angelo Salese]
1011 - Start to document 3d / framebuffer video registers, implemented a
1012    quick hook-up that fixes Buriki One 3d model colors minus one
1013    case [Angelo Salese]
1014 - Implemented screen disable when the visible area regs are equal to
1015    zero and fixed back layer [Angelo Salese]
1067 Poker Carnival (crsbingo):
1068 - Added change card, keyin, keyout, stats and settings inputs.
1069 - Added coin/keyin/keyout/payout counters.
1070 - Limited the bet and coin pulses to avoid repeats and coin jams.
1071 - Added complete coinage and keyin DIP switches.
1072 - Added double-up rate DIP switches.
1073 - Added minimum bet DIP switches.
1074 - Added maximum bet DIP switches.
1075 - Added cards graphics DIP switches.
1076 - Added double-up type DIP switches.
1077 - Added button-lamps layout.
10161078
1017Updated the albazg driver to use hanafuda standard inputs, eeprom
1018device, and memory_set_bank in place of memory_set_bankptr.
1019[Fabio Priuli]
1079 Super Rider, Super Moto:
1080 - Added stats and settings inputs.
1081 - Added coin counters.
1082 - Added main game and double-up rates DIP switches.
1083 - Added double-up and control type DIP switches.
1084 - Added coinage and demo sounds DIP switches.
1085 - Added button-lamps layout.
10201086
1021System 23 update [Naibo Zhang]
1022 - Corrected memory mapping of palette RAM and handling of palette
1023    data. Power-On Self Test now shows correct colors.
1024 - Changed Panic Park from SS23 to S23 game.
1087 Shark Party:
1088 - Added stats and settings inputs.
1089 - Added coin counters.
1090 - Added main game and double-up rates DIP switches.
1091 - Added double-up, coinage and demo sounds DIP switches.
1092 - Added button-lamps layout.
10251093
1026Galaxian3 update [Naibo Zhang]
1027 - Fleshed out skeleton driver. Each CPU board passes many self-tests
1028 - Master and slave CPU comms hooked up
1094Created new template class tagged_list which manages a simple list
1095along with a tagmap. Changed memory regions, input ports, and devices
1096to use this class. For devices, converted typenext and classnext
1097fields into methods which dynamically search for the next item.
1098Changed a number of macros to use the features of the class, removing
1099the need for a bunch of helper functions. [Aaron Giles]
10291100
1030Designated Puzzle Bang Bang (vamphalf.c) as Korean version. For this
1031set the title and language cannot be change. [Brian Troha]
1101Replaced device_find_child_by_tag() -> device->subdevice().
10321102
1033Added new module tagmap which is a simple hashed string map. Updated
1034device and input port lists to use the tagmap for tag searches. Also
1035removed the whole "quark" thing from the validity checker in favor of
1036using the tagmaps. [Aaron Giles]
1103Added Am29000 CPU core [Phil Bennett]
10371104
1038Added Intel 8008 and National Semiconductor SC/MP CPU cores.
1039[Miodrag Milanovic]
1105Removed stdlib.h from osdcomm.h. [couriersud]
1106 - Added #include stdlib.h where now necessary
1107 - Fixed Solaris build
1108 - Fixed building unidasm for OSD=sdl on win32
10401109
1041INS 8060 SC/MP II support (using clock divider 2), main model renamed
1042to INS 8050 SC/MP. [Miodrag Milanovic]
1110Tools now include stdlib.h where needed. [couriersud]
10431111
1044Updated the astrocorp.c and groundfx.c drivers to use EEPROM device.
1045[Fabio Priuli]
1112Changed core library files to use osd_malloc/osd_free where
1113appropriate. [couriersud]
10461114
1047Added support for SCSI command 0x2a (Write w/ 32-bit LBA), upped
1048input buffer size in WD33C93 controller [Harmony]
1115Added checkautodetect target to makefile. [couriersud]
10491116
1050Hooked up eepromdev.c using PORT_READ_LINE_DEVICE/
1051PORT_WRITE_LINE_DEVICE in groundfx.c. Output ports are now affected
1052by IP_ACTIVE_HIGH/IP_ACTIVE_LOW (eepromdev.c has active low cs).
1053The previous value for callbacks in inptport.c is now tracked per
1054field. This saves recalculating it for PORT_CHANGED & conditional
1055fields wouldn't always get updated correctly. Tidied up eepromdev.c
1056interface. [smf]
1117Permit zlib and expat to be linked dynamically without changing the
1118makefile by specifying "=0": make BUILD_ZLIB=0 BUILD_EXPAT=0
1119[couriersud]
10571120
1058Added sprites list stop to igs017.c. Implemented joystick mode in
1059mgdh and sdmg2 [Luca Elia]
1121Improved vsnet sprite/roz alignment [David Haywood]
10601122
1061Fixed audio output lengths in aviio.c. [CDiFan]
1123Converted the following drivers to use a driver_data structure:
1124[Atari Ace]
1125 - bigstrkb, mugsmash, pass, sbugger, sderby, shadfrce, shootout,
1126    silkroad, spbactn, sslam, stlforce, taitojc, tunhunt,
1127    welltris, wwfsstar, xyonix
1128 - 39in1, safarir, sbowling, shougi, skeetsht, skyarmy, sliver,
1129    spoker, spool99, srmp5, srmp6, ssingles, sstrangr, sub, supdrapo,
1130    superdq, supertnk, suprgolf
10621131
1063Added memory_install_write_port_handler &
1064memory_install_readwrite_port_handler to be consistent with
1065installing handlers. [smf]
1132hng64 : Implemented low-res texture decoding.  All red/green polygons
1133should now be textured. [Andrew Gardner]
10661134
1067CDP1869 changes: [Curt Coder]
1068 - converted page RAM functions to use devcb
1069 - added pull interface for predisplay
1135Correct a long-standing design flaw: device configuration state is
1136now separate from runtime device state: [Aaron Giles]
10701137
1071Switched from linear interpolation to antialiased point sampling
1072when upconverting low-frequency sound streams. This should de-muffle
1073low-frequency streams, treating them has having hard edges at sample
1074boundaries. [Aaron Giles]
1138 * There is a new class 'running_device' which represents the
1139    state of a live device. A list of these running_devices sits
1140    in machine->devicelist and is created when a running_machine
1141    is instantiated.
10751142
1076Converted the following drivers to use EEPROM device: deco156.c,
1077eolith.c, eolith16.c, limenko.c, taito_f3.c, taito_z.c, taito_b.c,
1078taitojc.c, toaplan2.c and kaneko16.c. [Fabio Priuli]
1143 * To access the configuration state, use device->baseconfig()
1144    which returns a reference to the configuration.
10791145
1080Implemented use of per tile colour lookup ROM in Portraits, colour
1081decode is still wrong [David Haywood]
1146 * The list of running_devices in machine->devicelist has a 1:1
1147    correspondance with the list of device configurations in
1148    machine->config->devicelist, and most navigation options work
1149    equally on either (scanning by class, type, etc.)
10821150
1083CF clear after binary operations on Intel 8008 CPU core.
1084[Miodrag Milanovic]
1151 * For the most part, drivers will now deal with running_device
1152    objects instead of const device_config objects. In fact, in
1153    order to do this patch, I did the following global search &
1154    replace:
10851155
1086Improvements to Noraut Poker driver: [Roberto Fresca]
1087 * A lot of work in memory maps and machine driver stuff.
1088 * Improved Inputs / DIP switches for some games.
1089 * Added lamps support / layouts to new working games.
1090 * Added preliminary support to Kimble hardware.
1091 * Added support to CGI's Credit Poker 30x games.
1092 * Added new (and fixed old) technical notes.
1093 * Renamed norautpn descripion to Noraut Deluxe Poker (bootleg).
1094 * Added a placeholder for tpoker2's undumped 68705 MCU.
1095 * Reorganized the driver, plus some clean-ups.
1096 * Renamed kimblejp to kimbldhl. Changed game description to Kimble
1097    Double Hi-Lo.
1098 * Added specific memory map & machine driver to Kimble Double Hi-Lo.
1099 * Fix the Kimble Double Hi-Lo CPU type.
1100 * Added notes about the code obfuscation and PPI's handling/offsets.
1156      const device_config -> running_device
1157      device->static_config -> device->baseconfig().static_config
1158      device->inline_config -> device->baseconfig().inline_config
11011159
1102Added Magic Card Jackpot and Magic Lotto Export to Impera Magic Card
1103driver. Also added PCB layouts, hardware description and technical
1104notes. Changed the bipolar prom dumps to serial I2C bus EEPROM.
1105[Roberto Fresca]
1160    and then fixed up the compiler errors that fell out.
11061161
1107Made DEVCB_INPUT_PORT(tag) work for write callbacks. [smf]
1162 * Removed device_get_info_* functions and replaced them with
1163    methods called get_config_*.
1164 
1165 * Added methods for get_runtime_* to access runtime state from
1166    the running_device.
1167 
1168 * DEVICE_GET_INFO callbacks are only passed a device_config *.
1169    This means they have no access to the token or runtime state
1170    at all. For most cases this is fine.
1171 
1172 * Added new DEVICE_GET_RUNTIME_INFO callback that is passed
1173    the running_device for accessing data that is live at runtime.
1174    In the future this will go away to make room for a cleaner
1175    mechanism.
1176 
1177 * Cleaned up the handoff of memory regions from the memory
1178    subsystem to the devices.
11081179
1109Fixed regression in magicard.c driver [Angelo Salese]
1180Fix bug introduced with astring changes that caused malformed tokens
1181when writing out cfg files. [Aaron Giles]
11101182
1111Introduced a generic_pointers structure within machine that is
1112designed to hold generic pointers that are commonly used. Moved
1113generic_nvram, videoram, colorram, spriteram*, paletteram* pointers
1114there. Added AM_BASE_GENERIC and AM_SIZE_GENERIC macros for
1115initializing generic pointers in memory maps. Also added
1116AM_BASE_SIZE_GENERIC to set both base and size in one step.
1117[Aaron Giles]
1183Fix bug where memory regions were not properly enumerated for the
1184debugger memory view. Also, stop creating empty regions for disk
1185regions. [Aaron Giles]
11181186
1119Moved global variables out of machine/generic and into a private data
1120structure hanging off of the running_machine. Added newly-needed
1121machine parameters to coin_counter_w, coin_lockout_w, and
1122coin_lockout_global_w. Also added machine parameter to
1123set_led_state. [Aaron Giles]
1187Added Guru(TM)-readme to trackfld. [Curt Coder]
11241188
1125Added interface functions to get the number of dispensed tickets and
1126to increment the count, to remove the need for direct access to these
1127global variables. Also added functions to get the current count on a
1128particular coin counter and to determine the lockout state.
1129[Aaron Giles]
1189Refactored the CIA 6526 interface, adding SP/CNT callbacks. Fixed
1190serial transfer. [Curt Coder]
11301191
1131Intel 8255A: clear input latch after reading it. [Curt Coder]
1192Convrted the rest of devintrf to classes and moved management
1193functions into methods of those classes. The most wide-ranging
1194change was converting device_reset() to device->reset(). Apart
1195from that it was mostly internal shuffling in the core. [Aaron Giles]
11321196
1133Actually use the speaker interface if provided. [Curt Coder]
1197Added OS/2 autodetect to makefile. [couriersud]
11341198
1135Purged remaining globals from video/generic.c and audio/generic.c.
1199Autodetection of PTR64 can be inhibited now by specifying PTR64=0.
1200On mixed 32bit/64bit targets identifying themselves as 64bit this can
1201be used to build a 32bit executable. [couriersud]
1202
1203Added OpenBSD support in makefile/sdl.mak. Fixed XBSD detection of
1204PTR64 (uses amd64). [couriersud]
1205
1206Fix bug that mistook a non-NULL token to mean that a device was
1207started. Fixes -video ddraw issue. [Aaron Giles]
1208
1209Replaced vsnes bank installs with RAM installs, since the banks were
1210never changed. [Aaron Giles]
1211
1212Exit from the unhandled exception filter cleanly now. Use
1213SetErrorMode() to disable the appearance of dialog boxes when crashes
1214occur. [Aaron Giles]
1215
1216Fixed a typo in pgm.c that was causing a memory test error and
1217corrected some comments [XingXing]
1218
1219Made direct accessors for device configuration state. Currently they
1220just call through to the get info function. Removed old macros that
1221wrapped calls. [Aaron Giles]
1222
1223Removed some aliases between CPUINFO_ and DEVINFO_ to help clarify
1224usage. Also converted a few more places to use the new accessors.
11361225[Aaron Giles]
11371226
1138Fixed i386 REP prefix to use segment:SI when address size is 16-bit
1139(ie: when using OUTSB or OUTSW). [Barry Rodewald]
1227Replaced drgninja set with one dumped from a genuine Data East PCB
1228[dlfrsilver]
11401229
1141Removed limited use of spriteram_3 global. [Atari Ace]
1230Added MEC-M1 PCB layout to the dec0 driver and updated some clocks
1231and ROM names [Guru]
11421232
1143Added AM_BASE_SIZE_MEMBER() macro for specifying both base and size
1144structure members at once. Updated all cases where this could be
1145used. [Aaron Giles]
1233hng64 : Partially decodes translation-only geometry type 0102. This
1234makes the road appear in the racing games, the edge of the ring in
1235buriki, and a hallway during the buriki attract. [Andrew Gardner]
11461236
1147Cleaned up many driver data structs: [Fabio Priuli]
1148 * dropped almost completely the use of generic sizes with struct
1149    members
1150 * reduced as much as possible accesses to cputag calls during
1151    emulation (they are now mainly concentrated at MACHINE_START &
1152    DRIVER_INIT)
1237The return of the "misc" [couriersud]
1238 - Added sdlmisc_<targetos>.c again. This was necessary since
1239    certain tools create stubs for e.g. osd_break_into_debugger.
1240    If we do not have this in a separate file, the link stage may
1241    break.
1242 - Applied OS/2 patch [Credit: KO Myung-Hun]
1243 - Cleaned up #includes. Removed stdlib.h were possible.
1244 - More malloc to osd_malloc rename.
1245 - SDL monitor modes are read now when they are needed. This is now
1246    consistent across platforms.
11531247
1154Joker's Wild: bypassed the rng test [Angelo Salese]
1248GTK Debugger work [couriersud]
1249 - glade-2 can now be used again to edit the debug.glade file.
1250 - No more need to edit the files created by glade-2
1251 - All "activate" handlers now pass the parent window pointer.
1252 - malloc ==> osd_malloc to prevent mixed c++/c window allocations.
1253 - Run to cursor (main view)
1254 - In place memory editing (memory view)
1255 - implement key handling (Up, down, ..) like in windows
1256 - Tab and ESC not yet handled
1257 - Functionality now matches win32 debugger
1258 - Further code review/rewrite/simplification
1259 - Added more comment headings
1260 - fix a compile warning for gcc-4.4 (not detected by gcc-4.2)
1261 - Horizontal divider bar to individually size views.
1262 - minimum height aligned to win32 debugger
11551263
1156Joker's Wild: implemented bare minimum to allow it to go into gameplay
1157and fixed tilemap graphics [Angelo Salese]
1264ARM: preliminary SA-1110 support [R. Belmont]
11581265
1159Memory regions now use a tagmap for lookups. [Aaron Giles]
1266Verified all deco32 clocks and corrected HuC6280 clock following old
1267Charles McDonald notes I had about internal divisor. Added a note on
1268the Arm cpu used by this game: it's a Data East 101 custom
1269[Corrado Tomaselli]
11601270
1271Changed the following games to use the 76489A variant (verified on my
1272pcbs): Green Beret, Do Run Run, Mr.Do's Castle, Jail Break,
1273Shaolin's Road, Yie Ar Kung-Fu [Corrado Tomaselli]
11611274
1275Fixed sn76489a periodic noise once again (and simplified a bit of
1276code), now should be closer to or match real chips as sampled. Added
1277true clock divider emulation, so emulation may be a bit slower.
1278[Lord Nightmare, PlgDavid, Kold666]
11621279
1280Popmessages can now be used in drivers which have an MC6845.
1281[Curt Coder]
1282
1283Ensure that RAM and bitmaps are cleared when the ms32 driver is
1284started to avoid 64-bit build crashes [David Haywood]
1285
1286Converted HD63484 ACRTC to be device. [Fabio Priuli]
1287
1288hng64 : Hacks the camera to work in sams64.  [Andrew Gardner]
1289
1290Fixed crash issues with mchampdx [Fabio Priuli]
1291
1292s14001a: updated comments; got rid of the squealing noise (hidden
1293behind a #define now, code is still there) until some other issues
1294can be resolved. [Lord Nightmare]
1295
1296Dumped the proms in D-Day (Jaleco) [Chack'n, Team Japump]
1297
1298Fixed background and sprites colors in D-Day (Jaleco) [Angelo Salese]
1299
1300UI menu interface changes [couriersud]
1301 - all ui functions now expect a render_container
1302 - removed all macros referencing render_container_get_ui
1303 - ui_menu_alloc now is passed a container to which to render the menu.
1304
1305
1306
11631307New games added or promoted from NOT_WORKING status
11641308---------------------------------------------------
1165Submarine [Volker Hann, Team Europe, David Haywood, Angelo Salese]
1166Noraut Deluxe Poker (console) [Roberto Fresca, ByteMaster]
1167Noraut Joker Poker (original) [Roberto Fresca, ByteMaster]
1168Noraut Red Hot Joker Poker (alt HW) [Roberto Fresca, ByteMaster]
1169Mainline Double Joker Poker [Roberto Fresca, ByteMaster]
1170Double Joker Poker (45%-75% payout) [Roberto Fresca, ByteMaster]
1171Royal on Ten (Noraut Deluxe hack) [Roberto Fresca, ByteMaster]
1172Credit Poker (ver.30c, standard) [Roberto Fresca, ByteMaster]
1173Iron (SNES bootleg) [Tomasz Slanina, Volker Hann & Team Europe]
1309F-15 Strike Eagle (2 sets) [Phil Bennett]
1310Battle of the Solar System (rev. 1.1) [Phil Bennett]
1311Tank Battle (prototype rev. 4/21/92) [Phil Bennett]
1312Fortune I (PK485-S) Draw Poker [Jim Stolis]
1313Versus Net Soccer (5 sets) [David Haywood]
1314Island 2 (060529, banking address hack) [David Haywood]
11741315
11751316
11761317
11771318New clones added
11781319----------------
1179Cannon Ball (bootleg on Crazy Kong hardware) (set 3, no bonus game)
1180   [Volker Hann, Team Europe]
1181X-Men (4 Players ver EBA) [Irongiant]
1182Wizard of Wor (with German Language ROM) [Volker Hann]
1183Gorf (program 1, with German Language ROM) [Volker Hann]
1184Super Puzzle Fighter II Turbo (Hispanic 960531)
1185   [Artemio Urbina, David Haywood]
1320Insector X (Japan) [Gyrovision, Gatinho, Smitdogg, Dumping Union]
1321Viper Phase 1 =U.S.A= [Keven Eshbach, Dumping Union]
1322Cube Quest (12/30/83) [Bill K]
11861323
11871324
11881325
11891326New games marked as GAME_NOT_WORKING
11901327------------------------------------
1191The King of Fighters Neowave (Japan) [Cah4e3]
1192Final Furlong (FF2 Ver. A) [Guru]
1193Dragon Chronicles (DC001 Ver. A) [Guru]
1194Netchuu Pro Yakyuu 2002 (NPY1 Ver. A) [Guru]
1195Soul Calibur II (SC23 Ver. A) [Guru]
1196Soul Calibur II (SC21 Ver. A) [Guru]
1197Tekken 4 (TEF3 Ver. C) [Guru]
1198Tekken 4 (TEF2 Ver. A) [Guru]
1199Tekken 4 (TEF1 Ver. A) [Guru]
1200Mobile Suit Z-Gundam: A.E.U.G. vs Titans (ZGA1 Ver. A) [Guru]
1201Capcom Fighting Jam (JAM1 Ver. A) [Guru]
1202Quiz and Veriety Suku Suku Inufuku 2 (IN2 Ver. A) [Guru]
1203Mobile Suit Z-Gundam: A.E.U.G. vs Titans DX (ZDX1 Ver. A) [Guru]
1204Soul Calibur III (SC31001-NA-A) [Guru]
1205Kinnikuman Muscle Grand Prix (KN1 Ver. A) [Guru]
1206Taiko No Tatsujin 9 (TK91001-NA-A) [Guru]
1207Tekken 5.1 (TE51 Ver. B) [Guru]
1208Airline Pilots (Rev. A) [f205v]
1209Sega Tetris [Guru]
1210Noraut unknown set 1 (console) [Roberto Fresca, ByteMaster]
1211Noraut unknown set 2 (console) [Roberto Fresca, ByteMaster]
1212Noraut Joker Poker (V3.011a) [Roberto Fresca, Alan Griffin]
1213Poker / Black Jack (Model 7521) [Roberto Fresca]
1214Kimble Double Hi-Lo [Roberto Fresca, Alan Griffin]
1215DRHL Poker (v.2.89) [Roberto Fresca, Siftware]
1216Magic Card Jackpot (4.01)
1217   [Roberto Fresca, Team Europe, krick & The Dumping Union]
1218Magic Lotto Export (5.03)
1219   [Roberto Fresca, Team Europe, krick & The Dumping Union]
1328King Tut (Australia) [David Haywood]
1329Money Bank (Australia) [David Haywood]
1330Penguin Adventure (bootleg) [Mariusz Wojcieszek]
1331Quarter Horse Classic [Siftware, Mariusz Wojcieszek]
1332Pinkiri 8 [Gyrovision, Smitdogg, The Dumping Union]
1333Poker Ladies (Censored bootleg) [David Haywood]
1334Gundam Wing: Endless Duel (SNES bootleg)
1335   [N. Francfort, manliodp, Smitdogg, The Dumping Union]
1336Mortal Kombat 3 (bootleg of Megadrive version)
1337   [Patrick McCarron, Smitdogg, The Dumping Union]
12201338
12211339
12221340
12230.135u1
13410.136u1
12241342-------
12251343
1344IMPORTANT NOTE: As of this release of MAME, several important things
1345about the system have changed. Please read the following items before
1346attempting to compile this new version.
12261347
13481. A new tool chain for Windows, based off of gcc 4.4.3 prerelease,
1349is now REQUIRED. Go to http://mamedev.org/tools to get the new tools.
1350The updated included with 0.136u1 WILL NOT BUILD with the old tools.
1351The new tool chain has support for building 64-bit MAME builds with
1352gcc, as well as built-in DirectX headers, and C++ support, which was
1353missing from the old tools.
1354
13552. Non-Unicode builds of Windows MAME are no longer supported. The
1356options to turn this off in the makefile have been removed, and
1357future changes are likely to solidify this requirement. If you are
1358still (God forbid) running on Win9x, you will need the unicows.dll
1359library to run MAME. Download unicows from Microsoft.
1360
13613. All code in MAME is now compiled as C++, plus there have been a few
1362small changes that take advantage of the C++ language. For the most
1363part, there is no effect on how drivers are written, except for some
1364nicer accessors to devices and address spaces. Future improvements to
1365take advantage of the C++ syntax will evolve slowly, and will be done
1366internally. We are not interest in outside attempts to do this work
1367for now.
1368
13694. The SDL OSD for MAME is now shipped as part of the main source
1370package. SDL builds for Windows are now regularly built as part of the
1371validation sequence for a new release. Thanks to R. Belmont,
1372couriersud, and Olivier Galibert for their work on the SDL port over
1373the years.
1374
1375
1376
12271377MAMETesters Bugs Fixed
12281378----------------------
1229- 03535: [Documentation] 3stooges: P1-P2-P3 button does not match
1230         documentation (input (this game)) (David Haywood)
1231- 02734: [Crash/Freeze] videocba, videodad, blckjack: Crash
1232         immediately after OK (Firewave)
1233- 00941: [Sound] tp84: The startup 'tune' no longer sounds like the
1234         original game after the fixes to the SN76496 sound core.
1235         (Lord Nightmare)
1236- 03494: [Gameplay] batridc, batrid, batridk, batridu: 'Guest
1237         Player', 'Special Course', 'Player Select' dipswitch
1238         settings reversed (Fabio Priuli)
1239- 02155: [DIP/Input] mole: Incorrect buttons mapping. (M.A.S.H.)
1240- 03498: [Graphics] sengekis, sengekisj: Missing graphic layer in
1241         Stages 3 and 5 (David Haywood)
1242- 03509: [Graphics] galpans2, galpans3, panicstr: Input test screen
1243         shows zoomed in text (David Haywood)
1379- 00660: [DIP/Input] zoar: The cabinet UPRIGHT dipswitch is not
1380         working. (stephh)
1381- 03233: [Multisession] All sets in crystal.c: Multisession Crash
1382- 00111: [Crash/Freeze] gunbird2: crashes during the 4th level boss
1383         fight (North Pole) when using Vampiro. (PsikyoFan)
1384- 03649: [Crash/Freeze] gekisha: Unknown DIP 4-2 toggles Auto Tsumo
1385         after Reach. If it is enabled and declare Reach, MAME crashes.
1386         (Angelo Salese)
1387- 02154: [DIP/Input] ckongg: Coinage settings are wrong. (stephh)
1388- 02157: [DIP/Input] ckongg: Coinage settings shown on screen don't
1389         correspond to actual settings (stephh)
1390- 03653: [Graphics] crzrally, crzrallya, crzrallyg: Default high
1391         scores are incorrect (Pierpaolo Prazzoli)
1392- 03651: [Graphics] matmania: Graphical corruption (M.A.S.H.)
1393- 03620: [Speed] quasar: Massive slowdown (Quench)
1394- 03623: [Speed] laserbat, catnmous: Massive slowdown (Quench)
1395- 03621: [Interface] Hitting F6 without -cheat trigger causes crash
1396         (smf)
1397- 03626: [Graphics] raiders, spacefrt: Background star field is
1398         missing (Fabio Priuli)
1399- 03637: [Core] dino, punisher, wof and clones: NVRAM saves correctly,
1400         but doesn't reload any changes made (Fabio Priuli)
1401- 03415: [Compiling] unidasm fails to link when ldplayer is the
1402         specified target (Aaron Giles)
1403- 03485: [Graphics] mikie, mikiej, mikiehs: Possible priority issue
1404         on game completion (robiza)
1405- 00266: [Graphics] daraku: Graphic Issues at region warning and
1406         during super move. (PsikyoFan)
1407- 00892: [Misc.] s1945iii: At the very last boss, MAME popup a message
1408         (PsikyoFan)
1409- 03632: [Crash/Freeze] kinst, kinst2: Game hangs at black screen with
1410         32-bit build (Aaron Giles)
1411- 03630: [Core] Any EEPROM with an 8-bit data bus is not being saved
1412         correctly (Aaron Giles)
1413- 03622: [Graphics] solomon, solomonj: Graphics Bugs
1414         (Pierpaolo Prazzoli)
12441415
12451416
12461417
12471418Source Changes
12481419--------------
1249Updated LFO information in YMF271 core. [Brian Troha, Nicola Salmoria]
1420hng64 improvments [Andrew Gardner]
1421 - bbust2 now has 3d geometry.
1422 - fixed improperly loaded ROMs in sams64* games.
1423 - hacked 3d acknowledge in a slightly different manner. Sams64 games
1424    now show 3d.
1425- found the 'explicit palette' word in bbust2.  Colors are now correct
1426    Implemented what looks like a 'dynamic palette' bit. Fixes the
1427    colors in sams64 games, but not roadedge or buriki.
12501428
1251Fixed parent relationship between sbrkout3 and sbrkout.
1252[Lord Nightmare]
1429RSP DRC changes: [Aaron Giles]
1430 - fixed misaligned 32-bit accesses
1431 - disabled DRC_SQV implementation as it breaks music in mtetrisc
12531432
1254Removed some magic numbers from machine/psx.c, replaced with #defines.
1255[Harmony]
1433Converted RSP callbacks into device callbacks. Removed a ton of tag-
1434based queries in favor of using the device passed. [Aaron Giles]
12561435
1257Change to consistently use Intel notation for hex values in TMS32010
1258disassembler, rather than a mix of Motorola and Intel notation.
1259[Lord Nightmare]
1436Added profiler_mark() calls around rdp_process_list() so that the RDP
1437time is separated from the RSP time. [Aaron Giles]
12601438
1261Z80: Check for NOP in interrupt mode 0. This allows code like ei /
1262halt / di to work correctly. A better solution would be to implement
1263full support for arbitrary opcodes in mode 0. [Dirk Best]
1439Added more decrypted opcodes to cb2001. [robiza]
12641440
1265igs017.c update [Luca Elia]
1266 - Merged in some IGS031 based games (igs_m68.c, tarzan.c)
1267 - Implemented tiles flip x and video disable
1268 - Added hopper simulation to mgcs
1269 - Decrypted mgdh
1441Added driver data struct to cave.c. [Fabio Priuli]
12701442
1271Almost complete decryption of starzan and tarzana [iq_132]
1443Changed inline_config to be allocated separately to avoid alignment
1444issues. [Aaron Giles]
12721445
1273Documented presence of Namco customs on the Pole Position bootleg
1274(Top Racer) sets. Removed Namco devices from bootlegs which don't
1275have them. [David Haywood]
1446uPD7801 core changes: [Wilbert Pol]
1447 - Fixed incorrect disassembly of some instructions.
1448 - Updated the handling of interrupts to match the documentation.
1449 - Implemented uPD7801 timers.
1450 - Configured port A on the uPD7801 to an output port.
12761451
1277Added save state support to plygonet.c and the DSP56156 CPU core.
1278[Andrew Gardner]
1452Removed the various HAS_xxxx for sound cores. To select sound cores,
1453just choose them in the make system. Further granularity is not
1454necessary. This also means that the samples core is always required.
1455[Aaron Giles]
12791456
1280Updated SN76489/A to have correct PRNG waveforms (a 0 bit was missing
1281at the beginning, and beginning of SN76489 waveform was all 1s
1282instead of 0s as measured on hardware). Added SN94624 (same as
1283SN76489). [Lord Nightmare, plgDavid (David Viens)]
1457Base tilemap hook-up for cb2001. [Angelo Salese]
12841458
1285IGS blitter based games update [Luca Elia]
1286 - Renamed driver to igs011.c and cleaned it up
1287 - Renamed some sets according to chinese title
1288 - Implemented hopper in lhb, lhb2, wlcc
1289 - Decrypted ryukobou
1459Fixed the gfx rom loading for Race Drivin' Panorama [David Haywood]
12901460
1291i386 core fixes: [Barry Rodewald]
1292 * Added Nested Task flag, and I/O Privilege flags.  They aren't
1293    implemented in any way, but can now be set or reset.  Can be used
1294    to detect a 80386 or later CPU.
1295 * Implemented ENTER instruction.
1296 * Made IRQ vectors treated as 8 bytes when in protected mode, and
1297    made the addresses pushed onto the stack 32-bit if the gate
1298    descriptor used is a 386 interrupt or trap gate (also when in
1299    protected mode, will always be 16-bit if in real mode).
1461Vs. Net Soccer improvements:
1462 - Emulated DMA protection for startup-checks [Olivier Galibert]
1463 - Fixed Data ROM loading, game now boots [David Haywood]
1464 - Marked Sprite + Sound ROMs as BAD_DUMP [David Haywood]
13001465
1301Fixes to default mapping as well as comment/information fixes for
1302Mole Attack [M.A.S.H./Tafoid]
1466Converted the goldstar, liberate, sidearms and sidepckt drivers to use
1467driver_data [Atari Ace]
13031468
1304Identify puyoj set as Rev B and correct various rom names.
1305[Smitdogg, Dumping Union]
1469Makefile changes: [Aaron Giles]
1470 - Removed CPP_COMPILE flag; all code is now compiled as C++ except
1471    for zlib and expat
1472 - Mapped INLINE to "static inline" since C++ has real inlining
1473 - Added new 'default' make target which just builds the emulator.
1474    Use 'make tools' to build the tools, or 'make all' to build the
1475    whole thing.
1476 - 64-bit builds now get a '64' suffix on them.
1477 - Removed UNICODE flag from Windows; UNICODE is always enabled now.
1478 - If OSD is not defined, we look for the built-in Windows
1479    environment variable 'OS' and if it is set to 'Windows_NT',
1480    we assume OSD=windows; otherwise we assume OSD=sdl.
1481 - If TARGETOS is not defined, we look for the same variable
1482    and set TARGETOS=win32 if it is set to 'Windows_NT'.
1483 - Windows SDL builds have an 'sdl' prefix on the executable
1484    so they can live side-by-side.
1485 - Added cheesy auto-detection of 64-bit Windows builds (based on the
1486    PATH including 'mingw64-w64')
1487 
1488Removed hacks surrounding unicode handling in main(). They are no
1489longer necessary with the new tools. [Aaron Giles]
13061490
1307Improved Super Nova sprite shrinking, used by Gals Panic S2 and
1308Sengeki Striker. [David Haywood]
1491Fixed typo in 8-bit eeprom case that broke operation in some games.
1492[Aaron Giles]
13091493
1310Improved dips in Mahjong Vegas. [nightsoil]
1494Fixed x86 DRC backend codegen bug that broke kinst. [Aaron Giles]
13111495
1312Added emulation of background graphics (blitter), sound and inputs to
1313skimaxx.c [Luca Elia]
1496Got rid of setjmp/longjmp for error handling in favor of exceptions.
1497Fatalerror now maps to throwing an exception. [Aaron Giles]
13141498
1315Refactored Z80, i8237, and i8257 DMA to use devcb. [Curt Coder]
1499[PIT8253] Update PIT counter even if there was no elapsed cycles (this
1500only affects fast drivers like at586 in MESS). [Miodrag Milanovic]
13161501
1317Fixed RGB555 palette RAM format in Soccer Superstars [Angelo Salese]
1502Fixed a bunch of minor quirks, and fixed gfxs in the dwarfd driver.
1503[Angelo Salese]
13181504
1319Allowed child CPUs to be used in read8/write8 callbacks. [Curt Coder]
1505Changed berlwall, arkanoid, bakubrkr, mgcrystl to use YM2149.
1506[Corrado Tomaselli]
13201507
1321Jaleco Mega System 32 update: [David Haywood]
1322 * Added correct RAM sizes as per Charles McDonald's notes
1323 * Implemented priority in the same manner as tetrisp2
1324 * Add shadows via custom mixing (gametngk and tetrisp / tp2m32 are
1325    much improved)
1326 * Added the alt tilemap layout used by f1superb for the backgrounds
1327 * Added f1superb notes and IRQ generation code from nuapete
1508Verified and corrected clocks in halleys and exctsccr.
1509[Corrado Tomaselli]
13281510
1329Tournament Solitaire (pcat_dyn) improvements [luigi30]:
1330 * Added newer version of toursol, renamed existing to toursol1 and
1331    the new one is now toursol
1332 * Set toursol date to 1995
1333 * Set toursol CPU speed to 40MHz
1511Add support for Mahjong panel for mjgtaste. Makes this the default
1512input and alters the default eeprom accordingly to match factory
1513default. Note that you need to change both the game and the controller
1514setting from the driver configuration when switching input sources
1515since the two are mutually exclusive. [PsikyoFan]
13341516
1335Many improvements to konamigx rendering, specifically improving
1336Soccer Superstars and Rushing Hero. [David Haywood, Angelo Salese]
1517Fix zeroize protection simulation in lieu of proper dongle dump.
1518[Bryan McPhail]
13371519
1338Implemented input buffer copy protection in Rushing Heroes, game is
1339now somewhat playable with heavy gfx glitches [Angelo Salese]
1520Adds missing sample rom to Gals Panic 4 (Korea)
1521[Brian Troha, Dumping Union]
13401522
1341Fixed Konami GX type 4 protection seed $d15, used to protect a sprite
1342bank in Run & Gun 2 / Slam Dunk 2 [Angelo Salese]
1523misc Konami wip: [Fabio Priuli]
1524 * moved a few routines (used for sorting graphics layers) to
1525    konicdev.c since they are shared by several drivers
1526 * added driver data struct to ajax.c and aliens.c
1527 * added driver data struct + save states to: asterix.c, bishi.c,
1528    blockhl.c, bottom9.c, chqflag.c, crimfght.c, dbz.c, gbusters.c,
1529    gijoe.c, lethal.c, mainevt.c, moo.c, overdriv.c, parodius.c,
1530    rollerg.c, rungun.c, simpsons.c, spy.c, surpratk.c, tail2nos.c,
1531    thunderx.c, tmnt.c, ultraman.c, vendetta.c, xexex.c and xmen.c
1532 * updated some Konami drivers above to separately allocate palette/
1533    extra/work RAM instead of appending them to maincpu ROM; also,
1534    reduced maincpu rom regions where appropriate
1535 * replaced memory_set_bankptr with memory_set_bank where necessary
1536 * added driver data struct & save states to gradius3.c
13431537
1344Fixed sprite ROM loading in Slam Dunk 2 [David Haywood]
1538Converted taitosnd (aka tc0140syt) to be a device and updated the
1539related drivers to use the new code. [Fabio Priuli]
13451540
1346Added missing BLTZAL opcode to the RSP core. [angrylion]
1541Replaced all occurrences of cputag_get_cpu with devtag_get_device:
1542the former function was just an alias and now cpus are no different
1543from other devices. Also removed cputag_get_cpu and cputag_reset
1544(another alias, not even used in the source) from cpuexec.h.
1545[Fabio Priuli]
13471546
1348Control fix for Strike Gunner S.T.G. to allow a 3rd button mapping
1349for each player - thus allowing for the feature of merging ships in 2
1350player games. [Tafoid]
1547Fixed knights rom labels [Dlfrsilver]
13511548
1352Marked cosmic alien colors as wrong, added TODO to the driver for
1353fixing colors. Added new XTAL value for cosmic alien and switched
1354driver to use it. [Lord Nightmare]
1549Metal Maniax improvements [Phil Bennett/luigi30]
1550 * Fixed frame buffer display
1551 * Started to add the other CPUs
1552 * Added PCB layouts for layers 1 and 2
1553 * Hooked up TMS34020
1554 * Started to implement the ADSP-2105 network CPU and the CAGE audio
1555    system [Phil Bennett]
13551556
1356Fixed colors in Greyhound games [Mariusz Wojcieszek]
1557Added some missing header declarations and static qualifiers. Added
1558validity.h to the core for consistency as well as an explicit foo.h
1559in each foo.c. [Atari Ace]
13571560
1358Restored Final Gorodi and Wyvern Wings to working. [Brian Troha]
1561Added driver data struct to taitoair.c and taito_b.c. [Fabio Priuli]
13591562
1360Fixed gfx decoding and hooked up mc6845 in the Forte Card driver
1361[Angelo Salese]
1563VIA6522: Refactored interface to use READ/WRITE_LINE. [Curt Coder]
13621564
1363Removed dual layout, added Map base video register and fixed
1364transparent issues in the Jackpot Cards driver [Angelo Salese]
1565Cyber Tank improvements: [Angelo Salese]
1566 * Fixed bitplane order
1567 * Decoded sprite gfx format
1568 * Hooked up the two bg tilemaps
1569 * Wrote bare-bones video emulation for the Cyber Tank sprite chip /
1570    blitter
1571 * Added video boundary checks for the blitter
13651572
1366MC680x0 update: [R. Belmont]
1367 - Reworked PMMU/core interface so PMMU now sees all cop 0
1368    instructions
1369 - Improved disassembly of PMMU instructions
1370 - Preliminary 68LC040 support
1371 - Fixed disassembly for EC/LC variants of '030/'040
1573The starting value for an output port is now the default value, which
1574is based on whether it is active high or low. So the device will be
1575called the first time the line becomes active. Changed the eeprom
1576device to assume that the reset and clock are cleared until it's told
1577otherwise. [smf]
13721578
1373Patched NVRAM check in Jackpot Cards, makes the game playable but you
1374cannot save settings so it's not yet working. [Angelo Salese]
1579Added driver data struct to taito_l.c & opwolf.c. [Fabio Priuli]
13751580
1376Trashed the old pre-accurate-clocking STEP based sample averaging
1377scheme from sn76489 and friends, vastly simplifying the code. Made
1378the output bipolar rather than only above the 0 line. Added missing
1379statement to the get_safe_token function for the recently added
1380SN94624. [Lord Nightmare]
1581Added driver data struct + save states to asuka.c (cadash was not
1582supporting saves), rainbow.c, rastan.c, taito_f2.c, taito_h.c,
1583taito_o.c, taito_z.c, topspeed.c & volfied.c. [Fabio Priuli]
13811584
1382Many N64 RDP fixes.
1383[angrylion, Ziggy, Gonetz, Orkin, DrgnMndd, Harmony]
1585Renamed mamecore.h -> emucore.h. [Aaron Giles]
13841586
1385Cleaned up toaplan2 V25 support, enabled Batsugun V25 and added
1386decryption table info for the other games [David Haywood]
1587New C++-aware memory manager: [Aaron Giles]
13871588
1388Improved the V25S memory map in Batsugun, now CPUs starts to
1389communicate properly, needs to find & implement the irq that clears
1390the RAM flag and decrypt the relative opcodes in that. [Angelo Salese]
1589  This is a simple manager that allows you to add any type of object
1590  to a resource pool. Most commonly, allocated objects are added, and
1591  so a set of allocation macros is provided to allow you to manage
1592  objects in a particular pool:
13911593
1392More Greyhound improvements: [Mariusz Wojcieszek]
1393 - added dip switches for Super Poker
1394 - improved inputs in Sports Authority
1594    pool_alloc(p, t) = allocate object of type 't' and add to pool 'p'
1595    pool_alloc_clear(p, t) = same as above, but clear the memory first
1596    pool_alloc_array(p, t, c) = allocate an array of 'c' objects of
1597                                type 't' and add to pool 'p'
1598    pool_alloc_array_clear(p, t, c) = same, but with clearing
1599    pool_free(p, v) = free object 'v' and remove it from the pool
13951600
1396Expanded some sound chip tags to specifically indicate they are sound
1397chips (generally, "ay" becomes "aysnd", "fm" becomes "fmsnd", etc)
1398[Aaron Giles]
1601  Note that pool_alloc[_clear] is roughly equivalent to "new t" and
1602  pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also
1603  note that pool_free works for single objects and arrays.
13991604
1400MIPS3 TLB fixes: [Aaron Giles]
1401 - now properly generating TLB fill exceptions under correct
1402    circumstances
1403 - TLB exceptions no longer trash low 4 bits of Context
1404 - exceptions with the EXL bit set always go to vector 0x180
1405 - fixed bug in vtlb code that caused us to lose track of previously
1406    registered fixed page ranges
1407 - fixed MIPS3 behavior that would not clear out invalid page ranges
1408    from the VTLB under certain circumstances
1409 - added support for TLB sizes less than 48 entries
1410 - fix TLBMOD exceptions so they also properly set BadVAddr
1605  There is a single global_resource_pool defined which should be used
1606  for any global allocations. It has equivalent macros to the pool_*
1607  macros above that automatically target the global pool.
14111608
1412Added NCR7496 variant to sn76496.c. Updated comments to show which
1413chips are currently verified. Cleaned up comments. [Lord Nightmare]
1609  In addition, the memory module defines global new/delete overrides
1610  that access file and line number parameters so that allocations can
1611  be tracked. Currently this tracking is only done if MAME_DEBUG is
1612  enabled. In debug builds, any unfreed memory will be printed at
1613  the end of the session.
14141614
1415Fixed the 64-bit crashing issues in N64 [Harmony]
1615  emualloc.h also has #defines to disable malloc/free/realloc/calloc.
1616  Since emualloc.h is included by emucore.h, this means pretty much
1617  all code within the emulator is forced to use the new allocators.
1618  Although straight new/delete do work, their use is discouraged, as
1619  any allocations made with them will not be tracked.
14161620
1417Fixed out-of-bounds array accesses in the peplus and videopkr drivers
1418[Oliver Stoeneberg]
1621  Changed the familar auto_alloc_* macros to map to the resource pool
1622  model described above. The running_machine is now a class and
1623  contains a resource pool which is automatically destructed upon
1624  deletion. If you are a driver writer, all your allocations should be
1625  done with auto_alloc_*.
14191626
1420Merged findout.c and getrivia.c into gei.c [Mariusz Wojcieszek]
1627  Changed all drivers and files in the core using malloc/realloc or
1628  the old alloc_*_or_die macros to use (preferably) the auto_alloc_*
1629  macros instead, or the global_alloc_* macros if necessary.
14211630
1422Fixed broken DRC logging. [Aaron Giles]
1631  Added simple C++ wrappers for astring and bitmap_t, as these need
1632  proper constructors/destructors to be used for auto_alloc_astring
1633  and auto_alloc_bitmap.
14231634
1424Fix PowerPC 603 translation so it doesn't get stuck in an infinite
1425loop after the first fixup. [Aaron Giles]
1635  Removed references to the winalloc prefix file. Most of its
1636  functionality has moved into the core, save for the guard page
1637  allocations, which are now implemented in osd_alloc and osd_free.
14261638
1427Added driver data struct and save state support to pandoras.c,
1428marineb.c, m10.c, m14.c, m52.c, m57.c, m58.c, m62.c, m63.c,
1429travrusa.c, adp.c, n8080.c, atarifb.c, astinvad.c, avalnche.c,
1430battlex.c, carjmbre.c, popper.c, spaceg.c, bankp.c, battlane.c,
1431blockade.c, blueprnt.c, brkthru.c bsktball.c, hexa.c
1639Added driver data struct + save states to darius.c & othunder.c.
14321640[Fabio Priuli]
14331641
1434Added driver data struct to espial.c, zodiack.c, 4enraya.c, 1942.c,
14351943.c, ace.c, albazc.c, arabian.c, aeroboto.c, astrof.c, ambush.c
1436angelkds.c, arkanoid.c. [Fabio Priuli]
1642Added driver data struct to ninjaw.c, slapshot.c, warriorb.c, wgp.c.
1643[Fabio Priuli]
14371644
1438Replaced model3.c fatalerror() calls with development-friendly
1439logerror() calls. Also allows dayto2pe to boot again. [Phil Bennett]
1645Extended the astring class wrapper into something useful, and
1646useable as a stack object. Also designed the interfaces to allow
1647for chaining operations. And added a casting operator to const
1648char * for seamless use in most functions that take plain old C
1649strings. [Aaron Giles]
14401650
1441hng64: Improved the Samurai Shodown 64 2 i/o simulation comms, now
1442inputs works and enters into proper gameplay. [Angelo Salese]
1651Changed all uses of astring to use the object directly on the
1652stack or embedded in objects instead of explicitly allocating
1653and deallocating it. Removed a lot of annoying memory management
1654code as a result. [Aaron Giles]
14431655
1444Merged some include files and merged audio/fghtbskt.c in
1445drivers/m63.c. [Fabio Priuli]
1656Changed interfaces that accepted/returned an astring * to
1657use an astring & instead. [Aaron Giles]
14461658
1447Got rid of SN76496's R->OldNoise since it causes problems for
1448gamegear/sms. Changed noise taps accordingly. Redid change to
1449gamegear/sms for XOR vs XNOR, now verified by Justin Kerk. Verified
1450gamegear noise taps thanks to sample provided by Justin Kerk.
1451Add stereo sound support to sn76496.c for gamegear.
1452[Lord Nightmare, Justin Kerk]
1659Removed auto_alloc_astring(machine). Use auto_alloc(machine, astring)
1660instead. [Aaron Giles]
14531661
1454Added a MDRV_EEPROM_NODEFAULT_ADD macro for drivers which do not need
1455default data size / data. [Fabio Priuli]
1662Major header file cleanup: [Aaron Giles]
1663 - Created new central header "emu.h"; this should be included
1664    by pretty much any driver or device as the first include. This
1665    file in turn includes pretty much everything a driver or device
1666    will need, minus any other devices it references. Note that
1667    emu.h should *never* be included by another header file.
1668 - Updated all files in the core (src/emu) to use emu.h.
1669 - Removed a ton of redundant and poorly-tracked header includes
1670    from within other header files.
1671 - Temporarily changed driver.h to map to emu.h until we update
1672    files outside of the core.
14561673
1457Updated 20pacgal to use EEPROM device. Proper save state support still
1458needs some work (to handle the rom banking mechanism). [Fabio Priuli]
1674Added class wrapper around tagmap so it can be directly included
1675and accessed within objects that need it. Updated all users to
1676embed tagmap objects and changed them to call through the class.
1677[Aaron Giles]
14591678
1460Updated galgbios to use EEPROM_NODEFAULT. [Fabio Priuli]
1679Added nicer functions for finding devices, ports, and regions in
1680a machine: [Aaron Giles]
14611681
1462Added PORT_CUSTOM(eepromdev_bit_r) for EEPROM devices. [Fabio Priuli]
1682   machine->device("tag") -- return the named device, or NULL
1683   machine->port("tag") -- return the named port, or NULL
1684   machine->region("tag") -- return the named region
14631685
1464Fixed wrong order parameters in memset (spotted by Beledgol).
1465[Fabio Priuli]
1686(Note that machine->region() returns a pointer to a region_info class
1687which describes a region, not a pointer to the region's memory.)
14661688
1467Verified/changed clocks and vsyncs on the following games:
1468Aerofighters (only vsync), Power Spikes, Turbo Force (only vsync),
1469Guzzler/Swimmer (same pcb), Exerion and Karate Champs Vs.
1689Made the device tag an astring. This required touching a lot of
1690code that printed the device to explicitly fetch the C-string
1691from it. (Thank you gcc for flagging that issue!) [Aaron Giles]
1692
1693Added a PCM sample end/loop callback to the RF5C68 core
1694[Barry Rodewald]
1695
1696galaxold update: [stephh]
1697 - Renamed set kkgalax to ckongmc
1698 - Changed descriptions for ckongg and ckongmc
1699 - Fixed dip switches and inputs for ckongg and ckongmc
1700 - Updated ckongmc memory map
1701
1702Added the mameconfig version to the -listxml output [Oliver Stoneberg]
1703
1704Implemented inputs and sound in Gunpey [Luca Elia]
1705
1706Added new member function space() to the device_config, along with
1707shorter constants to be used (AS_PROGRAM, AS_DATA, AS_IO). With no
1708parameters, space() returns the first address space, which is
1709commonly the only space present. Updated a few devices that referenced
1710the old space[] array to call the new function instead. [Aaron Giles]
1711
1712Implemented basic blitter support in Gunpey [Tomasz Slanina]
1713
1714Converted Gunpey to use RGB pens instead of hardcoded palette table
1715[Angelo Salese]
1716
1717Enforce that numbers are all the same exact width when loading fonts.
1718[Aaron Giles]
1719
1720Fixed a bogus protection check in Victor 21 [Angelo Salese]
1721
1722Fix assert for prmrsocr + clones - no whatsnew needed [Fabio Priuli]
1723
1724Redumped program and sprite roms in Cyber Tank [Antonio Gonzalez Jr.]
1725
1726Added a mostly-complete SunPlus u'nSP core based on the one in
1727Segher's "Unununium". [Harmony]
1728
1729Add lots of comments relating to 56-pin Mahjong interface and Psikyo
1730SK-G001 interface pcb based on discussion with alien_mame and
1731documents from other Mahjong PCBs. [PsikyoFan]
1732
1733Verified clocks on Poker Ladies and changed Z80 clock of Mahjong
1734Gakuen from 6Mhz to 8MHz to match the other Mitchell hardware games
14701735[Corrado Tomaselli]
14711736
1472hng64: rewrote the MCU simulations, basically to be more clean than
1473before [Angelo Salese]
1737i386: Improved accuracy of the various emulated models, makes CPU
1738detection programs detect the correct CPU (in MESS). [Dirk Best]
1739 - eflags mask added
1740 - Initial values for the EAX and EDX registers fixed
1741 - cpuid values improved
1742 - feature flags improved
1743 - initial value for the cr0 register improved
1744 - changed 486 to not support the cpuid instruction by default
1745 - take a trap on invalid instructions instead of throwing a
1746    fatalerror
1747 - emulated the undefined flag behavior for the DIV/IDIV instructions on Intel CPUs
14741748
1475hng64: improved MCU simulation and added inputs in Beast Busters 2nd
1476Nightmare, it can now reach gameplay mode too [Angelo Salese]
1749SDLMAME: improved OS X and SDL 1.3 SVN support, try to autodetect
1750SDLMAME targets [Couriersud]
14771751
1478hng64: removed Program Counter-based routines in Samurai Shodown 64
14791/2, this fixes the first episode that can now be coined up, however
1480it hangs soon after that [Angelo Salese]
1752SDLMAME: add BGRA support to -video soft [couriersud]
14811753
1482Renamed drw80pkr to drw80pk2. Appears to be later version and MN
1483jurisdiction specific. [Jim Stolis]
1754Fixed period for both sn76489 and sn76489A periodic noise; fixes
1755pitch in 'smooth criminal' demo for colecovision and fixes pitch
1756(but not the waveform, which will require more work) of music in
1757dorunrun; More work is required before the code will be bit accurate
1758due to the way the real LFSR and periodic generator work.
1759[Lord Nightmare, Kold666, PlgDavid]
14841760
1485Replaced drw80pkr with older dump from [Team Europe].
1761SDLMAME makefile improvements: [couriersud]
1762 - Fix TARGETOS detection on OS X.
1763 - Do not try to check TARGETOS when cross-compiling
1764 - For non-windows targets, try to auto-detect PTR64
1765 - testkeys now builds again
1766 - for unix targets, added a depend rule to sdl.mak which builds a
1767    .depend file.
14861768
1487Added various graphics improvements and corrected colors to drw80pkr.
1488Game boots much farther and cleaner. Additional graphics/memory
1489cleanup and preliminary input support [Jim Stolis]
1769Fixed a number of compiler bugs found by PowerPC MacOS X. [R. Belmont]
14901770
1491hng64: work-around to get to the character screen in Samurai Shodown
149264, hangs again after it [Angelo Salese]
1771Added casting operators to the region_info class so you can assign
1772a region to a generic type pointer and have it automatically convert.
1773Also added a bytes() method which is safe if the region is NULL
1774(useful for saying machine->region("foo")->bytes() and not crashing
1775if foo doesn't exist). [Aaron Giles]
14931776
1494Added driver_data struct to appoooh.c and boxer.c. Also merged boxer
1495video emulation into drivers/boxer.c. [Fabio Priuli]
1777Changed the region field in the device_config to be a region_info *,
1778and removed the regionbytes field. Updated all users of these fields
1779to use the new casting operators and bytes() methods instead.
1780[Aaron Giles]
14961781
1497Added dual screen output to the Konami GX Type 3/4 games
1498[David Haywood]
1782Added subdevice and subregion methods to the device_config class, so
1783you can easily query for devices and regions that are device-specific.
1784The device prefix ("devicename:") is automatically prepended.
1785[Aaron Giles]
14991786
1500Fixed possible NULL pointer dereference in video/dec0.c
1501[Oliver Stoneberg]
1787YM2612: More accurate LFO implementation and channel clipping
1788[Eke-Eke, Nemesis, R. Belmont]
15021789
1503Added save states to bionicc.c. [Fabio Priuli]
15041790
15051791
1506
15071792New games added or promoted from NOT_WORKING status
15081793---------------------------------------------------
1509Mahjong Super Da Man Guan II
1510   [Luca Elia, Pierpaolo Prazzoli, Guru, Xing Xing]
1511Mahjong Man Guan Da Heng [Luca Elia, Guru, The Dumping Union]
1512Touche Me [David Haywood, Justin Kerk, JacKc, Sez, The tECHIDNA, Smitdogg, The Dumping Union]
1513Skimaxx [Luca Elia, Phil Bennett]
1514Dream 9 Final [Angelo Salese, David Haywood]
1515Soccer Superstars [David Haywood, Angelo Salese]
1516Rushing Heroes [David Haywood, Angelo Salese]
1517Run & Gun 2 [David Haywood, Angelo Salese]
1518Super Poker [Mariusz Wojcieszek]
1519GEI Multi Game [Mariusz Wojcieszek]
1520Sport Authority [Mariusz Wojcieszek]
1521Oh! Paipee [Takahiro Nogi]
1522Tougenkyou [Takahiro Nogi]
1794Second Chance [Siftware]
1795Multi Game (Tung Sheng Electronics) [Mariusz Wojcieszek]
15231796
15241797
15251798
15261799New clones added
15271800----------------
1528Super Street Fighter II: The New Challengers (Hispanic 930911)
1529    [Artemio]
1530Silent Scope (JZD) (not working) [Guru}
1531Tarzan (V107) (not working) [iq_132]
1532Mahjong Ryukobou (Japan, V030J) [Luca Elia, Guru, Dyq, Bnathan]
1533Ultimate Tennis (Japan) [David Haywood, Aaron Giles, N. Alston, Smitdogg, The Dumping Union]
1534The Big Breakfast (5 sets) [AGEMAME Development]
1535Gals Panic S - Extra Edition (Korea) [Choi Sung Ho]
1536Light Bringer (Ver 2.20 1994/04/08) [Choi Sung Ho]
1537Mad Crusher (Japan) [David Haywood, Andrew Welburn]
1538Cosmic Alien (first version) [Andrew Welburn, Lord Nightmare]
1539Dungeons & Dragons: Shadow over Mystara (Hispanic 960223)
1540   [Artemio Urbina, David Haywood]
1541Mega Man 2: The Power Fighters (Hispanic 960712)
1542   [Artemio Urbina, David Haywood]
1543Last Duel (Japan) [Chack'n, Team Japump!!!]
1544Joker Poker (Version 16.04BI 10-19-88, Joker Poker ICB 9-30-86)
1545   [Mariusz Wojcieszek]
1546Joker Poker (Version 16.03BI 5-10-85, Poker No Raise ICB 9-30-86)
1547   [Mariusz Wojcieszek]
1548Amuse (Version 30.08 IBA) [Mariusz Wojcieszek]
1549R-Type II (Japan, revision C) [Andrew Welburn]
1550Popeye Man (hack) [Team Japump!!!]
1551Steraranger (Moon Cresta bootleg) [Siftware]
1801Exciting Soccer (Japan set 2) [Corrado Tomaselli]
1802Super Bar [Brian Troha, David Haywood, Dumping Union]
1803Mega Blast (US) [D. Beneke, hap, Smitdogg, Dumping Union]
15521804
15531805
15541806
15551807New games marked as GAME_NOT_WORKING
15561808------------------------------------
1557Super Tarzan [f205v, Mirko Buffoni, iq_132]
1558Mahjong Nenrikishu SP [Guru, Dyq, Bnathan]
1559Print Club 2 (U 970921 V1.000) [Guru, Angelo Salese]
1560Print Club 2 Vol. 3 (U 990310 V1.000) [Guru, Angelo Salese]
1809Fun Station Spielekoffer 9 Spiele [Tomasz Slanina]
1810Vega [David Haywood]
1811Monza GP [Tomasz Slanina]
1812Quarter Horse [Ruben Panossian, Angelo Salese]
1813Vortex [tormod, Team Europe, Smitdogg, The Dumping Union]
1814Bega's Battle [Angelo Salese]
1815Computer Quiz Atama no Taisou [Chack'n, Team Japump]
1816Track & Field (NZ Bootleg?) [Siftware, Tafoid]
1817
No newline at end of file

Previous 15994 Revisions Next


© 1998-2018 The MESS Team